@linkurious/ogma-linkurious-parser 4.3.7 → 4.3.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@linkurious/rest-client"),mr=require("@linkurious/ogma"),Sr=require("rxjs");var Q=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Re(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Cr(){this.__data__=[],this.size=0}var Ar=Cr;function Er(r,e){return r===e||r!==r&&e!==e}var Me=Er,xr=Me;function Fr(r,e){for(var t=r.length;t--;)if(xr(r[t][0],e))return t;return-1}var le=Fr,Tr=le,$r=Array.prototype,Nr=$r.splice;function Dr(r){var e=this.__data__,t=Tr(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():Nr.call(e,t,1),--this.size,!0}var wr=Dr,Or=le;function Lr(r){var e=this.__data__,t=Or(e,r);return t<0?void 0:e[t][1]}var Ir=Lr,Pr=le;function Rr(r){return Pr(this.__data__,r)>-1}var Mr=Rr,Gr=le;function Br(r,e){var t=this.__data__,i=Gr(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}var zr=Br,Ur=Ar,jr=wr,Vr=Ir,kr=Mr,Hr=zr;function U(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}U.prototype.clear=Ur;U.prototype.delete=jr;U.prototype.get=Vr;U.prototype.has=kr;U.prototype.set=Hr;var de=U,Kr=de;function qr(){this.__data__=new Kr,this.size=0}var Yr=qr;function Wr(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var Jr=Wr;function Zr(r){return this.__data__.get(r)}var Xr=Zr;function Qr(r){return this.__data__.has(r)}var ei=Qr,ti=typeof Q=="object"&&Q&&Q.Object===Object&&Q,Bt=ti,ri=Bt,ii=typeof self=="object"&&self&&self.Object===Object&&self,ni=ri||ii||Function("return this")(),w=ni,si=w,ai=si.Symbol,W=ai,Je=W,zt=Object.prototype,oi=zt.hasOwnProperty,ui=zt.toString,K=Je?Je.toStringTag:void 0;function li(r){var e=oi.call(r,K),t=r[K];try{r[K]=void 0;var i=!0}catch{}var n=ui.call(r);return i&&(e?r[K]=t:delete r[K]),n}var di=li,ci=Object.prototype,gi=ci.toString;function hi(r){return gi.call(r)}var fi=hi,Ze=W,pi=di,bi=fi,yi="[object Null]",vi="[object Undefined]",Xe=Ze?Ze.toStringTag:void 0;function _i(r){return r==null?r===void 0?vi:yi:Xe&&Xe in Object(r)?pi(r):bi(r)}var J=_i;function mi(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var ce=mi,Si=J,Ci=ce,Ai="[object AsyncFunction]",Ei="[object Function]",xi="[object GeneratorFunction]",Fi="[object Proxy]";function Ti(r){if(!Ci(r))return!1;var e=Si(r);return e==Ei||e==xi||e==Ai||e==Fi}var Ut=Ti,$i=w,Ni=$i["__core-js_shared__"],Di=Ni,_e=Di,Qe=function(){var r=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function wi(r){return!!Qe&&Qe in r}var Oi=wi,Li=Function.prototype,Ii=Li.toString;function Pi(r){if(r!=null){try{return Ii.call(r)}catch{}try{return r+""}catch{}}return""}var jt=Pi,Ri=Ut,Mi=Oi,Gi=ce,Bi=jt,zi=/[\\^$.*+?()[\]{}|]/g,Ui=/^\[object .+?Constructor\]$/,ji=Function.prototype,Vi=Object.prototype,ki=ji.toString,Hi=Vi.hasOwnProperty,Ki=RegExp("^"+ki.call(Hi).replace(zi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qi(r){if(!Gi(r)||Mi(r))return!1;var e=Ri(r)?Ki:Ui;return e.test(Bi(r))}var Yi=qi;function Wi(r,e){return r==null?void 0:r[e]}var Ji=Wi,Zi=Yi,Xi=Ji;function Qi(r,e){var t=Xi(r,e);return Zi(t)?t:void 0}var M=Qi,en=M,tn=w,rn=en(tn,"Map"),Ge=rn,nn=M,sn=nn(Object,"create"),ge=sn,et=ge;function an(){this.__data__=et?et(null):{},this.size=0}var on=an;function un(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var ln=un,dn=ge,cn="__lodash_hash_undefined__",gn=Object.prototype,hn=gn.hasOwnProperty;function fn(r){var e=this.__data__;if(dn){var t=e[r];return t===cn?void 0:t}return hn.call(e,r)?e[r]:void 0}var pn=fn,bn=ge,yn=Object.prototype,vn=yn.hasOwnProperty;function _n(r){var e=this.__data__;return bn?e[r]!==void 0:vn.call(e,r)}var mn=_n,Sn=ge,Cn="__lodash_hash_undefined__";function An(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Sn&&e===void 0?Cn:e,this}var En=An,xn=on,Fn=ln,Tn=pn,$n=mn,Nn=En;function j(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}j.prototype.clear=xn;j.prototype.delete=Fn;j.prototype.get=Tn;j.prototype.has=$n;j.prototype.set=Nn;var Dn=j,tt=Dn,wn=de,On=Ge;function Ln(){this.size=0,this.__data__={hash:new tt,map:new(On||wn),string:new tt}}var In=Ln;function Pn(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var Rn=Pn,Mn=Rn;function Gn(r,e){var t=r.__data__;return Mn(e)?t[typeof e=="string"?"string":"hash"]:t.map}var he=Gn,Bn=he;function zn(r){var e=Bn(this,r).delete(r);return this.size-=e?1:0,e}var Un=zn,jn=he;function Vn(r){return jn(this,r).get(r)}var kn=Vn,Hn=he;function Kn(r){return Hn(this,r).has(r)}var qn=Kn,Yn=he;function Wn(r,e){var t=Yn(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}var Jn=Wn,Zn=In,Xn=Un,Qn=kn,es=qn,ts=Jn;function V(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}V.prototype.clear=Zn;V.prototype.delete=Xn;V.prototype.get=Qn;V.prototype.has=es;V.prototype.set=ts;var Be=V,rs=de,is=Ge,ns=Be,ss=200;function as(r,e){var t=this.__data__;if(t instanceof rs){var i=t.__data__;if(!is||i.length<ss-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new ns(i)}return t.set(r,e),this.size=t.size,this}var os=as,us=de,ls=Yr,ds=Jr,cs=Xr,gs=ei,hs=os;function k(r){var e=this.__data__=new us(r);this.size=e.size}k.prototype.clear=ls;k.prototype.delete=ds;k.prototype.get=cs;k.prototype.has=gs;k.prototype.set=hs;var Vt=k,fs="__lodash_hash_undefined__";function ps(r){return this.__data__.set(r,fs),this}var bs=ps;function ys(r){return this.__data__.has(r)}var vs=ys,_s=Be,ms=bs,Ss=vs;function ie(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new _s;++e<t;)this.add(r[e])}ie.prototype.add=ie.prototype.push=ms;ie.prototype.has=Ss;var Cs=ie;function As(r,e){for(var t=-1,i=r==null?0:r.length;++t<i;)if(e(r[t],t,r))return!0;return!1}var Es=As;function xs(r,e){return r.has(e)}var Fs=xs,Ts=Cs,$s=Es,Ns=Fs,Ds=1,ws=2;function Os(r,e,t,i,n,s){var a=t&Ds,o=r.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var d=s.get(r),c=s.get(e);if(d&&c)return d==e&&c==r;var h=-1,f=!0,v=t&ws?new Ts:void 0;for(s.set(r,e),s.set(e,r);++h<o;){var S=r[h],b=e[h];if(i)var x=a?i(b,S,h,e,r,s):i(S,b,h,r,e,s);if(x!==void 0){if(x)continue;f=!1;break}if(v){if(!$s(e,function($,N){if(!Ns(v,N)&&(S===$||n(S,$,t,i,s)))return v.push(N)})){f=!1;break}}else if(!(S===b||n(S,b,t,i,s))){f=!1;break}}return s.delete(r),s.delete(e),f}var kt=Os,Ls=w,Is=Ls.Uint8Array,Ps=Is;function Rs(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}var Ms=Rs;function Gs(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var Bs=Gs,rt=W,it=Ps,zs=Me,Us=kt,js=Ms,Vs=Bs,ks=1,Hs=2,Ks="[object Boolean]",qs="[object Date]",Ys="[object Error]",Ws="[object Map]",Js="[object Number]",Zs="[object RegExp]",Xs="[object Set]",Qs="[object String]",ea="[object Symbol]",ta="[object ArrayBuffer]",ra="[object DataView]",nt=rt?rt.prototype:void 0,me=nt?nt.valueOf:void 0;function ia(r,e,t,i,n,s,a){switch(t){case ra:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case ta:return!(r.byteLength!=e.byteLength||!s(new it(r),new it(e)));case Ks:case qs:case Js:return zs(+r,+e);case Ys:return r.name==e.name&&r.message==e.message;case Zs:case Qs:return r==e+"";case Ws:var o=js;case Xs:var l=i&ks;if(o||(o=Vs),r.size!=e.size&&!l)return!1;var d=a.get(r);if(d)return d==e;i|=Hs,a.set(r,e);var c=Us(o(r),o(e),i,n,s,a);return a.delete(r),c;case ea:if(me)return me.call(r)==me.call(e)}return!1}var na=ia;function sa(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}var Ht=sa,aa=Array.isArray,T=aa,oa=Ht,ua=T;function la(r,e,t){var i=e(r);return ua(r)?i:oa(i,t(r))}var da=la;function ca(r,e){for(var t=-1,i=r==null?0:r.length,n=0,s=[];++t<i;){var a=r[t];e(a,t,r)&&(s[n++]=a)}return s}var ga=ca;function ha(){return[]}var fa=ha,pa=ga,ba=fa,ya=Object.prototype,va=ya.propertyIsEnumerable,st=Object.getOwnPropertySymbols,_a=st?function(r){return r==null?[]:(r=Object(r),pa(st(r),function(e){return va.call(r,e)}))}:ba,ma=_a;function Sa(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}var Ca=Sa;function Aa(r){return r!=null&&typeof r=="object"}var Z=Aa,Ea=J,xa=Z,Fa="[object Arguments]";function Ta(r){return xa(r)&&Ea(r)==Fa}var $a=Ta,at=$a,Na=Z,Kt=Object.prototype,Da=Kt.hasOwnProperty,wa=Kt.propertyIsEnumerable,Oa=at(function(){return arguments}())?at:function(r){return Na(r)&&Da.call(r,"callee")&&!wa.call(r,"callee")},ze=Oa,ne={exports:{}};function La(){return!1}var Ia=La;ne.exports;(function(r,e){var t=w,i=Ia,n=e&&!e.nodeType&&e,s=n&&!0&&r&&!r.nodeType&&r,a=s&&s.exports===n,o=a?t.Buffer:void 0,l=o?o.isBuffer:void 0,d=l||i;r.exports=d})(ne,ne.exports);var qt=ne.exports,Pa=9007199254740991,Ra=/^(?:0|[1-9]\d*)$/;function Ma(r,e){var t=typeof r;return e=e??Pa,!!e&&(t=="number"||t!="symbol"&&Ra.test(r))&&r>-1&&r%1==0&&r<e}var Ue=Ma,Ga=9007199254740991;function Ba(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ga}var je=Ba,za=J,Ua=je,ja=Z,Va="[object Arguments]",ka="[object Array]",Ha="[object Boolean]",Ka="[object Date]",qa="[object Error]",Ya="[object Function]",Wa="[object Map]",Ja="[object Number]",Za="[object Object]",Xa="[object RegExp]",Qa="[object Set]",eo="[object String]",to="[object WeakMap]",ro="[object ArrayBuffer]",io="[object DataView]",no="[object Float32Array]",so="[object Float64Array]",ao="[object Int8Array]",oo="[object Int16Array]",uo="[object Int32Array]",lo="[object Uint8Array]",co="[object Uint8ClampedArray]",go="[object Uint16Array]",ho="[object Uint32Array]",y={};y[no]=y[so]=y[ao]=y[oo]=y[uo]=y[lo]=y[co]=y[go]=y[ho]=!0;y[Va]=y[ka]=y[ro]=y[Ha]=y[io]=y[Ka]=y[qa]=y[Ya]=y[Wa]=y[Ja]=y[Za]=y[Xa]=y[Qa]=y[eo]=y[to]=!1;function fo(r){return ja(r)&&Ua(r.length)&&!!y[za(r)]}var po=fo;function bo(r){return function(e){return r(e)}}var Yt=bo,se={exports:{}};se.exports;(function(r,e){var t=Bt,i=e&&!e.nodeType&&e,n=i&&!0&&r&&!r.nodeType&&r,s=n&&n.exports===i,a=s&&t.process,o=function(){try{var l=n&&n.require&&n.require("util").types;return l||a&&a.binding&&a.binding("util")}catch{}}();r.exports=o})(se,se.exports);var yo=se.exports,vo=po,_o=Yt,ot=yo,ut=ot&&ot.isTypedArray,mo=ut?_o(ut):vo,Wt=mo,So=Ca,Co=ze,Ao=T,Eo=qt,xo=Ue,Fo=Wt,To=Object.prototype,$o=To.hasOwnProperty;function No(r,e){var t=Ao(r),i=!t&&Co(r),n=!t&&!i&&Eo(r),s=!t&&!i&&!n&&Fo(r),a=t||i||n||s,o=a?So(r.length,String):[],l=o.length;for(var d in r)(e||$o.call(r,d))&&!(a&&(d=="length"||n&&(d=="offset"||d=="parent")||s&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||xo(d,l)))&&o.push(d);return o}var Do=No,wo=Object.prototype;function Oo(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||wo;return r===t}var Lo=Oo;function Io(r,e){return function(t){return r(e(t))}}var Po=Io,Ro=Po,Mo=Ro(Object.keys,Object),Go=Mo,Bo=Lo,zo=Go,Uo=Object.prototype,jo=Uo.hasOwnProperty;function Vo(r){if(!Bo(r))return zo(r);var e=[];for(var t in Object(r))jo.call(r,t)&&t!="constructor"&&e.push(t);return e}var ko=Vo,Ho=Ut,Ko=je;function qo(r){return r!=null&&Ko(r.length)&&!Ho(r)}var fe=qo,Yo=Do,Wo=ko,Jo=fe;function Zo(r){return Jo(r)?Yo(r):Wo(r)}var Ve=Zo,Xo=da,Qo=ma,eu=Ve;function tu(r){return Xo(r,eu,Qo)}var ru=tu,lt=ru,iu=1,nu=Object.prototype,su=nu.hasOwnProperty;function au(r,e,t,i,n,s){var a=t&iu,o=lt(r),l=o.length,d=lt(e),c=d.length;if(l!=c&&!a)return!1;for(var h=l;h--;){var f=o[h];if(!(a?f in e:su.call(e,f)))return!1}var v=s.get(r),S=s.get(e);if(v&&S)return v==e&&S==r;var b=!0;s.set(r,e),s.set(e,r);for(var x=a;++h<l;){f=o[h];var $=r[f],N=e[f];if(i)var X=a?i(N,$,f,e,r,s):i($,N,f,r,e,s);if(!(X===void 0?$===N||n($,N,t,i,s):X)){b=!1;break}x||(x=f=="constructor")}if(b&&!x){var m=r.constructor,O=e.constructor;m!=O&&"constructor"in r&&"constructor"in e&&!(typeof m=="function"&&m instanceof m&&typeof O=="function"&&O instanceof O)&&(b=!1)}return s.delete(r),s.delete(e),b}var ou=au,uu=M,lu=w,du=uu(lu,"DataView"),cu=du,gu=M,hu=w,fu=gu(hu,"Promise"),pu=fu,bu=M,yu=w,vu=bu(yu,"Set"),_u=vu,mu=M,Su=w,Cu=mu(Su,"WeakMap"),Au=Cu,Ee=cu,xe=Ge,Fe=pu,Te=_u,$e=Au,Jt=J,H=jt,dt="[object Map]",Eu="[object Object]",ct="[object Promise]",gt="[object Set]",ht="[object WeakMap]",ft="[object DataView]",xu=H(Ee),Fu=H(xe),Tu=H(Fe),$u=H(Te),Nu=H($e),L=Jt;(Ee&&L(new Ee(new ArrayBuffer(1)))!=ft||xe&&L(new xe)!=dt||Fe&&L(Fe.resolve())!=ct||Te&&L(new Te)!=gt||$e&&L(new $e)!=ht)&&(L=function(r){var e=Jt(r),t=e==Eu?r.constructor:void 0,i=t?H(t):"";if(i)switch(i){case xu:return ft;case Fu:return dt;case Tu:return ct;case $u:return gt;case Nu:return ht}return e});var Du=L,Se=Vt,wu=kt,Ou=na,Lu=ou,pt=Du,bt=T,yt=qt,Iu=Wt,Pu=1,vt="[object Arguments]",_t="[object Array]",ee="[object Object]",Ru=Object.prototype,mt=Ru.hasOwnProperty;function Mu(r,e,t,i,n,s){var a=bt(r),o=bt(e),l=a?_t:pt(r),d=o?_t:pt(e);l=l==vt?ee:l,d=d==vt?ee:d;var c=l==ee,h=d==ee,f=l==d;if(f&&yt(r)){if(!yt(e))return!1;a=!0,c=!1}if(f&&!c)return s||(s=new Se),a||Iu(r)?wu(r,e,t,i,n,s):Ou(r,e,l,t,i,n,s);if(!(t&Pu)){var v=c&&mt.call(r,"__wrapped__"),S=h&&mt.call(e,"__wrapped__");if(v||S){var b=v?r.value():r,x=S?e.value():e;return s||(s=new Se),n(b,x,t,i,s)}}return f?(s||(s=new Se),Lu(r,e,t,i,n,s)):!1}var Gu=Mu,Bu=Gu,St=Z;function Zt(r,e,t,i,n){return r===e?!0:r==null||e==null||!St(r)&&!St(e)?r!==r&&e!==e:Bu(r,e,t,i,Zt,n)}var ke=Zt,zu=ke;function Uu(r,e){return zu(r,e)}var ju=Uu;const Vu=Re(ju);var Ct=W,ku=ze,Hu=T,At=Ct?Ct.isConcatSpreadable:void 0;function Ku(r){return Hu(r)||ku(r)||!!(At&&r&&r[At])}var qu=Ku,Yu=Ht,Wu=qu;function Xt(r,e,t,i,n){var s=-1,a=r.length;for(t||(t=Wu),n||(n=[]);++s<a;){var o=r[s];e>0&&t(o)?e>1?Xt(o,e-1,t,i,n):Yu(n,o):i||(n[n.length]=o)}return n}var Ju=Xt;function Zu(r,e){for(var t=-1,i=r==null?0:r.length,n=Array(i);++t<i;)n[t]=e(r[t],t,r);return n}var Qt=Zu,Xu=J,Qu=Z,el="[object Symbol]";function tl(r){return typeof r=="symbol"||Qu(r)&&Xu(r)==el}var pe=tl,rl=T,il=pe,nl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sl=/^\w*$/;function al(r,e){if(rl(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||il(r)?!0:sl.test(r)||!nl.test(r)||e!=null&&r in Object(e)}var He=al,er=Be,ol="Expected a function";function Ke(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(ol);var t=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=t.cache;if(s.has(n))return s.get(n);var a=r.apply(this,i);return t.cache=s.set(n,a)||s,a};return t.cache=new(Ke.Cache||er),t}Ke.Cache=er;var ul=Ke,ll=ul,dl=500;function cl(r){var e=ll(r,function(i){return t.size===dl&&t.clear(),i}),t=e.cache;return e}var gl=cl,hl=gl,fl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pl=/\\(\\)?/g,bl=hl(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(fl,function(t,i,n,s){e.push(n?s.replace(pl,"$1"):i||t)}),e}),yl=bl,Et=W,vl=Qt,_l=T,ml=pe,xt=Et?Et.prototype:void 0,Ft=xt?xt.toString:void 0;function tr(r){if(typeof r=="string")return r;if(_l(r))return vl(r,tr)+"";if(ml(r))return Ft?Ft.call(r):"";var e=r+"";return e=="0"&&1/r==-1/0?"-0":e}var Sl=tr,Cl=Sl;function Al(r){return r==null?"":Cl(r)}var El=Al,xl=T,Fl=He,Tl=yl,$l=El;function Nl(r,e){return xl(r)?r:Fl(r,e)?[r]:Tl($l(r))}var rr=Nl,Dl=pe;function wl(r){if(typeof r=="string"||Dl(r))return r;var e=r+"";return e=="0"&&1/r==-1/0?"-0":e}var be=wl,Ol=rr,Ll=be;function Il(r,e){e=Ol(e,r);for(var t=0,i=e.length;r!=null&&t<i;)r=r[Ll(e[t++])];return t&&t==i?r:void 0}var qe=Il,Pl=Vt,Rl=ke,Ml=1,Gl=2;function Bl(r,e,t,i){var n=t.length,s=n,a=!i;if(r==null)return!s;for(r=Object(r);n--;){var o=t[n];if(a&&o[2]?o[1]!==r[o[0]]:!(o[0]in r))return!1}for(;++n<s;){o=t[n];var l=o[0],d=r[l],c=o[1];if(a&&o[2]){if(d===void 0&&!(l in r))return!1}else{var h=new Pl;if(i)var f=i(d,c,l,r,e,h);if(!(f===void 0?Rl(c,d,Ml|Gl,i,h):f))return!1}}return!0}var zl=Bl,Ul=ce;function jl(r){return r===r&&!Ul(r)}var ir=jl,Vl=ir,kl=Ve;function Hl(r){for(var e=kl(r),t=e.length;t--;){var i=e[t],n=r[i];e[t]=[i,n,Vl(n)]}return e}var Kl=Hl;function ql(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var nr=ql,Yl=zl,Wl=Kl,Jl=nr;function Zl(r){var e=Wl(r);return e.length==1&&e[0][2]?Jl(e[0][0],e[0][1]):function(t){return t===r||Yl(t,r,e)}}var Xl=Zl,Ql=qe;function ed(r,e,t){var i=r==null?void 0:Ql(r,e);return i===void 0?t:i}var td=ed;function rd(r,e){return r!=null&&e in Object(r)}var id=rd,nd=rr,sd=ze,ad=T,od=Ue,ud=je,ld=be;function dd(r,e,t){e=nd(e,r);for(var i=-1,n=e.length,s=!1;++i<n;){var a=ld(e[i]);if(!(s=r!=null&&t(r,a)))break;r=r[a]}return s||++i!=n?s:(n=r==null?0:r.length,!!n&&ud(n)&&od(a,n)&&(ad(r)||sd(r)))}var cd=dd,gd=id,hd=cd;function fd(r,e){return r!=null&&hd(r,e,gd)}var pd=fd,bd=ke,yd=td,vd=pd,_d=He,md=ir,Sd=nr,Cd=be,Ad=1,Ed=2;function xd(r,e){return _d(r)&&md(e)?Sd(Cd(r),e):function(t){var i=yd(t,r);return i===void 0&&i===e?vd(t,r):bd(e,i,Ad|Ed)}}var Fd=xd;function Td(r){return r}var ye=Td;function $d(r){return function(e){return e==null?void 0:e[r]}}var Nd=$d,Dd=qe;function wd(r){return function(e){return Dd(e,r)}}var Od=wd,Ld=Nd,Id=Od,Pd=He,Rd=be;function Md(r){return Pd(r)?Ld(Rd(r)):Id(r)}var Gd=Md,Bd=Xl,zd=Fd,Ud=ye,jd=T,Vd=Gd;function kd(r){return typeof r=="function"?r:r==null?Ud:typeof r=="object"?jd(r)?zd(r[0],r[1]):Bd(r):Vd(r)}var Hd=kd;function Kd(r){return function(e,t,i){for(var n=-1,s=Object(e),a=i(e),o=a.length;o--;){var l=a[r?o:++n];if(t(s[l],l,s)===!1)break}return e}}var qd=Kd,Yd=qd,Wd=Yd(),Jd=Wd,Zd=Jd,Xd=Ve;function Qd(r,e){return r&&Zd(r,e,Xd)}var ec=Qd,tc=fe;function rc(r,e){return function(t,i){if(t==null)return t;if(!tc(t))return r(t,i);for(var n=t.length,s=e?n:-1,a=Object(t);(e?s--:++s<n)&&i(a[s],s,a)!==!1;);return t}}var ic=rc,nc=ec,sc=ic,ac=sc(nc),oc=ac,uc=oc,lc=fe;function dc(r,e){var t=-1,i=lc(r)?Array(r.length):[];return uc(r,function(n,s,a){i[++t]=e(n,s,a)}),i}var cc=dc;function gc(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var hc=gc,Tt=pe;function fc(r,e){if(r!==e){var t=r!==void 0,i=r===null,n=r===r,s=Tt(r),a=e!==void 0,o=e===null,l=e===e,d=Tt(e);if(!o&&!d&&!s&&r>e||s&&a&&l&&!o&&!d||i&&a&&l||!t&&l||!n)return 1;if(!i&&!s&&!d&&r<e||d&&t&&n&&!i&&!s||o&&t&&n||!a&&n||!l)return-1}return 0}var pc=fc,bc=pc;function yc(r,e,t){for(var i=-1,n=r.criteria,s=e.criteria,a=n.length,o=t.length;++i<a;){var l=bc(n[i],s[i]);if(l){if(i>=o)return l;var d=t[i];return l*(d=="desc"?-1:1)}}return r.index-e.index}var vc=yc,Ce=Qt,_c=qe,mc=Hd,Sc=cc,Cc=hc,Ac=Yt,Ec=vc,xc=ye,Fc=T;function Tc(r,e,t){e.length?e=Ce(e,function(s){return Fc(s)?function(a){return _c(a,s.length===1?s[0]:s)}:s}):e=[xc];var i=-1;e=Ce(e,Ac(mc));var n=Sc(r,function(s,a,o){var l=Ce(e,function(d){return d(s)});return{criteria:l,index:++i,value:s}});return Cc(n,function(s,a){return Ec(s,a,t)})}var $c=Tc;function Nc(r,e,t){switch(t.length){case 0:return r.call(e);case 1:return r.call(e,t[0]);case 2:return r.call(e,t[0],t[1]);case 3:return r.call(e,t[0],t[1],t[2])}return r.apply(e,t)}var Dc=Nc,wc=Dc,$t=Math.max;function Oc(r,e,t){return e=$t(e===void 0?r.length-1:e,0),function(){for(var i=arguments,n=-1,s=$t(i.length-e,0),a=Array(s);++n<s;)a[n]=i[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=i[n];return o[e]=t(a),wc(r,this,o)}}var Lc=Oc;function Ic(r){return function(){return r}}var Pc=Ic,Rc=M,Mc=function(){try{var r=Rc(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Gc=Mc,Bc=Pc,Nt=Gc,zc=ye,Uc=Nt?function(r,e){return Nt(r,"toString",{configurable:!0,enumerable:!1,value:Bc(e),writable:!0})}:zc,jc=Uc,Vc=800,kc=16,Hc=Date.now;function Kc(r){var e=0,t=0;return function(){var i=Hc(),n=kc-(i-t);if(t=i,n>0){if(++e>=Vc)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var qc=Kc,Yc=jc,Wc=qc,Jc=Wc(Yc),Zc=Jc,Xc=ye,Qc=Lc,eg=Zc;function tg(r,e){return eg(Qc(r,e,Xc),r+"")}var rg=tg,ig=Me,ng=fe,sg=Ue,ag=ce;function og(r,e,t){if(!ag(t))return!1;var i=typeof e;return(i=="number"?ng(t)&&sg(e,t.length):i=="string"&&e in t)?ig(t[e],r):!1}var ug=og,lg=Ju,dg=$c,cg=rg,Dt=ug,gg=cg(function(r,e){if(r==null)return[];var t=e.length;return t>1&&Dt(r,e[0],e[1])?e=[]:t>2&&Dt(e[0],e[1],e[2])&&(e=[e[0]]),dg(r,lg(e,1),[])}),hg=gg;const G=Re(hg),fg=/\S+\.(gif|jpe?g|tiff|png|bmp|svg)$/i,pg=["label","Label","name","Name","title","Title","rdfs:label"];class u{static isEqual(e,t){return Vu(e,t)}static isDefined(e){return e!=null}static truncate(e,t,i=0){const n="…";if(!u.isDefined(e))return"";const s=`${e}`;if(s.length<=i+1)return s;const a=i-1;switch(t){case"middle":return s.substring(0,Math.ceil(a/2))+n+s.substring(s.length-Math.floor(a/2));case"end":return s.substring(0,a)+n}}static getIn(e,t){return t.reduce((i,n)=>i&&i[n]!==void 0?i[n]:void 0,e)}static clone(e){return typeof e=="object"?JSON.parse(JSON.stringify(e,(t,i)=>i instanceof Set?{}:i)):e}static getHiddenNeighbors(e){return e.reduce((t,i)=>{const n=i.getData("statistics");if(n!==void 0){const s=n.degree!==void 0&&!n.supernode?n.degree-u.getDegreeWithoutSelfConnection(i):n.supernodeDegree;if(s!==void 0&&s>0)return t+=s}return t},0)}static getDegreeWithoutSelfConnection(e){return e.getAdjacentNodes({policy:"exclude-sources",filter:"raw"}).size}static formatNumber(e){let t=1,i="";const n=e<0?"-":"";e=Math.abs(e),e>=1e6?(t=1e6,i="M"):e>=1e3&&(t=1e3,i="k");const s=e/t;return s<10&&s%1!==0?n+s.toFixed(1)+i:n+Math.floor(s)+i}static isStringFilled(e){return e.trim()!==""}static getValueFromLkProperty(e){if(typeof e=="object"&&"type"in e){if(!("original"in e)&&!("value"in e))return null;if("original"in e)return`${e.original}`;if("value"in e)return u.formatDate(new Date(new Date(e.value).getTime()+u.timezoneToMilliseconds(e.timezone)).toISOString())}return e}static formatDate(e,t,i){let n=e;i!==void 0&&(n=new Date(e).getTime()+i*1e3);const s=new Date(n);if(isNaN(s.getUTCFullYear()))return null;let a=s.getFullYear()+"-"+((s.getUTCMonth()+1).toString().length===1?"0"+(s.getUTCMonth()+1):s.getUTCMonth()+1)+"-"+(s.getUTCDate().toString().length===1?"0"+s.getUTCDate():s.getUTCDate());return t&&(a+=" "+(s.getUTCHours().toString().length===1?"0"+s.getUTCHours():s.getUTCHours())+":"+(s.getUTCMinutes().toString().length===1?"0"+s.getUTCMinutes():s.getUTCMinutes())+":"+(s.getUTCSeconds().toString().length===1?"0"+s.getUTCSeconds():s.getUTCSeconds())),a}static timezoneToMilliseconds(e){if(e===void 0||e==="Z")return 0;const t=e[0],[i,n]=e.slice(1).split(":");return t==="+"?this.sanitizeFormattedNumber(i)*36e5+this.sanitizeFormattedNumber(n)*6e4:(this.sanitizeFormattedNumber(i)*36e5+this.sanitizeFormattedNumber(n)*6e4)*-1}static sanitizeFormattedNumber(e){return e.length===2&&e.startsWith("0")?u.parseNumber(e[1]):u.parseNumber(e)}static parseNumber(e){if(typeof e=="string"){if(e.trim()==="")return Number.NaN;e=+e.replace(",",".").replace(" ","")}return typeof e!="number"||!isFinite(e)?Number.NaN:e}static uniqBy(e,t){const i=new Set;if(t){const n=[];for(let s=0;s<e.length;++s)e[s]&&e[s][t]&&!i.has(e[s][t])?(i.add(e[s][t]),n.push(e[s])):e[s][t]||n.push(e[s]);return n}return typeof e[0]=="object"?Array.from(new Set(e.map(n=>JSON.stringify(n)))).map(n=>JSON.parse(n)):Array.from(new Set(e))}static getType(e){if(u.isURLImage(e))return"imageUrl";if(u.isImage(e))return"image";if(u.isUrl(e))return"url"}static isUrl(e){try{return new URL(e),!0}catch{return!1}}static isImage(e){return fg.test(e)}static isURLImage(e){if(u.isUrl(e)){const t=new URL(e);return u.isImage(t.pathname)}return!1}static valueExists(e){return u.isDefined(e)&&(typeof e!="string"||u.isStringFilled(e))}static isNumber(e){return e=u.parseNumber(e),u.isDefined(e)&&e===e}static getPropertyValue(e,t,i){if(typeof e=="object"&&!Array.isArray(e)){if("status"in e)return t&&"original"in e?e.original:void 0;if((e.type==="date"||e.type==="datetime")&&i)return u.formatDate(e.value,e.type==="datetime");if(e.type==="date"||e.type==="datetime")return new Date(e.value).getTime()}return e}static parseFloat(e){return u.parseNumber(e)}static formatCurrencyValue(e,t){const i=e<0?"- ":"";switch(t.format){case g.CurrencyFormat.SYMBOL_COMMAS_DOT:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",",".")}`;case g.CurrencyFormat.SYMBOL_COMMAS:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",")}`;case g.CurrencyFormat.DOTS_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case g.CurrencyFormat.DOTS_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".")}${t.symbol!==void 0?" "+t.symbol:""}`;case g.CurrencyFormat.SPACES_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e," ",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case g.CurrencyFormat.SPACES_SYMBOL:return`${i}${u.formatNumberToCurrency(e," ")}${t.symbol!==void 0?" "+t.symbol:""}`;default:throw Error(`Cannot format property value ${e}, unknown format ${t.format}.`)}}static formatNumberToCurrency(e,t,i){if(!Number.isFinite(e))return e.toString();const[n,s]=i?Math.abs(e).toFixed(2).split("."):[Math.abs(e).toFixed(0),void 0];let a=-1;const o=n.split("").reverse().map(l=>(a++,a>0&&a%3===0?l+t:l)).reverse().join("");return i?o+i+s:o}}class F{static getText(e,t,i){const n="categories"in e?e.categories:[e.type];if(F.captionExist(n,t))return"categories"in e?F.generateNodeCaption(e,t,i)||null:F.generateEdgeCaption(e,t,i)||null;if(e.properties!==void 0){const s=pg.find(a=>e.properties[a]!==void 0);if(s!==void 0&&u.isDefined(e.properties[s]))return`${u.getValueFromLkProperty(e.properties[s])}`.trim()}return null}static getLabel(e,t){if(typeof e=="object"&&"type"in e){if(!("original"in e)&&!("value"in e))return null;if("original"in e)return`${e.original}`;if("value"in e)return u.formatDate(new Date(new Date(e.value).getTime()+u.timezoneToMilliseconds(e.timezone)).toISOString())}else if((t==null?void 0:t.name)===g.PropertyTypeName.NUMBER&&t.options!==void 0)return u.formatCurrencyValue(e,t.options);return`${e}`.trim()}static captionExist(e,t){return e.some(i=>u.isDefined(t[i]))}static generateNodeCaption(e,t,i){const n=e.categories,s=[];let a=[];return n.forEach(o=>{t[o]&&t[o].active&&(t[o].displayName&&s.push(o),a=[...a,...t[o].properties])}),u.uniqBy(a).forEach(o=>{if(e.properties[o]!==void 0){const l=i?F.getPropertyType(i,o,n[0]):void 0;s.push(this.getLabel(e.properties[o],l))}}),s.filter(o=>o!==null).join(" - ").trim()}static getPropertyType(e,t,i){const n=e.find(a=>a.itemType===i),s=n==null?void 0:n.properties.find(a=>a.propertyKey===t);return s==null?void 0:s.propertyType}static generateEdgeCaption(e,t,i){const n=e.type,s=[];let a=[];return t[n]&&t[n].active?(t[n].displayName&&s.push(n),a=[...a,...t[n].properties],u.uniqBy(a).forEach(o=>{if(u.isDefined(e.properties[o])){const l=i?F.getPropertyType(i,o,n):void 0;s.push(F.getLabel(e.properties[o],l))}}),s.join(" - ").trim()):""}}var sr={exports:{}},ar={exports:{}};(function(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(t,i){return t<<i|t>>>32-i},rotr:function(t,i){return t<<32-i|t>>>i},endian:function(t){if(t.constructor==Number)return e.rotl(t,8)&16711935|e.rotl(t,24)&4278255360;for(var i=0;i<t.length;i++)t[i]=e.endian(t[i]);return t},randomBytes:function(t){for(var i=[];t>0;t--)i.push(Math.floor(Math.random()*256));return i},bytesToWords:function(t){for(var i=[],n=0,s=0;n<t.length;n++,s+=8)i[s>>>5]|=t[n]<<24-s%32;return i},wordsToBytes:function(t){for(var i=[],n=0;n<t.length*32;n+=8)i.push(t[n>>>5]>>>24-n%32&255);return i},bytesToHex:function(t){for(var i=[],n=0;n<t.length;n++)i.push((t[n]>>>4).toString(16)),i.push((t[n]&15).toString(16));return i.join("")},hexToBytes:function(t){for(var i=[],n=0;n<t.length;n+=2)i.push(parseInt(t.substr(n,2),16));return i},bytesToBase64:function(t){for(var i=[],n=0;n<t.length;n+=3)for(var s=t[n]<<16|t[n+1]<<8|t[n+2],a=0;a<4;a++)n*8+a*6<=t.length*8?i.push(r.charAt(s>>>6*(3-a)&63)):i.push("=");return i.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/ig,"");for(var i=[],n=0,s=0;n<t.length;s=++n%4)s!=0&&i.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*s+8)-1)<<s*2|r.indexOf(t.charAt(n))>>>6-s*2);return i}};ar.exports=e})();var bg=ar.exports,Ne={utf8:{stringToBytes:function(r){return Ne.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(Ne.bin.bytesToString(r)))}},bin:{stringToBytes:function(r){for(var e=[],t=0;t<r.length;t++)e.push(r.charCodeAt(t)&255);return e},bytesToString:function(r){for(var e=[],t=0;t<r.length;t++)e.push(String.fromCharCode(r[t]));return e.join("")}}},wt=Ne;(function(){var r=bg,e=wt.utf8,t=wt.bin,i=function(s){s.constructor==String?s=e.stringToBytes(s):typeof Buffer<"u"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(s)?s=Array.prototype.slice.call(s,0):Array.isArray(s)||(s=s.toString());var a=r.bytesToWords(s),o=s.length*8,l=[],d=1732584193,c=-271733879,h=-1732584194,f=271733878,v=-1009589776;a[o>>5]|=128<<24-o%32,a[(o+64>>>9<<4)+15]=o;for(var S=0;S<a.length;S+=16){for(var b=d,x=c,$=h,N=f,X=v,m=0;m<80;m++){if(m<16)l[m]=a[S+m];else{var O=l[m-3]^l[m-8]^l[m-14]^l[m-16];l[m]=O<<1|O>>>31}var _r=(d<<5|d>>>27)+v+(l[m]>>>0)+(m<20?(c&h|~c&f)+1518500249:m<40?(c^h^f)+1859775393:m<60?(c&h|c&f|h&f)-1894007588:(c^h^f)-899497514);v=f,f=h,h=c<<30|c>>>2,c=d,d=_r}d+=b,c+=x,h+=$,f+=N,v+=X}return[d,c,h,f,v]},n=function(s,a){var o=r.wordsToBytes(i(s));return a&&a.asBytes?o:a&&a.asString?t.bytesToString(o):r.bytesToHex(o)};n._blocksize=16,n._digestsize=20,sr.exports=n})();var yg=sr.exports;const ae=Re(yg),E="#7f7f7f",De=["#9467bd","#e377c2","#1f77b4","#17becf","#2ca02c","#bcbd22","#d62728","#ff7f0e","#8c564b","#c5b0d5","#f7b6d2","#aec7e8","#9edae5","#98df8a","#dbdb8d","#ff9896","#ffbb78","#c49c94"];class A{constructor(e){this.colorsCache=new Map,this._rulesMap={},this.refresh(e)}refresh(e){e.color!==void 0&&(this.colorsCache=new Map),this._rulesMap={color:e.color?[...e.color].reverse():this._rulesMap.color,icon:e.icon?[...e.icon].reverse():this._rulesMap.icon,image:e.image?[...e.image].reverse():this._rulesMap.image,shape:e.shape?[...e.shape].reverse():this._rulesMap.shape,size:e.size?[...e.size].reverse():this._rulesMap.size,width:e.width?[...e.width].reverse():this._rulesMap.width}}static autoColor(e,t){return u.isDefined(e)?De[A.getRandomUniqueColorPaletteIndex(e,De.length,t)]:E}static getRandomUniqueColorPaletteIndex(e,t,i){return i&&(e=e.toLowerCase()),+("0x"+ae(e).substr(-4))%t}static getTypeColor(e,t){return typeof e.style.color=="object"&&e.style.color.input[0]!=="properties"?A.autoColor(t,e.style.color.ignoreCase):!u.isDefined(e.input)&&typeof e.style.color!="object"?e.style.color:null}static getAutomaticRangeStyleLinear(e,{max:t,min:i},n,s){if(t!==void 0&&i!==void 0){if(t===i||isNaN(e))return"100%";const a=(s-n)/(t-i),o=(n*t-s*i)/(t-i);return`${Math.floor(e*a+o)}%`}}static getAutomaticRangeStyleLog(e,{max:t,min:i},n,s){if(i!==void 0&&t!==void 0){if(t===i||isNaN(e))return"100%";i<1&&(e+=Math.abs(i)+1,t+=Math.abs(i)+1,i+=Math.abs(i)+1);const a=(s-n)/(Math.log(t)-Math.log(i)),o=(n*Math.log(t)-s*Math.log(i))/(Math.log(t)-Math.log(i));return`${Math.floor(a*Math.log(e)+o)}%`}}isAutoRange(e){return typeof e=="object"&&(e==null?void 0:e.type)==="autoRange"}}class z extends A{constructor(e){super(e)}static matchStyle(e,t){if(t!==void 0){for(let i=0;i<e.length;++i)if(e[i].canApplyTo(t))return e[i]}}color(e){if(!u.isDefined(e))return E;let t;for(let i=0;i<this._rulesMap.color.length;++i){const n=this._rulesMap.color[i];if(n.canApplyTo(e)){if(typeof n.style.color=="string")t=n.style.color;else if(typeof n.style.color=="object"){const s=u.getIn(e,n.style.color.input);t=A.autoColor(`${s}`,n.style.color.ignoreCase)}break}}return u.isDefined(t)?t:E}shape(e){var t;if(this._rulesMap.shape!==void 0)return(t=z.matchStyle(this._rulesMap.shape,e))==null?void 0:t.style.shape}width(e){if(this._rulesMap.width!==void 0){const t=z.matchStyle(this._rulesMap.width,e);if(t!==void 0){const i=t==null?void 0:t.style.width;if(i!==void 0&&this.isAutoRange(i)){if(i.input!==void 0&&i.max!==void 0&&i.min!==void 0){const n=i.input[1],s=u.parseNumber(e.properties[n]),a=i.scale&&i.scale===g.AutoRangeScale.LOGARITHMIC;return z.getAutomaticRangeWidth(s,t,a)}}else return i}}}static getAutomaticRangeWidth(e,t,i=!1){return i?this.getAutomaticRangeStyleLog(e,t.style.width,50,200):this.getAutomaticRangeStyleLinear(e,t.style.width,50,200)}all(e){return u.isDefined(e)?{color:this.color(e),shape:this.shape(e),width:this.width(e)}:{color:E,shape:g.OgmaEdgeShape.ARROW,width:"100%"}}}class I extends A{constructor(e){super(e)}static matchStyle(e,t,i){if(u.isDefined(t)&&u.isDefined(e)){for(let n=0;n<e.length;++n)if(e[n].canApplyTo(t)){i(e[n]);break}}}color(e){if(!u.isDefined(e))return[E];const t=ae(JSON.stringify(e)),i=this.colorsCache.get(t);if(i!==void 0)return i;let n=[];for(let a=0;a<e.categories.length;++a){let o=null;for(let l=0;l<this._rulesMap.color.length;++l){const d=this._rulesMap.color[l];if(!(d.itemType!==void 0&&d.itemType!==null&&d.itemType!==e.categories[a])&&d.canApplyTo(e)){if(typeof d.style.color=="object"){const c=u.getIn(e,d.style.color.input);Array.isArray(c)?o=A.autoColor(e.categories[a],d.style.color.ignoreCase):o=A.autoColor(`${c}`,d.style.color.ignoreCase)}else o=d.style.color;break}}n.push(o)}n=n.filter(a=>u.isDefined(a)),n.length===0&&(n=[E]);const s=n.length===1?n[0]:n;return this.colorsCache.set(t,s),s}icon(e){var a,o;const t=this.color(e),i=Array.isArray(t)?t[0]:t;let n={};const s=[...this._rulesMap.image||[],...this._rulesMap.icon||[]];if(!u.isDefined(e))return{icon:{},image:{}};for(let l=0;l<s.length;++l)if(s[l].canApplyTo(e)){const d=s[l].style;if("icon"in d&&typeof d.icon=="object")n={icon:{content:(a=d.icon)==null?void 0:a.content,font:(o=d.icon)==null?void 0:o.font,scale:.5,color:P.isBright(i)?"#000000":"#FFFFFF"}};else if("image"in d&&typeof d.image=="object"){const c=I.getImageUrlFromStyleRule(d.image.url,e,this._baseUrl);c!==void 0&&(n={image:{url:c,scale:d.image.scale,fit:d.image.fit,tile:d.image.tile,minVisibleSize:0}})}break}return n}shape(e){let t;return this._rulesMap.shape!==void 0&&I.matchStyle(this._rulesMap.shape,e,i=>{t=i.style.shape}),t}size(e){let t;return this._rulesMap.size!==void 0&&I.matchStyle(this._rulesMap.size,e,i=>{const n=i.style.size;if(this.isAutoRange(n)){if(n.input!==void 0&&n.max!==void 0&&n.min!==void 0){const s=n.input[1],a=u.parseNumber(e.properties[s]),o=n.scale&&n.scale===g.AutoRangeScale.LOGARITHMIC;t=I.getAutomaticRangeSize(a,i,o)}}else t=n}),t}static getAutomaticRangeSize(e,t,i=!1){return i?this.getAutomaticRangeStyleLog(e,t.style.size,50,500):this.getAutomaticRangeStyleLinear(e,t.style.size,50,500)}all(e){if(!u.isDefined(e))return{color:E};const t=this.icon(e);return{radius:this.size(e),color:this.color(e),shape:this.shape(e),icon:t.icon,image:t.image}}static getImageUrlFromStyleRule(e,t,i){let n;return typeof e=="string"&&["imageUrl","image"].includes(u.getType(e))?n=e:typeof e=="object"&&(n=u.getIn(t,e.path)),n!==void 0&&i!==void 0?new URL(n,i).href:n}setBaseUrl(e){this._baseUrl=e}}var or=(r=>(r.AUTO_RANGE="autoRange",r))(or||{});class C{constructor(e){this.type=e.type,this.input=e.input,this.index=e.index,this.itemType=e.itemType,this.style=e.style,this.value=e.value}static isAutomaticRange(e){return e.style!==void 0&&(e.style.width!==void 0&&e.style.width.type==="autoRange"||e.style.size!==void 0&&e.style.size.type==="autoRange")}get specificity(){return this.itemType!==void 0&&this.input!==void 0?4:this.itemType===void 0&&this.input!==void 0?3:this.itemType!==void 0&&this.input===void 0?2:1}matchValues(e,t,i){return u.isDefined(t)?(e===this.itemType||!u.isDefined(this.itemType))&&u.isEqual(["properties",...t],this.input)&&u.isEqual(i,this.value)||this.type==="any"&&!u.isDefined(this.input)&&typeof this.style.color=="object"&&this.style.color.input[1]===t[0]:u.isDefined(this.itemType)?e===this.itemType&&!u.isDefined(this.input):!u.isDefined(this.input)}static inputExists(e,t){return e!==g.SelectorType.ANY}canApplyTo(e){const t="categories"in e?e.categories:[e.type];let i=!1;switch(this.type){case g.SelectorType.ANY:i=C.checkAny(e,this.style);break;case g.SelectorType.NO_VALUE:C.inputExists(this.type,this.input)&&(i=C.checkNoValue(e,this.input));break;case g.SelectorType.NAN:C.inputExists(this.type,this.input)&&(i=C.checkNan(e,this.input));break;case g.SelectorType.RANGE:C.inputExists(this.type,this.input)&&(i=C.checkRange(u.getIn(e,this.input),this.value));break;case g.SelectorType.IS:C.inputExists(this.type,this.input)&&(i=C.checkIs(e,this.input,this.value));break}return i&&C.checkItemType(t,this.itemType)}static checkAny(e,t){return typeof t.color=="object"?u.isDefined(u.getIn(e,t.color.input)):!0}static checkNoValue(e,t){return!u.valueExists(u.getIn(e,t))}static checkNan(e,t){return!u.isNumber(u.getIn(e,t))}static checkRange(e,t){return(t["<="]===void 0||e<=t["<="])&&(t["<"]===void 0||e<t["<"])&&(t[">"]===void 0||e>t[">"])&&(t[">="]===void 0||e>=t[">="])}static checkIs(e,t,i){if(!u.isDefined(t))return!1;const n=u.getIn(e,t);let s=n;if(u.isDefined(n)&&typeof n=="object"&&(n.type==="date"||n.type==="datetime")){let a=n.timezone;n.timezone==="Z"&&(a="+00:00"),s=u.formatDate(n.value,n.type==="datetime",u.timezoneToMilliseconds(a)/1e3)}return u.isEqual(s,i)}static checkItemType(e,t){return C.matchCategory(e,t)||C.matchAny(t)}static matchCategory(e,t){return u.isDefined(t)&&(Array.isArray(e)?e.includes(t):u.isEqual(e,t))}static matchAny(e){return e===void 0}getTypeColor(e){let t;return C.checkItemType([e],this.itemType)&&this.type===g.SelectorType.ANY&&!u.isDefined(this.input)&&(t=A.getTypeColor(this,e)),t}}var D=(r=>(r.COLOR="color",r.ICON="icon",r.SIZE="size",r.IMAGE="image",r.SHAPE="shape",r.WIDTH="width",r))(D||{});const B=["specificity","itemType","index"];class p{constructor(e){this._rules=e}get color(){return G(p.getBy("color",this._rules),B)}get icon(){return G([...p.getBy("icon",this._rules)||[],...p.getBy("image",this._rules)||[]],B)}get image(){return G(p.getBy("image",this._rules),B)}get shape(){return G(p.getBy("shape",this._rules),B)}get size(){return G(p.getBy("size",this._rules),B)}get width(){return G(p.getBy("width",this._rules),B)}get nodeRules(){return{color:this.color,icon:this.icon,image:this.image,shape:this.shape,size:this.size}}get edgeRules(){return{color:this.color,shape:this.shape,width:this.width}}generateLegend(e){const t={};return e.length===0||("categories"in e[0]?Object.keys(this.nodeRules).forEach(i=>{t[i]=p.getLegendForStyle(i,this.nodeRules[i],e)}):Object.keys(this.edgeRules).forEach(i=>{t[i]=p.getLegendForStyle(i,this.edgeRules[i],e)})),t}static getLegendForStyle(e,t,i){const n=[],s=i.filter(a=>a);for(let a=0;a<t.length;a++){const o=new C(t[a]);if(s.some(d=>o.canApplyTo(d)))if(e==="color"&&typeof o.style.color=="object")p.addLegendAutoColors(s,o,n);else if(e==="icon"&&"image"in o.style){const d=u.isDefined(o.input)?`${p.getTypeLabel(o.itemType)}.${o.input[1]} ${p.sanitizeValue(o.type,o.value)}`:`${p.getTypeLabel(o.itemType)}`,c=o.style.image;if(!(c.url&&typeof c.url=="object"&&c.url.type==="data")){const h=o.style.image;p.updateLegend(n,{label:d,value:h})}}else{const d=u.isDefined(o.input)?`${p.getTypeLabel(o.itemType)}.${o.input[1]} ${p.sanitizeValue(o.type,o.value)}`:`${p.getTypeLabel(o.itemType)}`,c=o.style[e];p.updateLegend(n,{label:d,value:c})}}return n}static sanitizeValue(e,t){let i="";switch(e){case g.SelectorType.NO_VALUE:return"is undefined";case g.SelectorType.NAN:return"is not an number";case g.SelectorType.RANGE:return Object.keys(t).forEach((n,s)=>{s>0&&(i+=" and "),i+=`${n} ${t[n]}`}),i}return typeof t=="object"?`= ${JSON.stringify(t)}`:`= ${t}`}static addLegendAutoColors(e,t,i){const n=t.style.color,s=n.input[1];e.forEach(a=>{const o=u.getIn(a,n.input);if(Array.isArray(o))o.forEach(l=>{const d=n.input.includes("properties")?`${p.getTypeLabel(t.itemType)}.${s} = ${l}`:`${p.getTypeLabel(l)}`,c=A.autoColor(l,n.ignoreCase);p.updateLegend(i,{label:d,value:c})});else{const l=n.input.includes("properties")?`${p.getTypeLabel(t.itemType)}.${s} = ${o}`:`${p.getTypeLabel(o)}`,d=A.autoColor(o,n.ignoreCase);p.updateLegend(i,{label:l,value:d})}})}static getTypeLabel(e){return e===void 0?"All":e===null?"Others":e}getColorForType(e){const t=this.color.map(i=>i.getTypeColor(e)).filter(i=>u.isDefined(i));return t.length>0?t[t.length-1]:E}getIconForType(e){const t=this.icon.filter(i=>!u.isDefined(i.input)&&i.itemType===e).map(i=>{var n;return(n=i.style.icon)==null?void 0:n.content}).filter(i=>u.isDefined(i));return t.length>0?t[t.length-1]:void 0}static updateLegend(e,{label:t,value:i}){const n=e.map(s=>s.label).indexOf(t);n<0?e.push({label:t,value:i}):e[n]={label:t,value:i}}static getBy(e,t){return t.filter(i=>{switch(e){case"color":return i.style.color!==void 0;case"icon":return"icon"in i.style&&i.style.icon!==void 0;case"image":return"image"in i.style&&i.style.image!==void 0;case"shape":return i.style.shape!==void 0;case"size":return"size"in i.style&&i.style.size!==void 0;case"width":return"width"in i.style&&i.style.width!==void 0}}).map(i=>p.getRule(i,e))}static getRule(e,t){const i=u.clone(e);return i.style={[t]:i.style[t]},new C(i)}static sanitizeStylesIndex(e){const t=[],i=u.clone(e);let n=Math.max(...e.node.map(s=>s.index),...e.edge.map(s=>s.index))+1;return i.node=i.node.map(s=>(t.includes(s.index)?(s.index=n,n++):t.push(s.index),s)),i.edge=i.edge.map(s=>(t.includes(s.index)?(s.index=n,n++):t.push(s.index),s)),i}}const ur="'roboto', sans-serif",oe="#FFF",we=.2,Y="#3F3D5F",Ot={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outerStroke:{width:2},outline:!1},Lt={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outline:!1},vg={color:"#FFF",width:7,scalingMethod:"scaled",strokeWidth:0,hideNonAdjacentEdges:!1},_g={color:"#FFF",scalingMethod:"scaled",width:4},It="#7f7f7f";class lr{constructor(e,t){this._nodeAttributes=new I({}),this._edgeAttributes=new z({}),this._ogma=e,this._defaultConfiguration=t,this._nodeAttributes.setBaseUrl(t.baseUrl)}get nodeAttributes(){return this._nodeAttributes}get nodeFont(){var e,t;return(t=(e=this._defaultConfiguration.node)==null?void 0:e.text)==null?void 0:t.font}setNodesDefaultStyles(){this._ogma.styles.setHoveredNodeAttributes(Ot),this._ogma.styles.setSelectedNodeAttributes(Ot),this._nodeDefaultStylesRules=this._ogma.styles.addRule({nodeAttributes:{text:{padding:5,minVisibleSize:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.minVisibleSize?this._defaultConfiguration.node.text.minVisibleSize:12,maxLineLength:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.maxLineLength!==void 0?this._defaultConfiguration.node.text.maxLineLength:30,position:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.nodePosition!==void 0?this._defaultConfiguration.node.text.nodePosition:"bottom",backgroundColor:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.backgroundColor!==void 0?this._defaultConfiguration.node.text.backgroundColor:void 0,font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:"'roboto', sans-serif",color:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.color!==void 0?this._defaultConfiguration.node.text.color:"black",size:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.size!==void 0?this._defaultConfiguration.node.text.size:14,margin:5},radius:this.defaultNodeRadius(this._defaultConfiguration.node),icon:{minVisibleSize:15},color:It,shape:this._defaultConfiguration.node.shape!==void 0?this._defaultConfiguration.node.shape:"circle",innerStroke:{width:3},outline:!1},nodeSelector:e=>!e.isVirtual()})}setEdgesDefaultStyles(){var e;this._ogma.styles.setHoveredEdgeAttributes(Lt),this._ogma.styles.setSelectedEdgeAttributes(Lt),this._edgeDefaultStylesRules=this._ogma.styles.addRule({edgeAttributes:{text:{minVisibleSize:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.minVisibleSize?this._defaultConfiguration.edge.text.minVisibleSize:3,maxLineLength:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.maxLineLength!==void 0?this._defaultConfiguration.edge.text.maxLineLength:30,backgroundColor:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.backgroundColor!==void 0?this._defaultConfiguration.edge.text.backgroundColor:void 0,font:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.font!==void 0?this._defaultConfiguration.edge.text.font:"'roboto', sans-serif",color:((e=this._defaultConfiguration.edge)==null?void 0:e.text)!==void 0&&this._defaultConfiguration.edge.text.color!==void 0?this._defaultConfiguration.edge.text.color:"black",size:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.size!==void 0?this._defaultConfiguration.edge.text.size:14},width:this.defaultEdgeWidth(this._defaultConfiguration.edge),shape:this._defaultConfiguration.edge.shape!==void 0?this._defaultConfiguration.edge.shape:"arrow",color:It}})}setNodesDefaultHalo(){this._nodeDefaultHaloRules=this._ogma.styles.addRule({nodeSelector:e=>e&&!e.hasClass("filtered")&&!e.isVirtual(),nodeAttributes:{halo:e=>e!==void 0&&!e.hasClass("filtered")&&(e.isSelected()||e.getAdjacentNodes({}).isSelected().includes(!0)||e.getAdjacentEdges().isSelected().includes(!0))?{...vg,scalingMethod:this._ogma.geo.enabled()?"fixed":"scaled"}:null},nodeDependencies:{self:{selection:!0},adjacentNodes:{selection:!0},adjacentEdges:{selection:!0}}})}setEdgesDefaultHalo(){this._edgeDefaultHaloRules=this._ogma.styles.addRule({edgeSelector:e=>e&&e.getSource()&&e.getTarget()&&!e.hasClass("filtered"),edgeAttributes:{halo:e=>e&&!e.hasClass("filtered")&&(e.isSelected()||e.getSource().isSelected()||e.getTarget().isSelected())?{..._g,scalingMethod:this._ogma.geo.enabled()?"fixed":"scaled"}:null},edgeDependencies:{self:{selection:!0},extremities:{selection:!0}}})}defaultNodeRadius(e){return this.defaultStylesHas(e,["nodeRadius"])?e.nodeRadius:5}defaultEdgeWidth(e){return this.defaultStylesHas(e,["edgeWidth"])?e.edgeWidth:1}defaultStylesHas(e,t){return u.isDefined(e)?u.getIn(e,t)!==void 0:!1}setFilterClass(){this._ogma.styles.createClass({name:"filtered",nodeAttributes:{opacity:we,layer:e=>e.getMetaNode()!==null?1:-1,detectable:!1,badges:{topRight:{text:null},bottomRight:{text:null}},text:null,color:"rgb(240, 240, 240)",innerStroke:{width:1,color:E,minVisibleSize:1},shape:"circle",image:null,icon:null,radius:"50%"},edgeAttributes:{opacity:we,layer:e=>{const t=e.getExtremities().getMetaNode().some(i=>i!==null);return!e.isVirtual()&&t?1:-1},detectable:!1,text:null,color:E,shape:"line",width:.2}})}setExportClass(e){this._exportClass?this._exportClass.update({nodeAttributes:{text:{maxLineLength:e?30:0},halo:null}}):this._exportClass=this._ogma.styles.createClass({name:"exported",nodeAttributes:{text:{minVisibleSize:0,size:12,maxLineLength:e?30:0},halo:null},edgeAttributes:{text:{minVisibleSize:0,size:12},halo:null}})}async initBadges(e){this._badgesStyle=e,this.refreshCounterBadgeClass(),await this.refreshPinBadgeStyleRule()}refreshCounterBadgeClass(){const e="degreeIndicator",t={nodeAttributes:{badges:{bottomLeft:n=>this._getCounterBadge(n)}}},i=this._ogma.styles.getClass(e);u.isDefined(i)?i.update(t):(this._ogma.styles.createClass({name:e,...t}),this._ogma.events.on("addNodes",n=>n.nodes.addClass(e)),this._ogma.getNodes().addClass(e))}async refreshPinBadgeStyleRule(){u.isDefined(this._pinnedIndicatorRule)?(await this._pinnedIndicatorRule.refresh(),this._pinnedIndicatorRule.update({priority:100})):(this._pinnedIndicatorRule=this._ogma.styles.addRule({nodeSelector:e=>!e.getAttribute("layoutable"),nodeAttributes:{badges:{topRight:e=>this._getPinBadge(e)}},nodeDependencies:{self:{attributes:["layoutable"]}}}),this._pinnedIndicatorRule.update({priority:100}))}toggleTextOverlap(e){this._ogma.setOptions({texts:{preventOverlap:e}})}refreshRules(){this._nodeDefaultStylesRules.refresh(),this._edgeDefaultStylesRules.refresh()}refreshNodeColors(e){u.isDefined(this._ogmaNodeColor)?(this._nodeAttributes.refresh({color:e}),this._ogmaNodeColor.refresh()):(this._nodeAttributes.refresh({color:e}),this._ogmaNodeColor=this._ogma.styles.addRule({nodeAttributes:{color:t=>{if(t!==void 0)return this._nodeAttributes.color(t.getData())}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}getStyleRule(e,t){return new p(e)[t]}initNodeColors(e){const t=this.getStyleRule(e,D.COLOR);this.refreshNodeColors(t)}initNodesIcons(e){const t=this.getStyleRule(e,D.ICON);this.refreshNodeIcons(t)}initNodesSizes(e){const t=this.getStyleRule(e,D.SIZE);this.refreshNodeSize(t)}initNodesShapes(e){const t=this.getStyleRule(e,D.SHAPE);this.refreshNodeShape(t)}initEdgesWidth(e){const t=this.getStyleRule(e,D.WIDTH);this.refreshEdgeWidth(t)}initEdgesShape(e){const t=this.getStyleRule(e,D.SHAPE);this.refreshEdgeShape(t)}initEdgesColor(e){const t=this.getStyleRule(e,D.COLOR);this.refreshEdgeColors(t)}refreshNodeIcons(e){u.isDefined(this._ogmaNodeIcon)?(this._nodeAttributes.refresh({icon:e}),this._ogmaNodeIcon.refresh()):(this._nodeAttributes.refresh({icon:e}),this._ogmaNodeIcon=this._ogma.styles.addRule({nodeAttributes:{icon:t=>{if(t!==void 0)return this._nodeAttributes.icon(t.getData()).icon},image:t=>{if(t!==void 0&&!t.isVirtual())return this._nodeAttributes.icon(t.getData()).image}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}refreshNodeSize(e){u.isDefined(this._ogmaNodeSize)?(this._nodeAttributes.refresh({size:e}),this._ogmaNodeSize.refresh()):(this._nodeAttributes.refresh({size:e}),this._ogmaNodeSize=this._ogma.styles.addRule({nodeAttributes:{radius:t=>{if(t!==void 0)return this._nodeAttributes.size(t.getData())}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}refreshNodeShape(e){u.isDefined(this._ogmaNodeShape)?(this._nodeAttributes.refresh({shape:e}),this._ogmaNodeShape.refresh()):(this._nodeAttributes.refresh({shape:e}),this._ogmaNodeShape=this._ogma.styles.addRule({nodeAttributes:{shape:t=>{if(t!==void 0)return this._nodeAttributes.shape(t.getData())}},nodeSelector:t=>t!==void 0&&!t.isVirtual(),nodeDependencies:{self:{data:!0}}}))}refreshEdgeColors(e){u.isDefined(this._ogmaEdgeColor)?(this._edgeAttributes.refresh({color:e}),this._ogmaEdgeColor.refresh()):(this._edgeAttributes.refresh({color:e}),this._ogmaEdgeColor=this._ogma.styles.addRule({edgeAttributes:{color:t=>{if(t!==void 0)return this._edgeAttributes.color(t.getData())}},edgeDependencies:{self:{data:!0}}}))}refreshEdgeWidth(e){u.isDefined(this._ogmaEdgeWidth)?(this._edgeAttributes.refresh({width:e}),this._ogmaEdgeWidth.refresh()):(this._edgeAttributes.refresh({width:e}),this._ogmaEdgeWidth=this._ogma.styles.addRule({edgeAttributes:{width:t=>{if(t!==void 0)return this._edgeAttributes.width(t.getData())}},edgeDependencies:{self:{data:!0}}}))}refreshEdgeShape(e){u.isDefined(this._ogmaEdgeShape)?(this._edgeAttributes.refresh({shape:e}),this._ogmaEdgeShape.refresh()):(this._edgeAttributes.refresh({shape:e}),this._ogmaEdgeShape=this._ogma.styles.addRule({edgeAttributes:{shape:t=>{if(t!==void 0)return this._edgeAttributes.shape(t.getData())}},edgeDependencies:{self:{data:!0}}}))}_findPinBadgeScale(e){return this._getNodeRadius(e)*.46>5?.17:.46}_getNodeRadius(e){return!e.isVirtual()||P.isGroupCollapsed(e)?e.getAttribute("radius"):this._ogma.transformations.getXYR(e.toList())[0].radius}_getCounterBadge(e){var t,i,n,s;if(((i=(t=this._badgesStyle)==null?void 0:t.counter)==null?void 0:i.display)!==!1&&u.isDefined(e)){const a=u.getHiddenNeighbors(e.toList()),o=u.formatNumber(a);if(a>0){const l=e.getData(["statistics","supernode"]);let d=null;return+o!=0&&(d=l?o+"+":o),{color:((s=(n=this._badgesStyle)==null?void 0:n.counter)==null?void 0:s.color)||Y,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:ur,scale:.4,color:oe,content:d}}}}}_getPinBadge(e){var t,i,n,s;if(((i=(t=this._badgesStyle)==null?void 0:t.pin)==null?void 0:i.display)!==!1)return{color:((s=(n=this._badgesStyle)==null?void 0:n.pin)==null?void 0:s.color)||Y,minVisibleSize:20,scale:this._findPinBadgeScale(e),stroke:{width:2,color:"#FFFFFF"},text:{font:"FontAwesome",scale:.4,color:oe,content:""}}}}class dr{constructor(e,t,i){this._nodeMaxTextLength=t,this._edgeMaxTextLength=i,this._captionSchema={node:{},edge:{}},this._graphSchema={node:[],edge:[]},this._ogma=e}set graphSchema(e){this._graphSchema=e}refreshSchema(e){this._captionSchema=e}async initVizCaptions(e){this._ogma.LKCaptions.nodesCaptionsRule?(this._ogma.LKCaptions.refreshSchema(e),await this._ogma.LKCaptions.updateNodeCaptions()):this._ogma.LKCaptions.updateNodeCaptions(e.node),this._ogma.LKCaptions.edgesCaptionsRule?(this._ogma.LKCaptions.refreshSchema(e),await this._ogma.LKCaptions.updateEdgeCaptions()):this._ogma.LKCaptions.updateEdgeCaptions(e.edge)}updateNodeCaptions(e){if(e&&(this._captionSchema.node=e),!u.isDefined(this.nodesCaptionsRule))this.nodesCaptionsRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:t=>{if(t===void 0)return"";const i=F.getText(t.getData(),this._captionSchema.node,this._graphSchema.node);return u.isDefined(this._nodeMaxTextLength)?u.truncate(i,"middle",this._nodeMaxTextLength):i}}},nodeSelector:t=>!t.isVirtual(),nodeDependencies:{self:{data:!0}}});else return this.nodesCaptionsRule.refresh()}updateEdgeCaptions(e){if(e&&(this._captionSchema.edge=e),!u.isDefined(this.edgesCaptionsRule))this.edgesCaptionsRule=this._ogma.styles.addRule({edgeAttributes:{text:{content:t=>{if(t===void 0||t.getData()===void 0)return"";const i=F.getText(t.getData(),this._captionSchema.edge,this._graphSchema.edge);return u.isDefined(this._edgeMaxTextLength)?u.truncate(i,"middle",this._edgeMaxTextLength):i}}},edgeSelector:t=>!t.isVirtual(),edgeDependencies:{self:{data:!0,attributes:["shape.style"]}}});else return this.edgesCaptionsRule.refresh()}}function R(r){return typeof r=="function"}function mg(r){return R(r==null?void 0:r.lift)}function cr(r){return function(e){if(mg(e))return e.lift(function(t){try{return r(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}var Oe=function(r,e){return Oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},Oe(r,e)};function Ye(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Oe(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Pt(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Le(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(o){a={error:o}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return s}function Ie(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return r.concat(s||Array.prototype.slice.call(e))}function Sg(r){var e=function(i){Error.call(i),i.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Ae=Sg(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
2
- `+t.map(function(i,n){return n+1+") "+i.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=t}});function Rt(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var We=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,i,n,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Pt(a),l=o.next();!l.done;l=o.next()){var d=l.value;d.remove(this)}}catch(b){e={error:b}}finally{try{l&&!l.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(R(c))try{c()}catch(b){s=b instanceof Ae?b.errors:[b]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=Pt(h),v=f.next();!v.done;v=f.next()){var S=v.value;try{Mt(S)}catch(b){s=s??[],b instanceof Ae?s=Ie(Ie([],Le(s)),Le(b.errors)):s.push(b)}}}catch(b){i={error:b}}finally{try{v&&!v.done&&(n=f.return)&&n.call(f)}finally{if(i)throw i.error}}}if(s)throw new Ae(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Mt(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Rt(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&Rt(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();We.EMPTY;function Cg(r){return r instanceof We||r&&"closed"in r&&R(r.remove)&&R(r.add)&&R(r.unsubscribe)}function Mt(r){R(r)?r():r.unsubscribe()}var Ag={setTimeout:function(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,Ie([r,e],Le(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Eg(r){Ag.setTimeout(function(){throw r})}function Gt(){}var gr=function(r){Ye(e,r);function e(t){var i=r.call(this)||this;return i.isStopped=!1,t?(i.destination=t,Cg(t)&&t.add(i)):i.destination=$g,i}return e.create=function(t,i,n){return new Fg(t,i,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(We),xg=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){te(i)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){te(i)}else te(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){te(t)}},r}(),Fg=function(r){Ye(e,r);function e(t,i,n){var s=r.call(this)||this,a;return R(t)||!t?a={next:t??void 0,error:i??void 0,complete:n??void 0}:a=t,s.destination=new xg(a),s}return e}(gr);function te(r){Eg(r)}function Tg(r){throw r}var $g={closed:!0,next:Gt,error:Tg,complete:Gt};function Ng(r){return r}function hr(r,e,t,i,n){return new Dg(r,e,t,i,n)}var Dg=function(r){Ye(e,r);function e(t,i,n,s,a,o){var l=r.call(this,t)||this;return l.onFinalize=a,l.shouldUnsubscribe=o,l._next=i?function(d){try{i(d)}catch(c){t.error(c)}}:r.prototype._next,l._error=s?function(d){try{s(d)}catch(c){t.error(c)}finally{this.unsubscribe()}}:r.prototype._error,l._complete=n?function(){try{n()}catch(d){t.error(d)}finally{this.unsubscribe()}}:r.prototype._complete,l}return e.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var i=this.closed;r.prototype.unsubscribe.call(this),!i&&((t=this.onFinalize)===null||t===void 0||t.call(this))}},e}(gr);function wg(r,e){return cr(function(t,i){var n=0;t.subscribe(hr(i,function(s){i.next(r.call(e,s,n++))}))})}function Og(r,e){return e===void 0&&(e=Ng),r=r??Lg,cr(function(t,i){var n,s=!0;t.subscribe(hr(i,function(a){var o=e(a);(s||!r(n,o))&&(s=!1,n=o,i.next(a))}))})}function Lg(r,e){return r===e}class fr extends Sr.BehaviorSubject{constructor(e){super(e)}dispatch(e){this.next(e(this.value))}selectStore(e){return this.pipe(wg(e),Og((t,i)=>u.isEqual(t,i)))}clear(){this.next({selection:void 0,items:{node:[],edge:[]},changes:void 0,animation:!1})}}class Ig{constructor(e){this._store=new fr({selection:void 0,items:{node:[],edge:[]},changes:void 0,animation:!1}),this._ogma=e,this.listenToSelectionEvents()}get store(){return this._store}listenToSelectionEvents(){let e=Date.now(),t=!1;this._ogma.events.on("animate",i=>{if(i.updatesPositions===!1)return;t||(t=!0,this._store.dispatch(a=>({...a,animation:!0})));const n=Math.max(e,Date.now()+i.duration);if(n===e)return;e=n;const s=e-Date.now()+16;clearTimeout(this._animationThrottle),this._animationThrottle=setTimeout(()=>{t=!1,this._store.dispatch(a=>({...a,animation:!1}))},s)}),this._ogma.events.on("dragStart",()=>{this._store.dispatch(i=>({...i,animation:!0}))}),this._ogma.events.on("dragEnd",()=>{this._store.dispatch(i=>({...i,animation:!1}))}),this._ogma.events.on("addNodes",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("removeNodes",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("addEdges",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("removeEdges",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("geoDisabled",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("geoEnabled",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("nodesSelected",()=>{this._store.dispatch(this.storeNodeSelection.bind(this))}),this._ogma.events.on("edgesSelected",()=>{this._store.dispatch(this.storeEdgeSelection.bind(this))}),this._ogma.events.on("nodesUnselected",()=>{this._store.dispatch(this.storeNodeSelection.bind(this))}),this._ogma.events.on("edgesUnselected",()=>{this._store.dispatch(this.storeEdgeSelection.bind(this))}),this._ogma.events.on("updateNodeData",i=>{i!==void 0&&i.changes.forEach(n=>{this._store.dispatch(s=>({...s,changes:{entityType:"node",input:n.property,value:n.newValues[0]}}))})}),this._ogma.events.on("updateEdgeData",i=>{i!==void 0&&i.changes.forEach(n=>{this._store.dispatch(s=>({...s,changes:{entityType:"edge",input:n.property,value:n.newValues[0]}}))})})}storeItems(e){return{...e,items:{node:this._ogma.getNodes().getId(),edge:this._ogma.getEdges().getId()}}}storeNodeSelection(e){return{...e,selection:this._ogma.getSelectedNodes()}}storeEdgeSelection(e){return{...e,selection:this._ogma.getSelectedEdges()}}}const pr=750;class Pg extends mr{constructor(e,t){super(e),this._configuration=e,Object.setPrototypeOf(this,new.target.prototype),this.initOgmaLinkuriousParser(!0,t)}initOgmaLinkuriousParser(e,t){this.nodeCategoriesWatcher=this.schema.watchNodeNonObjectProperty({path:"categories",unwindArrays:!0,filter:"all"}),this.edgeTypeWatcher=this.schema.watchEdgeNonObjectProperty({path:"type",filter:"all"}),this.setOptions({interactions:{zoom:{maxValue:i=>128/i.smallestNodeSize},selection:{enabled:!1}}}),this._reactive===void 0?(this._reactive=new Ig(this),this.store=this._reactive.store):this._reactive.listenToSelectionEvents(),this.initSelection(),this.setConfigOgma(this._configuration,e,t),this.LKTransformation=new yr(this),this.LkNodeGroupingTransformation=new q(this),this.LKStyles.setNodesDefaultHalo(),this.LKStyles.setEdgesDefaultHalo(),this.LKStyles.refreshCounterBadgeClass(),this.LKStyles.setFilterClass()}initSelection(){this.events.onClick(e=>{if(e!==void 0&&e.button==="left")if(e.target!==null){const t=navigator.platform==="MacIntel"?"cmd":"ctrl";this.keyboard.isKeyPressed(t)?(e.target.isNode&&this.getSelectedEdges().size>0&&this.getSelectedEdges().setSelected(!1),!e.target.isNode&&this.getSelectedNodes().size>0&&this.getSelectedNodes().setSelected(!1),e.target.isSelected()?e.target.setSelected(!1):e.target.setSelected(!0)):(this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1),e.target.setSelected(!0))}else this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1)})}setStyles(e,t){var i,n,s,a;this.LKStyles=new lr(this,{node:((n=(i=e==null?void 0:e.options)==null?void 0:i.styles)==null?void 0:n.node)||{},edge:((a=(s=e==null?void 0:e.options)==null?void 0:s.styles)==null?void 0:a.edge)||{},baseUrl:t}),this.LKStyles.setNodesDefaultStyles(),this.LKStyles.setEdgesDefaultStyles()}setCaptions(e){var n,s,a,o,l,d,c,h;const t=(o=(a=(s=(n=e==null?void 0:e.options)==null?void 0:n.styles)==null?void 0:s.node)==null?void 0:a.text)==null?void 0:o.maxTextLength,i=(h=(c=(d=(l=e==null?void 0:e.options)==null?void 0:l.styles)==null?void 0:d.edge)==null?void 0:c.text)==null?void 0:h.maxTextLength;this.LKCaptions=new dr(this,t,i)}getForceLayoutParams(e,t=0){let i=300-.052*this.getNodes().size;return i<40&&(i=40),{steps:e===g.ForceLayoutMode.FAST?i:300,alignSiblings:this.getNodes().size>3,duration:t,charge:20,gravity:.08,theta:this.getNodes().size>100?.8:.34}}getRadialLayoutParams(e,t=0){return{centralNode:e,radiusDelta:1,nodeGap:10,repulsion:this.getNodes().size>80?1:6,duration:t}}getHierarchicalLayoutParams(e,t,i=0){return{direction:e,roots:[t],duration:i}}async init(e){this.clearGraph();let t,i=[];const n=e.nodes.map(a=>(a.attributes.selected&&(t=g.EntityType.NODE,i.push(a.id)),delete a.attributes.selected,a)),s=e.edges.map(a=>(a.attributes!==void 0&&(a.attributes.selected&&((t===void 0||t===g.EntityType.NODE)&&(t=g.EntityType.EDGE,i=[]),i.push(a.id)),delete a.attributes.selected),a));await this.addGraphAfterValidation({nodes:n,edges:s}),t===g.EntityType.NODE?this.getNodes(i).setSelected(!0):t===g.EntityType.EDGE&&this.getEdges(i).setSelected(!0)}async initVisualization(e){await this.init(e);const t=p.sanitizeStylesIndex(e.design.styles);this.LKStyles.initNodeColors(t.node),this.LKStyles.initNodesIcons(t.node),this.LKStyles.initNodesSizes(t.node),this.LKStyles.initNodesShapes(t.node),this.LKStyles.initEdgesWidth(t.edge),this.LKStyles.initEdgesShape(t.edge),this.LKStyles.initEdgesColor(t.edge),await this.LKStyles.initBadges(t.badges),await this.LKCaptions.initVizCaptions({node:e.nodeFields.captions||{},edge:e.edgeFields.captions||{}}),this.LKTransformation.groupedEdges=e.edgeGrouping,await this.LKTransformation.initTransformation(),this.LKTransformation.initEdgeGroupingStyle()}async addGraphAfterValidation(e){const t=await this.addNodes(e.nodes),i=await this.addEdges(e.edges);return{nodes:t,edges:i}}addEdges(e,t){return super.addEdges(e,{...t,ignoreInvalid:!0})}getNonFilteredNodes(e){return u.isDefined(e)?this.getNodes(e).filter(t=>!t.hasClass("filtered")):this.getNodes("raw").filter(t=>!t.hasClass("filtered"))}getFilteredNodes(e,t="raw"){return u.isDefined(e)?this.getNodes(e).filter(i=>i.hasClass("filtered")):this.getNodes(t).filter(i=>i.hasClass("filtered"))}getNonFilteredEdges(e){return u.isDefined(e)?this.getEdges(e).filter(t=>!t.hasClass("filtered")):this.getEdges("raw").filter(t=>!t.hasClass("filtered"))}getFilteredEdges(e,t="raw"){return u.isDefined(e)?this.getEdges(e).filter(i=>i.hasClass("filtered")):this.getEdges(t).filter(i=>i.hasClass("filtered"))}shutDown(){this.destroy(),this.store&&this.store.clear()}clearOgmaState(){this.reset(),this.store&&this.store.clear(),this.initOgmaLinkuriousParser()}setConfigOgma(e,t,i){e&&(this._configuration=e),t||this.setOptions({...this._configuration.options,renderer:this._configuration.renderer}),this.setStyles(this._configuration,i),this.setCaptions(this._configuration)}getSelectedNodes(){return this.getNodes("all").filter(e=>e.isSelected())}clearSelection(){this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1)}}const re={lightsalmon:{hex:"#FFA07A",rgb:"rbg(255,160,122)"},salmon:{hex:"#FA8072",rgb:"rgb(250,128,114)"},darksalmon:{hex:"#E9967A",rgb:"rgb(233,150,122)"},lightcoral:{hex:"#F08080",rgb:"rgb(240,128,128)"},indianred:{hex:"#CD5C5C",rgb:"rgb(205,92,92)"},crimson:{hex:"#DC143C",rgb:"rgb(220,20,60)"},firebrick:{hex:"#B22222",rgb:"rgb(178,34,34)"},red:{hex:"#FF0000",rgb:"rgb(255,0,0)"},darkred:{hex:"#8B0000",rgb:"rgb(139,0,0)"},coral:{hex:"#FF7F50",rgb:"rgb(255,127,80)"},tomato:{hex:"#FF6347",rgb:"rgb(255,99,71)"},orangered:{hex:"#FF4500",rgb:"rgb(255,69,0)"},gold:{hex:"#FFD700",rgb:"rgb(255,215,0)"},orange:{hex:"#FFA500",rgb:"rgb(255,165,0)"},darkorange:{hex:"#FF8C00",rgb:"rgb(255,140,0)"},lightyellow:{hex:"#FFFFE0",rgb:"rgb(255,255,224)"},lemonchiffon:{hex:"#FFFACD",rgb:"rgb(255,250,205)"},lightgoldenrodyellow:{hex:"#FAFAD2",rgb:"rgb(250,250,210)"},papayawhip:{hex:"#FFEFD5",rgb:"rgb(255,239,213)"},moccasin:{hex:"#FFE4B5",rgb:"rgb(255,228,181)"},peachpuff:{hex:"#FFDAB9",rgb:"rgb(255,218,185)"},palegoldenrod:{hex:"#EEE8AA",rgb:"rgb(238,232,170)"},khaki:{hex:"#F0E68C",rgb:"rgb(240,230,140)"},darkkhaki:{hex:"#BDB76B",rgb:"rgb(189,183,107)"},yellow:{hex:"#FFFF00",rgb:"rgb(255,255,0)"},lawngreen:{hex:"#7CFC00",rgb:"rgb(124,252,0)"},chartreuse:{hex:"#7FFF00",rgb:"rgb(127,255,0)"},limegreen:{hex:"#32CD32",rgb:"rgb(50,205,50)"},lime:{hex:"#00FF00",rgb:"rgb(0.255.0)"},forestgreen:{hex:"#228B22",rgb:"rgb(34,139,34)"},green:{hex:"#008000",rgb:"rgb(0,128,0)"},darkgreen:{hex:"#006400",rgb:"rgb(0,100,0)"},greenyellow:{hex:"#ADFF2F",rgb:"rgb(173,255,47)"},yellowgreen:{hex:"#9ACD32",rgb:"rgb(154,205,50)"},springgreen:{hex:"#00FF7F",rgb:"rgb(0,255,127)"},mediumspringgreen:{hex:"#00FA9A",rgb:"rgb(0,250,154)"},lightgreen:{hex:"#90EE90",rgb:"rgb(144,238,144)"},palegreen:{hex:"#98FB98",rgb:"rgb(152,251,152)"},darkseagreen:{hex:"#8FBC8F",rgb:"rgb(143,188,143)"},mediumseagreen:{hex:"#3CB371",rgb:"rgb(60,179,113)"},seagreen:{hex:"#2E8B57",rgb:"rgb(46,139,87)"},olive:{hex:"#808000",rgb:"rgb(128,128,0)"},darkolivegreen:{hex:"#556B2F",rgb:"rgb(85,107,47)"},olivedrab:{hex:"#6B8E23",rgb:"rgb(107,142,35)"},lightcyan:{hex:"#E0FFFF",rgb:"rgb(224,255,255)"},cyan:{hex:"#00FFFF",rgb:"rgb(0,255,255)"},aqua:{hex:"#00FFFF",rgb:"rgb(0,255,255)"},aquamarine:{hex:"#7FFFD4",rgb:"rgb(127,255,212)"},mediumaquamarine:{hex:"#66CDAA",rgb:"rgb(102,205,170)"},paleturquoise:{hex:"#AFEEEE",rgb:"rgb(175,238,238)"},turquoise:{hex:"#40E0D0",rgb:"rgb(64,224,208)"},mediumturquoise:{hex:"#48D1CC",rgb:"rgb(72,209,204)"},darkturquoise:{hex:"#00CED1",rgb:"rgb(0,206,209)"},lightseagreen:{hex:"#20B2AA",rgb:"rgb(32,178,170)"},cadetblue:{hex:"#5F9EA0",rgb:"rgb(95,158,160)"},darkcyan:{hex:"#008B8B",rgb:"rgb(0,139,139)"},teal:{hex:"#008080",rgb:"rgb(0,128,128)"},powderblue:{hex:"#B0E0E6",rgb:"rgb(176,224,230)"},lightblue:{hex:"#ADD8E6",rgb:"rgb(173,216,230)"},lightskyblue:{hex:"#87CEFA",rgb:"rgb(135,206,250)"},skyblue:{hex:"#87CEEB",rgb:"rgb(135,206,235)"},deepskyblue:{hex:"#00BFFF",rgb:"rgb(0,191,255)"},lightsteelblue:{hex:"#B0C4DE",rgb:"rgb(176,196,222)"},dodgerblue:{hex:"#1E90FF",rgb:"rgb(30,144,255)"},cornflowerblue:{hex:"#6495ED",rgb:"rgb(100,149,237)"},steelblue:{hex:"#4682B4",rgb:"rgb(70,130,180)"},royalblue:{hex:"#4169E1",rgb:"rgb(65,105,225)"},blue:{hex:"#0000FF",rgb:"rgb(0,0,255)"},mediumblue:{hex:"#0000CD",rgb:"rgb(0,0,205)"},darkblue:{hex:"#00008B",rgb:"rgb(0,0,139)"},navy:{hex:"#000080",rgb:"rgb(0,0,128)"},midnightblue:{hex:"#191970",rgb:"rgb(25,25,112)"},mediumslateblue:{hex:"#7B68EE",rgb:"rgb(123,104,238)"},slateblue:{hex:"#6A5ACD",rgb:"rgb(106,90,205)"},darkslateblue:{hex:"#483D8B",rgb:"rgb(72,61,139)"},lavender:{hex:"#E6E6FA",rgb:"rgb(230,230,250)"},thistle:{hex:"#D8BFD8",rgb:"rgb(216,191,216)"},plum:{hex:"#DDA0DD",rgb:"rgb(221,160,221)"},violet:{hex:"#EE82EE",rgb:"rgb(238,130,238)"},orchid:{hex:"#DA70D6",rgb:"rgb(218,112,214)"},fuchsia:{hex:"#FF00FF",rgb:"rgb(255,0,255)"},magenta:{hex:"#FF00FF",rgb:"rgb(255,0,255)"},mediumorchid:{hex:"#BA55D3",rgb:"rgb(186,85,211)"},mediumpurple:{hex:"#9370DB",rgb:"rgb(147,112,219)"},blueviolet:{hex:"#8A2BE2",rgb:"rgb(138,43,226)"},darkviolet:{hex:"#9400D3",rgb:"rgb(148,0,211)"},darkorchid:{hex:"#9932CC",rgb:"rgb(153,50,204)"},darkmagenta:{hex:"#8B008B",rgb:"rgb(139,0,139)"},purple:{hex:"#800080",rgb:"rgb(128,0,128)"},indigo:{hex:"#4B0082",rgb:"rgb(75,0,130)"},pink:{hex:"#FFC0CB",rgb:"rgb(255,192,203)"},lightpink:{hex:"#FFB6C1",rgb:"rgb(255,182,193)"},hotpink:{hex:"#FF69B4",rgb:"rgb(255,105,180)"},deeppink:{hex:"#FF1493",rgb:"rgb(255,20,147)"},palevioletred:{hex:"#DB7093",rgb:"rgb(219,112,147)"},mediumvioletred:{hex:"#C71585",rgb:"rgb(199,21,133)"},white:{hex:"#FFFFFF",rgb:"rgb(255,255,255)"},snow:{hex:"#FFFAFA",rgb:"rgb(255,250,250)"},honeydew:{hex:"#F0FFF0",rgb:"rgb(240,255,240)"},mintcream:{hex:"#F5FFFA",rgb:"rgb(245,255,250)"},azure:{hex:"#F0FFFF",rgb:"rgb(240,255,255)"},aliceblue:{hex:"#F0F8FF",rgb:"rgb(240,248,255)"},ghostwhite:{hex:"#F8F8FF",rgb:"rgb(248,248,255)"},whitesmoke:{hex:"#F5F5F5",rgb:"rgb(245,245,245)"},seashell:{hex:"#FFF5EE",rgb:"rgb(255,245,238)"},beige:{hex:"#F5F5DC",rgb:"rgb(245,245,220)"},oldlace:{hex:"#FDF5E6",rgb:"rgb(253,245,230)"},floralwhite:{hex:"#FFFAF0",rgb:"rgb(255,250,240)"},ivory:{hex:"#FFFFF0",rgb:"rgb(255,255,240)"},antiquewhite:{hex:"#FAEBD7",rgb:"rgb(250,235,215)"},linen:{hex:"#FAF0E6",rgb:"rgb(250,240,230)"},lavenderblush:{hex:"#FFF0F5",rgb:"rgb(255,240,245)"},mistyrose:{hex:"#FFE4E1",rgb:"rgb(255,228,225)"},gainsboro:{hex:"#DCDCDC",rgb:"rgb(220,220,220)"},lightgray:{hex:"#D3D3D3",rgb:"rgb(211,211,211)"},silver:{hex:"#C0C0C0",rgb:"rgb(192,192,192)"},darkgray:{hex:"#A9A9A9",rgb:"rgb(169,169,169)"},gray:{hex:"#808080",rgb:"rgb(128,128,128)"},dimgray:{hex:"#696969",rgb:"rgb(105,105,105)"},lightslategray:{hex:"#778899",rgb:"rgb(119,136,153)"},slategray:{hex:"#708090",rgb:"rgb(112,128,144)"},darkslategray:{hex:"#2F4F4F",rgb:"rgb(47,79,79)"},black:{hex:"#000000",rgb:"rgb(0,0,0)"},cornsilk:{hex:"#FFF8DC",rgb:"rgb(255,248,220)"},blanchedalmond:{hex:"#FFEBCD",rgb:"rgb(255,235,205)"},bisque:{hex:"#FFE4C4",rgb:"rgb(255,228,196)"},navajowhite:{hex:"#FFDEAD",rgb:"rgb(255,222,173)"},wheat:{hex:"#F5DEB3",rgb:"rgb(245,222,179)"},burlywood:{hex:"#DEB887",rgb:"rgb(222,184,135)"},tan:{hex:"#D2B48C",rgb:"rgb(210,180,140)"},rosybrown:{hex:"#BC8F8F",rgb:"rgb(188,143,143)"},sandybrown:{hex:"#F4A460",rgb:"rgb(244,164,96)"},goldenrod:{hex:"#DAA520",rgb:"rgb(218,165,32)"},peru:{hex:"#CD853F",rgb:"rgb(205,133,63)"},chocolate:{hex:"#D2691E",rgb:"rgb(210,105,30)"},saddlebrown:{hex:"#8B4513",rgb:"rgb(139,69,19)"},sienna:{hex:"#A0522D",rgb:"rgb(160,82,45)"},brown:{hex:"#A52A2A",rgb:"rgb(165,42,42)"},maroon:{hex:"#800000",rgb:"rgb(128,0,0)"}},br={steps:250,alignSiblings:!0,charge:20,theta:.34,duration:pr,gravity:.0475,gpu:!0};class P{static getHiddenNeighbors(e){return e.reduce((t,i)=>{const n=i.getData("statistics");if(n!==void 0){const s=n.degree!==void 0&&!n.supernode?n.degree-u.getDegreeWithoutSelfConnection(i):n.supernodeDegree;if(s!==void 0&&s>0)return t+=s}return t},0)}static getDegreeWithoutSelfConnection(e){return e.getAdjacentNodes({policy:"exclude-sources",filter:"all"}).size}static isBright(e){if(e===null||!u.isStringFilled(e))return!0;const t=/#[A-Fa-f0-9]{3,6}/,i=/^rgb\(\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*\)$/i,n=/^rgba\(\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*(?:0|1|0?\.\d+)\s*\)$/i;let s;if(t.test(e)){e.length<5&&(e+=e.slice(1)),e=e.replace("#","");const d=parseInt(e[0].toString()+e[1].toString(),16),c=parseInt(e[2].toString()+e[3].toString(),16),h=parseInt(e[4].toString()+e[5].toString(),16);s=`rgb(${d}, ${c}, ${h})`}else if(i.test(e)||n.test(e)||re[e.toLowerCase()]!==void 0)s=u.isDefined(re[e.toLowerCase()])?re[e.toLowerCase()].rgb:e;else return!0;const[a,o,l]=/rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,(?:0|1|0?\.\d+))?\)/.exec(s.replace(/\s/g,"")).slice(1,4);return!u.isDefined(a)||!u.isDefined(o)||!u.isDefined(l)?(console.warn("The given color is not a valid rgb formatted color"),!0):(+a*299+ +o*587+ +l*114)/1e3>255*.7}static isNode(e){return e.isNode}static isNodeList(e){return e.isNode}static topologicalSort(e){const i=e.toArray().filter(a=>a.getDegree()===1),n=new Set,s=[];return i.forEach(a=>{let o=a;if(n.has(o))return;const l=[];for(;o;){l.push(o),n.add(o);const d=o.getAdjacentNodes().filter(c=>!n.has(c)).get(0);o=d===void 0?null:d}s.push(l)}),s.sort((a,o)=>o.length-a.length),{chain:s.flat().map(a=>a.getId()),numberOfChain:i.length/2}}static isStar(e){for(const t of e.toArray()){const i=t.getAdjacentNodes();if(t.getDegree()>2&&i.getDegree().every(s=>s===1)&&i.size+1===e.size)return t}return!1}static isGroupCollapsed(e){return e.getData("collapsed")}static setCollapsedGroupProperty(e,t){e.setData("collapsed",t)}}const ue="LKE_NODE_GROUPING_EDGE";class q{constructor(e){this._collapsedDefaultValue=!1,this._nodeGroupingAttributes=[],this._ogma=e}setGroupingRule(e){this.groupRule=e}async initTransformation(){this.transformation===void 0?this.transformation=this._ogma.transformations.addNodeGrouping({groupIdFunction:e=>{if(this._isRuleNotApplicableToNode(e))return;const t=this.groupRule;return t.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._getAdjacentEdgeGroupId(e,t):this._getPropertyValueGroupId(e,t)},nodeGenerator:e=>{const t=new Set(e.getData("categories").flat()),i=this._findNodeGroupId(e);return{data:{categories:[],subCategories:Array.from(t),collapsed:this._getDefaultCollapsedState(i),nodeGroupId:i},attributes:{layoutable:this._getDefaultLayoutableValue(i)}}},onGroupUpdate:(e,t)=>{if(t.size!==1)return{layout:"force",params:{...br}}},edgeGenerator:()=>({data:{type:ue}}),showContents:e=>!P.isGroupCollapsed(e),duration:300,padding:10}):await this.refreshTransformation(),await this._ogma.transformations.afterNextUpdate()}async refreshTransformation(){this.transformation!==void 0?(await this.transformation.refresh(),await this._unpinNodes(this._getAllTransformationRawNodes())):await this.initTransformation()}initNodeGroupingStyle(){this._nodeGroupingStyleRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:e=>this._getNodeGroupingCaption(e),style:"bold"},layer:-1,color:"rgba(240, 240, 240)",innerStroke:{color:"#7f7f7f",width:2}},nodeSelector:e=>e.isVirtual()&&!P.isGroupCollapsed(e),nodeDependencies:{self:{data:!0}}}),this._initIntermediateGroupStyle(),this._nodeGroupingCollapsedStyleRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:e=>this._getNodeGroupingCaption(e),style:"bold"},halo:{width:4,color:"#e4ebea",strokeColor:"#ccc"},badges:{bottomLeft:e=>{var i;const t=(i=e.getSubNodes().filter(n=>!n.hasClass("filtered")))==null?void 0:i.size;return{color:Y,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:u.isDefined(this._ogma.LKStyles.nodeFont)?this._ogma.LKStyles.nodeFont:ur,scale:.4,color:oe,content:`x${t}`}}},topLeft:()=>({color:Y,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:"FontAwesome",scale:.4,color:oe,content:""}})},color:e=>{if(e!==void 0)return this._ogma.LKStyles.nodeAttributes.color({geo:{},isVirtual:!1,properties:{},readAt:0,categories:e.getData("subCategories")})},icon:e=>{const t=e==null?void 0:e.getData("subCategories");if(!(!u.isDefined(e)||t.length>1))return this._ogma.LKStyles.nodeAttributes.icon({geo:{},isVirtual:!1,properties:{},readAt:0,categories:t}).icon}},nodeSelector:e=>e.isVirtual()&&P.isGroupCollapsed(e)&&!e.hasClass("filtered")}),this._setSubSelectedClass()}async refreshNodeGroupingStyle(){var e,t;await((e=this._nodeGroupingStyleRule)==null?void 0:e.refresh()),await((t=this._nodeGroupingCollapsedStyleRule)==null?void 0:t.refresh())}getVirtualNodesOfTransformation(){return this.transformation.getContext().metaNodes}setNodeGroupingAttributes(e){this._nodeGroupingAttributes=e}setCollapseDefaultValue(e){this._collapsedDefaultValue=e}_getNodeGroupingCaption(e){if(!(!u.isDefined(e)||!u.isDefined(this.groupRule)))return this.groupRule.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._getAdjacentEdgeNodeGroupingCaption(e,this.groupRule):this._getPropertyValueNodeGroupingCaption(e,this.groupRule)}_getAdjacentEdgeNodeGroupingCaption(e,t){const i=e.getSubNodes();return!u.isDefined(i)||!u.isDefined(i.get(0))?void 0:q._getGroupCentralNode(i.get(0),t).getData(["properties","name"])}_getPropertyValueNodeGroupingCaption(e,t){var i;if(e.isVirtual()&&((i=e.getSubNodes())==null?void 0:i.get(0))!==void 0){const n=e.getSubNodes().get(0).getData(["properties",t.groupingOptions.propertyKey]),s=u.getValueFromLkProperty(n),a=e.getSubNodes().filter(o=>!o.hasClass("filtered")).size;return`${s} (${a})`}}_isRuleNotApplicableToNode(e){const t=this.groupRule;return t===void 0?!0:t.groupingType===g.NodeGroupingType.BY_PROPERTY_VALUE?this._isPropertyRuleNotApplicableToNode(e,t):t.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._isRelationshipRuleNotApplicableToNode(e,t):!0}_isRelationshipRuleNotApplicableToNode(e,t){return!this._hasEdgeOfType(e,t.groupingOptions.edgeType)}_hasEdgeOfType(e,t){let i=!1;return e.getAdjacentEdges().forEach(n=>{n.getData("type")===t&&(i=!0)}),i}_isPropertyRuleNotApplicableToNode(e,t){const i=e.getData(["properties",t.groupingOptions.propertyKey??""]);return t.groupingOptions.itemTypes.every(n=>!e.getData("categories").includes(n))||!u.isDefined(i)||typeof i=="object"&&i.status==="missing"}async _unpinNodes(e){await Promise.all(e.map(t=>t!==null?t.setAttribute("layoutable",!0):Promise.resolve()))}_getAllTransformationRawNodes(){return this.getVirtualNodesOfTransformation().getSubNodes()}_findGroupingPropertyValue(e){const t=this.groupRule,i=e.getData(["properties",t.groupingOptions.propertyKey??""]);return`${u.getValueFromLkProperty(i)}`}_findNodeGroupId(e){var i;const t=this.groupRule;if(t.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE){const n=q._getGroupCentralNode(e.get(0),t);return ae(`${(i=this.groupRule)==null?void 0:i.name}-${n.getId()}`)}else{const n=this._findGroupingPropertyValue(e.get(0));return ae(`${t.name}-${t.groupingOptions.itemTypes.join("-")}-${n}`)}}static _getGroupCentralNode(e,t){const i=e.getAdjacentEdges({filter:"raw"}).filter(n=>n.getData("type")===t.groupingOptions.edgeType).get(0);return t.groupingOptions.centralNodeIs==="source"?i.getSource():i.getTarget()}_getPropertyValueGroupId(e,t){const i=this._findGroupingPropertyValue(e);return`${t.groupingOptions.itemTypes.join("-")}-${i}`.toLowerCase().trim()}_getAdjacentEdgeGroupId(e,t){return q._getGroupCentralNode(e,t).getId().toString()}_initIntermediateGroupStyle(){this._ogma.styles.addRule({nodeAttributes:{color:"rgba(240, 240, 240)"},nodeSelector:e=>e.isVirtual()&&P.isGroupCollapsed(e),nodeDependencies:{self:{data:!0}}})}_getDefaultCollapsedState(e){const t=this._nodeGroupingAttributes.find(i=>i.id===e);return u.isDefined(t)&&u.isDefined(t.attributes.collapsed)?t.attributes.collapsed:this._collapsedDefaultValue}_getDefaultLayoutableValue(e){const t=this._nodeGroupingAttributes.find(i=>i.id===e);return u.isDefined(t)&&u.isDefined(t.attributes.layoutable)?t.attributes.layoutable:!0}_setSubSelectedClass(){this._ogma.styles.createClass({name:"subSelection",nodeAttributes:{halo:{width:4,color:"#e67a8f",strokeColor:"#ccc"}}})}}const Rg={color:"#000000",shape:{style:"dashed",head:"arrow"},width:1.5};class yr{constructor(e){this._ogma=e,this.groupedEdges={}}async initTransformation(){this.transformation===void 0?this.transformation=this._ogma.transformations.addEdgeGrouping({separateEdgesByDirection:!0,selector:e=>this.groupedEdges[e.getData("type")],groupIdFunction:e=>e.getData("type"),generator:e=>({data:{properties:{originalType:e.getData("type")[0]}}})}):await this.transformation.refresh()}initEdgeGroupingStyle(){this.edgeGroupingStyleRule=this._ogma.styles.addRule({edgeAttributes:{...Rg,...this.edgeGroupStyle,text:{content:e=>{if(e!==void 0&&e.getSubEdges()!==null&&e.getData("type")!==ue){const t=e.getSubEdges().filter(i=>!i.hasClass("filtered")).size;return`${e.getData(["properties","originalType"])} (${t})`}},style:"bold"}},edgeSelector:e=>e.isVirtual()&&e.getSubEdges()&&e.getSubEdges().filter(t=>!t.hasClass("filtered")).size>0&&e.getData("type")!==ue,edgeDependencies:{self:{data:!0}}})}refreshEdgeGroupingStyle(){this.edgeGroupingStyleRule!==void 0&&this.edgeGroupingStyleRule.refresh()}}const _=class _{static isFiltered(e,t){return u.isDefined(t)?"categories"in t?_.getFilterFunction(e,!0)(t):_.getFilterFunction(e,!1)(t):!1}static getFilterFunction(e,t){const i=JSON.stringify(e,null,""),n=t?_.nodeCache:_.edgeCache;let s=n.get(i);return s||(s=_.createFilterFunction(e,t),n.size>_.FILTER_CACHE_SIZE&&n.clear(),n.set(i,s)),s}static createFilterFunction(e,t){const i=e.map(n=>_.filterToFilterFunction(n,t));return n=>{for(const s of i)if(s(n))return!0;return!1}}static filterToFilterFunction(e,t){switch(e.type){case g.SelectorType.ANY:return _.createAnyFilterFunction(e,t);case g.SelectorType.IS:return _.createIsFilterFunction(e,t);case g.SelectorType.NO_VALUE:return _.createNoValueFilterFunction(e,t);case g.SelectorType.RANGE:return _.createRangeFilterFunction(e,t);case g.SelectorType.NAN:return _.createNaNFilterFunction(e,t)}}static createAnyFilterFunction(e,t){return t?i=>e.itemType===void 0?!0:i.categories.includes(e.itemType):i=>i.type===e.itemType}static createIsFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&u.getPropertyValue(u.getIn(i,e.input),!0)===e.value:i=>i.type===e.itemType&&u.getPropertyValue(u.getIn(i,e.input),!0)===e.value}static createNoValueFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&!u.isDefined(u.getPropertyValue(u.getIn(i,e.input),!0)):i=>i.type===e.itemType&&!u.isDefined(u.getPropertyValue(u.getIn(i,e.input),!0))}static createNaNFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&_.isNotANumber(u.getPropertyValue(u.getIn(i,e.input),!0)):i=>i.type===e.itemType&&_.isNotANumber(u.getPropertyValue(u.getIn(i,e.input),!0))}static isNotANumber(e){return u.isDefined(e)&&!u.isNumber(e)}static createRangeFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&_.valueShouldBeHidden(u.getPropertyValue(u.getIn(i,e.input),!1),e.value):i=>i.type===e.itemType&&_.valueShouldBeHidden(u.getPropertyValue(u.getIn(i,e.input),!1),e.value)}static valueShouldBeHidden(e,t){const i=u.parseFloat(e);return Number.isNaN(i)?!1:t["<"]!==void 0&&i<t["<"]||t["<="]!==void 0&&i<=t["<="]||t[">"]!==void 0&&i>t[">"]||t[">="]!==void 0&&i>=t[">="]}};_.nodeCache=new Map,_.edgeCache=new Map,_.FILTER_CACHE_SIZE=5;let Pe=_;const Mg=r=>r.selection.size,Gg=r=>{switch(r.selection.size){case 1:return"selection";case 0:return"noSelection";default:return"multiSelection"}},Bg=r=>{if(!(!u.isDefined(r.selection)||r.selection.size===0))return r.selection.isNode?g.EntityType.NODE:g.EntityType.EDGE},ve=r=>u.isDefined(r.selection)&&r.selection.size===1?r.selection.get(0):void 0,zg=r=>{const e=ve(r);if(e!==void 0)return e.isNode?e.getData("categories"):[e.getData("type")]},Ug=r=>{const e=ve(r);if(e!==void 0)return e.isNode?"node":"edge"},vr=r=>{const e=ve(r);if(e!==void 0){const t=e.getData().properties;return Object.keys(t).map(i=>({key:i,value:t[i]}))}return[]},jg=r=>vr(r).length>0;exports.ANIMATION_DURATION=pr;exports.BADGE_COLOR=Y;exports.BASE_GREY=E;exports.Captions=F;exports.CaptionsViz=dr;exports.EdgeAttributes=z;exports.FILTER_OPACITY=we;exports.FORCE_LAYOUT_CONFIG=br;exports.Filters=Pe;exports.HTML_COLORS=re;exports.ItemAttributes=A;exports.LKE_NODE_GROUPING_EDGE=ue;exports.LKOgma=Pg;exports.NodeAttributes=I;exports.OgmaStore=fr;exports.OgmaTools=P;exports.PALETTE=De;exports.StyleRule=C;exports.StyleRuleType=or;exports.StyleRules=p;exports.StyleType=D;exports.StylesViz=lr;exports.Tools=u;exports.TransformationsViz=yr;exports.getSelectionEntity=Bg;exports.getSelectionProperties=vr;exports.getSelectionSize=Mg;exports.getSelectionState=Gg;exports.getUniqSelection=ve;exports.getUniqSelectionEntity=Ug;exports.getUniqSelectionTypes=zg;exports.hasSelectionProperties=jg;
4
- //# sourceMappingURL=index.cjs.map
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,a)=>(a=n==null?{}:e(i(n)),s(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let l=require("@linkurious/rest-client"),u=require("@linkurious/ogma");u=c(u);let d=require("rxjs");var f=o(((e,t)=>{function n(){this.__data__=[],this.size=0}t.exports=n})),p=o(((e,t)=>{function n(e,t){return e===t||e!==e&&t!==t}t.exports=n})),m=o(((e,t)=>{var n=p();function r(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}t.exports=r})),h=o(((e,t)=>{var n=m(),r=Array.prototype.splice;function i(e){var t=this.__data__,i=n(t,e);return i<0?!1:(i==t.length-1?t.pop():r.call(t,i,1),--this.size,!0)}t.exports=i})),g=o(((e,t)=>{var n=m();function r(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}t.exports=r})),_=o(((e,t)=>{var n=m();function r(e){return n(this.__data__,e)>-1}t.exports=r})),v=o(((e,t)=>{var n=m();function r(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}t.exports=r})),y=o(((e,t)=>{var n=f(),r=h(),i=g(),a=_(),o=v();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),b=o(((e,t)=>{var n=y();function r(){this.__data__=new n,this.size=0}t.exports=r})),x=o(((e,t)=>{function n(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}t.exports=n})),S=o(((e,t)=>{function n(e){return this.__data__.get(e)}t.exports=n})),C=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),w=o(((e,t)=>{t.exports=typeof global==`object`&&global&&global.Object===Object&&global})),T=o(((e,t)=>{var n=w(),r=typeof self==`object`&&self&&self.Object===Object&&self;t.exports=n||r||Function(`return this`)()})),E=o(((e,t)=>{t.exports=T().Symbol})),D=o(((e,t)=>{var n=E(),r=Object.prototype,i=r.hasOwnProperty,a=r.toString,o=n?n.toStringTag:void 0;function s(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var r=!0}catch{}var s=a.call(e);return r&&(t?e[o]=n:delete e[o]),s}t.exports=s})),O=o(((e,t)=>{var n=Object.prototype.toString;function r(e){return n.call(e)}t.exports=r})),k=o(((e,t)=>{var n=E(),r=D(),i=O(),a=`[object Null]`,o=`[object Undefined]`,s=n?n.toStringTag:void 0;function c(e){return e==null?e===void 0?o:a:s&&s in Object(e)?r(e):i(e)}t.exports=c})),A=o(((e,t)=>{function n(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}t.exports=n})),ee=o(((e,t)=>{var n=k(),r=A(),i=`[object AsyncFunction]`,a=`[object Function]`,o=`[object GeneratorFunction]`,s=`[object Proxy]`;function c(e){if(!r(e))return!1;var t=n(e);return t==a||t==o||t==i||t==s}t.exports=c})),te=o(((e,t)=>{t.exports=T()[`__core-js_shared__`]})),ne=o(((e,t)=>{var n=te(),r=function(){var e=/[^.]+$/.exec(n&&n.keys&&n.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function i(e){return!!r&&r in e}t.exports=i})),re=o(((e,t)=>{var n=Function.prototype.toString;function r(e){if(e!=null){try{return n.call(e)}catch{}try{return e+``}catch{}}return``}t.exports=r})),ie=o(((e,t)=>{var n=ee(),r=ne(),i=A(),a=re(),o=/[\\^$.*+?()[\]{}|]/g,s=/^\[object .+?Constructor\]$/,c=Function.prototype,l=Object.prototype,u=c.toString,d=l.hasOwnProperty,f=RegExp(`^`+u.call(d).replace(o,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function p(e){return!i(e)||r(e)?!1:(n(e)?f:s).test(a(e))}t.exports=p})),ae=o(((e,t)=>{function n(e,t){return e?.[t]}t.exports=n})),j=o(((e,t)=>{var n=ie(),r=ae();function i(e,t){var i=r(e,t);return n(i)?i:void 0}t.exports=i})),oe=o(((e,t)=>{t.exports=j()(T(),`Map`)})),M=o(((e,t)=>{t.exports=j()(Object,`create`)})),se=o(((e,t)=>{var n=M();function r(){this.__data__=n?n(null):{},this.size=0}t.exports=r})),ce=o(((e,t)=>{function n(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}t.exports=n})),le=o(((e,t)=>{var n=M(),r=`__lodash_hash_undefined__`,i=Object.prototype.hasOwnProperty;function a(e){var t=this.__data__;if(n){var a=t[e];return a===r?void 0:a}return i.call(t,e)?t[e]:void 0}t.exports=a})),ue=o(((e,t)=>{var n=M(),r=Object.prototype.hasOwnProperty;function i(e){var t=this.__data__;return n?t[e]!==void 0:r.call(t,e)}t.exports=i})),de=o(((e,t)=>{var n=M(),r=`__lodash_hash_undefined__`;function i(e,t){var i=this.__data__;return this.size+=+!this.has(e),i[e]=n&&t===void 0?r:t,this}t.exports=i})),fe=o(((e,t)=>{var n=se(),r=ce(),i=le(),a=ue(),o=de();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),pe=o(((e,t)=>{var n=fe(),r=y(),i=oe();function a(){this.size=0,this.__data__={hash:new n,map:new(i||r),string:new n}}t.exports=a})),me=o(((e,t)=>{function n(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}t.exports=n})),N=o(((e,t)=>{var n=me();function r(e,t){var r=e.__data__;return n(t)?r[typeof t==`string`?`string`:`hash`]:r.map}t.exports=r})),he=o(((e,t)=>{var n=N();function r(e){var t=n(this,e).delete(e);return this.size-=+!!t,t}t.exports=r})),ge=o(((e,t)=>{var n=N();function r(e){return n(this,e).get(e)}t.exports=r})),_e=o(((e,t)=>{var n=N();function r(e){return n(this,e).has(e)}t.exports=r})),ve=o(((e,t)=>{var n=N();function r(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}t.exports=r})),ye=o(((e,t)=>{var n=pe(),r=he(),i=ge(),a=_e(),o=ve();function s(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}s.prototype.clear=n,s.prototype.delete=r,s.prototype.get=i,s.prototype.has=a,s.prototype.set=o,t.exports=s})),be=o(((e,t)=>{var n=y(),r=oe(),i=ye(),a=200;function o(e,t){var o=this.__data__;if(o instanceof n){var s=o.__data__;if(!r||s.length<a-1)return s.push([e,t]),this.size=++o.size,this;o=this.__data__=new i(s)}return o.set(e,t),this.size=o.size,this}t.exports=o})),xe=o(((e,t)=>{var n=y(),r=b(),i=x(),a=S(),o=C(),s=be();function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=r,c.prototype.delete=i,c.prototype.get=a,c.prototype.has=o,c.prototype.set=s,t.exports=c})),Se=o(((e,t)=>{var n=`__lodash_hash_undefined__`;function r(e){return this.__data__.set(e,n),this}t.exports=r})),Ce=o(((e,t)=>{function n(e){return this.__data__.has(e)}t.exports=n})),we=o(((e,t)=>{var n=ye(),r=Se(),i=Ce();function a(e){var t=-1,r=e==null?0:e.length;for(this.__data__=new n;++t<r;)this.add(e[t])}a.prototype.add=a.prototype.push=r,a.prototype.has=i,t.exports=a})),Te=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1}t.exports=n})),Ee=o(((e,t)=>{function n(e,t){return e.has(t)}t.exports=n})),De=o(((e,t)=>{var n=we(),r=Te(),i=Ee(),a=1,o=2;function s(e,t,s,c,l,u){var d=s&a,f=e.length,p=t.length;if(f!=p&&!(d&&p>f))return!1;var m=u.get(e),h=u.get(t);if(m&&h)return m==t&&h==e;var g=-1,_=!0,v=s&o?new n:void 0;for(u.set(e,t),u.set(t,e);++g<f;){var y=e[g],b=t[g];if(c)var x=d?c(b,y,g,t,e,u):c(y,b,g,e,t,u);if(x!==void 0){if(x)continue;_=!1;break}if(v){if(!r(t,function(e,t){if(!i(v,t)&&(y===e||l(y,e,s,c,u)))return v.push(t)})){_=!1;break}}else if(!(y===b||l(y,b,s,c,u))){_=!1;break}}return u.delete(e),u.delete(t),_}t.exports=s})),Oe=o(((e,t)=>{t.exports=T().Uint8Array})),ke=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}t.exports=n})),Ae=o(((e,t)=>{function n(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}t.exports=n})),je=o(((e,t)=>{var n=E(),r=Oe(),i=p(),a=De(),o=ke(),s=Ae(),c=1,l=2,u=`[object Boolean]`,d=`[object Date]`,f=`[object Error]`,m=`[object Map]`,h=`[object Number]`,g=`[object RegExp]`,_=`[object Set]`,v=`[object String]`,y=`[object Symbol]`,b=`[object ArrayBuffer]`,x=`[object DataView]`,S=n?n.prototype:void 0,C=S?S.valueOf:void 0;function w(e,t,n,p,S,w,T){switch(n){case x:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case b:return!(e.byteLength!=t.byteLength||!w(new r(e),new r(t)));case u:case d:case h:return i(+e,+t);case f:return e.name==t.name&&e.message==t.message;case g:case v:return e==t+``;case m:var E=o;case _:var D=p&c;if(E||=s,e.size!=t.size&&!D)return!1;var O=T.get(e);if(O)return O==t;p|=l,T.set(e,t);var k=a(E(e),E(t),p,S,w,T);return T.delete(e),k;case y:if(C)return C.call(e)==C.call(t)}return!1}t.exports=w})),Me=o(((e,t)=>{function n(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e}t.exports=n})),P=o(((e,t)=>{t.exports=Array.isArray})),Ne=o(((e,t)=>{var n=Me(),r=P();function i(e,t,i){var a=t(e);return r(e)?a:n(a,i(e))}t.exports=i})),Pe=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=0,a=[];++n<r;){var o=e[n];t(o,n,e)&&(a[i++]=o)}return a}t.exports=n})),Fe=o(((e,t)=>{function n(){return[]}t.exports=n})),Ie=o(((e,t)=>{var n=Pe(),r=Fe(),i=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols;t.exports=a?function(e){return e==null?[]:(e=Object(e),n(a(e),function(t){return i.call(e,t)}))}:r})),Le=o(((e,t)=>{function n(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}t.exports=n})),F=o(((e,t)=>{function n(e){return typeof e==`object`&&!!e}t.exports=n})),Re=o(((e,t)=>{var n=k(),r=F(),i=`[object Arguments]`;function a(e){return r(e)&&n(e)==i}t.exports=a})),ze=o(((e,t)=>{var n=Re(),r=F(),i=Object.prototype,a=i.hasOwnProperty,o=i.propertyIsEnumerable;t.exports=n(function(){return arguments}())?n:function(e){return r(e)&&a.call(e,`callee`)&&!o.call(e,`callee`)}})),Be=o(((e,t)=>{function n(){return!1}t.exports=n})),Ve=o(((e,t)=>{var n=T(),r=Be(),i=typeof e==`object`&&e&&!e.nodeType&&e,a=i&&typeof t==`object`&&t&&!t.nodeType&&t,o=a&&a.exports===i?n.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||r})),He=o(((e,t)=>{var n=9007199254740991,r=/^(?:0|[1-9]\d*)$/;function i(e,t){var i=typeof e;return t??=n,!!t&&(i==`number`||i!=`symbol`&&r.test(e))&&e>-1&&e%1==0&&e<t}t.exports=i})),Ue=o(((e,t)=>{var n=9007199254740991;function r(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=n}t.exports=r})),We=o(((e,t)=>{var n=k(),r=Ue(),i=F(),a=`[object Arguments]`,o=`[object Array]`,s=`[object Boolean]`,c=`[object Date]`,l=`[object Error]`,u=`[object Function]`,d=`[object Map]`,f=`[object Number]`,p=`[object Object]`,m=`[object RegExp]`,h=`[object Set]`,g=`[object String]`,_=`[object WeakMap]`,v=`[object ArrayBuffer]`,y=`[object DataView]`,b=`[object Float32Array]`,x=`[object Float64Array]`,S=`[object Int8Array]`,C=`[object Int16Array]`,w=`[object Int32Array]`,T=`[object Uint8Array]`,E=`[object Uint8ClampedArray]`,D=`[object Uint16Array]`,O=`[object Uint32Array]`,A={};A[b]=A[x]=A[S]=A[C]=A[w]=A[T]=A[E]=A[D]=A[O]=!0,A[a]=A[o]=A[v]=A[s]=A[y]=A[c]=A[l]=A[u]=A[d]=A[f]=A[p]=A[m]=A[h]=A[g]=A[_]=!1;function ee(e){return i(e)&&r(e.length)&&!!A[n(e)]}t.exports=ee})),Ge=o(((e,t)=>{function n(e){return function(t){return e(t)}}t.exports=n})),Ke=o(((e,t)=>{var n=w(),r=typeof e==`object`&&e&&!e.nodeType&&e,i=r&&typeof t==`object`&&t&&!t.nodeType&&t,a=i&&i.exports===r&&n.process;t.exports=function(){try{return i&&i.require&&i.require(`util`).types||a&&a.binding&&a.binding(`util`)}catch{}}()})),qe=o(((e,t)=>{var n=We(),r=Ge(),i=Ke(),a=i&&i.isTypedArray;t.exports=a?r(a):n})),Je=o(((e,t)=>{var n=Le(),r=ze(),i=P(),a=Ve(),o=He(),s=qe(),c=Object.prototype.hasOwnProperty;function l(e,t){var l=i(e),u=!l&&r(e),d=!l&&!u&&a(e),f=!l&&!u&&!d&&s(e),p=l||u||d||f,m=p?n(e.length,String):[],h=m.length;for(var g in e)(t||c.call(e,g))&&!(p&&(g==`length`||d&&(g==`offset`||g==`parent`)||f&&(g==`buffer`||g==`byteLength`||g==`byteOffset`)||o(g,h)))&&m.push(g);return m}t.exports=l})),Ye=o(((e,t)=>{var n=Object.prototype;function r(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||n)}t.exports=r})),Xe=o(((e,t)=>{function n(e,t){return function(n){return e(t(n))}}t.exports=n})),Ze=o(((e,t)=>{t.exports=Xe()(Object.keys,Object)})),Qe=o(((e,t)=>{var n=Ye(),r=Ze(),i=Object.prototype.hasOwnProperty;function a(e){if(!n(e))return r(e);var t=[];for(var a in Object(e))i.call(e,a)&&a!=`constructor`&&t.push(a);return t}t.exports=a})),I=o(((e,t)=>{var n=ee(),r=Ue();function i(e){return e!=null&&r(e.length)&&!n(e)}t.exports=i})),$e=o(((e,t)=>{var n=Je(),r=Qe(),i=I();function a(e){return i(e)?n(e):r(e)}t.exports=a})),et=o(((e,t)=>{var n=Ne(),r=Ie(),i=$e();function a(e){return n(e,i,r)}t.exports=a})),tt=o(((e,t)=>{var n=et(),r=1,i=Object.prototype.hasOwnProperty;function a(e,t,a,o,s,c){var l=a&r,u=n(e),d=u.length;if(d!=n(t).length&&!l)return!1;for(var f=d;f--;){var p=u[f];if(!(l?p in t:i.call(t,p)))return!1}var m=c.get(e),h=c.get(t);if(m&&h)return m==t&&h==e;var g=!0;c.set(e,t),c.set(t,e);for(var _=l;++f<d;){p=u[f];var v=e[p],y=t[p];if(o)var b=l?o(y,v,p,t,e,c):o(v,y,p,e,t,c);if(!(b===void 0?v===y||s(v,y,a,o,c):b)){g=!1;break}_||=p==`constructor`}if(g&&!_){var x=e.constructor,S=t.constructor;x!=S&&`constructor`in e&&`constructor`in t&&!(typeof x==`function`&&x instanceof x&&typeof S==`function`&&S instanceof S)&&(g=!1)}return c.delete(e),c.delete(t),g}t.exports=a})),nt=o(((e,t)=>{t.exports=j()(T(),`DataView`)})),rt=o(((e,t)=>{t.exports=j()(T(),`Promise`)})),it=o(((e,t)=>{t.exports=j()(T(),`Set`)})),at=o(((e,t)=>{t.exports=j()(T(),`WeakMap`)})),ot=o(((e,t)=>{var n=nt(),r=oe(),i=rt(),a=it(),o=at(),s=k(),c=re(),l=`[object Map]`,u=`[object Object]`,d=`[object Promise]`,f=`[object Set]`,p=`[object WeakMap]`,m=`[object DataView]`,h=c(n),g=c(r),_=c(i),v=c(a),y=c(o),b=s;(n&&b(new n(new ArrayBuffer(1)))!=m||r&&b(new r)!=l||i&&b(i.resolve())!=d||a&&b(new a)!=f||o&&b(new o)!=p)&&(b=function(e){var t=s(e),n=t==u?e.constructor:void 0,r=n?c(n):``;if(r)switch(r){case h:return m;case g:return l;case _:return d;case v:return f;case y:return p}return t}),t.exports=b})),st=o(((e,t)=>{var n=xe(),r=De(),i=je(),a=tt(),o=ot(),s=P(),c=Ve(),l=qe(),u=1,d=`[object Arguments]`,f=`[object Array]`,p=`[object Object]`,m=Object.prototype.hasOwnProperty;function h(e,t,h,g,_,v){var y=s(e),b=s(t),x=y?f:o(e),S=b?f:o(t);x=x==d?p:x,S=S==d?p:S;var C=x==p,w=S==p,T=x==S;if(T&&c(e)){if(!c(t))return!1;y=!0,C=!1}if(T&&!C)return v||=new n,y||l(e)?r(e,t,h,g,_,v):i(e,t,x,h,g,_,v);if(!(h&u)){var E=C&&m.call(e,`__wrapped__`),D=w&&m.call(t,`__wrapped__`);if(E||D){var O=E?e.value():e,k=D?t.value():t;return v||=new n,_(O,k,h,g,v)}}return T?(v||=new n,a(e,t,h,g,_,v)):!1}t.exports=h})),ct=o(((e,t)=>{var n=st(),r=F();function i(e,t,a,o,s){return e===t?!0:e==null||t==null||!r(e)&&!r(t)?e!==e&&t!==t:n(e,t,a,o,i,s)}t.exports=i})),lt=o(((e,t)=>{var n=ct();function r(e,t){return n(e,t)}t.exports=r})),ut=o(((e,t)=>{var n=E(),r=ze(),i=P(),a=n?n.isConcatSpreadable:void 0;function o(e){return i(e)||r(e)||!!(a&&e&&e[a])}t.exports=o})),dt=o(((e,t)=>{var n=Me(),r=ut();function i(e,t,a,o,s){var c=-1,l=e.length;for(a||=r,s||=[];++c<l;){var u=e[c];t>0&&a(u)?t>1?i(u,t-1,a,o,s):n(s,u):o||(s[s.length]=u)}return s}t.exports=i})),ft=o(((e,t)=>{function n(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}t.exports=n})),L=o(((e,t)=>{var n=k(),r=F(),i=`[object Symbol]`;function a(e){return typeof e==`symbol`||r(e)&&n(e)==i}t.exports=a})),pt=o(((e,t)=>{var n=P(),r=L(),i=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;function o(e,t){if(n(e))return!1;var o=typeof e;return o==`number`||o==`symbol`||o==`boolean`||e==null||r(e)?!0:a.test(e)||!i.test(e)||t!=null&&e in Object(t)}t.exports=o})),mt=o(((e,t)=>{var n=ye(),r=`Expected a function`;function i(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(r);var a=function(){var n=arguments,r=t?t.apply(this,n):n[0],i=a.cache;if(i.has(r))return i.get(r);var o=e.apply(this,n);return a.cache=i.set(r,o)||i,o};return a.cache=new(i.Cache||n),a}i.Cache=n,t.exports=i})),ht=o(((e,t)=>{var n=mt(),r=500;function i(e){var t=n(e,function(e){return i.size===r&&i.clear(),e}),i=t.cache;return t}t.exports=i})),gt=o(((e,t)=>{var n=ht(),r=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g;t.exports=n(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(r,function(e,n,r,a){t.push(r?a.replace(i,`$1`):n||e)}),t})})),_t=o(((e,t)=>{var n=E(),r=ft(),i=P(),a=L(),o=1/0,s=n?n.prototype:void 0,c=s?s.toString:void 0;function l(e){if(typeof e==`string`)return e;if(i(e))return r(e,l)+``;if(a(e))return c?c.call(e):``;var t=e+``;return t==`0`&&1/e==-o?`-0`:t}t.exports=l})),vt=o(((e,t)=>{var n=_t();function r(e){return e==null?``:n(e)}t.exports=r})),yt=o(((e,t)=>{var n=P(),r=pt(),i=gt(),a=vt();function o(e,t){return n(e)?e:r(e,t)?[e]:i(a(e))}t.exports=o})),R=o(((e,t)=>{var n=L(),r=1/0;function i(e){if(typeof e==`string`||n(e))return e;var t=e+``;return t==`0`&&1/e==-r?`-0`:t}t.exports=i})),bt=o(((e,t)=>{var n=yt(),r=R();function i(e,t){t=n(t,e);for(var i=0,a=t.length;e!=null&&i<a;)e=e[r(t[i++])];return i&&i==a?e:void 0}t.exports=i})),xt=o(((e,t)=>{var n=xe(),r=ct(),i=1,a=2;function o(e,t,o,s){var c=o.length,l=c,u=!s;if(e==null)return!l;for(e=Object(e);c--;){var d=o[c];if(u&&d[2]?d[1]!==e[d[0]]:!(d[0]in e))return!1}for(;++c<l;){d=o[c];var f=d[0],p=e[f],m=d[1];if(u&&d[2]){if(p===void 0&&!(f in e))return!1}else{var h=new n;if(s)var g=s(p,m,f,e,t,h);if(!(g===void 0?r(m,p,i|a,s,h):g))return!1}}return!0}t.exports=o})),St=o(((e,t)=>{var n=A();function r(e){return e===e&&!n(e)}t.exports=r})),Ct=o(((e,t)=>{var n=St(),r=$e();function i(e){for(var t=r(e),i=t.length;i--;){var a=t[i],o=e[a];t[i]=[a,o,n(o)]}return t}t.exports=i})),wt=o(((e,t)=>{function n(e,t){return function(n){return n==null?!1:n[e]===t&&(t!==void 0||e in Object(n))}}t.exports=n})),Tt=o(((e,t)=>{var n=xt(),r=Ct(),i=wt();function a(e){var t=r(e);return t.length==1&&t[0][2]?i(t[0][0],t[0][1]):function(r){return r===e||n(r,e,t)}}t.exports=a})),Et=o(((e,t)=>{var n=bt();function r(e,t,r){var i=e==null?void 0:n(e,t);return i===void 0?r:i}t.exports=r})),Dt=o(((e,t)=>{function n(e,t){return e!=null&&t in Object(e)}t.exports=n})),Ot=o(((e,t)=>{var n=yt(),r=ze(),i=P(),a=He(),o=Ue(),s=R();function c(e,t,c){t=n(t,e);for(var l=-1,u=t.length,d=!1;++l<u;){var f=s(t[l]);if(!(d=e!=null&&c(e,f)))break;e=e[f]}return d||++l!=u?d:(u=e==null?0:e.length,!!u&&o(u)&&a(f,u)&&(i(e)||r(e)))}t.exports=c})),kt=o(((e,t)=>{var n=Dt(),r=Ot();function i(e,t){return e!=null&&r(e,t,n)}t.exports=i})),At=o(((e,t)=>{var n=ct(),r=Et(),i=kt(),a=pt(),o=St(),s=wt(),c=R(),l=1,u=2;function d(e,t){return a(e)&&o(t)?s(c(e),t):function(a){var o=r(a,e);return o===void 0&&o===t?i(a,e):n(t,o,l|u)}}t.exports=d})),z=o(((e,t)=>{function n(e){return e}t.exports=n})),jt=o(((e,t)=>{function n(e){return function(t){return t?.[e]}}t.exports=n})),Mt=o(((e,t)=>{var n=bt();function r(e){return function(t){return n(t,e)}}t.exports=r})),Nt=o(((e,t)=>{var n=jt(),r=Mt(),i=pt(),a=R();function o(e){return i(e)?n(a(e)):r(e)}t.exports=o})),Pt=o(((e,t)=>{var n=Tt(),r=At(),i=z(),a=P(),o=Nt();function s(e){return typeof e==`function`?e:e==null?i:typeof e==`object`?a(e)?r(e[0],e[1]):n(e):o(e)}t.exports=s})),Ft=o(((e,t)=>{function n(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}t.exports=n})),It=o(((e,t)=>{t.exports=Ft()()})),Lt=o(((e,t)=>{var n=It(),r=$e();function i(e,t){return e&&n(e,t,r)}t.exports=i})),Rt=o(((e,t)=>{var n=I();function r(e,t){return function(r,i){if(r==null)return r;if(!n(r))return e(r,i);for(var a=r.length,o=t?a:-1,s=Object(r);(t?o--:++o<a)&&i(s[o],o,s)!==!1;);return r}}t.exports=r})),zt=o(((e,t)=>{var n=Lt();t.exports=Rt()(n)})),Bt=o(((e,t)=>{var n=zt(),r=I();function i(e,t){var i=-1,a=r(e)?Array(e.length):[];return n(e,function(e,n,r){a[++i]=t(e,n,r)}),a}t.exports=i})),Vt=o(((e,t)=>{function n(e,t){var n=e.length;for(e.sort(t);n--;)e[n]=e[n].value;return e}t.exports=n})),Ht=o(((e,t)=>{var n=L();function r(e,t){if(e!==t){var r=e!==void 0,i=e===null,a=e===e,o=n(e),s=t!==void 0,c=t===null,l=t===t,u=n(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||i&&s&&l||!r&&l||!a)return 1;if(!i&&!o&&!u&&e<t||u&&r&&a&&!i&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}t.exports=r})),Ut=o(((e,t)=>{var n=Ht();function r(e,t,r){for(var i=-1,a=e.criteria,o=t.criteria,s=a.length,c=r.length;++i<s;){var l=n(a[i],o[i]);if(l)return i>=c?l:l*(r[i]==`desc`?-1:1)}return e.index-t.index}t.exports=r})),Wt=o(((e,t)=>{var n=ft(),r=bt(),i=Pt(),a=Bt(),o=Vt(),s=Ge(),c=Ut(),l=z(),u=P();function d(e,t,d){t=t.length?n(t,function(e){return u(e)?function(t){return r(t,e.length===1?e[0]:e)}:e}):[l];var f=-1;return t=n(t,s(i)),o(a(e,function(e,r,i){return{criteria:n(t,function(t){return t(e)}),index:++f,value:e}}),function(e,t){return c(e,t,d)})}t.exports=d})),Gt=o(((e,t)=>{function n(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}t.exports=n})),Kt=o(((e,t)=>{var n=Gt(),r=Math.max;function i(e,t,i){return t=r(t===void 0?e.length-1:t,0),function(){for(var a=arguments,o=-1,s=r(a.length-t,0),c=Array(s);++o<s;)c[o]=a[t+o];o=-1;for(var l=Array(t+1);++o<t;)l[o]=a[o];return l[t]=i(c),n(e,this,l)}}t.exports=i})),qt=o(((e,t)=>{function n(e){return function(){return e}}t.exports=n})),Jt=o(((e,t)=>{var n=j();t.exports=function(){try{var e=n(Object,`defineProperty`);return e({},``,{}),e}catch{}}()})),Yt=o(((e,t)=>{var n=qt(),r=Jt(),i=z();t.exports=r?function(e,t){return r(e,`toString`,{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:i})),Xt=o(((e,t)=>{var n=800,r=16,i=Date.now;function a(e){var t=0,a=0;return function(){var o=i(),s=r-(o-a);if(a=o,s>0){if(++t>=n)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}t.exports=a})),Zt=o(((e,t)=>{var n=Yt();t.exports=Xt()(n)})),Qt=o(((e,t)=>{var n=z(),r=Kt(),i=Zt();function a(e,t){return i(r(e,t,n),e+``)}t.exports=a})),$t=o(((e,t)=>{var n=p(),r=I(),i=He(),a=A();function o(e,t,o){if(!a(o))return!1;var s=typeof t;return(s==`number`?r(o)&&i(t,o.length):s==`string`&&t in o)?n(o[t],e):!1}t.exports=o})),en=o(((e,t)=>{var n=dt(),r=Wt(),i=Qt(),a=$t();t.exports=i(function(e,t){if(e==null)return[];var i=t.length;return i>1&&a(e,t[0],t[1])?t=[]:i>2&&a(t[0],t[1],t[2])&&(t=[t[0]]),r(e,n(t,1),[])})})),tn=c(lt()),B=c(en()),nn=/\S+\.(gif|jpe?g|tiff|png|bmp|svg)$/i,rn=[`label`,`Label`,`name`,`Name`,`title`,`Title`,`rdfs:label`],V=class e{static isEqual(e,t){return(0,tn.default)(e,t)}static isDefined(e){return e!=null}static truncate(t,n,r=0){if(!e.isDefined(t))return``;let i=`${t}`;if(i.length<=r+1)return i;let a=r-1;switch(n){case`middle`:return i.substring(0,Math.ceil(a/2))+`…`+i.substring(i.length-Math.floor(a/2));case`end`:return i.substring(0,a)+`…`}}static getIn(e,t){return t.reduce((e,t)=>e&&e[t]!==void 0?e[t]:void 0,e)}static clone(e){return typeof e==`object`?JSON.parse(JSON.stringify(e,(e,t)=>t instanceof Set?{}:t)):e}static getHiddenNeighbors(t){return t.reduce((t,n)=>{let r=n.getData(`statistics`);if(r!==void 0){let i=r.degree!==void 0&&!r.supernode?r.degree-e.getDegreeWithoutSelfConnection(n):r.supernodeDegree;if(i!==void 0&&i>0)return t+=i}return t},0)}static getDegreeWithoutSelfConnection(e){return e.getAdjacentNodes({policy:`exclude-sources`,filter:`raw`}).size}static formatNumber(e){let t=1,n=``,r=e<0?`-`:``;e=Math.abs(e),e>=1e6?(t=1e6,n=`M`):e>=1e3&&(t=1e3,n=`k`);let i=e/t;return i<10&&i%1!=0?r+i.toFixed(1)+n:r+Math.floor(i)+n}static isStringFilled(e){return e.trim()!==``}static getValueFromLkProperty(t){if(typeof t==`object`&&`type`in t){if(!(`original`in t)&&!(`value`in t))return null;if(`original`in t)return`${t.original}`;if(`value`in t)return e.formatDate(new Date(new Date(t.value).getTime()+e.timezoneToMilliseconds(t.timezone)).toISOString())}return t}static formatDate(e,t,n){let r=e;n!==void 0&&(r=new Date(e).getTime()+n*1e3);let i=new Date(r);if(isNaN(i.getUTCFullYear()))return null;let a=i.getFullYear()+`-`+((i.getUTCMonth()+1).toString().length===1?`0`+(i.getUTCMonth()+1):i.getUTCMonth()+1)+`-`+(i.getUTCDate().toString().length===1?`0`+i.getUTCDate():i.getUTCDate());return t&&(a+=` `+(i.getUTCHours().toString().length===1?`0`+i.getUTCHours():i.getUTCHours())+`:`+(i.getUTCMinutes().toString().length===1?`0`+i.getUTCMinutes():i.getUTCMinutes())+`:`+(i.getUTCSeconds().toString().length===1?`0`+i.getUTCSeconds():i.getUTCSeconds())),a}static timezoneToMilliseconds(e){if(e===void 0||e===`Z`)return 0;let t=e[0],[n,r]=e.slice(1).split(`:`);return t===`+`?this.sanitizeFormattedNumber(n)*36e5+this.sanitizeFormattedNumber(r)*6e4:(this.sanitizeFormattedNumber(n)*36e5+this.sanitizeFormattedNumber(r)*6e4)*-1}static sanitizeFormattedNumber(t){return t.length===2&&t.startsWith(`0`)?e.parseNumber(t[1]):e.parseNumber(t)}static parseNumber(e){if(typeof e==`string`){if(e.trim()===``)return NaN;e=+e.replace(`,`,`.`).replace(` `,``)}return typeof e!=`number`||!isFinite(e)?NaN:e}static uniqBy(e,t){let n=new Set;if(t){let r=[];for(let i=0;i<e.length;++i)e[i]&&e[i][t]&&!n.has(e[i][t])?(n.add(e[i][t]),r.push(e[i])):e[i][t]||r.push(e[i]);return r}return typeof e[0]==`object`?Array.from(new Set(e.map(e=>JSON.stringify(e)))).map(e=>JSON.parse(e)):Array.from(new Set(e))}static getType(t){if(e.isURLImage(t))return`imageUrl`;if(e.isImage(t))return`image`;if(e.isUrl(t))return`url`}static isUrl(e){try{return new URL(e),!0}catch{return!1}}static isImage(e){return nn.test(e)}static isURLImage(t){if(e.isUrl(t)){let n=new URL(t);return e.isImage(n.pathname)}return!1}static valueExists(t){return e.isDefined(t)&&(typeof t!=`string`||e.isStringFilled(t))}static isNumber(t){return t=e.parseNumber(t),e.isDefined(t)&&t===t}static getPropertyValue(t,n,r){if(typeof t==`object`&&!Array.isArray(t))if(!(`status`in t)){if((t.type===`date`||t.type===`datetime`)&&r)return e.formatDate(t.value,t.type===`datetime`);if(t.type===`date`||t.type===`datetime`)return new Date(t.value).getTime()}else if(n)return`original`in t?t.original:void 0;else return;return t}static parseFloat(t){return e.parseNumber(t)}static formatCurrencyValue(t,n){let r=t<0?`- `:``;switch(n.format){case l.CurrencyFormat.SYMBOL_COMMAS_DOT:return`${r}${n.symbol===void 0?``:n.symbol+` `}${e.formatNumberToCurrency(t,`,`,`.`)}`;case l.CurrencyFormat.SYMBOL_COMMAS:return`${r}${n.symbol===void 0?``:n.symbol+` `}${e.formatNumberToCurrency(t,`,`)}`;case l.CurrencyFormat.DOTS_COMMA_SYMBOL:return`${r}${e.formatNumberToCurrency(t,`.`,`,`)}${n.symbol===void 0?``:` `+n.symbol}`;case l.CurrencyFormat.DOTS_SYMBOL:return`${r}${e.formatNumberToCurrency(t,`.`)}${n.symbol===void 0?``:` `+n.symbol}`;case l.CurrencyFormat.SPACES_COMMA_SYMBOL:return`${r}${e.formatNumberToCurrency(t,` `,`,`)}${n.symbol===void 0?``:` `+n.symbol}`;case l.CurrencyFormat.SPACES_SYMBOL:return`${r}${e.formatNumberToCurrency(t,` `)}${n.symbol===void 0?``:` `+n.symbol}`;default:throw Error(`Cannot format property value ${t}, unknown format ${n.format}.`)}}static formatNumberToCurrency(e,t,n){if(!Number.isFinite(e))return e.toString();let[r,i]=n?Math.abs(e).toFixed(2).split(`.`):[Math.abs(e).toFixed(0),void 0],a=-1,o=r.split(``).reverse().map(e=>(a++,a>0&&a%3==0?e+t:e)).reverse().join(``);return n?o+n+i:o}},an=class e{static getText(t,n,r){let i=`categories`in t?t.categories:[t.type];if(e.captionExist(i,n))return`categories`in t?e.generateNodeCaption(t,n,r)||null:e.generateEdgeCaption(t,n,r)||null;if(t.properties!==void 0){let e=rn.find(e=>t.properties[e]!==void 0);if(e!==void 0&&V.isDefined(t.properties[e]))return`${V.getValueFromLkProperty(t.properties[e])}`.trim()}return null}static getLabel(e,t){if(typeof e==`object`&&`type`in e){if(!(`original`in e)&&!(`value`in e))return null;if(`original`in e)return`${e.original}`;if(`value`in e)return V.formatDate(new Date(new Date(e.value).getTime()+V.timezoneToMilliseconds(e.timezone)).toISOString())}else if(t?.name===l.PropertyTypeName.NUMBER&&t.options!==void 0)return V.formatCurrencyValue(e,t.options);return`${e}`.trim()}static captionExist(e,t){return e.some(e=>V.isDefined(t[e]))}static generateNodeCaption(t,n,r){let i=t.categories,a=[],o=[];return i.forEach(e=>{n[e]&&n[e].active&&(n[e].displayName&&a.push(e),o=[...o,...n[e].properties])}),V.uniqBy(o).forEach(n=>{if(t.properties[n]!==void 0){let o=r?e.getPropertyType(r,n,i[0]):void 0;a.push(this.getLabel(t.properties[n],o))}}),a.filter(e=>e!==null).join(` - `).trim()}static getPropertyType(e,t,n){return e.find(e=>e.itemType===n)?.properties.find(e=>e.propertyKey===t)?.propertyType}static generateEdgeCaption(t,n,r){let i=t.type,a=[],o=[];return n[i]&&n[i].active?(n[i].displayName&&a.push(i),o=[...o,...n[i].properties],V.uniqBy(o).forEach(n=>{if(V.isDefined(t.properties[n])){let o=r?e.getPropertyType(r,n,i):void 0;a.push(e.getLabel(t.properties[n],o))}}),a.join(` - `).trim()):``}},on=o(((e,t)=>{(function(){var e=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return n.rotl(e,8)&16711935|n.rotl(e,24)&4278255360;for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(Math.random()*256));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<e.length*32;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((e[n]&15).toString(16));return t.join(``)},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(t){for(var n=[],r=0;r<t.length;r+=3)for(var i=t[r]<<16|t[r+1]<<8|t[r+2],a=0;a<4;a++)r*8+a*6<=t.length*8?n.push(e.charAt(i>>>6*(3-a)&63)):n.push(`=`);return n.join(``)},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/gi,``);for(var n=[],r=0,i=0;r<t.length;i=++r%4)i!=0&&n.push((e.indexOf(t.charAt(r-1))&2**(-2*i+8)-1)<<i*2|e.indexOf(t.charAt(r))>>>6-i*2);return n}};t.exports=n})()})),sn=o(((e,t)=>{var n={utf8:{stringToBytes:function(e){return n.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(n.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(e.charCodeAt(n)&255);return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join(``)}}};t.exports=n})),H=c(o(((e,t)=>{(function(){var e=on(),n=sn().utf8,r=sn().bin,i=function(t){t.constructor==String?t=n.stringToBytes(t):typeof Buffer<`u`&&typeof Buffer.isBuffer==`function`&&Buffer.isBuffer(t)?t=Array.prototype.slice.call(t,0):Array.isArray(t)||(t=t.toString());var r=e.bytesToWords(t),i=t.length*8,a=[],o=1732584193,s=-271733879,c=-1732584194,l=271733878,u=-1009589776;r[i>>5]|=128<<24-i%32,r[(i+64>>>9<<4)+15]=i;for(var d=0;d<r.length;d+=16){for(var f=o,p=s,m=c,h=l,g=u,_=0;_<80;_++){if(_<16)a[_]=r[d+_];else{var v=a[_-3]^a[_-8]^a[_-14]^a[_-16];a[_]=v<<1|v>>>31}var y=(o<<5|o>>>27)+u+(a[_]>>>0)+(_<20?(s&c|~s&l)+1518500249:_<40?(s^c^l)+1859775393:_<60?(s&c|s&l|c&l)-1894007588:(s^c^l)-899497514);u=l,l=c,c=s<<30|s>>>2,s=o,o=y}o+=f,s+=p,c+=m,l+=h,u+=g}return[o,s,c,l,u]},a=function(t,n){var a=e.wordsToBytes(i(t));return n&&n.asBytes?a:n&&n.asString?r.bytesToString(a):e.bytesToHex(a)};a._blocksize=16,a._digestsize=20,t.exports=a})()}))()),U=`#7f7f7f`,cn=[`#9467bd`,`#e377c2`,`#1f77b4`,`#17becf`,`#2ca02c`,`#bcbd22`,`#d62728`,`#ff7f0e`,`#8c564b`,`#c5b0d5`,`#f7b6d2`,`#aec7e8`,`#9edae5`,`#98df8a`,`#dbdb8d`,`#ff9896`,`#ffbb78`,`#c49c94`],W=class e{constructor(e){this.colorsCache=new Map,this._rulesMap={},this.refresh(e)}refresh(e){e.color!==void 0&&(this.colorsCache=new Map),this._rulesMap={color:e.color?[...e.color].reverse():this._rulesMap.color,icon:e.icon?[...e.icon].reverse():this._rulesMap.icon,image:e.image?[...e.image].reverse():this._rulesMap.image,shape:e.shape?[...e.shape].reverse():this._rulesMap.shape,size:e.size?[...e.size].reverse():this._rulesMap.size,width:e.width?[...e.width].reverse():this._rulesMap.width}}static autoColor(t,n){return V.isDefined(t)?cn[e.getRandomUniqueColorPaletteIndex(t,cn.length,n)]:U}static getRandomUniqueColorPaletteIndex(e,t,n){return n&&(e=e.toLowerCase()),+(`0x`+(0,H.default)(e).substr(-4))%t}static getTypeColor(t,n){return typeof t.style.color==`object`&&t.style.color.input[0]!==`properties`?e.autoColor(n,t.style.color.ignoreCase):!V.isDefined(t.input)&&typeof t.style.color!=`object`?t.style.color:null}static getAutomaticRangeStyleLinear(e,{max:t,min:n},r,i){if(t!==void 0&&n!==void 0){if(t===n||isNaN(e))return`100%`;let a=(i-r)/(t-n),o=(r*t-i*n)/(t-n);return`${Math.floor(e*a+o)}%`}}static getAutomaticRangeStyleLog(e,{max:t,min:n},r,i){if(n!==void 0&&t!==void 0){if(t===n||isNaN(e))return`100%`;n<1&&(e+=Math.abs(n)+1,t+=Math.abs(n)+1,n+=Math.abs(n)+1);let a=(i-r)/(Math.log(t)-Math.log(n)),o=(r*Math.log(t)-i*Math.log(n))/(Math.log(t)-Math.log(n));return`${Math.floor(a*Math.log(e)+o)}%`}}isAutoRange(e){return typeof e==`object`&&e?.type===`autoRange`}},ln=class e extends W{constructor(e){super(e)}static matchStyle(e,t){if(t!==void 0){for(let n=0;n<e.length;++n)if(e[n].canApplyTo(t))return e[n]}}color(e){if(!V.isDefined(e))return U;let t;for(let n=0;n<this._rulesMap.color.length;++n){let r=this._rulesMap.color[n];if(r.canApplyTo(e)){if(typeof r.style.color==`string`)t=r.style.color;else if(typeof r.style.color==`object`){let n=V.getIn(e,r.style.color.input);t=W.autoColor(`${n}`,r.style.color.ignoreCase)}break}}return V.isDefined(t)?t:U}shape(t){if(this._rulesMap.shape!==void 0)return e.matchStyle(this._rulesMap.shape,t)?.style.shape}width(t){if(this._rulesMap.width!==void 0){let n=e.matchStyle(this._rulesMap.width,t);if(n!==void 0){let r=n?.style.width;if(r!==void 0&&this.isAutoRange(r)){if(r.input!==void 0&&r.max!==void 0&&r.min!==void 0){let i=r.input[1],a=V.parseNumber(t.properties[i]),o=r.scale&&r.scale===l.AutoRangeScale.LOGARITHMIC;return e.getAutomaticRangeWidth(a,n,o)}}else return r}}}static getAutomaticRangeWidth(e,t,n=!1){return n?this.getAutomaticRangeStyleLog(e,t.style.width,50,200):this.getAutomaticRangeStyleLinear(e,t.style.width,50,200)}all(e){return V.isDefined(e)?{color:this.color(e),shape:this.shape(e),width:this.width(e)}:{color:U,shape:l.OgmaEdgeShape.ARROW,width:`100%`}}},un=class e extends W{constructor(e){super(e)}static matchStyle(e,t,n){if(V.isDefined(t)&&V.isDefined(e)){for(let r=0;r<e.length;++r)if(e[r].canApplyTo(t)){n(e[r]);break}}}color(e){if(!V.isDefined(e))return[U];let t=(0,H.default)(JSON.stringify(e)),n=this.colorsCache.get(t);if(n!==void 0)return n;let r=[];for(let t=0;t<e.categories.length;++t){let n=null;for(let r=0;r<this._rulesMap.color.length;++r){let i=this._rulesMap.color[r];if(!(i.itemType!==void 0&&i.itemType!==null&&i.itemType!==e.categories[t])&&i.canApplyTo(e)){if(typeof i.style.color==`object`){let r=V.getIn(e,i.style.color.input);n=Array.isArray(r)?W.autoColor(e.categories[t],i.style.color.ignoreCase):W.autoColor(`${r}`,i.style.color.ignoreCase)}else n=i.style.color;break}}r.push(n)}r=r.filter(e=>V.isDefined(e)),r.length===0&&(r=[U]);let i=r.length===1?r[0]:r;return this.colorsCache.set(t,i),i}icon(t){let n=this.color(t),r=Array.isArray(n)?n[0]:n,i={},a=[...this._rulesMap.image||[],...this._rulesMap.icon||[]];if(!V.isDefined(t))return{icon:{},image:{}};for(let n=0;n<a.length;++n)if(a[n].canApplyTo(t)){let o=a[n].style;if(`icon`in o&&typeof o.icon==`object`)i={icon:{content:o.icon?.content,font:o.icon?.font,scale:.5,color:$.isBright(r)?`#000000`:`#FFFFFF`}};else if(`image`in o&&typeof o.image==`object`){let n=e.getImageUrlFromStyleRule(o.image.url,t,this._baseUrl);n!==void 0&&(i={image:{url:n,scale:o.image.scale,fit:o.image.fit,tile:o.image.tile,minVisibleSize:0}})}break}return i}shape(t){let n;return this._rulesMap.shape!==void 0&&e.matchStyle(this._rulesMap.shape,t,e=>{n=e.style.shape}),n}size(t){let n;return this._rulesMap.size!==void 0&&e.matchStyle(this._rulesMap.size,t,r=>{let i=r.style.size;if(this.isAutoRange(i)){if(i.input!==void 0&&i.max!==void 0&&i.min!==void 0){let a=i.input[1],o=V.parseNumber(t.properties[a]),s=i.scale&&i.scale===l.AutoRangeScale.LOGARITHMIC;n=e.getAutomaticRangeSize(o,r,s)}}else n=i}),n}static getAutomaticRangeSize(e,t,n=!1){return n?this.getAutomaticRangeStyleLog(e,t.style.size,50,500):this.getAutomaticRangeStyleLinear(e,t.style.size,50,500)}all(e){if(!V.isDefined(e))return{color:U};let t=this.icon(e);return{radius:this.size(e),color:this.color(e),shape:this.shape(e),icon:t.icon,image:t.image}}static getImageUrlFromStyleRule(e,t,n){let r;return typeof e==`string`&&[`imageUrl`,`image`].includes(V.getType(e))?r=e:typeof e==`object`&&(r=V.getIn(t,e.path)),r!==void 0&&n!==void 0?new URL(r,n).href:r}setBaseUrl(e){this._baseUrl=e}},dn=function(e){return e.AUTO_RANGE=`autoRange`,e}({}),fn=class e{constructor(e){this.type=e.type,this.input=e.input,this.index=e.index,this.itemType=e.itemType,this.style=e.style,this.value=e.value}static isAutomaticRange(e){return e.style!==void 0&&(e.style.width!==void 0&&e.style.width.type===`autoRange`||e.style.size!==void 0&&e.style.size.type===`autoRange`)}get specificity(){return this.itemType!==void 0&&this.input!==void 0?4:this.itemType===void 0&&this.input!==void 0?3:this.itemType!==void 0&&this.input===void 0?2:1}matchValues(e,t,n){return V.isDefined(t)?(e===this.itemType||!V.isDefined(this.itemType))&&V.isEqual([`properties`,...t],this.input)&&V.isEqual(n,this.value)||this.type===`any`&&!V.isDefined(this.input)&&typeof this.style.color==`object`&&this.style.color.input[1]===t[0]:V.isDefined(this.itemType)?e===this.itemType&&!V.isDefined(this.input):!V.isDefined(this.input)}static inputExists(e,t){return e!==l.SelectorType.ANY}canApplyTo(t){let n=`categories`in t?t.categories:[t.type],r=!1;switch(this.type){case l.SelectorType.ANY:r=e.checkAny(t,this.style);break;case l.SelectorType.NO_VALUE:e.inputExists(this.type,this.input)&&(r=e.checkNoValue(t,this.input));break;case l.SelectorType.NAN:e.inputExists(this.type,this.input)&&(r=e.checkNan(t,this.input));break;case l.SelectorType.RANGE:e.inputExists(this.type,this.input)&&(r=e.checkRange(V.getIn(t,this.input),this.value));break;case l.SelectorType.IS:e.inputExists(this.type,this.input)&&(r=e.checkIs(t,this.input,this.value));break}return r&&e.checkItemType(n,this.itemType)}static checkAny(e,t){return typeof t.color==`object`?V.isDefined(V.getIn(e,t.color.input)):!0}static checkNoValue(e,t){return!V.valueExists(V.getIn(e,t))}static checkNan(e,t){return!V.isNumber(V.getIn(e,t))}static checkRange(e,t){return(t[`<=`]===void 0||e<=t[`<=`])&&(t[`<`]===void 0||e<t[`<`])&&(t[`>`]===void 0||e>t[`>`])&&(t[`>=`]===void 0||e>=t[`>=`])}static checkIs(e,t,n){if(!V.isDefined(t))return!1;let r=V.getIn(e,t),i=r;if(V.isDefined(r)&&typeof r==`object`&&(r.type===`date`||r.type===`datetime`)){let e=r.timezone;r.timezone===`Z`&&(e=`+00:00`),i=V.formatDate(r.value,r.type===`datetime`,V.timezoneToMilliseconds(e)/1e3)}return V.isEqual(i,n)}static checkItemType(t,n){return e.matchCategory(t,n)||e.matchAny(n)}static matchCategory(e,t){return V.isDefined(t)&&(Array.isArray(e)?e.includes(t):V.isEqual(e,t))}static matchAny(e){return e===void 0}getTypeColor(t){let n;return e.checkItemType([t],this.itemType)&&this.type===l.SelectorType.ANY&&!V.isDefined(this.input)&&(n=W.getTypeColor(this,t)),n}},G=function(e){return e.COLOR=`color`,e.ICON=`icon`,e.SIZE=`size`,e.IMAGE=`image`,e.SHAPE=`shape`,e.WIDTH=`width`,e}({}),K=[`specificity`,`itemType`,`index`],pn=class e{constructor(e){this._rules=e}get color(){return(0,B.default)(e.getBy(`color`,this._rules),K)}get icon(){return(0,B.default)([...e.getBy(`icon`,this._rules)||[],...e.getBy(`image`,this._rules)||[]],K)}get image(){return(0,B.default)(e.getBy(`image`,this._rules),K)}get shape(){return(0,B.default)(e.getBy(`shape`,this._rules),K)}get size(){return(0,B.default)(e.getBy(`size`,this._rules),K)}get width(){return(0,B.default)(e.getBy(`width`,this._rules),K)}get nodeRules(){return{color:this.color,icon:this.icon,image:this.image,shape:this.shape,size:this.size}}get edgeRules(){return{color:this.color,shape:this.shape,width:this.width}}generateLegend(t){let n={};return t.length===0||(`categories`in t[0]?Object.keys(this.nodeRules).forEach(r=>{n[r]=e.getLegendForStyle(r,this.nodeRules[r],t)}):Object.keys(this.edgeRules).forEach(r=>{n[r]=e.getLegendForStyle(r,this.edgeRules[r],t)})),n}static getLegendForStyle(t,n,r){let i=[],a=r.filter(e=>e);for(let r=0;r<n.length;r++){let o=new fn(n[r]);if(a.some(e=>o.canApplyTo(e)))if(t===`color`&&typeof o.style.color==`object`)e.addLegendAutoColors(a,o,i);else if(t===`icon`&&`image`in o.style){let t=V.isDefined(o.input)?`${e.getTypeLabel(o.itemType)}.${o.input[1]} ${e.sanitizeValue(o.type,o.value)}`:`${e.getTypeLabel(o.itemType)}`,n=o.style.image;if(!(n.url&&typeof n.url==`object`&&n.url.type===`data`)){let n=o.style.image;e.updateLegend(i,{label:t,value:n})}}else{let n=V.isDefined(o.input)?`${e.getTypeLabel(o.itemType)}.${o.input[1]} ${e.sanitizeValue(o.type,o.value)}`:`${e.getTypeLabel(o.itemType)}`,r=o.style[t];e.updateLegend(i,{label:n,value:r})}}return i}static sanitizeValue(e,t){let n=``;switch(e){case l.SelectorType.NO_VALUE:return`is undefined`;case l.SelectorType.NAN:return`is not an number`;case l.SelectorType.RANGE:return Object.keys(t).forEach((e,r)=>{r>0&&(n+=` and `),n+=`${e} ${t[e]}`}),n}return typeof t==`object`?`= ${JSON.stringify(t)}`:`= ${t}`}static addLegendAutoColors(t,n,r){let i=n.style.color,a=i.input[1];t.forEach(t=>{let o=V.getIn(t,i.input);if(Array.isArray(o))o.forEach(t=>{let o=i.input.includes(`properties`)?`${e.getTypeLabel(n.itemType)}.${a} = ${t}`:`${e.getTypeLabel(t)}`,s=W.autoColor(t,i.ignoreCase);e.updateLegend(r,{label:o,value:s})});else{let t=i.input.includes(`properties`)?`${e.getTypeLabel(n.itemType)}.${a} = ${o}`:`${e.getTypeLabel(o)}`,s=W.autoColor(o,i.ignoreCase);e.updateLegend(r,{label:t,value:s})}})}static getTypeLabel(e){return e===void 0?`All`:e===null?`Others`:e}getColorForType(e){let t=this.color.map(t=>t.getTypeColor(e)).filter(e=>V.isDefined(e));return t.length>0?t[t.length-1]:U}getIconForType(e){let t=this.icon.filter(t=>!V.isDefined(t.input)&&t.itemType===e).map(e=>e.style.icon?.content).filter(e=>V.isDefined(e));return t.length>0?t[t.length-1]:void 0}static updateLegend(e,{label:t,value:n}){let r=e.map(e=>e.label).indexOf(t);r<0?e.push({label:t,value:n}):e[r]={label:t,value:n}}static getBy(t,n){return n.filter(e=>{switch(t){case`color`:return e.style.color!==void 0;case`icon`:return`icon`in e.style&&e.style.icon!==void 0;case`image`:return`image`in e.style&&e.style.image!==void 0;case`shape`:return e.style.shape!==void 0;case`size`:return`size`in e.style&&e.style.size!==void 0;case`width`:return`width`in e.style&&e.style.width!==void 0}}).map(n=>e.getRule(n,t))}static getRule(e,t){let n=V.clone(e);return n.style={[t]:n.style[t]},new fn(n)}static sanitizeStylesIndex(e){let t=[],n=V.clone(e),r=Math.max(...e.node.map(e=>e.index),...e.edge.map(e=>e.index))+1;return n.node=n.node.map(e=>(t.includes(e.index)?(e.index=r,r++):t.push(e.index),e)),n.edge=n.edge.map(e=>(t.includes(e.index)?(e.index=r,r++):t.push(e.index),e)),n}},mn=`'roboto', sans-serif`,q=`#FFF`,hn=.2,gn=`#3F3D5F`,_n={text:{style:`bold`,backgroundColor:`#fff`,minVisibleSize:0},outerStroke:{width:2},outline:!1},vn={text:{style:`bold`,backgroundColor:`#fff`,minVisibleSize:0},outline:!1},yn={color:`#FFF`,width:7,scalingMethod:`scaled`,strokeWidth:0,hideNonAdjacentEdges:!1},bn={color:`#FFF`,scalingMethod:`scaled`,width:4},xn=`#7f7f7f`,Sn=class{constructor(e,t){this._nodeAttributes=new un({}),this._edgeAttributes=new ln({}),this._ogma=e,this._defaultConfiguration=t,this._nodeAttributes.setBaseUrl(t.baseUrl)}get nodeAttributes(){return this._nodeAttributes}get nodeFont(){return this._defaultConfiguration.node?.text?.font}setNodesDefaultStyles(){this._ogma.styles.setHoveredNodeAttributes(_n),this._ogma.styles.setSelectedNodeAttributes(_n),this._nodeDefaultStylesRules=this._ogma.styles.addRule({nodeAttributes:{text:{padding:5,minVisibleSize:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.minVisibleSize?this._defaultConfiguration.node.text.minVisibleSize:12,maxLineLength:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.maxLineLength!==void 0?this._defaultConfiguration.node.text.maxLineLength:30,position:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.nodePosition!==void 0?this._defaultConfiguration.node.text.nodePosition:`bottom`,backgroundColor:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.backgroundColor!==void 0?this._defaultConfiguration.node.text.backgroundColor:void 0,font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:`'roboto', sans-serif`,color:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.color!==void 0?this._defaultConfiguration.node.text.color:`black`,size:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.size!==void 0?this._defaultConfiguration.node.text.size:14,margin:5},radius:this.defaultNodeRadius(this._defaultConfiguration.node),icon:{minVisibleSize:15},color:xn,shape:this._defaultConfiguration.node.shape===void 0?`circle`:this._defaultConfiguration.node.shape,innerStroke:{width:3},outline:!1},nodeSelector:e=>!e.isVirtual()})}setEdgesDefaultStyles(){this._ogma.styles.setHoveredEdgeAttributes(vn),this._ogma.styles.setSelectedEdgeAttributes(vn),this._edgeDefaultStylesRules=this._ogma.styles.addRule({edgeAttributes:{text:{minVisibleSize:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.minVisibleSize?this._defaultConfiguration.edge.text.minVisibleSize:3,maxLineLength:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.maxLineLength!==void 0?this._defaultConfiguration.edge.text.maxLineLength:30,backgroundColor:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.backgroundColor!==void 0?this._defaultConfiguration.edge.text.backgroundColor:void 0,font:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.font!==void 0?this._defaultConfiguration.edge.text.font:`'roboto', sans-serif`,color:this._defaultConfiguration.edge?.text!==void 0&&this._defaultConfiguration.edge.text.color!==void 0?this._defaultConfiguration.edge.text.color:`black`,size:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.size!==void 0?this._defaultConfiguration.edge.text.size:14},width:this.defaultEdgeWidth(this._defaultConfiguration.edge),shape:this._defaultConfiguration.edge.shape===void 0?`arrow`:this._defaultConfiguration.edge.shape,color:xn}})}setNodesDefaultHalo(){this._nodeDefaultHaloRules=this._ogma.styles.addRule({nodeSelector:e=>e&&!e.hasClass(`filtered`)&&!e.isVirtual(),nodeAttributes:{halo:e=>e!==void 0&&!e.hasClass(`filtered`)&&(e.isSelected()||e.getAdjacentNodes({}).isSelected().includes(!0)||e.getAdjacentEdges().isSelected().includes(!0))?{...yn,scalingMethod:this._ogma.geo.enabled()?`fixed`:`scaled`}:null},nodeDependencies:{self:{selection:!0},adjacentNodes:{selection:!0},adjacentEdges:{selection:!0}}})}setEdgesDefaultHalo(){this._edgeDefaultHaloRules=this._ogma.styles.addRule({edgeSelector:e=>e&&e.getSource()&&e.getTarget()&&!e.hasClass(`filtered`),edgeAttributes:{halo:e=>e&&!e.hasClass(`filtered`)&&(e.isSelected()||e.getSource().isSelected()||e.getTarget().isSelected())?{...bn,scalingMethod:this._ogma.geo.enabled()?`fixed`:`scaled`}:null},edgeDependencies:{self:{selection:!0},extremities:{selection:!0}}})}defaultNodeRadius(e){return this.defaultStylesHas(e,[`nodeRadius`])?e.nodeRadius:5}defaultEdgeWidth(e){return this.defaultStylesHas(e,[`edgeWidth`])?e.edgeWidth:1}defaultStylesHas(e,t){return V.isDefined(e)?V.getIn(e,t)!==void 0:!1}setFilterClass(){this._ogma.styles.createClass({name:`filtered`,nodeAttributes:{opacity:hn,layer:e=>e.getMetaNode()===null?-1:1,detectable:!1,badges:{topRight:{text:null},bottomRight:{text:null}},text:null,color:`rgb(240, 240, 240)`,innerStroke:{width:1,color:U,minVisibleSize:1},shape:`circle`,image:null,icon:null,radius:`50%`},edgeAttributes:{opacity:hn,layer:e=>{let t=e.getExtremities().getMetaNode().some(e=>e!==null);return!e.isVirtual()&&t?1:-1},detectable:!1,text:null,color:U,shape:`line`,width:.2}})}setExportClass(e){this._exportClass?this._exportClass.update({nodeAttributes:{text:{maxLineLength:e?30:0},halo:null}}):this._exportClass=this._ogma.styles.createClass({name:`exported`,nodeAttributes:{text:{minVisibleSize:0,size:12,maxLineLength:e?30:0},halo:null},edgeAttributes:{text:{minVisibleSize:0,size:12},halo:null}})}async initBadges(e){this._badgesStyle=e,this.refreshCounterBadgeClass(),await this.refreshPinBadgeStyleRule()}refreshCounterBadgeClass(){let e=`degreeIndicator`,t={nodeAttributes:{badges:{bottomLeft:e=>this._getCounterBadge(e)}}},n=this._ogma.styles.getClass(e);V.isDefined(n)?n.update(t):(this._ogma.styles.createClass({name:e,...t}),this._ogma.events.on(`addNodes`,t=>t.nodes.addClass(e)),this._ogma.getNodes().addClass(e))}async refreshPinBadgeStyleRule(){V.isDefined(this._pinnedIndicatorRule)?(await this._pinnedIndicatorRule.refresh(),this._pinnedIndicatorRule.update({priority:100})):(this._pinnedIndicatorRule=this._ogma.styles.addRule({nodeSelector:e=>!e.getAttribute(`layoutable`),nodeAttributes:{badges:{topRight:e=>this._getPinBadge(e)}},nodeDependencies:{self:{attributes:[`layoutable`]}}}),this._pinnedIndicatorRule.update({priority:100}))}toggleTextOverlap(e){this._ogma.setOptions({texts:{preventOverlap:e}})}refreshRules(){this._nodeDefaultStylesRules.refresh(),this._edgeDefaultStylesRules.refresh()}refreshNodeColors(e){V.isDefined(this._ogmaNodeColor)?(this._nodeAttributes.refresh({color:e}),this._ogmaNodeColor.refresh()):(this._nodeAttributes.refresh({color:e}),this._ogmaNodeColor=this._ogma.styles.addRule({nodeAttributes:{color:e=>{if(e!==void 0)return this._nodeAttributes.color(e.getData())}},nodeDependencies:{self:{data:!0}},nodeSelector:e=>!e.isVirtual()}))}getStyleRule(e,t){return new pn(e)[t]}initNodeColors(e){let t=this.getStyleRule(e,G.COLOR);this.refreshNodeColors(t)}initNodesIcons(e){let t=this.getStyleRule(e,G.ICON);this.refreshNodeIcons(t)}initNodesSizes(e){let t=this.getStyleRule(e,G.SIZE);this.refreshNodeSize(t)}initNodesShapes(e){let t=this.getStyleRule(e,G.SHAPE);this.refreshNodeShape(t)}initEdgesWidth(e){let t=this.getStyleRule(e,G.WIDTH);this.refreshEdgeWidth(t)}initEdgesShape(e){let t=this.getStyleRule(e,G.SHAPE);this.refreshEdgeShape(t)}initEdgesColor(e){let t=this.getStyleRule(e,G.COLOR);this.refreshEdgeColors(t)}refreshNodeIcons(e){V.isDefined(this._ogmaNodeIcon)?(this._nodeAttributes.refresh({icon:e}),this._ogmaNodeIcon.refresh()):(this._nodeAttributes.refresh({icon:e}),this._ogmaNodeIcon=this._ogma.styles.addRule({nodeAttributes:{icon:e=>{if(e!==void 0)return this._nodeAttributes.icon(e.getData()).icon},image:e=>{if(e!==void 0&&!e.isVirtual())return this._nodeAttributes.icon(e.getData()).image}},nodeDependencies:{self:{data:!0}},nodeSelector:e=>!e.isVirtual()}))}refreshNodeSize(e){V.isDefined(this._ogmaNodeSize)?(this._nodeAttributes.refresh({size:e}),this._ogmaNodeSize.refresh()):(this._nodeAttributes.refresh({size:e}),this._ogmaNodeSize=this._ogma.styles.addRule({nodeAttributes:{radius:e=>{if(e!==void 0)return this._nodeAttributes.size(e.getData())}},nodeDependencies:{self:{data:!0}},nodeSelector:e=>!e.isVirtual()}))}refreshNodeShape(e){V.isDefined(this._ogmaNodeShape)?(this._nodeAttributes.refresh({shape:e}),this._ogmaNodeShape.refresh()):(this._nodeAttributes.refresh({shape:e}),this._ogmaNodeShape=this._ogma.styles.addRule({nodeAttributes:{shape:e=>{if(e!==void 0)return this._nodeAttributes.shape(e.getData())}},nodeSelector:e=>e!==void 0&&!e.isVirtual(),nodeDependencies:{self:{data:!0}}}))}refreshEdgeColors(e){V.isDefined(this._ogmaEdgeColor)?(this._edgeAttributes.refresh({color:e}),this._ogmaEdgeColor.refresh()):(this._edgeAttributes.refresh({color:e}),this._ogmaEdgeColor=this._ogma.styles.addRule({edgeAttributes:{color:e=>{if(e!==void 0)return this._edgeAttributes.color(e.getData())}},edgeDependencies:{self:{data:!0}}}))}refreshEdgeWidth(e){V.isDefined(this._ogmaEdgeWidth)?(this._edgeAttributes.refresh({width:e}),this._ogmaEdgeWidth.refresh()):(this._edgeAttributes.refresh({width:e}),this._ogmaEdgeWidth=this._ogma.styles.addRule({edgeAttributes:{width:e=>{if(e!==void 0)return this._edgeAttributes.width(e.getData())}},edgeDependencies:{self:{data:!0}}}))}refreshEdgeShape(e){V.isDefined(this._ogmaEdgeShape)?(this._edgeAttributes.refresh({shape:e}),this._ogmaEdgeShape.refresh()):(this._edgeAttributes.refresh({shape:e}),this._ogmaEdgeShape=this._ogma.styles.addRule({edgeAttributes:{shape:e=>{if(e!==void 0)return this._edgeAttributes.shape(e.getData())}},edgeDependencies:{self:{data:!0}}}))}_findPinBadgeScale(e){let t=.46;return this._getNodeRadius(e)*t>5?.17:t}_getNodeRadius(e){return!e.isVirtual()||$.isGroupCollapsed(e)?e.getAttribute(`radius`):this._ogma.transformations.getXYR(e.toList())[0].radius}_getCounterBadge(e){if(this._badgesStyle?.counter?.display!==!1&&V.isDefined(e)){let t=V.getHiddenNeighbors(e.toList()),n=V.formatNumber(t);if(t>0){let t=e.getData([`statistics`,`supernode`]),r=null;return+n!=0&&(r=t?n+`+`:n),{color:this._badgesStyle?.counter?.color||`#3F3D5F`,minVisibleSize:20,stroke:{width:2,color:`#FFFFFF`},text:{font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:mn,scale:.4,color:q,content:r}}}}}_getPinBadge(e){if(this._badgesStyle?.pin?.display!==!1)return{color:this._badgesStyle?.pin?.color||`#3F3D5F`,minVisibleSize:20,scale:this._findPinBadgeScale(e),stroke:{width:2,color:`#FFFFFF`},text:{font:`FontAwesome`,scale:.4,color:q,content:``}}}},Cn=class{constructor(e,t,n){this._nodeMaxTextLength=t,this._edgeMaxTextLength=n,this._captionSchema={node:{},edge:{}},this._graphSchema={node:[],edge:[]},this._ogma=e}set graphSchema(e){this._graphSchema=e}refreshSchema(e){this._captionSchema=e}async initVizCaptions(e){this._ogma.LKCaptions.nodesCaptionsRule?(this._ogma.LKCaptions.refreshSchema(e),await this._ogma.LKCaptions.updateNodeCaptions()):this._ogma.LKCaptions.updateNodeCaptions(e.node),this._ogma.LKCaptions.edgesCaptionsRule?(this._ogma.LKCaptions.refreshSchema(e),await this._ogma.LKCaptions.updateEdgeCaptions()):this._ogma.LKCaptions.updateEdgeCaptions(e.edge)}updateNodeCaptions(e){if(e&&(this._captionSchema.node=e),!V.isDefined(this.nodesCaptionsRule))this.nodesCaptionsRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:e=>{if(e===void 0)return``;let t=an.getText(e.getData(),this._captionSchema.node,this._graphSchema.node);return V.isDefined(this._nodeMaxTextLength)?V.truncate(t,`middle`,this._nodeMaxTextLength):t}}},nodeSelector:e=>!e.isVirtual(),nodeDependencies:{self:{data:!0}}});else return this.nodesCaptionsRule.refresh()}updateEdgeCaptions(e){if(e&&(this._captionSchema.edge=e),!V.isDefined(this.edgesCaptionsRule))this.edgesCaptionsRule=this._ogma.styles.addRule({edgeAttributes:{text:{content:e=>{if(e===void 0||e.getData()===void 0)return``;let t=an.getText(e.getData(),this._captionSchema.edge,this._graphSchema.edge);return V.isDefined(this._edgeMaxTextLength)?V.truncate(t,`middle`,this._edgeMaxTextLength):t}}},edgeSelector:e=>!e.isVirtual(),edgeDependencies:{self:{data:!0,attributes:[`shape.style`]}}});else return this.edgesCaptionsRule.refresh()}};function J(e){return typeof e==`function`}function wn(e){return J(e?.lift)}function Tn(e){return function(t){if(wn(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError(`Unable to lift unknown Observable type`)}}var En=function(e,t){return En=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},En(e,t)};function Dn(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);En(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}function On(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function Y(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function X(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function kn(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var An=kn(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
2
+ `+t.map(function(e,t){return t+1+`) `+e.toString()}).join(`
3
+ `):``,this.name=`UnsubscriptionError`,this.errors=t}});function jn(e,t){if(e){var n=e.indexOf(t);0<=n&&e.splice(n,1)}}var Mn=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,n,r,i;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=On(a),s=o.next();!s.done;s=o.next())s.value.remove(this)}catch(t){e={error:t}}finally{try{s&&!s.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}else a.remove(this);var c=this.initialTeardown;if(J(c))try{c()}catch(e){i=e instanceof An?e.errors:[e]}var l=this._finalizers;if(l){this._finalizers=null;try{for(var u=On(l),d=u.next();!d.done;d=u.next()){var f=d.value;try{Pn(f)}catch(e){i??=[],e instanceof An?i=X(X([],Y(i)),Y(e.errors)):i.push(e)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}if(i)throw new An(i)}},e.prototype.add=function(t){if(t&&t!==this)if(this.closed)Pn(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=this._finalizers??[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&jn(t,e)},e.prototype.remove=function(t){var n=this._finalizers;n&&jn(n,t),t instanceof e&&t._removeParent(this)},e.EMPTY=(function(){var t=new e;return t.closed=!0,t})(),e}();Mn.EMPTY;function Nn(e){return e instanceof Mn||e&&`closed`in e&&J(e.remove)&&J(e.add)&&J(e.unsubscribe)}function Pn(e){J(e)?e():e.unsubscribe()}var Z={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},Q={setTimeout:function(e,t){var n=[...arguments].slice(2),r=Q.delegate;return r?.setTimeout?r.setTimeout.apply(r,X([e,t],Y(n))):setTimeout.apply(void 0,X([e,t],Y(n)))},clearTimeout:function(e){return(Q.delegate?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Fn(e){Q.setTimeout(function(){var t=Z.onUnhandledError;if(t)t(e);else throw e})}function In(){}var Ln=(function(){return Bn(`C`,void 0,void 0)})();function Rn(e){return Bn(`E`,void 0,e)}function zn(e){return Bn(`N`,e,void 0)}function Bn(e,t,n){return{kind:e,value:t,error:n}}var Vn=null;function Hn(e){Z.useDeprecatedSynchronousErrorHandling&&Vn&&(Vn.errorThrown=!0,Vn.error=e)}var Un=function(e){Dn(t,e);function t(t){var n=e.call(this)||this;return n.isStopped=!1,t?(n.destination=t,Nn(t)&&t.add(n)):n.destination=Zn,n}return t.create=function(e,t,n){return new qn(e,t,n)},t.prototype.next=function(e){this.isStopped?Xn(zn(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?Xn(Rn(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?Xn(Ln,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(Mn),Wn=Function.prototype.bind;function Gn(e,t){return Wn.call(e,t)}var Kn=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(e){Jn(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){Jn(e)}else Jn(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){Jn(e)}},e}(),qn=function(e){Dn(t,e);function t(t,n,r){var i=e.call(this)||this,a;if(J(t)||!t)a={next:t??void 0,error:n??void 0,complete:r??void 0};else{var o;i&&Z.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return i.unsubscribe()},a={next:t.next&&Gn(t.next,o),error:t.error&&Gn(t.error,o),complete:t.complete&&Gn(t.complete,o)}):a=t}return i.destination=new Kn(a),i}return t}(Un);function Jn(e){Z.useDeprecatedSynchronousErrorHandling?Hn(e):Fn(e)}function Yn(e){throw e}function Xn(e,t){var n=Z.onStoppedNotification;n&&Q.setTimeout(function(){return n(e,t)})}var Zn={closed:!0,next:In,error:Yn,complete:In};function Qn(e){return e}function $n(e,t,n,r,i){return new er(e,t,n,r,i)}var er=function(e){Dn(t,e);function t(t,n,r,i,a,o){var s=e.call(this,t)||this;return s.onFinalize=a,s.shouldUnsubscribe=o,s._next=n?function(e){try{n(e)}catch(e){t.error(e)}}:e.prototype._next,s._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,s._complete=r?function(){try{r()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,s}return t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((t=this.onFinalize)==null||t.call(this))}},t}(Un);function tr(e,t){return Tn(function(n,r){var i=0;n.subscribe($n(r,function(n){r.next(e.call(t,n,i++))}))})}function nr(e,t){return t===void 0&&(t=Qn),e??=rr,Tn(function(n,r){var i,a=!0;n.subscribe($n(r,function(n){var o=t(n);(a||!e(i,o))&&(a=!1,i=o,r.next(n))}))})}function rr(e,t){return e===t}var ir=class extends d.BehaviorSubject{constructor(e){super(e)}dispatch(e){this.next(e(this.value))}selectStore(e){return this.pipe(tr(e),nr((e,t)=>V.isEqual(e,t)))}clear(){this.next({selection:void 0,items:{node:[],edge:[]},changes:void 0,animation:!1})}},ar=class{constructor(e){this._store=new ir({selection:void 0,items:{node:[],edge:[]},changes:void 0,animation:!1}),this._ogma=e,this.listenToSelectionEvents()}get store(){return this._store}listenToSelectionEvents(){let e=Date.now(),t=!1;this._ogma.events.on(`animate`,n=>{if(n.updatesPositions===!1)return;t||(t=!0,this._store.dispatch(e=>({...e,animation:!0})));let r=Math.max(e,Date.now()+n.duration);if(r===e)return;e=r;let i=e-Date.now()+16;clearTimeout(this._animationThrottle),this._animationThrottle=setTimeout(()=>{t=!1,this._store.dispatch(e=>({...e,animation:!1}))},i)}),this._ogma.events.on(`dragStart`,()=>{this._store.dispatch(e=>({...e,animation:!0}))}),this._ogma.events.on(`dragEnd`,()=>{this._store.dispatch(e=>({...e,animation:!1}))}),this._ogma.events.on(`addNodes`,()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on(`removeNodes`,()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on(`addEdges`,()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on(`removeEdges`,()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on(`geoDisabled`,()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on(`geoEnabled`,()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on(`nodesSelected`,()=>{this._store.dispatch(this.storeNodeSelection.bind(this))}),this._ogma.events.on(`edgesSelected`,()=>{this._store.dispatch(this.storeEdgeSelection.bind(this))}),this._ogma.events.on(`nodesUnselected`,()=>{this._store.dispatch(this.storeNodeSelection.bind(this))}),this._ogma.events.on(`edgesUnselected`,()=>{this._store.dispatch(this.storeEdgeSelection.bind(this))}),this._ogma.events.on(`updateNodeData`,e=>{e!==void 0&&e.changes.forEach(e=>{this._store.dispatch(t=>({...t,changes:{entityType:`node`,input:e.property,value:e.newValues[0]}}))})}),this._ogma.events.on(`updateEdgeData`,e=>{e!==void 0&&e.changes.forEach(e=>{this._store.dispatch(t=>({...t,changes:{entityType:`edge`,input:e.property,value:e.newValues[0]}}))})})}storeItems(e){return{...e,items:{node:this._ogma.getNodes().getId(),edge:this._ogma.getEdges().getId()}}}storeNodeSelection(e){return{...e,selection:this._ogma.getSelectedNodes()}}storeEdgeSelection(e){return{...e,selection:this._ogma.getSelectedEdges()}}},or=750,sr=class extends u.default{constructor(e,t){super(e),this._configuration=e,Object.setPrototypeOf(this,new.target.prototype),this.initOgmaLinkuriousParser(!0,t)}initOgmaLinkuriousParser(e,t){this.nodeCategoriesWatcher=this.schema.watchNodeNonObjectProperty({path:`categories`,unwindArrays:!0,filter:`all`}),this.edgeTypeWatcher=this.schema.watchEdgeNonObjectProperty({path:`type`,filter:`all`}),this.setOptions({interactions:{zoom:{maxValue:e=>128/e.smallestNodeSize},selection:{enabled:!1}}}),this._reactive===void 0?(this._reactive=new ar(this),this.store=this._reactive.store):this._reactive.listenToSelectionEvents(),this.initSelection(),this.setConfigOgma(this._configuration,e,t),this.LKTransformation=new pr(this),this.LkNodeGroupingTransformation=new dr(this),this.LKStyles.setNodesDefaultHalo(),this.LKStyles.setEdgesDefaultHalo(),this.LKStyles.refreshCounterBadgeClass(),this.LKStyles.setFilterClass()}initSelection(){this.events.onClick(e=>{if(e!==void 0&&e.button===`left`)if(e.target!==null){let t=navigator.platform===`MacIntel`?`cmd`:`ctrl`;this.keyboard.isKeyPressed(t)?(e.target.isNode&&this.getSelectedEdges().size>0&&this.getSelectedEdges().setSelected(!1),!e.target.isNode&&this.getSelectedNodes().size>0&&this.getSelectedNodes().setSelected(!1),e.target.isSelected()?e.target.setSelected(!1):e.target.setSelected(!0)):(this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1),e.target.setSelected(!0))}else this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1)})}setStyles(e,t){this.LKStyles=new Sn(this,{node:e?.options?.styles?.node||{},edge:e?.options?.styles?.edge||{},baseUrl:t}),this.LKStyles.setNodesDefaultStyles(),this.LKStyles.setEdgesDefaultStyles()}setCaptions(e){let t=e?.options?.styles?.node?.text?.maxTextLength,n=e?.options?.styles?.edge?.text?.maxTextLength;this.LKCaptions=new Cn(this,t,n)}getForceLayoutParams(e,t=0){let n=300-260/5e3*this.getNodes().size;return n<40&&(n=40),{steps:e===l.ForceLayoutMode.FAST?n:300,alignSiblings:this.getNodes().size>3,duration:t,charge:20,gravity:.08,theta:this.getNodes().size>100?.8:.34}}getRadialLayoutParams(e,t=0){return{centralNode:e,radiusDelta:1,nodeGap:10,repulsion:this.getNodes().size>80?1:6,duration:t}}getHierarchicalLayoutParams(e,t,n=0){return{direction:e,roots:[t],duration:n}}async init(e){this.clearGraph();let t,n=[],r=e.nodes.map(e=>(e.attributes.selected&&(t=l.EntityType.NODE,n.push(e.id)),delete e.attributes.selected,e)),i=e.edges.map(e=>(e.attributes!==void 0&&(e.attributes.selected&&((t===void 0||t===l.EntityType.NODE)&&(t=l.EntityType.EDGE,n=[]),n.push(e.id)),delete e.attributes.selected),e));await this.addGraphAfterValidation({nodes:r,edges:i}),t===l.EntityType.NODE?this.getNodes(n).setSelected(!0):t===l.EntityType.EDGE&&this.getEdges(n).setSelected(!0)}async initVisualization(e){await this.init(e);let t=pn.sanitizeStylesIndex(e.design.styles);this.LKStyles.initNodeColors(t.node),this.LKStyles.initNodesIcons(t.node),this.LKStyles.initNodesSizes(t.node),this.LKStyles.initNodesShapes(t.node),this.LKStyles.initEdgesWidth(t.edge),this.LKStyles.initEdgesShape(t.edge),this.LKStyles.initEdgesColor(t.edge),await this.LKStyles.initBadges(t.badges),await this.LKCaptions.initVizCaptions({node:e.nodeFields.captions||{},edge:e.edgeFields.captions||{}}),this.LKTransformation.groupedEdges=e.edgeGrouping,await this.LKTransformation.initTransformation(),this.LKTransformation.initEdgeGroupingStyle()}async addGraphAfterValidation(e){return{nodes:await this.addNodes(e.nodes),edges:await this.addEdges(e.edges)}}addEdges(e,t){return super.addEdges(e,{...t,ignoreInvalid:!0})}getNonFilteredNodes(e){return V.isDefined(e)?this.getNodes(e).filter(e=>!e.hasClass(`filtered`)):this.getNodes(`raw`).filter(e=>!e.hasClass(`filtered`))}getFilteredNodes(e,t=`raw`){return V.isDefined(e)?this.getNodes(e).filter(e=>e.hasClass(`filtered`)):this.getNodes(t).filter(e=>e.hasClass(`filtered`))}getNonFilteredEdges(e){return V.isDefined(e)?this.getEdges(e).filter(e=>!e.hasClass(`filtered`)):this.getEdges(`raw`).filter(e=>!e.hasClass(`filtered`))}getFilteredEdges(e,t=`raw`){return V.isDefined(e)?this.getEdges(e).filter(e=>e.hasClass(`filtered`)):this.getEdges(t).filter(e=>e.hasClass(`filtered`))}shutDown(){this.destroy(),this.store&&this.store.clear()}clearOgmaState(){this.reset(),this.store&&this.store.clear(),this.initOgmaLinkuriousParser()}setConfigOgma(e,t,n){e&&(this._configuration=e),t||this.setOptions({...this._configuration.options,renderer:this._configuration.renderer}),this.setStyles(this._configuration,n),this.setCaptions(this._configuration)}getSelectedNodes(){return this.getNodes(`all`).filter(e=>e.isSelected())}clearSelection(){this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1)}},cr={lightsalmon:{hex:`#FFA07A`,rgb:`rbg(255,160,122)`},salmon:{hex:`#FA8072`,rgb:`rgb(250,128,114)`},darksalmon:{hex:`#E9967A`,rgb:`rgb(233,150,122)`},lightcoral:{hex:`#F08080`,rgb:`rgb(240,128,128)`},indianred:{hex:`#CD5C5C`,rgb:`rgb(205,92,92)`},crimson:{hex:`#DC143C`,rgb:`rgb(220,20,60)`},firebrick:{hex:`#B22222`,rgb:`rgb(178,34,34)`},red:{hex:`#FF0000`,rgb:`rgb(255,0,0)`},darkred:{hex:`#8B0000`,rgb:`rgb(139,0,0)`},coral:{hex:`#FF7F50`,rgb:`rgb(255,127,80)`},tomato:{hex:`#FF6347`,rgb:`rgb(255,99,71)`},orangered:{hex:`#FF4500`,rgb:`rgb(255,69,0)`},gold:{hex:`#FFD700`,rgb:`rgb(255,215,0)`},orange:{hex:`#FFA500`,rgb:`rgb(255,165,0)`},darkorange:{hex:`#FF8C00`,rgb:`rgb(255,140,0)`},lightyellow:{hex:`#FFFFE0`,rgb:`rgb(255,255,224)`},lemonchiffon:{hex:`#FFFACD`,rgb:`rgb(255,250,205)`},lightgoldenrodyellow:{hex:`#FAFAD2`,rgb:`rgb(250,250,210)`},papayawhip:{hex:`#FFEFD5`,rgb:`rgb(255,239,213)`},moccasin:{hex:`#FFE4B5`,rgb:`rgb(255,228,181)`},peachpuff:{hex:`#FFDAB9`,rgb:`rgb(255,218,185)`},palegoldenrod:{hex:`#EEE8AA`,rgb:`rgb(238,232,170)`},khaki:{hex:`#F0E68C`,rgb:`rgb(240,230,140)`},darkkhaki:{hex:`#BDB76B`,rgb:`rgb(189,183,107)`},yellow:{hex:`#FFFF00`,rgb:`rgb(255,255,0)`},lawngreen:{hex:`#7CFC00`,rgb:`rgb(124,252,0)`},chartreuse:{hex:`#7FFF00`,rgb:`rgb(127,255,0)`},limegreen:{hex:`#32CD32`,rgb:`rgb(50,205,50)`},lime:{hex:`#00FF00`,rgb:`rgb(0.255.0)`},forestgreen:{hex:`#228B22`,rgb:`rgb(34,139,34)`},green:{hex:`#008000`,rgb:`rgb(0,128,0)`},darkgreen:{hex:`#006400`,rgb:`rgb(0,100,0)`},greenyellow:{hex:`#ADFF2F`,rgb:`rgb(173,255,47)`},yellowgreen:{hex:`#9ACD32`,rgb:`rgb(154,205,50)`},springgreen:{hex:`#00FF7F`,rgb:`rgb(0,255,127)`},mediumspringgreen:{hex:`#00FA9A`,rgb:`rgb(0,250,154)`},lightgreen:{hex:`#90EE90`,rgb:`rgb(144,238,144)`},palegreen:{hex:`#98FB98`,rgb:`rgb(152,251,152)`},darkseagreen:{hex:`#8FBC8F`,rgb:`rgb(143,188,143)`},mediumseagreen:{hex:`#3CB371`,rgb:`rgb(60,179,113)`},seagreen:{hex:`#2E8B57`,rgb:`rgb(46,139,87)`},olive:{hex:`#808000`,rgb:`rgb(128,128,0)`},darkolivegreen:{hex:`#556B2F`,rgb:`rgb(85,107,47)`},olivedrab:{hex:`#6B8E23`,rgb:`rgb(107,142,35)`},lightcyan:{hex:`#E0FFFF`,rgb:`rgb(224,255,255)`},cyan:{hex:`#00FFFF`,rgb:`rgb(0,255,255)`},aqua:{hex:`#00FFFF`,rgb:`rgb(0,255,255)`},aquamarine:{hex:`#7FFFD4`,rgb:`rgb(127,255,212)`},mediumaquamarine:{hex:`#66CDAA`,rgb:`rgb(102,205,170)`},paleturquoise:{hex:`#AFEEEE`,rgb:`rgb(175,238,238)`},turquoise:{hex:`#40E0D0`,rgb:`rgb(64,224,208)`},mediumturquoise:{hex:`#48D1CC`,rgb:`rgb(72,209,204)`},darkturquoise:{hex:`#00CED1`,rgb:`rgb(0,206,209)`},lightseagreen:{hex:`#20B2AA`,rgb:`rgb(32,178,170)`},cadetblue:{hex:`#5F9EA0`,rgb:`rgb(95,158,160)`},darkcyan:{hex:`#008B8B`,rgb:`rgb(0,139,139)`},teal:{hex:`#008080`,rgb:`rgb(0,128,128)`},powderblue:{hex:`#B0E0E6`,rgb:`rgb(176,224,230)`},lightblue:{hex:`#ADD8E6`,rgb:`rgb(173,216,230)`},lightskyblue:{hex:`#87CEFA`,rgb:`rgb(135,206,250)`},skyblue:{hex:`#87CEEB`,rgb:`rgb(135,206,235)`},deepskyblue:{hex:`#00BFFF`,rgb:`rgb(0,191,255)`},lightsteelblue:{hex:`#B0C4DE`,rgb:`rgb(176,196,222)`},dodgerblue:{hex:`#1E90FF`,rgb:`rgb(30,144,255)`},cornflowerblue:{hex:`#6495ED`,rgb:`rgb(100,149,237)`},steelblue:{hex:`#4682B4`,rgb:`rgb(70,130,180)`},royalblue:{hex:`#4169E1`,rgb:`rgb(65,105,225)`},blue:{hex:`#0000FF`,rgb:`rgb(0,0,255)`},mediumblue:{hex:`#0000CD`,rgb:`rgb(0,0,205)`},darkblue:{hex:`#00008B`,rgb:`rgb(0,0,139)`},navy:{hex:`#000080`,rgb:`rgb(0,0,128)`},midnightblue:{hex:`#191970`,rgb:`rgb(25,25,112)`},mediumslateblue:{hex:`#7B68EE`,rgb:`rgb(123,104,238)`},slateblue:{hex:`#6A5ACD`,rgb:`rgb(106,90,205)`},darkslateblue:{hex:`#483D8B`,rgb:`rgb(72,61,139)`},lavender:{hex:`#E6E6FA`,rgb:`rgb(230,230,250)`},thistle:{hex:`#D8BFD8`,rgb:`rgb(216,191,216)`},plum:{hex:`#DDA0DD`,rgb:`rgb(221,160,221)`},violet:{hex:`#EE82EE`,rgb:`rgb(238,130,238)`},orchid:{hex:`#DA70D6`,rgb:`rgb(218,112,214)`},fuchsia:{hex:`#FF00FF`,rgb:`rgb(255,0,255)`},magenta:{hex:`#FF00FF`,rgb:`rgb(255,0,255)`},mediumorchid:{hex:`#BA55D3`,rgb:`rgb(186,85,211)`},mediumpurple:{hex:`#9370DB`,rgb:`rgb(147,112,219)`},blueviolet:{hex:`#8A2BE2`,rgb:`rgb(138,43,226)`},darkviolet:{hex:`#9400D3`,rgb:`rgb(148,0,211)`},darkorchid:{hex:`#9932CC`,rgb:`rgb(153,50,204)`},darkmagenta:{hex:`#8B008B`,rgb:`rgb(139,0,139)`},purple:{hex:`#800080`,rgb:`rgb(128,0,128)`},indigo:{hex:`#4B0082`,rgb:`rgb(75,0,130)`},pink:{hex:`#FFC0CB`,rgb:`rgb(255,192,203)`},lightpink:{hex:`#FFB6C1`,rgb:`rgb(255,182,193)`},hotpink:{hex:`#FF69B4`,rgb:`rgb(255,105,180)`},deeppink:{hex:`#FF1493`,rgb:`rgb(255,20,147)`},palevioletred:{hex:`#DB7093`,rgb:`rgb(219,112,147)`},mediumvioletred:{hex:`#C71585`,rgb:`rgb(199,21,133)`},white:{hex:`#FFFFFF`,rgb:`rgb(255,255,255)`},snow:{hex:`#FFFAFA`,rgb:`rgb(255,250,250)`},honeydew:{hex:`#F0FFF0`,rgb:`rgb(240,255,240)`},mintcream:{hex:`#F5FFFA`,rgb:`rgb(245,255,250)`},azure:{hex:`#F0FFFF`,rgb:`rgb(240,255,255)`},aliceblue:{hex:`#F0F8FF`,rgb:`rgb(240,248,255)`},ghostwhite:{hex:`#F8F8FF`,rgb:`rgb(248,248,255)`},whitesmoke:{hex:`#F5F5F5`,rgb:`rgb(245,245,245)`},seashell:{hex:`#FFF5EE`,rgb:`rgb(255,245,238)`},beige:{hex:`#F5F5DC`,rgb:`rgb(245,245,220)`},oldlace:{hex:`#FDF5E6`,rgb:`rgb(253,245,230)`},floralwhite:{hex:`#FFFAF0`,rgb:`rgb(255,250,240)`},ivory:{hex:`#FFFFF0`,rgb:`rgb(255,255,240)`},antiquewhite:{hex:`#FAEBD7`,rgb:`rgb(250,235,215)`},linen:{hex:`#FAF0E6`,rgb:`rgb(250,240,230)`},lavenderblush:{hex:`#FFF0F5`,rgb:`rgb(255,240,245)`},mistyrose:{hex:`#FFE4E1`,rgb:`rgb(255,228,225)`},gainsboro:{hex:`#DCDCDC`,rgb:`rgb(220,220,220)`},lightgray:{hex:`#D3D3D3`,rgb:`rgb(211,211,211)`},silver:{hex:`#C0C0C0`,rgb:`rgb(192,192,192)`},darkgray:{hex:`#A9A9A9`,rgb:`rgb(169,169,169)`},gray:{hex:`#808080`,rgb:`rgb(128,128,128)`},dimgray:{hex:`#696969`,rgb:`rgb(105,105,105)`},lightslategray:{hex:`#778899`,rgb:`rgb(119,136,153)`},slategray:{hex:`#708090`,rgb:`rgb(112,128,144)`},darkslategray:{hex:`#2F4F4F`,rgb:`rgb(47,79,79)`},black:{hex:`#000000`,rgb:`rgb(0,0,0)`},cornsilk:{hex:`#FFF8DC`,rgb:`rgb(255,248,220)`},blanchedalmond:{hex:`#FFEBCD`,rgb:`rgb(255,235,205)`},bisque:{hex:`#FFE4C4`,rgb:`rgb(255,228,196)`},navajowhite:{hex:`#FFDEAD`,rgb:`rgb(255,222,173)`},wheat:{hex:`#F5DEB3`,rgb:`rgb(245,222,179)`},burlywood:{hex:`#DEB887`,rgb:`rgb(222,184,135)`},tan:{hex:`#D2B48C`,rgb:`rgb(210,180,140)`},rosybrown:{hex:`#BC8F8F`,rgb:`rgb(188,143,143)`},sandybrown:{hex:`#F4A460`,rgb:`rgb(244,164,96)`},goldenrod:{hex:`#DAA520`,rgb:`rgb(218,165,32)`},peru:{hex:`#CD853F`,rgb:`rgb(205,133,63)`},chocolate:{hex:`#D2691E`,rgb:`rgb(210,105,30)`},saddlebrown:{hex:`#8B4513`,rgb:`rgb(139,69,19)`},sienna:{hex:`#A0522D`,rgb:`rgb(160,82,45)`},brown:{hex:`#A52A2A`,rgb:`rgb(165,42,42)`},maroon:{hex:`#800000`,rgb:`rgb(128,0,0)`}},lr={steps:250,alignSiblings:!0,charge:20,theta:.34,duration:750,gravity:.0475,gpu:!0},$=class{static getHiddenNeighbors(e){return e.reduce((e,t)=>{let n=t.getData(`statistics`);if(n!==void 0){let r=n.degree!==void 0&&!n.supernode?n.degree-V.getDegreeWithoutSelfConnection(t):n.supernodeDegree;if(r!==void 0&&r>0)return e+=r}return e},0)}static getDegreeWithoutSelfConnection(e){return e.getAdjacentNodes({policy:`exclude-sources`,filter:`all`}).size}static isBright(e){if(e===null||!V.isStringFilled(e))return!0;let t=/#[A-Fa-f0-9]{3,6}/,n=/^rgb\(\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*\)$/i,r=/^rgba\(\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*(?:0|1|0?\.\d+)\s*\)$/i,i;if(t.test(e))e.length<5&&(e+=e.slice(1)),e=e.replace(`#`,``),i=`rgb(${parseInt(e[0].toString()+e[1].toString(),16)}, ${parseInt(e[2].toString()+e[3].toString(),16)}, ${parseInt(e[4].toString()+e[5].toString(),16)})`;else if(n.test(e)||r.test(e)||cr[e.toLowerCase()]!==void 0)i=V.isDefined(cr[e.toLowerCase()])?cr[e.toLowerCase()].rgb:e;else return!0;let[a,o,s]=/rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,(?:0|1|0?\.\d+))?\)/.exec(i.replace(/\s/g,``)).slice(1,4);return!V.isDefined(a)||!V.isDefined(o)||!V.isDefined(s)?(console.warn(`The given color is not a valid rgb formatted color`),!0):(a*299+o*587+s*114)/1e3>255*.7}static isNode(e){return e.isNode}static isNodeList(e){return e.isNode}static topologicalSort(e){let t=e.toArray().filter(e=>e.getDegree()===1),n=new Set,r=[];return t.forEach(e=>{let t=e;if(n.has(t))return;let i=[];for(;t;){i.push(t),n.add(t);let e=t.getAdjacentNodes().filter(e=>!n.has(e)).get(0);t=e===void 0?null:e}r.push(i)}),r.sort((e,t)=>t.length-e.length),{chain:r.flat().map(e=>e.getId()),numberOfChain:t.length/2}}static isStar(e){for(let t of e.toArray()){let n=t.getAdjacentNodes();if(t.getDegree()>2&&n.getDegree().every(e=>e===1)&&n.size+1===e.size)return t}return!1}static isGroupCollapsed(e){return e.getData(`collapsed`)}static setCollapsedGroupProperty(e,t){e.setData(`collapsed`,t)}},ur=`LKE_NODE_GROUPING_EDGE`,dr=class e{constructor(e){this._collapsedDefaultValue=!1,this._nodeGroupingAttributes=[],this._ogma=e}setGroupingRule(e){this.groupRule=e}async initTransformation(){this.transformation===void 0?this.transformation=this._ogma.transformations.addNodeGrouping({groupIdFunction:e=>{if(this._isRuleNotApplicableToNode(e))return;let t=this.groupRule;return t.groupingType===l.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._getAdjacentEdgeGroupId(e,t):this._getPropertyValueGroupId(e,t)},nodeGenerator:e=>{let t=new Set(e.getData(`categories`).flat()),n=this._findNodeGroupId(e);return{data:{categories:[],subCategories:Array.from(t),collapsed:this._getDefaultCollapsedState(n),nodeGroupId:n},attributes:{layoutable:this._getDefaultLayoutableValue(n)}}},onGroupUpdate:(e,t)=>{if(t.size!==1)return{layout:`force`,params:{...lr}}},edgeGenerator:()=>({data:{type:ur}}),showContents:e=>!$.isGroupCollapsed(e),duration:300,padding:10}):await this.refreshTransformation(),await this._ogma.transformations.afterNextUpdate()}async refreshTransformation(){this.transformation===void 0?await this.initTransformation():(await this.transformation.refresh(),await this._unpinNodes(this._getAllTransformationRawNodes()))}initNodeGroupingStyle(){this._nodeGroupingStyleRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:e=>this._getNodeGroupingCaption(e),style:`bold`},layer:-1,color:`rgba(240, 240, 240)`,innerStroke:{color:`#7f7f7f`,width:2}},nodeSelector:e=>e.isVirtual()&&!$.isGroupCollapsed(e),nodeDependencies:{self:{data:!0}}}),this._initIntermediateGroupStyle(),this._nodeGroupingCollapsedStyleRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:e=>this._getNodeGroupingCaption(e),style:`bold`},halo:{width:4,color:`#e4ebea`,strokeColor:`#ccc`},badges:{bottomLeft:e=>{let t=e.getSubNodes().filter(e=>!e.hasClass(`filtered`))?.size;return{color:gn,minVisibleSize:20,stroke:{width:2,color:`#FFFFFF`},text:{font:V.isDefined(this._ogma.LKStyles.nodeFont)?this._ogma.LKStyles.nodeFont:mn,scale:.4,color:q,content:`x${t}`}}},topLeft:()=>({color:gn,minVisibleSize:20,stroke:{width:2,color:`#FFFFFF`},text:{font:`FontAwesome`,scale:.4,color:q,content:``}})},color:e=>{if(e!==void 0)return this._ogma.LKStyles.nodeAttributes.color({geo:{},isVirtual:!1,properties:{},readAt:0,categories:e.getData(`subCategories`)})},icon:e=>{let t=e?.getData(`subCategories`);if(!(!V.isDefined(e)||t.length>1))return this._ogma.LKStyles.nodeAttributes.icon({geo:{},isVirtual:!1,properties:{},readAt:0,categories:t}).icon}},nodeSelector:e=>e.isVirtual()&&$.isGroupCollapsed(e)&&!e.hasClass(`filtered`)}),this._setSubSelectedClass()}async refreshNodeGroupingStyle(){await this._nodeGroupingStyleRule?.refresh(),await this._nodeGroupingCollapsedStyleRule?.refresh()}getVirtualNodesOfTransformation(){return this.transformation.getContext().metaNodes}setNodeGroupingAttributes(e){this._nodeGroupingAttributes=e}setCollapseDefaultValue(e){this._collapsedDefaultValue=e}_getNodeGroupingCaption(e){if(!(!V.isDefined(e)||!V.isDefined(this.groupRule)))return this.groupRule.groupingType===l.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._getAdjacentEdgeNodeGroupingCaption(e,this.groupRule):this._getPropertyValueNodeGroupingCaption(e,this.groupRule)}_getAdjacentEdgeNodeGroupingCaption(t,n){let r=t.getSubNodes();if(!(!V.isDefined(r)||!V.isDefined(r.get(0))))return e._getGroupCentralNode(r.get(0),n).getData([`properties`,`name`])}_getPropertyValueNodeGroupingCaption(e,t){if(e.isVirtual()&&e.getSubNodes()?.get(0)!==void 0){let n=e.getSubNodes().get(0).getData([`properties`,t.groupingOptions.propertyKey]);return`${V.getValueFromLkProperty(n)} (${e.getSubNodes().filter(e=>!e.hasClass(`filtered`)).size})`}}_isRuleNotApplicableToNode(e){let t=this.groupRule;return t===void 0?!0:t.groupingType===l.NodeGroupingType.BY_PROPERTY_VALUE?this._isPropertyRuleNotApplicableToNode(e,t):t.groupingType===l.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._isRelationshipRuleNotApplicableToNode(e,t):!0}_isRelationshipRuleNotApplicableToNode(e,t){return!this._hasEdgeOfType(e,t.groupingOptions.edgeType)}_hasEdgeOfType(e,t){let n=!1;return e.getAdjacentEdges().forEach(e=>{e.getData(`type`)===t&&(n=!0)}),n}_isPropertyRuleNotApplicableToNode(e,t){let n=e.getData([`properties`,t.groupingOptions.propertyKey??``]);return t.groupingOptions.itemTypes.every(t=>!e.getData(`categories`).includes(t))||!V.isDefined(n)||typeof n==`object`&&n.status===`missing`}async _unpinNodes(e){await Promise.all(e.map(e=>e===null?Promise.resolve():e.setAttribute(`layoutable`,!0)))}_getAllTransformationRawNodes(){return this.getVirtualNodesOfTransformation().getSubNodes()}_findGroupingPropertyValue(e){let t=this.groupRule,n=e.getData([`properties`,t.groupingOptions.propertyKey??``]);return`${V.getValueFromLkProperty(n)}`}_findNodeGroupId(t){let n=this.groupRule;if(n.groupingType===l.NodeGroupingType.BY_ADJACENT_EDGE_TYPE){let r=e._getGroupCentralNode(t.get(0),n);return(0,H.default)(`${this.groupRule?.name}-${r.getId()}`)}else{let e=this._findGroupingPropertyValue(t.get(0));return(0,H.default)(`${n.name}-${n.groupingOptions.itemTypes.join(`-`)}-${e}`)}}static _getGroupCentralNode(e,t){let n=e.getAdjacentEdges({filter:`raw`}).filter(e=>e.getData(`type`)===t.groupingOptions.edgeType).get(0);return t.groupingOptions.centralNodeIs===`source`?n.getSource():n.getTarget()}_getPropertyValueGroupId(e,t){let n=this._findGroupingPropertyValue(e);return`${t.groupingOptions.itemTypes.join(`-`)}-${n}`.toLowerCase().trim()}_getAdjacentEdgeGroupId(t,n){return e._getGroupCentralNode(t,n).getId().toString()}_initIntermediateGroupStyle(){this._ogma.styles.addRule({nodeAttributes:{color:`rgba(240, 240, 240)`},nodeSelector:e=>e.isVirtual()&&$.isGroupCollapsed(e),nodeDependencies:{self:{data:!0}}})}_getDefaultCollapsedState(e){let t=this._nodeGroupingAttributes.find(t=>t.id===e);return V.isDefined(t)&&V.isDefined(t.attributes.collapsed)?t.attributes.collapsed:this._collapsedDefaultValue}_getDefaultLayoutableValue(e){let t=this._nodeGroupingAttributes.find(t=>t.id===e);return V.isDefined(t)&&V.isDefined(t.attributes.layoutable)?t.attributes.layoutable:!0}_setSubSelectedClass(){this._ogma.styles.createClass({name:`subSelection`,nodeAttributes:{halo:{width:4,color:`#e67a8f`,strokeColor:`#ccc`}}})}},fr={color:`#000000`,shape:{style:`dashed`,head:`arrow`},width:1.5},pr=class{constructor(e){this._ogma=e,this.groupedEdges={}}async initTransformation(){this.transformation===void 0?this.transformation=this._ogma.transformations.addEdgeGrouping({separateEdgesByDirection:!0,selector:e=>this.groupedEdges[e.getData(`type`)],groupIdFunction:e=>e.getData(`type`),generator:e=>({data:{properties:{originalType:e.getData(`type`)[0]}}})}):await this.transformation.refresh()}initEdgeGroupingStyle(){this.edgeGroupingStyleRule=this._ogma.styles.addRule({edgeAttributes:{...fr,...this.edgeGroupStyle,text:{content:e=>{if(e!==void 0&&e.getSubEdges()!==null&&e.getData(`type`)!==`LKE_NODE_GROUPING_EDGE`){let t=e.getSubEdges().filter(e=>!e.hasClass(`filtered`)).size;return`${e.getData([`properties`,`originalType`])} (${t})`}},style:`bold`}},edgeSelector:e=>e.isVirtual()&&e.getSubEdges()&&e.getSubEdges().filter(e=>!e.hasClass(`filtered`)).size>0&&e.getData(`type`)!==`LKE_NODE_GROUPING_EDGE`,edgeDependencies:{self:{data:!0}}})}refreshEdgeGroupingStyle(){this.edgeGroupingStyleRule!==void 0&&this.edgeGroupingStyleRule.refresh()}},mr=class e{static{this.nodeCache=new Map}static{this.edgeCache=new Map}static{this.FILTER_CACHE_SIZE=5}static isFiltered(t,n){return V.isDefined(n)?`categories`in n?e.getFilterFunction(t,!0)(n):e.getFilterFunction(t,!1)(n):!1}static getFilterFunction(t,n){let r=JSON.stringify(t,null,``),i=n?e.nodeCache:e.edgeCache,a=i.get(r);return a||(a=e.createFilterFunction(t,n),i.size>e.FILTER_CACHE_SIZE&&i.clear(),i.set(r,a)),a}static createFilterFunction(t,n){let r=t.map(t=>e.filterToFilterFunction(t,n));return e=>{for(let t of r)if(t(e))return!0;return!1}}static filterToFilterFunction(t,n){switch(t.type){case l.SelectorType.ANY:return e.createAnyFilterFunction(t,n);case l.SelectorType.IS:return e.createIsFilterFunction(t,n);case l.SelectorType.NO_VALUE:return e.createNoValueFilterFunction(t,n);case l.SelectorType.RANGE:return e.createRangeFilterFunction(t,n);case l.SelectorType.NAN:return e.createNaNFilterFunction(t,n)}}static createAnyFilterFunction(e,t){return t?t=>e.itemType===void 0?!0:t.categories.includes(e.itemType):t=>t.type===e.itemType}static createIsFilterFunction(e,t){return t?t=>t.categories.includes(e.itemType)&&V.getPropertyValue(V.getIn(t,e.input),!0)===e.value:t=>t.type===e.itemType&&V.getPropertyValue(V.getIn(t,e.input),!0)===e.value}static createNoValueFilterFunction(e,t){return t?t=>t.categories.includes(e.itemType)&&!V.isDefined(V.getPropertyValue(V.getIn(t,e.input),!0)):t=>t.type===e.itemType&&!V.isDefined(V.getPropertyValue(V.getIn(t,e.input),!0))}static createNaNFilterFunction(t,n){return n?n=>n.categories.includes(t.itemType)&&e.isNotANumber(V.getPropertyValue(V.getIn(n,t.input),!0)):n=>n.type===t.itemType&&e.isNotANumber(V.getPropertyValue(V.getIn(n,t.input),!0))}static isNotANumber(e){return V.isDefined(e)&&!V.isNumber(e)}static createRangeFilterFunction(t,n){return n?n=>n.categories.includes(t.itemType)&&e.valueShouldBeHidden(V.getPropertyValue(V.getIn(n,t.input),!1),t.value):n=>n.type===t.itemType&&e.valueShouldBeHidden(V.getPropertyValue(V.getIn(n,t.input),!1),t.value)}static valueShouldBeHidden(e,t){let n=V.parseFloat(e);return Number.isNaN(n)?!1:t[`<`]!==void 0&&n<t[`<`]||t[`<=`]!==void 0&&n<=t[`<=`]||t[`>`]!==void 0&&n>t[`>`]||t[`>=`]!==void 0&&n>=t[`>=`]}},hr=e=>e.selection.size,gr=e=>{switch(e.selection.size){case 1:return`selection`;case 0:return`noSelection`;default:return`multiSelection`}},_r=e=>{if(!(!V.isDefined(e.selection)||e.selection.size===0))return e.selection.isNode?l.EntityType.NODE:l.EntityType.EDGE},vr=e=>V.isDefined(e.selection)&&e.selection.size===1?e.selection.get(0):void 0,yr=e=>{let t=vr(e);if(t!==void 0)return t.isNode?t.getData(`categories`):[t.getData(`type`)]},br=e=>{let t=vr(e);if(t!==void 0)return t.isNode?`node`:`edge`},xr=e=>{let t=vr(e);if(t!==void 0){let e=t.getData().properties;return Object.keys(e).map(t=>({key:t,value:e[t]}))}return[]},Sr=e=>xr(e).length>0;exports.ANIMATION_DURATION=or,exports.BADGE_COLOR=gn,exports.BASE_GREY=U,exports.Captions=an,exports.CaptionsViz=Cn,exports.EdgeAttributes=ln,exports.FILTER_OPACITY=hn,exports.FORCE_LAYOUT_CONFIG=lr,exports.Filters=mr,exports.HTML_COLORS=cr,exports.ItemAttributes=W,exports.LKE_NODE_GROUPING_EDGE=ur,exports.LKOgma=sr,exports.NodeAttributes=un,exports.OgmaStore=ir,exports.OgmaTools=$,exports.PALETTE=cn,exports.StyleRule=fn,exports.StyleRuleType=dn,exports.StyleRules=pn,exports.StyleType=G,exports.StylesViz=Sn,exports.Tools=V,exports.TransformationsViz=pr,exports.getSelectionEntity=_r,exports.getSelectionProperties=xr,exports.getSelectionSize=hr,exports.getSelectionState=gr,exports.getUniqSelection=vr,exports.getUniqSelectionEntity=br,exports.getUniqSelectionTypes=yr,exports.hasSelectionProperties=Sr;
4
+ //# sourceMappingURL=index.cjs.map