@linkurious/ogma-linkurious-parser 4.3.3 → 4.3.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { IEdgeStyle, INodeStyle, IStyleRule, OgmaEdgeShape, OgmaNodeShape, TextOptions } from '@linkurious/rest-client';
1
+ import { IBadgesStyle, IEdgeStyle, INodeStyle, IStyleRule, OgmaEdgeShape, OgmaNodeShape, TextOptions } from '@linkurious/rest-client';
2
2
  import { LKOgma, NodeAttributes, StyleRule as LKStyleRule, StyleType } from '../..';
3
3
  export interface StylesConfig {
4
4
  nodeColorStyleRules: Array<LKStyleRule>;
@@ -12,6 +12,7 @@ export interface StylesConfig {
12
12
  export declare const DEFAULT_OGMA_FONT = "'roboto', sans-serif";
13
13
  export declare const CLEAR_FONT_COLOR = "#FFF";
14
14
  export declare const FILTER_OPACITY = 0.2;
15
+ export declare const BADGE_COLOR = "#3F3D5F";
15
16
  export declare class StylesViz {
16
17
  private _ogma;
17
18
  private _exportClass;
@@ -30,6 +31,7 @@ export declare class StylesViz {
30
31
  private _ogmaEdgeShape;
31
32
  private _defaultConfiguration;
32
33
  private _pinnedIndicatorRule?;
34
+ private _badgesStyle?;
33
35
  constructor(ogma: LKOgma, configuration: {
34
36
  node: {
35
37
  nodeRadius?: number;
@@ -88,9 +90,13 @@ export declare class StylesViz {
88
90
  */
89
91
  setExportClass(textWrappingLength?: boolean): void;
90
92
  /**
91
- * Set the rule to display badges
93
+ * Set the badge style
92
94
  */
93
- setBadgeRule(): void;
95
+ initBadges(badges?: IBadgesStyle): Promise<void>;
96
+ /**
97
+ * Refresh the hidden neighbors counter badge class (used in expand)
98
+ */
99
+ refreshCounterBadgeClass(): void;
94
100
  /**
95
101
  * Used in other repos to refresh the pin badge style rule
96
102
  * LKE-13639: we are using a style rule instead of an Ogma class to get the right size of the nodes when calling _findPinBadgeScale
@@ -169,4 +175,12 @@ export declare class StylesViz {
169
175
  * The issue is still present in Ogma 5.2
170
176
  */
171
177
  private _getNodeRadius;
178
+ /**
179
+ * Helper to get the counter badge attribute
180
+ */
181
+ private _getCounterBadge;
182
+ /**
183
+ * Helper to get the pin badge attribute
184
+ */
185
+ private _getPinBadge;
172
186
  }
@@ -3,4 +3,3 @@ export declare const HTML_COLORS: GenericObject<{
3
3
  hex: string;
4
4
  rgb: string;
5
5
  }>;
6
- export declare const BADGE_COLOR = "#3F3D5F";
package/package.json CHANGED
@@ -1,41 +1,41 @@
1
1
  {
2
2
  "name": "@linkurious/ogma-linkurious-parser",
3
- "version": "4.3.3",
3
+ "version": "4.3.5",
4
4
  "author": "Linkurious SAS",
5
5
  "description": "Parse and load a Linkurious visualization in Ogma with one line of code ",
6
6
  "files": [
7
- "dist"
7
+ "dist/src/index.cjs",
8
+ "dist/src/index.cjs.map",
9
+ "dist/src/index.mjs",
10
+ "dist/src/index.mjs.map",
11
+ "dist/src/**/*.d.ts"
8
12
  ],
9
13
  "publishConfig": {
10
14
  "access": "public"
11
15
  },
12
16
  "private": false,
13
- "type": "module",
14
- "main": "./dist/index.cjs",
15
- "module": "./dist/index.mjs",
16
- "types": "./dist/index.d.ts",
17
+ "main": "./dist/src/index.cjs",
18
+ "module": "./dist/src/index.mjs",
19
+ "types": "./dist/src/index.d.ts",
17
20
  "engines": {
18
- "node": "24.14.1",
19
- "npm": "^11.6.1"
21
+ "node": "24.14.1"
20
22
  },
21
23
  "exports": {
22
24
  ".": {
23
- "import": "./dist/index.mjs",
24
- "require": "./dist/index.cjs",
25
- "types": "./dist/index.d.ts"
25
+ "import": "./dist/src/index.mjs",
26
+ "require": "./dist/src/index.cjs",
27
+ "types": "./dist/src/index.d.ts"
26
28
  }
27
29
  },
28
30
  "scripts": {
29
- "build": "npm run compile && npm run build:bundle",
30
- "compile": "tsc --emitDeclarationOnly",
31
- "build:bundle": "vite build",
31
+ "build": "tsc && vite build",
32
+ "compile": "tsc && vite build",
32
33
  "clean": "rm -rf node_modules dist .nyc_output",
33
- "test": "mocha -r tsx tests/**/*.spec.ts",
34
- "test:unit": "mocha -r tsx --reporter mocha-multi-reporters --reporter-options configFile=.test-reporters.json tests/**/*.spec.ts",
34
+ "test": "mocha dist/tests/**/*.spec.js",
35
+ "test:unit": "mocha --reporter mocha-multi-reporters --reporter-options configFile=.test-reporters.json dist/tests/**/*.spec.js",
35
36
  "coverage": "nyc --reporter=text-summary --reporter=cobertura --report-dir=../../reports/ogma-linkurious-parser npm run test:unit",
36
37
  "lint": "eslint --fix --ext .ts .",
37
- "lint:ci": "eslint --cache --cache-strategy content -f checkstyle -o reports/checkstyle.xml --ext .ts .",
38
- "latest:generic": "npm install @linkurious/rest-client@${npm_config_lk_tag}"
38
+ "lint:ci": "eslint --cache --cache-strategy content -f checkstyle -o reports/checkstyle.xml --ext .ts ."
39
39
  },
40
40
  "repository": {
41
41
  "type": "git",
@@ -44,7 +44,7 @@
44
44
  "license": "Apache-2.0",
45
45
  "homepage": "",
46
46
  "dependencies": {
47
- "lodash": "4.17.21",
47
+ "lodash": "4.18.1",
48
48
  "rxjs": "7.8.1",
49
49
  "sha1": "1.1.1"
50
50
  },
@@ -53,27 +53,10 @@
53
53
  },
54
54
  "devDependencies": {
55
55
  "@linkurious/ogma": "5.3.12",
56
- "@linkurious/rest-client": "4.3.3",
57
- "@types/chai": "4.2.17",
58
- "@types/lodash": "4.14.182",
59
- "@types/mocha": "5.2.7",
56
+ "@linkurious/rest-client": "file:../rest-client",
57
+ "@types/lodash": "4.17.24",
60
58
  "@types/sha1": "1.1.2",
61
- "@typescript-eslint/eslint-plugin": "7.15.0",
62
- "@typescript-eslint/parser": "7.15.0",
63
- "chai": "4.3.4",
64
- "eslint": "8.57.0",
65
- "eslint-config-prettier": "6.10.1",
66
- "eslint-plugin-import": "2.29.0",
67
- "eslint-plugin-prettier": "5.2.1",
68
- "mocha": "9.2.0",
69
- "mocha-junit-reporter": "2.0.2",
70
- "mocha-multi-reporters": "1.5.1",
71
- "nyc": "15.1.0",
72
- "prettier": "3.3.3",
73
- "should": "11.1.0",
74
59
  "tslib": "2.8.0",
75
- "tsx": "4.19.2",
76
- "typescript": "5.5.4",
77
60
  "vite": "5.4.10"
78
61
  }
79
62
  }
package/dist/index.cjs DELETED
@@ -1,4 +0,0 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@linkurious/rest-client"),mr=require("@linkurious/ogma"),Sr=require("rxjs");var X=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Re(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}function Cr(){this.__data__=[],this.size=0}var Ar=Cr;function Er(r,e){return r===e||r!==r&&e!==e}var Me=Er,xr=Me;function Fr(r,e){for(var t=r.length;t--;)if(xr(r[t][0],e))return t;return-1}var le=Fr,Tr=le,$r=Array.prototype,Nr=$r.splice;function Dr(r){var e=this.__data__,t=Tr(e,r);if(t<0)return!1;var i=e.length-1;return t==i?e.pop():Nr.call(e,t,1),--this.size,!0}var wr=Dr,Or=le;function Lr(r){var e=this.__data__,t=Or(e,r);return t<0?void 0:e[t][1]}var Ir=Lr,Pr=le;function Rr(r){return Pr(this.__data__,r)>-1}var Mr=Rr,Gr=le;function zr(r,e){var t=this.__data__,i=Gr(t,r);return i<0?(++this.size,t.push([r,e])):t[i][1]=e,this}var Br=zr,Ur=Ar,jr=wr,Vr=Ir,kr=Mr,Hr=Br;function U(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}U.prototype.clear=Ur;U.prototype.delete=jr;U.prototype.get=Vr;U.prototype.has=kr;U.prototype.set=Hr;var ce=U,Kr=ce;function qr(){this.__data__=new Kr,this.size=0}var Yr=qr;function Wr(r){var e=this.__data__,t=e.delete(r);return this.size=e.size,t}var Jr=Wr;function Zr(r){return this.__data__.get(r)}var Xr=Zr;function Qr(r){return this.__data__.has(r)}var ei=Qr,ti=typeof X=="object"&&X&&X.Object===Object&&X,zt=ti,ri=zt,ii=typeof self=="object"&&self&&self.Object===Object&&self,ni=ri||ii||Function("return this")(),w=ni,si=w,ai=si.Symbol,Y=ai,Je=Y,Bt=Object.prototype,oi=Bt.hasOwnProperty,ui=Bt.toString,K=Je?Je.toStringTag:void 0;function li(r){var e=oi.call(r,K),t=r[K];try{r[K]=void 0;var i=!0}catch{}var n=ui.call(r);return i&&(e?r[K]=t:delete r[K]),n}var ci=li,di=Object.prototype,gi=di.toString;function hi(r){return gi.call(r)}var fi=hi,Ze=Y,pi=ci,bi=fi,yi="[object Null]",vi="[object Undefined]",Xe=Ze?Ze.toStringTag:void 0;function _i(r){return r==null?r===void 0?vi:yi:Xe&&Xe in Object(r)?pi(r):bi(r)}var W=_i;function mi(r){var e=typeof r;return r!=null&&(e=="object"||e=="function")}var de=mi,Si=W,Ci=de,Ai="[object AsyncFunction]",Ei="[object Function]",xi="[object GeneratorFunction]",Fi="[object Proxy]";function Ti(r){if(!Ci(r))return!1;var e=Si(r);return e==Ei||e==xi||e==Ai||e==Fi}var Ut=Ti,$i=w,Ni=$i["__core-js_shared__"],Di=Ni,_e=Di,Qe=function(){var r=/[^.]+$/.exec(_e&&_e.keys&&_e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function wi(r){return!!Qe&&Qe in r}var Oi=wi,Li=Function.prototype,Ii=Li.toString;function Pi(r){if(r!=null){try{return Ii.call(r)}catch{}try{return r+""}catch{}}return""}var jt=Pi,Ri=Ut,Mi=Oi,Gi=de,zi=jt,Bi=/[\\^$.*+?()[\]{}|]/g,Ui=/^\[object .+?Constructor\]$/,ji=Function.prototype,Vi=Object.prototype,ki=ji.toString,Hi=Vi.hasOwnProperty,Ki=RegExp("^"+ki.call(Hi).replace(Bi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function qi(r){if(!Gi(r)||Mi(r))return!1;var e=Ri(r)?Ki:Ui;return e.test(zi(r))}var Yi=qi;function Wi(r,e){return r==null?void 0:r[e]}var Ji=Wi,Zi=Yi,Xi=Ji;function Qi(r,e){var t=Xi(r,e);return Zi(t)?t:void 0}var M=Qi,en=M,tn=w,rn=en(tn,"Map"),Ge=rn,nn=M,sn=nn(Object,"create"),ge=sn,et=ge;function an(){this.__data__=et?et(null):{},this.size=0}var on=an;function un(r){var e=this.has(r)&&delete this.__data__[r];return this.size-=e?1:0,e}var ln=un,cn=ge,dn="__lodash_hash_undefined__",gn=Object.prototype,hn=gn.hasOwnProperty;function fn(r){var e=this.__data__;if(cn){var t=e[r];return t===dn?void 0:t}return hn.call(e,r)?e[r]:void 0}var pn=fn,bn=ge,yn=Object.prototype,vn=yn.hasOwnProperty;function _n(r){var e=this.__data__;return bn?e[r]!==void 0:vn.call(e,r)}var mn=_n,Sn=ge,Cn="__lodash_hash_undefined__";function An(r,e){var t=this.__data__;return this.size+=this.has(r)?0:1,t[r]=Sn&&e===void 0?Cn:e,this}var En=An,xn=on,Fn=ln,Tn=pn,$n=mn,Nn=En;function j(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}j.prototype.clear=xn;j.prototype.delete=Fn;j.prototype.get=Tn;j.prototype.has=$n;j.prototype.set=Nn;var Dn=j,tt=Dn,wn=ce,On=Ge;function Ln(){this.size=0,this.__data__={hash:new tt,map:new(On||wn),string:new tt}}var In=Ln;function Pn(r){var e=typeof r;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?r!=="__proto__":r===null}var Rn=Pn,Mn=Rn;function Gn(r,e){var t=r.__data__;return Mn(e)?t[typeof e=="string"?"string":"hash"]:t.map}var he=Gn,zn=he;function Bn(r){var e=zn(this,r).delete(r);return this.size-=e?1:0,e}var Un=Bn,jn=he;function Vn(r){return jn(this,r).get(r)}var kn=Vn,Hn=he;function Kn(r){return Hn(this,r).has(r)}var qn=Kn,Yn=he;function Wn(r,e){var t=Yn(this,r),i=t.size;return t.set(r,e),this.size+=t.size==i?0:1,this}var Jn=Wn,Zn=In,Xn=Un,Qn=kn,es=qn,ts=Jn;function V(r){var e=-1,t=r==null?0:r.length;for(this.clear();++e<t;){var i=r[e];this.set(i[0],i[1])}}V.prototype.clear=Zn;V.prototype.delete=Xn;V.prototype.get=Qn;V.prototype.has=es;V.prototype.set=ts;var ze=V,rs=ce,is=Ge,ns=ze,ss=200;function as(r,e){var t=this.__data__;if(t instanceof rs){var i=t.__data__;if(!is||i.length<ss-1)return i.push([r,e]),this.size=++t.size,this;t=this.__data__=new ns(i)}return t.set(r,e),this.size=t.size,this}var os=as,us=ce,ls=Yr,cs=Jr,ds=Xr,gs=ei,hs=os;function k(r){var e=this.__data__=new us(r);this.size=e.size}k.prototype.clear=ls;k.prototype.delete=cs;k.prototype.get=ds;k.prototype.has=gs;k.prototype.set=hs;var Vt=k,fs="__lodash_hash_undefined__";function ps(r){return this.__data__.set(r,fs),this}var bs=ps;function ys(r){return this.__data__.has(r)}var vs=ys,_s=ze,ms=bs,Ss=vs;function re(r){var e=-1,t=r==null?0:r.length;for(this.__data__=new _s;++e<t;)this.add(r[e])}re.prototype.add=re.prototype.push=ms;re.prototype.has=Ss;var Cs=re;function As(r,e){for(var t=-1,i=r==null?0:r.length;++t<i;)if(e(r[t],t,r))return!0;return!1}var Es=As;function xs(r,e){return r.has(e)}var Fs=xs,Ts=Cs,$s=Es,Ns=Fs,Ds=1,ws=2;function Os(r,e,t,i,n,s){var a=t&Ds,o=r.length,l=e.length;if(o!=l&&!(a&&l>o))return!1;var c=s.get(r),d=s.get(e);if(c&&d)return c==e&&d==r;var h=-1,f=!0,v=t&ws?new Ts:void 0;for(s.set(r,e),s.set(e,r);++h<o;){var S=r[h],b=e[h];if(i)var x=a?i(b,S,h,e,r,s):i(S,b,h,r,e,s);if(x!==void 0){if(x)continue;f=!1;break}if(v){if(!$s(e,function($,N){if(!Ns(v,N)&&(S===$||n(S,$,t,i,s)))return v.push(N)})){f=!1;break}}else if(!(S===b||n(S,b,t,i,s))){f=!1;break}}return s.delete(r),s.delete(e),f}var kt=Os,Ls=w,Is=Ls.Uint8Array,Ps=Is;function Rs(r){var e=-1,t=Array(r.size);return r.forEach(function(i,n){t[++e]=[n,i]}),t}var Ms=Rs;function Gs(r){var e=-1,t=Array(r.size);return r.forEach(function(i){t[++e]=i}),t}var zs=Gs,rt=Y,it=Ps,Bs=Me,Us=kt,js=Ms,Vs=zs,ks=1,Hs=2,Ks="[object Boolean]",qs="[object Date]",Ys="[object Error]",Ws="[object Map]",Js="[object Number]",Zs="[object RegExp]",Xs="[object Set]",Qs="[object String]",ea="[object Symbol]",ta="[object ArrayBuffer]",ra="[object DataView]",nt=rt?rt.prototype:void 0,me=nt?nt.valueOf:void 0;function ia(r,e,t,i,n,s,a){switch(t){case ra:if(r.byteLength!=e.byteLength||r.byteOffset!=e.byteOffset)return!1;r=r.buffer,e=e.buffer;case ta:return!(r.byteLength!=e.byteLength||!s(new it(r),new it(e)));case Ks:case qs:case Js:return Bs(+r,+e);case Ys:return r.name==e.name&&r.message==e.message;case Zs:case Qs:return r==e+"";case Ws:var o=js;case Xs:var l=i&ks;if(o||(o=Vs),r.size!=e.size&&!l)return!1;var c=a.get(r);if(c)return c==e;i|=Hs,a.set(r,e);var d=Us(o(r),o(e),i,n,s,a);return a.delete(r),d;case ea:if(me)return me.call(r)==me.call(e)}return!1}var na=ia;function sa(r,e){for(var t=-1,i=e.length,n=r.length;++t<i;)r[n+t]=e[t];return r}var Ht=sa,aa=Array.isArray,T=aa,oa=Ht,ua=T;function la(r,e,t){var i=e(r);return ua(r)?i:oa(i,t(r))}var ca=la;function da(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=da;function ha(){return[]}var fa=ha,pa=ga,ba=fa,ya=Object.prototype,va=ya.propertyIsEnumerable,st=Object.getOwnPropertySymbols,_a=st?function(r){return r==null?[]:(r=Object(r),pa(st(r),function(e){return va.call(r,e)}))}:ba,ma=_a;function Sa(r,e){for(var t=-1,i=Array(r);++t<r;)i[t]=e(t);return i}var Ca=Sa;function Aa(r){return r!=null&&typeof r=="object"}var J=Aa,Ea=W,xa=J,Fa="[object Arguments]";function Ta(r){return xa(r)&&Ea(r)==Fa}var $a=Ta,at=$a,Na=J,Kt=Object.prototype,Da=Kt.hasOwnProperty,wa=Kt.propertyIsEnumerable,Oa=at(function(){return arguments}())?at:function(r){return Na(r)&&Da.call(r,"callee")&&!wa.call(r,"callee")},Be=Oa,ie={exports:{}};function La(){return!1}var Ia=La;ie.exports;(function(r,e){var t=w,i=Ia,n=e&&!e.nodeType&&e,s=n&&!0&&r&&!r.nodeType&&r,a=s&&s.exports===n,o=a?t.Buffer:void 0,l=o?o.isBuffer:void 0,c=l||i;r.exports=c})(ie,ie.exports);var qt=ie.exports,Pa=9007199254740991,Ra=/^(?:0|[1-9]\d*)$/;function Ma(r,e){var t=typeof r;return e=e??Pa,!!e&&(t=="number"||t!="symbol"&&Ra.test(r))&&r>-1&&r%1==0&&r<e}var Ue=Ma,Ga=9007199254740991;function za(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=Ga}var je=za,Ba=W,Ua=je,ja=J,Va="[object Arguments]",ka="[object Array]",Ha="[object Boolean]",Ka="[object Date]",qa="[object Error]",Ya="[object Function]",Wa="[object Map]",Ja="[object Number]",Za="[object Object]",Xa="[object RegExp]",Qa="[object Set]",eo="[object String]",to="[object WeakMap]",ro="[object ArrayBuffer]",io="[object DataView]",no="[object Float32Array]",so="[object Float64Array]",ao="[object Int8Array]",oo="[object Int16Array]",uo="[object Int32Array]",lo="[object Uint8Array]",co="[object Uint8ClampedArray]",go="[object Uint16Array]",ho="[object Uint32Array]",y={};y[no]=y[so]=y[ao]=y[oo]=y[uo]=y[lo]=y[co]=y[go]=y[ho]=!0;y[Va]=y[ka]=y[ro]=y[Ha]=y[io]=y[Ka]=y[qa]=y[Ya]=y[Wa]=y[Ja]=y[Za]=y[Xa]=y[Qa]=y[eo]=y[to]=!1;function fo(r){return ja(r)&&Ua(r.length)&&!!y[Ba(r)]}var po=fo;function bo(r){return function(e){return r(e)}}var Yt=bo,ne={exports:{}};ne.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})(ne,ne.exports);var yo=ne.exports,vo=po,_o=Yt,ot=yo,ut=ot&&ot.isTypedArray,mo=ut?_o(ut):vo,Wt=mo,So=Ca,Co=Be,Ao=T,Eo=qt,xo=Ue,Fo=Wt,To=Object.prototype,$o=To.hasOwnProperty;function No(r,e){var t=Ao(r),i=!t&&Co(r),n=!t&&!i&&Eo(r),s=!t&&!i&&!n&&Fo(r),a=t||i||n||s,o=a?So(r.length,String):[],l=o.length;for(var c in r)(e||$o.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 Do=No,wo=Object.prototype;function Oo(r){var e=r&&r.constructor,t=typeof e=="function"&&e.prototype||wo;return r===t}var Lo=Oo;function Io(r,e){return function(t){return r(e(t))}}var Po=Io,Ro=Po,Mo=Ro(Object.keys,Object),Go=Mo,zo=Lo,Bo=Go,Uo=Object.prototype,jo=Uo.hasOwnProperty;function Vo(r){if(!zo(r))return Bo(r);var e=[];for(var t in Object(r))jo.call(r,t)&&t!="constructor"&&e.push(t);return e}var ko=Vo,Ho=Ut,Ko=je;function qo(r){return r!=null&&Ko(r.length)&&!Ho(r)}var fe=qo,Yo=Do,Wo=ko,Jo=fe;function Zo(r){return Jo(r)?Yo(r):Wo(r)}var Ve=Zo,Xo=ca,Qo=ma,eu=Ve;function tu(r){return Xo(r,eu,Qo)}var ru=tu,lt=ru,iu=1,nu=Object.prototype,su=nu.hasOwnProperty;function au(r,e,t,i,n,s){var a=t&iu,o=lt(r),l=o.length,c=lt(e),d=c.length;if(l!=d&&!a)return!1;for(var h=l;h--;){var f=o[h];if(!(a?f in e:su.call(e,f)))return!1}var v=s.get(r),S=s.get(e);if(v&&S)return v==e&&S==r;var b=!0;s.set(r,e),s.set(e,r);for(var x=a;++h<l;){f=o[h];var $=r[f],N=e[f];if(i)var Z=a?i(N,$,f,e,r,s):i($,N,f,r,e,s);if(!(Z===void 0?$===N||n($,N,t,i,s):Z)){b=!1;break}x||(x=f=="constructor")}if(b&&!x){var m=r.constructor,O=e.constructor;m!=O&&"constructor"in r&&"constructor"in e&&!(typeof m=="function"&&m instanceof m&&typeof O=="function"&&O instanceof O)&&(b=!1)}return s.delete(r),s.delete(e),b}var ou=au,uu=M,lu=w,cu=uu(lu,"DataView"),du=cu,gu=M,hu=w,fu=gu(hu,"Promise"),pu=fu,bu=M,yu=w,vu=bu(yu,"Set"),_u=vu,mu=M,Su=w,Cu=mu(Su,"WeakMap"),Au=Cu,Ee=du,xe=Ge,Fe=pu,Te=_u,$e=Au,Jt=W,H=jt,ct="[object Map]",Eu="[object Object]",dt="[object Promise]",gt="[object Set]",ht="[object WeakMap]",ft="[object DataView]",xu=H(Ee),Fu=H(xe),Tu=H(Fe),$u=H(Te),Nu=H($e),L=Jt;(Ee&&L(new Ee(new ArrayBuffer(1)))!=ft||xe&&L(new xe)!=ct||Fe&&L(Fe.resolve())!=dt||Te&&L(new Te)!=gt||$e&&L(new $e)!=ht)&&(L=function(r){var e=Jt(r),t=e==Eu?r.constructor:void 0,i=t?H(t):"";if(i)switch(i){case xu:return ft;case Fu:return ct;case Tu:return dt;case $u:return gt;case Nu:return ht}return e});var Du=L,Se=Vt,wu=kt,Ou=na,Lu=ou,pt=Du,bt=T,yt=qt,Iu=Wt,Pu=1,vt="[object Arguments]",_t="[object Array]",Q="[object Object]",Ru=Object.prototype,mt=Ru.hasOwnProperty;function Mu(r,e,t,i,n,s){var a=bt(r),o=bt(e),l=a?_t:pt(r),c=o?_t:pt(e);l=l==vt?Q:l,c=c==vt?Q:c;var d=l==Q,h=c==Q,f=l==c;if(f&&yt(r)){if(!yt(e))return!1;a=!0,d=!1}if(f&&!d)return s||(s=new Se),a||Iu(r)?wu(r,e,t,i,n,s):Ou(r,e,l,t,i,n,s);if(!(t&Pu)){var v=d&&mt.call(r,"__wrapped__"),S=h&&mt.call(e,"__wrapped__");if(v||S){var b=v?r.value():r,x=S?e.value():e;return s||(s=new Se),n(b,x,t,i,s)}}return f?(s||(s=new Se),Lu(r,e,t,i,n,s)):!1}var Gu=Mu,zu=Gu,St=J;function Zt(r,e,t,i,n){return r===e?!0:r==null||e==null||!St(r)&&!St(e)?r!==r&&e!==e:zu(r,e,t,i,Zt,n)}var ke=Zt,Bu=ke;function Uu(r,e){return Bu(r,e)}var ju=Uu;const Vu=Re(ju);var Ct=Y,ku=Be,Hu=T,At=Ct?Ct.isConcatSpreadable:void 0;function Ku(r){return Hu(r)||ku(r)||!!(At&&r&&r[At])}var qu=Ku,Yu=Ht,Wu=qu;function Xt(r,e,t,i,n){var s=-1,a=r.length;for(t||(t=Wu),n||(n=[]);++s<a;){var o=r[s];e>0&&t(o)?e>1?Xt(o,e-1,t,i,n):Yu(n,o):i||(n[n.length]=o)}return n}var Ju=Xt;function Zu(r,e){for(var t=-1,i=r==null?0:r.length,n=Array(i);++t<i;)n[t]=e(r[t],t,r);return n}var Qt=Zu,Xu=W,Qu=J,el="[object Symbol]";function tl(r){return typeof r=="symbol"||Qu(r)&&Xu(r)==el}var pe=tl,rl=T,il=pe,nl=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,sl=/^\w*$/;function al(r,e){if(rl(r))return!1;var t=typeof r;return t=="number"||t=="symbol"||t=="boolean"||r==null||il(r)?!0:sl.test(r)||!nl.test(r)||e!=null&&r in Object(e)}var He=al,er=ze,ol="Expected a function";function Ke(r,e){if(typeof r!="function"||e!=null&&typeof e!="function")throw new TypeError(ol);var t=function(){var i=arguments,n=e?e.apply(this,i):i[0],s=t.cache;if(s.has(n))return s.get(n);var a=r.apply(this,i);return t.cache=s.set(n,a)||s,a};return t.cache=new(Ke.Cache||er),t}Ke.Cache=er;var ul=Ke,ll=ul,cl=500;function dl(r){var e=ll(r,function(i){return t.size===cl&&t.clear(),i}),t=e.cache;return e}var gl=dl,hl=gl,fl=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,pl=/\\(\\)?/g,bl=hl(function(r){var e=[];return r.charCodeAt(0)===46&&e.push(""),r.replace(fl,function(t,i,n,s){e.push(n?s.replace(pl,"$1"):i||t)}),e}),yl=bl,Et=Y,vl=Qt,_l=T,ml=pe,xt=Et?Et.prototype:void 0,Ft=xt?xt.toString:void 0;function tr(r){if(typeof r=="string")return r;if(_l(r))return vl(r,tr)+"";if(ml(r))return Ft?Ft.call(r):"";var e=r+"";return e=="0"&&1/r==-1/0?"-0":e}var Sl=tr,Cl=Sl;function Al(r){return r==null?"":Cl(r)}var El=Al,xl=T,Fl=He,Tl=yl,$l=El;function Nl(r,e){return xl(r)?r:Fl(r,e)?[r]:Tl($l(r))}var rr=Nl,Dl=pe;function wl(r){if(typeof r=="string"||Dl(r))return r;var e=r+"";return e=="0"&&1/r==-1/0?"-0":e}var be=wl,Ol=rr,Ll=be;function Il(r,e){e=Ol(e,r);for(var t=0,i=e.length;r!=null&&t<i;)r=r[Ll(e[t++])];return t&&t==i?r:void 0}var qe=Il,Pl=Vt,Rl=ke,Ml=1,Gl=2;function zl(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 h=new Pl;if(i)var f=i(c,d,l,r,e,h);if(!(f===void 0?Rl(d,c,Ml|Gl,i,h):f))return!1}}return!0}var Bl=zl,Ul=de;function jl(r){return r===r&&!Ul(r)}var ir=jl,Vl=ir,kl=Ve;function Hl(r){for(var e=kl(r),t=e.length;t--;){var i=e[t],n=r[i];e[t]=[i,n,Vl(n)]}return e}var Kl=Hl;function ql(r,e){return function(t){return t==null?!1:t[r]===e&&(e!==void 0||r in Object(t))}}var nr=ql,Yl=Bl,Wl=Kl,Jl=nr;function Zl(r){var e=Wl(r);return e.length==1&&e[0][2]?Jl(e[0][0],e[0][1]):function(t){return t===r||Yl(t,r,e)}}var Xl=Zl,Ql=qe;function ec(r,e,t){var i=r==null?void 0:Ql(r,e);return i===void 0?t:i}var tc=ec;function rc(r,e){return r!=null&&e in Object(r)}var ic=rc,nc=rr,sc=Be,ac=T,oc=Ue,uc=je,lc=be;function cc(r,e,t){e=nc(e,r);for(var i=-1,n=e.length,s=!1;++i<n;){var a=lc(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&&uc(n)&&oc(a,n)&&(ac(r)||sc(r)))}var dc=cc,gc=ic,hc=dc;function fc(r,e){return r!=null&&hc(r,e,gc)}var pc=fc,bc=ke,yc=tc,vc=pc,_c=He,mc=ir,Sc=nr,Cc=be,Ac=1,Ec=2;function xc(r,e){return _c(r)&&mc(e)?Sc(Cc(r),e):function(t){var i=yc(t,r);return i===void 0&&i===e?vc(t,r):bc(e,i,Ac|Ec)}}var Fc=xc;function Tc(r){return r}var ye=Tc;function $c(r){return function(e){return e==null?void 0:e[r]}}var Nc=$c,Dc=qe;function wc(r){return function(e){return Dc(e,r)}}var Oc=wc,Lc=Nc,Ic=Oc,Pc=He,Rc=be;function Mc(r){return Pc(r)?Lc(Rc(r)):Ic(r)}var Gc=Mc,zc=Xl,Bc=Fc,Uc=ye,jc=T,Vc=Gc;function kc(r){return typeof r=="function"?r:r==null?Uc:typeof r=="object"?jc(r)?Bc(r[0],r[1]):zc(r):Vc(r)}var Hc=kc;function Kc(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 qc=Kc,Yc=qc,Wc=Yc(),Jc=Wc,Zc=Jc,Xc=Ve;function Qc(r,e){return r&&Zc(r,e,Xc)}var ed=Qc,td=fe;function rd(r,e){return function(t,i){if(t==null)return t;if(!td(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 id=rd,nd=ed,sd=id,ad=sd(nd),od=ad,ud=od,ld=fe;function cd(r,e){var t=-1,i=ld(r)?Array(r.length):[];return ud(r,function(n,s,a){i[++t]=e(n,s,a)}),i}var dd=cd;function gd(r,e){var t=r.length;for(r.sort(e);t--;)r[t]=r[t].value;return r}var hd=gd,Tt=pe;function fd(r,e){if(r!==e){var t=r!==void 0,i=r===null,n=r===r,s=Tt(r),a=e!==void 0,o=e===null,l=e===e,c=Tt(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 pd=fd,bd=pd;function yd(r,e,t){for(var i=-1,n=r.criteria,s=e.criteria,a=n.length,o=t.length;++i<a;){var l=bd(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 vd=yd,Ce=Qt,_d=qe,md=Hc,Sd=dd,Cd=hd,Ad=Yt,Ed=vd,xd=ye,Fd=T;function Td(r,e,t){e.length?e=Ce(e,function(s){return Fd(s)?function(a){return _d(a,s.length===1?s[0]:s)}:s}):e=[xd];var i=-1;e=Ce(e,Ad(md));var n=Sd(r,function(s,a,o){var l=Ce(e,function(c){return c(s)});return{criteria:l,index:++i,value:s}});return Cd(n,function(s,a){return Ed(s,a,t)})}var $d=Td;function Nd(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 Dd=Nd,wd=Dd,$t=Math.max;function Od(r,e,t){return e=$t(e===void 0?r.length-1:e,0),function(){for(var i=arguments,n=-1,s=$t(i.length-e,0),a=Array(s);++n<s;)a[n]=i[e+n];n=-1;for(var o=Array(e+1);++n<e;)o[n]=i[n];return o[e]=t(a),wd(r,this,o)}}var Ld=Od;function Id(r){return function(){return r}}var Pd=Id,Rd=M,Md=function(){try{var r=Rd(Object,"defineProperty");return r({},"",{}),r}catch{}}(),Gd=Md,zd=Pd,Nt=Gd,Bd=ye,Ud=Nt?function(r,e){return Nt(r,"toString",{configurable:!0,enumerable:!1,value:zd(e),writable:!0})}:Bd,jd=Ud,Vd=800,kd=16,Hd=Date.now;function Kd(r){var e=0,t=0;return function(){var i=Hd(),n=kd-(i-t);if(t=i,n>0){if(++e>=Vd)return arguments[0]}else e=0;return r.apply(void 0,arguments)}}var qd=Kd,Yd=jd,Wd=qd,Jd=Wd(Yd),Zd=Jd,Xd=ye,Qd=Ld,eg=Zd;function tg(r,e){return eg(Qd(r,e,Xd),r+"")}var rg=tg,ig=Me,ng=fe,sg=Ue,ag=de;function og(r,e,t){if(!ag(t))return!1;var i=typeof e;return(i=="number"?ng(t)&&sg(e,t.length):i=="string"&&e in t)?ig(t[e],r):!1}var ug=og,lg=Ju,cg=$d,dg=rg,Dt=ug,gg=dg(function(r,e){if(r==null)return[];var t=e.length;return t>1&&Dt(r,e[0],e[1])?e=[]:t>2&&Dt(e[0],e[1],e[2])&&(e=[e[0]]),cg(r,lg(e,1),[])}),hg=gg;const G=Re(hg),fg=/\S+\.(gif|jpe?g|tiff|png|bmp|svg)$/i,pg=["label","Label","name","Name","title","Title","rdfs:label"];class u{static isEqual(e,t){return Vu(e,t)}static isDefined(e){return e!=null}static truncate(e,t,i=0){const n="…";if(!u.isDefined(e))return"";const s=`${e}`;if(s.length<=i+1)return s;const a=i-1;switch(t){case"middle":return s.substring(0,Math.ceil(a/2))+n+s.substring(s.length-Math.floor(a/2));case"end":return s.substring(0,a)+n}}static getIn(e,t){return t.reduce((i,n)=>i&&i[n]!==void 0?i[n]:void 0,e)}static clone(e){return typeof e=="object"?JSON.parse(JSON.stringify(e,(t,i)=>i instanceof Set?{}:i)):e}static getHiddenNeighbors(e){return e.reduce((t,i)=>{const n=i.getData("statistics");if(n!==void 0){const s=n.degree!==void 0&&!n.supernode?n.degree-u.getDegreeWithoutSelfConnection(i):n.supernodeDegree;if(s!==void 0&&s>0)return t+=s}return t},0)}static getDegreeWithoutSelfConnection(e){return e.getAdjacentNodes({policy:"exclude-sources",filter:"raw"}).size}static formatNumber(e){let t=1,i="";const n=e<0?"-":"";e=Math.abs(e),e>=1e6?(t=1e6,i="M"):e>=1e3&&(t=1e3,i="k");const s=e/t;return s<10&&s%1!==0?n+s.toFixed(1)+i:n+Math.floor(s)+i}static isStringFilled(e){return e.trim()!==""}static getValueFromLkProperty(e){if(typeof e=="object"&&"type"in e){if(!("original"in e)&&!("value"in e))return null;if("original"in e)return`${e.original}`;if("value"in e)return u.formatDate(new Date(new Date(e.value).getTime()+u.timezoneToMilliseconds(e.timezone)).toISOString())}return e}static formatDate(e,t,i){let n=e;i!==void 0&&(n=new Date(e).getTime()+i*1e3);const s=new Date(n);if(isNaN(s.getUTCFullYear()))return null;let a=s.getFullYear()+"-"+((s.getUTCMonth()+1).toString().length===1?"0"+(s.getUTCMonth()+1):s.getUTCMonth()+1)+"-"+(s.getUTCDate().toString().length===1?"0"+s.getUTCDate():s.getUTCDate());return t&&(a+=" "+(s.getUTCHours().toString().length===1?"0"+s.getUTCHours():s.getUTCHours())+":"+(s.getUTCMinutes().toString().length===1?"0"+s.getUTCMinutes():s.getUTCMinutes())+":"+(s.getUTCSeconds().toString().length===1?"0"+s.getUTCSeconds():s.getUTCSeconds())),a}static timezoneToMilliseconds(e){if(e===void 0||e==="Z")return 0;const t=e[0],[i,n]=e.slice(1).split(":");return t==="+"?this.sanitizeFormattedNumber(i)*36e5+this.sanitizeFormattedNumber(n)*6e4:(this.sanitizeFormattedNumber(i)*36e5+this.sanitizeFormattedNumber(n)*6e4)*-1}static sanitizeFormattedNumber(e){return e.length===2&&e.startsWith("0")?u.parseNumber(e[1]):u.parseNumber(e)}static parseNumber(e){if(typeof e=="string"){if(e.trim()==="")return Number.NaN;e=+e.replace(",",".").replace(" ","")}return typeof e!="number"||!isFinite(e)?Number.NaN:e}static uniqBy(e,t){const i=new Set;if(t){const n=[];for(let s=0;s<e.length;++s)e[s]&&e[s][t]&&!i.has(e[s][t])?(i.add(e[s][t]),n.push(e[s])):e[s][t]||n.push(e[s]);return n}return typeof e[0]=="object"?Array.from(new Set(e.map(n=>JSON.stringify(n)))).map(n=>JSON.parse(n)):Array.from(new Set(e))}static getType(e){if(u.isURLImage(e))return"imageUrl";if(u.isImage(e))return"image";if(u.isUrl(e))return"url"}static isUrl(e){try{return new URL(e),!0}catch{return!1}}static isImage(e){return fg.test(e)}static isURLImage(e){if(u.isUrl(e)){const t=new URL(e);return u.isImage(t.pathname)}return!1}static valueExists(e){return u.isDefined(e)&&(typeof e!="string"||u.isStringFilled(e))}static isNumber(e){return e=u.parseNumber(e),u.isDefined(e)&&e===e}static getPropertyValue(e,t,i){if(typeof e=="object"&&!Array.isArray(e)){if("status"in e)return t&&"original"in e?e.original:void 0;if((e.type==="date"||e.type==="datetime")&&i)return u.formatDate(e.value,e.type==="datetime");if(e.type==="date"||e.type==="datetime")return new Date(e.value).getTime()}return e}static parseFloat(e){return u.parseNumber(e)}static formatCurrencyValue(e,t){const i=e<0?"- ":"";switch(t.format){case g.CurrencyFormat.SYMBOL_COMMAS_DOT:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",",".")}`;case g.CurrencyFormat.SYMBOL_COMMAS:return`${i}${t.symbol!==void 0?t.symbol+" ":""}${u.formatNumberToCurrency(e,",")}`;case g.CurrencyFormat.DOTS_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case g.CurrencyFormat.DOTS_SYMBOL:return`${i}${u.formatNumberToCurrency(e,".")}${t.symbol!==void 0?" "+t.symbol:""}`;case g.CurrencyFormat.SPACES_COMMA_SYMBOL:return`${i}${u.formatNumberToCurrency(e," ",",")}${t.symbol!==void 0?" "+t.symbol:""}`;case g.CurrencyFormat.SPACES_SYMBOL:return`${i}${u.formatNumberToCurrency(e," ")}${t.symbol!==void 0?" "+t.symbol:""}`;default:throw Error(`Cannot format property value ${e}, unknown format ${t.format}.`)}}static formatNumberToCurrency(e,t,i){if(!Number.isFinite(e))return e.toString();const[n,s]=i?Math.abs(e).toFixed(2).split("."):[Math.abs(e).toFixed(0),void 0];let a=-1;const o=n.split("").reverse().map(l=>(a++,a>0&&a%3===0?l+t:l)).reverse().join("");return i?o+i+s:o}}class F{static getText(e,t,i){const n="categories"in e?e.categories:[e.type];if(F.captionExist(n,t))return"categories"in e?F.generateNodeCaption(e,t,i)||null:F.generateEdgeCaption(e,t,i)||null;if(e.properties!==void 0){const s=pg.find(a=>e.properties[a]!==void 0);if(s!==void 0&&u.isDefined(e.properties[s]))return`${u.getValueFromLkProperty(e.properties[s])}`.trim()}return null}static getLabel(e,t){if(typeof e=="object"&&"type"in e){if(!("original"in e)&&!("value"in e))return null;if("original"in e)return`${e.original}`;if("value"in e)return u.formatDate(new Date(new Date(e.value).getTime()+u.timezoneToMilliseconds(e.timezone)).toISOString())}else if((t==null?void 0:t.name)===g.PropertyTypeName.NUMBER&&t.options!==void 0)return u.formatCurrencyValue(e,t.options);return`${e}`.trim()}static captionExist(e,t){return e.some(i=>u.isDefined(t[i]))}static generateNodeCaption(e,t,i){const n=e.categories,s=[];let a=[];return n.forEach(o=>{t[o]&&t[o].active&&(t[o].displayName&&s.push(o),a=[...a,...t[o].properties])}),u.uniqBy(a).forEach(o=>{if(e.properties[o]!==void 0){const l=i?F.getPropertyType(i,o,n[0]):void 0;s.push(this.getLabel(e.properties[o],l))}}),s.filter(o=>o!==null).join(" - ").trim()}static getPropertyType(e,t,i){const n=e.find(a=>a.itemType===i),s=n==null?void 0:n.properties.find(a=>a.propertyKey===t);return s==null?void 0:s.propertyType}static generateEdgeCaption(e,t,i){const n=e.type,s=[];let a=[];return t[n]&&t[n].active?(t[n].displayName&&s.push(n),a=[...a,...t[n].properties],u.uniqBy(a).forEach(o=>{if(u.isDefined(e.properties[o])){const l=i?F.getPropertyType(i,o,n):void 0;s.push(F.getLabel(e.properties[o],l))}}),s.join(" - ").trim()):""}}var sr={exports:{}},ar={exports:{}};(function(){var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(t,i){return t<<i|t>>>32-i},rotr:function(t,i){return t<<32-i|t>>>i},endian:function(t){if(t.constructor==Number)return e.rotl(t,8)&16711935|e.rotl(t,24)&4278255360;for(var i=0;i<t.length;i++)t[i]=e.endian(t[i]);return t},randomBytes:function(t){for(var i=[];t>0;t--)i.push(Math.floor(Math.random()*256));return i},bytesToWords:function(t){for(var i=[],n=0,s=0;n<t.length;n++,s+=8)i[s>>>5]|=t[n]<<24-s%32;return i},wordsToBytes:function(t){for(var i=[],n=0;n<t.length*32;n+=8)i.push(t[n>>>5]>>>24-n%32&255);return i},bytesToHex:function(t){for(var i=[],n=0;n<t.length;n++)i.push((t[n]>>>4).toString(16)),i.push((t[n]&15).toString(16));return i.join("")},hexToBytes:function(t){for(var i=[],n=0;n<t.length;n+=2)i.push(parseInt(t.substr(n,2),16));return i},bytesToBase64:function(t){for(var i=[],n=0;n<t.length;n+=3)for(var s=t[n]<<16|t[n+1]<<8|t[n+2],a=0;a<4;a++)n*8+a*6<=t.length*8?i.push(r.charAt(s>>>6*(3-a)&63)):i.push("=");return i.join("")},base64ToBytes:function(t){t=t.replace(/[^A-Z0-9+\/]/ig,"");for(var i=[],n=0,s=0;n<t.length;s=++n%4)s!=0&&i.push((r.indexOf(t.charAt(n-1))&Math.pow(2,-2*s+8)-1)<<s*2|r.indexOf(t.charAt(n))>>>6-s*2);return i}};ar.exports=e})();var bg=ar.exports,Ne={utf8:{stringToBytes:function(r){return Ne.bin.stringToBytes(unescape(encodeURIComponent(r)))},bytesToString:function(r){return decodeURIComponent(escape(Ne.bin.bytesToString(r)))}},bin:{stringToBytes:function(r){for(var e=[],t=0;t<r.length;t++)e.push(r.charCodeAt(t)&255);return e},bytesToString:function(r){for(var e=[],t=0;t<r.length;t++)e.push(String.fromCharCode(r[t]));return e.join("")}}},wt=Ne;(function(){var r=bg,e=wt.utf8,t=wt.bin,i=function(s){s.constructor==String?s=e.stringToBytes(s):typeof Buffer<"u"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(s)?s=Array.prototype.slice.call(s,0):Array.isArray(s)||(s=s.toString());var a=r.bytesToWords(s),o=s.length*8,l=[],c=1732584193,d=-271733879,h=-1732584194,f=271733878,v=-1009589776;a[o>>5]|=128<<24-o%32,a[(o+64>>>9<<4)+15]=o;for(var S=0;S<a.length;S+=16){for(var b=c,x=d,$=h,N=f,Z=v,m=0;m<80;m++){if(m<16)l[m]=a[S+m];else{var O=l[m-3]^l[m-8]^l[m-14]^l[m-16];l[m]=O<<1|O>>>31}var _r=(c<<5|c>>>27)+v+(l[m]>>>0)+(m<20?(d&h|~d&f)+1518500249:m<40?(d^h^f)+1859775393:m<60?(d&h|d&f|h&f)-1894007588:(d^h^f)-899497514);v=f,f=h,h=d<<30|d>>>2,d=c,c=_r}c+=b,d+=x,h+=$,f+=N,v+=Z}return[c,d,h,f,v]},n=function(s,a){var o=r.wordsToBytes(i(s));return a&&a.asBytes?o:a&&a.asString?t.bytesToString(o):r.bytesToHex(o)};n._blocksize=16,n._digestsize=20,sr.exports=n})();var yg=sr.exports;const se=Re(yg),E="#7f7f7f",De=["#9467bd","#e377c2","#1f77b4","#17becf","#2ca02c","#bcbd22","#d62728","#ff7f0e","#8c564b","#c5b0d5","#f7b6d2","#aec7e8","#9edae5","#98df8a","#dbdb8d","#ff9896","#ffbb78","#c49c94"];class A{constructor(e){this.colorsCache=new Map,this._rulesMap={},this.refresh(e)}refresh(e){e.color!==void 0&&(this.colorsCache=new Map),this._rulesMap={color:e.color?[...e.color].reverse():this._rulesMap.color,icon:e.icon?[...e.icon].reverse():this._rulesMap.icon,image:e.image?[...e.image].reverse():this._rulesMap.image,shape:e.shape?[...e.shape].reverse():this._rulesMap.shape,size:e.size?[...e.size].reverse():this._rulesMap.size,width:e.width?[...e.width].reverse():this._rulesMap.width}}static autoColor(e,t){return u.isDefined(e)?De[A.getRandomUniqueColorPaletteIndex(e,De.length,t)]:E}static getRandomUniqueColorPaletteIndex(e,t,i){return i&&(e=e.toLowerCase()),+("0x"+se(e).substr(-4))%t}static getTypeColor(e,t){return typeof e.style.color=="object"&&e.style.color.input[0]!=="properties"?A.autoColor(t,e.style.color.ignoreCase):!u.isDefined(e.input)&&typeof e.style.color!="object"?e.style.color:null}static getAutomaticRangeStyleLinear(e,{max:t,min:i},n,s){if(t!==void 0&&i!==void 0){if(t===i||isNaN(e))return"100%";const a=(s-n)/(t-i),o=(n*t-s*i)/(t-i);return`${Math.floor(e*a+o)}%`}}static getAutomaticRangeStyleLog(e,{max:t,min:i},n,s){if(i!==void 0&&t!==void 0){if(t===i||isNaN(e))return"100%";i<1&&(e+=Math.abs(i)+1,t+=Math.abs(i)+1,i+=Math.abs(i)+1);const a=(s-n)/(Math.log(t)-Math.log(i)),o=(n*Math.log(t)-s*Math.log(i))/(Math.log(t)-Math.log(i));return`${Math.floor(a*Math.log(e)+o)}%`}}isAutoRange(e){return typeof e=="object"&&(e==null?void 0:e.type)==="autoRange"}}class B extends A{constructor(e){super(e)}static matchStyle(e,t){if(t!==void 0){for(let i=0;i<e.length;++i)if(e[i].canApplyTo(t))return e[i]}}color(e){if(!u.isDefined(e))return E;let t;for(let i=0;i<this._rulesMap.color.length;++i){const n=this._rulesMap.color[i];if(n.canApplyTo(e)){if(typeof n.style.color=="string")t=n.style.color;else if(typeof n.style.color=="object"){const s=u.getIn(e,n.style.color.input);t=A.autoColor(`${s}`,n.style.color.ignoreCase)}break}}return u.isDefined(t)?t:E}shape(e){var t;if(this._rulesMap.shape!==void 0)return(t=B.matchStyle(this._rulesMap.shape,e))==null?void 0:t.style.shape}width(e){if(this._rulesMap.width!==void 0){const t=B.matchStyle(this._rulesMap.width,e);if(t!==void 0){const i=t==null?void 0:t.style.width;if(i!==void 0&&this.isAutoRange(i)){if(i.input!==void 0&&i.max!==void 0&&i.min!==void 0){const n=i.input[1],s=u.parseNumber(e.properties[n]),a=i.scale&&i.scale===g.AutoRangeScale.LOGARITHMIC;return B.getAutomaticRangeWidth(s,t,a)}}else return i}}}static getAutomaticRangeWidth(e,t,i=!1){return i?this.getAutomaticRangeStyleLog(e,t.style.width,50,200):this.getAutomaticRangeStyleLinear(e,t.style.width,50,200)}all(e){return u.isDefined(e)?{color:this.color(e),shape:this.shape(e),width:this.width(e)}:{color:E,shape:g.OgmaEdgeShape.ARROW,width:"100%"}}}class I extends A{constructor(e){super(e)}static matchStyle(e,t,i){if(u.isDefined(t)&&u.isDefined(e)){for(let n=0;n<e.length;++n)if(e[n].canApplyTo(t)){i(e[n]);break}}}color(e){if(!u.isDefined(e))return[E];const t=se(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=A.autoColor(e.categories[a],c.style.color.ignoreCase):o=A.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=[E]);const s=n.length===1?n[0]:n;return this.colorsCache.set(t,s),s}icon(e){var a,o;const t=this.color(e),i=Array.isArray(t)?t[0]:t;let n={};const s=[...this._rulesMap.image||[],...this._rulesMap.icon||[]];if(!u.isDefined(e))return{icon:{},image:{}};for(let l=0;l<s.length;++l)if(s[l].canApplyTo(e)){const 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:P.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===g.AutoRangeScale.LOGARITHMIC;t=I.getAutomaticRangeSize(a,i,o)}}else t=n}),t}static getAutomaticRangeSize(e,t,i=!1){return i?this.getAutomaticRangeStyleLog(e,t.style.size,50,500):this.getAutomaticRangeStyleLinear(e,t.style.size,50,500)}all(e){if(!u.isDefined(e))return{color:E};const t=this.icon(e);return{radius:this.size(e),color:this.color(e),shape:this.shape(e),icon:t.icon,image:t.image}}static getImageUrlFromStyleRule(e,t,i){let n;return typeof e=="string"&&["imageUrl","image"].includes(u.getType(e))?n=e:typeof e=="object"&&(n=u.getIn(t,e.path)),n!==void 0&&i!==void 0?new URL(n,i).href:n}setBaseUrl(e){this._baseUrl=e}}var or=(r=>(r.AUTO_RANGE="autoRange",r))(or||{});class C{constructor(e){this.type=e.type,this.input=e.input,this.index=e.index,this.itemType=e.itemType,this.style=e.style,this.value=e.value}static isAutomaticRange(e){return e.style!==void 0&&(e.style.width!==void 0&&e.style.width.type==="autoRange"||e.style.size!==void 0&&e.style.size.type==="autoRange")}get specificity(){return this.itemType!==void 0&&this.input!==void 0?4:this.itemType===void 0&&this.input!==void 0?3:this.itemType!==void 0&&this.input===void 0?2:1}matchValues(e,t,i){return u.isDefined(t)?(e===this.itemType||!u.isDefined(this.itemType))&&u.isEqual(["properties",...t],this.input)&&u.isEqual(i,this.value)||this.type==="any"&&!u.isDefined(this.input)&&typeof this.style.color=="object"&&this.style.color.input[1]===t[0]:u.isDefined(this.itemType)?e===this.itemType&&!u.isDefined(this.input):!u.isDefined(this.input)}static inputExists(e,t){return e!==g.SelectorType.ANY}canApplyTo(e){const t="categories"in e?e.categories:[e.type];let i=!1;switch(this.type){case g.SelectorType.ANY:i=C.checkAny(e,this.style);break;case g.SelectorType.NO_VALUE:C.inputExists(this.type,this.input)&&(i=C.checkNoValue(e,this.input));break;case g.SelectorType.NAN:C.inputExists(this.type,this.input)&&(i=C.checkNan(e,this.input));break;case g.SelectorType.RANGE:C.inputExists(this.type,this.input)&&(i=C.checkRange(u.getIn(e,this.input),this.value));break;case g.SelectorType.IS:C.inputExists(this.type,this.input)&&(i=C.checkIs(e,this.input,this.value));break}return i&&C.checkItemType(t,this.itemType)}static checkAny(e,t){return typeof t.color=="object"?u.isDefined(u.getIn(e,t.color.input)):!0}static checkNoValue(e,t){return!u.valueExists(u.getIn(e,t))}static checkNan(e,t){return!u.isNumber(u.getIn(e,t))}static checkRange(e,t){return(t["<="]===void 0||e<=t["<="])&&(t["<"]===void 0||e<t["<"])&&(t[">"]===void 0||e>t[">"])&&(t[">="]===void 0||e>=t[">="])}static checkIs(e,t,i){if(!u.isDefined(t))return!1;const n=u.getIn(e,t);let s=n;if(u.isDefined(n)&&typeof n=="object"&&(n.type==="date"||n.type==="datetime")){let a=n.timezone;n.timezone==="Z"&&(a="+00:00"),s=u.formatDate(n.value,n.type==="datetime",u.timezoneToMilliseconds(a)/1e3)}return u.isEqual(s,i)}static checkItemType(e,t){return C.matchCategory(e,t)||C.matchAny(t)}static matchCategory(e,t){return u.isDefined(t)&&(Array.isArray(e)?e.includes(t):u.isEqual(e,t))}static matchAny(e){return e===void 0}getTypeColor(e){let t;return C.checkItemType([e],this.itemType)&&this.type===g.SelectorType.ANY&&!u.isDefined(this.input)&&(t=A.getTypeColor(this,e)),t}}var D=(r=>(r.COLOR="color",r.ICON="icon",r.SIZE="size",r.IMAGE="image",r.SHAPE="shape",r.WIDTH="width",r))(D||{});const z=["specificity","itemType","index"];class p{constructor(e){this._rules=e}get color(){return G(p.getBy("color",this._rules),z)}get icon(){return G([...p.getBy("icon",this._rules)||[],...p.getBy("image",this._rules)||[]],z)}get image(){return G(p.getBy("image",this._rules),z)}get shape(){return G(p.getBy("shape",this._rules),z)}get size(){return G(p.getBy("size",this._rules),z)}get width(){return G(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 h=o.style.image;p.updateLegend(n,{label:c,value:h})}}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 g.SelectorType.NO_VALUE:return"is undefined";case g.SelectorType.NAN:return"is not an number";case g.SelectorType.RANGE:return Object.keys(t).forEach((n,s)=>{s>0&&(i+=" and "),i+=`${n} ${t[n]}`}),i}return typeof t=="object"?`= ${JSON.stringify(t)}`:`= ${t}`}static addLegendAutoColors(e,t,i){const n=t.style.color,s=n.input[1];e.forEach(a=>{const o=u.getIn(a,n.input);if(Array.isArray(o))o.forEach(l=>{const c=n.input.includes("properties")?`${p.getTypeLabel(t.itemType)}.${s} = ${l}`:`${p.getTypeLabel(l)}`,d=A.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=A.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]:E}getIconForType(e){const t=this.icon.filter(i=>!u.isDefined(i.input)&&i.itemType===e).map(i=>{var n;return(n=i.style.icon)==null?void 0:n.content}).filter(i=>u.isDefined(i));return t.length>0?t[t.length-1]:void 0}static updateLegend(e,{label:t,value:i}){const n=e.map(s=>s.label).indexOf(t);n<0?e.push({label:t,value:i}):e[n]={label:t,value:i}}static getBy(e,t){return t.filter(i=>{switch(e){case"color":return i.style.color!==void 0;case"icon":return"icon"in i.style&&i.style.icon!==void 0;case"image":return"image"in i.style&&i.style.image!==void 0;case"shape":return i.style.shape!==void 0;case"size":return"size"in i.style&&i.style.size!==void 0;case"width":return"width"in i.style&&i.style.width!==void 0}}).map(i=>p.getRule(i,e))}static getRule(e,t){const i=u.clone(e);return i.style={[t]:i.style[t]},new C(i)}static sanitizeStylesIndex(e){const t=[],i=u.clone(e);let n=Math.max(...e.node.map(s=>s.index),...e.edge.map(s=>s.index))+1;return i.node=i.node.map(s=>(t.includes(s.index)?(s.index=n,n++):t.push(s.index),s)),i.edge=i.edge.map(s=>(t.includes(s.index)?(s.index=n,n++):t.push(s.index),s)),i}}const te={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)"}},ae="#3F3D5F",ur="'roboto', sans-serif",oe="#FFF",we=.2,Ot={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outerStroke:{width:2},outline:!1},Lt={text:{style:"bold",backgroundColor:"#fff",minVisibleSize:0},outline:!1},vg={color:"#FFF",width:7,scalingMethod:"scaled",strokeWidth:0,hideNonAdjacentEdges:!1},_g={color:"#FFF",scalingMethod:"scaled",width:4},It="#7f7f7f";class lr{constructor(e,t){this._nodeAttributes=new I({}),this._edgeAttributes=new B({}),this._ogma=e,this._defaultConfiguration=t,this._nodeAttributes.setBaseUrl(t.baseUrl)}get nodeAttributes(){return this._nodeAttributes}get nodeFont(){var e,t;return(t=(e=this._defaultConfiguration.node)==null?void 0:e.text)==null?void 0:t.font}setNodesDefaultStyles(){this._ogma.styles.setHoveredNodeAttributes(Ot),this._ogma.styles.setSelectedNodeAttributes(Ot),this._nodeDefaultStylesRules=this._ogma.styles.addRule({nodeAttributes:{text:{padding:5,minVisibleSize:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.minVisibleSize?this._defaultConfiguration.node.text.minVisibleSize:12,maxLineLength:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.maxLineLength!==void 0?this._defaultConfiguration.node.text.maxLineLength:30,position:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.nodePosition!==void 0?this._defaultConfiguration.node.text.nodePosition:"bottom",backgroundColor:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.backgroundColor!==void 0?this._defaultConfiguration.node.text.backgroundColor:void 0,font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:"'roboto', sans-serif",color:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.color!==void 0?this._defaultConfiguration.node.text.color:"black",size:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.size!==void 0?this._defaultConfiguration.node.text.size:14,margin:5},radius:this.defaultNodeRadius(this._defaultConfiguration.node),icon:{minVisibleSize:15},color:It,shape:this._defaultConfiguration.node.shape!==void 0?this._defaultConfiguration.node.shape:"circle",innerStroke:{width:3},outline:!1},nodeSelector:e=>!e.isVirtual()})}setEdgesDefaultStyles(){var e;this._ogma.styles.setHoveredEdgeAttributes(Lt),this._ogma.styles.setSelectedEdgeAttributes(Lt),this._edgeDefaultStylesRules=this._ogma.styles.addRule({edgeAttributes:{text:{minVisibleSize:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.minVisibleSize?this._defaultConfiguration.edge.text.minVisibleSize:3,maxLineLength:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.maxLineLength!==void 0?this._defaultConfiguration.edge.text.maxLineLength:30,backgroundColor:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.backgroundColor!==void 0?this._defaultConfiguration.edge.text.backgroundColor:void 0,font:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.font!==void 0?this._defaultConfiguration.edge.text.font:"'roboto', sans-serif",color:((e=this._defaultConfiguration.edge)==null?void 0:e.text)!==void 0&&this._defaultConfiguration.edge.text.color!==void 0?this._defaultConfiguration.edge.text.color:"black",size:this._defaultConfiguration.edge.text!==void 0&&this._defaultConfiguration.edge.text.size!==void 0?this._defaultConfiguration.edge.text.size:14},width:this.defaultEdgeWidth(this._defaultConfiguration.edge),shape:this._defaultConfiguration.edge.shape!==void 0?this._defaultConfiguration.edge.shape:"arrow",color:It}})}setNodesDefaultHalo(){this._nodeDefaultHaloRules=this._ogma.styles.addRule({nodeSelector:e=>e&&!e.hasClass("filtered")&&!e.isVirtual(),nodeAttributes:{halo:e=>e!==void 0&&!e.hasClass("filtered")&&(e.isSelected()||e.getAdjacentNodes({}).isSelected().includes(!0)||e.getAdjacentEdges().isSelected().includes(!0))?{...vg,scalingMethod:this._ogma.geo.enabled()?"fixed":"scaled"}:null},nodeDependencies:{self:{selection:!0},adjacentNodes:{selection:!0},adjacentEdges:{selection:!0}}})}setEdgesDefaultHalo(){this._edgeDefaultHaloRules=this._ogma.styles.addRule({edgeSelector:e=>e&&e.getSource()&&e.getTarget()&&!e.hasClass("filtered"),edgeAttributes:{halo:e=>e&&!e.hasClass("filtered")&&(e.isSelected()||e.getSource().isSelected()||e.getTarget().isSelected())?{..._g,scalingMethod:this._ogma.geo.enabled()?"fixed":"scaled"}:null},edgeDependencies:{self:{selection:!0},extremities:{selection:!0}}})}defaultNodeRadius(e){return this.defaultStylesHas(e,["nodeRadius"])?e.nodeRadius:5}defaultEdgeWidth(e){return this.defaultStylesHas(e,["edgeWidth"])?e.edgeWidth:1}defaultStylesHas(e,t){return u.isDefined(e)?u.getIn(e,t)!==void 0:!1}setFilterClass(){this._ogma.styles.createClass({name:"filtered",nodeAttributes:{opacity:we,layer:e=>e.getMetaNode()!==null?1:-1,detectable:!1,badges:{topRight:{text:null},bottomRight:{text:null}},text:null,color:"rgb(240, 240, 240)",innerStroke:{width:1,color:E,minVisibleSize:1},shape:"circle",image:null,icon:null,radius:"50%"},edgeAttributes:{opacity:we,layer:e=>{const t=e.getExtremities().getMetaNode().some(i=>i!==null);return!e.isVirtual()&&t?1:-1},detectable:!1,text:null,color:E,shape:"line",width:.2}})}setExportClass(e){this._exportClass?this._exportClass.update({nodeAttributes:{text:{maxLineLength:e?30:0},halo:null}}):this._exportClass=this._ogma.styles.createClass({name:"exported",nodeAttributes:{text:{minVisibleSize:0,size:12,maxLineLength:e?30:0},halo:null},edgeAttributes:{text:{minVisibleSize:0,size:12},halo:null}})}setBadgeRule(){this._ogma.styles.createClass({name:"degreeIndicator",nodeAttributes:{badges:{bottomLeft:e=>{if(e!==void 0){const t=u.getHiddenNeighbors(e.toList()),i=u.formatNumber(t);if(t>0){const n=e.getData(["statistics","supernode"]);let s=null;return+i!=0&&(s=n?i+"+":i),{color:ae,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:this._defaultConfiguration.node.text!==void 0&&this._defaultConfiguration.node.text.font!==void 0?this._defaultConfiguration.node.text.font:ur,scale:.4,color:oe,content:s}}}}}}}}),this._ogma.events.on("addNodes",e=>e.nodes.addClass("degreeIndicator"))}async refreshPinBadgeStyleRule(){u.isDefined(this._pinnedIndicatorRule)?(await this._pinnedIndicatorRule.refresh(),this._pinnedIndicatorRule.update({priority:100})):(this._pinnedIndicatorRule=this._ogma.styles.addRule({nodeSelector:e=>!e.getAttribute("layoutable"),nodeAttributes:{badges:{topRight:e=>({color:ae,minVisibleSize:20,scale:this._findPinBadgeScale(e),stroke:{width:2,color:"#FFFFFF"},text:{font:"FontAwesome",scale:.4,color:oe,content:""}})}},nodeDependencies:{self:{attributes:["layoutable"]}}}),this._pinnedIndicatorRule.update({priority:100}))}toggleTextOverlap(e){this._ogma.setOptions({texts:{preventOverlap:e}})}refreshRules(){this._nodeDefaultStylesRules.refresh(),this._edgeDefaultStylesRules.refresh()}refreshNodeColors(e){u.isDefined(this._ogmaNodeColor)?(this._nodeAttributes.refresh({color:e}),this._ogmaNodeColor.refresh()):(this._nodeAttributes.refresh({color:e}),this._ogmaNodeColor=this._ogma.styles.addRule({nodeAttributes:{color:t=>{if(t!==void 0)return this._nodeAttributes.color(t.getData())}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}getStyleRule(e,t){return new p(e)[t]}initNodeColors(e){const t=this.getStyleRule(e,D.COLOR);this.refreshNodeColors(t)}initNodesIcons(e){const t=this.getStyleRule(e,D.ICON);this.refreshNodeIcons(t)}initNodesSizes(e){const t=this.getStyleRule(e,D.SIZE);this.refreshNodeSize(t)}initNodesShapes(e){const t=this.getStyleRule(e,D.SHAPE);this.refreshNodeShape(t)}initEdgesWidth(e){const t=this.getStyleRule(e,D.WIDTH);this.refreshEdgeWidth(t)}initEdgesShape(e){const t=this.getStyleRule(e,D.SHAPE);this.refreshEdgeShape(t)}initEdgesColor(e){const t=this.getStyleRule(e,D.COLOR);this.refreshEdgeColors(t)}refreshNodeIcons(e){u.isDefined(this._ogmaNodeIcon)?(this._nodeAttributes.refresh({icon:e}),this._ogmaNodeIcon.refresh()):(this._nodeAttributes.refresh({icon:e}),this._ogmaNodeIcon=this._ogma.styles.addRule({nodeAttributes:{icon:t=>{if(t!==void 0)return this._nodeAttributes.icon(t.getData()).icon},image:t=>{if(t!==void 0&&!t.isVirtual())return this._nodeAttributes.icon(t.getData()).image}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}refreshNodeSize(e){u.isDefined(this._ogmaNodeSize)?(this._nodeAttributes.refresh({size:e}),this._ogmaNodeSize.refresh()):(this._nodeAttributes.refresh({size:e}),this._ogmaNodeSize=this._ogma.styles.addRule({nodeAttributes:{radius:t=>{if(t!==void 0)return this._nodeAttributes.size(t.getData())}},nodeDependencies:{self:{data:!0}},nodeSelector:t=>!t.isVirtual()}))}refreshNodeShape(e){u.isDefined(this._ogmaNodeShape)?(this._nodeAttributes.refresh({shape:e}),this._ogmaNodeShape.refresh()):(this._nodeAttributes.refresh({shape:e}),this._ogmaNodeShape=this._ogma.styles.addRule({nodeAttributes:{shape:t=>{if(t!==void 0)return this._nodeAttributes.shape(t.getData())}},nodeSelector:t=>t!==void 0&&!t.isVirtual(),nodeDependencies:{self:{data:!0}}}))}refreshEdgeColors(e){u.isDefined(this._ogmaEdgeColor)?(this._edgeAttributes.refresh({color:e}),this._ogmaEdgeColor.refresh()):(this._edgeAttributes.refresh({color:e}),this._ogmaEdgeColor=this._ogma.styles.addRule({edgeAttributes:{color:t=>{if(t!==void 0)return this._edgeAttributes.color(t.getData())}},edgeDependencies:{self:{data:!0}}}))}refreshEdgeWidth(e){u.isDefined(this._ogmaEdgeWidth)?(this._edgeAttributes.refresh({width:e}),this._ogmaEdgeWidth.refresh()):(this._edgeAttributes.refresh({width:e}),this._ogmaEdgeWidth=this._ogma.styles.addRule({edgeAttributes:{width:t=>{if(t!==void 0)return this._edgeAttributes.width(t.getData())}},edgeDependencies:{self:{data:!0}}}))}refreshEdgeShape(e){u.isDefined(this._ogmaEdgeShape)?(this._edgeAttributes.refresh({shape:e}),this._ogmaEdgeShape.refresh()):(this._edgeAttributes.refresh({shape:e}),this._ogmaEdgeShape=this._ogma.styles.addRule({edgeAttributes:{shape:t=>{if(t!==void 0)return this._edgeAttributes.shape(t.getData())}},edgeDependencies:{self:{data:!0}}}))}_findPinBadgeScale(e){return this._getNodeRadius(e)*.46>5?.17:.46}_getNodeRadius(e){return!e.isVirtual()||P.isGroupCollapsed(e)?e.getAttribute("radius"):this._ogma.transformations.getXYR(e.toList())[0].radius}}class cr{constructor(e,t,i){this._nodeMaxTextLength=t,this._edgeMaxTextLength=i,this._captionSchema={node:{},edge:{}},this._graphSchema={node:[],edge:[]},this._ogma=e}set graphSchema(e){this._graphSchema=e}refreshSchema(e){this._captionSchema=e}async initVizCaptions(e){this._ogma.LKCaptions.nodesCaptionsRule?(this._ogma.LKCaptions.refreshSchema(e),await this._ogma.LKCaptions.updateNodeCaptions()):this._ogma.LKCaptions.updateNodeCaptions(e.node),this._ogma.LKCaptions.edgesCaptionsRule?(this._ogma.LKCaptions.refreshSchema(e),await this._ogma.LKCaptions.updateEdgeCaptions()):this._ogma.LKCaptions.updateEdgeCaptions(e.edge)}updateNodeCaptions(e){if(e&&(this._captionSchema.node=e),!u.isDefined(this.nodesCaptionsRule))this.nodesCaptionsRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:t=>{if(t===void 0)return"";const i=F.getText(t.getData(),this._captionSchema.node,this._graphSchema.node);return u.isDefined(this._nodeMaxTextLength)?u.truncate(i,"middle",this._nodeMaxTextLength):i}}},nodeSelector:t=>!t.isVirtual(),nodeDependencies:{self:{data:!0}}});else return this.nodesCaptionsRule.refresh()}updateEdgeCaptions(e){if(e&&(this._captionSchema.edge=e),!u.isDefined(this.edgesCaptionsRule))this.edgesCaptionsRule=this._ogma.styles.addRule({edgeAttributes:{text:{content:t=>{if(t===void 0||t.getData()===void 0)return"";const i=F.getText(t.getData(),this._captionSchema.edge,this._graphSchema.edge);return u.isDefined(this._edgeMaxTextLength)?u.truncate(i,"middle",this._edgeMaxTextLength):i}}},edgeSelector:t=>!t.isVirtual(),edgeDependencies:{self:{data:!0,attributes:["shape.style"]}}});else return this.edgesCaptionsRule.refresh()}}function R(r){return typeof r=="function"}function mg(r){return R(r==null?void 0:r.lift)}function dr(r){return function(e){if(mg(e))return e.lift(function(t){try{return r(t,this)}catch(i){this.error(i)}});throw new TypeError("Unable to lift unknown Observable type")}}var Oe=function(r,e){return Oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},Oe(r,e)};function Ye(r,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Oe(r,e);function t(){this.constructor=r}r.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function Pt(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],i=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&i>=r.length&&(r=void 0),{value:r&&r[i++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Le(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var i=t.call(r),n,s=[],a;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)s.push(n.value)}catch(o){a={error:o}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(a)throw a.error}}return s}function Ie(r,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,s;i<n;i++)(s||!(i in e))&&(s||(s=Array.prototype.slice.call(e,0,i)),s[i]=e[i]);return r.concat(s||Array.prototype.slice.call(e))}function Sg(r){var e=function(i){Error.call(i),i.stack=new Error().stack},t=r(e);return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var Ae=Sg(function(r){return function(t){r(this),this.message=t?t.length+` errors occurred during unsubscription:
2
- `+t.map(function(i,n){return n+1+") "+i.toString()}).join(`
3
- `):"",this.name="UnsubscriptionError",this.errors=t}});function Rt(r,e){if(r){var t=r.indexOf(e);0<=t&&r.splice(t,1)}}var We=function(){function r(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return r.prototype.unsubscribe=function(){var e,t,i,n,s;if(!this.closed){this.closed=!0;var a=this._parentage;if(a)if(this._parentage=null,Array.isArray(a))try{for(var o=Pt(a),l=o.next();!l.done;l=o.next()){var 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(R(d))try{d()}catch(b){s=b instanceof Ae?b.errors:[b]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var f=Pt(h),v=f.next();!v.done;v=f.next()){var S=v.value;try{Mt(S)}catch(b){s=s??[],b instanceof Ae?s=Ie(Ie([],Le(s)),Le(b.errors)):s.push(b)}}}catch(b){i={error:b}}finally{try{v&&!v.done&&(n=f.return)&&n.call(f)}finally{if(i)throw i.error}}}if(s)throw new Ae(s)}},r.prototype.add=function(e){var t;if(e&&e!==this)if(this.closed)Mt(e);else{if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e)}},r.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},r.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},r.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&Rt(t,e)},r.prototype.remove=function(e){var t=this._finalizers;t&&Rt(t,e),e instanceof r&&e._removeParent(this)},r.EMPTY=function(){var e=new r;return e.closed=!0,e}(),r}();We.EMPTY;function Cg(r){return r instanceof We||r&&"closed"in r&&R(r.remove)&&R(r.add)&&R(r.unsubscribe)}function Mt(r){R(r)?r():r.unsubscribe()}var Ag={setTimeout:function(r,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return setTimeout.apply(void 0,Ie([r,e],Le(t)))},clearTimeout:function(r){return clearTimeout(r)},delegate:void 0};function Eg(r){Ag.setTimeout(function(){throw r})}function Gt(){}var gr=function(r){Ye(e,r);function e(t){var i=r.call(this)||this;return i.isStopped=!1,t?(i.destination=t,Cg(t)&&t.add(i)):i.destination=$g,i}return e.create=function(t,i,n){return new Fg(t,i,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,r.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(We),xg=function(){function r(e){this.partialObserver=e}return r.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(i){ee(i)}},r.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(i){ee(i)}else ee(e)},r.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(t){ee(t)}},r}(),Fg=function(r){Ye(e,r);function e(t,i,n){var s=r.call(this)||this,a;return R(t)||!t?a={next:t??void 0,error:i??void 0,complete:n??void 0}:a=t,s.destination=new xg(a),s}return e}(gr);function ee(r){Eg(r)}function Tg(r){throw r}var $g={closed:!0,next:Gt,error:Tg,complete:Gt};function Ng(r){return r}function hr(r,e,t,i,n){return new Dg(r,e,t,i,n)}var Dg=function(r){Ye(e,r);function e(t,i,n,s,a,o){var l=r.call(this,t)||this;return l.onFinalize=a,l.shouldUnsubscribe=o,l._next=i?function(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}(gr);function wg(r,e){return dr(function(t,i){var n=0;t.subscribe(hr(i,function(s){i.next(r.call(e,s,n++))}))})}function Og(r,e){return e===void 0&&(e=Ng),r=r??Lg,dr(function(t,i){var n,s=!0;t.subscribe(hr(i,function(a){var o=e(a);(s||!r(n,o))&&(s=!1,n=o,i.next(a))}))})}function Lg(r,e){return r===e}class fr extends Sr.BehaviorSubject{constructor(e){super(e)}dispatch(e){this.next(e(this.value))}selectStore(e){return this.pipe(wg(e),Og((t,i)=>u.isEqual(t,i)))}clear(){this.next({selection:void 0,items:{node:[],edge:[]},changes:void 0,animation:!1})}}class Ig{constructor(e){this._store=new fr({selection:void 0,items:{node:[],edge:[]},changes:void 0,animation:!1}),this._ogma=e,this.listenToSelectionEvents()}get store(){return this._store}listenToSelectionEvents(){let e=Date.now(),t=!1;this._ogma.events.on("animate",i=>{if(i.updatesPositions===!1)return;t||(t=!0,this._store.dispatch(a=>({...a,animation:!0})));const n=Math.max(e,Date.now()+i.duration);if(n===e)return;e=n;const s=e-Date.now()+16;clearTimeout(this._animationThrottle),this._animationThrottle=setTimeout(()=>{t=!1,this._store.dispatch(a=>({...a,animation:!1}))},s)}),this._ogma.events.on("dragStart",()=>{this._store.dispatch(i=>({...i,animation:!0}))}),this._ogma.events.on("dragEnd",()=>{this._store.dispatch(i=>({...i,animation:!1}))}),this._ogma.events.on("addNodes",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("removeNodes",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("addEdges",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("removeEdges",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("geoDisabled",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("geoEnabled",()=>{this._store.dispatch(this.storeItems.bind(this))}),this._ogma.events.on("nodesSelected",()=>{this._store.dispatch(this.storeNodeSelection.bind(this))}),this._ogma.events.on("edgesSelected",()=>{this._store.dispatch(this.storeEdgeSelection.bind(this))}),this._ogma.events.on("nodesUnselected",()=>{this._store.dispatch(this.storeNodeSelection.bind(this))}),this._ogma.events.on("edgesUnselected",()=>{this._store.dispatch(this.storeEdgeSelection.bind(this))}),this._ogma.events.on("updateNodeData",i=>{i!==void 0&&i.changes.forEach(n=>{this._store.dispatch(s=>({...s,changes:{entityType:"node",input:n.property,value:n.newValues[0]}}))})}),this._ogma.events.on("updateEdgeData",i=>{i!==void 0&&i.changes.forEach(n=>{this._store.dispatch(s=>({...s,changes:{entityType:"edge",input:n.property,value:n.newValues[0]}}))})})}storeItems(e){return{...e,items:{node:this._ogma.getNodes().getId(),edge:this._ogma.getEdges().getId()}}}storeNodeSelection(e){return{...e,selection:this._ogma.getSelectedNodes()}}storeEdgeSelection(e){return{...e,selection:this._ogma.getSelectedEdges()}}}const pr=750;class Pg extends mr{constructor(e,t){super(e),this._configuration=e,Object.setPrototypeOf(this,new.target.prototype),this.initOgmaLinkuriousParser(!0,t)}initOgmaLinkuriousParser(e,t){this.nodeCategoriesWatcher=this.schema.watchNodeNonObjectProperty({path:"categories",unwindArrays:!0,filter:"all"}),this.edgeTypeWatcher=this.schema.watchEdgeNonObjectProperty({path:"type",filter:"all"}),this.setOptions({interactions:{zoom:{maxValue:i=>128/i.smallestNodeSize},selection:{enabled:!1}}}),this._reactive===void 0?(this._reactive=new Ig(this),this.store=this._reactive.store):this._reactive.listenToSelectionEvents(),this.initSelection(),this.setConfigOgma(this._configuration,e,t),this.LKTransformation=new yr(this),this.LkNodeGroupingTransformation=new q(this),this.LKStyles.setNodesDefaultHalo(),this.LKStyles.setEdgesDefaultHalo(),this.LKStyles.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 lr(this,{node:((n=(i=e==null?void 0:e.options)==null?void 0:i.styles)==null?void 0:n.node)||{},edge:((a=(s=e==null?void 0:e.options)==null?void 0:s.styles)==null?void 0:a.edge)||{},baseUrl:t}),this.LKStyles.setNodesDefaultStyles(),this.LKStyles.setEdgesDefaultStyles()}setCaptions(e){var n,s,a,o,l,c,d,h;const t=(o=(a=(s=(n=e==null?void 0:e.options)==null?void 0:n.styles)==null?void 0:s.node)==null?void 0:a.text)==null?void 0:o.maxTextLength,i=(h=(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:h.maxTextLength;this.LKCaptions=new cr(this,t,i)}getForceLayoutParams(e,t=0){let i=300-.052*this.getNodes().size;return i<40&&(i=40),{steps:e===g.ForceLayoutMode.FAST?i:300,alignSiblings:this.getNodes().size>3,duration:t,charge:20,gravity:.08,theta:this.getNodes().size>100?.8:.34}}getRadialLayoutParams(e,t=0){return{centralNode:e,radiusDelta:1,nodeGap:10,repulsion:this.getNodes().size>80?1:6,duration:t}}getHierarchicalLayoutParams(e,t,i=0){return{direction:e,roots:[t],duration:i}}async init(e){this.clearGraph();let t,i=[];const n=e.nodes.map(a=>(a.attributes.selected&&(t=g.EntityType.NODE,i.push(a.id)),delete a.attributes.selected,a)),s=e.edges.map(a=>(a.attributes!==void 0&&(a.attributes.selected&&((t===void 0||t===g.EntityType.NODE)&&(t=g.EntityType.EDGE,i=[]),i.push(a.id)),delete a.attributes.selected),a));await this.addGraphAfterValidation({nodes:n,edges:s}),t===g.EntityType.NODE?this.getNodes(i).setSelected(!0):t===g.EntityType.EDGE&&this.getEdges(i).setSelected(!0)}async initVisualization(e){await this.init(e);const t=p.sanitizeStylesIndex(e.design.styles);this.LKStyles.initNodeColors(t.node),this.LKStyles.initNodesIcons(t.node),this.LKStyles.initNodesSizes(t.node),this.LKStyles.initNodesShapes(t.node),this.LKStyles.initEdgesWidth(t.edge),this.LKStyles.initEdgesShape(t.edge),this.LKStyles.initEdgesColor(t.edge),await this.LKCaptions.initVizCaptions({node:e.nodeFields.captions||{},edge:e.edgeFields.captions||{}}),this.LKTransformation.groupedEdges=e.edgeGrouping,await this.LKTransformation.initTransformation(),this.LKTransformation.initEdgeGroupingStyle()}async addGraphAfterValidation(e){const t=await this.addNodes(e.nodes),i=await this.addEdges(e.edges);return{nodes:t,edges:i}}addEdges(e,t){return super.addEdges(e,{...t,ignoreInvalid:!0})}getNonFilteredNodes(e){return u.isDefined(e)?this.getNodes(e).filter(t=>!t.hasClass("filtered")):this.getNodes("raw").filter(t=>!t.hasClass("filtered"))}getFilteredNodes(e,t="raw"){return u.isDefined(e)?this.getNodes(e).filter(i=>i.hasClass("filtered")):this.getNodes(t).filter(i=>i.hasClass("filtered"))}getNonFilteredEdges(e){return u.isDefined(e)?this.getEdges(e).filter(t=>!t.hasClass("filtered")):this.getEdges("raw").filter(t=>!t.hasClass("filtered"))}getFilteredEdges(e,t="raw"){return u.isDefined(e)?this.getEdges(e).filter(i=>i.hasClass("filtered")):this.getEdges(t).filter(i=>i.hasClass("filtered"))}shutDown(){this.destroy(),this.store&&this.store.clear()}clearOgmaState(){this.reset(),this.store&&this.store.clear(),this.initOgmaLinkuriousParser()}setConfigOgma(e,t,i){e&&(this._configuration=e),t||this.setOptions({...this._configuration.options,renderer:this._configuration.renderer}),this.setStyles(this._configuration,i),this.setCaptions(this._configuration)}getSelectedNodes(){return this.getNodes("all").filter(e=>e.isSelected())}clearSelection(){this.getSelectedNodes().setSelected(!1),this.getSelectedEdges().setSelected(!1)}}const br={steps:250,alignSiblings:!0,charge:20,theta:.34,duration:pr,gravity:.0475,gpu:!0};class P{static getHiddenNeighbors(e){return e.reduce((t,i)=>{const n=i.getData("statistics");if(n!==void 0){const s=n.degree!==void 0&&!n.supernode?n.degree-u.getDegreeWithoutSelfConnection(i):n.supernodeDegree;if(s!==void 0&&s>0)return t+=s}return t},0)}static getDegreeWithoutSelfConnection(e){return e.getAdjacentNodes({policy:"exclude-sources",filter:"all"}).size}static isBright(e){if(e===null||!u.isStringFilled(e))return!0;const t=/#[A-Fa-f0-9]{3,6}/,i=/^rgb\(\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*\)$/i,n=/^rgba\(\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*([01]?\d\d?|2[0-4]\d|25[0-5])\s*,\s*(?:0|1|0?\.\d+)\s*\)$/i;let s;if(t.test(e)){e.length<5&&(e+=e.slice(1)),e=e.replace("#","");const c=parseInt(e[0].toString()+e[1].toString(),16),d=parseInt(e[2].toString()+e[3].toString(),16),h=parseInt(e[4].toString()+e[5].toString(),16);s=`rgb(${c}, ${d}, ${h})`}else if(i.test(e)||n.test(e)||te[e.toLowerCase()]!==void 0)s=u.isDefined(te[e.toLowerCase()])?te[e.toLowerCase()].rgb:e;else return!0;const[a,o,l]=/rgba?\((\d{1,3}),(\d{1,3}),(\d{1,3})(,(?:0|1|0?\.\d+))?\)/.exec(s.replace(/\s/g,"")).slice(1,4);return!u.isDefined(a)||!u.isDefined(o)||!u.isDefined(l)?(console.warn("The given color is not a valid rgb formatted color"),!0):(+a*299+ +o*587+ +l*114)/1e3>255*.7}static isNode(e){return e.isNode}static isNodeList(e){return e.isNode}static topologicalSort(e){const i=e.toArray().filter(a=>a.getDegree()===1),n=new Set,s=[];return i.forEach(a=>{let o=a;if(n.has(o))return;const l=[];for(;o;){l.push(o),n.add(o);const c=o.getAdjacentNodes().filter(d=>!n.has(d)).get(0);o=c===void 0?null:c}s.push(l)}),s.sort((a,o)=>o.length-a.length),{chain:s.flat().map(a=>a.getId()),numberOfChain:i.length/2}}static isStar(e){for(const t of e.toArray()){const i=t.getAdjacentNodes();if(t.getDegree()>2&&i.getDegree().every(s=>s===1)&&i.size+1===e.size)return t}return!1}static isGroupCollapsed(e){return e.getData("collapsed")}static setCollapsedGroupProperty(e,t){e.setData("collapsed",t)}}const ue="LKE_NODE_GROUPING_EDGE";class q{constructor(e){this._collapsedDefaultValue=!1,this._nodeGroupingAttributes=[],this._ogma=e}setGroupingRule(e){this.groupRule=e}async initTransformation(){this.transformation===void 0?this.transformation=this._ogma.transformations.addNodeGrouping({groupIdFunction:e=>{if(this._isRuleNotApplicableToNode(e))return;const t=this.groupRule;return t.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._getAdjacentEdgeGroupId(e,t):this._getPropertyValueGroupId(e,t)},nodeGenerator:e=>{const t=new Set(e.getData("categories").flat()),i=this._findNodeGroupId(e);return{data:{categories:[],subCategories:Array.from(t),collapsed:this._getDefaultCollapsedState(i),nodeGroupId:i},attributes:{layoutable:this._getDefaultLayoutableValue(i)}}},onGroupUpdate:(e,t)=>{if(t.size!==1)return{layout:"force",params:{...br}}},edgeGenerator:()=>({data:{type:ue}}),showContents:e=>!P.isGroupCollapsed(e),duration:300,padding:10}):await this.refreshTransformation(),await this._ogma.transformations.afterNextUpdate()}async refreshTransformation(){this.transformation!==void 0?(await this.transformation.refresh(),await this._unpinNodes(this._getAllTransformationRawNodes())):await this.initTransformation()}initNodeGroupingStyle(){this._nodeGroupingStyleRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:e=>this._getNodeGroupingCaption(e),style:"bold"},layer:-1,color:"rgba(240, 240, 240)",innerStroke:{color:"#7f7f7f",width:2}},nodeSelector:e=>e.isVirtual()&&!P.isGroupCollapsed(e),nodeDependencies:{self:{data:!0}}}),this._initIntermediateGroupStyle(),this._nodeGroupingCollapsedStyleRule=this._ogma.styles.addRule({nodeAttributes:{text:{content:e=>this._getNodeGroupingCaption(e),style:"bold"},halo:{width:4,color:"#e4ebea",strokeColor:"#ccc"},badges:{bottomLeft:e=>{var i;const t=(i=e.getSubNodes().filter(n=>!n.hasClass("filtered")))==null?void 0:i.size;return{color:ae,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:u.isDefined(this._ogma.LKStyles.nodeFont)?this._ogma.LKStyles.nodeFont:ur,scale:.4,color:oe,content:`x${t}`}}},topLeft:()=>({color:ae,minVisibleSize:20,stroke:{width:2,color:"#FFFFFF"},text:{font:"FontAwesome",scale:.4,color:oe,content:""}})},color:e=>{if(e!==void 0)return this._ogma.LKStyles.nodeAttributes.color({geo:{},isVirtual:!1,properties:{},readAt:0,categories:e.getData("subCategories")})},icon:e=>{const t=e==null?void 0:e.getData("subCategories");if(!(!u.isDefined(e)||t.length>1))return this._ogma.LKStyles.nodeAttributes.icon({geo:{},isVirtual:!1,properties:{},readAt:0,categories:t}).icon}},nodeSelector:e=>e.isVirtual()&&P.isGroupCollapsed(e)&&!e.hasClass("filtered")}),this._setSubSelectedClass()}async refreshNodeGroupingStyle(){var e,t;await((e=this._nodeGroupingStyleRule)==null?void 0:e.refresh()),await((t=this._nodeGroupingCollapsedStyleRule)==null?void 0:t.refresh())}getVirtualNodesOfTransformation(){return this.transformation.getContext().metaNodes}setNodeGroupingAttributes(e){this._nodeGroupingAttributes=e}setCollapseDefaultValue(e){this._collapsedDefaultValue=e}_getNodeGroupingCaption(e){if(!(!u.isDefined(e)||!u.isDefined(this.groupRule)))return this.groupRule.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._getAdjacentEdgeNodeGroupingCaption(e,this.groupRule):this._getPropertyValueNodeGroupingCaption(e,this.groupRule)}_getAdjacentEdgeNodeGroupingCaption(e,t){const i=e.getSubNodes();return!u.isDefined(i)||!u.isDefined(i.get(0))?void 0:q._getGroupCentralNode(i.get(0),t).getData(["properties","name"])}_getPropertyValueNodeGroupingCaption(e,t){var i;if(e.isVirtual()&&((i=e.getSubNodes())==null?void 0:i.get(0))!==void 0){const n=e.getSubNodes().get(0).getData(["properties",t.groupingOptions.propertyKey]),s=u.getValueFromLkProperty(n),a=e.getSubNodes().filter(o=>!o.hasClass("filtered")).size;return`${s} (${a})`}}_isRuleNotApplicableToNode(e){const t=this.groupRule;return t===void 0?!0:t.groupingType===g.NodeGroupingType.BY_PROPERTY_VALUE?this._isPropertyRuleNotApplicableToNode(e,t):t.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE?this._isRelationshipRuleNotApplicableToNode(e,t):!0}_isRelationshipRuleNotApplicableToNode(e,t){return!this._hasEdgeOfType(e,t.groupingOptions.edgeType)}_hasEdgeOfType(e,t){let i=!1;return e.getAdjacentEdges().forEach(n=>{n.getData("type")===t&&(i=!0)}),i}_isPropertyRuleNotApplicableToNode(e,t){const i=e.getData(["properties",t.groupingOptions.propertyKey??""]);return t.groupingOptions.itemTypes.every(n=>!e.getData("categories").includes(n))||!u.isDefined(i)||typeof i=="object"&&i.status==="missing"}async _unpinNodes(e){await Promise.all(e.map(t=>{if(t!==null)return t.setAttribute("layoutable",!0)}))}_getAllTransformationRawNodes(){return this.getVirtualNodesOfTransformation().getSubNodes()}_findGroupingPropertyValue(e){const t=this.groupRule,i=e.getData(["properties",t.groupingOptions.propertyKey??""]);return`${u.getValueFromLkProperty(i)}`}_findNodeGroupId(e){var i;const t=this.groupRule;if(t.groupingType===g.NodeGroupingType.BY_ADJACENT_EDGE_TYPE){const n=q._getGroupCentralNode(e.get(0),t);return se(`${(i=this.groupRule)==null?void 0:i.name}-${n.getId()}`)}else{const n=this._findGroupingPropertyValue(e.get(0));return se(`${t.name}-${t.groupingOptions.itemTypes.join("-")}-${n}`)}}static _getGroupCentralNode(e,t){const i=e.getAdjacentEdges({filter:"raw"}).filter(n=>n.getData("type")===t.groupingOptions.edgeType).get(0);return t.groupingOptions.centralNodeIs==="source"?i.getSource():i.getTarget()}_getPropertyValueGroupId(e,t){const i=this._findGroupingPropertyValue(e);return`${t.groupingOptions.itemTypes.join("-")}-${i}`.toLowerCase().trim()}_getAdjacentEdgeGroupId(e,t){return q._getGroupCentralNode(e,t).getId().toString()}_initIntermediateGroupStyle(){this._ogma.styles.addRule({nodeAttributes:{color:"rgba(240, 240, 240)"},nodeSelector:e=>e.isVirtual()&&P.isGroupCollapsed(e),nodeDependencies:{self:{data:!0}}})}_getDefaultCollapsedState(e){const t=this._nodeGroupingAttributes.find(i=>i.id===e);return u.isDefined(t)&&u.isDefined(t.attributes.collapsed)?t.attributes.collapsed:this._collapsedDefaultValue}_getDefaultLayoutableValue(e){const t=this._nodeGroupingAttributes.find(i=>i.id===e);return u.isDefined(t)&&u.isDefined(t.attributes.layoutable)?t.attributes.layoutable:!0}_setSubSelectedClass(){this._ogma.styles.createClass({name:"subSelection",nodeAttributes:{halo:{width:4,color:"#e67a8f",strokeColor:"#ccc"}}})}}const Rg={color:"#000000",shape:{style:"dashed",head:"arrow"},width:1.5};class yr{constructor(e){this._ogma=e,this.groupedEdges={}}async initTransformation(){this.transformation===void 0?this.transformation=this._ogma.transformations.addEdgeGrouping({separateEdgesByDirection:!0,selector:e=>this.groupedEdges[e.getData("type")],groupIdFunction:e=>e.getData("type"),generator:e=>({data:{properties:{originalType:e.getData("type")[0]}}})}):await this.transformation.refresh()}initEdgeGroupingStyle(){this.edgeGroupingStyleRule=this._ogma.styles.addRule({edgeAttributes:{...Rg,...this.edgeGroupStyle,text:{content:e=>{if(e!==void 0&&e.getSubEdges()!==null&&e.getData("type")!==ue){const t=e.getSubEdges().filter(i=>!i.hasClass("filtered")).size;return`${e.getData(["properties","originalType"])} (${t})`}},style:"bold"}},edgeSelector:e=>e.isVirtual()&&e.getSubEdges()&&e.getSubEdges().filter(t=>!t.hasClass("filtered")).size>0&&e.getData("type")!==ue,edgeDependencies:{self:{data:!0}}})}refreshEdgeGroupingStyle(){this.edgeGroupingStyleRule!==void 0&&this.edgeGroupingStyleRule.refresh()}}const _=class _{static isFiltered(e,t){return u.isDefined(t)?"categories"in t?_.getFilterFunction(e,!0)(t):_.getFilterFunction(e,!1)(t):!1}static getFilterFunction(e,t){const i=JSON.stringify(e,null,""),n=t?_.nodeCache:_.edgeCache;let s=n.get(i);return s||(s=_.createFilterFunction(e,t),n.size>_.FILTER_CACHE_SIZE&&n.clear(),n.set(i,s)),s}static createFilterFunction(e,t){const i=e.map(n=>_.filterToFilterFunction(n,t));return n=>{for(const s of i)if(s(n))return!0;return!1}}static filterToFilterFunction(e,t){switch(e.type){case g.SelectorType.ANY:return _.createAnyFilterFunction(e,t);case g.SelectorType.IS:return _.createIsFilterFunction(e,t);case g.SelectorType.NO_VALUE:return _.createNoValueFilterFunction(e,t);case g.SelectorType.RANGE:return _.createRangeFilterFunction(e,t);case g.SelectorType.NAN:return _.createNaNFilterFunction(e,t)}}static createAnyFilterFunction(e,t){return t?i=>e.itemType===void 0?!0:i.categories.includes(e.itemType):i=>i.type===e.itemType}static createIsFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&u.getPropertyValue(u.getIn(i,e.input),!0)===e.value:i=>i.type===e.itemType&&u.getPropertyValue(u.getIn(i,e.input),!0)===e.value}static createNoValueFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&!u.isDefined(u.getPropertyValue(u.getIn(i,e.input),!0)):i=>i.type===e.itemType&&!u.isDefined(u.getPropertyValue(u.getIn(i,e.input),!0))}static createNaNFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&_.isNotANumber(u.getPropertyValue(u.getIn(i,e.input),!0)):i=>i.type===e.itemType&&_.isNotANumber(u.getPropertyValue(u.getIn(i,e.input),!0))}static isNotANumber(e){return u.isDefined(e)&&!u.isNumber(e)}static createRangeFilterFunction(e,t){return t?i=>i.categories.includes(e.itemType)&&_.valueShouldBeHidden(u.getPropertyValue(u.getIn(i,e.input),!1),e.value):i=>i.type===e.itemType&&_.valueShouldBeHidden(u.getPropertyValue(u.getIn(i,e.input),!1),e.value)}static valueShouldBeHidden(e,t){const i=u.parseFloat(e);return Number.isNaN(i)?!1:t["<"]!==void 0&&i<t["<"]||t["<="]!==void 0&&i<=t["<="]||t[">"]!==void 0&&i>t[">"]||t[">="]!==void 0&&i>=t[">="]}};_.nodeCache=new Map,_.edgeCache=new Map,_.FILTER_CACHE_SIZE=5;let Pe=_;const Mg=r=>r.selection.size,Gg=r=>{switch(r.selection.size){case 1:return"selection";case 0:return"noSelection";default:return"multiSelection"}},zg=r=>{if(!(!u.isDefined(r.selection)||r.selection.size===0))return r.selection.isNode?g.EntityType.NODE:g.EntityType.EDGE},ve=r=>u.isDefined(r.selection)&&r.selection.size===1?r.selection.get(0):void 0,Bg=r=>{const e=ve(r);if(e!==void 0)return e.isNode?e.getData("categories"):[e.getData("type")]},Ug=r=>{const e=ve(r);if(e!==void 0)return e.isNode?"node":"edge"},vr=r=>{const e=ve(r);if(e!==void 0){const t=e.getData().properties;return Object.keys(t).map(i=>({key:i,value:t[i]}))}return[]},jg=r=>vr(r).length>0;exports.ANIMATION_DURATION=pr;exports.BASE_GREY=E;exports.Captions=F;exports.CaptionsViz=cr;exports.EdgeAttributes=B;exports.FILTER_OPACITY=we;exports.FORCE_LAYOUT_CONFIG=br;exports.Filters=Pe;exports.HTML_COLORS=te;exports.ItemAttributes=A;exports.LKE_NODE_GROUPING_EDGE=ue;exports.LKOgma=Pg;exports.NodeAttributes=I;exports.OgmaStore=fr;exports.OgmaTools=P;exports.PALETTE=De;exports.StyleRule=C;exports.StyleRuleType=or;exports.StyleRules=p;exports.StyleType=D;exports.StylesViz=lr;exports.Tools=u;exports.TransformationsViz=yr;exports.getSelectionEntity=zg;exports.getSelectionProperties=vr;exports.getSelectionSize=Mg;exports.getSelectionState=Gg;exports.getUniqSelection=ve;exports.getUniqSelectionEntity=Ug;exports.getUniqSelectionTypes=Bg;exports.hasSelectionProperties=jg;
4
- //# sourceMappingURL=index.cjs.map