@linkurious/ogma-linkurious-parser 4.1.8 → 4.1.9
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.
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +92 -75
- package/dist/index.mjs.map +1 -1
- package/dist/styles/styleRules.d.ts +8 -0
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@linkurious/rest-client"),mr=require("@linkurious/ogma"),_r=require("rxjs");var Z=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ie(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Sr(){this.__data__=[],this.size=0}var Cr=Sr;function Ar(r,e){return r===e||r!==r&&e!==e}var Pe=Ar,xr=Pe;function Er(r,e){for(var t=r.length;t--;)if(xr(r[t][0],e))return t;return-1}var se=Er,$r=se,Tr=Array.prototype,Fr=Tr.splice;function Nr(r){var e=this.__data__,t=$r(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():Fr.call(e,t,1),--this.size,!0}var wr=Nr,Or=se;function Dr(r){var e=this.__data__,t=Or(e,r);return t<0?void 0:e[t][1]}var Lr=Dr,Ir=se;function Pr(r){return Ir(this.__data__,r)>-1}var Mr=Pr,Rr=se;function Br(r,e){var t=this.__data__,i=Rr(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}var zr=Br,Gr=Cr,Ur=wr,jr=Lr,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=Gr;U.prototype.delete=Ur;U.prototype.get=jr;U.prototype.has=kr;U.prototype.set=Hr;var ae=U,Vr=ae;function Kr(){this.__data__=new Vr,this.size=0}var qr=Kr;function Wr(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var Yr=Wr;function Jr(r){return this.__data__.get(r)}var Zr=Jr;function Xr(r){return this.__data__.has(r)}var Qr=Xr,ei=typeof Z=="object"&&Z&&Z.Object===Object&&Z,zt=ei,ti=zt,ri=typeof self=="object"&&self&&self.Object===Object&&self,ii=ti||ri||Function("return this")(),O=ii,ni=O,si=ni.Symbol,W=si,Ye=W,Gt=Object.prototype,ai=Gt.hasOwnProperty,oi=Gt.toString,K=Ye?Ye.toStringTag:void 0;function ui(r){var e=ai.call(r,K),t=r[K];try{r[K]=void 0;var i=!0}catch{}var n=oi.call(r);return i&&(e?r[K]=t:delete r[K]),n}var li=ui,ci=Object.prototype,di=ci.toString;function gi(r){return di.call(r)}var hi=gi,Je=W,fi=li,pi=hi,bi="[object Null]",yi="[object Undefined]",Ze=Je?Je.toStringTag:void 0;function vi(r){return r==null?r===void 0?yi:bi:Ze&&Ze in Object(r)?fi(r):pi(r)}var Y=vi;function mi(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var oe=mi,_i=Y,Si=oe,Ci="[object AsyncFunction]",Ai="[object Function]",xi="[object GeneratorFunction]",Ei="[object Proxy]";function $i(r){if(!Si(r))return!1;var e=_i(r);return e==Ai||e==xi||e==Ci||e==Ei}var Ut=$i,Ti=O,Fi=Ti["__core-js_shared__"],Ni=Fi,pe=Ni,Xe=function(){var r=/[^.]+$/.exec(pe&&pe.keys&&pe.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function wi(r){return!!Xe&&Xe in r}var Oi=wi,Di=Function.prototype,Li=Di.toString;function Ii(r){if(r!=null){try{return Li.call(r)}catch{}try{return r+""}catch{}}return""}var jt=Ii,Pi=Ut,Mi=Oi,Ri=oe,Bi=jt,zi=/[\\^$.*+?()[\]{}|]/g,Gi=/^\[object .+?Constructor\]$/,Ui=Function.prototype,ji=Object.prototype,ki=Ui.toString,Hi=ji.hasOwnProperty,Vi=RegExp("^"+ki.call(Hi).replace(zi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ki(r){if(!Ri(r)||Mi(r))return!1;var e=Pi(r)?Vi:Gi;return e.test(Bi(r))}var qi=Ki;function Wi(r,e){return r==null?void 0:r[e]}var Yi=Wi,Ji=qi,Zi=Yi;function Xi(r,e){var t=Zi(r,e);return Ji(t)?t:void 0}var M=Xi,Qi=M,en=O,tn=Qi(en,"Map"),Me=tn,rn=M,nn=rn(Object,"create"),ue=nn,Qe=ue;function sn(){this.__data__=Qe?Qe(null):{},this.size=0}var an=sn;function on(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var un=on,ln=ue,cn="__lodash_hash_undefined__",dn=Object.prototype,gn=dn.hasOwnProperty;function hn(r){var e=this.__data__;if(ln){var t=e[r];return t===cn?void 0:t}return gn.call(e,r)?e[r]:void 0}var fn=hn,pn=ue,bn=Object.prototype,yn=bn.hasOwnProperty;function vn(r){var e=this.__data__;return pn?e[r]!==void 0:yn.call(e,r)}var mn=vn,_n=ue,Sn="__lodash_hash_undefined__";function Cn(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=_n&&e===void 0?Sn:e,this}var An=Cn,xn=an,En=un,$n=fn,Tn=mn,Fn=An;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=En;j.prototype.get=$n;j.prototype.has=Tn;j.prototype.set=Fn;var Nn=j,et=Nn,wn=ae,On=Me;function Dn(){this.size=0,this.__data__={hash:new et,map:new(On||wn),string:new et}}var Ln=Dn;function In(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var Pn=In,Mn=Pn;function Rn(r,e){var t=r.__data__;return Mn(e)?t[typeof e=="string"?"string":"hash"]:t.map}var le=Rn,Bn=le;function zn(r){var e=Bn(this,r).delete(r);return this.size-=e?1:0,e}var Gn=zn,Un=le;function jn(r){return Un(this,r).get(r)}var kn=jn,Hn=le;function Vn(r){return Hn(this,r).has(r)}var Kn=Vn,qn=le;function Wn(r,e){var t=qn(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}var Yn=Wn,Jn=Ln,Zn=Gn,Xn=kn,Qn=Kn,es=Yn;function k(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])}}k.prototype.clear=Jn;k.prototype.delete=Zn;k.prototype.get=Xn;k.prototype.has=Qn;k.prototype.set=es;var Re=k,ts=ae,rs=Me,is=Re,ns=200;function ss(r,e){var t=this.__data__;if(t instanceof ts){var i=t.__data__;if(!rs||i.length<ns-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new is(i)}return t.set(r,e),this.size=t.size,this}var as=ss,os=ae,us=qr,ls=Yr,cs=Zr,ds=Qr,gs=as;function H(r){var e=this.__data__=new os(r);this.size=e.size}H.prototype.clear=us;H.prototype.delete=ls;H.prototype.get=cs;H.prototype.has=ds;H.prototype.set=gs;var kt=H,hs="__lodash_hash_undefined__";function fs(r){return this.__data__.set(r,hs),this}var ps=fs;function bs(r){return this.__data__.has(r)}var ys=bs,vs=Re,ms=ps,_s=ys;function te(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new vs;++e<t;)this.add(r[e])}te.prototype.add=te.prototype.push=ms;te.prototype.has=_s;var Ss=te;function Cs(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 As=Cs;function xs(r,e){return r.has(e)}var Es=xs,$s=Ss,Ts=As,Fs=Es,Ns=1,ws=2;function Os(r,e,t,i,n,s){var a=t&Ns,o=r.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(r),d=s.get(e);if(c&&d)return c==e&&d==r;var g=-1,h=!0,v=t&ws?new $s:void 0;for(s.set(r,e),s.set(e,r);++g<o;){var S=r[g],b=e[g];if(i)var A=a?i(b,S,g,e,r,s):i(S,b,g,r,e,s);if(A!==void 0){if(A)continue;h=!1;break}if(v){if(!Ts(e,function(x,E){if(!Fs(v,E)&&(S===x||n(S,x,t,i,s)))return v.push(E)})){h=!1;break}}else if(!(S===b||n(S,b,t,i,s))){h=!1;break}}return s.delete(r),s.delete(e),h}var Ht=Os,Ds=O,Ls=Ds.Uint8Array,Is=Ls;function Ps(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}var Ms=Ps;function Rs(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var Bs=Rs,tt=W,rt=Is,zs=Pe,Gs=Ht,Us=Ms,js=Bs,ks=1,Hs=2,Vs="[object Boolean]",Ks="[object Date]",qs="[object Error]",Ws="[object Map]",Ys="[object Number]",Js="[object RegExp]",Zs="[object Set]",Xs="[object String]",Qs="[object Symbol]",ea="[object ArrayBuffer]",ta="[object DataView]",it=tt?tt.prototype:void 0,be=it?it.valueOf:void 0;function ra(r,e,t,i,n,s,a){switch(t){case ta:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case ea:return!(r.byteLength!=e.byteLength||!s(new rt(r),new rt(e)));case Vs:case Ks:case Ys:return zs(+r,+e);case qs:return r.name==e.name&&r.message==e.message;case Js:case Xs:return r==e+"";case Ws:var o=Us;case Zs:var l=i&ks;if(o||(o=js),r.size!=e.size&&!l)return!1;var c=a.get(r);if(c)return c==e;i|=Hs,a.set(r,e);var d=Gs(o(r),o(e),i,n,s,a);return a.delete(r),d;case Qs:if(be)return be.call(r)==be.call(e)}return!1}var ia=ra;function na(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}var Vt=na,sa=Array.isArray,N=sa,aa=Vt,oa=N;function ua(r,e,t){var i=e(r);return oa(r)?i:aa(i,t(r))}var la=ua;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 da=ca;function ga(){return[]}var ha=ga,fa=da,pa=ha,ba=Object.prototype,ya=ba.propertyIsEnumerable,nt=Object.getOwnPropertySymbols,va=nt?function(r){return r==null?[]:(r=Object(r),fa(nt(r),function(e){return ya.call(r,e)}))}:pa,ma=va;function _a(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}var Sa=_a;function Ca(r){return r!=null&&typeof r=="object"}var J=Ca,Aa=Y,xa=J,Ea="[object Arguments]";function $a(r){return xa(r)&&Aa(r)==Ea}var Ta=$a,st=Ta,Fa=J,Kt=Object.prototype,Na=Kt.hasOwnProperty,wa=Kt.propertyIsEnumerable,Oa=st(function(){return arguments}())?st:function(r){return Fa(r)&&Na.call(r,"callee")&&!wa.call(r,"callee")},Be=Oa,re={exports:{}};function Da(){return!1}var La=Da;re.exports;(function(r,e){var t=O,i=La,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,c=l||i;r.exports=c})(re,re.exports);var qt=re.exports,Ia=9007199254740991,Pa=/^(?:0|[1-9]\d*)$/;function Ma(r,e){var t=typeof r;return e=e??Ia,!!e&&(t=="number"||t!="symbol"&&Pa.test(r))&&r>-1&&r%1==0&&r<e}var ze=Ma,Ra=9007199254740991;function Ba(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ra}var Ge=Ba,za=Y,Ga=Ge,Ua=J,ja="[object Arguments]",ka="[object Array]",Ha="[object Boolean]",Va="[object Date]",Ka="[object Error]",qa="[object Function]",Wa="[object Map]",Ya="[object Number]",Ja="[object Object]",Za="[object RegExp]",Xa="[object Set]",Qa="[object String]",eo="[object WeakMap]",to="[object ArrayBuffer]",ro="[object DataView]",io="[object Float32Array]",no="[object Float64Array]",so="[object Int8Array]",ao="[object Int16Array]",oo="[object Int32Array]",uo="[object Uint8Array]",lo="[object Uint8ClampedArray]",co="[object Uint16Array]",go="[object Uint32Array]",y={};y[io]=y[no]=y[so]=y[ao]=y[oo]=y[uo]=y[lo]=y[co]=y[go]=!0;y[ja]=y[ka]=y[to]=y[Ha]=y[ro]=y[Va]=y[Ka]=y[qa]=y[Wa]=y[Ya]=y[Ja]=y[Za]=y[Xa]=y[Qa]=y[eo]=!1;function ho(r){return Ua(r)&&Ga(r.length)&&!!y[za(r)]}var fo=ho;function po(r){return function(e){return r(e)}}var Wt=po,ie={exports:{}};ie.exports;(function(r,e){var t=zt,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})(ie,ie.exports);var bo=ie.exports,yo=fo,vo=Wt,at=bo,ot=at&&at.isTypedArray,mo=ot?vo(ot):yo,Yt=mo,_o=Sa,So=Be,Co=N,Ao=qt,xo=ze,Eo=Yt,$o=Object.prototype,To=$o.hasOwnProperty;function Fo(r,e){var t=Co(r),i=!t&&So(r),n=!t&&!i&&Ao(r),s=!t&&!i&&!n&&Eo(r),a=t||i||n||s,o=a?_o(r.length,String):[],l=o.length;for(var c in r)(e||To.call(r,c))&&!(a&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||xo(c,l)))&&o.push(c);return o}var No=Fo,wo=Object.prototype;function Oo(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||wo;return r===t}var Do=Oo;function Lo(r,e){return function(t){return r(e(t))}}var Io=Lo,Po=Io,Mo=Po(Object.keys,Object),Ro=Mo,Bo=Do,zo=Ro,Go=Object.prototype,Uo=Go.hasOwnProperty;function jo(r){if(!Bo(r))return zo(r);var e=[];for(var t in Object(r))Uo.call(r,t)&&t!="constructor"&&e.push(t);return e}var ko=jo,Ho=Ut,Vo=Ge;function Ko(r){return r!=null&&Vo(r.length)&&!Ho(r)}var ce=Ko,qo=No,Wo=ko,Yo=ce;function Jo(r){return Yo(r)?qo(r):Wo(r)}var Ue=Jo,Zo=la,Xo=ma,Qo=Ue;function eu(r){return Zo(r,Qo,Xo)}var tu=eu,ut=tu,ru=1,iu=Object.prototype,nu=iu.hasOwnProperty;function su(r,e,t,i,n,s){var a=t&ru,o=ut(r),l=o.length,c=ut(e),d=c.length;if(l!=d&&!a)return!1;for(var g=l;g--;){var h=o[g];if(!(a?h in e:nu.call(e,h)))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 A=a;++g<l;){h=o[g];var x=r[h],E=e[h];if(i)var R=a?i(E,x,h,e,r,s):i(x,E,h,r,e,s);if(!(R===void 0?x===E||n(x,E,t,i,s):R)){b=!1;break}A||(A=h=="constructor")}if(b&&!A){var m=r.constructor,D=e.constructor;m!=D&&"constructor"in r&&"constructor"in e&&!(typeof m=="function"&&m instanceof m&&typeof D=="function"&&D instanceof D)&&(b=!1)}return s.delete(r),s.delete(e),b}var au=su,ou=M,uu=O,lu=ou(uu,"DataView"),cu=lu,du=M,gu=O,hu=du(gu,"Promise"),fu=hu,pu=M,bu=O,yu=pu(bu,"Set"),vu=yu,mu=M,_u=O,Su=mu(_u,"WeakMap"),Cu=Su,Ce=cu,Ae=Me,xe=fu,Ee=vu,$e=Cu,Jt=Y,V=jt,lt="[object Map]",Au="[object Object]",ct="[object Promise]",dt="[object Set]",gt="[object WeakMap]",ht="[object DataView]",xu=V(Ce),Eu=V(Ae),$u=V(xe),Tu=V(Ee),Fu=V($e),L=Jt;(Ce&&L(new Ce(new ArrayBuffer(1)))!=ht||Ae&&L(new Ae)!=lt||xe&&L(xe.resolve())!=ct||Ee&&L(new Ee)!=dt||$e&&L(new $e)!=gt)&&(L=function(r){var e=Jt(r),t=e==Au?r.constructor:void 0,i=t?V(t):"";if(i)switch(i){case xu:return ht;case Eu:return lt;case $u:return ct;case Tu:return dt;case Fu:return gt}return e});var Nu=L,ye=kt,wu=Ht,Ou=ia,Du=au,ft=Nu,pt=N,bt=qt,Lu=Yt,Iu=1,yt="[object Arguments]",vt="[object Array]",X="[object Object]",Pu=Object.prototype,mt=Pu.hasOwnProperty;function Mu(r,e,t,i,n,s){var a=pt(r),o=pt(e),l=a?vt:ft(r),c=o?vt:ft(e);l=l==yt?X:l,c=c==yt?X:c;var d=l==X,g=c==X,h=l==c;if(h&&bt(r)){if(!bt(e))return!1;a=!0,d=!1}if(h&&!d)return s||(s=new ye),a||Lu(r)?wu(r,e,t,i,n,s):Ou(r,e,l,t,i,n,s);if(!(t&Iu)){var v=d&&mt.call(r,"__wrapped__"),S=g&&mt.call(e,"__wrapped__");if(v||S){var b=v?r.value():r,A=S?e.value():e;return s||(s=new ye),n(b,A,t,i,s)}}return h?(s||(s=new ye),Du(r,e,t,i,n,s)):!1}var Ru=Mu,Bu=Ru,_t=J;function Zt(r,e,t,i,n){return r===e?!0:r==null||e==null||!_t(r)&&!_t(e)?r!==r&&e!==e:Bu(r,e,t,i,Zt,n)}var je=Zt,zu=je;function Gu(r,e){return zu(r,e)}var Uu=Gu;const ju=Ie(Uu);var St=W,ku=Be,Hu=N,Ct=St?St.isConcatSpreadable:void 0;function Vu(r){return Hu(r)||ku(r)||!!(Ct&&r&&r[Ct])}var Ku=Vu,qu=Vt,Wu=Ku;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):qu(n,o):i||(n[n.length]=o)}return n}var Yu=Xt;function Ju(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=Ju,Zu=Y,Xu=J,Qu="[object Symbol]";function el(r){return typeof r=="symbol"||Xu(r)&&Zu(r)==Qu}var de=el,tl=N,rl=de,il=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nl=/^\w*$/;function sl(r,e){if(tl(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||rl(r)?!0:nl.test(r)||!il.test(r)||e!=null&&r in Object(e)}var ke=sl,er=Re,al="Expected a function";function He(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(al);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(He.Cache||er),t}He.Cache=er;var ol=He,ul=ol,ll=500;function cl(r){var e=ul(r,function(i){return t.size===ll&&t.clear(),i}),t=e.cache;return e}var dl=cl,gl=dl,hl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fl=/\\(\\)?/g,pl=gl(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(hl,function(t,i,n,s){e.push(n?s.replace(fl,"$1"):i||t)}),e}),bl=pl,At=W,yl=Qt,vl=N,ml=de,_l=1/0,xt=At?At.prototype:void 0,Et=xt?xt.toString:void 0;function tr(r){if(typeof r=="string")return r;if(vl(r))return yl(r,tr)+"";if(ml(r))return Et?Et.call(r):"";var e=r+"";return e=="0"&&1/r==-_l?"-0":e}var Sl=tr,Cl=Sl;function Al(r){return r==null?"":Cl(r)}var xl=Al,El=N,$l=ke,Tl=bl,Fl=xl;function Nl(r,e){return El(r)?r:$l(r,e)?[r]:Tl(Fl(r))}var rr=Nl,wl=de,Ol=1/0;function Dl(r){if(typeof r=="string"||wl(r))return r;var e=r+"";return e=="0"&&1/r==-Ol?"-0":e}var ge=Dl,Ll=rr,Il=ge;function Pl(r,e){e=Ll(e,r);for(var t=0,i=e.length;r!=null&&t<i;)r=r[Il(e[t++])];return t&&t==i?r:void 0}var Ve=Pl,Ml=kt,Rl=je,Bl=1,zl=2;function Gl(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],c=r[l],d=o[1];if(a&&o[2]){if(c===void 0&&!(l in r))return!1}else{var g=new Ml;if(i)var h=i(c,d,l,r,e,g);if(!(h===void 0?Rl(d,c,Bl|zl,i,g):h))return!1}}return!0}var Ul=Gl,jl=oe;function kl(r){return r===r&&!jl(r)}var ir=kl,Hl=ir,Vl=Ue;function Kl(r){for(var e=Vl(r),t=e.length;t--;){var i=e[t],n=r[i];e[t]=[i,n,Hl(n)]}return e}var ql=Kl;function Wl(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var nr=Wl,Yl=Ul,Jl=ql,Zl=nr;function Xl(r){var e=Jl(r);return e.length==1&&e[0][2]?Zl(e[0][0],e[0][1]):function(t){return t===r||Yl(t,r,e)}}var Ql=Xl,ec=Ve;function tc(r,e,t){var i=r==null?void 0:ec(r,e);return i===void 0?t:i}var rc=tc;function ic(r,e){return r!=null&&e in Object(r)}var nc=ic,sc=rr,ac=Be,oc=N,uc=ze,lc=Ge,cc=ge;function dc(r,e,t){e=sc(e,r);for(var i=-1,n=e.length,s=!1;++i<n;){var a=cc(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&&lc(n)&&uc(a,n)&&(oc(r)||ac(r)))}var gc=dc,hc=nc,fc=gc;function pc(r,e){return r!=null&&fc(r,e,hc)}var bc=pc,yc=je,vc=rc,mc=bc,_c=ke,Sc=ir,Cc=nr,Ac=ge,xc=1,Ec=2;function $c(r,e){return _c(r)&&Sc(e)?Cc(Ac(r),e):function(t){var i=vc(t,r);return i===void 0&&i===e?mc(t,r):yc(e,i,xc|Ec)}}var Tc=$c;function Fc(r){return r}var he=Fc;function Nc(r){return function(e){return e==null?void 0:e[r]}}var wc=Nc,Oc=Ve;function Dc(r){return function(e){return Oc(e,r)}}var Lc=Dc,Ic=wc,Pc=Lc,Mc=ke,Rc=ge;function Bc(r){return Mc(r)?Ic(Rc(r)):Pc(r)}var zc=Bc,Gc=Ql,Uc=Tc,jc=he,kc=N,Hc=zc;function Vc(r){return typeof r=="function"?r:r==null?jc:typeof r=="object"?kc(r)?Uc(r[0],r[1]):Gc(r):Hc(r)}var Kc=Vc;function qc(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 Wc=qc,Yc=Wc,Jc=Yc(),Zc=Jc,Xc=Zc,Qc=Ue;function ed(r,e){return r&&Xc(r,e,Qc)}var td=ed,rd=ce;function id(r,e){return function(t,i){if(t==null)return t;if(!rd(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 nd=id,sd=td,ad=nd,od=ad(sd),ud=od,ld=ud,cd=ce;function dd(r,e){var t=-1,i=cd(r)?Array(r.length):[];return ld(r,function(n,s,a){i[++t]=e(n,s,a)}),i}var gd=dd;function hd(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var fd=hd,$t=de;function pd(r,e){if(r!==e){var t=r!==void 0,i=r===null,n=r===r,s=$t(r),a=e!==void 0,o=e===null,l=e===e,c=$t(e);if(!o&&!c&&!s&&r>e||s&&a&&l&&!o&&!c||i&&a&&l||!t&&l||!n)return 1;if(!i&&!s&&!c&&r<e||c&&t&&n&&!i&&!s||o&&t&&n||!a&&n||!l)return-1}return 0}var bd=pd,yd=bd;function vd(r,e,t){for(var i=-1,n=r.criteria,s=e.criteria,a=n.length,o=t.length;++i<a;){var l=yd(n[i],s[i]);if(l){if(i>=o)return l;var c=t[i];return l*(c=="desc"?-1:1)}}return r.index-e.index}var md=vd,ve=Qt,_d=Ve,Sd=Kc,Cd=gd,Ad=fd,xd=Wt,Ed=md,$d=he,Td=N;function Fd(r,e,t){e.length?e=ve(e,function(s){return Td(s)?function(a){return _d(a,s.length===1?s[0]:s)}:s}):e=[$d];var i=-1;e=ve(e,xd(Sd));var n=Cd(r,function(s,a,o){var l=ve(e,function(c){return c(s)});return{criteria:l,index:++i,value:s}});return Ad(n,function(s,a){return Ed(s,a,t)})}var Nd=Fd;function wd(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 Od=wd,Dd=Od,Tt=Math.max;function Ld(r,e,t){return e=Tt(e===void 0?r.length-1:e,0),function(){for(var i=arguments,n=-1,s=Tt(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),Dd(r,this,o)}}var Id=Ld;function Pd(r){return function(){return r}}var Md=Pd,Rd=M,Bd=function(){try{var r=Rd(Object,"defineProperty");return r({},"",{}),r}catch{}}(),zd=Bd,Gd=Md,Ft=zd,Ud=he,jd=Ft?function(r,e){return Ft(r,"toString",{configurable:!0,enumerable:!1,value:Gd(e),writable:!0})}:Ud,kd=jd,Hd=800,Vd=16,Kd=Date.now;function qd(r){var e=0,t=0;return function(){var i=Kd(),n=Vd-(i-t);if(t=i,n>0){if(++e>=Hd)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Wd=qd,Yd=kd,Jd=Wd,Zd=Jd(Yd),Xd=Zd,Qd=he,eg=Id,tg=Xd;function rg(r,e){return tg(eg(r,e,Qd),r+"")}var ig=rg,ng=Pe,sg=ce,ag=ze,og=oe;function ug(r,e,t){if(!og(t))return!1;var i=typeof e;return(i=="number"?sg(t)&&ag(e,t.length):i=="string"&&e in t)?ng(t[e],r):!1}var lg=ug,cg=Yu,dg=Nd,gg=ig,Nt=lg,hg=gg(function(r,e){if(r==null)return[];var t=e.length;return t>1&&Nt(r,e[0],e[1])?e=[]:t>2&&Nt(e[0],e[1],e[2])&&(e=[e[0]]),dg(r,cg(e,1),[])}),fg=hg;const B=Ie(fg),pg=/\S+\.(gif|jpe?g|tiff|png|bmp|svg)$/i,bg=["label","Label","name","Name","title","Title","rdfs:label"];class u{static isEqual(e,t){return ju(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 pg.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 f.CurrencyFormat.SYMBOL_COMMAS_DOT:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",",".")}`;case f.CurrencyFormat.SYMBOL_COMMAS:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",")}`;case f.CurrencyFormat.DOTS_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case f.CurrencyFormat.DOTS_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".")}${t.symbol!==void 0?" "+t.symbol:""}`;case f.CurrencyFormat.SPACES_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e," ",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case f.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=bg.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)===f.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 yg=ar.exports,Te={utf8:{stringToBytes:function(r){return Te.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(Te.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=Te;(function(){var r=yg,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=[],c=1732584193,d=-271733879,g=-1732584194,h=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=c,A=d,x=g,E=h,R=v,m=0;m<80;m++){if(m<16)l[m]=a[S+m];else{var D=l[m-3]^l[m-8]^l[m-14]^l[m-16];l[m]=D<<1|D>>>31}var vr=(c<<5|c>>>27)+v+(l[m]>>>0)+(m<20?(d&g|~d&h)+1518500249:m<40?(d^g^h)+1859775393:m<60?(d&g|d&h|g&h)-1894007588:(d^g^h)-899497514);v=h,h=g,g=d<<30|d>>>2,d=c,c=vr}c+=b,d+=A,g+=x,h+=E,v+=R}return[c,d,g,h,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 vg=sr.exports;const Ke=Ie(vg),T="#7f7f7f",Fe=["#9467bd","#e377c2","#1f77b4","#17becf","#2ca02c","#bcbd22","#d62728","#ff7f0e","#8c564b","#c5b0d5","#f7b6d2","#aec7e8","#9edae5","#98df8a","#dbdb8d","#ff9896","#ffbb78","#c49c94"];class ${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)?Fe[$.getRandomUniqueColorPaletteIndex(e,Fe.length,t)]:T}static getRandomUniqueColorPaletteIndex(e,t,i){return i&&(e=e.toLowerCase()),+("0x"+Ke(e).substr(-4))%t}static getTypeColor(e,t){return typeof e.style.color=="object"&&e.style.color.input[0]!=="properties"?$.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 G extends ${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 T;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=$.autoColor(`${s}`,n.style.color.ignoreCase)}break}}return u.isDefined(t)?t:T}shape(e){var t;if(this._rulesMap.shape!==void 0)return(t=G.matchStyle(this._rulesMap.shape,e))==null?void 0:t.style.shape}width(e){if(this._rulesMap.width!==void 0){const t=G.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===f.AutoRangeScale.LOGARITHMIC;return G.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:T,shape:f.OgmaEdgeShape.ARROW,width:"100%"}}}class I extends ${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[T];const t=Ke(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 c=this._rulesMap.color[l];if(!(c.itemType!==void 0&&c.itemType!==null&&c.itemType!==e.categories[a])&&c.canApplyTo(e)){if(typeof c.style.color=="object"){const d=u.getIn(e,c.style.color.input);Array.isArray(d)?o=$.autoColor(e.categories[a],c.style.color.ignoreCase):o=$.autoColor(`${d}`,c.style.color.ignoreCase)}else o=c.style.color;break}}n.push(o)}n=n.filter(a=>u.isDefined(a)),n.length===0&&(n=[T]);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 c=s[l].style;if("icon"in c&&typeof c.icon=="object")n={icon:{content:(a=c.icon)==null?void 0:a.content,font:(o=c.icon)==null?void 0:o.font,scale:.5,color:q.isBright(i)?"#000000":"#FFFFFF"}};else if("image"in c&&typeof c.image=="object"){const d=I.getImageUrlFromStyleRule(c.image.url,e,this._baseUrl);d!==void 0&&(n={image:{url:d,scale:c.image.scale,fit:c.image.fit,tile:c.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===f.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:T};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!==f.SelectorType.ANY}canApplyTo(e){const t="categories"in e?e.categories:[e.type];let i=!1;switch(this.type){case f.SelectorType.ANY:i=C.checkAny(e,this.style);break;case f.SelectorType.NO_VALUE:C.inputExists(this.type,this.input)&&(i=C.checkNoValue(e,this.input));break;case f.SelectorType.NAN:C.inputExists(this.type,this.input)&&(i=C.checkNan(e,this.input));break;case f.SelectorType.RANGE:C.inputExists(this.type,this.input)&&(i=C.checkRange(u.getIn(e,this.input),this.value));break;case f.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===f.SelectorType.ANY&&!u.isDefined(this.input)&&(t=$.getTypeColor(this,e)),t}}var w=(r=>(r.COLOR="color",r.ICON="icon",r.SIZE="size",r.IMAGE="image",r.SHAPE="shape",r.WIDTH="width",r))(w||{});const z=["specificity","itemType","index"];class p{constructor(e){this._rules=e}get color(){return B(p.getBy("color",this._rules),z)}get icon(){return B([...p.getBy("icon",this._rules)||[],...p.getBy("image",this._rules)||[]],z)}get image(){return B(p.getBy("image",this._rules),z)}get shape(){return B(p.getBy("shape",this._rules),z)}get size(){return B(p.getBy("size",this._rules),z)}get width(){return B(p.getBy("width",this._rules),z)}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(c=>o.canApplyTo(c)))if(e==="color"&&typeof o.style.color=="object")p.addLegendAutoColors(s,o,n);else if(e==="icon"&&"image"in o.style){const c=u.isDefined(o.input)?`${p.getTypeLabel(o.itemType)}.${o.input[1]} ${p.sanitizeValue(o.type,o.value)}`:`${p.getTypeLabel(o.itemType)}`,d=o.style.image;if(!(d.url&&typeof d.url=="object"&&d.url.type==="data")){const g=o.style.image;p.updateLegend(n,{label:c,value:g})}}else{const c=u.isDefined(o.input)?`${p.getTypeLabel(o.itemType)}.${o.input[1]} ${p.sanitizeValue(o.type,o.value)}`:`${p.getTypeLabel(o.itemType)}`,d=o.style[e];p.updateLegend(n,{label:c,value:d})}}return n}static sanitizeValue(e,t){let i="";switch(e){case f.SelectorType.NO_VALUE:return"is undefined";case f.SelectorType.NAN:return"is not an number";case f.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 c=n.input.includes("properties")?`${p.getTypeLabel(t.itemType)}.${s} = ${l}`:`${p.getTypeLabel(l)}`,d=$.autoColor(l,n.ignoreCase);p.updateLegend(i,{label:c,value:d})});else{const l=n.input.includes("properties")?`${p.getTypeLabel(t.itemType)}.${s} = ${o}`:`${p.getTypeLabel(o)}`,c=$.autoColor(o,n.ignoreCase);p.updateLegend(i,{label:l,value:c})}})}static getTypeLabel(e){return e===void 0?"All":e===null?"Others":e}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 Ot={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outerStroke:{width:2},outline:!1},Dt={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outline:!1},mg={color:"#FFF",width:7,scalingMethod:"scaled",strokeWidth:0,hideNonAdjacentEdges:!1},_g={color:"#FFF",scalingMethod:"scaled",width:4},Sg="'roboto', sans-serif",Lt="#000",me="#FFF",It="#7f7f7f",Ne=.2;class ur{constructor(e,t){this._nodeAttributes=new I({}),this._edgeAttributes=new G({}),this._ogma=e,this._defaultConfiguration=t,this._nodeAttributes.setBaseUrl(t.baseUrl)}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}})}setEdgesDefaultStyles(){var e;this._ogma.styles.setHoveredEdgeAttributes(Dt),this._ogma.styles.setSelectedEdgeAttributes(Dt),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"),nodeAttributes:{halo:e=>e!==void 0&&!e.hasClass("filtered")&&(e.isSelected()||e.getAdjacentNodes({}).isSelected().includes(!0)||e.getAdjacentEdges().isSelected().includes(!0))?{...mg,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:Ne,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:T,minVisibleSize:1},shape:"circle",image:null,icon:null,radius:"50%"},edgeAttributes:{opacity:Ne,layer:e=>{const t=e.getExtremities().getMetaNode().some(i=>i!==null);return!e.isVirtual()&&t?1:-1},detectable:!1,text:null,color:T,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}})}setBadgeRule(){this._ogma.styles.createClass({name:"degreeIndicator",nodeAttributes:{badges:{topRight:e=>{if(e!==void 0){const t=u.getHiddenNeighbors(e.toList()),i=u.formatNumber(t);if(t>0){const n=Array.isArray(e.getAttribute("color"))?e.getAttribute("color")[0]:e.getAttribute("color"),s=q.isBright(n)?Lt:me,a=e.getData(["statistics","supernode"]);let o=null;return+i!=0&&(o=a?i+"+":i),{color:"inherit",minVisibleSize:20,stroke:{width:0,color:null},text:{font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:Sg,scale:.4,color:s,content:o}}}}}}}}),this._ogma.styles.createClass({name:"pinnedIndicator",nodeAttributes:{badges:{bottomRight:e=>{if(e!==void 0&&!e.getAttribute("layoutable"))return{color:this._findPinBadgeBackgroundColor(e),minVisibleSize:20,scale:this._findPinBadgeScale(e),stroke:{width:0,color:null},text:{font:"FontAwesome",scale:.4,color:this._findPinBadgeTextColor(e),content:e.getAttribute("layoutable")?null:""}}}}},nodeDependencies:{self:{attributes:["layoutable"]}}}),this._ogma.events.on("addNodes",e=>e.nodes.addClass("degreeIndicator")),this._ogma.events.on("addNodes",e=>e.nodes.addClass("pinnedIndicator"))}deleteBadgeRule(){this._ogma.getNodes().removeClasses(["degreeIndicator","pinnedIndicator"],0)}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}}}))}getStyleRule(e,t){return new p(e)[t]}initNodeColors(e){const t=this.getStyleRule(e,w.COLOR);this.refreshNodeColors(t)}initNodesIcons(e){const t=this.getStyleRule(e,w.ICON);this.refreshNodeIcons(t)}initNodesSizes(e){const t=this.getStyleRule(e,w.SIZE);this.refreshNodeSize(t)}initNodesShapes(e){const t=this.getStyleRule(e,w.SHAPE);this.refreshNodeShape(t)}initEdgesWidth(e){const t=this.getStyleRule(e,w.WIDTH);this.refreshEdgeWidth(t)}initEdgesShape(e){const t=this.getStyleRule(e,w.SHAPE);this.refreshEdgeShape(t)}initEdgesColor(e){const t=this.getStyleRule(e,w.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}}}))}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}}}))}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}}}))}_getNodeRadius(e){var t;if(e.isVirtual()){const{width:i,height:n}=(t=e.getSubNodes())==null?void 0:t.getBoundingBox();return Math.max(i,n)}else return e.getAttribute("radius")}_findPinBadgeScale(e){return this._getNodeRadius(e)*.46>5?.17:.46}_findPinBadgeTextColor(e){if(e.isVirtual())return me;const t=Array.isArray(e.getAttribute("color"))?e.getAttribute("color")[0]:e.getAttribute("color");return q.isBright(t)?Lt:me}_findPinBadgeBackgroundColor(e){return e.isVirtual()?T:"inherit"}}class lr{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 P(r){return typeof r=="function"}function Cg(r){return P(r==null?void 0:r.lift)}function cr(r){return function(e){if(Cg(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 we=function(r,e){return we=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])},we(r,e)};function qe(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");we(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 Oe(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 De(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 Ag(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 _e=Ag(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@linkurious/rest-client"),mr=require("@linkurious/ogma"),_r=require("rxjs");var Z=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ie(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Sr(){this.__data__=[],this.size=0}var Cr=Sr;function Ar(r,e){return r===e||r!==r&&e!==e}var Pe=Ar,xr=Pe;function Er(r,e){for(var t=r.length;t--;)if(xr(r[t][0],e))return t;return-1}var se=Er,$r=se,Tr=Array.prototype,Fr=Tr.splice;function Nr(r){var e=this.__data__,t=$r(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():Fr.call(e,t,1),--this.size,!0}var wr=Nr,Or=se;function Dr(r){var e=this.__data__,t=Or(e,r);return t<0?void 0:e[t][1]}var Lr=Dr,Ir=se;function Pr(r){return Ir(this.__data__,r)>-1}var Mr=Pr,Rr=se;function Br(r,e){var t=this.__data__,i=Rr(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}var zr=Br,Gr=Cr,Ur=wr,jr=Lr,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=Gr;U.prototype.delete=Ur;U.prototype.get=jr;U.prototype.has=kr;U.prototype.set=Hr;var ae=U,Vr=ae;function Kr(){this.__data__=new Vr,this.size=0}var qr=Kr;function Wr(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var Yr=Wr;function Jr(r){return this.__data__.get(r)}var Zr=Jr;function Xr(r){return this.__data__.has(r)}var Qr=Xr,ei=typeof Z=="object"&&Z&&Z.Object===Object&&Z,zt=ei,ti=zt,ri=typeof self=="object"&&self&&self.Object===Object&&self,ii=ti||ri||Function("return this")(),O=ii,ni=O,si=ni.Symbol,W=si,Ye=W,Gt=Object.prototype,ai=Gt.hasOwnProperty,oi=Gt.toString,K=Ye?Ye.toStringTag:void 0;function ui(r){var e=ai.call(r,K),t=r[K];try{r[K]=void 0;var i=!0}catch{}var n=oi.call(r);return i&&(e?r[K]=t:delete r[K]),n}var li=ui,ci=Object.prototype,gi=ci.toString;function di(r){return gi.call(r)}var hi=di,Je=W,fi=li,pi=hi,bi="[object Null]",yi="[object Undefined]",Ze=Je?Je.toStringTag:void 0;function vi(r){return r==null?r===void 0?yi:bi:Ze&&Ze in Object(r)?fi(r):pi(r)}var Y=vi;function mi(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var oe=mi,_i=Y,Si=oe,Ci="[object AsyncFunction]",Ai="[object Function]",xi="[object GeneratorFunction]",Ei="[object Proxy]";function $i(r){if(!Si(r))return!1;var e=_i(r);return e==Ai||e==xi||e==Ci||e==Ei}var Ut=$i,Ti=O,Fi=Ti["__core-js_shared__"],Ni=Fi,pe=Ni,Xe=function(){var r=/[^.]+$/.exec(pe&&pe.keys&&pe.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function wi(r){return!!Xe&&Xe in r}var Oi=wi,Di=Function.prototype,Li=Di.toString;function Ii(r){if(r!=null){try{return Li.call(r)}catch{}try{return r+""}catch{}}return""}var jt=Ii,Pi=Ut,Mi=Oi,Ri=oe,Bi=jt,zi=/[\\^$.*+?()[\]{}|]/g,Gi=/^\[object .+?Constructor\]$/,Ui=Function.prototype,ji=Object.prototype,ki=Ui.toString,Hi=ji.hasOwnProperty,Vi=RegExp("^"+ki.call(Hi).replace(zi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function Ki(r){if(!Ri(r)||Mi(r))return!1;var e=Pi(r)?Vi:Gi;return e.test(Bi(r))}var qi=Ki;function Wi(r,e){return r==null?void 0:r[e]}var Yi=Wi,Ji=qi,Zi=Yi;function Xi(r,e){var t=Zi(r,e);return Ji(t)?t:void 0}var M=Xi,Qi=M,en=O,tn=Qi(en,"Map"),Me=tn,rn=M,nn=rn(Object,"create"),ue=nn,Qe=ue;function sn(){this.__data__=Qe?Qe(null):{},this.size=0}var an=sn;function on(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var un=on,ln=ue,cn="__lodash_hash_undefined__",gn=Object.prototype,dn=gn.hasOwnProperty;function hn(r){var e=this.__data__;if(ln){var t=e[r];return t===cn?void 0:t}return dn.call(e,r)?e[r]:void 0}var fn=hn,pn=ue,bn=Object.prototype,yn=bn.hasOwnProperty;function vn(r){var e=this.__data__;return pn?e[r]!==void 0:yn.call(e,r)}var mn=vn,_n=ue,Sn="__lodash_hash_undefined__";function Cn(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=_n&&e===void 0?Sn:e,this}var An=Cn,xn=an,En=un,$n=fn,Tn=mn,Fn=An;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=En;j.prototype.get=$n;j.prototype.has=Tn;j.prototype.set=Fn;var Nn=j,et=Nn,wn=ae,On=Me;function Dn(){this.size=0,this.__data__={hash:new et,map:new(On||wn),string:new et}}var Ln=Dn;function In(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var Pn=In,Mn=Pn;function Rn(r,e){var t=r.__data__;return Mn(e)?t[typeof e=="string"?"string":"hash"]:t.map}var le=Rn,Bn=le;function zn(r){var e=Bn(this,r).delete(r);return this.size-=e?1:0,e}var Gn=zn,Un=le;function jn(r){return Un(this,r).get(r)}var kn=jn,Hn=le;function Vn(r){return Hn(this,r).has(r)}var Kn=Vn,qn=le;function Wn(r,e){var t=qn(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}var Yn=Wn,Jn=Ln,Zn=Gn,Xn=kn,Qn=Kn,es=Yn;function k(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])}}k.prototype.clear=Jn;k.prototype.delete=Zn;k.prototype.get=Xn;k.prototype.has=Qn;k.prototype.set=es;var Re=k,ts=ae,rs=Me,is=Re,ns=200;function ss(r,e){var t=this.__data__;if(t instanceof ts){var i=t.__data__;if(!rs||i.length<ns-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new is(i)}return t.set(r,e),this.size=t.size,this}var as=ss,os=ae,us=qr,ls=Yr,cs=Zr,gs=Qr,ds=as;function H(r){var e=this.__data__=new os(r);this.size=e.size}H.prototype.clear=us;H.prototype.delete=ls;H.prototype.get=cs;H.prototype.has=gs;H.prototype.set=ds;var kt=H,hs="__lodash_hash_undefined__";function fs(r){return this.__data__.set(r,hs),this}var ps=fs;function bs(r){return this.__data__.has(r)}var ys=bs,vs=Re,ms=ps,_s=ys;function te(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new vs;++e<t;)this.add(r[e])}te.prototype.add=te.prototype.push=ms;te.prototype.has=_s;var Ss=te;function Cs(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 As=Cs;function xs(r,e){return r.has(e)}var Es=xs,$s=Ss,Ts=As,Fs=Es,Ns=1,ws=2;function Os(r,e,t,i,n,s){var a=t&Ns,o=r.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(r),g=s.get(e);if(c&&g)return c==e&&g==r;var d=-1,h=!0,v=t&ws?new $s:void 0;for(s.set(r,e),s.set(e,r);++d<o;){var S=r[d],b=e[d];if(i)var A=a?i(b,S,d,e,r,s):i(S,b,d,r,e,s);if(A!==void 0){if(A)continue;h=!1;break}if(v){if(!Ts(e,function(x,E){if(!Fs(v,E)&&(S===x||n(S,x,t,i,s)))return v.push(E)})){h=!1;break}}else if(!(S===b||n(S,b,t,i,s))){h=!1;break}}return s.delete(r),s.delete(e),h}var Ht=Os,Ds=O,Ls=Ds.Uint8Array,Is=Ls;function Ps(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}var Ms=Ps;function Rs(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var Bs=Rs,tt=W,rt=Is,zs=Pe,Gs=Ht,Us=Ms,js=Bs,ks=1,Hs=2,Vs="[object Boolean]",Ks="[object Date]",qs="[object Error]",Ws="[object Map]",Ys="[object Number]",Js="[object RegExp]",Zs="[object Set]",Xs="[object String]",Qs="[object Symbol]",ea="[object ArrayBuffer]",ta="[object DataView]",it=tt?tt.prototype:void 0,be=it?it.valueOf:void 0;function ra(r,e,t,i,n,s,a){switch(t){case ta:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case ea:return!(r.byteLength!=e.byteLength||!s(new rt(r),new rt(e)));case Vs:case Ks:case Ys:return zs(+r,+e);case qs:return r.name==e.name&&r.message==e.message;case Js:case Xs:return r==e+"";case Ws:var o=Us;case Zs:var l=i&ks;if(o||(o=js),r.size!=e.size&&!l)return!1;var c=a.get(r);if(c)return c==e;i|=Hs,a.set(r,e);var g=Gs(o(r),o(e),i,n,s,a);return a.delete(r),g;case Qs:if(be)return be.call(r)==be.call(e)}return!1}var ia=ra;function na(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}var Vt=na,sa=Array.isArray,N=sa,aa=Vt,oa=N;function ua(r,e,t){var i=e(r);return oa(r)?i:aa(i,t(r))}var la=ua;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 da(){return[]}var ha=da,fa=ga,pa=ha,ba=Object.prototype,ya=ba.propertyIsEnumerable,nt=Object.getOwnPropertySymbols,va=nt?function(r){return r==null?[]:(r=Object(r),fa(nt(r),function(e){return ya.call(r,e)}))}:pa,ma=va;function _a(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}var Sa=_a;function Ca(r){return r!=null&&typeof r=="object"}var J=Ca,Aa=Y,xa=J,Ea="[object Arguments]";function $a(r){return xa(r)&&Aa(r)==Ea}var Ta=$a,st=Ta,Fa=J,Kt=Object.prototype,Na=Kt.hasOwnProperty,wa=Kt.propertyIsEnumerable,Oa=st(function(){return arguments}())?st:function(r){return Fa(r)&&Na.call(r,"callee")&&!wa.call(r,"callee")},Be=Oa,re={exports:{}};function Da(){return!1}var La=Da;re.exports;(function(r,e){var t=O,i=La,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,c=l||i;r.exports=c})(re,re.exports);var qt=re.exports,Ia=9007199254740991,Pa=/^(?:0|[1-9]\d*)$/;function Ma(r,e){var t=typeof r;return e=e??Ia,!!e&&(t=="number"||t!="symbol"&&Pa.test(r))&&r>-1&&r%1==0&&r<e}var ze=Ma,Ra=9007199254740991;function Ba(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ra}var Ge=Ba,za=Y,Ga=Ge,Ua=J,ja="[object Arguments]",ka="[object Array]",Ha="[object Boolean]",Va="[object Date]",Ka="[object Error]",qa="[object Function]",Wa="[object Map]",Ya="[object Number]",Ja="[object Object]",Za="[object RegExp]",Xa="[object Set]",Qa="[object String]",eo="[object WeakMap]",to="[object ArrayBuffer]",ro="[object DataView]",io="[object Float32Array]",no="[object Float64Array]",so="[object Int8Array]",ao="[object Int16Array]",oo="[object Int32Array]",uo="[object Uint8Array]",lo="[object Uint8ClampedArray]",co="[object Uint16Array]",go="[object Uint32Array]",y={};y[io]=y[no]=y[so]=y[ao]=y[oo]=y[uo]=y[lo]=y[co]=y[go]=!0;y[ja]=y[ka]=y[to]=y[Ha]=y[ro]=y[Va]=y[Ka]=y[qa]=y[Wa]=y[Ya]=y[Ja]=y[Za]=y[Xa]=y[Qa]=y[eo]=!1;function ho(r){return Ua(r)&&Ga(r.length)&&!!y[za(r)]}var fo=ho;function po(r){return function(e){return r(e)}}var Wt=po,ie={exports:{}};ie.exports;(function(r,e){var t=zt,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})(ie,ie.exports);var bo=ie.exports,yo=fo,vo=Wt,at=bo,ot=at&&at.isTypedArray,mo=ot?vo(ot):yo,Yt=mo,_o=Sa,So=Be,Co=N,Ao=qt,xo=ze,Eo=Yt,$o=Object.prototype,To=$o.hasOwnProperty;function Fo(r,e){var t=Co(r),i=!t&&So(r),n=!t&&!i&&Ao(r),s=!t&&!i&&!n&&Eo(r),a=t||i||n||s,o=a?_o(r.length,String):[],l=o.length;for(var c in r)(e||To.call(r,c))&&!(a&&(c=="length"||n&&(c=="offset"||c=="parent")||s&&(c=="buffer"||c=="byteLength"||c=="byteOffset")||xo(c,l)))&&o.push(c);return o}var No=Fo,wo=Object.prototype;function Oo(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||wo;return r===t}var Do=Oo;function Lo(r,e){return function(t){return r(e(t))}}var Io=Lo,Po=Io,Mo=Po(Object.keys,Object),Ro=Mo,Bo=Do,zo=Ro,Go=Object.prototype,Uo=Go.hasOwnProperty;function jo(r){if(!Bo(r))return zo(r);var e=[];for(var t in Object(r))Uo.call(r,t)&&t!="constructor"&&e.push(t);return e}var ko=jo,Ho=Ut,Vo=Ge;function Ko(r){return r!=null&&Vo(r.length)&&!Ho(r)}var ce=Ko,qo=No,Wo=ko,Yo=ce;function Jo(r){return Yo(r)?qo(r):Wo(r)}var Ue=Jo,Zo=la,Xo=ma,Qo=Ue;function eu(r){return Zo(r,Qo,Xo)}var tu=eu,ut=tu,ru=1,iu=Object.prototype,nu=iu.hasOwnProperty;function su(r,e,t,i,n,s){var a=t&ru,o=ut(r),l=o.length,c=ut(e),g=c.length;if(l!=g&&!a)return!1;for(var d=l;d--;){var h=o[d];if(!(a?h in e:nu.call(e,h)))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 A=a;++d<l;){h=o[d];var x=r[h],E=e[h];if(i)var R=a?i(E,x,h,e,r,s):i(x,E,h,r,e,s);if(!(R===void 0?x===E||n(x,E,t,i,s):R)){b=!1;break}A||(A=h=="constructor")}if(b&&!A){var m=r.constructor,D=e.constructor;m!=D&&"constructor"in r&&"constructor"in e&&!(typeof m=="function"&&m instanceof m&&typeof D=="function"&&D instanceof D)&&(b=!1)}return s.delete(r),s.delete(e),b}var au=su,ou=M,uu=O,lu=ou(uu,"DataView"),cu=lu,gu=M,du=O,hu=gu(du,"Promise"),fu=hu,pu=M,bu=O,yu=pu(bu,"Set"),vu=yu,mu=M,_u=O,Su=mu(_u,"WeakMap"),Cu=Su,Ce=cu,Ae=Me,xe=fu,Ee=vu,$e=Cu,Jt=Y,V=jt,lt="[object Map]",Au="[object Object]",ct="[object Promise]",gt="[object Set]",dt="[object WeakMap]",ht="[object DataView]",xu=V(Ce),Eu=V(Ae),$u=V(xe),Tu=V(Ee),Fu=V($e),L=Jt;(Ce&&L(new Ce(new ArrayBuffer(1)))!=ht||Ae&&L(new Ae)!=lt||xe&&L(xe.resolve())!=ct||Ee&&L(new Ee)!=gt||$e&&L(new $e)!=dt)&&(L=function(r){var e=Jt(r),t=e==Au?r.constructor:void 0,i=t?V(t):"";if(i)switch(i){case xu:return ht;case Eu:return lt;case $u:return ct;case Tu:return gt;case Fu:return dt}return e});var Nu=L,ye=kt,wu=Ht,Ou=ia,Du=au,ft=Nu,pt=N,bt=qt,Lu=Yt,Iu=1,yt="[object Arguments]",vt="[object Array]",X="[object Object]",Pu=Object.prototype,mt=Pu.hasOwnProperty;function Mu(r,e,t,i,n,s){var a=pt(r),o=pt(e),l=a?vt:ft(r),c=o?vt:ft(e);l=l==yt?X:l,c=c==yt?X:c;var g=l==X,d=c==X,h=l==c;if(h&&bt(r)){if(!bt(e))return!1;a=!0,g=!1}if(h&&!g)return s||(s=new ye),a||Lu(r)?wu(r,e,t,i,n,s):Ou(r,e,l,t,i,n,s);if(!(t&Iu)){var v=g&&mt.call(r,"__wrapped__"),S=d&&mt.call(e,"__wrapped__");if(v||S){var b=v?r.value():r,A=S?e.value():e;return s||(s=new ye),n(b,A,t,i,s)}}return h?(s||(s=new ye),Du(r,e,t,i,n,s)):!1}var Ru=Mu,Bu=Ru,_t=J;function Zt(r,e,t,i,n){return r===e?!0:r==null||e==null||!_t(r)&&!_t(e)?r!==r&&e!==e:Bu(r,e,t,i,Zt,n)}var je=Zt,zu=je;function Gu(r,e){return zu(r,e)}var Uu=Gu;const ju=Ie(Uu);var St=W,ku=Be,Hu=N,Ct=St?St.isConcatSpreadable:void 0;function Vu(r){return Hu(r)||ku(r)||!!(Ct&&r&&r[Ct])}var Ku=Vu,qu=Vt,Wu=Ku;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):qu(n,o):i||(n[n.length]=o)}return n}var Yu=Xt;function Ju(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=Ju,Zu=Y,Xu=J,Qu="[object Symbol]";function el(r){return typeof r=="symbol"||Xu(r)&&Zu(r)==Qu}var ge=el,tl=N,rl=ge,il=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nl=/^\w*$/;function sl(r,e){if(tl(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||rl(r)?!0:nl.test(r)||!il.test(r)||e!=null&&r in Object(e)}var ke=sl,er=Re,al="Expected a function";function He(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(al);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(He.Cache||er),t}He.Cache=er;var ol=He,ul=ol,ll=500;function cl(r){var e=ul(r,function(i){return t.size===ll&&t.clear(),i}),t=e.cache;return e}var gl=cl,dl=gl,hl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,fl=/\\(\\)?/g,pl=dl(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(hl,function(t,i,n,s){e.push(n?s.replace(fl,"$1"):i||t)}),e}),bl=pl,At=W,yl=Qt,vl=N,ml=ge,_l=1/0,xt=At?At.prototype:void 0,Et=xt?xt.toString:void 0;function tr(r){if(typeof r=="string")return r;if(vl(r))return yl(r,tr)+"";if(ml(r))return Et?Et.call(r):"";var e=r+"";return e=="0"&&1/r==-_l?"-0":e}var Sl=tr,Cl=Sl;function Al(r){return r==null?"":Cl(r)}var xl=Al,El=N,$l=ke,Tl=bl,Fl=xl;function Nl(r,e){return El(r)?r:$l(r,e)?[r]:Tl(Fl(r))}var rr=Nl,wl=ge,Ol=1/0;function Dl(r){if(typeof r=="string"||wl(r))return r;var e=r+"";return e=="0"&&1/r==-Ol?"-0":e}var de=Dl,Ll=rr,Il=de;function Pl(r,e){e=Ll(e,r);for(var t=0,i=e.length;r!=null&&t<i;)r=r[Il(e[t++])];return t&&t==i?r:void 0}var Ve=Pl,Ml=kt,Rl=je,Bl=1,zl=2;function Gl(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],c=r[l],g=o[1];if(a&&o[2]){if(c===void 0&&!(l in r))return!1}else{var d=new Ml;if(i)var h=i(c,g,l,r,e,d);if(!(h===void 0?Rl(g,c,Bl|zl,i,d):h))return!1}}return!0}var Ul=Gl,jl=oe;function kl(r){return r===r&&!jl(r)}var ir=kl,Hl=ir,Vl=Ue;function Kl(r){for(var e=Vl(r),t=e.length;t--;){var i=e[t],n=r[i];e[t]=[i,n,Hl(n)]}return e}var ql=Kl;function Wl(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var nr=Wl,Yl=Ul,Jl=ql,Zl=nr;function Xl(r){var e=Jl(r);return e.length==1&&e[0][2]?Zl(e[0][0],e[0][1]):function(t){return t===r||Yl(t,r,e)}}var Ql=Xl,ec=Ve;function tc(r,e,t){var i=r==null?void 0:ec(r,e);return i===void 0?t:i}var rc=tc;function ic(r,e){return r!=null&&e in Object(r)}var nc=ic,sc=rr,ac=Be,oc=N,uc=ze,lc=Ge,cc=de;function gc(r,e,t){e=sc(e,r);for(var i=-1,n=e.length,s=!1;++i<n;){var a=cc(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&&lc(n)&&uc(a,n)&&(oc(r)||ac(r)))}var dc=gc,hc=nc,fc=dc;function pc(r,e){return r!=null&&fc(r,e,hc)}var bc=pc,yc=je,vc=rc,mc=bc,_c=ke,Sc=ir,Cc=nr,Ac=de,xc=1,Ec=2;function $c(r,e){return _c(r)&&Sc(e)?Cc(Ac(r),e):function(t){var i=vc(t,r);return i===void 0&&i===e?mc(t,r):yc(e,i,xc|Ec)}}var Tc=$c;function Fc(r){return r}var he=Fc;function Nc(r){return function(e){return e==null?void 0:e[r]}}var wc=Nc,Oc=Ve;function Dc(r){return function(e){return Oc(e,r)}}var Lc=Dc,Ic=wc,Pc=Lc,Mc=ke,Rc=de;function Bc(r){return Mc(r)?Ic(Rc(r)):Pc(r)}var zc=Bc,Gc=Ql,Uc=Tc,jc=he,kc=N,Hc=zc;function Vc(r){return typeof r=="function"?r:r==null?jc:typeof r=="object"?kc(r)?Uc(r[0],r[1]):Gc(r):Hc(r)}var Kc=Vc;function qc(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 Wc=qc,Yc=Wc,Jc=Yc(),Zc=Jc,Xc=Zc,Qc=Ue;function eg(r,e){return r&&Xc(r,e,Qc)}var tg=eg,rg=ce;function ig(r,e){return function(t,i){if(t==null)return t;if(!rg(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 ng=ig,sg=tg,ag=ng,og=ag(sg),ug=og,lg=ug,cg=ce;function gg(r,e){var t=-1,i=cg(r)?Array(r.length):[];return lg(r,function(n,s,a){i[++t]=e(n,s,a)}),i}var dg=gg;function hg(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var fg=hg,$t=ge;function pg(r,e){if(r!==e){var t=r!==void 0,i=r===null,n=r===r,s=$t(r),a=e!==void 0,o=e===null,l=e===e,c=$t(e);if(!o&&!c&&!s&&r>e||s&&a&&l&&!o&&!c||i&&a&&l||!t&&l||!n)return 1;if(!i&&!s&&!c&&r<e||c&&t&&n&&!i&&!s||o&&t&&n||!a&&n||!l)return-1}return 0}var bg=pg,yg=bg;function vg(r,e,t){for(var i=-1,n=r.criteria,s=e.criteria,a=n.length,o=t.length;++i<a;){var l=yg(n[i],s[i]);if(l){if(i>=o)return l;var c=t[i];return l*(c=="desc"?-1:1)}}return r.index-e.index}var mg=vg,ve=Qt,_g=Ve,Sg=Kc,Cg=dg,Ag=fg,xg=Wt,Eg=mg,$g=he,Tg=N;function Fg(r,e,t){e.length?e=ve(e,function(s){return Tg(s)?function(a){return _g(a,s.length===1?s[0]:s)}:s}):e=[$g];var i=-1;e=ve(e,xg(Sg));var n=Cg(r,function(s,a,o){var l=ve(e,function(c){return c(s)});return{criteria:l,index:++i,value:s}});return Ag(n,function(s,a){return Eg(s,a,t)})}var Ng=Fg;function wg(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 Og=wg,Dg=Og,Tt=Math.max;function Lg(r,e,t){return e=Tt(e===void 0?r.length-1:e,0),function(){for(var i=arguments,n=-1,s=Tt(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),Dg(r,this,o)}}var Ig=Lg;function Pg(r){return function(){return r}}var Mg=Pg,Rg=M,Bg=function(){try{var r=Rg(Object,"defineProperty");return r({},"",{}),r}catch{}}(),zg=Bg,Gg=Mg,Ft=zg,Ug=he,jg=Ft?function(r,e){return Ft(r,"toString",{configurable:!0,enumerable:!1,value:Gg(e),writable:!0})}:Ug,kg=jg,Hg=800,Vg=16,Kg=Date.now;function qg(r){var e=0,t=0;return function(){var i=Kg(),n=Vg-(i-t);if(t=i,n>0){if(++e>=Hg)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var Wg=qg,Yg=kg,Jg=Wg,Zg=Jg(Yg),Xg=Zg,Qg=he,ed=Ig,td=Xg;function rd(r,e){return td(ed(r,e,Qg),r+"")}var id=rd,nd=Pe,sd=ce,ad=ze,od=oe;function ud(r,e,t){if(!od(t))return!1;var i=typeof e;return(i=="number"?sd(t)&&ad(e,t.length):i=="string"&&e in t)?nd(t[e],r):!1}var ld=ud,cd=Yu,gd=Ng,dd=id,Nt=ld,hd=dd(function(r,e){if(r==null)return[];var t=e.length;return t>1&&Nt(r,e[0],e[1])?e=[]:t>2&&Nt(e[0],e[1],e[2])&&(e=[e[0]]),gd(r,cd(e,1),[])}),fd=hd;const B=Ie(fd),pd=/\S+\.(gif|jpe?g|tiff|png|bmp|svg)$/i,bd=["label","Label","name","Name","title","Title","rdfs:label"];class u{static isEqual(e,t){return ju(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 pd.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 f.CurrencyFormat.SYMBOL_COMMAS_DOT:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",",".")}`;case f.CurrencyFormat.SYMBOL_COMMAS:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",")}`;case f.CurrencyFormat.DOTS_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case f.CurrencyFormat.DOTS_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".")}${t.symbol!==void 0?" "+t.symbol:""}`;case f.CurrencyFormat.SPACES_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e," ",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case f.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=bd.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)===f.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 yd=ar.exports,Te={utf8:{stringToBytes:function(r){return Te.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(Te.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=Te;(function(){var r=yd,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=[],c=1732584193,g=-271733879,d=-1732584194,h=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=c,A=g,x=d,E=h,R=v,m=0;m<80;m++){if(m<16)l[m]=a[S+m];else{var D=l[m-3]^l[m-8]^l[m-14]^l[m-16];l[m]=D<<1|D>>>31}var vr=(c<<5|c>>>27)+v+(l[m]>>>0)+(m<20?(g&d|~g&h)+1518500249:m<40?(g^d^h)+1859775393:m<60?(g&d|g&h|d&h)-1894007588:(g^d^h)-899497514);v=h,h=d,d=g<<30|g>>>2,g=c,c=vr}c+=b,g+=A,d+=x,h+=E,v+=R}return[c,g,d,h,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 vd=sr.exports;const Ke=Ie(vd),$="#7f7f7f",Fe=["#9467bd","#e377c2","#1f77b4","#17becf","#2ca02c","#bcbd22","#d62728","#ff7f0e","#8c564b","#c5b0d5","#f7b6d2","#aec7e8","#9edae5","#98df8a","#dbdb8d","#ff9896","#ffbb78","#c49c94"];class T{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)?Fe[T.getRandomUniqueColorPaletteIndex(e,Fe.length,t)]:$}static getRandomUniqueColorPaletteIndex(e,t,i){return i&&(e=e.toLowerCase()),+("0x"+Ke(e).substr(-4))%t}static getTypeColor(e,t){return typeof e.style.color=="object"&&e.style.color.input[0]!=="properties"?T.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 G extends T{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 $;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=T.autoColor(`${s}`,n.style.color.ignoreCase)}break}}return u.isDefined(t)?t:$}shape(e){var t;if(this._rulesMap.shape!==void 0)return(t=G.matchStyle(this._rulesMap.shape,e))==null?void 0:t.style.shape}width(e){if(this._rulesMap.width!==void 0){const t=G.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===f.AutoRangeScale.LOGARITHMIC;return G.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:$,shape:f.OgmaEdgeShape.ARROW,width:"100%"}}}class I extends T{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[$];const t=Ke(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 c=this._rulesMap.color[l];if(!(c.itemType!==void 0&&c.itemType!==null&&c.itemType!==e.categories[a])&&c.canApplyTo(e)){if(typeof c.style.color=="object"){const g=u.getIn(e,c.style.color.input);Array.isArray(g)?o=T.autoColor(e.categories[a],c.style.color.ignoreCase):o=T.autoColor(`${g}`,c.style.color.ignoreCase)}else o=c.style.color;break}}n.push(o)}n=n.filter(a=>u.isDefined(a)),n.length===0&&(n=[$]);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 c=s[l].style;if("icon"in c&&typeof c.icon=="object")n={icon:{content:(a=c.icon)==null?void 0:a.content,font:(o=c.icon)==null?void 0:o.font,scale:.5,color:q.isBright(i)?"#000000":"#FFFFFF"}};else if("image"in c&&typeof c.image=="object"){const g=I.getImageUrlFromStyleRule(c.image.url,e,this._baseUrl);g!==void 0&&(n={image:{url:g,scale:c.image.scale,fit:c.image.fit,tile:c.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===f.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:$};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!==f.SelectorType.ANY}canApplyTo(e){const t="categories"in e?e.categories:[e.type];let i=!1;switch(this.type){case f.SelectorType.ANY:i=C.checkAny(e,this.style);break;case f.SelectorType.NO_VALUE:C.inputExists(this.type,this.input)&&(i=C.checkNoValue(e,this.input));break;case f.SelectorType.NAN:C.inputExists(this.type,this.input)&&(i=C.checkNan(e,this.input));break;case f.SelectorType.RANGE:C.inputExists(this.type,this.input)&&(i=C.checkRange(u.getIn(e,this.input),this.value));break;case f.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===f.SelectorType.ANY&&!u.isDefined(this.input)&&(t=T.getTypeColor(this,e)),t}}var w=(r=>(r.COLOR="color",r.ICON="icon",r.SIZE="size",r.IMAGE="image",r.SHAPE="shape",r.WIDTH="width",r))(w||{});const z=["specificity","itemType","index"];class p{constructor(e){this._rules=e}get color(){return B(p.getBy("color",this._rules),z)}get icon(){return B([...p.getBy("icon",this._rules)||[],...p.getBy("image",this._rules)||[]],z)}get image(){return B(p.getBy("image",this._rules),z)}get shape(){return B(p.getBy("shape",this._rules),z)}get size(){return B(p.getBy("size",this._rules),z)}get width(){return B(p.getBy("width",this._rules),z)}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(c=>o.canApplyTo(c)))if(e==="color"&&typeof o.style.color=="object")p.addLegendAutoColors(s,o,n);else if(e==="icon"&&"image"in o.style){const c=u.isDefined(o.input)?`${p.getTypeLabel(o.itemType)}.${o.input[1]} ${p.sanitizeValue(o.type,o.value)}`:`${p.getTypeLabel(o.itemType)}`,g=o.style.image;if(!(g.url&&typeof g.url=="object"&&g.url.type==="data")){const d=o.style.image;p.updateLegend(n,{label:c,value:d})}}else{const c=u.isDefined(o.input)?`${p.getTypeLabel(o.itemType)}.${o.input[1]} ${p.sanitizeValue(o.type,o.value)}`:`${p.getTypeLabel(o.itemType)}`,g=o.style[e];p.updateLegend(n,{label:c,value:g})}}return n}static sanitizeValue(e,t){let i="";switch(e){case f.SelectorType.NO_VALUE:return"is undefined";case f.SelectorType.NAN:return"is not an number";case f.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 c=n.input.includes("properties")?`${p.getTypeLabel(t.itemType)}.${s} = ${l}`:`${p.getTypeLabel(l)}`,g=T.autoColor(l,n.ignoreCase);p.updateLegend(i,{label:c,value:g})});else{const l=n.input.includes("properties")?`${p.getTypeLabel(t.itemType)}.${s} = ${o}`:`${p.getTypeLabel(o)}`,c=T.autoColor(o,n.ignoreCase);p.updateLegend(i,{label:l,value:c})}})}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]:$}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 Ot={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outerStroke:{width:2},outline:!1},Dt={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outline:!1},md={color:"#FFF",width:7,scalingMethod:"scaled",strokeWidth:0,hideNonAdjacentEdges:!1},_d={color:"#FFF",scalingMethod:"scaled",width:4},Sd="'roboto', sans-serif",Lt="#000",me="#FFF",It="#7f7f7f",Ne=.2;class ur{constructor(e,t){this._nodeAttributes=new I({}),this._edgeAttributes=new G({}),this._ogma=e,this._defaultConfiguration=t,this._nodeAttributes.setBaseUrl(t.baseUrl)}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}})}setEdgesDefaultStyles(){var e;this._ogma.styles.setHoveredEdgeAttributes(Dt),this._ogma.styles.setSelectedEdgeAttributes(Dt),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"),nodeAttributes:{halo:e=>e!==void 0&&!e.hasClass("filtered")&&(e.isSelected()||e.getAdjacentNodes({}).isSelected().includes(!0)||e.getAdjacentEdges().isSelected().includes(!0))?{...md,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())?{..._d,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:Ne,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:$,minVisibleSize:1},shape:"circle",image:null,icon:null,radius:"50%"},edgeAttributes:{opacity:Ne,layer:e=>{const t=e.getExtremities().getMetaNode().some(i=>i!==null);return!e.isVirtual()&&t?1:-1},detectable:!1,text:null,color:$,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}})}setBadgeRule(){this._ogma.styles.createClass({name:"degreeIndicator",nodeAttributes:{badges:{topRight:e=>{if(e!==void 0){const t=u.getHiddenNeighbors(e.toList()),i=u.formatNumber(t);if(t>0){const n=Array.isArray(e.getAttribute("color"))?e.getAttribute("color")[0]:e.getAttribute("color"),s=q.isBright(n)?Lt:me,a=e.getData(["statistics","supernode"]);let o=null;return+i!=0&&(o=a?i+"+":i),{color:"inherit",minVisibleSize:20,stroke:{width:0,color:null},text:{font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:Sd,scale:.4,color:s,content:o}}}}}}}}),this._ogma.styles.createClass({name:"pinnedIndicator",nodeAttributes:{badges:{bottomRight:e=>{if(e!==void 0&&!e.getAttribute("layoutable"))return{color:this._findPinBadgeBackgroundColor(e),minVisibleSize:20,scale:this._findPinBadgeScale(e),stroke:{width:0,color:null},text:{font:"FontAwesome",scale:.4,color:this._findPinBadgeTextColor(e),content:e.getAttribute("layoutable")?null:""}}}}},nodeDependencies:{self:{attributes:["layoutable"]}}}),this._ogma.events.on("addNodes",e=>e.nodes.addClass("degreeIndicator")),this._ogma.events.on("addNodes",e=>e.nodes.addClass("pinnedIndicator"))}deleteBadgeRule(){this._ogma.getNodes().removeClasses(["degreeIndicator","pinnedIndicator"],0)}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}}}))}getStyleRule(e,t){return new p(e)[t]}initNodeColors(e){const t=this.getStyleRule(e,w.COLOR);this.refreshNodeColors(t)}initNodesIcons(e){const t=this.getStyleRule(e,w.ICON);this.refreshNodeIcons(t)}initNodesSizes(e){const t=this.getStyleRule(e,w.SIZE);this.refreshNodeSize(t)}initNodesShapes(e){const t=this.getStyleRule(e,w.SHAPE);this.refreshNodeShape(t)}initEdgesWidth(e){const t=this.getStyleRule(e,w.WIDTH);this.refreshEdgeWidth(t)}initEdgesShape(e){const t=this.getStyleRule(e,w.SHAPE);this.refreshEdgeShape(t)}initEdgesColor(e){const t=this.getStyleRule(e,w.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}}}))}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}}}))}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}}}))}_getNodeRadius(e){var t;if(e.isVirtual()){const{width:i,height:n}=(t=e.getSubNodes())==null?void 0:t.getBoundingBox();return Math.max(i,n)}else return e.getAttribute("radius")}_findPinBadgeScale(e){return this._getNodeRadius(e)*.46>5?.17:.46}_findPinBadgeTextColor(e){if(e.isVirtual())return me;const t=Array.isArray(e.getAttribute("color"))?e.getAttribute("color")[0]:e.getAttribute("color");return q.isBright(t)?Lt:me}_findPinBadgeBackgroundColor(e){return e.isVirtual()?$:"inherit"}}class lr{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 P(r){return typeof r=="function"}function Cd(r){return P(r==null?void 0:r.lift)}function cr(r){return function(e){if(Cd(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 we=function(r,e){return we=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])},we(r,e)};function qe(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");we(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 Oe(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 De(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 Ad(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 _e=Ad(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
2
2
|
`+t.map(function(i,n){return n+1+") "+i.toString()}).join(`
|
|
3
|
-
`):"",this.name="UnsubscriptionError",this.errors=t}});function Mt(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 c=l.value;c.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 d=this.initialTeardown;if(P(d))try{d()}catch(b){s=b instanceof _e?b.errors:[b]}var g=this._finalizers;if(g){this._finalizers=null;try{for(var h=Pt(g),v=h.next();!v.done;v=h.next()){var S=v.value;try{Rt(S)}catch(b){s=s??[],b instanceof _e?s=De(De([],Oe(s)),Oe(b.errors)):s.push(b)}}}catch(b){i={error:b}}finally{try{v&&!v.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}}if(s)throw new _e(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Rt(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)&&Mt(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&Mt(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();We.EMPTY;function xg(r){return r instanceof We||r&&"closed"in r&&P(r.remove)&&P(r.add)&&P(r.unsubscribe)}function Rt(r){P(r)?r():r.unsubscribe()}var Eg={useDeprecatedNextContext:!1},$g={setTimeout:function(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,De([r,e],Oe(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Tg(r){$g.setTimeout(function(){throw r})}function Bt(){}var dr=function(r){qe(e,r);function e(t){var i=r.call(this)||this;return i.isStopped=!1,t?(i.destination=t,xg(t)&&t.add(i)):i.destination=Dg,i}return e.create=function(t,i,n){return new wg(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),Fg=Function.prototype.bind;function Se(r,e){return Fg.call(r,e)}var Ng=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){Q(i)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){Q(i)}else Q(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Q(t)}},r}(),wg=function(r){qe(e,r);function e(t,i,n){var s=r.call(this)||this,a;if(P(t)||!t)a={next:t??void 0,error:i??void 0,complete:n??void 0};else{var o;s&&Eg.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return s.unsubscribe()},a={next:t.next&&Se(t.next,o),error:t.error&&Se(t.error,o),complete:t.complete&&Se(t.complete,o)}):a=t}return s.destination=new Ng(a),s}return e}(dr);function Q(r){Tg(r)}function Og(r){throw r}var Dg={closed:!0,next:Bt,error:Og,complete:Bt};function Lg(r){return r}function gr(r,e,t,i,n){return new Ig(r,e,t,i,n)}var Ig=function(r){qe(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(c){try{i(c)}catch(d){t.error(d)}}:r.prototype._next,l._error=s?function(c){try{s(c)}catch(d){t.error(d)}finally{this.unsubscribe()}}:r.prototype._error,l._complete=n?function(){try{n()}catch(c){t.error(c)}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}(dr);function Pg(r,e){return cr(function(t,i){var n=0;t.subscribe(gr(i,function(s){i.next(r.call(e,s,n++))}))})}function Mg(r,e){return e===void 0&&(e=Lg),r=r??Rg,cr(function(t,i){var n,s=!0;t.subscribe(gr(i,function(a){var o=e(a);(s||!r(n,o))&&(s=!1,n=o,i.next(a))}))})}function Rg(r,e){return r===e}class hr extends _r.BehaviorSubject{constructor(e){super(e)}dispatch(e){this.next(e(this.value))}selectStore(e){return this.pipe(Pg(e),Mg((t,i)=>u.isEqual(t,i)))}clear(){this.next({selection:new fr,items:{node:[],edge:[]},changes:void 0,animation:!1})}}class Bg{constructor(e){this._store=new hr({selection:new fr,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("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()}}}class fr{constructor(){this.size=0,this.isNode=!0}}const pr=750,zg={steps:40,alignSiblings:!0,charge:5,theta:.34,duration:pr};class Gg 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 Bg(this),this.store=this._reactive.store):this._reactive.listenToSelectionEvents(),this.initSelection(),this.setConfigOgma(this._configuration,e,t),this.LKTransformation=new br(this),this.LkNodeGroupingTransformation=new jg(this),this.LKStyles.setNodesDefaultHalo(),this.LKStyles.setEdgesDefaultHalo(),this.LKStyles.setBadgeRule(),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 ur(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,c,d,g;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=(g=(d=(c=(l=e==null?void 0:e.options)==null?void 0:l.styles)==null?void 0:c.edge)==null?void 0:d.text)==null?void 0:g.maxTextLength;this.LKCaptions=new lr(this,t,i)}getForceLayoutParams(e,t=0){let i=300-.052*this.getNodes().size;return i<40&&(i=40),{steps:e===f.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=f.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===f.EntityType.NODE)&&(t=f.EntityType.EDGE,i=[]),i.push(a.id)),delete a.attributes.selected),a));await this.addGraphAfterValidation({nodes:n,edges:s}),t===f.EntityType.NODE?this.getNodes(i).setSelected(!0):t===f.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.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)}}const ee={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)"}};class q{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 c=parseInt(e[0].toString()+e[1].toString(),16),d=parseInt(e[2].toString()+e[3].toString(),16),g=parseInt(e[4].toString()+e[5].toString(),16);s=`rgb(${c}, ${d}, ${g})`}else if(i.test(e)||n.test(e)||ee[e.toLowerCase()]!==void 0)s=u.isDefined(ee[e.toLowerCase()])?ee[e.toLowerCase()].rgb:e;else return!0;const[a,o,l]=/rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,\d{1,3})?\)/.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){let i=e.toArray().find(a=>a.getDegree()===1);const n=new Set,s=[];for(;i;){s.push(i),n.add(i);const a=i.getAdjacentNodes().filter(o=>!n.has(o)).get(0);i=a===void 0?null:a}return s.map(a=>a.getId())}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}}const ne="LKE_NODE_GROUPING_EDGE",Ug="LKE_NODE_GROUPING_NODE";class jg{constructor(e){this._ogma=e}setGroupingRule(e){this.groupRule=e}async initTransformation(){this.transformation===void 0?this.transformation=this._ogma.transformations.addNodeGrouping({groupIdFunction:e=>{var t;if(!this._isRuleNotApplicableToNode(e)){const i=this._findGroupingPropertyValue(e);return`${(t=this.groupRule)==null?void 0:t.groupingOptions.itemTypes.join("-")}-${i}`.toLowerCase().trim()}},nodeGenerator:e=>({data:{categories:[Ug],properties:{},nodeGroupId:this._findNodeGroupId(e)}}),edgeGenerator:()=>({data:{type:ne}}),showContents:!0,padding:10}):await this.refreshTransformation()}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()&&u.isDefined(e.getSubNodes()),nodeDependencies:{self:{data:!0}}})}async refreshNodeGroupingStyle(){var e;await((e=this.nodeGroupingStyleRule)==null?void 0:e.refresh())}async runLayoutOnAllSubNodes(){await this._ogma.transformations.afterNextUpdate();const e=this._getAllTransformationRawNodes(),t=[];for(let i=0;i<e.length;i++){const n=e[i];t.push(this.runSubNodesLayout(n))}await Promise.all(t)}async runSubNodesLayout(e){if(e.size===0||e.size===1)return;if(e.size===2){await this._runTwoNodesLayout(e);return}if(e.getAdjacentEdges({bothExtremities:!0}).size===0)return this._runCirclePack(e);const i=this.isStar(e);if(i){const s=e.filter(l=>l!==i),a=this._runCircularLayout({radii:s.getAttribute("radius"),cx:i.getAttribute("x"),cy:i.getAttribute("y"),clockwise:!1,distanceRatio:5});await i.toList().concat(s).setAttributes([i.getPosition(),...a]);return}if(e.getDegree().every(s=>s>0&&s<=2)){await this._runChainLayout(e);return}return await this._runForceLayout(e)}getVirtualNodesOfTransformation(){return this.transformation.getContext().metaNodes}async setNodeGroupPin(e){this._ogma.getNodes().filter(t=>t.isVirtual()).forEach(t=>{const i=e.find(n=>n.id===t.getData("nodeGroupId"));i!==void 0&&t.setAttribute("layoutable",i.attributes.layoutable??!1)})}_getNodeGroupingCaption(e){var t;if(e!==void 0&&e.isVirtual()&&((t=e.getSubNodes())==null?void 0:t.get(0))!==void 0){const i=e.getSubNodes().get(0).getData(["properties",this.groupRule.groupingOptions.propertyKey]),n=u.getValueFromLkProperty(i),s=e.getSubNodes().filter(a=>!a.hasClass("filtered")).size;return`${n} (${s})`}}async _runCirclePack(e){await this._ogma.algorithms.circlePack({nodes:e,margin:10,sort:"asc"})}async _runChainLayout(e){const t=this._ogma.getNodes(q.topologicalSort(e));await this._ogma.layouts.grid({nodes:t,colDistance:Math.max(...e.getAttribute("radius").map(Number))*4,rows:1})}async _runForceLayout(e){await this._ogma.layouts.force({nodes:e,...zg})}_isRuleNotApplicableToNode(e){var i;const t=e.getData(["properties",((i=this.groupRule)==null?void 0:i.groupingOptions.propertyKey)??""]);return this.groupRule===void 0||this.groupRule.groupingOptions.itemTypes.every(n=>!e.getData("categories").includes(n))||!u.isDefined(t)||typeof t=="object"&&t.status==="missing"}async _unpinNodes(e){await Promise.all(e.map(t=>{if(t!==null)return t.setAttribute("layoutable",!0)}))}_getAllTransformationRawNodes(){return this.getVirtualNodesOfTransformation().getSubNodes()}_findGroupingPropertyValue(e){var i;const t=e.getData(["properties",((i=this.groupRule)==null?void 0:i.groupingOptions.propertyKey)??""]);return`${u.getValueFromLkProperty(t)}`}_findNodeGroupId(e){var i,n;const t=this._findGroupingPropertyValue(e.get(0));return Ke(`${(i=this.groupRule)==null?void 0:i.name}-${(n=this.groupRule)==null?void 0:n.groupingOptions.itemTypes.join("-")}-${t}`)}_runCircularLayout({radii:e,clockwise:t=!0,cx:i=0,cy:n=0,startAngle:s=3/2*Math.PI,getRadius:a=l=>Number(l),distanceRatio:o=0}){const l=e.length;if(l===0)return[];if(l===1)return[{x:i,y:n}];const c=e.map(a).reduce((A,x)=>Math.max(A,x),0)*(2+o),g=(2*Math.PI-2*Math.PI/l)/Math.max(1,l-1),h=Math.cos(g)-Math.cos(0),v=Math.sin(g)-Math.sin(0),S=Math.sqrt(c*c/(h*h+v*v)),b=Math.max(S,0);return e.map((A,x)=>{const E=s+x*g*(t?1:-1),R=b*Math.cos(E),m=b*Math.sin(E);return{x:i+R,y:n+m}})}async _runTwoNodesLayout(e){const t=e.getAttribute("radius").map(Number),i=e.getPosition(),n=Math.min(...t);await e.setAttributes([i[0],{x:i[0].x+n+t[0]+t[1],y:i[0].y}])}isStar(e){for(const t of e.getId()){const i=this._ogma.getNode(t),n=i.getAdjacentNodes();if(i.getDegree()>2&&n.getDegree().every(a=>a===1)&&n.size+1===e.size)return i}return!1}}const kg={color:"#000000",shape:{style:"dashed",head:"arrow"},width:1.5};class br{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:{...kg,...this.edgeGroupStyle,text:{content:e=>{if(e!==void 0&&e.getSubEdges()!==null&&e.getData("type")!==ne){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")!==ne,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 f.SelectorType.ANY:return _.createAnyFilterFunction(e,t);case f.SelectorType.IS:return _.createIsFilterFunction(e,t);case f.SelectorType.NO_VALUE:return _.createNoValueFilterFunction(e,t);case f.SelectorType.RANGE:return _.createRangeFilterFunction(e,t);case f.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 Le=_;const Hg=r=>r.selection.size,Vg=r=>{switch(r.selection.size){case 1:return"selection";case 0:return"noSelection";default:return"multiSelection"}},Kg=r=>{if(r.selection.size!==0)return r.selection.isNode?f.EntityType.NODE:f.EntityType.EDGE},fe=r=>r.selection.size===1?r.selection.get(0):void 0,qg=r=>{const e=fe(r);if(e!==void 0)return e.isNode?e.getData("categories"):[e.getData("type")]},Wg=r=>{const e=fe(r);if(e!==void 0)return e.isNode?"node":"edge"},yr=r=>{const e=fe(r);if(e!==void 0){const t=e.getData().properties;return Object.keys(t).map(i=>({key:i,value:t[i]}))}return[]},Yg=r=>yr(r).length>0;exports.ANIMATION_DURATION=pr;exports.BASE_GREY=T;exports.Captions=F;exports.CaptionsViz=lr;exports.EdgeAttributes=G;exports.FILTER_OPACITY=Ne;exports.Filters=Le;exports.HTML_COLORS=ee;exports.ItemAttributes=$;exports.LKE_NODE_GROUPING_EDGE=ne;exports.LKOgma=Gg;exports.NodeAttributes=I;exports.OgmaStore=hr;exports.OgmaTools=q;exports.PALETTE=Fe;exports.StyleRule=C;exports.StyleRuleType=or;exports.StyleRules=p;exports.StyleType=w;exports.StylesViz=ur;exports.Tools=u;exports.TransformationsViz=br;exports.getSelectionEntity=Kg;exports.getSelectionProperties=yr;exports.getSelectionSize=Hg;exports.getSelectionState=Vg;exports.getUniqSelection=fe;exports.getUniqSelectionEntity=Wg;exports.getUniqSelectionTypes=qg;exports.hasSelectionProperties=Yg;
|
|
3
|
+
`):"",this.name="UnsubscriptionError",this.errors=t}});function Mt(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 c=l.value;c.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 g=this.initialTeardown;if(P(g))try{g()}catch(b){s=b instanceof _e?b.errors:[b]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var h=Pt(d),v=h.next();!v.done;v=h.next()){var S=v.value;try{Rt(S)}catch(b){s=s??[],b instanceof _e?s=De(De([],Oe(s)),Oe(b.errors)):s.push(b)}}}catch(b){i={error:b}}finally{try{v&&!v.done&&(n=h.return)&&n.call(h)}finally{if(i)throw i.error}}}if(s)throw new _e(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Rt(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)&&Mt(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&Mt(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();We.EMPTY;function xd(r){return r instanceof We||r&&"closed"in r&&P(r.remove)&&P(r.add)&&P(r.unsubscribe)}function Rt(r){P(r)?r():r.unsubscribe()}var Ed={useDeprecatedNextContext:!1},$d={setTimeout:function(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,De([r,e],Oe(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Td(r){$d.setTimeout(function(){throw r})}function Bt(){}var gr=function(r){qe(e,r);function e(t){var i=r.call(this)||this;return i.isStopped=!1,t?(i.destination=t,xd(t)&&t.add(i)):i.destination=Dd,i}return e.create=function(t,i,n){return new wd(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),Fd=Function.prototype.bind;function Se(r,e){return Fd.call(r,e)}var Nd=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){Q(i)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){Q(i)}else Q(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){Q(t)}},r}(),wd=function(r){qe(e,r);function e(t,i,n){var s=r.call(this)||this,a;if(P(t)||!t)a={next:t??void 0,error:i??void 0,complete:n??void 0};else{var o;s&&Ed.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=function(){return s.unsubscribe()},a={next:t.next&&Se(t.next,o),error:t.error&&Se(t.error,o),complete:t.complete&&Se(t.complete,o)}):a=t}return s.destination=new Nd(a),s}return e}(gr);function Q(r){Td(r)}function Od(r){throw r}var Dd={closed:!0,next:Bt,error:Od,complete:Bt};function Ld(r){return r}function dr(r,e,t,i,n){return new Id(r,e,t,i,n)}var Id=function(r){qe(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(c){try{i(c)}catch(g){t.error(g)}}:r.prototype._next,l._error=s?function(c){try{s(c)}catch(g){t.error(g)}finally{this.unsubscribe()}}:r.prototype._error,l._complete=n?function(){try{n()}catch(c){t.error(c)}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 Pd(r,e){return cr(function(t,i){var n=0;t.subscribe(dr(i,function(s){i.next(r.call(e,s,n++))}))})}function Md(r,e){return e===void 0&&(e=Ld),r=r??Rd,cr(function(t,i){var n,s=!0;t.subscribe(dr(i,function(a){var o=e(a);(s||!r(n,o))&&(s=!1,n=o,i.next(a))}))})}function Rd(r,e){return r===e}class hr extends _r.BehaviorSubject{constructor(e){super(e)}dispatch(e){this.next(e(this.value))}selectStore(e){return this.pipe(Pd(e),Md((t,i)=>u.isEqual(t,i)))}clear(){this.next({selection:new fr,items:{node:[],edge:[]},changes:void 0,animation:!1})}}class Bd{constructor(e){this._store=new hr({selection:new fr,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("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()}}}class fr{constructor(){this.size=0,this.isNode=!0}}const pr=750,zd={steps:40,alignSiblings:!0,charge:5,theta:.34,duration:pr};class Gd 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 Bd(this),this.store=this._reactive.store):this._reactive.listenToSelectionEvents(),this.initSelection(),this.setConfigOgma(this._configuration,e,t),this.LKTransformation=new br(this),this.LkNodeGroupingTransformation=new jd(this),this.LKStyles.setNodesDefaultHalo(),this.LKStyles.setEdgesDefaultHalo(),this.LKStyles.setBadgeRule(),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 ur(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,c,g,d;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=(d=(g=(c=(l=e==null?void 0:e.options)==null?void 0:l.styles)==null?void 0:c.edge)==null?void 0:g.text)==null?void 0:d.maxTextLength;this.LKCaptions=new lr(this,t,i)}getForceLayoutParams(e,t=0){let i=300-.052*this.getNodes().size;return i<40&&(i=40),{steps:e===f.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=f.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===f.EntityType.NODE)&&(t=f.EntityType.EDGE,i=[]),i.push(a.id)),delete a.attributes.selected),a));await this.addGraphAfterValidation({nodes:n,edges:s}),t===f.EntityType.NODE?this.getNodes(i).setSelected(!0):t===f.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.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)}}const ee={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)"}};class q{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 c=parseInt(e[0].toString()+e[1].toString(),16),g=parseInt(e[2].toString()+e[3].toString(),16),d=parseInt(e[4].toString()+e[5].toString(),16);s=`rgb(${c}, ${g}, ${d})`}else if(i.test(e)||n.test(e)||ee[e.toLowerCase()]!==void 0)s=u.isDefined(ee[e.toLowerCase()])?ee[e.toLowerCase()].rgb:e;else return!0;const[a,o,l]=/rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,\d{1,3})?\)/.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){let i=e.toArray().find(a=>a.getDegree()===1);const n=new Set,s=[];for(;i;){s.push(i),n.add(i);const a=i.getAdjacentNodes().filter(o=>!n.has(o)).get(0);i=a===void 0?null:a}return s.map(a=>a.getId())}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}}const ne="LKE_NODE_GROUPING_EDGE",Ud="LKE_NODE_GROUPING_NODE";class jd{constructor(e){this._ogma=e}setGroupingRule(e){this.groupRule=e}async initTransformation(){this.transformation===void 0?this.transformation=this._ogma.transformations.addNodeGrouping({groupIdFunction:e=>{var t;if(!this._isRuleNotApplicableToNode(e)){const i=this._findGroupingPropertyValue(e);return`${(t=this.groupRule)==null?void 0:t.groupingOptions.itemTypes.join("-")}-${i}`.toLowerCase().trim()}},nodeGenerator:e=>({data:{categories:[Ud],properties:{},nodeGroupId:this._findNodeGroupId(e)}}),edgeGenerator:()=>({data:{type:ne}}),showContents:!0,padding:10}):await this.refreshTransformation()}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()&&u.isDefined(e.getSubNodes()),nodeDependencies:{self:{data:!0}}})}async refreshNodeGroupingStyle(){var e;await((e=this.nodeGroupingStyleRule)==null?void 0:e.refresh())}async runLayoutOnAllSubNodes(){await this._ogma.transformations.afterNextUpdate();const e=this._getAllTransformationRawNodes(),t=[];for(let i=0;i<e.length;i++){const n=e[i];t.push(this.runSubNodesLayout(n))}await Promise.all(t)}async runSubNodesLayout(e){if(e.size===0||e.size===1)return;if(e.size===2){await this._runTwoNodesLayout(e);return}if(e.getAdjacentEdges({bothExtremities:!0}).size===0)return this._runCirclePack(e);const i=this.isStar(e);if(i){const s=e.filter(l=>l!==i),a=this._runCircularLayout({radii:s.getAttribute("radius"),cx:i.getAttribute("x"),cy:i.getAttribute("y"),clockwise:!1,distanceRatio:5});await i.toList().concat(s).setAttributes([i.getPosition(),...a]);return}if(e.getDegree().every(s=>s>0&&s<=2)){await this._runChainLayout(e);return}return await this._runForceLayout(e)}getVirtualNodesOfTransformation(){return this.transformation.getContext().metaNodes}async setNodeGroupPin(e){this._ogma.getNodes().filter(t=>t.isVirtual()).forEach(t=>{const i=e.find(n=>n.id===t.getData("nodeGroupId"));i!==void 0&&t.setAttribute("layoutable",i.attributes.layoutable??!1)})}_getNodeGroupingCaption(e){var t;if(e!==void 0&&e.isVirtual()&&((t=e.getSubNodes())==null?void 0:t.get(0))!==void 0){const i=e.getSubNodes().get(0).getData(["properties",this.groupRule.groupingOptions.propertyKey]),n=u.getValueFromLkProperty(i),s=e.getSubNodes().filter(a=>!a.hasClass("filtered")).size;return`${n} (${s})`}}async _runCirclePack(e){await this._ogma.algorithms.circlePack({nodes:e,margin:10,sort:"asc"})}async _runChainLayout(e){const t=this._ogma.getNodes(q.topologicalSort(e));await this._ogma.layouts.grid({nodes:t,colDistance:Math.max(...e.getAttribute("radius").map(Number))*4,rows:1})}async _runForceLayout(e){await this._ogma.layouts.force({nodes:e,...zd})}_isRuleNotApplicableToNode(e){var i;const t=e.getData(["properties",((i=this.groupRule)==null?void 0:i.groupingOptions.propertyKey)??""]);return this.groupRule===void 0||this.groupRule.groupingOptions.itemTypes.every(n=>!e.getData("categories").includes(n))||!u.isDefined(t)||typeof t=="object"&&t.status==="missing"}async _unpinNodes(e){await Promise.all(e.map(t=>{if(t!==null)return t.setAttribute("layoutable",!0)}))}_getAllTransformationRawNodes(){return this.getVirtualNodesOfTransformation().getSubNodes()}_findGroupingPropertyValue(e){var i;const t=e.getData(["properties",((i=this.groupRule)==null?void 0:i.groupingOptions.propertyKey)??""]);return`${u.getValueFromLkProperty(t)}`}_findNodeGroupId(e){var i,n;const t=this._findGroupingPropertyValue(e.get(0));return Ke(`${(i=this.groupRule)==null?void 0:i.name}-${(n=this.groupRule)==null?void 0:n.groupingOptions.itemTypes.join("-")}-${t}`)}_runCircularLayout({radii:e,clockwise:t=!0,cx:i=0,cy:n=0,startAngle:s=3/2*Math.PI,getRadius:a=l=>Number(l),distanceRatio:o=0}){const l=e.length;if(l===0)return[];if(l===1)return[{x:i,y:n}];const c=e.map(a).reduce((A,x)=>Math.max(A,x),0)*(2+o),d=(2*Math.PI-2*Math.PI/l)/Math.max(1,l-1),h=Math.cos(d)-Math.cos(0),v=Math.sin(d)-Math.sin(0),S=Math.sqrt(c*c/(h*h+v*v)),b=Math.max(S,0);return e.map((A,x)=>{const E=s+x*d*(t?1:-1),R=b*Math.cos(E),m=b*Math.sin(E);return{x:i+R,y:n+m}})}async _runTwoNodesLayout(e){const t=e.getAttribute("radius").map(Number),i=e.getPosition(),n=Math.min(...t);await e.setAttributes([i[0],{x:i[0].x+n+t[0]+t[1],y:i[0].y}])}isStar(e){for(const t of e.getId()){const i=this._ogma.getNode(t),n=i.getAdjacentNodes();if(i.getDegree()>2&&n.getDegree().every(a=>a===1)&&n.size+1===e.size)return i}return!1}}const kd={color:"#000000",shape:{style:"dashed",head:"arrow"},width:1.5};class br{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:{...kd,...this.edgeGroupStyle,text:{content:e=>{if(e!==void 0&&e.getSubEdges()!==null&&e.getData("type")!==ne){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")!==ne,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 f.SelectorType.ANY:return _.createAnyFilterFunction(e,t);case f.SelectorType.IS:return _.createIsFilterFunction(e,t);case f.SelectorType.NO_VALUE:return _.createNoValueFilterFunction(e,t);case f.SelectorType.RANGE:return _.createRangeFilterFunction(e,t);case f.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 Le=_;const Hd=r=>r.selection.size,Vd=r=>{switch(r.selection.size){case 1:return"selection";case 0:return"noSelection";default:return"multiSelection"}},Kd=r=>{if(r.selection.size!==0)return r.selection.isNode?f.EntityType.NODE:f.EntityType.EDGE},fe=r=>r.selection.size===1?r.selection.get(0):void 0,qd=r=>{const e=fe(r);if(e!==void 0)return e.isNode?e.getData("categories"):[e.getData("type")]},Wd=r=>{const e=fe(r);if(e!==void 0)return e.isNode?"node":"edge"},yr=r=>{const e=fe(r);if(e!==void 0){const t=e.getData().properties;return Object.keys(t).map(i=>({key:i,value:t[i]}))}return[]},Yd=r=>yr(r).length>0;exports.ANIMATION_DURATION=pr;exports.BASE_GREY=$;exports.Captions=F;exports.CaptionsViz=lr;exports.EdgeAttributes=G;exports.FILTER_OPACITY=Ne;exports.Filters=Le;exports.HTML_COLORS=ee;exports.ItemAttributes=T;exports.LKE_NODE_GROUPING_EDGE=ne;exports.LKOgma=Gd;exports.NodeAttributes=I;exports.OgmaStore=hr;exports.OgmaTools=q;exports.PALETTE=Fe;exports.StyleRule=C;exports.StyleRuleType=or;exports.StyleRules=p;exports.StyleType=w;exports.StylesViz=ur;exports.Tools=u;exports.TransformationsViz=br;exports.getSelectionEntity=Kd;exports.getSelectionProperties=yr;exports.getSelectionSize=Hd;exports.getSelectionState=Vd;exports.getUniqSelection=fe;exports.getUniqSelectionEntity=Wd;exports.getUniqSelectionTypes=qd;exports.hasSelectionProperties=Yd;
|
|
4
4
|
//# sourceMappingURL=index.cjs.map
|