vue-safe-force-graph 2.0.48 → 2.0.49
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.
|
@@ -40302,7 +40302,7 @@ const EAe = /* @__PURE__ */ ln(BTe, [["render", xAe], ["__scopeId", "data-v-a8e2
|
|
|
40302
40302
|
utime: "2019-05-06 15:08:10",
|
|
40303
40303
|
children: []
|
|
40304
40304
|
}
|
|
40305
|
-
], AAe = "vue-safe-force-graph", kAe = "2.0.
|
|
40305
|
+
], AAe = "vue-safe-force-graph", kAe = "2.0.49", OAe = "force_graph in security area", NAe = "jason zhang", IAe = "./lib/vue-safe-force-graph.js", PAe = "./lib/vue-safe-force-graph.umd.cjs", RAe = "module", LAe = [
|
|
40306
40306
|
"/lib/"
|
|
40307
40307
|
], DAe = {
|
|
40308
40308
|
".": {
|
|
@@ -40750,8 +40750,8 @@ const { toClipboard: zAe } = Og(), VAe = "Arial,Helvetica Neue,Helvetica,PingFan
|
|
|
40750
40750
|
},
|
|
40751
40751
|
update(e = !1) {
|
|
40752
40752
|
return Ge(this, null, function* () {
|
|
40753
|
-
var t;
|
|
40754
|
-
this.iconAllLoaded
|
|
40753
|
+
var t, n, r;
|
|
40754
|
+
!this.iconAllLoaded && ((n = (t = this.moduleDetail) == null ? void 0 : t.nodes) != null && n.length) && (yield this.loadIcons()), !this.destroyed && (r = this.nodes) != null && r.length && (this.initScript(), kr("update"), e && this.updateSimulation(), this.doClearCanvas(), this.paintLinks(), this.paintNodes(), this.updateSelection(), this.ticked(), this.actNum === 9 && setTimeout(() => {
|
|
40755
40755
|
this.centerAndZoom(0.8);
|
|
40756
40756
|
}, 200));
|
|
40757
40757
|
});
|
|
@@ -40767,7 +40767,9 @@ const { toClipboard: zAe } = Og(), VAe = "Arial,Helvetica Neue,Helvetica,PingFan
|
|
|
40767
40767
|
const e = this.stage.width() / 2, t = this.stage.height() / 2, n = this.selection.map((r) => r.id);
|
|
40768
40768
|
this.nodes.forEach((r) => Ge(this, null, function* () {
|
|
40769
40769
|
var b, _, w, E, S, C, k, O, N, P, q, R, W, z, J, re, ae, H, G, K;
|
|
40770
|
-
|
|
40770
|
+
let s;
|
|
40771
|
+
r.type === "nodeType" ? s = this.iconSizeComputed[r.icon] || this.iconSizeComputed.node_type : s = this.iconSize[r.icon] || this.iconSize[r.type] || 24;
|
|
40772
|
+
const o = ((w = (_ = (b = r == null ? void 0 : r.detail) == null ? void 0 : b.info) == null ? void 0 : _.basic) == null ? void 0 : w.level) || "", l = (C = (S = (E = r == null ? void 0 : r.detail) == null ? void 0 : E.info) == null ? void 0 : S.basic) == null ? void 0 : C.flag;
|
|
40771
40773
|
let a;
|
|
40772
40774
|
try {
|
|
40773
40775
|
a = yield this.getNodeImage(r);
|
|
@@ -141,5 +141,5 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
141
141
|
\v\f\r \u2028\u2029\uFEFF`,sO=Ke("".replace),x3e=RegExp("^["+Nw+"]+"),k3e=RegExp("(^|[^"+Nw+"])["+Nw+"]+$"),Tw=function(e){return function(t){var n=E3e(S3e(t));return 1&e&&(n=sO(n,x3e,"")),2&e&&(n=sO(n,k3e,"$1")),n}},N3e={start:Tw(1),end:Tw(2),trim:Tw(3)},T3e=pt,A3e=wt,aO=Ge,lO=w3e,cO=Ke,O3e=bh,dO=Yt,I3e=Qp,R3e=bs,P3e=rh,uO=c1,L3e=Fe,B3e=Pa.f,D3e=Ra.f,M3e=In.f,F3e=oO,$3e=N3e.trim,Zp="Number",El=aO[Zp];lO[Zp];var Aw=El.prototype,z3e=aO.TypeError,U3e=cO("".slice),Vp=cO("".charCodeAt),j3e=function(e){var t,n,r,o,a,c,l,d,u=uO(e,"number");if(P3e(u))throw new z3e("Cannot convert a Symbol value to a number");if(typeof u=="string"&&u.length>2){if(u=$3e(u),(t=Vp(u,0))===43||t===45){if((n=Vp(u,2))===88||n===120)return NaN}else if(t===48){switch(Vp(u,1)){case 66:case 98:r=2,o=49;break;case 79:case 111:r=8,o=55;break;default:return+u}for(c=(a=U3e(u,2)).length,l=0;l<c;l++)if((d=Vp(a,l))<48||d>o)return NaN;return parseInt(a,r)}}return+u},Ow=O3e(Zp,!El(" 0o1")||!El("0b1")||El("+0x1")),eg=function(e){var t,n=arguments.length<1?0:El(function(r){var o=uO(r,"number");return typeof o=="bigint"?o:j3e(o)}(e));return R3e(Aw,t=this)&&L3e(function(){F3e(t)})?I3e(Object(n),this,eg):n};eg.prototype=Aw,Ow&&(Aw.constructor=eg),T3e({global:!0,constructor:!0,wrap:!0,forced:Ow},{Number:eg}),Ow&&function(e,t){for(var n,r=A3e?B3e(t):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),o=0;r.length>o;o++)dO(t,n=r[o])&&!dO(e,n)&&M3e(e,n,D3e(t,n))}(lO[Zp],El);var q3e=Li,H3e=xr,G3e=bo,W3e=RangeError,K3e=pt,Iw=Ke,Y3e=Li,J3e=oO,X3e=function(e){var t=H3e(G3e(this)),n="",r=q3e(e);if(r<0||r===1/0)throw new W3e("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n},fO=Fe,Q3e=RangeError,hO=String,pO=Math.floor,Rw=Iw(X3e),gO=Iw("".slice),Ud=Iw(1 .toFixed),xl=function(e,t,n){return t===0?n:t%2==1?xl(e,t-1,n*e):xl(e*e,t/2,n)},kl=function(e,t,n){for(var r=-1,o=n;++r<6;)o+=t*e[r],e[r]=o%1e7,o=pO(o/1e7)},Pw=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=pO(r/t),r=r%t*1e7},mO=function(e){for(var t=6,n="";--t>=0;)if(n!==""||t===0||e[t]!==0){var r=hO(e[t]);n=n===""?r:n+Rw("0",7-r.length)+r}return n};K3e({target:"Number",proto:!0,forced:fO(function(){return Ud(8e-5,3)!=="0.000"||Ud(.9,0)!=="1"||Ud(1.255,2)!=="1.25"||Ud(0xde0b6b3a7640080,0)!=="1000000000000000128"})||!fO(function(){Ud({})})},{toFixed:function(e){var t,n,r,o,a=J3e(this),c=Y3e(e),l=[0,0,0,0,0,0],d="",u="0";if(c<0||c>20)throw new Q3e("Incorrect fraction digits");if(a!=a)return"NaN";if(a<=-1e21||a>=1e21)return hO(a);if(a<0&&(d="-",a=-a),a>1e-21)if(t=function(f){for(var p=0,h=f;h>=4096;)p+=12,h/=4096;for(;h>=2;)p+=1,h/=2;return p}(a*xl(2,69,1))-69,n=t<0?a*xl(2,-t,1):a/xl(2,t,1),n*=4503599627370496,(t=52-t)>0){for(kl(l,0,n),r=c;r>=7;)kl(l,1e7,0),r-=7;for(kl(l,xl(10,r,1),0),r=t-1;r>=23;)Pw(l,1<<23),r-=23;Pw(l,1<<r),kl(l,1,1),Pw(l,2),u=mO(l)}else kl(l,0,n),kl(l,1<<-t,0),u=mO(l)+Rw("0",c);return u=c>0?d+((o=u.length)<=c?"0."+Rw("0",c-o)+u:gO(u,0,o-c)+"."+gO(u,o-c)):d+u}});var vO=function(e,t){if(PerformanceObserver)if((PerformanceObserver.supportedEntryTypes||[]).includes(e))try{new PerformanceObserver(function(n){n&&t(n)}).observe({type:e,buffered:!0})}catch(n){t("err")}else t("err");else t("err")},Qt=function(e){var t=Math.min(Math.max(e,0),15e3);return Number.isNaN(t)?0:t%1!=0?Number(t.toFixed(2)):t},Z3e=Er.filter;pt({target:"Array",proto:!0,forced:!Mh("filter")},{filter:function(e){return Z3e(this,e,arguments.length>1?arguments[1]:void 0)}});var V3e=function(){function e(t){Kf(this,e),Ai(this,"performanceData",{fcp:0,fp:0,lcp:0}),Ai(this,"commit",function(){}),this.webCoreIns=t}return Yf(e,[{key:"init",value:function(){try{if(!((t=window.performance)&&t.getEntriesByType&&t.timing))return;this.calcPerformanceTime()}catch(n){}var t}},{key:"calcNavigation",value:function(t){}},{key:"calcPerformanceTime",value:function(){var t=this;Promise.all([new Promise(function(n,r){var o=window.performance.timing,a=null;window.addEventListener("load",function c(){if(o.loadEventEnd>0){clearTimeout(a);var l=Qt(o.unloadEnd-o.unloadStart),d=Qt(o.redirectStart-o.redirectEnd),u=Qt(o.domainLookupStart-o.fetchStart),f=Qt(o.domainLookupEnd-o.domainLookupStart),p=Qt(o.connectEnd-o.connectStart),h=Qt(o.secureConnectionStart==0?0:o.connectEnd-o.secureConnectionStart),m=Qt(o.responseStart-o.requestStart),b=Qt(o.domInteractive-o.fetchStart),w=Qt(o.responseEnd-o.responseStart),_=Qt(o.domContentLoadedEventEnd-o.fetchStart),C=Qt(o.domInteractive-o.responseEnd),k=Qt(o.loadEventStart-o.domContentLoadedEventEnd),S=Qt(o.loadEventEnd-o.loadEventStart),E=Qt(o.loadEventEnd-o.fetchStart);n({unloadTime:l,redirectTime:d,appCacheTime:u,dnsTime:f,tcpTime:p,sslTime:h,ttfb:m,contentTime:w,domParseTime:C,tti:b,domReadyTime:_,loadEventTime:S,loadFinishTime:E,loadResourceTime:k,resource:""})}else a=setTimeout(c,100)},!1)}),new Promise(function(n,r){vO("paint",function(o){var a=0,c=0;if(o!=="err"){var l,d=Jv(o.getEntries());try{for(d.s();!(l=d.n()).done;){var u=l.value,f=u.name,p=u.startTime;f==="first-paint"&&(a=Qt(p)),f==="first-contentful-paint"&&(c=Qt(p))}}catch(h){d.e(h)}finally{d.f()}}n({fp:a,fcp:c})})}).catch(function(n){return console.log(n)}),new Promise(function(n,r){vO("largest-contentful-paint",function(o){if(o=="err")n({lcp:0});else{var a,c=Jv(o.getEntries());try{for(c.s();!(a=c.n()).done;){var l=a.value;n({lcp:Qt(l.startTime)})}}catch(d){c.e(d)}finally{c.f()}}})}).catch(function(n){return console.log(n)})]).then(function(){var n=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:[]).reduce(function(r,o){return qc(qc({},r),o)},t.performanceData);n.type="performance",t.webCoreIns.commit(n)}).catch(function(n){console.log(n)})}},{key:"calcResourceTime",value:function(){}}]),e}(),e4e=["SCRIPT","STYLE","META","HEAD"];function Lw(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:document.body,t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4?arguments[4]:void 0;if(!e||n>r||e4e.indexOf(e.tagName)>-1||o&&t>o)return n;var a=function(c,l){if(!l||!document.querySelector(c.tagName))return 0;var d=c.getBoundingClientRect(),u=d.top,f=d.height;return u>window.innerHeight||f<=0?0:1/Math.pow(2,l-1)}(e,t);return[].reduceRight.call(e.children,function(c,l){return Lw(l,t+1,c,r,o)},n+a)}var yO,Bw,Dw=Fe,Mw=Ge.RegExp,Fw=Dw(function(){var e=Mw("a","y");return e.lastIndex=2,e.exec("abcd")!==null}),t4e=Fw||Dw(function(){return!Mw("a","y").sticky}),n4e=Fw||Dw(function(){var e=Mw("^r","gy");return e.lastIndex=2,e.exec("str")!==null}),r4e={BROKEN_CARET:n4e,MISSED_STICKY:t4e,UNSUPPORTED_Y:Fw},i4e=Fe,o4e=Ge.RegExp,s4e=i4e(function(){var e=o4e(".","s");return!(e.dotAll&&e.test(`
|
|
142
142
|
`)&&e.flags==="s")}),a4e=Fe,l4e=Ge.RegExp,c4e=a4e(function(){var e=l4e("(?<a>b)","g");return e.exec("b").groups.a!=="b"||"b".replace(e,"$<a>c")!=="bc"}),Nl=Ot,tg=Ke,d4e=xr,u4e=Lx,f4e=r4e,h4e=Ia,p4e=nn.get,g4e=s4e,m4e=c4e,v4e=Zv("native-string-replace",String.prototype.replace),ng=RegExp.prototype.exec,$w=ng,y4e=tg("".charAt),b4e=tg("".indexOf),w4e=tg("".replace),zw=tg("".slice),Uw=(Bw=/b*/g,Nl(ng,yO=/a/,"a"),Nl(ng,Bw,"a"),yO.lastIndex!==0||Bw.lastIndex!==0),bO=f4e.BROKEN_CARET,jw=/()??/.exec("")[1]!==void 0;(Uw||jw||bO||g4e||m4e)&&($w=function(e){var t,n,r,o,a,c,l,d=this,u=p4e(d),f=d4e(e),p=u.raw;if(p)return p.lastIndex=d.lastIndex,t=Nl($w,p,f),d.lastIndex=p.lastIndex,t;var h=u.groups,m=bO&&d.sticky,b=Nl(u4e,d),w=d.source,_=0,C=f;if(m&&(b=w4e(b,"y",""),b4e(b,"g")===-1&&(b+="g"),C=zw(f,d.lastIndex),d.lastIndex>0&&(!d.multiline||d.multiline&&y4e(f,d.lastIndex-1)!==`
|
|
143
143
|
`)&&(w="(?: "+w+")",C=" "+C,_++),n=new RegExp("^(?:"+w+")",b)),jw&&(n=new RegExp("^"+w+"$(?!\\s)",b)),Uw&&(r=d.lastIndex),o=Nl(ng,m?n:d,C),m?o?(o.input=zw(o.input,_),o[0]=zw(o[0],_),o.index=d.lastIndex,d.lastIndex+=o[0].length):d.lastIndex=0:Uw&&o&&(d.lastIndex=d.global?o.index+o[0].length:r),jw&&o&&o.length>1&&Nl(v4e,o[0],n,function(){for(a=1;a<arguments.length-2;a++)arguments[a]===void 0&&(o[a]=void 0)}),o&&h)for(o.groups=c=h4e(null),a=0;a<h.length;a++)c[(l=h[a])[0]]=o[l[1]];return o});var rg=$w;pt({target:"RegExp",proto:!0,forced:/./.exec!==rg},{exec:rg});var wO=Jc,_O=Rn,_4e=rg,CO=Fe,SO=dt,C4e=Oi,S4e=SO("species"),qw=RegExp.prototype,E4e=K1.charAt,EO=Ot,x4e=tn,k4e=ht,N4e=Ii,T4e=rg,A4e=TypeError,O4e=Ot,I4e=function(e,t,n,r){var o=SO(e),a=!CO(function(){var u={};return u[o]=function(){return 7},""[e](u)!==7}),c=a&&!CO(function(){var u=!1,f=/a/;return e==="split"&&((f={}).constructor={},f.constructor[S4e]=function(){return f},f.flags="",f[o]=/./[o]),f.exec=function(){return u=!0,null},f[o](""),!u});if(!a||!c||n){var l=wO(/./[o]),d=t(o,""[e],function(u,f,p,h,m){var b=wO(u),w=f.exec;return w===_4e||w===qw.exec?a&&!m?{done:!0,value:l(f,p,h)}:{done:!0,value:b(p,f,h)}:{done:!1}});_O(String.prototype,e,d[0]),_O(qw,o,d[1])}r&&C4e(qw[o],"sham",!0)},R4e=tn,P4e=ms,L4e=_s,Hw=xr,B4e=bo,D4e=ih,M4e=function(e,t,n){return t+(n?E4e(e,t).length:1)},xO=function(e,t){var n=e.exec;if(k4e(n)){var r=EO(n,e,t);return r!==null&&x4e(r),r}if(N4e(e)==="RegExp")return EO(T4e,e,t);throw new A4e("RegExp#exec called on incompatible receiver")};I4e("match",function(e,t,n){return[function(r){var o=B4e(this),a=P4e(r)?void 0:D4e(r,e);return a?O4e(a,r,o):new RegExp(r)[e](Hw(o))},function(r){var o=R4e(this),a=Hw(r),c=n(t,o,a);if(c.done)return c.value;if(!o.global)return xO(o,a);var l=o.unicode;o.lastIndex=0;for(var d,u=[],f=0;(d=xO(o,a))!==null;){var p=Hw(d[0]);u[f]=p,p===""&&(o.lastIndex=M4e(a,L4e(o.lastIndex),l)),f++}return f===0?null:u}]});var En,Tl,ig,Gw={exports:{}},kO=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined",F4e=kO,Ww=wt,gn=Ge,NO=ht,og=At,Lo=Yt,Kw=Ri,$4e=Ta,z4e=Oi,Yw=Rn,U4e=Co,j4e=bs,sg=ed,Al=La,q4e=dt,H4e=eh,TO=nn.enforce,G4e=nn.get,ag=gn.Int8Array,Jw=ag&&ag.prototype,AO=gn.Uint8ClampedArray,OO=AO&&AO.prototype,ti=ag&&sg(ag),Ir=Jw&&sg(Jw),W4e=Object.prototype,Xw=gn.TypeError,IO=q4e("toStringTag"),Qw=H4e("TYPED_ARRAY_TAG"),lg="TypedArrayConstructor",zi=F4e&&!!Al&&Kw(gn.opera)!=="Opera",RO=!1,Ui={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Zw={BigInt64Array:8,BigUint64Array:8},PO=function(e){var t=sg(e);if(og(t)){var n=G4e(t);return n&&Lo(n,lg)?n[lg]:PO(t)}},LO=function(e){if(!og(e))return!1;var t=Kw(e);return Lo(Ui,t)||Lo(Zw,t)};for(En in Ui)(ig=(Tl=gn[En])&&Tl.prototype)?TO(ig)[lg]=Tl:zi=!1;for(En in Zw)(ig=(Tl=gn[En])&&Tl.prototype)&&(TO(ig)[lg]=Tl);if((!zi||!NO(ti)||ti===Function.prototype)&&(ti=function(){throw new Xw("Incorrect invocation")},zi))for(En in Ui)gn[En]&&Al(gn[En],ti);if((!zi||!Ir||Ir===W4e)&&(Ir=ti.prototype,zi))for(En in Ui)gn[En]&&Al(gn[En].prototype,Ir);if(zi&&sg(OO)!==Ir&&Al(OO,Ir),Ww&&!Lo(Ir,IO))for(En in RO=!0,U4e(Ir,IO,{configurable:!0,get:function(){return og(this)?this[Qw]:void 0}}),Ui)gn[En]&&z4e(gn[En],Qw,En);var Oe={NATIVE_ARRAY_BUFFER_VIEWS:zi,TYPED_ARRAY_TAG:RO&&Qw,aTypedArray:function(e){if(LO(e))return e;throw new Xw("Target is not a typed array")},aTypedArrayConstructor:function(e){if(NO(e)&&(!Al||j4e(ti,e)))return e;throw new Xw($4e(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(Ww){if(n)for(var o in Ui){var a=gn[o];if(a&&Lo(a.prototype,e))try{delete a.prototype[e]}catch(c){try{a.prototype[e]=t}catch(l){}}}Ir[e]&&!n||Yw(Ir,e,n?t:zi&&Jw[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,o;if(Ww){if(Al){if(n){for(r in Ui)if((o=gn[r])&&Lo(o,e))try{delete o[e]}catch(a){}}if(ti[e]&&!n)return;try{return Yw(ti,e,n?t:zi&&ti[e]||t)}catch(a){}}for(r in Ui)!(o=gn[r])||o[e]&&!n||Yw(o,e,t)}},getTypedArrayConstructor:PO,isView:function(e){if(!og(e))return!1;var t=Kw(e);return t==="DataView"||Lo(Ui,t)||Lo(Zw,t)},isTypedArray:LO,TypedArray:ti,TypedArrayPrototype:Ir},BO=Ge,Vw=Fe,K4e=xw,Y4e=Oe.NATIVE_ARRAY_BUFFER_VIEWS,J4e=BO.ArrayBuffer,$s=BO.Int8Array,X4e=!Y4e||!Vw(function(){$s(1)})||!Vw(function(){new $s(-1)})||!K4e(function(e){new $s,new $s(null),new $s(1.5),new $s(e)},!0)||Vw(function(){return new $s(new J4e(2),1,void 0).length!==1}),Q4e=Li,Z4e=_s,V4e=RangeError,DO=function(e){if(e===void 0)return 0;var t=Q4e(e),n=Z4e(t);if(t!==n)throw new V4e("Wrong length or index");return n},e8e=Math.sign||function(e){var t=+e;return t===0||t!=t?t:t<0?-1:1},t8e=e8e,n8e=Math.abs,MO=2220446049250313e-31,FO=1/MO,r8e=function(e,t,n,r){var o=+e,a=n8e(o),c=t8e(o);if(a<r)return c*function(u){return u+FO-FO}(a/r/t)*r*t;var l=(1+t/MO)*a,d=l-(l-a);return d>n||d!=d?c*(1/0):c*d},i8e=Math.fround||function(e){return r8e(e,11920928955078125e-23,34028234663852886e22,11754943508222875e-54)},o8e=Array,s8e=Math.abs,ji=Math.pow,a8e=Math.floor,l8e=Math.log,c8e=Math.LN2,d8e={pack:function(e,t,n){var r,o,a,c=o8e(n),l=8*n-t-1,d=(1<<l)-1,u=d>>1,f=t===23?ji(2,-24)-ji(2,-77):0,p=e<0||e===0&&1/e<0?1:0,h=0;for((e=s8e(e))!=e||e===1/0?(o=e!=e?1:0,r=d):(r=a8e(l8e(e)/c8e),e*(a=ji(2,-r))<1&&(r--,a*=2),(e+=r+u>=1?f/a:f*ji(2,1-u))*a>=2&&(r++,a/=2),r+u>=d?(o=0,r=d):r+u>=1?(o=(e*a-1)*ji(2,t),r+=u):(o=e*ji(2,u-1)*ji(2,t),r=0));t>=8;)c[h++]=255&o,o/=256,t-=8;for(r=r<<t|o,l+=t;l>0;)c[h++]=255&r,r/=256,l-=8;return c[--h]|=128*p,c},unpack:function(e,t){var n,r=e.length,o=8*r-t-1,a=(1<<o)-1,c=a>>1,l=o-7,d=r-1,u=e[d--],f=127&u;for(u>>=7;l>0;)f=256*f+e[d--],l-=8;for(n=f&(1<<-l)-1,f>>=-l,l+=t;l>0;)n=256*n+e[d--],l-=8;if(f===0)f=1-c;else{if(f===a)return n?NaN:u?-1/0:1/0;n+=ji(2,t),f-=c}return(u?-1:1)*n*ji(2,f-t)}},u8e=Sr,$O=Qc,f8e=Pn,zO=function(e){for(var t=u8e(this),n=f8e(t),r=arguments.length,o=$O(r>1?arguments[1]:void 0,n),a=r>2?arguments[2]:void 0,c=a===void 0?n:$O(a,n);c>o;)t[o++]=e;return t},cg=Ge,e_=Ke,t_=wt,h8e=kO,p8e=Oi,g8e=Co,UO=ry,n_=Fe,dg=Ss,m8e=Li,v8e=_s,ug=DO,y8e=i8e,jO=d8e,b8e=ed,qO=La,w8e=zO,_8e=So,C8e=Qp,S8e=V9,HO=_o,r_=nn,E8e=ws.PROPER,GO=ws.CONFIGURABLE,Ol="ArrayBuffer",fg="DataView",Il="prototype",WO="Wrong index",KO=r_.getterFor(Ol),jd=r_.getterFor(fg),YO=r_.set,Rr=cg[Ol],Pr=Rr,Rl=Pr&&Pr[Il],qi=cg[fg],zs=qi&&qi[Il],JO=Object.prototype,x8e=cg.Array,hg=cg.RangeError,k8e=e_(w8e),N8e=e_([].reverse),XO=jO.pack,QO=jO.unpack,ZO=function(e){return[255&e]},VO=function(e){return[255&e,e>>8&255]},eI=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},tI=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},T8e=function(e){return XO(y8e(e),23,4)},A8e=function(e){return XO(e,52,8)},pg=function(e,t,n){g8e(e[Il],t,{configurable:!0,get:function(){return n(this)[t]}})},Bo=function(e,t,n,r){var o=jd(e),a=ug(n),c=!!r;if(a+t>o.byteLength)throw new hg(WO);var l=o.bytes,d=a+o.byteOffset,u=_8e(l,d,d+t);return c?u:N8e(u)},Do=function(e,t,n,r,o,a){var c=jd(e),l=ug(n),d=r(+o),u=!!a;if(l+t>c.byteLength)throw new hg(WO);for(var f=c.bytes,p=l+c.byteOffset,h=0;h<t;h++)f[p+h]=d[u?h:t-h-1]};if(h8e){var nI=E8e&&Rr.name!==Ol;n_(function(){Rr(1)})&&n_(function(){new Rr(-1)})&&!n_(function(){return new Rr,new Rr(1.5),new Rr(NaN),Rr.length!==1||nI&&!GO})?nI&&GO&&p8e(Rr,"name",Ol):((Pr=function(e){return dg(this,Rl),C8e(new Rr(ug(e)),this,Pr)})[Il]=Rl,Rl.constructor=Pr,S8e(Pr,Rr)),qO&&b8e(zs)!==JO&&qO(zs,JO);var gg=new qi(new Pr(2)),rI=e_(zs.setInt8);gg.setInt8(0,2147483648),gg.setInt8(1,2147483649),!gg.getInt8(0)&&gg.getInt8(1)||UO(zs,{setInt8:function(e,t){rI(this,e,t<<24>>24)},setUint8:function(e,t){rI(this,e,t<<24>>24)}},{unsafe:!0})}else Rl=(Pr=function(e){dg(this,Rl);var t=ug(e);YO(this,{type:Ol,bytes:k8e(x8e(t),0),byteLength:t}),t_||(this.byteLength=t,this.detached=!1)})[Il],zs=(qi=function(e,t,n){dg(this,zs),dg(e,Rl);var r=KO(e),o=r.byteLength,a=m8e(t);if(a<0||a>o)throw new hg("Wrong offset");if(a+(n=n===void 0?o-a:v8e(n))>o)throw new hg("Wrong length");YO(this,{type:fg,buffer:e,byteLength:n,byteOffset:a,bytes:r.bytes}),t_||(this.buffer=e,this.byteLength=n,this.byteOffset=a)})[Il],t_&&(pg(Pr,"byteLength",KO),pg(qi,"buffer",jd),pg(qi,"byteLength",jd),pg(qi,"byteOffset",jd)),UO(zs,{getInt8:function(e){return Bo(this,1,e)[0]<<24>>24},getUint8:function(e){return Bo(this,1,e)[0]},getInt16:function(e){var t=Bo(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Bo(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return tI(Bo(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return tI(Bo(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return QO(Bo(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return QO(Bo(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){Do(this,1,e,ZO,t)},setUint8:function(e,t){Do(this,1,e,ZO,t)},setInt16:function(e,t){Do(this,2,e,VO,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){Do(this,2,e,VO,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){Do(this,4,e,eI,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){Do(this,4,e,eI,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){Do(this,4,e,T8e,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){Do(this,8,e,A8e,t,arguments.length>2&&arguments[2])}});HO(Pr,Ol),HO(qi,fg);var O8e={ArrayBuffer:Pr,DataView:qi},I8e=At,R8e=Math.floor,P8e=Number.isInteger||function(e){return!I8e(e)&&isFinite(e)&&R8e(e)===e},L8e=Li,B8e=RangeError,D8e=function(e){var t=L8e(e);if(t<0)throw new B8e("The argument can't be less than 0");return t},M8e=RangeError,iI=function(e,t){var n=D8e(e);if(n%t)throw new M8e("Wrong offset");return n},F8e=Math.round,$8e=Ri,z8e=c1,U8e=TypeError,oI=function(e){var t=z8e(e,"number");if(typeof t=="number")throw new U8e("Can't convert number to bigint");return BigInt(t)},j8e=Pi,q8e=Ot,H8e=tA,G8e=Sr,W8e=Pn,K8e=Sh,Y8e=id,J8e=Z1,X8e=function(e){var t=$8e(e);return t==="BigInt64Array"||t==="BigUint64Array"},Q8e=Oe.aTypedArrayConstructor,Z8e=oI,V8e=Pn,sI=function(e,t,n){for(var r=0,o=arguments.length>2?n:V8e(t),a=new e(o);o>r;)a[r]=t[r++];return a},aI=pt,lI=Ge,cI=Ot,e6e=wt,t6e=X4e,qd=Oe,dI=O8e,uI=Ss,n6e=Aa,Hd=Oi,r6e=P8e,i6e=_s,fI=DO,i_=iI,o6e=function(e){var t=F8e(e);return t<0?0:t>255?255:255&t},hI=oh,Gd=Yt,s6e=Ri,o_=At,a6e=rh,l6e=Ia,c6e=bs,mg=La,d6e=Pa.f,pI=function(e){var t,n,r,o,a,c,l,d,u=H8e(this),f=G8e(e),p=arguments.length,h=p>1?arguments[1]:void 0,m=h!==void 0,b=Y8e(f);if(b&&!J8e(b))for(d=(l=K8e(f,b)).next,f=[];!(c=q8e(d,l)).done;)f.push(c.value);for(m&&p>2&&(h=j8e(h,arguments[2])),n=W8e(f),r=new(Q8e(u))(n),o=X8e(r),t=0;n>t;t++)a=m?h(f[t],t):f[t],r[t]=o?Z8e(a):+a;return r},u6e=Er.forEach,f6e=rw,h6e=Co,gI=In,mI=Ra,vI=sI,p6e=Qp,s_=nn.get,g6e=nn.set,m6e=nn.enforce,yI=gI.f,v6e=mI.f,a_=lI.RangeError,bI=dI.ArrayBuffer,y6e=bI.prototype,b6e=dI.DataView,vg=qd.NATIVE_ARRAY_BUFFER_VIEWS,wI=qd.TYPED_ARRAY_TAG,_I=qd.TypedArray,Wd=qd.TypedArrayPrototype,l_=qd.isTypedArray,yg="BYTES_PER_ELEMENT",c_="Wrong length",bg=function(e,t){h6e(e,t,{configurable:!0,get:function(){return s_(this)[t]}})},CI=function(e){var t;return c6e(y6e,e)||(t=s6e(e))==="ArrayBuffer"||t==="SharedArrayBuffer"},SI=function(e,t){return l_(e)&&!a6e(t)&&t in e&&r6e(+t)&&t>=0},EI=function(e,t){return t=hI(t),SI(e,t)?n6e(2,e[t]):v6e(e,t)},xI=function(e,t,n){return t=hI(t),!(SI(e,t)&&o_(n)&&Gd(n,"value"))||Gd(n,"get")||Gd(n,"set")||n.configurable||Gd(n,"writable")&&!n.writable||Gd(n,"enumerable")&&!n.enumerable?yI(e,t,n):(e[t]=n.value,e)};e6e?(vg||(mI.f=EI,gI.f=xI,bg(Wd,"buffer"),bg(Wd,"byteOffset"),bg(Wd,"byteLength"),bg(Wd,"length")),aI({target:"Object",stat:!0,forced:!vg},{getOwnPropertyDescriptor:EI,defineProperty:xI}),Gw.exports=function(e,t,n){var r=e.match(/\d+/)[0]/8,o=e+(n?"Clamped":"")+"Array",a="get"+e,c="set"+e,l=lI[o],d=l,u=d&&d.prototype,f={},p=function(m,b){yI(m,b,{get:function(){return function(w,_){var C=s_(w);return C.view[a](_*r+C.byteOffset,!0)}(this,b)},set:function(w){return function(_,C,k){var S=s_(_);S.view[c](C*r+S.byteOffset,n?o6e(k):k,!0)}(this,b,w)},enumerable:!0})};vg?t6e&&(d=t(function(m,b,w,_){return uI(m,u),p6e(o_(b)?CI(b)?_!==void 0?new l(b,i_(w,r),_):w!==void 0?new l(b,i_(w,r)):new l(b):l_(b)?vI(d,b):cI(pI,d,b):new l(fI(b)),m,d)}),mg&&mg(d,_I),u6e(d6e(l),function(m){m in d||Hd(d,m,l[m])}),d.prototype=u):(d=t(function(m,b,w,_){uI(m,u);var C,k,S,E=0,T=0;if(o_(b)){if(!CI(b))return l_(b)?vI(d,b):cI(pI,d,b);C=b,T=i_(w,r);var A=b.byteLength;if(_===void 0){if(A%r)throw new a_(c_);if((k=A-T)<0)throw new a_(c_)}else if((k=i6e(_)*r)+T>A)throw new a_(c_);S=k/r}else S=fI(b),C=new bI(k=S*r);for(g6e(m,{buffer:C,byteOffset:T,byteLength:k,length:S,view:new b6e(C)});E<S;)p(m,E++)}),mg&&mg(d,_I),u=d.prototype=l6e(Wd)),u.constructor!==d&&Hd(u,"constructor",d),m6e(u).TypedArrayConstructor=d,wI&&Hd(u,wI,o);var h=d!==l;f[o]=d,aI({global:!0,constructor:!0,forced:h,sham:!vg},f),yg in d||Hd(d,yg,r),yg in u||Hd(u,yg,r),f6e(o)}):Gw.exports=function(){},(0,Gw.exports)("Uint8",function(e){return function(t,n,r){return e(this,t,n,r)}});var kI=Ta,w6e=TypeError,_6e=Sr,d_=Qc,C6e=Pn,S6e=function(e,t){if(!delete e[t])throw new w6e("Cannot delete property "+kI(t)+" of "+kI(e))},E6e=Math.min,x6e=[].copyWithin||function(e,t){var n=_6e(this),r=C6e(n),o=d_(e,r),a=d_(t,r),c=arguments.length>2?arguments[2]:void 0,l=E6e((c===void 0?r:d_(c,r))-a,r-o),d=1;for(a<o&&o<a+l&&(d=-1,a+=l-1,o+=l-1);l-- >0;)a in n?n[o]=n[a]:S6e(n,o),o+=d,a+=d;return n},NI=Oe,k6e=Ke(x6e),N6e=NI.aTypedArray;(0,NI.exportTypedArrayMethod)("copyWithin",function(e,t){return k6e(N6e(this),e,t,arguments.length>2?arguments[2]:void 0)});var T6e=Er.every,A6e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("every",function(e){return T6e(A6e(this),e,arguments.length>1?arguments[1]:void 0)});var O6e=zO,I6e=oI,R6e=Ri,P6e=Ot,L6e=Fe,B6e=Oe.aTypedArray,D6e=Oe.exportTypedArrayMethod,M6e=Ke("".slice);D6e("fill",function(e){var t=arguments.length;B6e(this);var n=M6e(R6e(this),0,3)==="Big"?I6e(e):+e;return P6e(O6e,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)},L6e(function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),e!==1}));var F6e=rA,$6e=Oe.aTypedArrayConstructor,z6e=Oe.getTypedArrayConstructor,wg=function(e){return $6e(F6e(e,z6e(e)))},U6e=sI,j6e=wg,q6e=Er.filter,H6e=function(e,t){return U6e(j6e(e),t)},G6e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("filter",function(e){var t=q6e(G6e(this),e,arguments.length>1?arguments[1]:void 0);return H6e(this,t)});var W6e=Er.find,K6e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("find",function(e){return W6e(K6e(this),e,arguments.length>1?arguments[1]:void 0)});var Y6e=Er.findIndex,J6e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("findIndex",function(e){return Y6e(J6e(this),e,arguments.length>1?arguments[1]:void 0)});var X6e=Er.forEach,Q6e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("forEach",function(e){X6e(Q6e(this),e,arguments.length>1?arguments[1]:void 0)});var Z6e=gh.includes,V6e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("includes",function(e){return Z6e(V6e(this),e,arguments.length>1?arguments[1]:void 0)});var e5e=gh.indexOf,t5e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("indexOf",function(e){return e5e(t5e(this),e,arguments.length>1?arguments[1]:void 0)});var n5e=Ge,r5e=Fe,u_=Ke,TI=Oe,f_=hE,h_=dt("iterator"),AI=n5e.Uint8Array,i5e=u_(f_.values),o5e=u_(f_.keys),s5e=u_(f_.entries),p_=TI.aTypedArray,_g=TI.exportTypedArrayMethod,Pl=AI&&AI.prototype,Cg=!r5e(function(){Pl[h_].call([1])}),OI=!!Pl&&Pl.values&&Pl[h_]===Pl.values&&Pl.values.name==="values",II=function(){return i5e(p_(this))};_g("entries",function(){return s5e(p_(this))},Cg),_g("keys",function(){return o5e(p_(this))},Cg),_g("values",II,Cg||!OI,{name:"values"}),_g(h_,II,Cg||!OI,{name:"values"});var a5e=Oe.aTypedArray,l5e=Oe.exportTypedArrayMethod,c5e=Ke([].join);l5e("join",function(e){return c5e(a5e(this),e)});var d5e=$p,u5e=Bi,f5e=Li,h5e=Pn,p5e=P9,g5e=Math.min,g_=[].lastIndexOf,RI=!!g_&&1/[1].lastIndexOf(1,-0)<0,m5e=p5e("lastIndexOf"),v5e=RI||!m5e?function(e){if(RI)return d5e(g_,this,arguments)||0;var t=u5e(this),n=h5e(t),r=n-1;for(arguments.length>1&&(r=g5e(r,f5e(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:g_,y5e=$p,b5e=v5e,w5e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("lastIndexOf",function(e){var t=arguments.length;return y5e(b5e,w5e(this),t>1?[e,arguments[1]]:[e])});var _5e=Er.map,C5e=wg,S5e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("map",function(e){return _5e(S5e(this),e,arguments.length>1?arguments[1]:void 0,function(t,n){return new(C5e(t))(n)})});var E5e=Kr,x5e=Sr,k5e=hh,N5e=Pn,T5e=TypeError,PI=function(e){return function(t,n,r,o){var a=x5e(t),c=k5e(a),l=N5e(a);E5e(n);var d=e?l-1:0,u=e?-1:1;if(r<2)for(;;){if(d in c){o=c[d],d+=u;break}if(d+=u,e?d<0:l<=d)throw new T5e("Reduce of empty array with no initial value")}for(;e?d>=0:l>d;d+=u)d in c&&(o=n(o,c[d],d,a));return o}},LI={left:PI(!1),right:PI(!0)},A5e=LI.left,O5e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("reduce",function(e){var t=arguments.length;return A5e(O5e(this),e,t,t>1?arguments[1]:void 0)});var I5e=LI.right,R5e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("reduceRight",function(e){var t=arguments.length;return I5e(R5e(this),e,t,t>1?arguments[1]:void 0)});var P5e=Oe.aTypedArray,L5e=Oe.exportTypedArrayMethod,B5e=Math.floor;L5e("reverse",function(){for(var e,t=this,n=P5e(t).length,r=B5e(n/2),o=0;o<r;)e=t[o],t[o++]=t[--n],t[n]=e;return t});var BI=Ge,DI=Ot,m_=Oe,D5e=Pn,M5e=iI,F5e=Sr,MI=Fe,$5e=BI.RangeError,v_=BI.Int8Array,FI=v_&&v_.prototype,$I=FI&&FI.set,z5e=m_.aTypedArray,U5e=m_.exportTypedArrayMethod,y_=!MI(function(){var e=new Uint8ClampedArray(2);return DI($I,e,{length:1,0:3},1),e[1]!==3}),j5e=y_&&m_.NATIVE_ARRAY_BUFFER_VIEWS&&MI(function(){var e=new v_(2);return e.set(1),e.set("2",1),e[0]!==0||e[1]!==2});U5e("set",function(e){z5e(this);var t=M5e(arguments.length>1?arguments[1]:void 0,1),n=F5e(e);if(y_)return DI($I,this,n,t);var r=this.length,o=D5e(n),a=0;if(o+t>r)throw new $5e("Wrong length");for(;a<o;)this[t+a]=n[a++]},!y_||j5e);var q5e=wg,H5e=So,G5e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("slice",function(e,t){for(var n=H5e(G5e(this),e,t),r=q5e(this),o=0,a=n.length,c=new r(a);a>o;)c[o]=n[o++];return c},Fe(function(){new Int8Array(1).slice()}));var W5e=Er.some,K5e=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("some",function(e){return W5e(K5e(this),e,arguments.length>1?arguments[1]:void 0)});var zI=vs.match(/firefox\/(\d+)/i),Y5e=!!zI&&+zI[1],J5e=/MSIE|Trident/.test(vs),UI=vs.match(/AppleWebKit\/(\d+)\./),X5e=!!UI&&+UI[1],Q5e=Jc,b_=Fe,Z5e=Kr,V5e=jE,jI=Y5e,eCe=J5e,qI=Kc,HI=X5e,tCe=Oe.aTypedArray,nCe=Oe.exportTypedArrayMethod,Kd=Ge.Uint16Array,Ll=Kd&&Q5e(Kd.prototype.sort),rCe=!(!Ll||b_(function(){Ll(new Kd(2),null)})&&b_(function(){Ll(new Kd(2),{})})),GI=!!Ll&&!b_(function(){if(qI)return qI<74;if(jI)return jI<67;if(eCe)return!0;if(HI)return HI<602;var e,t,n=new Kd(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(Ll(n,function(o,a){return(o/4|0)-(a/4|0)}),e=0;e<516;e++)if(n[e]!==r[e])return!0});nCe("sort",function(e){return e!==void 0&&Z5e(e),GI?Ll(this,e):V5e(tCe(this),function(t){return function(n,r){return t!==void 0?+t(n,r)||0:r!=r?-1:n!=n?1:n===0&&r===0?1/n>0&&1/r<0?1:-1:n>r}}(e))},!GI||rCe);var iCe=_s,WI=Qc,oCe=wg,sCe=Oe.aTypedArray;(0,Oe.exportTypedArrayMethod)("subarray",function(e,t){var n=sCe(this),r=n.length,o=WI(e,r);return new(oCe(n))(n.buffer,n.byteOffset+o*n.BYTES_PER_ELEMENT,iCe((t===void 0?r:WI(t,r))-o))});var aCe=$p,KI=Oe,w_=Fe,YI=So,Sg=Ge.Int8Array,JI=KI.aTypedArray,lCe=KI.exportTypedArrayMethod,XI=[].toLocaleString,cCe=!!Sg&&w_(function(){XI.call(new Sg(1))});lCe("toLocaleString",function(){return aCe(XI,cCe?YI(JI(this)):JI(this),YI(arguments))},w_(function(){return[1,2].toLocaleString()!==new Sg([1,2]).toLocaleString()})||!w_(function(){Sg.prototype.toLocaleString.call([1,2])}));var dCe=Oe.exportTypedArrayMethod,uCe=Fe,fCe=Ke,QI=Ge.Uint8Array,hCe=QI&&QI.prototype||{},Eg=[].toString,pCe=fCe([].join);uCe(function(){Eg.call({})})&&(Eg=function(){return pCe(this)});var gCe=hCe.toString!==Eg;dCe("toString",Eg,gCe);var mCe=0,__={},vCe=function(e){if(!e)return Promise.reject("empty url");var t=__[e];return t?Promise.resolve(t):new Promise(function(n,r){var o=document.createElement("script");if(o.id="script".concat(mCe++),o.src=e,o.async="async",o.src.indexOf("http")!==0)throw Error("load-script只能加载http/https协议的url,当前协议是".concat(location.protocol));o.onerror=function(a){$("#".concat(o.id)).remove(),r(a)},o.readyState?o.onreadystatechange=function(a){o.readyState!="loaded"&&o.readyState!="complete"||(o.onreadystatechange=null,__[e]=a,n(a))}:o.onload=function(a){__[e]=a,n(a)},document.body.appendChild(o)})};function yCe(e,t){return ZI.apply(this,arguments)}function ZI(){return(ZI=Hc(Cr().mark(function e(t,n){var r,o,a;return Cr().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,vCe("https://html2canvas.hertzen.com/dist/html2canvas.min.js");case 2:return c.next=4,html2canvas(document.body,{useCORS:!0});case 4:return r=c.sent,o=r.toDataURL("image/jpeg",.3),a=bCe(o),c.next=9,wCe(a,t,n);case 9:return c.abrupt("return",c.sent);case 10:case"end":return c.stop()}},e)}))).apply(this,arguments)}function bCe(e){for(var t=e.split(","),n=t[0].match(/:(.*?);/)[1],r=atob(t[1]),o=r.length,a=new Uint8Array(o);o--;)a[o]=r.charCodeAt(o);return new Blob([a],{type:n})}function wCe(e,t,n){return VI.apply(this,arguments)}function VI(){return(VI=Hc(Cr().mark(function e(t,n,r){var o,a;return Cr().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return(o=new FormData).append("filename",t,"".concat(r,".png")),o.append("https",1),c.next=5,n("//qapm.360.cn/api/upload/uploadImg",{method:"POST",body:o,keepalive:!0}).then(function(l){return l.json()});case 5:return a=c.sent,c.abrupt("return",a);case 7:case"end":return c.stop()}},e)}))).apply(this,arguments)}var _Ce=function(){function e(n){Kf(this,e),Ai(this,"isLoaded",!1),Ai(this,"timer",null),Ai(this,"whiteCount",0),Ai(this,"maxLoopNumber",2),Ai(this,"isReport",!1),this.webCoreIns=n;var r=n.config.whiteScreenConfig||{},o=r.target,a=r.score,c=a===void 0?1.5:a;r.screenshot;var l=r.domDepth,d=l===void 0?6:l;this.target=o,this.score=c,this.screenshot=!1,this.domDepth=d,this.fetch=n.fetch}var t;return Yf(e,[{key:"init",value:function(){var n=this;window.addEventListener("load",function(){n.isLoaded=!0,n.handle()}),window.addEventListener("error",function(){n.isLoaded&&(n.whiteCount=n.maxLoopNumber,n.handle())})}},{key:"getTarget",value:function(){var n;try{n=this.target?document.querySelector(this.target):document.body}catch(r){console.log("sdk入参target有误:",this.target)}return n||console.log("sdk入参target有误:",this.target),n||document.body}},{key:"handle",value:function(){var n=Lw(this.getTarget(),0,0,this.score,this.domDepth);this.whiteCount+=1,n<=this.score?this.openLoopToJudge(n):this.whiteCount=0}},{key:"openLoopToJudge",value:function(n){var r=this;this.whiteCount>=this.maxLoopNumber?this.commit(n):this.timer=setTimeout(function(){var o=Lw(r.target,0,0,r.score,r.domDepth);r.whiteCount+=1,o<=r.score?(clearTimeout(r.timer),r.timer=null,r.openLoopToJudge(o)):(clearTimeout(r.timer),r.timer=null,r.whiteCount=0)},1e3)}},{key:"commit",value:(t=Hc(Cr().mark(function n(r){return Cr().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(!this.isReport){o.next=2;break}return o.abrupt("return");case 2:this.isReport=!0,this.screenshot&&yCe(this.fetch,this.webCoreIns.sid),this.webCoreIns.commit({type:"whiteScreen",score:r});case 5:case"end":return o.stop()}},n,this)})),function(n){return t.apply(this,arguments)})}]),e}(),eR={exports:{}},tR={},CCe=Ii,SCe=Bi,nR=Pa.f,ECe=So,rR=typeof window=="object"&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];tR.f=function(e){return rR&&CCe(e)==="Window"?function(t){try{return nR(t)}catch(n){return ECe(rR)}}(e):nR(SCe(e))};var xCe=Fe(function(){if(typeof ArrayBuffer=="function"){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}}),kCe=Fe,NCe=At,TCe=Ii,iR=xCe,xg=Object.isExtensible,ACe=kCe(function(){xg(1)})||iR?function(e){return!!NCe(e)&&(!iR||TCe(e)!=="ArrayBuffer")&&(!xg||xg(e))}:xg,OCe=!Fe(function(){return Object.isExtensible(Object.preventExtensions({}))}),ICe=pt,RCe=Ke,PCe=ch,LCe=At,C_=Yt,BCe=In.f,oR=Pa,DCe=tR,S_=ACe,MCe=OCe,sR=!1,Hi=eh("meta"),FCe=0,E_=function(e){BCe(e,Hi,{value:{objectID:"O"+FCe++,weakData:{}}})},$Ce=eR.exports={enable:function(){$Ce.enable=function(){},sR=!0;var e=oR.f,t=RCe([].splice),n={};n[Hi]=1,e(n).length&&(oR.f=function(r){for(var o=e(r),a=0,c=o.length;a<c;a++)if(o[a]===Hi){t(o,a,1);break}return o},ICe({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:DCe.f}))},fastKey:function(e,t){if(!LCe(e))return typeof e=="symbol"?e:(typeof e=="string"?"S":"P")+e;if(!C_(e,Hi)){if(!S_(e))return"F";if(!t)return"E";E_(e)}return e[Hi].objectID},getWeakData:function(e,t){if(!C_(e,Hi)){if(!S_(e))return!0;if(!t)return!1;E_(e)}return e[Hi].weakData},onFreeze:function(e){return MCe&&sR&&S_(e)&&!C_(e,Hi)&&E_(e),e}};PCe[Hi]=!0;var aR=eR.exports,zCe=pt,UCe=Ge,jCe=Ke,lR=bh,qCe=Rn,HCe=aR,GCe=Xp,WCe=Ss,KCe=ht,YCe=ms,x_=At,k_=Fe,JCe=xw,XCe=_o,QCe=Qp,cR=Ia,ZCe=Co,dR=ry,VCe=Pi,eSe=Ss,tSe=ms,nSe=Xp,rSe=H1,uR=_h,iSe=rw,Yd=wt,fR=aR.fastKey,hR=nn.set,N_=nn.getterFor,oSe={getConstructor:function(e,t,n,r){var o=e(function(u,f){eSe(u,a),hR(u,{type:t,index:cR(null),first:void 0,last:void 0,size:0}),Yd||(u.size=0),tSe(f)||nSe(f,u[r],{that:u,AS_ENTRIES:n})}),a=o.prototype,c=N_(t),l=function(u,f,p){var h,m,b=c(u),w=d(u,f);return w?w.value=p:(b.last=w={index:m=fR(f,!0),key:f,value:p,previous:h=b.last,next:void 0,removed:!1},b.first||(b.first=w),h&&(h.next=w),Yd?b.size++:u.size++,m!=="F"&&(b.index[m]=w)),u},d=function(u,f){var p,h=c(u),m=fR(f);if(m!=="F")return h.index[m];for(p=h.first;p;p=p.next)if(p.key===f)return p};return dR(a,{clear:function(){for(var u=c(this),f=u.first;f;)f.removed=!0,f.previous&&(f.previous=f.previous.next=void 0),f=f.next;u.first=u.last=void 0,u.index=cR(null),Yd?u.size=0:this.size=0},delete:function(u){var f=this,p=c(f),h=d(f,u);if(h){var m=h.next,b=h.previous;delete p.index[h.index],h.removed=!0,b&&(b.next=m),m&&(m.previous=b),p.first===h&&(p.first=m),p.last===h&&(p.last=b),Yd?p.size--:f.size--}return!!h},forEach:function(u){for(var f,p=c(this),h=VCe(u,arguments.length>1?arguments[1]:void 0);f=f?f.next:p.first;)for(h(f.value,f.key,this);f&&f.removed;)f=f.previous},has:function(u){return!!d(this,u)}}),dR(a,n?{get:function(u){var f=d(this,u);return f&&f.value},set:function(u,f){return l(this,u===0?0:u,f)}}:{add:function(u){return l(this,u=u===0?0:u,u)}}),Yd&&ZCe(a,"size",{configurable:!0,get:function(){return c(this).size}}),o},setStrong:function(e,t,n){var r=t+" Iterator",o=N_(t),a=N_(r);rSe(e,t,function(c,l){hR(this,{type:r,target:c,state:o(c),kind:l,last:void 0})},function(){for(var c=a(this),l=c.kind,d=c.last;d&&d.removed;)d=d.previous;return c.target&&(c.last=d=d?d.next:c.state.first)?uR(l==="keys"?d.key:l==="values"?d.value:[d.key,d.value],!1):(c.target=void 0,uR(void 0,!0))},n?"entries":"values",!n,!0),iSe(t)}},sSe=function(e,t,n){var r=e.indexOf("Map")!==-1,o=e.indexOf("Weak")!==-1,a=r?"set":"add",c=UCe[e],l=c&&c.prototype,d=c,u={},f=function(_){var C=jCe(l[_]);qCe(l,_,_==="add"?function(k){return C(this,k===0?0:k),this}:_==="delete"?function(k){return!(o&&!x_(k))&&C(this,k===0?0:k)}:_==="get"?function(k){return o&&!x_(k)?void 0:C(this,k===0?0:k)}:_==="has"?function(k){return!(o&&!x_(k))&&C(this,k===0?0:k)}:function(k,S){return C(this,k===0?0:k,S),this})};if(lR(e,!KCe(c)||!(o||l.forEach&&!k_(function(){new c().entries().next()}))))d=n.getConstructor(t,e,r,a),HCe.enable();else if(lR(e,!0)){var p=new d,h=p[a](o?{}:-0,1)!==p,m=k_(function(){p.has(1)}),b=JCe(function(_){new c(_)}),w=!o&&k_(function(){for(var _=new c,C=5;C--;)_[a](C,C);return!_.has(-0)});b||((d=t(function(_,C){WCe(_,l);var k=QCe(new c,_,d);return YCe(C)||GCe(C,k[a],{that:k,AS_ENTRIES:r}),k})).prototype=l,l.constructor=d),(m||w)&&(f("delete"),f("has"),r&&f("get")),(w||h)&&f(a),o&&l.clear&&delete l.clear}return u[e]=d,zCe({global:!0,constructor:!0,forced:d!==c},u),XCe(d,e),o||n.setStrong(d,e,r),d};sSe("Set",function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},oSe);var aSe=pt,pR=k1,lSe=ph,cSe=At,gR=Qc,dSe=Pn,uSe=Bi,fSe=V1,hSe=dt,pSe=So,gSe=Mh("slice"),mSe=hSe("species"),T_=Array,vSe=Math.max;aSe({target:"Array",proto:!0,forced:!gSe},{slice:function(e,t){var n,r,o,a=uSe(this),c=dSe(a),l=gR(e,c),d=gR(t===void 0?c:t,c);if(pR(a)&&(n=a.constructor,(lSe(n)&&(n===T_||pR(n.prototype))||cSe(n)&&(n=n[mSe])===null)&&(n=void 0),n===T_||n===void 0))return pSe(a,l,d);for(r=new(n===void 0?T_:n)(vSe(d-l,0)),o=0;l<d;l++,o++)l in a&&fSe(r,o,a[l]);return r.length=o,r}});var A_,ySe=pt,bSe=Jc,wSe=Ra.f,_Se=_s,mR=xr,CSe=tO,SSe=bo,ESe=nO,xSe=bSe("".slice),kSe=Math.min,vR=ESe("endsWith");ySe({target:"String",proto:!0,forced:!!(vR||(A_=wSe(String.prototype,"endsWith"),!A_||A_.writable))&&!vR},{endsWith:function(e){var t=mR(SSe(this));CSe(e);var n=arguments.length>1?arguments[1]:void 0,r=t.length,o=n===void 0?r:kSe(_Se(n),r),a=mR(e);return xSe(t,o-a.length,o)===a}});var kg,Jd,NSe=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Ng="js",Xd="resource",yR="unhandledrejection",Tg="cors",bR="vue",wR="react",_R={exports:{}},CR={exports:{}};kg="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Jd={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&Jd.rotl(e,8)|4278255360&Jd.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=Jd.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],n=0,r=0;n<e.length;n++,r+=8)t[r>>>5]|=e[n]<<24-r%32;return t},wordsToBytes:function(e){for(var t=[],n=0;n<32*e.length;n+=8)t.push(e[n>>>5]>>>24-n%32&255);return t},bytesToHex:function(e){for(var t=[],n=0;n<e.length;n++)t.push((e[n]>>>4).toString(16)),t.push((15&e[n]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],n=0;n<e.length;n+=2)t.push(parseInt(e.substr(n,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var r=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?t.push(kg.charAt(r>>>6*(3-o)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],n=0,r=0;n<e.length;r=++n%4)r!=0&&t.push((kg.indexOf(e.charAt(n-1))&Math.pow(2,-2*r+8)-1)<<2*r|kg.indexOf(e.charAt(n))>>>6-2*r);return t}},CR.exports=Jd;var TSe=CR.exports,O_={utf8:{stringToBytes:function(e){return O_.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(O_.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],n=0;n<e.length;n++)t.push(255&e.charCodeAt(n));return t},bytesToString:function(e){for(var t=[],n=0;n<e.length;n++)t.push(String.fromCharCode(e[n]));return t.join("")}}},SR=O_,ASe=function(e){return e!=null&&(ER(e)||function(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&ER(t.slice(0,0))}(e)||!!e._isBuffer)};function ER(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}(function(){var e=TSe,t=SR.utf8,n=ASe,r=SR.bin,o=function(a,c){a.constructor==String?a=c&&c.encoding==="binary"?r.stringToBytes(a):t.stringToBytes(a):n(a)?a=Array.prototype.slice.call(a,0):Array.isArray(a)||a.constructor===Uint8Array||(a=a.toString());for(var l=e.bytesToWords(a),d=8*a.length,u=1732584193,f=-271733879,p=-1732584194,h=271733878,m=0;m<l.length;m++)l[m]=16711935&(l[m]<<8|l[m]>>>24)|4278255360&(l[m]<<24|l[m]>>>8);l[d>>>5]|=128<<d%32,l[14+(d+64>>>9<<4)]=d;var b=o._ff,w=o._gg,_=o._hh,C=o._ii;for(m=0;m<l.length;m+=16){var k=u,S=f,E=p,T=h;u=b(u,f,p,h,l[m+0],7,-680876936),h=b(h,u,f,p,l[m+1],12,-389564586),p=b(p,h,u,f,l[m+2],17,606105819),f=b(f,p,h,u,l[m+3],22,-1044525330),u=b(u,f,p,h,l[m+4],7,-176418897),h=b(h,u,f,p,l[m+5],12,1200080426),p=b(p,h,u,f,l[m+6],17,-1473231341),f=b(f,p,h,u,l[m+7],22,-45705983),u=b(u,f,p,h,l[m+8],7,1770035416),h=b(h,u,f,p,l[m+9],12,-1958414417),p=b(p,h,u,f,l[m+10],17,-42063),f=b(f,p,h,u,l[m+11],22,-1990404162),u=b(u,f,p,h,l[m+12],7,1804603682),h=b(h,u,f,p,l[m+13],12,-40341101),p=b(p,h,u,f,l[m+14],17,-1502002290),u=w(u,f=b(f,p,h,u,l[m+15],22,1236535329),p,h,l[m+1],5,-165796510),h=w(h,u,f,p,l[m+6],9,-1069501632),p=w(p,h,u,f,l[m+11],14,643717713),f=w(f,p,h,u,l[m+0],20,-373897302),u=w(u,f,p,h,l[m+5],5,-701558691),h=w(h,u,f,p,l[m+10],9,38016083),p=w(p,h,u,f,l[m+15],14,-660478335),f=w(f,p,h,u,l[m+4],20,-405537848),u=w(u,f,p,h,l[m+9],5,568446438),h=w(h,u,f,p,l[m+14],9,-1019803690),p=w(p,h,u,f,l[m+3],14,-187363961),f=w(f,p,h,u,l[m+8],20,1163531501),u=w(u,f,p,h,l[m+13],5,-1444681467),h=w(h,u,f,p,l[m+2],9,-51403784),p=w(p,h,u,f,l[m+7],14,1735328473),u=_(u,f=w(f,p,h,u,l[m+12],20,-1926607734),p,h,l[m+5],4,-378558),h=_(h,u,f,p,l[m+8],11,-2022574463),p=_(p,h,u,f,l[m+11],16,1839030562),f=_(f,p,h,u,l[m+14],23,-35309556),u=_(u,f,p,h,l[m+1],4,-1530992060),h=_(h,u,f,p,l[m+4],11,1272893353),p=_(p,h,u,f,l[m+7],16,-155497632),f=_(f,p,h,u,l[m+10],23,-1094730640),u=_(u,f,p,h,l[m+13],4,681279174),h=_(h,u,f,p,l[m+0],11,-358537222),p=_(p,h,u,f,l[m+3],16,-722521979),f=_(f,p,h,u,l[m+6],23,76029189),u=_(u,f,p,h,l[m+9],4,-640364487),h=_(h,u,f,p,l[m+12],11,-421815835),p=_(p,h,u,f,l[m+15],16,530742520),u=C(u,f=_(f,p,h,u,l[m+2],23,-995338651),p,h,l[m+0],6,-198630844),h=C(h,u,f,p,l[m+7],10,1126891415),p=C(p,h,u,f,l[m+14],15,-1416354905),f=C(f,p,h,u,l[m+5],21,-57434055),u=C(u,f,p,h,l[m+12],6,1700485571),h=C(h,u,f,p,l[m+3],10,-1894986606),p=C(p,h,u,f,l[m+10],15,-1051523),f=C(f,p,h,u,l[m+1],21,-2054922799),u=C(u,f,p,h,l[m+8],6,1873313359),h=C(h,u,f,p,l[m+15],10,-30611744),p=C(p,h,u,f,l[m+6],15,-1560198380),f=C(f,p,h,u,l[m+13],21,1309151649),u=C(u,f,p,h,l[m+4],6,-145523070),h=C(h,u,f,p,l[m+11],10,-1120210379),p=C(p,h,u,f,l[m+2],15,718787259),f=C(f,p,h,u,l[m+9],21,-343485551),u=u+k>>>0,f=f+S>>>0,p=p+E>>>0,h=h+T>>>0}return e.endian([u,f,p,h])};o._ff=function(a,c,l,d,u,f,p){var h=a+(c&l|~c&d)+(u>>>0)+p;return(h<<f|h>>>32-f)+c},o._gg=function(a,c,l,d,u,f,p){var h=a+(c&d|l&~d)+(u>>>0)+p;return(h<<f|h>>>32-f)+c},o._hh=function(a,c,l,d,u,f,p){var h=a+(c^l^d)+(u>>>0)+p;return(h<<f|h>>>32-f)+c},o._ii=function(a,c,l,d,u,f,p){var h=a+(l^(c|~d))+(u>>>0)+p;return(h<<f|h>>>32-f)+c},o._blocksize=16,o._digestsize=16,_R.exports=function(a,c){if(a==null)throw new Error("Illegal argument "+a);var l=e.wordsToBytes(o(a,c));return c&&c.asBytes?l:c&&c.asString?r.bytesToString(l):e.bytesToHex(l)}})();var OSe=Cse(_R.exports);function ISe(e){var t=e.match(NSe);return t?{filename:t[2],functionName:t[1]||"",lineno:parseInt(t[3],10)||void 0,colno:parseInt(t[4],10)||void 0}:{}}function Ag(e){var t=(e||{stack:""}).stack;if(!t)return[];var n,r=[],o=Jv(t.split(`
|
|
144
|
-
`).slice(1));try{for(o.s();!(n=o.n()).done;){var a=ISe(n.value);a&&r.push(a)}}catch(c){o.e(c)}finally{o.f()}return r.slice(0,10)}var Bl=function(e){return OSe(e).toString()},I_=function(e){return e instanceof ErrorEvent?e.message==="Script error."?Tg:Ng:Xd},RSe=function(){function e(t){Kf(this,e),Ai(this,"errorIdSet",new Set),this.webCoreIns=t,this.errorIdSet=new Set}return Yf(e,[{key:"init",value:function(){var t;if(this.initJsError(),this.initResourceError(),this.initPromiseError(),this.initCorsError(),(t=window.__QAPM__)!==null&&t!==void 0&&(t=t.q)!==null&&t!==void 0&&t.length){var n={error:this.onJSError.bind(this),reject:this.onPromiseError.bind(this)};window.__QAPM__.q.forEach(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=r.type,a=r.event,c=n[o];c&&c(a)}),window.__QAPM__.q=[]}}},{key:"initJsError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onJSError(n)},!0)}},{key:"initResourceError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onResourceError(n)},!0)}},{key:"initPromiseError",value:function(){var t=this;window.addEventListener("unhandledrejection",function(n){return t.onPromiseError(n)},!0)}},{key:"initCorsError",value:function(){var t=this;window.addEventListener("error",function(n){return function(r){if(I_(r)===Tg){var o={errorType:Tg,errorMessage:r.message,errorSummary:"CorsError",errorId:Bl("".concat(Tg,"-").concat(r.message))};t.commit(o)}}(n)},!0)}},{key:"onResourceError",value:function(t){if(I_(t)===Xd){var n=t.target||t.srcElement,r=n.src||n.href,o=JSON.stringify(Xd+": "+r||"UnKnown Resource"),a={errorType:Xd,errorMessage:o,errorSummary:"ResourceError",errorId:Bl("".concat(Xd,"-").concat(o))};this.commit(a)}}},{key:"onJSError",value:function(t){var n,r;if(I_(t)===Ng){var o=JSON.stringify(t.message),a=function(l){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unknown";if(!l)return d;try{var u=new URL(l);return u.pathname&&u.pathname.endsWith(".js")?l:d}catch(f){return l}}(t.filename,(n=this.webCoreIns.config)===null||n===void 0?void 0:n.appKey),c={errorType:Ng,errorMessage:o,errorSummary:t.error&&((r=t.error)===null||r===void 0?void 0:r.name)||"UnKnown",errorStack:JSON.stringify(Ag(t.error)),errorId:Bl("".concat(Ng,"-").concat(o,"-").concat(a))};this.commit(c)}}},{key:"onPromiseError",value:function(t){var n,r,o=JSON.stringify(((n=t.reason)===null||n===void 0?void 0:n.message)||t.reason||"UnKnown"),a=((r=t.reason)===null||r===void 0?void 0:r.name)||"UnKnown",c={errorType:yR,errorMessage:o,errorSummary:a,errorStack:JSON.stringify(Ag(t.reason)),errorId:Bl("".concat(yR,"-").concat(o,"-").concat(a))};this.commit(c)}},{key:"onVueError",value:function(t,n,r){var o=JSON.stringify(t.message),a={errorType:bR,errorMessage:o,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Ag(t)),errorId:Bl("".concat(bR,"-").concat(o,"-").concat(t.name))};this.commit(a)}},{key:"onReactError",value:function(t,n){var r=JSON.stringify(t.message),o={errorType:wR,errorMessage:r,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Ag(t)),errorId:Bl("".concat(wR,"-").concat(r,"-").concat(t.name))};console.log(o),this.commit(o)}},{key:"commit",value:function(t){var n=t.errorId;this.errorIdSet.has(n)||(this.errorIdSet.add(n),this.webCoreIns.commit(qc({type:"error"},t)))}}]),e}(),PSe=function(e){function t(){var o,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Kf(this,t),(o=wse(this,t,[a])).config=a,o.isReport()?(o.PerformancePluginInstance=new V3e(Gc(o)),o.WhiteScreenPluginInstance=new _Ce(Gc(o)),o.ErrorPluginInstance=new RSe(Gc(o)),o.plugins=[o.PerformancePluginInstance,o.WhiteScreenPluginInstance,o.ErrorPluginInstance],o.init(),jS(t,t,Dl,Gc(o)),o):$S(o)}var n,r;return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(a&&a.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),a&&Yv(o,a)}(t,bwe),Yf(t,[{key:"isReport",value:function(){var o=this.isIE(),a=this.calcRatio();return this.config.appKey&&a&&!o}},{key:"init",value:(r=Hc(Cr().mark(function o(){return Cr().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:this.initTime(this.mixed()),this.plugins.forEach(function(c){c.init()});case 2:case"end":return a.stop()}},o,this)})),function(){return r.apply(this,arguments)})},{key:"mixed",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=this.uid(),c=this.getTime(),l=c.time,d=c.date,u=this.getUA(),f=window.location,p=f.host,h=f.origin,m=f.pathname;return qc(qc({uid:a,sid:this.sid,url:window.location.href,host:p,fullPath:h+m,sdkVersion:this.sdkVersion,createDate:d,appKey:this.config.appKey,createTime:l,appVersion:this.appVersion,env:this.env},u),o)}},{key:"commit",value:(n=Hc(Cr().mark(function o(a){var c,l;return Cr().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:c=this.mixed(a),l=new URL("".concat(window.location.protocol,"//").concat(this.host,"/log.gif")),Object.entries(c).map(function(u){var f=_se(u,2),p=f[0],h=f[1];l.searchParams.set(p,h)}),new Image().src=l.toString();case 5:case"end":return d.stop()}},o,this)})),function(o){return n.apply(this,arguments)})}],[{key:"install",value:function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Xf(t,t,Dl)||(o.config.errorHandler=function(c,l,d){Xf(t,t,Dl).ErrorPluginInstance.onVueError(c,l,d),console.error(c)},jS(t,t,Dl,new t(a)))}},{key:"sendError",value:function(o){Xf(t,t,Dl)?Xf(t,t,Dl).ErrorPluginInstance.onReactError(o):console.error("QAPM: 请先初始化 QAPM!")}}]),t}(),Dl={writable:!0,value:null};const CNe="",SNe="",LSe={components:{InfoFilled:Pm,ArrowRight:Im},mixins:[jr],inject:["hasLevel"],props:{axis:{required:!0,type:Object,default:()=>({x:0,y:0})},show:{required:!0,type:Boolean,default:!1},nodeInfo:{required:!0,type:Array,default:()=>[]},menuOptions:{required:!0,type:Array,default:()=>[]},border:{type:Boolean,required:!1,default:!0},itemWidth:{type:Number,required:!1,default:206},itemHeight:{type:Number,required:!1,default:36},itemSize:{type:Number,required:!1,default:14},offset:{type:Object,required:!1,default:()=>({x:6,y:2})},borderWidth:{type:Number,required:!1,default:6},history:{type:Object,required:!0,default:()=>{}},moduleDetail:{type:Object,required:!0,default:()=>{}}},emits:["contextmenu-click"],data(){return{checkedItems:{},globalMenus:JZ,maxMulti:6}},computed:{checkboxMenu(){return this.nodeInfo.length>1?[]:this.menuOptions},canGoDetail(){var e,t,n,r;return((t=(e=this.moduleDetail)==null?void 0:e.config)==null?void 0:t.jumpDetail)&&((r=this.moduleDetail)==null?void 0:r.config.jumpRule[(n=this.nodeInfo[0])==null?void 0:n.type])},systemMenu(){var r,o,a,c,l,d,u;const e=[];if(this.nodeInfo.length===1){const f=this.nodeInfo[0];f.type!=="aggregation"&&f.type!=="nodeType"&&(e.push(iv),(r=this.history.keyNodeIds)!=null&&r.some(_=>_===f.id)||(e.push(av),(a=(o=this.moduleDetail)==null?void 0:o.config)!=null&&a.hideCollectMenu||e.push(f.collect?sv:ov),e.push(f.textProp==="name"?tv:ev),f.label&&e.push(f.textProp==="label"?nv:rv)),this.canGoDetail&&e.push(K5)),e.push(f.fx?V0:Z0);const p=this.history.dataNow.links.some(w=>w.source.id===f.id&&w.target.type==="aggregation"),b=this.history.dataNow.links.filter(w=>w.source.id===f.id).map(w=>w.target).some(w=>{let _=0;return this.history.dataNow.links.map(C=>{C.source.id===w.id&&_++}),_===0});p||f.type==="aggregation"?e.push(H5):b&&e.push(q5),b&&e.push(j5),e.push(lv)}else this.nodeInfo.length>1?(e.push(av,iv),e.push(this.nodeInfo.some(p=>!p.collect)?ov:sv),this.nodeInfo.some(p=>p.label)&&e.push(this.nodeInfo.some(p=>p.textProp!=="label")?rv:nv),e.push(this.nodeInfo.some(p=>p.textProp!=="name")?ev:tv),e.push(this.nodeInfo.some(p=>!p.fx)?Z0:V0),e.push(lv)):this.nodeInfo.length===0&&(this.history.dataNow.nodes.some(p=>p.label)&&e.push(this.history.dataNow.nodes.some(p=>p.textProp!=="label")?$5:F5),e.push(this.history.dataNow.nodes.some(p=>p.textProp!=="name")?D5:M5),e.push(this.history.dataNow.nodes.some(p=>!p.fx)?L5:B5),this.history.currentIndex>0&&e.push(z5),this.history.currentIndex<this.history.length-1&&e.push(U5));const t=(c=this.nodeInfo[0])==null?void 0:c.type,n=(u=(d=(l=this.nodeInfo[0])==null?void 0:l.detail)==null?void 0:d.info)==null?void 0:u.extraNodeContextMenus;return t!=="nodeType"&&(n!=null&&n.length)&&(n.forEach(f=>{f.icon||(f.icon="button_edit_label")}),e.push(...n)),e},totalHeight(){let e=this.menuOptions.length*(this.itemHeight+5)+10+44+48+5,t=this.systemMenu.length*(this.itemHeight+5)+10+44+5;return e=this.menuOptions.length===0?0:44,t=this.systemMenu.length===0?0:44,e+t},axisComputed(){const e=document.getElementsByClassName("d3-container")[0],t=this.axis.top-e.offsetTop;return{top:(t<e.offsetHeight/2?Math.min(t+this.offset.y,Math.max(e.offsetHeight-this.totalHeight,e.getBoundingClientRect().top)):Math.max(t+this.offset.y,this.totalHeight+e.getBoundingClientRect().top))+"px",left:this.axis.left+this.offset.x+"px",transform:`translate(${this.axis.left>e.offsetWidth/2?"-100%":"0%"}, ${t>e.offsetHeight/2?"-100%":"0%"})`}},liStyle(){return{width:this.itemWidth+"px",height:this.itemHeight+"px",lineHeight:this.itemHeight+"px",fontSize:this.itemSize+"px"}},firstLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*2>=e},secondLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*3>=e},checkedItemsFinal(){return Object.keys(this.checkedItems).filter(e=>this.checkedItems[e]).map(e=>this.checkedItems[e])},haveInterface(){let e=!1;return this.menuOptions.map(t=>{t.type===1&&(e=!0)}),e}},watch:{show(){this.checkedItems={}}},methods:{handleCollapse(){},isSystemItem(e){return e.type===2},isExternalItem(e){return e.type===3},hasChildren(e){var t;return((t=e==null?void 0:e.children)==null?void 0:t.length)>0},onCheck(e,t){this.checkedItems[t.name]=e.currentTarget.checked?t:!1},secondBorderCheck(e,t=0){const n=document.body.offsetWidth,r=document.body.offsetHeight,o=this.axis.top+(e+t)*this.itemHeight;return{width:this.itemWidth*2+60+"px",left:this.axis.left+this.itemWidth*2>=n?"-100%":"100%",top:r>=o?0:"auto",bottom:r<o?0:"auto"}},thirdBorderCheck(e,t,n,r){const o=document.body.offsetWidth,a=document.body.offsetHeight,c=this.secondBorderCheck(e,n).top;let l;const d=(t+r)*this.itemHeight,u=d>180?180:d;return c===0?l=this.axis.top+e*this.itemHeight+u:l=this.axis.top-e*this.itemHeight+u,{left:this.axis.left+this.itemWidth*3>=o?"-100%":"100%",bottom:a>=l?0:"auto",top:a<l?0:"auto"}},handleClick(e,t){if(!t){if(en({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),e.has_child>0)return!1;ye(this,"contextmenu-click",{nodes:this.nodeInfo,api:e})}},handleDataClick(e,t){en({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),ye(this,"contextmenu-click",{nodes:this.nodeInfo,api:t,dataApi:e}),this.checkedItems={}}}},Ml=e=>(s.pushScopeId("data-v-dd8dd8d0"),e=e(),s.popScopeId(),e),BSe={"aria-hidden":"true",style:{position:"absolute",width:"0",height:"0",overflow:"hidden",display:"none"}},DSe=[Ml(()=>s.createElementVNode("symbol",{id:"icon-arrow-right",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{d:"M288.791335 65.582671l446.41733 446.417329-446.41733 446.417329z"})],-1))],MSe={class:"cm-list"},FSe={class:"cm-ul"},$Se={class:"hd"},zSe=["src"],USe={class:"bd"},jSe={class:"cm-ul cm-ul-level1"},qSe=["title"],HSe=Ml(()=>s.createElementVNode("svg",{class:"icon","aria-hidden":"true"},[s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"})],-1)),GSe=["title","onClick"],WSe=["title","onClick"],KSe={key:0,class:"icon","aria-hidden":"true"},YSe=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],JSe=["title","onClick"],XSe=["src"],QSe=Ml(()=>s.createElementVNode("div",{class:"bd"},null,-1)),ZSe=["title","onClick"],VSe={key:0,class:"fas el-icon-fa-cog"},e9e={key:1,class:"fas el-icon-fa-external-link-alt"},t9e={class:"text-wrapper"},n9e=["src"],r9e=["src"],i9e={key:3,class:"shortcut"},o9e={key:2,class:"icon","aria-hidden":"true"},s9e=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],a9e=["title","onClick"],l9e={key:1,class:"icon","aria-hidden":"true"},c9e=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],d9e=["title","onClick"];function u9e(e,t,n,r,o,a){const c=s.resolveComponent("ArrowRight"),l=Qe,d=s.resolveComponent("InfoFilled"),u=Hn;return n.show?(s.openBlock(),s.createElementBlock("div",{key:0,class:"cm-container",style:s.normalizeStyle(a.axisComputed),onClick:t[1]||(t[1]=s.withModifiers((...f)=>a.handleCollapse&&a.handleCollapse(...f),["stop"]))},[(s.openBlock(),s.createElementBlock("svg",BSe,DSe)),s.createElementVNode("div",MSe,[s.createElementVNode("ul",FSe,[a.checkboxMenu.length>0?(s.openBlock(),s.createElementBlock("li",{key:0,class:"cm-li data-opt-wrapper",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",$Se,[s.createElementVNode("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,zSe),s.createTextVNode("按关系分类拓线"),s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(c)]),_:1})]),s.createElementVNode("div",USe,[s.createElementVNode("ul",jSe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.checkboxMenu,(f,p)=>(s.openBlock(),s.createElementBlock("li",{key:p,class:"cm-li context-one",style:s.normalizeStyle(a.liStyle)},[a.hasChildren(f)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["cm-item",a.firstLeft?"cm-left":""]),title:f.namec},[s.createElementVNode("span",null,s.toDisplayString(f.namec),1),HSe],10,qSe)):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["cm-item",a.firstLeft?"cm-left":""]),title:f.namec,onClick:s.withModifiers(h=>a.handleDataClick(f,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(f.namec),1)],10,GSe)),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("ul",{key:2,class:"cm-ul cm-ul-level2",style:s.normalizeStyle(a.secondBorderCheck(p,f.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.children,(h,m)=>(s.openBlock(),s.createElementBlock("li",{key:m,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",a.secondLeft?"cm-left":""]),title:h.namec,onClick:s.withModifiers(b=>a.handleDataClick(h,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(h.namec),1),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("svg",KSe,YSe)):s.createCommentVNode("",!0)],10,WSe),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level3",style:s.normalizeStyle(a.thirdBorderCheck(p,m,f.children.length,h.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h.children,(b,w)=>(s.openBlock(),s.createElementBlock("li",{key:w,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:"cm-item",title:b.namec,onClick:s.withModifiers(_=>a.handleDataClick(b,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(b.namec),1)],8,JSe)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))])])],4)):n.nodeInfo.length>1&&n.nodeInfo.length<o.maxMulti?(s.openBlock(),s.createElementBlock("li",{key:1,class:"cm-li data-opt-wrapper data-opt-all",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:"hd",onClick:t[0]||(t[0]=s.withModifiers(f=>a.handleDataClick(null,o.globalMenus.expandNode),["stop"]))},[s.createElementVNode("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,XSe),s.createTextVNode("展开全部关系 ")]),QSe],4)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.systemMenu,(f,p)=>(s.openBlock(),s.createElementBlock("li",{key:p,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{"cm-left":a.firstLeft,disabled:f.disabled}]),title:f.namec,onClick:s.withModifiers(h=>a.handleClick(f,f.disabled),["stop"])},[a.isSystemItem(f)?(s.openBlock(),s.createElementBlock("i",VSe)):a.isExternalItem(f)?(s.openBlock(),s.createElementBlock("i",e9e)):s.createCommentVNode("",!0),s.createElementVNode("div",t9e,[f.icon?(s.openBlock(),s.createElementBlock("img",{key:0,src:e.imgPath["./public/d3svg1/button18/"+f.icon+".svg"],class:"t-icon"},null,8,n9e)):(s.openBlock(),s.createElementBlock("img",{key:1,src:e.imgPath["./public/d3svg1/button18/button_"+f.name+".svg"],class:"t-icon"},null,8,r9e)),f.tooltip?(s.openBlock(),s.createBlock(u,{key:2,class:"el-icon-info",effect:"dark",content:f.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(f.namec),1),f.shortcut?(s.openBlock(),s.createElementBlock("span",i9e,s.toDisplayString(f.shortcut),1)):s.createCommentVNode("",!0)]),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("svg",o9e,s9e)):s.createCommentVNode("",!0)],10,ZSe),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level2",style:s.normalizeStyle(a.secondBorderCheck(p,f.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.children,(h,m)=>(s.openBlock(),s.createElementBlock("li",{key:m,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{"cm-left":a.secondLeft,disabled:f.disabled||h.disabled}]),title:h.namec,onClick:s.withModifiers(b=>a.handleClick(h,f.disabled||h.disabled),["stop"])},[h.tooltip?(s.openBlock(),s.createBlock(u,{key:0,class:"el-icon-info",effect:"dark",content:h.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(h.namec),1),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("svg",l9e,c9e)):s.createCommentVNode("",!0)],10,a9e),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level3",style:s.normalizeStyle(a.thirdBorderCheck(p,m,f.children.length,h.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h.children,(b,w)=>(s.openBlock(),s.createElementBlock("li",{key:w,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{disabled:f.disabled||h.disabled||b.disabled}]),title:b.namec,onClick:s.withModifiers(_=>a.handleClick(b,f.disabled||h.disabled||b.disabled),["stop"])},[b.tooltip?(s.openBlock(),s.createBlock(u,{key:0,class:"el-icon-info",effect:"dark",content:b.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(b.namec),1)],10,d9e)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))])])],4)):s.createCommentVNode("",!0)}const f9e=Bt(LSe,[["render",u9e],["__scopeId","data-v-dd8dd8d0"]]),TNe="",ANe="",ONe="",INe="",h9e={name:"Popover",components:{ForceGraphSvgIcon:ss},mixins:[jr],inject:["levelList","hasLevel"],props:{showPopover:{type:Boolean,default:!1},mousePosition:{type:Object,default:()=>({left:0,top:0})},nodeInfo:{type:Object,default:()=>{}},type:{type:String,default:"node"},moduleDetail:{type:Object,default:()=>{}},data:{type:Object,default:()=>{}},darkMode:{type:Boolean,default:!0},history:{type:Object,default:()=>({})}},data(){return{showSelf:!1,onPop:!1,position:null,aggregationList:[]}},computed:{show(){return this.showPopover||this.showSelf},name(){var e,t,n;return((n=(t=(e=this.nodeInfo)==null?void 0:e.detail)==null?void 0:t.info)==null?void 0:n.name)||this.nodeInfo.name},isNormalNode(){return this.nodeInfo.type!=="nodeType"&&this.nodeInfo.type!=="aggregation"},isNodeTypeNode(){return this.nodeInfo.type==="nodeType"},isAggregateNode(){return this.nodeInfo.type==="aggregation"},fieldMapThisType(){var e;return this.moduleDetail.detail_field_map&&this.moduleDetail.detail_field_map[`${(e=this.nodeInfo)==null?void 0:e.type}_detail_info`]},canGoDetail(){return["nodeType","aggregation","family","org","report","vul","thumbprint_md5","email","cert_https"].indexOf(this.nodeInfo.type)<0}},watch:{mousePosition(){setTimeout(()=>{var l,d,u;const e=this.mousePosition.left>document.body.offsetWidth/2,t=this.mousePosition.top>document.body.offsetHeight/2,n=(l=document.getElementsByClassName("popover-container")[0])==null?void 0:l.offsetHeight,r=(d=document.getElementsByClassName("d3-container")[0])==null?void 0:d.offsetHeight,o=(u=document.getElementsByClassName("d3-container")[0])==null?void 0:u.getBoundingClientRect().top;let a;t?a=Math.max(this.mousePosition.top,n+o)+5:a=Math.min(this.mousePosition.top,Math.max(r-n,o))-5;const c={left:(e?this.mousePosition.left+2:this.mousePosition.right-2)+"px",top:a+"px",transform:`translate(${e?"-100%":"0%"}, ${t?"-100%":"0%"})`};this.position=c},100)},nodeInfo:{handler:function(){var t;const e=(((t=this.nodeInfo)==null?void 0:t.list)||[]).map(n=>{var o,a,c;const r=n.detail;return ue(ae({},n),{name:((o=r==null?void 0:r.info)==null?void 0:o.name)||n.name,level:((c=(a=r==null?void 0:r.info)==null?void 0:a.basic)==null?void 0:c.level)||""})});e==null||e.sort((n,r)=>{var c,l;const o=(c=this.levelList.find(d=>d.level===n.level))==null?void 0:c.dangerNumber;return((l=this.levelList.find(d=>d.level===r.level))==null?void 0:l.dangerNumber)-o}),this.aggregationList=e},immediate:!0}},methods:{handleMouseEnter(){this.showSelf=!0},handleMouseLeave(){this.showSelf=!1},isSomething(e){return j0(e)},getTypeZh(e){var n,r,o;let t=e;if(e==="nodeType")t="关系节点";else for(const a in(n=this.moduleDetail)==null?void 0:n.nodes)if(e===((r=this.moduleDetail)==null?void 0:r.nodes[a].name)){t=(o=this.moduleDetail)==null?void 0:o.nodes[a].namec;break}return t},getLevelClass(e){return of(e,this.levelList)},getColorStyle(e){return as(e,this.levelList,this.darkMode)},getNodeTypeChildNum(e){var o;const t=(o=this.data)==null?void 0:o.links,n=[],r=[];return t==null||t.map(a=>{a.source.id===e&&(n.push(a.target.id),a.target.detail&&UQ(a.target.detail.info.basic.level,this.levelList)&&r.push(a.target.id))}),{allChildNum:n.length,dangerChildNum:r.length}},canShowField(e){const t=this.hasFieldValue(e);return!(t===void 0||e.hide_hover||e.hide_empty&&!t)},hasFieldValue(e){const t=this.nodeInfo.detail&&this.nodeInfo.detail.info&&this.nodeInfo.detail.info.basic[e.prop];if(t===null)return;const n=Array.isArray(t);return n&&t.length>0||!n&&t!==""&&t!=="无"},getFieldValue(e){const t=this.nodeInfo.detail.info.basic[e.prop],n=Array.isArray(t),r=this.isSomething(t);let o="-";return r&&(n?o=t.length?t.join("|"):"-":o=t||"-"),o},formatTags(e){return cf(df(e))},addToGraph(e){const t={type:"addFromAggregation",addOne:{nodes:[e],links:[{source:this.nodeInfo.relationId,target:e.id}]}};if(this.aggregationList=this.aggregationList.filter(n=>n.id!==e.id),this.history.updateAggregationNode(this.aggregationList,this.nodeInfo.id),this.history.pushState(t),this.aggregationList.length)ye(qe,"emitDataLoaded");else{const n=this.nodeInfo,r={deleteOne:{nodes:[n],links:[{source:n.relationId,target:n.id}]},type:"aggregation"};setTimeout(()=>{this.history.pushState(r),ye(qe,"emitDataLoaded")},0)}}}},Fl=e=>(s.pushScopeId("data-v-a8e278b3"),e=e(),s.popScopeId(),e),p9e={key:0,class:"node-info-container"},g9e={class:"popover-block popover-header"},m9e={key:0,class:"popover-collect"},v9e={key:1,class:"row-item"},y9e={class:"label"},b9e={key:2,class:"row-item"},w9e=Fl(()=>s.createElementVNode("div",{class:"label"},"关系节点:",-1)),_9e={class:"value"},C9e={class:"node-type-info"},S9e={class:"name"},E9e={key:3,class:"row-item"},x9e=Fl(()=>s.createElementVNode("div",{class:"label"},"备注:",-1)),k9e={class:"value"},N9e={class:"popover-block popover-fields"},T9e={key:0,class:"node-detail top-border"},A9e={key:0,class:"row-item"},O9e=Fl(()=>s.createElementVNode("div",{class:"label"},"危险级别:",-1)),I9e=["title"],R9e={key:1,class:"row-item row-item-tag"},P9e=Fl(()=>s.createElementVNode("div",{class:"label"},"标签:",-1)),L9e={class:"value"},B9e={class:"graph-tags-box"},D9e=Fl(()=>s.createElementVNode("br",null,null,-1)),M9e={key:0,class:"row-item"},F9e={class:"label"},$9e=["title"],z9e={key:1,class:"node-statistics top-border"},U9e={class:"row-item node-num"},j9e=Fl(()=>s.createElementVNode("div",{class:"label"},"拓展节点统计:",-1)),q9e={class:"value"},H9e={key:0},G9e={class:"danger"},W9e={key:2,class:"node-aggregation"},K9e={class:"aggregation-title"},Y9e={class:"aggregation-box"},J9e={key:1,class:"node-info-container"},X9e={class:"popover-fields"},Q9e={class:"top"};function Z9e(e,t,n,r,o,a){const c=s.resolveComponent("force-graph-svg-icon"),l=Hn,d=xc,u=CX,f=ns,p=_X;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["popover-container",a.show?"show-popover":"hide-popover"]),style:s.normalizeStyle(o.position),onMouseenter:t[0]||(t[0]=(...h)=>a.handleMouseEnter&&a.handleMouseEnter(...h)),onMouseleave:t[1]||(t[1]=(...h)=>a.handleMouseLeave&&a.handleMouseLeave(...h))},[s.createElementVNode("div",null,[n.type==="node"?(s.openBlock(),s.createElementBlock("div",p9e,[s.createElementVNode("div",g9e,[n.nodeInfo.collect?(s.openBlock(),s.createElementBlock("div",m9e,[s.createVNode(l,{content:"已收藏","popper-class":"el-tooltip-gray",placement:"left"},{default:s.withCtx(()=>[s.createVNode(c,{class:"button-img","icon-class":e.imgPath["./public/d3svg1/star.svg"]},null,8,["icon-class"])]),_:1})])):s.createCommentVNode("",!0),a.isNormalNode?(s.openBlock(),s.createElementBlock("div",v9e,[s.createElementVNode("div",y9e,s.toDisplayString(a.getTypeZh(n.nodeInfo.type))+":",1),s.createElementVNode("div",{class:s.normalizeClass(["value",{"star-next":n.nodeInfo.collect}])},s.toDisplayString(a.name),3)])):s.createCommentVNode("",!0),a.isNodeTypeNode?(s.openBlock(),s.createElementBlock("div",b9e,[w9e,s.createElementVNode("div",_9e,[s.createElementVNode("div",C9e,[s.createElementVNode("div",S9e,s.toDisplayString(n.nodeInfo.name),1)])])])):s.createCommentVNode("",!0),n.nodeInfo.label?(s.openBlock(),s.createElementBlock("div",E9e,[x9e,s.createElementVNode("div",k9e,s.toDisplayString(n.nodeInfo.label),1)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",N9e,[a.isNormalNode&&n.nodeInfo.detail?(s.openBlock(),s.createElementBlock("div",T9e,[a.canGoDetail&&a.hasLevel?(s.openBlock(),s.createElementBlock("div",A9e,[O9e,s.createElementVNode("div",{class:s.normalizeClass(["value level",a.getLevelClass(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level)]),title:n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"},s.toDisplayString(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"),11,I9e)])):s.createCommentVNode("",!0),n.nodeInfo.detail&&n.nodeInfo.detail.tags&&n.nodeInfo.detail.tags.length>0?(s.openBlock(),s.createElementBlock("div",R9e,[P9e,s.createElementVNode("div",L9e,[s.createElementVNode("div",B9e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.formatTags(n.nodeInfo.detail.tags),(h,m)=>(s.openBlock(),s.createBlock(l,{key:m,"popper-class":"el-tooltip-gray"},{content:s.withCtx(()=>[s.createElementVNode("div",null,[s.createTextVNode(s.toDisplayString(h.name===h.desc?h.name:h.name+":"+h.desc)+" ",1),h.disabled?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[D9e,s.createTextVNode(" 标签状态:失效 ")],64)):s.createCommentVNode("",!0)])]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createVNode(d,{class:s.normalizeClass(["graph-tag-one",`${h.type||"unknown"} ${h.disabled?"tag-disable":""}`]),type:h.type||"info"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(h.name),1)]),_:2},1032,["class","type"])])]),_:2},1024))),128))])])])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.fieldMapThisType,(h,m)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[a.canShowField(h)?(s.openBlock(),s.createElementBlock("div",M9e,[s.createElementVNode("div",F9e,s.toDisplayString(h.zh)+":",1),s.createElementVNode("div",{class:s.normalizeClass(["value",{red:h.prop==="virus_name"}]),title:n.nodeInfo.detail.info.basic[m]},s.toDisplayString(a.getFieldValue(h)),11,$9e)])):s.createCommentVNode("",!0)],64))),256))])):s.createCommentVNode("",!0),a.isNodeTypeNode?(s.openBlock(),s.createElementBlock("div",z9e,[s.createElementVNode("div",U9e,[j9e,s.createElementVNode("div",q9e,[a.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum>0?(s.openBlock(),s.createElementBlock("span",H9e,[s.createElementVNode("span",G9e,s.toDisplayString(a.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum),1),s.createTextVNode("/")])):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.getNodeTypeChildNum(n.nodeInfo.id).allChildNum),1)])])])):s.createCommentVNode("",!0),a.isAggregateNode?(s.openBlock(),s.createElementBlock("div",W9e,[s.createElementVNode("div",K9e,"聚合节点 ("+s.toDisplayString(o.aggregationList.length)+"个)",1),s.createElementVNode("div",Y9e,[s.createVNode(p,{data:o.aggregationList,style:{width:"100%"}},{default:s.withCtx(()=>[s.createVNode(u,{prop:"name","min-width":"200",label:"名称"}),s.createVNode(u,{sortable:"",prop:"type",label:"类型"}),s.createVNode(u,{sortable:"",prop:"level",width:"80",label:"级别"},{default:s.withCtx(h=>[s.createElementVNode("span",{style:s.normalizeStyle({color:a.getColorStyle(h.row.level)})},s.toDisplayString(h.row.level||"--"),5)]),_:1}),s.createVNode(u,{label:"操作"},{default:s.withCtx(h=>[s.createVNode(f,{class:"add-to-graph-btn",type:"primary",text:"",size:"small",onClick:m=>a.addToGraph(h.row)},{default:s.withCtx(()=>[s.createTextVNode(" 添加到图谱 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])])):s.createCommentVNode("",!0)])])):(s.openBlock(),s.createElementBlock("div",J9e,[s.createElementVNode("div",X9e,[s.createElementVNode("div",Q9e,s.toDisplayString(n.nodeInfo.apiName),1)])]))])],38)}const V9e=Bt(h9e,[["render",Z9e],["__scopeId","data-v-a8e278b3"]]),eEe=[{id:52,product_id:0,name:"copy",namec:"复制",parent_id:0,has_child:0,status:0,type:2,path:"0-52",pos:65,ctime:"0000-00-00 00:00:00",utime:"2019-06-04 16:49:38",children:[]},{id:62,product_id:0,name:"release_aggregation",namec:"释放聚合顶点",parent_id:0,has_child:0,status:0,is_sys:0,is_detail:0,type:2,path:"0-62",pos:1,ctime:"0000-00-00 00:00:00",utime:"2019-05-06 15:08:10",children:[]}],tEe={name:"vue-safe-force-graph",version:"2.0.48",description:"force_graph in security area",author:"jason zhang",module:"./lib/vue-safe-force-graph.js",main:"./lib/vue-safe-force-graph.umd.cjs",type:"module",files:["/lib/"],exports:{".":{import:"./lib/vue-safe-force-graph.js",require:"./lib/vue-safe-force-graph.umd.cjs"},"./*":"./*"},scripts:{dev:"vite","dev:base64":"vite --mode development_base64",lib:"vite build","lib:base64":"vite build --mode production_base64",patch:'npm version patch -m "Upgrade to %s "',"patch:base64":'npm version patch -m "Upgrade to %s for base64"',p:"npm run patch && npm run lib && npm publish","p:base64":"npm run patch:base64 && npm run lib:base64 && npm publish",lint:"eslint --ext .js,.vue src",lintFix:"eslint --fix --ext .js,.vue src",imageToCdn:"node qcdn.cjs",imageToBase64:"node qcdn.cjs --buildtype=base64",changelog:"conventional-changelog -p angular -i CHANGELOG.md -s -r 0"},dependencies:{"@element-plus/icons-vue":"^2.1.0","@q/qapm":"^1.1.5","csv-parse":"^5.0.4",d3:"^7.8.5","d3-lasso":"0.0.5","element-plus":"^2.3.0",json2csv:"^5.0.7",konva:"^9.2.0","lodash-es":"^4.17.21","mime-types":"^2.1.35",minimist:"^1.2.6","radar-js-analytic-sdk":"^2.2.6",vue:"^3.2.47","vue-clipboard3":"^2.0.0","vue-router":"^4.1.6","vue-virtual-scroller":"^2.0.0-beta.8"},devDependencies:{"@babel/core":"^7.23.3","@babel/preset-env":"^7.23.3","@originjs/vite-plugin-commonjs":"^1.0.3","@q/qcdn":"^3.2.2","@vitejs/plugin-vue":"^4.1.0",axios:"^0.21.1","babel-eslint":"^10.1.0",eslint:"^7.32.0","eslint-plugin-vue":"^8.0.3",imageinfo:"^1.0.4",qs:"^6.10.1","rollup-plugin-visualizer":"^5.9.0",sass:"^1.62.0","unplugin-auto-import":"^0.15.2","unplugin-vue-components":"^0.24.1",vite:"^4.3.1"},browserslist:["> 1%","last 2 versions"],engines:{node:">=8.9",npm:">= 3.0.0"},license:"MIT"},KNe="",YNe="",JNe="",{toClipboard:nEe}=uf(),rEe="Arial,Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif",ni=1,iEe=["ip","intranet","internet"],R_=20,cr={},oEe={name:"ForceGraphRenderByCanvas",components:{Popover:V9e,NodeContextmenu:f9e},mixins:[jr],provide:function(){return{levelList:this.levelList}},props:{data:{type:Object,default:()=>({nodes:[],links:[]})},history:{type:Object,default:()=>({})},strength:{type:Number,default:-600},isThreatPath:{type:Boolean,default:!1},requestGraphData:{type:Boolean,default:!1},moduleDetail:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}},alphaDecay:{type:Number,default:.0228},alphaMin:{type:Number,default:.001},darkMode:{type:Boolean,default:!0},levelList:{type:Array,default:()=>[{level:"未知",levelName:"未知",className:"unknown",normalColor:"#666",darkColor:"#c6cdd5",dangerNumber:0},{level:"危险",levelName:"危险",className:"warn",normalColor:"#CF1322",darkColor:"#fb2400",dangerNumber:1},{level:"普通",levelName:"普通",className:"normal",normalColor:"#007EE2",darkColor:"#0094ff",dangerNumber:-1},{level:"安全",levelName:"安全",className:"safe",normalColor:"#009A75",darkColor:"#00da90",dangerNumber:-2}]},nodeTypeScale:{type:Number,default:1},nodeTypeList:{type:Array,default:()=>[]},manualTickNumber:{type:Number,default:500},startNodeAnimation:{type:Boolean,default:!0}},emits:["handle-select-node","custom-contextmenu-click","flagFiles","updateSelection"],data(){return{prefix:"./public/",iconAllLoaded:!1,iconSize:{},iconFiles:{},flagFiles:{},highlightRule:{},nodesRange:null,mousePosition:{left:0,top:0},hoverNodePosition:{},uniqueClass:"",showPopover:!1,popoverTimer:null,popoverType:"",popoverContent:{},popoverNode:{},showContextMenu:!1,contextMenuNode:{},menuOptions:[],isDragging:!1,originTransform:null,dragNodeFix:!1,destroyed:!1,actKey:ma()?"metaKey":"ctrlKey",levelHeight:100,actNum:0,scriptNow:null,scriptInited:!1,canAct:!1,isKeyUp:!0,initTimes:0,resizeObserver:null,canvasElement:null,stage:s.shallowRef(null),layer:s.shallowRef(null),nodesGroup:s.shallowRef({}),linksGroup:s.shallowRef({}),grab:s.shallowRef(null),simulation:s.shallowRef(null),nodes:s.shallowRef(null),links:s.shallowRef(null),hoveredNode:s.shallowRef(null),mouseDownNode:s.shallowRef(null),selectionRect:null,selection:[],scale:ni,mousedownPos:null,mousedownNode:null,mouseupNode:null,dragLine:null,darkBgRect:null,inited:!1,hasSimulation:!1,nodesLength:0,ticking:!1,anim1:null,anim2:null,anim3:null}},computed:{isAutoTick(){var e;return((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber},iconSizeComputed(){const e=a$(this.iconSize);return this.nodeTypeList.forEach(t=>{e[t]=this.iconSize[t]*this.nodeTypeScale}),e},contextMenuNodes(){return this.contextMenuNode.id?this.selection.some(e=>e.id===this.contextMenuNode.id)?[...this.selection]:[this.contextMenuNode]:[]},showContextMenuFlag(){return this.requestGraphData?this.showContextMenu:!1}},watch:{data:{handler:function(){const e=this.nodesLength!==this.data.nodes.length;this.nodes=this.data.nodes,this.links=this.data.links,this.nodesLength=this.data.nodes.length,this.update(e)},deep:!0},moduleDetail:{handler:function(e){return Te(this,null,function*(){e!=null&&e.nodes&&!this.iconAllLoaded&&(yield this.loadIcons(),this.initForceGraph(),setTimeout(()=>{this.update()},50))})},deep:!0,immediate:!0},darkMode:{handler:function(e){return Te(this,null,function*(){const t=e?"dark":"light";setTimeout(()=>{this.update(),this.isThreatPath?document.querySelectorAll(`.${this.uniqueClass}.render-container`)[0].setAttribute("data-theme",t):(document.querySelectorAll(`.${this.uniqueClass}.render-container`)[0].setAttribute("data-theme",t),document.getElementsByClassName(this.uniqueClass+" render-container")[0].parentElement.parentElement.setAttribute("data-theme",t))},200)})},immediate:!0}},created(){Gn("graph created time",Date.now()),wi.setProject("QH_10542_1724").getTrack(),localStorage.getItem("showSafeForceGraphLog")&&Gn("组件版本: "+tEe.version),this.isThreatPath||this.initKeyEvent(),this.uniqueClass="unique"+new Date().getTime()+Math.floor(Math.random()*1e5)},mounted(){return Te(this,null,function*(){new PSe({appKey:"fe-force-graph",ratio:50}),this.initForceGraph(),zQ(this.levelList),!this.isThreatPath&&(uo(qe,"buttonClick",e=>{this.handleContextMenuClick(e)}),uo(qe,"relationClick",e=>{this.handleContextMenuClick(e)}),uo(qe,"sendNodesRange",(e,t)=>{e!==void 0&&(this.nodesRange=e,this.updateNodeStyle())}))})},beforeUnmount(){fo(qe,"buttonClick"),fo(qe,"relationClick"),fo(qe,"sendNodesRange"),this.unbindKeyEvent(),this.resetAll(),Gn("destroy")},methods:{initForceGraph(){return Te(this,null,function*(){if(this.inited)return;const e=this.$refs.canvasContainer;let t=e.clientWidth,n=e.clientHeight;this.resizeObserver=new ResizeObserver(o=>{for(const a of o){if(t=a.contentRect.width,n=a.contentRect.height,Gn(`新宽度: ${t}px, 新高度: ${n}px`),t===0||n===0)return;this.stage.width(t),this.stage.height(n),this.layer&&this.layer.batchDraw(),this.hasSimulation&&this.updateSimulation()}}),this.resizeObserver.observe(e),document.addEventListener("click",this.hideContextMenu,!1),this.nodes=this.data.nodes,this.links=this.data.links,this.stage=new ct.Stage({container:e,width:t,height:n,scaleX:ni,scaleY:ni}),this.layer=new ct.Layer,this.grab=new ct.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab);const r=this.layer.getCanvas()._canvas;this.canvasElement=r,this.stage.on("mousemove",o=>{if(!this.mousedownNode||!o.evt[this.actKey]){if(this.resetMouseVars(),this.selectionRect&&o.evt.altKey){const a=this.stage.getPointerPosition(),c=(a.x-this.stage.x())/this.scale,l=(a.y-this.stage.y())/this.scale,d=c-this.selectionRect.x(),u=l-this.selectionRect.y();this.selectionRect.width(d),this.selectionRect.height(u),this.stage.batchDraw()}}else{const a=this.stage.getPointerPosition(),c=this.stage.scaleX(),l=(a.x-this.stage.x())/c,d=(a.y-this.stage.y())/c;this.dragLine.points([this.mousedownPos.x,this.mousedownPos.y,l,d]),this.layer.batchDraw()}}),this.stage.on("wheel",o=>{o.evt.preventDefault();const a=1.1,c=this.scale,l=o.evt.deltaY<0?c*a:c/a;this.scale=l;const d=this.stage.getPointerPosition(),u=this.stage.position(),f=d.x-(d.x-u.x)*(l/c),p=d.y-(d.y-u.y)*(l/c);this.stage.setAttrs({scaleX:l,scaleY:l,x:f,y:p}),this.layer.batchDraw()}),this.stage.on("mousedown",o=>{const a=o.target;if(a&&a.nodeType==="Stage"?this.stage.setDraggable(!0):this.stage.setDraggable(!1),o.evt.altKey){this.stage.setDraggable(!1);const c=this.stage.scaleX(),l=this.stage.getPointerPosition(),d=(l.x-this.stage.x())/c,u=(l.y-this.stage.y())/c;this.selectionRect=new ct.Rect({x:d,y:u,width:0,height:0,stroke:"rgb(80, 80, 80)",strokeWidth:2}),this.layer.add(this.selectionRect),this.stage.batchDraw()}}),this.stage.on("mouseup",o=>{if(this.stage.setDraggable(!1),this.selectionRect&&o.evt.altKey){const a=this.selectionRect.x(),c=this.selectionRect.y(),l=this.selectionRect.width(),d=this.selectionRect.height();this.selection=this.nodes.filter(u=>{const f={x:u.x,y:u.y},p=Math.min(a,a+l),h=Math.max(a,a+l),m=Math.min(c,c+d),b=Math.max(c,c+d);return f.x>=p&&f.x<=h&&f.y>=m&&f.y<=b}),this.updateSelection(),this.selectionRect.destroy(),this.selectionRect=null}}),this.stage.on("contextmenu",this.handleGlobalContextMenu),this.stage.on("click",o=>{o.target&&o.target.nodeType==="Stage"&&this.handleDeselectNode(o)}),this.setSimulation(),this.stage.add(this.layer),this.stage.draw(),this.update(),this.inited=!0})},setSimulation(){var n;if(this.hasSimulation||!((n=this.nodes)!=null&&n.length))return;const e=this.stage.width()/(2*ni),t=this.stage.height()/(2*ni);this.hasSimulation=!0,this.simulation=mse(this.nodes).force("link",tse(this.links).id(r=>r.id).distance(120).strength(1)).force("charge",vse().strength(-600)).force("x",yse()).force("y",bse()).force("center",_S(e,t)).alphaDecay(this.alphaDecay).alphaMin(this.alphaMin).stop(),this.isAutoTick?(this.simulation.alpha(1).restart(),this.simulation.on("tick",this.ticked)):(this.simulation.on("tick",null),this.sendManualTick()),this.simulation.on("end",()=>{Gn("simulation end time",Date.now()),this.isThreatPath&&this.centerAndZoom(1)})},sendManualTick(){var e;Gn("sendManualTick",(e=this.nodes)==null?void 0:e.length),!this.ticking&&(this.ticking=!0,this.doClearCanvas(),this.simulation.alphaDecay(this.alphaDecay*2),this.simulation.alphaMin(this.alphaMin*5),this.simulation.alpha(1).restart(),setTimeout(()=>{console.time("tick");for(let t=0,n=Math.ceil(Math.log(this.simulation.alphaMin())/Math.log(1-this.simulation.alphaDecay()));t<n;++t)Gn("tick"),this.simulation.tick();console.timeEnd("tick"),this.ticking=!1,this.update(),this.centerAndZoom()},1e3))},update(e=!1){return Te(this,null,function*(){var t;this.iconAllLoaded||(yield this.loadIcons()),!this.destroyed&&(t=this.nodes)!=null&&t.length&&(this.initScript(),Gn("update"),e&&this.updateSimulation(),this.doClearCanvas(),this.paintLinks(),this.paintNodes(),this.updateSelection(),this.ticked(),this.actNum===9&&setTimeout(()=>{this.centerAndZoom(.8)},200))})},doClearCanvas(){this.nodesGroup={},this.linksGroup={},this.layer.destroyChildren(),this.grab=new ct.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab)},paintNodes(){const e=this.stage.width()/2,t=this.stage.height()/2,n=this.selection.map(r=>r.id);this.nodes.forEach(r=>Te(this,null,function*(){var w,_,C,k,S,E,T,A,O,I,F,R,q,z,G,Y,Z,U,j,H;const o=(r.type==="nodeType"?this.iconSizeComputed[r.icon]||this.iconSizeComputed.node_type:this.iconSize[r.icon])||24,a=((C=(_=(w=r==null?void 0:r.detail)==null?void 0:w.info)==null?void 0:_.basic)==null?void 0:C.level)||"",c=(E=(S=(k=r==null?void 0:r.detail)==null?void 0:k.info)==null?void 0:S.basic)==null?void 0:E.flag;let l;try{l=yield this.getNodeImage(r)}catch(M){console.log(M)}this.nodesGroup[r.id]&&((T=this.nodesGroup[r.id])==null||T.destroy());const d=new ct.Group({name:"nodeGroup",opacity:1,id:`${r.id}`,x:r.x?r.x:e,y:r.y?r.y:t,draggable:!0,visible:r.show});if(n.includes(r.id)&&d.addName("isSelected"),r.startNode&&this.startNodeAnimation){const M=as(a,this.levelList,this.darkMode),D=new ct.Circle({x:0,y:0,radius:20,fill:M,opacity:0}),te=new ct.Circle({x:0,y:0,radius:20,fill:M,opacity:0}),V=new ct.Circle({x:0,y:0,radius:20,fill:M,opacity:0});d.add(D),d.add(te),d.add(V);const ee=(X,oe)=>new ct.Animation(function(se){const B=se.time;if(B%oe/oe===0)return!1;const re=.5-.5*(B%oe)/oe,ce=40*(B%oe)/oe;X.radius(ce||0),X.opacity(re)},this.layer);(A=this.anim1)==null||A.stop(),(O=this.anim2)==null||O.stop(),(I=this.anim3)==null||I.stop(),this.anim1=ee(D,1500),this.anim2=ee(te,1500),this.anim3=ee(V,1500),(F=this.anim1)==null||F.start(),setTimeout(()=>{this.anim2.start()},500),setTimeout(()=>{this.anim3.start()},1e3)}else if(r.startNode&&!this.startNodeAnimation){const M=as(a,this.levelList,this.darkMode),D=new ct.Circle({x:0,y:0,radius:20,fill:M,opacity:this.startNodeAnimation?0:.3});d.add(D)}if(r.type==="ip"||r.type==="internet"||r.type==="country"||r.type==="target_country"){const M=as(a,this.levelList,this.darkMode),D=new ct.Circle({x:0,y:0,fill:this.darkMode?"#182628":"#fff",radius:o/2,stroke:M,strokeWidth:2});d.add(D)}if(l){const M=c||(q=(R=r==null?void 0:r.detail)==null?void 0:R.info)!=null&&q.inner_country?20:o,D=l&&new ct.Image({x:0,y:0,offsetX:M/2,offsetY:M/2,image:l,width:M,height:M,draggable:!1});d.add(D)}if(r.detail&&r.type==="md5"){const M=((Y=(G=(z=r.detail.info)==null?void 0:z.basic)==null?void 0:G.file_type)==null?void 0:Y.toUpperCase())||"MD5",D=new ct.Text({name:"md5Text",x:0,y:0,text:M,fontSize:4,fontWeight:700,fontFamily:rEe,fill:this.darkMode?"#182628":"#fff",align:"center",listening:!1});D.x(D.x()-D.width()/2),d.add(D)}const u=r.textProp||"name",f=u==="name"?((U=(Z=r==null?void 0:r.detail)==null?void 0:Z.info)==null?void 0:U.name)||r.name:r[u];let p=f.length>14&&!iEe.includes(r.type)?f.slice(0,7)+"..."+f.slice(-7):f;p=JQ(p);const h=new ct.Text({offsetY:o/2,name:"konvaText",x:0,y:o+8,text:p,fontSize:12,fontFamily:"Calibri",fill:this.darkMode?"#cdd9da":"#000",align:"center",listening:!1,visible:!!r.textProp});h.x(h.x()-h.width()/2),d.add(h);const m=new ct.Circle({name:"border",x:0,y:0,radius:o/2,fill:"#5c6271",opacity:.4,visible:!1});if(d.add(m),(H=(j=r.detail)==null?void 0:j.tags)!=null&&H.length){const M=new ct.Circle({x:((o/2||14)+5)*Math.sin(60*Math.PI/180),y:-((o/2||14)+5)*Math.cos(60*Math.PI/180),radius:3,fill:"#9300ff",listening:!1});d.add(M)}if(r.type!=="nodeType"&&r.type!=="aggregation"){var b=new ct.Circle({name:"collect",x:((o/2||14)+5)*Math.sin(0*Math.PI/180),y:-((o/2||14)+5)*Math.cos(0*Math.PI/180),radius:3,fill:"#ffad00",visible:!!r.collect});d.add(b)}if(r.label){const M=new ct.Circle({x:((o/2||14)+5)*Math.sin(30*Math.PI/180),y:-((o/2||14)+5)*Math.cos(30*Math.PI/180),radius:3,fill:"#0099ff",listening:!1});d.add(M)}d.on("dragstart",(M,D)=>{M.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(.3).restart(),this.isDragging=!0)}),d.on("dragmove",M=>{if(!M.evt[this.actKey]){var D=this.simulation.nodes().find(te=>te.id===r.id);D&&(D.x=d.x(),D.fx=d.x(),D.y=d.y(),D.fy=d.y(),this.links.forEach(te=>{const V=this.linksGroup[`${te.source.id}-${te.target.id}`],ee=V==null?void 0:V.findOne(".konvaLine"),X=V==null?void 0:V.findOne(".linkArrow"),oe=V==null?void 0:V.findOne(".edgeLabel");let se,B,W,re;if(te.source.id===D.id){if(!this.nodesGroup[te.target.id])return;se=D.x,B=this.nodesGroup[te.target.id].x(),W=D.y,re=this.nodesGroup[te.target.id].y(),ee.points([se,W,B,re]);const ce=q0(se,W,B,re,R_);X==null||X.x(ce==null?void 0:ce.x),X==null||X.y(ce==null?void 0:ce.y),X==null||X.rotation(Math.atan2(re-W,B-se)*(180/Math.PI))}else if(te.target.id===D.id){if(!this.nodesGroup[te.source.id])return;se=this.nodesGroup[te.source.id].x()||0,B=D.x||0,W=this.nodesGroup[te.source.id].y()||0,re=D.y||0,ee.points([se,W,B,re]);const ce=q0(se,W,B,re,R_);X==null||X.x(ce==null?void 0:ce.x),X==null||X.y(ce==null?void 0:ce.y),X==null||X.rotation(Math.atan2(re-W,B-se)*(180/Math.PI))}if(oe&&(te.source.id===D.id||te.target.id===D.id)){oe.x((se+B)/2),oe.y((W+re)/2),oe.offsetX(oe.getWidth()/2||0),oe.offsetY(oe.getHeight()/2+8||0);const ce=Math.atan2(re-W,B-se)*(180/Math.PI);B<se?oe.rotation(ce+180):oe.rotation(ce)}}),this.layer.batchDraw())}}),d.on("dragend",M=>{M.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(0),this.isDragging=!1)}),d.on("click",M=>{M.evt.detail===2?this.expandNodes(M,r):M.evt.detail===1&&M.evt.button===0&&this.handleNodeClick(M,r)}),d.on("contextmenu",M=>{M.cancelBubble=!0,M.evt.preventDefault(),M.evt.stopPropagation(),this.handleNodeContextMenu(M,r,d)}),d.on("mouseup",M=>this.handleNodeMouseUp(M,r)),d.on("mousedown",M=>this.handleNodeMouseDown(M,r)),d.on("mouseenter",M=>this.handleNodeMouseEnter(M,r)),d.on("mouseleave",M=>this.handleNodeMouseLeave(M,r)),this.grab.add(d),this.nodesGroup[r.id]=d})),this.stage.batchDraw()},paintLinks(){const e=this.stage.width()/2,t=this.stage.height()/2;this.links.forEach(n=>{this.linksGroup[`${n.source.id}-${n.target.id}`]&&this.linksGroup[`${n.source.id}-${n.target.id}`].destroy();const r=new ct.Group({opacity:1,id:`${n.source.id}-${n.target.id}`,visible:n.source.show&&n.target.show}),o=this.darkMode?"#445152":"#999",a=new ct.Arrow({name:"linkArrow",pointerLength:10,pointerWidth:10,x:e,y:t,fill:o});r.add(a);const c=n.source.x||0,l=n.source.y||0,d=n.target.x||0,u=n.target.y||0,f=new ct.Line({name:"konvaLine",id:`${n.source.id}-${n.target.id}`,points:[c,l,d,u],stroke:n.target.type==="org"?"#cf1322":o,strokeWidth:1,dash:n.diy===!0?[5,5]:null});if(n.target.type==="nodeType"){const p=new ct.Text({name:"edgeLabel",x:(c+d)/2,y:(l+u)/2,text:n.target.name,fontSize:12,fill:this.darkMode?"#cdd9da":"#000"});r.add(p)}r.add(f),this.grab.add(r),r.moveToBottom(),this.linksGroup[`${n.source.id}-${n.target.id}`]=r}),this.stage.batchDraw()},updateSimulation(){var e,t;try{if(!this.simulation&&!this.hasSimulation){this.setSimulation();return}this.simulation.nodes(this.nodes),this.simulation.force("link").links(this.links),this.simulation.alpha(.4).restart(),this.history.layoutIndex===0?((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber?this.simulation.on("tick",this.ticked):(this.simulation.on("tick",null),this.sendManualTick()):this.simulation.on("tick",this.ticked)}catch(n){console.log(n,"simulation-e1"),(t=this.simulation)==null||t.stop()}},ticked(){switch(Gn("ticked"),this.history.layoutIndex){case 0:this.forceLayout();break;case 1:this.treeLayout();break;default:this.forceLayout();break}},forceLayout(){var t;if(!this.nodes.length||!this.links.length)return;let e=!0;for(let n=0;n<this.links.length;n++){const r=this.links[n],o=this.linksGroup[`${r.source.id}-${r.target.id}`],a=o==null?void 0:o.findOne(".konvaLine"),c=o==null?void 0:o.findOne(".linkArrow"),l=o==null?void 0:o.findOne(".edgeLabel");let d=r.source.x,u=r.source.y,f=r.target.x,p=r.target.y;const h=f-d||1,m=p-u||1,b=Math.sqrt(h*h+m*m),w=h/b||1,_=m/b||1,C=r.source.type==="nodeType"?(this.iconSizeComputed[r.source.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1,k=r.target.type==="nodeType"?(this.iconSizeComputed[r.target.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1;if(d=d+C*w,u=u+C*_,f=f-k*w,p=p-k*_,isNaN(d)||isNaN(u)||isNaN(f)||isNaN(p)){e=!1;break}if(a==null||a.points([d,u,f,p]),c){const S=q0(d,u,f,p,R_);c==null||c.x((S==null?void 0:S.x)||0),c==null||c.y((S==null?void 0:S.y)||0),c==null||c.rotation(Math.atan2(p-u,f-d)*(180/Math.PI))}if(l){l.x((d+f)/2),l.y((u+p)/2),l.offsetX(l.getWidth()/2||0),l.offsetY(l.getHeight()/2+8||0);const S=Math.atan2(p-u,f-d)*(180/Math.PI);f<d?l.rotation(S+180):l.rotation(S)}}if(!e){Gn("请点击自动布局按钮"),this.resetLayout();return}for(let n=0;n<this.nodes.length;n++){const r=this.nodes[n];(t=this.nodesGroup[r.id])==null||t.position({x:r.x||0,y:r.y||0})}},selectEdgesByNode(e){const t=e.map(n=>n.id);this.links.forEach(n=>{const r=this.linksGroup[`${n.source.id}-${n.target.id}`];t.includes(n==null?void 0:n.target.id)||t.includes(n==null?void 0:n.source.id)?r==null||r.addName("isSelected"):r==null||r.removeName("isSelected")})},showKeyWay(e){if(e.length!==1){this.links.forEach(r=>{const o=this.linksGroup[`${r.source.id}-${r.target.id}`];o==null||o.removeName("keyed")}),this.history.resetKeyLinksAndNodes();return}const{keyLinks:t,keyNodeIds:n}=this.history.findKeyLinksAndNodes(e[0].id,!0);this.links.forEach(r=>{const o=t.find(c=>c.source.id===r.source.id&&c.target.id===r.target.id),a=this.linksGroup[`${r.source.id}-${r.target.id}`];o?a==null||a.addName("keyed"):a==null||a.removeName("keyed")}),this.nodes.forEach(r=>{const o=this.nodesGroup[r.id];n.includes(r.id)?o==null||o.addName("keyed"):o==null||o.removeName("keyed")})},updateNodeStyle(){if(!this.iconAllLoaded)return;let e;this.nodesRange&&this.history.keyNodeIds?e=[...this.nodesRange.map(t=>t.id),...this.history.keyNodeIds]:this.nodesRange?e=this.nodesRange.map(t=>t.id):this.history.keyNodeIds&&(e=this.history.keyNodeIds),setTimeout(()=>{this.highlightByRule(this.highlightRule,e),this.updateNodesStyleByName(),this.updateLinksStyleByName()},0)},updateNodesStyleByName(){this.nodes.forEach(e=>{const t=this.nodesGroup[e.id];if(!t)return;const n=t==null?void 0:t.findOne(".border"),r=t==null?void 0:t.findOne(".konvaText"),o=this.darkMode?"#cdd9da":"#000";t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1),t!=null&&t.hasName("isSelected")?(t.scale({x:8/7,y:8/7}),n==null||n.visible(!0)):(t.scale({x:1,y:1}),n==null||n.visible(!1)),e.type!=="nodeType"&&(t!=null&&t.hasName("isSelected")?(r==null||r.visible(!0),r==null||r.fill("#007ee2")):(r==null||r.visible(!!e.textProp),r==null||r.fill(o)))}),this.layer.batchDraw()},updateLinksStyleByName(){this.links.forEach(e=>{const t=this.linksGroup[`${e.source.id}-${e.target.id}`];if(!t)return;const n=t.findOne(".konvaLine"),r=t.findOne(".edgeLabel"),o=t.findOne(".linkArrow");t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1);const a=this.darkMode?"#445152":"#999";if(t.hasName("isSelected")||t.hasName("keyed")){const c=e.target.type==="org"?"#cf1322":"#007ee2";n.stroke(c),o.fill(c),n.strokeWidth(1),t==null||t.opacity(1),r==null||r.fill("#007ee2"),t.hasName("keyed")?n.strokeWidth(3):n.strokeWidth(1)}else{const c=e.target.type==="org"?"#cf1322":a;this.linksGroup[`${e.source.id}-${e.target.id}`].removeName("isSelected"),n.strokeWidth(1),n.stroke(c),o.fill(c),r==null||r.fill(this.darkMode?"#cdd9da":"#000")}}),this.layer.batchDraw()},handleTableSelect(e=[]){this.selection=this.nodes.filter(t=>{let n;return e.length>1?n=e.indexOf(t.id)>=0&&t.type!=="nodeType"&&t.type!=="aggregation":n=e.indexOf(t.id)>=0,n}),this.updateSelection()},resetAll(){var e,t;document.removeEventListener("click",this.hideContextMenu),(e=this.simulation)==null||e.stop(),this.simulation=null,this.hasSimulation=!1,this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,this.$refs.canvasContainer&&((t=this.resizeObserver)==null||t.unobserve(this.$refs.canvasContainer)),this.nodes=[],this.links=[],this.resizeObserver=null,this.destroyed=!0,this.history.destroy&&this.history.destroy()},unbindKeyEvent(){this.initKeyEvent(1)},initKeyEvent(e=0){if(e){document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp);return}document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),this.isKeyUp=!0},keyDown(e){const t=e.keyCode,n=e[this.actKey],r=e.shiftKey;if(this.isKeyUp)switch(t){case 17:break;case 16:this.toggleZoom(!1);break;case 38:break;case 40:this.goAction();break;case 67:if(window.getSelection().toString())return;n&&this.copyNodeText(this.selection);break;case 89:n&&!ma()&&this.$parent.historyForward();break;case 90:n&&r?this.$parent.historyForward():n&&this.$parent.historyBack();break;case 46:this.$parent.deleteNodes(this.selection);break}},keyUp(e){const t=e.keyCode,n=e.keyCode;if(ma())switch(n){case 17:break;case 16:this.toggleZoom(!0);break}else switch(t){case 17:break;case 16:this.toggleZoom(!0);break}this.isKeyUp=!0},initScript(){var r,o,a,c,l,d;if(this.scriptInited)return;((a=(o=(r=this.history)==null?void 0:r.dataNow)==null?void 0:o.nodes)==null?void 0:a.length)>0&&(this.scriptInited=!0);const e=["193.36.119.50","6cd7b91212983cc557c6e3e671734ff9"];let t=null;if((d=(l=(c=this.history)==null?void 0:c.dataNow)==null?void 0:l.nodes)==null||d.some(u=>{const f=e.indexOf(u.id);return f>=0&&u.startNode===!0&&(t=f),!0}),t===null)return;const n=[[{node:"193.36.119.50"},{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"}],[{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"},{node:"183.246.177.59"},{node:"e7db5b09a39e324d36e937d89f98fdb9122cd859"}]];this.scriptNow=n[t],this.canAct=!!this.scriptNow},goAction(){if(!this.scriptNow||this.actNum>(this.scriptNow.length-1)*2)return;if(this.actNum===(this.scriptNow.length-1)*2){this.centerAndZoom(),this.actNum++;return}const e=this.scriptNow[Math.floor(this.actNum/2)+1];if(this.actNum%2===0){if(!this.history.dataNow.nodes.some(t=>t.id===e.node))return;this.handleTableSelect(e.node),this.nodesMoveToCenterView([e.node]),this.actNum++}else this.$parent.expandNodes(this.selection[0]),setTimeout(()=>{this.nodesMoveToCenterView([this.selection[0].id])},100),this.actNum++},nodesMoveToCenterView(e,t=.9){if(e.length===0)return;const n=[],r=this.nodes.filter(k=>e.indexOf(k.id)>=0);r==null||r.forEach(function(k,S){const E=this.nodesGroup[k.id];n.push({bounds:(E==null?void 0:E.getClientRect())||{},fx:k.x||0,fy:k.y||0})});const o=this.getBounds(n);this.originTransform=this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()};const a=this.stage.width(),c=this.stage.height()/1.5,l=o.width,d=o.height;if(l===0||d===0)return;let u=t/Math.max(l/a,d/c);u=Math.min(u,ni)||ni,this.scale=u;const f=this.stage.width()/(2*u),p=this.stage.height()/(2*u),h=this.nodesGroup[e[0]],m=h==null?void 0:h.getClientRect(),b=m.x*u,w=m.y*u,_=f-b,C=p-w;this.stage.setAttrs({scaleX:u,scaleY:u,x:_||0,y:C||0}),this.layer.batchDraw()},getBounds(e){let t,n,r,o;return e.map(a=>{const c=a.bounds,l=c.x+a.fx,d=c.y+a.fy;t=Math.min(l,t)||l,n=Math.min(d,n)||d,r=Math.max(l+c.width,r)||l+c.width,o=Math.max(d+c.height,o)||d+c.height}),{x:t,y:n,width:r-t,height:o-n}},resetMouseVars(){var e;this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,(e=this.dragLine)==null||e.destroy(),Object.keys(this.nodesGroup).forEach(t=>{this.nodesGroup[t].draggable(!0)})},loadIcons(){return new Promise((e,t)=>{const n=[],r=[];for(const d in this.moduleDetail.plugs){const u=this.moduleDetail.plugs[d];u==null||u.map(f=>{f.children?r.push(...f.children):r.push(f)})}n.push(...r.map(d=>d.icon)),n.push(...this.moduleDetail.nodes.map(d=>d.name)),n.push("node_type"),n.push("node"),n.push("aggregation");const o=this;let a=0;const c=n.filter(d=>this.imgPath[`${o.prefix}d3svg1/${d}.svg`]);function l(d){return{}.VITE_SVG_TYPE==="base64"?S5(d):_5(d)}c.map(d=>{l(this.imgPath[`${o.prefix}d3svg1/${d}.svg`]).then(u=>{o.iconFiles[d]=u;const f=XQ(u).width;this.iconSize[d]=f,a++,a===c.length&&(o.iconAllLoaded=!0,e())}).catch(u=>{console.log(u,"e"),t()})})})},toggleZoom(e){},handleNodeContextMenu(e,t){var n,r;e.evt[this.actKey]||(clearTimeout(this.popoverTimer),this.showPopover=!1,this.contextMenuId++,this.contextMenuNode=t,this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.showContextMenu=!0,e.currentTarget.type==="aggregation"?this.menuOptions=eEe:this.menuOptions=(n=this.$parent.moduleDetail)!=null&&n.plugs[t.type]?Array.from((r=this.$parent.moduleDetail)==null?void 0:r.plugs[t.type]):[])},handleDeselectNode(e,t){ye(this,"handle-select-node",{isSelected:!1,_node:s.toRaw(t)}),this.selection.length&&(this.selection=[],this.updateSelection()),this.setHighlightRule({}),this.hideContextMenu()},setHighlightRule({prop:e,type:t,value:n}){this.highlightRule={prop:e,type:t,value:n},this.updateNodeStyle(),t||yC(".legend-filter .out-box").classed("active",!1)},updateSelection(){const e=this.selection.map(t=>t.id);this.nodes.forEach(t=>{var n,r;e.includes(t.id)?(n=this.nodesGroup[t.id])==null||n.addName("isSelected"):(r=this.nodesGroup[t.id])==null||r.removeName("isSelected")}),ye(this,"updateSelection")},toggleLayout(e){this.history.layoutIndex=e,this.nodes.map(t=>{t.fx=t.fy=null}),this.updateSimulation(),this.ticked(),setTimeout(()=>{this.centerAndZoom()},200)},handleNodeClick(e,t){en({cId:"handleNodeClick",c:"点击节点"}),this.canAct&&(t.type==="org"?window.open("http://bs.safe.360.net/starmap","__blank"):t.type==="nodeType"&&t.id.indexOf("org")>=0&&window.open("http://bs.safe.360.net/orglist?snapshot=true","__blank1")),this.hideContextMenu();const n=this.selection.some(o=>o.id===t.id);if(e.evt.shiftKey){if(t.type==="nodeType"||this.selection.some(o=>o.type==="nodeType"))return;n?this.selection=this.selection.filter(o=>o.id!==t.id):this.selection=[...this.selection,t]}else n?this.selection=[]:this.selection=[t];const r=this.selection.some(o=>o.id===t.id);ye(this,"handle-select-node",{isSelected:r,_node:t}),this.updateSelection(),this.setHighlightRule(this.highlightRule)},handleNodeMouseEnter(e,t){if(!this.showContextMenu&&!e.evt[this.actKey]){const n=e.target.width(),r=e.target.height(),o=e.target,a=o.getAbsolutePosition(),l=o.getStage().container().getBoundingClientRect(),d=a.x-n/2+l.left,u=a.y-r/2+l.top,f=d,p=u,h=f,m=f+n,b=p,w=p+r;this.hoverNodePosition={top:b,right:m,bottom:w,left:h,width:n,height:r},this.popoverType="node",this.popoverContent={[t.type]:t.id},this.popoverNode=t,this.popoverTimer&&clearTimeout(this.popoverTimer),this.popoverTimer=setTimeout(()=>{this.showPopover=!0},200)}},handleNodeMouseLeave(e,t){this.showContextMenu||(clearTimeout(this.popoverTimer),this.showPopover=!1)},handleNodeMouseUp(e,t){var n;e.evt[this.actKey]&&this.mousedownNode&&(this.dragLine&&((n=this.dragLine)==null||n.destroy()),this.mouseupNode=t,this.mouseupNode.id===this.mousedownNode.id||this.mouseupNode.type==="aggregation"||this.mousedownNode.type==="aggregation"||this.$parent.addLink(this.mousedownNode,this.mouseupNode)),this.resetMouseVars()},handleNodeMouseDown(e,t){if(e.evt[this.actKey]){this.mousedownNode=t,this.nodesGroup[t.id].draggable(!1);const n=this.stage.scaleX(),r=this.stage.getPointerPosition(),o=(r.x-this.stage.x())/n,a=(r.y-this.stage.y())/n;this.mousedownPos={x:o,y:a},this.dragLine=new ct.Line({points:[o,a,o,a],stroke:"black",strokeWidth:1,dash:[5,5],opacity:.7,visible:!0}),this.layer.add(this.dragLine),this.stage.draw()}},treeLayout(){this.nodes.map(e=>{e.fx=e.pos,e.fy=e.levelNum*this.levelHeight}),this.forceLayout()},resetLayout(){this.simulation.stop(),this.nodes.map(e=>{delete e.vx,delete e.vy,delete e.x,delete e.y,delete e.fx,delete e.fy}),this.updateSimulation()},selectSingleEdgeNode(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)});for(let n=t.length-1;n>=0;n--){let r=0,o=0;const a=t[n];this.links.map(c=>{c.source.id===a&&r++,c.target.id===a&&o++}),r>=1&&t.splice(n,1),o>=2&&t.splice(n,1)}return t},selectChildren(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)}),this.handleTableSelect(t)},selectParents(e){const t=[];this.links.map(n=>{n.target.id===e.id&&t.push(n.source.id)}),this.handleTableSelect(t)},handleGlobalContextMenu(e){this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.menuOptions=[],this.showContextMenu=!0,this.showPopover=!1,this.contextMenuNode={},e.evt.preventDefault()},hideContextMenu(){this.showContextMenu=!1,this.contextMenuNode={}},centerAndZoom(e=.7,t=!1){var f,p,h;if(this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()},!this.grab)return;const n=this.stage.width(),r=this.stage.height(),o=this.grab.getClientRect(),a=o.width/this.scale,c=o.height/this.scale;if(a===0||c===0)return;let l=e/Math.max(a/n,c/r);if(l=t?l:Math.min(l,ni)||ni,!t&&l>ni)return;this.scale=l;const d=this.stage.width()/(2*l),u=this.stage.height()/(2*l);if((f=this.simulation)!=null&&f.force&&((p=this.simulation)==null||p.force("center",_S(d,u))),this.ticked(),this.stage.setAttrs({scaleX:l,scaleY:l,x:0,y:0}),this.layer.batchDraw(),this.history.layoutIndex===1){const m=this.grab.getClientRect(),b=(n-m.width)/2-m.x,w=(r-m.height)/2-m.y;this.stage.setAttrs({x:b,y:w}),this.layer.batchDraw(),(h=this.simulation)==null||h.stop()}},reset(){this.stage.setAttrs(this.originTransform)},handleContextMenuClick({nodes:e,api:t,dataApi:n}){if(this.requestGraphData){let r,o;const a={show_label:"label",all_show_label:"label",all_show_names:"name",show_names:"name"};switch(t&&t.name){case"edit_label":this.editLabel(e);break;case"single_edge_select":r=this.selectSingleEdgeNode(e[0]),this.selection=this.nodes.filter(c=>r.includes(c.id));break;case"hold_aggregation":o=this.selectSingleEdgeNode(e[0]),this.$parent.aggregationNodes(o,e[0]);break;case"release_aggregation":this.$parent.releaseAggregation(e[0]);break;case"show_label":case"show_names":e.map(c=>{this.showLabel(c,a[t.name])});break;case"all_show_label":case"all_show_names":this.nodes.map(c=>{this.showLabel(c,a[t.name])});break;case"un_show_names":case"un_show_label":e.map(c=>{this.hideLabel(c)});break;case"all_un_show_names":case"all_un_show_label":this.nodes.map(c=>{this.hideLabel(c)});break;case"copy":this.copyNodeText(e);break;case"node_star":e.map(c=>{this.starNode(c)});break;case"un_node_star":e.map(c=>{this.starNode(c,!1)});break;case"fix_nodes":e.map(c=>{this.toggleMove(c,!0)});break;case"un_fix_nodes":e.map(c=>{this.toggleMove(c,!1)}),this.updateSimulation();break;case"all_fix_nodes":this.fixAllNodes(!0);break;case"all_un_fix_nodes":this.fixAllNodes(!1);break;case"expand_node":e.map(c=>{this.$parent.expandNodes(c)});break;case"expand_part_node":e.map(c=>{this.$parent.expandNodes(c,n)});break;case"go_result":this.handleGoDetail(e);break;case"delete_node":this.$parent.deleteNodes(e);break;case"select_children":this.selectChildren(e[0]);break;case"select_parents":this.selectParents(e[0]);break;case"undo":this.$parent.historyBack();break;case"redo":this.$parent.historyForward();break;case"add_con_node":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"add_link":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"show_node":this.toggleShowNode(e[0],e[1],!0);break;case"hide_node":this.toggleShowNode(e[0],e[1],!1);break;default:ye(this,"custom-contextmenu-click",{eventName:t.name,customConfig:t.customConfig,nodes:e,allNodes:s.toRaw(this.history.dataNow.nodes)})}this.hideContextMenu(),setTimeout(()=>{this.updateSelection()},400)}else Lt({message:"无可操作权限",type:"warning"})},expandNodes(e,t){en({cId:"dblclick",c:"双击节点"}),this.requestGraphData?this.$parent.expandNodes(t):Lt({message:"无可操作权限",type:"warning"})},toggleShowNode(e,t,n=!0){this.history.toggleShowNode(e,t,n),this.selection.filter(o=>o.show).length>0||this.handleTableSelect([]),setTimeout(this.updateNodeStyle,100)},copyNodeText(e){let t="";e.filter(n=>n.type!=="aggregation"&&n.type!=="nodeType").map(n=>{t=t+n.id+`
|
|
144
|
+
`).slice(1));try{for(o.s();!(n=o.n()).done;){var a=ISe(n.value);a&&r.push(a)}}catch(c){o.e(c)}finally{o.f()}return r.slice(0,10)}var Bl=function(e){return OSe(e).toString()},I_=function(e){return e instanceof ErrorEvent?e.message==="Script error."?Tg:Ng:Xd},RSe=function(){function e(t){Kf(this,e),Ai(this,"errorIdSet",new Set),this.webCoreIns=t,this.errorIdSet=new Set}return Yf(e,[{key:"init",value:function(){var t;if(this.initJsError(),this.initResourceError(),this.initPromiseError(),this.initCorsError(),(t=window.__QAPM__)!==null&&t!==void 0&&(t=t.q)!==null&&t!==void 0&&t.length){var n={error:this.onJSError.bind(this),reject:this.onPromiseError.bind(this)};window.__QAPM__.q.forEach(function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},o=r.type,a=r.event,c=n[o];c&&c(a)}),window.__QAPM__.q=[]}}},{key:"initJsError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onJSError(n)},!0)}},{key:"initResourceError",value:function(){var t=this;window.addEventListener("error",function(n){return t.onResourceError(n)},!0)}},{key:"initPromiseError",value:function(){var t=this;window.addEventListener("unhandledrejection",function(n){return t.onPromiseError(n)},!0)}},{key:"initCorsError",value:function(){var t=this;window.addEventListener("error",function(n){return function(r){if(I_(r)===Tg){var o={errorType:Tg,errorMessage:r.message,errorSummary:"CorsError",errorId:Bl("".concat(Tg,"-").concat(r.message))};t.commit(o)}}(n)},!0)}},{key:"onResourceError",value:function(t){if(I_(t)===Xd){var n=t.target||t.srcElement,r=n.src||n.href,o=JSON.stringify(Xd+": "+r||"UnKnown Resource"),a={errorType:Xd,errorMessage:o,errorSummary:"ResourceError",errorId:Bl("".concat(Xd,"-").concat(o))};this.commit(a)}}},{key:"onJSError",value:function(t){var n,r;if(I_(t)===Ng){var o=JSON.stringify(t.message),a=function(l){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"unknown";if(!l)return d;try{var u=new URL(l);return u.pathname&&u.pathname.endsWith(".js")?l:d}catch(f){return l}}(t.filename,(n=this.webCoreIns.config)===null||n===void 0?void 0:n.appKey),c={errorType:Ng,errorMessage:o,errorSummary:t.error&&((r=t.error)===null||r===void 0?void 0:r.name)||"UnKnown",errorStack:JSON.stringify(Ag(t.error)),errorId:Bl("".concat(Ng,"-").concat(o,"-").concat(a))};this.commit(c)}}},{key:"onPromiseError",value:function(t){var n,r,o=JSON.stringify(((n=t.reason)===null||n===void 0?void 0:n.message)||t.reason||"UnKnown"),a=((r=t.reason)===null||r===void 0?void 0:r.name)||"UnKnown",c={errorType:yR,errorMessage:o,errorSummary:a,errorStack:JSON.stringify(Ag(t.reason)),errorId:Bl("".concat(yR,"-").concat(o,"-").concat(a))};this.commit(c)}},{key:"onVueError",value:function(t,n,r){var o=JSON.stringify(t.message),a={errorType:bR,errorMessage:o,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Ag(t)),errorId:Bl("".concat(bR,"-").concat(o,"-").concat(t.name))};this.commit(a)}},{key:"onReactError",value:function(t,n){var r=JSON.stringify(t.message),o={errorType:wR,errorMessage:r,errorSummary:t.name||"UnKnown",errorStack:JSON.stringify(Ag(t)),errorId:Bl("".concat(wR,"-").concat(r,"-").concat(t.name))};console.log(o),this.commit(o)}},{key:"commit",value:function(t){var n=t.errorId;this.errorIdSet.has(n)||(this.errorIdSet.add(n),this.webCoreIns.commit(qc({type:"error"},t)))}}]),e}(),PSe=function(e){function t(){var o,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Kf(this,t),(o=wse(this,t,[a])).config=a,o.isReport()?(o.PerformancePluginInstance=new V3e(Gc(o)),o.WhiteScreenPluginInstance=new _Ce(Gc(o)),o.ErrorPluginInstance=new RSe(Gc(o)),o.plugins=[o.PerformancePluginInstance,o.WhiteScreenPluginInstance,o.ErrorPluginInstance],o.init(),jS(t,t,Dl,Gc(o)),o):$S(o)}var n,r;return function(o,a){if(typeof a!="function"&&a!==null)throw new TypeError("Super expression must either be null or a function");o.prototype=Object.create(a&&a.prototype,{constructor:{value:o,writable:!0,configurable:!0}}),Object.defineProperty(o,"prototype",{writable:!1}),a&&Yv(o,a)}(t,bwe),Yf(t,[{key:"isReport",value:function(){var o=this.isIE(),a=this.calcRatio();return this.config.appKey&&a&&!o}},{key:"init",value:(r=Hc(Cr().mark(function o(){return Cr().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:this.initTime(this.mixed()),this.plugins.forEach(function(c){c.init()});case 2:case"end":return a.stop()}},o,this)})),function(){return r.apply(this,arguments)})},{key:"mixed",value:function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},a=this.uid(),c=this.getTime(),l=c.time,d=c.date,u=this.getUA(),f=window.location,p=f.host,h=f.origin,m=f.pathname;return qc(qc({uid:a,sid:this.sid,url:window.location.href,host:p,fullPath:h+m,sdkVersion:this.sdkVersion,createDate:d,appKey:this.config.appKey,createTime:l,appVersion:this.appVersion,env:this.env},u),o)}},{key:"commit",value:(n=Hc(Cr().mark(function o(a){var c,l;return Cr().wrap(function(d){for(;;)switch(d.prev=d.next){case 0:c=this.mixed(a),l=new URL("".concat(window.location.protocol,"//").concat(this.host,"/log.gif")),Object.entries(c).map(function(u){var f=_se(u,2),p=f[0],h=f[1];l.searchParams.set(p,h)}),new Image().src=l.toString();case 5:case"end":return d.stop()}},o,this)})),function(o){return n.apply(this,arguments)})}],[{key:"install",value:function(o){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};Xf(t,t,Dl)||(o.config.errorHandler=function(c,l,d){Xf(t,t,Dl).ErrorPluginInstance.onVueError(c,l,d),console.error(c)},jS(t,t,Dl,new t(a)))}},{key:"sendError",value:function(o){Xf(t,t,Dl)?Xf(t,t,Dl).ErrorPluginInstance.onReactError(o):console.error("QAPM: 请先初始化 QAPM!")}}]),t}(),Dl={writable:!0,value:null};const CNe="",SNe="",LSe={components:{InfoFilled:Pm,ArrowRight:Im},mixins:[jr],inject:["hasLevel"],props:{axis:{required:!0,type:Object,default:()=>({x:0,y:0})},show:{required:!0,type:Boolean,default:!1},nodeInfo:{required:!0,type:Array,default:()=>[]},menuOptions:{required:!0,type:Array,default:()=>[]},border:{type:Boolean,required:!1,default:!0},itemWidth:{type:Number,required:!1,default:206},itemHeight:{type:Number,required:!1,default:36},itemSize:{type:Number,required:!1,default:14},offset:{type:Object,required:!1,default:()=>({x:6,y:2})},borderWidth:{type:Number,required:!1,default:6},history:{type:Object,required:!0,default:()=>{}},moduleDetail:{type:Object,required:!0,default:()=>{}}},emits:["contextmenu-click"],data(){return{checkedItems:{},globalMenus:JZ,maxMulti:6}},computed:{checkboxMenu(){return this.nodeInfo.length>1?[]:this.menuOptions},canGoDetail(){var e,t,n,r;return((t=(e=this.moduleDetail)==null?void 0:e.config)==null?void 0:t.jumpDetail)&&((r=this.moduleDetail)==null?void 0:r.config.jumpRule[(n=this.nodeInfo[0])==null?void 0:n.type])},systemMenu(){var r,o,a,c,l,d,u;const e=[];if(this.nodeInfo.length===1){const f=this.nodeInfo[0];f.type!=="aggregation"&&f.type!=="nodeType"&&(e.push(iv),(r=this.history.keyNodeIds)!=null&&r.some(_=>_===f.id)||(e.push(av),(a=(o=this.moduleDetail)==null?void 0:o.config)!=null&&a.hideCollectMenu||e.push(f.collect?sv:ov),e.push(f.textProp==="name"?tv:ev),f.label&&e.push(f.textProp==="label"?nv:rv)),this.canGoDetail&&e.push(K5)),e.push(f.fx?V0:Z0);const p=this.history.dataNow.links.some(w=>w.source.id===f.id&&w.target.type==="aggregation"),b=this.history.dataNow.links.filter(w=>w.source.id===f.id).map(w=>w.target).some(w=>{let _=0;return this.history.dataNow.links.map(C=>{C.source.id===w.id&&_++}),_===0});p||f.type==="aggregation"?e.push(H5):b&&e.push(q5),b&&e.push(j5),e.push(lv)}else this.nodeInfo.length>1?(e.push(av,iv),e.push(this.nodeInfo.some(p=>!p.collect)?ov:sv),this.nodeInfo.some(p=>p.label)&&e.push(this.nodeInfo.some(p=>p.textProp!=="label")?rv:nv),e.push(this.nodeInfo.some(p=>p.textProp!=="name")?ev:tv),e.push(this.nodeInfo.some(p=>!p.fx)?Z0:V0),e.push(lv)):this.nodeInfo.length===0&&(this.history.dataNow.nodes.some(p=>p.label)&&e.push(this.history.dataNow.nodes.some(p=>p.textProp!=="label")?$5:F5),e.push(this.history.dataNow.nodes.some(p=>p.textProp!=="name")?D5:M5),e.push(this.history.dataNow.nodes.some(p=>!p.fx)?L5:B5),this.history.currentIndex>0&&e.push(z5),this.history.currentIndex<this.history.length-1&&e.push(U5));const t=(c=this.nodeInfo[0])==null?void 0:c.type,n=(u=(d=(l=this.nodeInfo[0])==null?void 0:l.detail)==null?void 0:d.info)==null?void 0:u.extraNodeContextMenus;return t!=="nodeType"&&(n!=null&&n.length)&&(n.forEach(f=>{f.icon||(f.icon="button_edit_label")}),e.push(...n)),e},totalHeight(){let e=this.menuOptions.length*(this.itemHeight+5)+10+44+48+5,t=this.systemMenu.length*(this.itemHeight+5)+10+44+5;return e=this.menuOptions.length===0?0:44,t=this.systemMenu.length===0?0:44,e+t},axisComputed(){const e=document.getElementsByClassName("d3-container")[0],t=this.axis.top-e.offsetTop;return{top:(t<e.offsetHeight/2?Math.min(t+this.offset.y,Math.max(e.offsetHeight-this.totalHeight,e.getBoundingClientRect().top)):Math.max(t+this.offset.y,this.totalHeight+e.getBoundingClientRect().top))+"px",left:this.axis.left+this.offset.x+"px",transform:`translate(${this.axis.left>e.offsetWidth/2?"-100%":"0%"}, ${t>e.offsetHeight/2?"-100%":"0%"})`}},liStyle(){return{width:this.itemWidth+"px",height:this.itemHeight+"px",lineHeight:this.itemHeight+"px",fontSize:this.itemSize+"px"}},firstLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*2>=e},secondLeft(){const e=document.body.offsetWidth;return this.axis.left+this.itemWidth*3>=e},checkedItemsFinal(){return Object.keys(this.checkedItems).filter(e=>this.checkedItems[e]).map(e=>this.checkedItems[e])},haveInterface(){let e=!1;return this.menuOptions.map(t=>{t.type===1&&(e=!0)}),e}},watch:{show(){this.checkedItems={}}},methods:{handleCollapse(){},isSystemItem(e){return e.type===2},isExternalItem(e){return e.type===3},hasChildren(e){var t;return((t=e==null?void 0:e.children)==null?void 0:t.length)>0},onCheck(e,t){this.checkedItems[t.name]=e.currentTarget.checked?t:!1},secondBorderCheck(e,t=0){const n=document.body.offsetWidth,r=document.body.offsetHeight,o=this.axis.top+(e+t)*this.itemHeight;return{width:this.itemWidth*2+60+"px",left:this.axis.left+this.itemWidth*2>=n?"-100%":"100%",top:r>=o?0:"auto",bottom:r<o?0:"auto"}},thirdBorderCheck(e,t,n,r){const o=document.body.offsetWidth,a=document.body.offsetHeight,c=this.secondBorderCheck(e,n).top;let l;const d=(t+r)*this.itemHeight,u=d>180?180:d;return c===0?l=this.axis.top+e*this.itemHeight+u:l=this.axis.top-e*this.itemHeight+u,{left:this.axis.left+this.itemWidth*3>=o?"-100%":"100%",bottom:a>=l?0:"auto",top:a<l?0:"auto"}},handleClick(e,t){if(!t){if(en({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),e.has_child>0)return!1;ye(this,"contextmenu-click",{nodes:this.nodeInfo,api:e})}},handleDataClick(e,t){en({cId:"contextMenu-"+e.name,c:"右键菜单-"+e.namec}),ye(this,"contextmenu-click",{nodes:this.nodeInfo,api:t,dataApi:e}),this.checkedItems={}}}},Ml=e=>(s.pushScopeId("data-v-dd8dd8d0"),e=e(),s.popScopeId(),e),BSe={"aria-hidden":"true",style:{position:"absolute",width:"0",height:"0",overflow:"hidden",display:"none"}},DSe=[Ml(()=>s.createElementVNode("symbol",{id:"icon-arrow-right",viewBox:"0 0 1024 1024"},[s.createElementVNode("path",{d:"M288.791335 65.582671l446.41733 446.417329-446.41733 446.417329z"})],-1))],MSe={class:"cm-list"},FSe={class:"cm-ul"},$Se={class:"hd"},zSe=["src"],USe={class:"bd"},jSe={class:"cm-ul cm-ul-level1"},qSe=["title"],HSe=Ml(()=>s.createElementVNode("svg",{class:"icon","aria-hidden":"true"},[s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"})],-1)),GSe=["title","onClick"],WSe=["title","onClick"],KSe={key:0,class:"icon","aria-hidden":"true"},YSe=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],JSe=["title","onClick"],XSe=["src"],QSe=Ml(()=>s.createElementVNode("div",{class:"bd"},null,-1)),ZSe=["title","onClick"],VSe={key:0,class:"fas el-icon-fa-cog"},e9e={key:1,class:"fas el-icon-fa-external-link-alt"},t9e={class:"text-wrapper"},n9e=["src"],r9e=["src"],i9e={key:3,class:"shortcut"},o9e={key:2,class:"icon","aria-hidden":"true"},s9e=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],a9e=["title","onClick"],l9e={key:1,class:"icon","aria-hidden":"true"},c9e=[Ml(()=>s.createElementVNode("use",{"xlink:href":"#icon-arrow-right"},null,-1))],d9e=["title","onClick"];function u9e(e,t,n,r,o,a){const c=s.resolveComponent("ArrowRight"),l=Qe,d=s.resolveComponent("InfoFilled"),u=Hn;return n.show?(s.openBlock(),s.createElementBlock("div",{key:0,class:"cm-container",style:s.normalizeStyle(a.axisComputed),onClick:t[1]||(t[1]=s.withModifiers((...f)=>a.handleCollapse&&a.handleCollapse(...f),["stop"]))},[(s.openBlock(),s.createElementBlock("svg",BSe,DSe)),s.createElementVNode("div",MSe,[s.createElementVNode("ul",FSe,[a.checkboxMenu.length>0?(s.openBlock(),s.createElementBlock("li",{key:0,class:"cm-li data-opt-wrapper",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",$Se,[s.createElementVNode("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,zSe),s.createTextVNode("按关系分类拓线"),s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(c)]),_:1})]),s.createElementVNode("div",USe,[s.createElementVNode("ul",jSe,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.checkboxMenu,(f,p)=>(s.openBlock(),s.createElementBlock("li",{key:p,class:"cm-li context-one",style:s.normalizeStyle(a.liStyle)},[a.hasChildren(f)?(s.openBlock(),s.createElementBlock("div",{key:0,class:s.normalizeClass(["cm-item",a.firstLeft?"cm-left":""]),title:f.namec},[s.createElementVNode("span",null,s.toDisplayString(f.namec),1),HSe],10,qSe)):(s.openBlock(),s.createElementBlock("div",{key:1,class:s.normalizeClass(["cm-item",a.firstLeft?"cm-left":""]),title:f.namec,onClick:s.withModifiers(h=>a.handleDataClick(f,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(f.namec),1)],10,GSe)),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("ul",{key:2,class:"cm-ul cm-ul-level2",style:s.normalizeStyle(a.secondBorderCheck(p,f.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.children,(h,m)=>(s.openBlock(),s.createElementBlock("li",{key:m,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",a.secondLeft?"cm-left":""]),title:h.namec,onClick:s.withModifiers(b=>a.handleDataClick(h,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(h.namec),1),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("svg",KSe,YSe)):s.createCommentVNode("",!0)],10,WSe),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level3",style:s.normalizeStyle(a.thirdBorderCheck(p,m,f.children.length,h.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h.children,(b,w)=>(s.openBlock(),s.createElementBlock("li",{key:w,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:"cm-item",title:b.namec,onClick:s.withModifiers(_=>a.handleDataClick(b,o.globalMenus.expandPartNode),["stop"])},[s.createElementVNode("span",null,s.toDisplayString(b.namec),1)],8,JSe)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))])])],4)):n.nodeInfo.length>1&&n.nodeInfo.length<o.maxMulti?(s.openBlock(),s.createElementBlock("li",{key:1,class:"cm-li data-opt-wrapper data-opt-all",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:"hd",onClick:t[0]||(t[0]=s.withModifiers(f=>a.handleDataClick(null,o.globalMenus.expandNode),["stop"]))},[s.createElementVNode("img",{src:e.imgPath["./public/d3svg1/button18/button_relation.svg"],style:{"margin-right":"10px"}},null,8,XSe),s.createTextVNode("展开全部关系 ")]),QSe],4)):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.systemMenu,(f,p)=>(s.openBlock(),s.createElementBlock("li",{key:p,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{"cm-left":a.firstLeft,disabled:f.disabled}]),title:f.namec,onClick:s.withModifiers(h=>a.handleClick(f,f.disabled),["stop"])},[a.isSystemItem(f)?(s.openBlock(),s.createElementBlock("i",VSe)):a.isExternalItem(f)?(s.openBlock(),s.createElementBlock("i",e9e)):s.createCommentVNode("",!0),s.createElementVNode("div",t9e,[f.icon?(s.openBlock(),s.createElementBlock("img",{key:0,src:e.imgPath["./public/d3svg1/button18/"+f.icon+".svg"],class:"t-icon"},null,8,n9e)):(s.openBlock(),s.createElementBlock("img",{key:1,src:e.imgPath["./public/d3svg1/button18/button_"+f.name+".svg"],class:"t-icon"},null,8,r9e)),f.tooltip?(s.openBlock(),s.createBlock(u,{key:2,class:"el-icon-info",effect:"dark",content:f.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(f.namec),1),f.shortcut?(s.openBlock(),s.createElementBlock("span",i9e,s.toDisplayString(f.shortcut),1)):s.createCommentVNode("",!0)]),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("svg",o9e,s9e)):s.createCommentVNode("",!0)],10,ZSe),a.hasChildren(f)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level2",style:s.normalizeStyle(a.secondBorderCheck(p,f.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(f.children,(h,m)=>(s.openBlock(),s.createElementBlock("li",{key:m,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{"cm-left":a.secondLeft,disabled:f.disabled||h.disabled}]),title:h.namec,onClick:s.withModifiers(b=>a.handleClick(h,f.disabled||h.disabled),["stop"])},[h.tooltip?(s.openBlock(),s.createBlock(u,{key:0,class:"el-icon-info",effect:"dark",content:h.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(h.namec),1),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("svg",l9e,c9e)):s.createCommentVNode("",!0)],10,a9e),a.hasChildren(h)?(s.openBlock(),s.createElementBlock("ul",{key:0,class:"cm-ul cm-ul-level3",style:s.normalizeStyle(a.thirdBorderCheck(p,m,f.children.length,h.children.length))},[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(h.children,(b,w)=>(s.openBlock(),s.createElementBlock("li",{key:w,class:"cm-li",style:s.normalizeStyle(a.liStyle)},[s.createElementVNode("div",{class:s.normalizeClass(["cm-item",{disabled:f.disabled||h.disabled||b.disabled}]),title:b.namec,onClick:s.withModifiers(_=>a.handleClick(b,f.disabled||h.disabled||b.disabled),["stop"])},[b.tooltip?(s.openBlock(),s.createBlock(u,{key:0,class:"el-icon-info",effect:"dark",content:b.tooltip,placement:"top-start"},{default:s.withCtx(()=>[s.createVNode(l,null,{default:s.withCtx(()=>[s.createVNode(d)]),_:1})]),_:2},1032,["content"])):s.createCommentVNode("",!0),s.createElementVNode("span",null,s.toDisplayString(b.namec),1)],10,d9e)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))],4)):s.createCommentVNode("",!0)],4))),128))])])],4)):s.createCommentVNode("",!0)}const f9e=Bt(LSe,[["render",u9e],["__scopeId","data-v-dd8dd8d0"]]),TNe="",ANe="",ONe="",INe="",h9e={name:"Popover",components:{ForceGraphSvgIcon:ss},mixins:[jr],inject:["levelList","hasLevel"],props:{showPopover:{type:Boolean,default:!1},mousePosition:{type:Object,default:()=>({left:0,top:0})},nodeInfo:{type:Object,default:()=>{}},type:{type:String,default:"node"},moduleDetail:{type:Object,default:()=>{}},data:{type:Object,default:()=>{}},darkMode:{type:Boolean,default:!0},history:{type:Object,default:()=>({})}},data(){return{showSelf:!1,onPop:!1,position:null,aggregationList:[]}},computed:{show(){return this.showPopover||this.showSelf},name(){var e,t,n;return((n=(t=(e=this.nodeInfo)==null?void 0:e.detail)==null?void 0:t.info)==null?void 0:n.name)||this.nodeInfo.name},isNormalNode(){return this.nodeInfo.type!=="nodeType"&&this.nodeInfo.type!=="aggregation"},isNodeTypeNode(){return this.nodeInfo.type==="nodeType"},isAggregateNode(){return this.nodeInfo.type==="aggregation"},fieldMapThisType(){var e;return this.moduleDetail.detail_field_map&&this.moduleDetail.detail_field_map[`${(e=this.nodeInfo)==null?void 0:e.type}_detail_info`]},canGoDetail(){return["nodeType","aggregation","family","org","report","vul","thumbprint_md5","email","cert_https"].indexOf(this.nodeInfo.type)<0}},watch:{mousePosition(){setTimeout(()=>{var l,d,u;const e=this.mousePosition.left>document.body.offsetWidth/2,t=this.mousePosition.top>document.body.offsetHeight/2,n=(l=document.getElementsByClassName("popover-container")[0])==null?void 0:l.offsetHeight,r=(d=document.getElementsByClassName("d3-container")[0])==null?void 0:d.offsetHeight,o=(u=document.getElementsByClassName("d3-container")[0])==null?void 0:u.getBoundingClientRect().top;let a;t?a=Math.max(this.mousePosition.top,n+o)+5:a=Math.min(this.mousePosition.top,Math.max(r-n,o))-5;const c={left:(e?this.mousePosition.left+2:this.mousePosition.right-2)+"px",top:a+"px",transform:`translate(${e?"-100%":"0%"}, ${t?"-100%":"0%"})`};this.position=c},100)},nodeInfo:{handler:function(){var t;const e=(((t=this.nodeInfo)==null?void 0:t.list)||[]).map(n=>{var o,a,c;const r=n.detail;return ue(ae({},n),{name:((o=r==null?void 0:r.info)==null?void 0:o.name)||n.name,level:((c=(a=r==null?void 0:r.info)==null?void 0:a.basic)==null?void 0:c.level)||""})});e==null||e.sort((n,r)=>{var c,l;const o=(c=this.levelList.find(d=>d.level===n.level))==null?void 0:c.dangerNumber;return((l=this.levelList.find(d=>d.level===r.level))==null?void 0:l.dangerNumber)-o}),this.aggregationList=e},immediate:!0}},methods:{handleMouseEnter(){this.showSelf=!0},handleMouseLeave(){this.showSelf=!1},isSomething(e){return j0(e)},getTypeZh(e){var n,r,o;let t=e;if(e==="nodeType")t="关系节点";else for(const a in(n=this.moduleDetail)==null?void 0:n.nodes)if(e===((r=this.moduleDetail)==null?void 0:r.nodes[a].name)){t=(o=this.moduleDetail)==null?void 0:o.nodes[a].namec;break}return t},getLevelClass(e){return of(e,this.levelList)},getColorStyle(e){return as(e,this.levelList,this.darkMode)},getNodeTypeChildNum(e){var o;const t=(o=this.data)==null?void 0:o.links,n=[],r=[];return t==null||t.map(a=>{a.source.id===e&&(n.push(a.target.id),a.target.detail&&UQ(a.target.detail.info.basic.level,this.levelList)&&r.push(a.target.id))}),{allChildNum:n.length,dangerChildNum:r.length}},canShowField(e){const t=this.hasFieldValue(e);return!(t===void 0||e.hide_hover||e.hide_empty&&!t)},hasFieldValue(e){const t=this.nodeInfo.detail&&this.nodeInfo.detail.info&&this.nodeInfo.detail.info.basic[e.prop];if(t===null)return;const n=Array.isArray(t);return n&&t.length>0||!n&&t!==""&&t!=="无"},getFieldValue(e){const t=this.nodeInfo.detail.info.basic[e.prop],n=Array.isArray(t),r=this.isSomething(t);let o="-";return r&&(n?o=t.length?t.join("|"):"-":o=t||"-"),o},formatTags(e){return cf(df(e))},addToGraph(e){const t={type:"addFromAggregation",addOne:{nodes:[e],links:[{source:this.nodeInfo.relationId,target:e.id}]}};if(this.aggregationList=this.aggregationList.filter(n=>n.id!==e.id),this.history.updateAggregationNode(this.aggregationList,this.nodeInfo.id),this.history.pushState(t),this.aggregationList.length)ye(qe,"emitDataLoaded");else{const n=this.nodeInfo,r={deleteOne:{nodes:[n],links:[{source:n.relationId,target:n.id}]},type:"aggregation"};setTimeout(()=>{this.history.pushState(r),ye(qe,"emitDataLoaded")},0)}}}},Fl=e=>(s.pushScopeId("data-v-a8e278b3"),e=e(),s.popScopeId(),e),p9e={key:0,class:"node-info-container"},g9e={class:"popover-block popover-header"},m9e={key:0,class:"popover-collect"},v9e={key:1,class:"row-item"},y9e={class:"label"},b9e={key:2,class:"row-item"},w9e=Fl(()=>s.createElementVNode("div",{class:"label"},"关系节点:",-1)),_9e={class:"value"},C9e={class:"node-type-info"},S9e={class:"name"},E9e={key:3,class:"row-item"},x9e=Fl(()=>s.createElementVNode("div",{class:"label"},"备注:",-1)),k9e={class:"value"},N9e={class:"popover-block popover-fields"},T9e={key:0,class:"node-detail top-border"},A9e={key:0,class:"row-item"},O9e=Fl(()=>s.createElementVNode("div",{class:"label"},"危险级别:",-1)),I9e=["title"],R9e={key:1,class:"row-item row-item-tag"},P9e=Fl(()=>s.createElementVNode("div",{class:"label"},"标签:",-1)),L9e={class:"value"},B9e={class:"graph-tags-box"},D9e=Fl(()=>s.createElementVNode("br",null,null,-1)),M9e={key:0,class:"row-item"},F9e={class:"label"},$9e=["title"],z9e={key:1,class:"node-statistics top-border"},U9e={class:"row-item node-num"},j9e=Fl(()=>s.createElementVNode("div",{class:"label"},"拓展节点统计:",-1)),q9e={class:"value"},H9e={key:0},G9e={class:"danger"},W9e={key:2,class:"node-aggregation"},K9e={class:"aggregation-title"},Y9e={class:"aggregation-box"},J9e={key:1,class:"node-info-container"},X9e={class:"popover-fields"},Q9e={class:"top"};function Z9e(e,t,n,r,o,a){const c=s.resolveComponent("force-graph-svg-icon"),l=Hn,d=xc,u=CX,f=ns,p=_X;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["popover-container",a.show?"show-popover":"hide-popover"]),style:s.normalizeStyle(o.position),onMouseenter:t[0]||(t[0]=(...h)=>a.handleMouseEnter&&a.handleMouseEnter(...h)),onMouseleave:t[1]||(t[1]=(...h)=>a.handleMouseLeave&&a.handleMouseLeave(...h))},[s.createElementVNode("div",null,[n.type==="node"?(s.openBlock(),s.createElementBlock("div",p9e,[s.createElementVNode("div",g9e,[n.nodeInfo.collect?(s.openBlock(),s.createElementBlock("div",m9e,[s.createVNode(l,{content:"已收藏","popper-class":"el-tooltip-gray",placement:"left"},{default:s.withCtx(()=>[s.createVNode(c,{class:"button-img","icon-class":e.imgPath["./public/d3svg1/star.svg"]},null,8,["icon-class"])]),_:1})])):s.createCommentVNode("",!0),a.isNormalNode?(s.openBlock(),s.createElementBlock("div",v9e,[s.createElementVNode("div",y9e,s.toDisplayString(a.getTypeZh(n.nodeInfo.type))+":",1),s.createElementVNode("div",{class:s.normalizeClass(["value",{"star-next":n.nodeInfo.collect}])},s.toDisplayString(a.name),3)])):s.createCommentVNode("",!0),a.isNodeTypeNode?(s.openBlock(),s.createElementBlock("div",b9e,[w9e,s.createElementVNode("div",_9e,[s.createElementVNode("div",C9e,[s.createElementVNode("div",S9e,s.toDisplayString(n.nodeInfo.name),1)])])])):s.createCommentVNode("",!0),n.nodeInfo.label?(s.openBlock(),s.createElementBlock("div",E9e,[x9e,s.createElementVNode("div",k9e,s.toDisplayString(n.nodeInfo.label),1)])):s.createCommentVNode("",!0)]),s.createElementVNode("div",N9e,[a.isNormalNode&&n.nodeInfo.detail?(s.openBlock(),s.createElementBlock("div",T9e,[a.canGoDetail&&a.hasLevel?(s.openBlock(),s.createElementBlock("div",A9e,[O9e,s.createElementVNode("div",{class:s.normalizeClass(["value level",a.getLevelClass(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level)]),title:n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"},s.toDisplayString(n.nodeInfo.detail&&n.nodeInfo.detail.info.basic.level||"--"),11,I9e)])):s.createCommentVNode("",!0),n.nodeInfo.detail&&n.nodeInfo.detail.tags&&n.nodeInfo.detail.tags.length>0?(s.openBlock(),s.createElementBlock("div",R9e,[P9e,s.createElementVNode("div",L9e,[s.createElementVNode("div",B9e,[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.formatTags(n.nodeInfo.detail.tags),(h,m)=>(s.openBlock(),s.createBlock(l,{key:m,"popper-class":"el-tooltip-gray"},{content:s.withCtx(()=>[s.createElementVNode("div",null,[s.createTextVNode(s.toDisplayString(h.name===h.desc?h.name:h.name+":"+h.desc)+" ",1),h.disabled?(s.openBlock(),s.createElementBlock(s.Fragment,{key:0},[D9e,s.createTextVNode(" 标签状态:失效 ")],64)):s.createCommentVNode("",!0)])]),default:s.withCtx(()=>[s.createElementVNode("span",null,[s.createVNode(d,{class:s.normalizeClass(["graph-tag-one",`${h.type||"unknown"} ${h.disabled?"tag-disable":""}`]),type:h.type||"info"},{default:s.withCtx(()=>[s.createTextVNode(s.toDisplayString(h.name),1)]),_:2},1032,["class","type"])])]),_:2},1024))),128))])])])):s.createCommentVNode("",!0),(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(a.fieldMapThisType,(h,m)=>(s.openBlock(),s.createElementBlock(s.Fragment,null,[a.canShowField(h)?(s.openBlock(),s.createElementBlock("div",M9e,[s.createElementVNode("div",F9e,s.toDisplayString(h.zh)+":",1),s.createElementVNode("div",{class:s.normalizeClass(["value",{red:h.prop==="virus_name"}]),title:n.nodeInfo.detail.info.basic[m]},s.toDisplayString(a.getFieldValue(h)),11,$9e)])):s.createCommentVNode("",!0)],64))),256))])):s.createCommentVNode("",!0),a.isNodeTypeNode?(s.openBlock(),s.createElementBlock("div",z9e,[s.createElementVNode("div",U9e,[j9e,s.createElementVNode("div",q9e,[a.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum>0?(s.openBlock(),s.createElementBlock("span",H9e,[s.createElementVNode("span",G9e,s.toDisplayString(a.getNodeTypeChildNum(n.nodeInfo.id).dangerChildNum),1),s.createTextVNode("/")])):s.createCommentVNode("",!0),s.createTextVNode(s.toDisplayString(a.getNodeTypeChildNum(n.nodeInfo.id).allChildNum),1)])])])):s.createCommentVNode("",!0),a.isAggregateNode?(s.openBlock(),s.createElementBlock("div",W9e,[s.createElementVNode("div",K9e,"聚合节点 ("+s.toDisplayString(o.aggregationList.length)+"个)",1),s.createElementVNode("div",Y9e,[s.createVNode(p,{data:o.aggregationList,style:{width:"100%"}},{default:s.withCtx(()=>[s.createVNode(u,{prop:"name","min-width":"200",label:"名称"}),s.createVNode(u,{sortable:"",prop:"type",label:"类型"}),s.createVNode(u,{sortable:"",prop:"level",width:"80",label:"级别"},{default:s.withCtx(h=>[s.createElementVNode("span",{style:s.normalizeStyle({color:a.getColorStyle(h.row.level)})},s.toDisplayString(h.row.level||"--"),5)]),_:1}),s.createVNode(u,{label:"操作"},{default:s.withCtx(h=>[s.createVNode(f,{class:"add-to-graph-btn",type:"primary",text:"",size:"small",onClick:m=>a.addToGraph(h.row)},{default:s.withCtx(()=>[s.createTextVNode(" 添加到图谱 ")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])])):s.createCommentVNode("",!0)])])):(s.openBlock(),s.createElementBlock("div",J9e,[s.createElementVNode("div",X9e,[s.createElementVNode("div",Q9e,s.toDisplayString(n.nodeInfo.apiName),1)])]))])],38)}const V9e=Bt(h9e,[["render",Z9e],["__scopeId","data-v-a8e278b3"]]),eEe=[{id:52,product_id:0,name:"copy",namec:"复制",parent_id:0,has_child:0,status:0,type:2,path:"0-52",pos:65,ctime:"0000-00-00 00:00:00",utime:"2019-06-04 16:49:38",children:[]},{id:62,product_id:0,name:"release_aggregation",namec:"释放聚合顶点",parent_id:0,has_child:0,status:0,is_sys:0,is_detail:0,type:2,path:"0-62",pos:1,ctime:"0000-00-00 00:00:00",utime:"2019-05-06 15:08:10",children:[]}],tEe={name:"vue-safe-force-graph",version:"2.0.49",description:"force_graph in security area",author:"jason zhang",module:"./lib/vue-safe-force-graph.js",main:"./lib/vue-safe-force-graph.umd.cjs",type:"module",files:["/lib/"],exports:{".":{import:"./lib/vue-safe-force-graph.js",require:"./lib/vue-safe-force-graph.umd.cjs"},"./*":"./*"},scripts:{dev:"vite","dev:base64":"vite --mode development_base64",lib:"vite build","lib:base64":"vite build --mode production_base64",patch:'npm version patch -m "Upgrade to %s "',"patch:base64":'npm version patch -m "Upgrade to %s for base64"',p:"npm run patch && npm run lib && npm publish","p:base64":"npm run patch:base64 && npm run lib:base64 && npm publish",lint:"eslint --ext .js,.vue src",lintFix:"eslint --fix --ext .js,.vue src",imageToCdn:"node qcdn.cjs",imageToBase64:"node qcdn.cjs --buildtype=base64",changelog:"conventional-changelog -p angular -i CHANGELOG.md -s -r 0"},dependencies:{"@element-plus/icons-vue":"^2.1.0","@q/qapm":"^1.1.5","csv-parse":"^5.0.4",d3:"^7.8.5","d3-lasso":"0.0.5","element-plus":"^2.3.0",json2csv:"^5.0.7",konva:"^9.2.0","lodash-es":"^4.17.21","mime-types":"^2.1.35",minimist:"^1.2.6","radar-js-analytic-sdk":"^2.2.6",vue:"^3.2.47","vue-clipboard3":"^2.0.0","vue-router":"^4.1.6","vue-virtual-scroller":"^2.0.0-beta.8"},devDependencies:{"@babel/core":"^7.23.3","@babel/preset-env":"^7.23.3","@originjs/vite-plugin-commonjs":"^1.0.3","@q/qcdn":"^3.2.2","@vitejs/plugin-vue":"^4.1.0",axios:"^0.21.1","babel-eslint":"^10.1.0",eslint:"^7.32.0","eslint-plugin-vue":"^8.0.3",imageinfo:"^1.0.4",qs:"^6.10.1","rollup-plugin-visualizer":"^5.9.0",sass:"^1.62.0","unplugin-auto-import":"^0.15.2","unplugin-vue-components":"^0.24.1",vite:"^4.3.1"},browserslist:["> 1%","last 2 versions"],engines:{node:">=8.9",npm:">= 3.0.0"},license:"MIT"},KNe="",YNe="",JNe="",{toClipboard:nEe}=uf(),rEe="Arial,Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,sans-serif",ni=1,iEe=["ip","intranet","internet"],R_=20,cr={},oEe={name:"ForceGraphRenderByCanvas",components:{Popover:V9e,NodeContextmenu:f9e},mixins:[jr],provide:function(){return{levelList:this.levelList}},props:{data:{type:Object,default:()=>({nodes:[],links:[]})},history:{type:Object,default:()=>({})},strength:{type:Number,default:-600},isThreatPath:{type:Boolean,default:!1},requestGraphData:{type:Boolean,default:!1},moduleDetail:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}},alphaDecay:{type:Number,default:.0228},alphaMin:{type:Number,default:.001},darkMode:{type:Boolean,default:!0},levelList:{type:Array,default:()=>[{level:"未知",levelName:"未知",className:"unknown",normalColor:"#666",darkColor:"#c6cdd5",dangerNumber:0},{level:"危险",levelName:"危险",className:"warn",normalColor:"#CF1322",darkColor:"#fb2400",dangerNumber:1},{level:"普通",levelName:"普通",className:"normal",normalColor:"#007EE2",darkColor:"#0094ff",dangerNumber:-1},{level:"安全",levelName:"安全",className:"safe",normalColor:"#009A75",darkColor:"#00da90",dangerNumber:-2}]},nodeTypeScale:{type:Number,default:1},nodeTypeList:{type:Array,default:()=>[]},manualTickNumber:{type:Number,default:500},startNodeAnimation:{type:Boolean,default:!0}},emits:["handle-select-node","custom-contextmenu-click","flagFiles","updateSelection"],data(){return{prefix:"./public/",iconAllLoaded:!1,iconSize:{},iconFiles:{},flagFiles:{},highlightRule:{},nodesRange:null,mousePosition:{left:0,top:0},hoverNodePosition:{},uniqueClass:"",showPopover:!1,popoverTimer:null,popoverType:"",popoverContent:{},popoverNode:{},showContextMenu:!1,contextMenuNode:{},menuOptions:[],isDragging:!1,originTransform:null,dragNodeFix:!1,destroyed:!1,actKey:ma()?"metaKey":"ctrlKey",levelHeight:100,actNum:0,scriptNow:null,scriptInited:!1,canAct:!1,isKeyUp:!0,initTimes:0,resizeObserver:null,canvasElement:null,stage:s.shallowRef(null),layer:s.shallowRef(null),nodesGroup:s.shallowRef({}),linksGroup:s.shallowRef({}),grab:s.shallowRef(null),simulation:s.shallowRef(null),nodes:s.shallowRef(null),links:s.shallowRef(null),hoveredNode:s.shallowRef(null),mouseDownNode:s.shallowRef(null),selectionRect:null,selection:[],scale:ni,mousedownPos:null,mousedownNode:null,mouseupNode:null,dragLine:null,darkBgRect:null,inited:!1,hasSimulation:!1,nodesLength:0,ticking:!1,anim1:null,anim2:null,anim3:null}},computed:{isAutoTick(){var e;return((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber},iconSizeComputed(){const e=a$(this.iconSize);return this.nodeTypeList.forEach(t=>{e[t]=this.iconSize[t]*this.nodeTypeScale}),e},contextMenuNodes(){return this.contextMenuNode.id?this.selection.some(e=>e.id===this.contextMenuNode.id)?[...this.selection]:[this.contextMenuNode]:[]},showContextMenuFlag(){return this.requestGraphData?this.showContextMenu:!1}},watch:{data:{handler:function(){const e=this.nodesLength!==this.data.nodes.length;this.nodes=this.data.nodes,this.links=this.data.links,this.nodesLength=this.data.nodes.length,this.update(e)},deep:!0},moduleDetail:{handler:function(e){return Te(this,null,function*(){e!=null&&e.nodes&&!this.iconAllLoaded&&(yield this.loadIcons(),this.initForceGraph(),setTimeout(()=>{this.update()},50))})},deep:!0,immediate:!0},darkMode:{handler:function(e){return Te(this,null,function*(){const t=e?"dark":"light";setTimeout(()=>{this.update(),this.isThreatPath?document.querySelectorAll(`.${this.uniqueClass}.render-container`)[0].setAttribute("data-theme",t):(document.querySelectorAll(`.${this.uniqueClass}.render-container`)[0].setAttribute("data-theme",t),document.getElementsByClassName(this.uniqueClass+" render-container")[0].parentElement.parentElement.setAttribute("data-theme",t))},200)})},immediate:!0}},created(){Gn("graph created time",Date.now()),wi.setProject("QH_10542_1724").getTrack(),localStorage.getItem("showSafeForceGraphLog")&&Gn("组件版本: "+tEe.version),this.isThreatPath||this.initKeyEvent(),this.uniqueClass="unique"+new Date().getTime()+Math.floor(Math.random()*1e5)},mounted(){return Te(this,null,function*(){new PSe({appKey:"fe-force-graph",ratio:50}),this.initForceGraph(),zQ(this.levelList),!this.isThreatPath&&(uo(qe,"buttonClick",e=>{this.handleContextMenuClick(e)}),uo(qe,"relationClick",e=>{this.handleContextMenuClick(e)}),uo(qe,"sendNodesRange",(e,t)=>{e!==void 0&&(this.nodesRange=e,this.updateNodeStyle())}))})},beforeUnmount(){fo(qe,"buttonClick"),fo(qe,"relationClick"),fo(qe,"sendNodesRange"),this.unbindKeyEvent(),this.resetAll(),Gn("destroy")},methods:{initForceGraph(){return Te(this,null,function*(){if(this.inited)return;const e=this.$refs.canvasContainer;let t=e.clientWidth,n=e.clientHeight;this.resizeObserver=new ResizeObserver(o=>{for(const a of o){if(t=a.contentRect.width,n=a.contentRect.height,Gn(`新宽度: ${t}px, 新高度: ${n}px`),t===0||n===0)return;this.stage.width(t),this.stage.height(n),this.layer&&this.layer.batchDraw(),this.hasSimulation&&this.updateSimulation()}}),this.resizeObserver.observe(e),document.addEventListener("click",this.hideContextMenu,!1),this.nodes=this.data.nodes,this.links=this.data.links,this.stage=new ct.Stage({container:e,width:t,height:n,scaleX:ni,scaleY:ni}),this.layer=new ct.Layer,this.grab=new ct.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab);const r=this.layer.getCanvas()._canvas;this.canvasElement=r,this.stage.on("mousemove",o=>{if(!this.mousedownNode||!o.evt[this.actKey]){if(this.resetMouseVars(),this.selectionRect&&o.evt.altKey){const a=this.stage.getPointerPosition(),c=(a.x-this.stage.x())/this.scale,l=(a.y-this.stage.y())/this.scale,d=c-this.selectionRect.x(),u=l-this.selectionRect.y();this.selectionRect.width(d),this.selectionRect.height(u),this.stage.batchDraw()}}else{const a=this.stage.getPointerPosition(),c=this.stage.scaleX(),l=(a.x-this.stage.x())/c,d=(a.y-this.stage.y())/c;this.dragLine.points([this.mousedownPos.x,this.mousedownPos.y,l,d]),this.layer.batchDraw()}}),this.stage.on("wheel",o=>{o.evt.preventDefault();const a=1.1,c=this.scale,l=o.evt.deltaY<0?c*a:c/a;this.scale=l;const d=this.stage.getPointerPosition(),u=this.stage.position(),f=d.x-(d.x-u.x)*(l/c),p=d.y-(d.y-u.y)*(l/c);this.stage.setAttrs({scaleX:l,scaleY:l,x:f,y:p}),this.layer.batchDraw()}),this.stage.on("mousedown",o=>{const a=o.target;if(a&&a.nodeType==="Stage"?this.stage.setDraggable(!0):this.stage.setDraggable(!1),o.evt.altKey){this.stage.setDraggable(!1);const c=this.stage.scaleX(),l=this.stage.getPointerPosition(),d=(l.x-this.stage.x())/c,u=(l.y-this.stage.y())/c;this.selectionRect=new ct.Rect({x:d,y:u,width:0,height:0,stroke:"rgb(80, 80, 80)",strokeWidth:2}),this.layer.add(this.selectionRect),this.stage.batchDraw()}}),this.stage.on("mouseup",o=>{if(this.stage.setDraggable(!1),this.selectionRect&&o.evt.altKey){const a=this.selectionRect.x(),c=this.selectionRect.y(),l=this.selectionRect.width(),d=this.selectionRect.height();this.selection=this.nodes.filter(u=>{const f={x:u.x,y:u.y},p=Math.min(a,a+l),h=Math.max(a,a+l),m=Math.min(c,c+d),b=Math.max(c,c+d);return f.x>=p&&f.x<=h&&f.y>=m&&f.y<=b}),this.updateSelection(),this.selectionRect.destroy(),this.selectionRect=null}}),this.stage.on("contextmenu",this.handleGlobalContextMenu),this.stage.on("click",o=>{o.target&&o.target.nodeType==="Stage"&&this.handleDeselectNode(o)}),this.setSimulation(),this.stage.add(this.layer),this.stage.draw(),this.update(),this.inited=!0})},setSimulation(){var n;if(this.hasSimulation||!((n=this.nodes)!=null&&n.length))return;const e=this.stage.width()/(2*ni),t=this.stage.height()/(2*ni);this.hasSimulation=!0,this.simulation=mse(this.nodes).force("link",tse(this.links).id(r=>r.id).distance(120).strength(1)).force("charge",vse().strength(-600)).force("x",yse()).force("y",bse()).force("center",_S(e,t)).alphaDecay(this.alphaDecay).alphaMin(this.alphaMin).stop(),this.isAutoTick?(this.simulation.alpha(1).restart(),this.simulation.on("tick",this.ticked)):(this.simulation.on("tick",null),this.sendManualTick()),this.simulation.on("end",()=>{Gn("simulation end time",Date.now()),this.isThreatPath&&this.centerAndZoom(1)})},sendManualTick(){var e;Gn("sendManualTick",(e=this.nodes)==null?void 0:e.length),!this.ticking&&(this.ticking=!0,this.doClearCanvas(),this.simulation.alphaDecay(this.alphaDecay*2),this.simulation.alphaMin(this.alphaMin*5),this.simulation.alpha(1).restart(),setTimeout(()=>{console.time("tick");for(let t=0,n=Math.ceil(Math.log(this.simulation.alphaMin())/Math.log(1-this.simulation.alphaDecay()));t<n;++t)Gn("tick"),this.simulation.tick();console.timeEnd("tick"),this.ticking=!1,this.update(),this.centerAndZoom()},1e3))},update(e=!1){return Te(this,null,function*(){var t,n,r;!this.iconAllLoaded&&((n=(t=this.moduleDetail)==null?void 0:t.nodes)!=null&&n.length)&&(yield this.loadIcons()),!this.destroyed&&(r=this.nodes)!=null&&r.length&&(this.initScript(),Gn("update"),e&&this.updateSimulation(),this.doClearCanvas(),this.paintLinks(),this.paintNodes(),this.updateSelection(),this.ticked(),this.actNum===9&&setTimeout(()=>{this.centerAndZoom(.8)},200))})},doClearCanvas(){this.nodesGroup={},this.linksGroup={},this.layer.destroyChildren(),this.grab=new ct.Group({id:"grab",x:0,y:0}),this.layer.add(this.grab)},paintNodes(){const e=this.stage.width()/2,t=this.stage.height()/2,n=this.selection.map(r=>r.id);this.nodes.forEach(r=>Te(this,null,function*(){var w,_,C,k,S,E,T,A,O,I,F,R,q,z,G,Y,Z,U,j,H;let o;r.type==="nodeType"?o=this.iconSizeComputed[r.icon]||this.iconSizeComputed.node_type:o=this.iconSize[r.icon]||this.iconSize[r.type]||24;const a=((C=(_=(w=r==null?void 0:r.detail)==null?void 0:w.info)==null?void 0:_.basic)==null?void 0:C.level)||"",c=(E=(S=(k=r==null?void 0:r.detail)==null?void 0:k.info)==null?void 0:S.basic)==null?void 0:E.flag;let l;try{l=yield this.getNodeImage(r)}catch(M){console.log(M)}this.nodesGroup[r.id]&&((T=this.nodesGroup[r.id])==null||T.destroy());const d=new ct.Group({name:"nodeGroup",opacity:1,id:`${r.id}`,x:r.x?r.x:e,y:r.y?r.y:t,draggable:!0,visible:r.show});if(n.includes(r.id)&&d.addName("isSelected"),r.startNode&&this.startNodeAnimation){const M=as(a,this.levelList,this.darkMode),D=new ct.Circle({x:0,y:0,radius:20,fill:M,opacity:0}),te=new ct.Circle({x:0,y:0,radius:20,fill:M,opacity:0}),V=new ct.Circle({x:0,y:0,radius:20,fill:M,opacity:0});d.add(D),d.add(te),d.add(V);const ee=(X,oe)=>new ct.Animation(function(se){const B=se.time;if(B%oe/oe===0)return!1;const re=.5-.5*(B%oe)/oe,ce=40*(B%oe)/oe;X.radius(ce||0),X.opacity(re)},this.layer);(A=this.anim1)==null||A.stop(),(O=this.anim2)==null||O.stop(),(I=this.anim3)==null||I.stop(),this.anim1=ee(D,1500),this.anim2=ee(te,1500),this.anim3=ee(V,1500),(F=this.anim1)==null||F.start(),setTimeout(()=>{this.anim2.start()},500),setTimeout(()=>{this.anim3.start()},1e3)}else if(r.startNode&&!this.startNodeAnimation){const M=as(a,this.levelList,this.darkMode),D=new ct.Circle({x:0,y:0,radius:20,fill:M,opacity:this.startNodeAnimation?0:.3});d.add(D)}if(r.type==="ip"||r.type==="internet"||r.type==="country"||r.type==="target_country"){const M=as(a,this.levelList,this.darkMode),D=new ct.Circle({x:0,y:0,fill:this.darkMode?"#182628":"#fff",radius:o/2,stroke:M,strokeWidth:2});d.add(D)}if(l){const M=c||(q=(R=r==null?void 0:r.detail)==null?void 0:R.info)!=null&&q.inner_country?20:o,D=l&&new ct.Image({x:0,y:0,offsetX:M/2,offsetY:M/2,image:l,width:M,height:M,draggable:!1});d.add(D)}if(r.detail&&r.type==="md5"){const M=((Y=(G=(z=r.detail.info)==null?void 0:z.basic)==null?void 0:G.file_type)==null?void 0:Y.toUpperCase())||"MD5",D=new ct.Text({name:"md5Text",x:0,y:0,text:M,fontSize:4,fontWeight:700,fontFamily:rEe,fill:this.darkMode?"#182628":"#fff",align:"center",listening:!1});D.x(D.x()-D.width()/2),d.add(D)}const u=r.textProp||"name",f=u==="name"?((U=(Z=r==null?void 0:r.detail)==null?void 0:Z.info)==null?void 0:U.name)||r.name:r[u];let p=f.length>14&&!iEe.includes(r.type)?f.slice(0,7)+"..."+f.slice(-7):f;p=JQ(p);const h=new ct.Text({offsetY:o/2,name:"konvaText",x:0,y:o+8,text:p,fontSize:12,fontFamily:"Calibri",fill:this.darkMode?"#cdd9da":"#000",align:"center",listening:!1,visible:!!r.textProp});h.x(h.x()-h.width()/2),d.add(h);const m=new ct.Circle({name:"border",x:0,y:0,radius:o/2,fill:"#5c6271",opacity:.4,visible:!1});if(d.add(m),(H=(j=r.detail)==null?void 0:j.tags)!=null&&H.length){const M=new ct.Circle({x:((o/2||14)+5)*Math.sin(60*Math.PI/180),y:-((o/2||14)+5)*Math.cos(60*Math.PI/180),radius:3,fill:"#9300ff",listening:!1});d.add(M)}if(r.type!=="nodeType"&&r.type!=="aggregation"){var b=new ct.Circle({name:"collect",x:((o/2||14)+5)*Math.sin(0*Math.PI/180),y:-((o/2||14)+5)*Math.cos(0*Math.PI/180),radius:3,fill:"#ffad00",visible:!!r.collect});d.add(b)}if(r.label){const M=new ct.Circle({x:((o/2||14)+5)*Math.sin(30*Math.PI/180),y:-((o/2||14)+5)*Math.cos(30*Math.PI/180),radius:3,fill:"#0099ff",listening:!1});d.add(M)}d.on("dragstart",(M,D)=>{M.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(.3).restart(),this.isDragging=!0)}),d.on("dragmove",M=>{if(!M.evt[this.actKey]){var D=this.simulation.nodes().find(te=>te.id===r.id);D&&(D.x=d.x(),D.fx=d.x(),D.y=d.y(),D.fy=d.y(),this.links.forEach(te=>{const V=this.linksGroup[`${te.source.id}-${te.target.id}`],ee=V==null?void 0:V.findOne(".konvaLine"),X=V==null?void 0:V.findOne(".linkArrow"),oe=V==null?void 0:V.findOne(".edgeLabel");let se,B,W,re;if(te.source.id===D.id){if(!this.nodesGroup[te.target.id])return;se=D.x,B=this.nodesGroup[te.target.id].x(),W=D.y,re=this.nodesGroup[te.target.id].y(),ee.points([se,W,B,re]);const ce=q0(se,W,B,re,R_);X==null||X.x(ce==null?void 0:ce.x),X==null||X.y(ce==null?void 0:ce.y),X==null||X.rotation(Math.atan2(re-W,B-se)*(180/Math.PI))}else if(te.target.id===D.id){if(!this.nodesGroup[te.source.id])return;se=this.nodesGroup[te.source.id].x()||0,B=D.x||0,W=this.nodesGroup[te.source.id].y()||0,re=D.y||0,ee.points([se,W,B,re]);const ce=q0(se,W,B,re,R_);X==null||X.x(ce==null?void 0:ce.x),X==null||X.y(ce==null?void 0:ce.y),X==null||X.rotation(Math.atan2(re-W,B-se)*(180/Math.PI))}if(oe&&(te.source.id===D.id||te.target.id===D.id)){oe.x((se+B)/2),oe.y((W+re)/2),oe.offsetX(oe.getWidth()/2||0),oe.offsetY(oe.getHeight()/2+8||0);const ce=Math.atan2(re-W,B-se)*(180/Math.PI);B<se?oe.rotation(ce+180):oe.rotation(ce)}}),this.layer.batchDraw())}}),d.on("dragend",M=>{M.evt[this.actKey]||(this.isAutoTick&&this.simulation.alphaTarget(0),this.isDragging=!1)}),d.on("click",M=>{M.evt.detail===2?this.expandNodes(M,r):M.evt.detail===1&&M.evt.button===0&&this.handleNodeClick(M,r)}),d.on("contextmenu",M=>{M.cancelBubble=!0,M.evt.preventDefault(),M.evt.stopPropagation(),this.handleNodeContextMenu(M,r,d)}),d.on("mouseup",M=>this.handleNodeMouseUp(M,r)),d.on("mousedown",M=>this.handleNodeMouseDown(M,r)),d.on("mouseenter",M=>this.handleNodeMouseEnter(M,r)),d.on("mouseleave",M=>this.handleNodeMouseLeave(M,r)),this.grab.add(d),this.nodesGroup[r.id]=d})),this.stage.batchDraw()},paintLinks(){const e=this.stage.width()/2,t=this.stage.height()/2;this.links.forEach(n=>{this.linksGroup[`${n.source.id}-${n.target.id}`]&&this.linksGroup[`${n.source.id}-${n.target.id}`].destroy();const r=new ct.Group({opacity:1,id:`${n.source.id}-${n.target.id}`,visible:n.source.show&&n.target.show}),o=this.darkMode?"#445152":"#999",a=new ct.Arrow({name:"linkArrow",pointerLength:10,pointerWidth:10,x:e,y:t,fill:o});r.add(a);const c=n.source.x||0,l=n.source.y||0,d=n.target.x||0,u=n.target.y||0,f=new ct.Line({name:"konvaLine",id:`${n.source.id}-${n.target.id}`,points:[c,l,d,u],stroke:n.target.type==="org"?"#cf1322":o,strokeWidth:1,dash:n.diy===!0?[5,5]:null});if(n.target.type==="nodeType"){const p=new ct.Text({name:"edgeLabel",x:(c+d)/2,y:(l+u)/2,text:n.target.name,fontSize:12,fill:this.darkMode?"#cdd9da":"#000"});r.add(p)}r.add(f),this.grab.add(r),r.moveToBottom(),this.linksGroup[`${n.source.id}-${n.target.id}`]=r}),this.stage.batchDraw()},updateSimulation(){var e,t;try{if(!this.simulation&&!this.hasSimulation){this.setSimulation();return}this.simulation.nodes(this.nodes),this.simulation.force("link").links(this.links),this.simulation.alpha(.4).restart(),this.history.layoutIndex===0?((e=this.nodes)==null?void 0:e.length)<this.manualTickNumber?this.simulation.on("tick",this.ticked):(this.simulation.on("tick",null),this.sendManualTick()):this.simulation.on("tick",this.ticked)}catch(n){console.log(n,"simulation-e1"),(t=this.simulation)==null||t.stop()}},ticked(){switch(Gn("ticked"),this.history.layoutIndex){case 0:this.forceLayout();break;case 1:this.treeLayout();break;default:this.forceLayout();break}},forceLayout(){var t;if(!this.nodes.length||!this.links.length)return;let e=!0;for(let n=0;n<this.links.length;n++){const r=this.links[n],o=this.linksGroup[`${r.source.id}-${r.target.id}`],a=o==null?void 0:o.findOne(".konvaLine"),c=o==null?void 0:o.findOne(".linkArrow"),l=o==null?void 0:o.findOne(".edgeLabel");let d=r.source.x,u=r.source.y,f=r.target.x,p=r.target.y;const h=f-d||1,m=p-u||1,b=Math.sqrt(h*h+m*m),w=h/b||1,_=m/b||1,C=r.source.type==="nodeType"?(this.iconSizeComputed[r.source.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1,k=r.target.type==="nodeType"?(this.iconSizeComputed[r.target.icon]||14)/2-1:(this.iconSize[r.target.type]||14)/2-1;if(d=d+C*w,u=u+C*_,f=f-k*w,p=p-k*_,isNaN(d)||isNaN(u)||isNaN(f)||isNaN(p)){e=!1;break}if(a==null||a.points([d,u,f,p]),c){const S=q0(d,u,f,p,R_);c==null||c.x((S==null?void 0:S.x)||0),c==null||c.y((S==null?void 0:S.y)||0),c==null||c.rotation(Math.atan2(p-u,f-d)*(180/Math.PI))}if(l){l.x((d+f)/2),l.y((u+p)/2),l.offsetX(l.getWidth()/2||0),l.offsetY(l.getHeight()/2+8||0);const S=Math.atan2(p-u,f-d)*(180/Math.PI);f<d?l.rotation(S+180):l.rotation(S)}}if(!e){Gn("请点击自动布局按钮"),this.resetLayout();return}for(let n=0;n<this.nodes.length;n++){const r=this.nodes[n];(t=this.nodesGroup[r.id])==null||t.position({x:r.x||0,y:r.y||0})}},selectEdgesByNode(e){const t=e.map(n=>n.id);this.links.forEach(n=>{const r=this.linksGroup[`${n.source.id}-${n.target.id}`];t.includes(n==null?void 0:n.target.id)||t.includes(n==null?void 0:n.source.id)?r==null||r.addName("isSelected"):r==null||r.removeName("isSelected")})},showKeyWay(e){if(e.length!==1){this.links.forEach(r=>{const o=this.linksGroup[`${r.source.id}-${r.target.id}`];o==null||o.removeName("keyed")}),this.history.resetKeyLinksAndNodes();return}const{keyLinks:t,keyNodeIds:n}=this.history.findKeyLinksAndNodes(e[0].id,!0);this.links.forEach(r=>{const o=t.find(c=>c.source.id===r.source.id&&c.target.id===r.target.id),a=this.linksGroup[`${r.source.id}-${r.target.id}`];o?a==null||a.addName("keyed"):a==null||a.removeName("keyed")}),this.nodes.forEach(r=>{const o=this.nodesGroup[r.id];n.includes(r.id)?o==null||o.addName("keyed"):o==null||o.removeName("keyed")})},updateNodeStyle(){if(!this.iconAllLoaded)return;let e;this.nodesRange&&this.history.keyNodeIds?e=[...this.nodesRange.map(t=>t.id),...this.history.keyNodeIds]:this.nodesRange?e=this.nodesRange.map(t=>t.id):this.history.keyNodeIds&&(e=this.history.keyNodeIds),setTimeout(()=>{this.highlightByRule(this.highlightRule,e),this.updateNodesStyleByName(),this.updateLinksStyleByName()},0)},updateNodesStyleByName(){this.nodes.forEach(e=>{const t=this.nodesGroup[e.id];if(!t)return;const n=t==null?void 0:t.findOne(".border"),r=t==null?void 0:t.findOne(".konvaText"),o=this.darkMode?"#cdd9da":"#000";t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1),t!=null&&t.hasName("isSelected")?(t.scale({x:8/7,y:8/7}),n==null||n.visible(!0)):(t.scale({x:1,y:1}),n==null||n.visible(!1)),e.type!=="nodeType"&&(t!=null&&t.hasName("isSelected")?(r==null||r.visible(!0),r==null||r.fill("#007ee2")):(r==null||r.visible(!!e.textProp),r==null||r.fill(o)))}),this.layer.batchDraw()},updateLinksStyleByName(){this.links.forEach(e=>{const t=this.linksGroup[`${e.source.id}-${e.target.id}`];if(!t)return;const n=t.findOne(".konvaLine"),r=t.findOne(".edgeLabel"),o=t.findOne(".linkArrow");t!=null&&t.hasName("lowlight")?t==null||t.opacity(.4):t==null||t.opacity(1);const a=this.darkMode?"#445152":"#999";if(t.hasName("isSelected")||t.hasName("keyed")){const c=e.target.type==="org"?"#cf1322":"#007ee2";n.stroke(c),o.fill(c),n.strokeWidth(1),t==null||t.opacity(1),r==null||r.fill("#007ee2"),t.hasName("keyed")?n.strokeWidth(3):n.strokeWidth(1)}else{const c=e.target.type==="org"?"#cf1322":a;this.linksGroup[`${e.source.id}-${e.target.id}`].removeName("isSelected"),n.strokeWidth(1),n.stroke(c),o.fill(c),r==null||r.fill(this.darkMode?"#cdd9da":"#000")}}),this.layer.batchDraw()},handleTableSelect(e=[]){this.selection=this.nodes.filter(t=>{let n;return e.length>1?n=e.indexOf(t.id)>=0&&t.type!=="nodeType"&&t.type!=="aggregation":n=e.indexOf(t.id)>=0,n}),this.updateSelection()},resetAll(){var e,t;document.removeEventListener("click",this.hideContextMenu),(e=this.simulation)==null||e.stop(),this.simulation=null,this.hasSimulation=!1,this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,this.$refs.canvasContainer&&((t=this.resizeObserver)==null||t.unobserve(this.$refs.canvasContainer)),this.nodes=[],this.links=[],this.resizeObserver=null,this.destroyed=!0,this.history.destroy&&this.history.destroy()},unbindKeyEvent(){this.initKeyEvent(1)},initKeyEvent(e=0){if(e){document.removeEventListener("keydown",this.keyDown),document.removeEventListener("keyup",this.keyUp);return}document.addEventListener("keydown",this.keyDown),document.addEventListener("keyup",this.keyUp),this.isKeyUp=!0},keyDown(e){const t=e.keyCode,n=e[this.actKey],r=e.shiftKey;if(this.isKeyUp)switch(t){case 17:break;case 16:this.toggleZoom(!1);break;case 38:break;case 40:this.goAction();break;case 67:if(window.getSelection().toString())return;n&&this.copyNodeText(this.selection);break;case 89:n&&!ma()&&this.$parent.historyForward();break;case 90:n&&r?this.$parent.historyForward():n&&this.$parent.historyBack();break;case 46:this.$parent.deleteNodes(this.selection);break}},keyUp(e){const t=e.keyCode,n=e.keyCode;if(ma())switch(n){case 17:break;case 16:this.toggleZoom(!0);break}else switch(t){case 17:break;case 16:this.toggleZoom(!0);break}this.isKeyUp=!0},initScript(){var r,o,a,c,l,d;if(this.scriptInited)return;((a=(o=(r=this.history)==null?void 0:r.dataNow)==null?void 0:o.nodes)==null?void 0:a.length)>0&&(this.scriptInited=!0);const e=["193.36.119.50","6cd7b91212983cc557c6e3e671734ff9"];let t=null;if((d=(l=(c=this.history)==null?void 0:c.dataNow)==null?void 0:l.nodes)==null||d.some(u=>{const f=e.indexOf(u.id);return f>=0&&u.startNode===!0&&(t=f),!0}),t===null)return;const n=[[{node:"193.36.119.50"},{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"}],[{node:"6cd7b91212983cc557c6e3e671734ff9"},{node:"http://9d1109ab.privatedns.org/download/FirefoxSetup.dll"},{node:"94.237.81.57"},{node:"chart.expocasheuro.com"},{node:"183.246.177.59"},{node:"e7db5b09a39e324d36e937d89f98fdb9122cd859"}]];this.scriptNow=n[t],this.canAct=!!this.scriptNow},goAction(){if(!this.scriptNow||this.actNum>(this.scriptNow.length-1)*2)return;if(this.actNum===(this.scriptNow.length-1)*2){this.centerAndZoom(),this.actNum++;return}const e=this.scriptNow[Math.floor(this.actNum/2)+1];if(this.actNum%2===0){if(!this.history.dataNow.nodes.some(t=>t.id===e.node))return;this.handleTableSelect(e.node),this.nodesMoveToCenterView([e.node]),this.actNum++}else this.$parent.expandNodes(this.selection[0]),setTimeout(()=>{this.nodesMoveToCenterView([this.selection[0].id])},100),this.actNum++},nodesMoveToCenterView(e,t=.9){if(e.length===0)return;const n=[],r=this.nodes.filter(k=>e.indexOf(k.id)>=0);r==null||r.forEach(function(k,S){const E=this.nodesGroup[k.id];n.push({bounds:(E==null?void 0:E.getClientRect())||{},fx:k.x||0,fy:k.y||0})});const o=this.getBounds(n);this.originTransform=this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()};const a=this.stage.width(),c=this.stage.height()/1.5,l=o.width,d=o.height;if(l===0||d===0)return;let u=t/Math.max(l/a,d/c);u=Math.min(u,ni)||ni,this.scale=u;const f=this.stage.width()/(2*u),p=this.stage.height()/(2*u),h=this.nodesGroup[e[0]],m=h==null?void 0:h.getClientRect(),b=m.x*u,w=m.y*u,_=f-b,C=p-w;this.stage.setAttrs({scaleX:u,scaleY:u,x:_||0,y:C||0}),this.layer.batchDraw()},getBounds(e){let t,n,r,o;return e.map(a=>{const c=a.bounds,l=c.x+a.fx,d=c.y+a.fy;t=Math.min(l,t)||l,n=Math.min(d,n)||d,r=Math.max(l+c.width,r)||l+c.width,o=Math.max(d+c.height,o)||d+c.height}),{x:t,y:n,width:r-t,height:o-n}},resetMouseVars(){var e;this.mousedownNode=null,this.mousedownPos=null,this.mouseupNode=null,(e=this.dragLine)==null||e.destroy(),Object.keys(this.nodesGroup).forEach(t=>{this.nodesGroup[t].draggable(!0)})},loadIcons(){return new Promise((e,t)=>{const n=[],r=[];for(const d in this.moduleDetail.plugs){const u=this.moduleDetail.plugs[d];u==null||u.map(f=>{f.children?r.push(...f.children):r.push(f)})}n.push(...r.map(d=>d.icon)),n.push(...this.moduleDetail.nodes.map(d=>d.name)),n.push("node_type"),n.push("node"),n.push("aggregation");const o=this;let a=0;const c=n.filter(d=>this.imgPath[`${o.prefix}d3svg1/${d}.svg`]);function l(d){return{}.VITE_SVG_TYPE==="base64"?S5(d):_5(d)}c.map(d=>{l(this.imgPath[`${o.prefix}d3svg1/${d}.svg`]).then(u=>{o.iconFiles[d]=u;const f=XQ(u).width;this.iconSize[d]=f,a++,a===c.length&&(o.iconAllLoaded=!0,e())}).catch(u=>{console.log(u,"e"),t()})})})},toggleZoom(e){},handleNodeContextMenu(e,t){var n,r;e.evt[this.actKey]||(clearTimeout(this.popoverTimer),this.showPopover=!1,this.contextMenuId++,this.contextMenuNode=t,this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.showContextMenu=!0,e.currentTarget.type==="aggregation"?this.menuOptions=eEe:this.menuOptions=(n=this.$parent.moduleDetail)!=null&&n.plugs[t.type]?Array.from((r=this.$parent.moduleDetail)==null?void 0:r.plugs[t.type]):[])},handleDeselectNode(e,t){ye(this,"handle-select-node",{isSelected:!1,_node:s.toRaw(t)}),this.selection.length&&(this.selection=[],this.updateSelection()),this.setHighlightRule({}),this.hideContextMenu()},setHighlightRule({prop:e,type:t,value:n}){this.highlightRule={prop:e,type:t,value:n},this.updateNodeStyle(),t||yC(".legend-filter .out-box").classed("active",!1)},updateSelection(){const e=this.selection.map(t=>t.id);this.nodes.forEach(t=>{var n,r;e.includes(t.id)?(n=this.nodesGroup[t.id])==null||n.addName("isSelected"):(r=this.nodesGroup[t.id])==null||r.removeName("isSelected")}),ye(this,"updateSelection")},toggleLayout(e){this.history.layoutIndex=e,this.nodes.map(t=>{t.fx=t.fy=null}),this.updateSimulation(),this.ticked(),setTimeout(()=>{this.centerAndZoom()},200)},handleNodeClick(e,t){en({cId:"handleNodeClick",c:"点击节点"}),this.canAct&&(t.type==="org"?window.open("http://bs.safe.360.net/starmap","__blank"):t.type==="nodeType"&&t.id.indexOf("org")>=0&&window.open("http://bs.safe.360.net/orglist?snapshot=true","__blank1")),this.hideContextMenu();const n=this.selection.some(o=>o.id===t.id);if(e.evt.shiftKey){if(t.type==="nodeType"||this.selection.some(o=>o.type==="nodeType"))return;n?this.selection=this.selection.filter(o=>o.id!==t.id):this.selection=[...this.selection,t]}else n?this.selection=[]:this.selection=[t];const r=this.selection.some(o=>o.id===t.id);ye(this,"handle-select-node",{isSelected:r,_node:t}),this.updateSelection(),this.setHighlightRule(this.highlightRule)},handleNodeMouseEnter(e,t){if(!this.showContextMenu&&!e.evt[this.actKey]){const n=e.target.width(),r=e.target.height(),o=e.target,a=o.getAbsolutePosition(),l=o.getStage().container().getBoundingClientRect(),d=a.x-n/2+l.left,u=a.y-r/2+l.top,f=d,p=u,h=f,m=f+n,b=p,w=p+r;this.hoverNodePosition={top:b,right:m,bottom:w,left:h,width:n,height:r},this.popoverType="node",this.popoverContent={[t.type]:t.id},this.popoverNode=t,this.popoverTimer&&clearTimeout(this.popoverTimer),this.popoverTimer=setTimeout(()=>{this.showPopover=!0},200)}},handleNodeMouseLeave(e,t){this.showContextMenu||(clearTimeout(this.popoverTimer),this.showPopover=!1)},handleNodeMouseUp(e,t){var n;e.evt[this.actKey]&&this.mousedownNode&&(this.dragLine&&((n=this.dragLine)==null||n.destroy()),this.mouseupNode=t,this.mouseupNode.id===this.mousedownNode.id||this.mouseupNode.type==="aggregation"||this.mousedownNode.type==="aggregation"||this.$parent.addLink(this.mousedownNode,this.mouseupNode)),this.resetMouseVars()},handleNodeMouseDown(e,t){if(e.evt[this.actKey]){this.mousedownNode=t,this.nodesGroup[t.id].draggable(!1);const n=this.stage.scaleX(),r=this.stage.getPointerPosition(),o=(r.x-this.stage.x())/n,a=(r.y-this.stage.y())/n;this.mousedownPos={x:o,y:a},this.dragLine=new ct.Line({points:[o,a,o,a],stroke:"black",strokeWidth:1,dash:[5,5],opacity:.7,visible:!0}),this.layer.add(this.dragLine),this.stage.draw()}},treeLayout(){this.nodes.map(e=>{e.fx=e.pos,e.fy=e.levelNum*this.levelHeight}),this.forceLayout()},resetLayout(){this.simulation.stop(),this.nodes.map(e=>{delete e.vx,delete e.vy,delete e.x,delete e.y,delete e.fx,delete e.fy}),this.updateSimulation()},selectSingleEdgeNode(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)});for(let n=t.length-1;n>=0;n--){let r=0,o=0;const a=t[n];this.links.map(c=>{c.source.id===a&&r++,c.target.id===a&&o++}),r>=1&&t.splice(n,1),o>=2&&t.splice(n,1)}return t},selectChildren(e){const t=[];this.links.map(n=>{n.source.id===e.id&&t.push(n.target.id)}),this.handleTableSelect(t)},selectParents(e){const t=[];this.links.map(n=>{n.target.id===e.id&&t.push(n.source.id)}),this.handleTableSelect(t)},handleGlobalContextMenu(e){this.mousePosition.left=e.evt.clientX,this.mousePosition.top=e.evt.clientY,this.menuOptions=[],this.showContextMenu=!0,this.showPopover=!1,this.contextMenuNode={},e.evt.preventDefault()},hideContextMenu(){this.showContextMenu=!1,this.contextMenuNode={}},centerAndZoom(e=.7,t=!1){var f,p,h;if(this.originTransform={scaleX:this.stage.scaleX(),scaleY:this.stage.scaleY(),x:this.stage.x(),y:this.stage.y()},!this.grab)return;const n=this.stage.width(),r=this.stage.height(),o=this.grab.getClientRect(),a=o.width/this.scale,c=o.height/this.scale;if(a===0||c===0)return;let l=e/Math.max(a/n,c/r);if(l=t?l:Math.min(l,ni)||ni,!t&&l>ni)return;this.scale=l;const d=this.stage.width()/(2*l),u=this.stage.height()/(2*l);if((f=this.simulation)!=null&&f.force&&((p=this.simulation)==null||p.force("center",_S(d,u))),this.ticked(),this.stage.setAttrs({scaleX:l,scaleY:l,x:0,y:0}),this.layer.batchDraw(),this.history.layoutIndex===1){const m=this.grab.getClientRect(),b=(n-m.width)/2-m.x,w=(r-m.height)/2-m.y;this.stage.setAttrs({x:b,y:w}),this.layer.batchDraw(),(h=this.simulation)==null||h.stop()}},reset(){this.stage.setAttrs(this.originTransform)},handleContextMenuClick({nodes:e,api:t,dataApi:n}){if(this.requestGraphData){let r,o;const a={show_label:"label",all_show_label:"label",all_show_names:"name",show_names:"name"};switch(t&&t.name){case"edit_label":this.editLabel(e);break;case"single_edge_select":r=this.selectSingleEdgeNode(e[0]),this.selection=this.nodes.filter(c=>r.includes(c.id));break;case"hold_aggregation":o=this.selectSingleEdgeNode(e[0]),this.$parent.aggregationNodes(o,e[0]);break;case"release_aggregation":this.$parent.releaseAggregation(e[0]);break;case"show_label":case"show_names":e.map(c=>{this.showLabel(c,a[t.name])});break;case"all_show_label":case"all_show_names":this.nodes.map(c=>{this.showLabel(c,a[t.name])});break;case"un_show_names":case"un_show_label":e.map(c=>{this.hideLabel(c)});break;case"all_un_show_names":case"all_un_show_label":this.nodes.map(c=>{this.hideLabel(c)});break;case"copy":this.copyNodeText(e);break;case"node_star":e.map(c=>{this.starNode(c)});break;case"un_node_star":e.map(c=>{this.starNode(c,!1)});break;case"fix_nodes":e.map(c=>{this.toggleMove(c,!0)});break;case"un_fix_nodes":e.map(c=>{this.toggleMove(c,!1)}),this.updateSimulation();break;case"all_fix_nodes":this.fixAllNodes(!0);break;case"all_un_fix_nodes":this.fixAllNodes(!1);break;case"expand_node":e.map(c=>{this.$parent.expandNodes(c)});break;case"expand_part_node":e.map(c=>{this.$parent.expandNodes(c,n)});break;case"go_result":this.handleGoDetail(e);break;case"delete_node":this.$parent.deleteNodes(e);break;case"select_children":this.selectChildren(e[0]);break;case"select_parents":this.selectParents(e[0]);break;case"undo":this.$parent.historyBack();break;case"redo":this.$parent.historyForward();break;case"add_con_node":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"add_link":this.$parent.$refs.buttonList.addNode("diy",e[0]);break;case"show_node":this.toggleShowNode(e[0],e[1],!0);break;case"hide_node":this.toggleShowNode(e[0],e[1],!1);break;default:ye(this,"custom-contextmenu-click",{eventName:t.name,customConfig:t.customConfig,nodes:e,allNodes:s.toRaw(this.history.dataNow.nodes)})}this.hideContextMenu(),setTimeout(()=>{this.updateSelection()},400)}else Lt({message:"无可操作权限",type:"warning"})},expandNodes(e,t){en({cId:"dblclick",c:"双击节点"}),this.requestGraphData?this.$parent.expandNodes(t):Lt({message:"无可操作权限",type:"warning"})},toggleShowNode(e,t,n=!0){this.history.toggleShowNode(e,t,n),this.selection.filter(o=>o.show).length>0||this.handleTableSelect([]),setTimeout(this.updateNodeStyle,100)},copyNodeText(e){let t="";e.filter(n=>n.type!=="aggregation"&&n.type!=="nodeType").map(n=>{t=t+n.id+`
|
|
145
145
|
`}),t&&nEe(t).then(()=>{Lt({message:"复制成功",type:"success"})},n=>{console.log("copy---e",n)})},toggleMove(e,t){e.fx=t?e.x:null,e.fy=t?e.y:null},autoDisplay(){this.nodes.map(e=>{e.fx=null,e.fy=null})},editLabel(e){var t;g5.prompt("修改备注",{confirmButtonText:"确定",cancelButtonText:"取消",inputValue:(t=e[0])==null?void 0:t.label,inputPlaceholder:"请输入备注,最多20字",inputValidator:n=>n.length>20?"已超过20字":!0}).then(({value:n})=>{e.map(r=>{r.label=n,this.showLabel(r,"label")}),this.updateNodeStyle()}).catch(n=>{console.log(n)})},showLabel(e,t){e.textProp=t,this.update()},hideLabel(e,t){e.textProp=null,this.update()},safeGet(e,t){return!e||!t?void 0:t.split(".").reduce((o,a)=>o&&o[a]?o[a]:void 0,e)},fixAllNodes(e=!0){this.nodes.map(t=>{this.toggleMove(t,e)}),!e&&this.isAutoTick&&this.updateSimulation()},highlightByRule(e,t){if(!e.prop&&!t){this.nodes.forEach(l=>{const d=this.nodesGroup[l.id];d==null||d.removeName("lowlight")}),this.links.forEach(l=>{const d=this.linksGroup[`${l.source.id}-${l.target.id}`];d==null||d.removeName("lowlight")});return}const{type:n,prop:r,value:o}=e,a=this,c=[];this.nodes.forEach(l=>{const d=this.nodesGroup[l.id];r?n==="include"?o.includes(a.safeGet(l,r))&&a.inNodesRange(t,l)?(d==null||d.removeName("lowlight"),c.push(l)):d==null||d.addName("lowlight"):n==="equal"?a.safeGet(l,r)===o&&a.inNodesRange(t,l)?(d==null||d.removeName("lowlight"),c.push(l)):d==null||d.addName("lowlight"):n==="boolean"&&(j0(a.safeGet(l,r))&&a.inNodesRange(t,l)?(d==null||d.removeName("lowlight"),c.push(l)):d==null||d.addName("lowlight")):a.inNodesRange(t,l)?(d==null||d.removeName("lowlight"),c.push(l)):d==null||d.addName("lowlight")}),this.links.forEach(l=>{const d=this.linksGroup[`${l.source.id}-${l.target.id}`];c.some(f=>f.id===l.target.id)?d==null||d.removeName("lowlight"):d==null||d.addName("lowlight")})},handleCustomSelect(e){if(this.handleDeselectNode(),!e.prop)return;const{type:t,prop:n,value:r}=e,o=this;this.nodes.forEach(a=>{if(n&&t==="include"){let c;if(a.type==="nodeType"){const l=o.safeGet(a,"parents"),d=o.safeGet(a,"children"),u=l==null?void 0:l.some(p=>r.includes(p)),f=d==null?void 0:d.some(p=>r.includes(p));c=u&&f}(r.includes(o.safeGet(a,n))||c)&&this.selection.push(a)}}),this.updateSelection()},inNodesRange(e,t){return e?e.some(n=>n===t.id):!0},loadFlagFiles(e){return Te(this,null,function*(){return new Promise(t=>{this.flagFiles[e]?t(this.flagFiles[e]):(this.flagFiles[e]=this.imgPath[`${this.prefix}d3svg1/flags/${e}.png`],t(this.flagFiles[e]))})})},getNodeImage(e){return Te(this,null,function*(){var o,a,c,l,d,u,f,p,h,m;let t=null;const n=(c=(a=(o=e.detail)==null?void 0:o.info)==null?void 0:a.basic)==null?void 0:c.flag,r=(u=(d=(l=e==null?void 0:e.detail)==null?void 0:l.info)==null?void 0:d.basic)==null?void 0:u.level;if(e.detail&&((p=(f=e.detail)==null?void 0:f.info)!=null&&p.inner_img))try{t=yield ga(e.detail.info.inner_img)}catch(b){console.log("loadCompleted error",b)}else if(e.type==="nodeType"||e.type==="aggregation"){const b=e.icon||"node_type";if(cr[b])return t=cr[b],t;t=this.iconFiles[b]?this.iconFiles[b]:this.iconFiles.node_type,t=yield ga("data:image/svg+xml,"+encodeURIComponent(t)),cr[b]=t}else if(n&&(e.type==="ip"||e.type==="internet")){if(cr[n])return t=cr[n],t;yield this.loadFlagFiles(n),t=yield ga(this.flagFiles[n]),cr[n]=t}else if((m=(h=e.detail)==null?void 0:h.info)!=null&&m.inner_country&&(e.type==="country"||e.type==="target_country")){const b=e.detail.info.inner_country;if(cr[b])return t=cr[b],t;yield this.loadFlagFiles(b),t=yield ga(this.flagFiles[b]),cr[b]=t}else{const b=`${e.type||"node"}${r}${this.darkMode}`;if(cr[b])return t=cr[b],t;t=this.iconFiles[e.type]?this.iconFiles[e.type]:this.iconFiles.node;const w=as(r,this.levelList,this.darkMode),_=this.darkMode?"#182628":"#fff";t=C5(t,w,_);try{t=yield ga("data:image/svg+xml,"+encodeURIComponent(t))}catch(C){console.log(C)}cr[b]=t}return t})},handleGoDetail(e){e.forEach(t=>{if(t.isCluster)return;const n=t.type,r=this.moduleDetail.config.jumpRule[n];if(r)if(n==="org"){const o=t.id.split("(")[0];o.indexOf("APT")>=0&&window.open(r.split("${id}").join(o),t.id)}else{let o=t.origin&&t.origin[0]||t.id;(n==="url"||n==="virus")&&(o=encodeURIComponent(o)),window.open(r.split("${id}").join(o),t.id)}})},starNode(e,t=!0){e.collect=t,this.update()},handleAddBlack(e){this.showBlackType=!0,this.node=e},changeVisible(e){this.showBlackType=e},zoomIn(){this.adjustZoom(1.1)},zoomOut(){this.adjustZoom(.909)},adjustZoom(e){const n=this.stage.scaleX()*e;this.scale=n;const r={x:this.stage.width()/2,y:this.stage.height()/2},o={x:this.stage.getPointerPosition().x-this.stage.x(),y:this.stage.getPointerPosition().y-this.stage.y()},a={x:-(o.x-r.x)*(e-1),y:-(o.y-r.y)*(e-1)};this.stage.setAttrs({x:this.stage.x()+a.x,y:this.stage.y()+a.y,scaleX:n,scaleY:n}),this.layer.batchDraw()},addNodesDetail(e){return Te(this,null,function*(){const t=e.filter(o=>!o.detail&&o.noDetail!==!0&&o.type!=="aggregation"&&o.type!=="nodeType"),n={};t.map(o=>{n[o.type]?n[o.type].push(o):n[o.type]=[o]});const r=[];for(const o in n){const a=n[o],c={};a.map(l=>{l.origin&&(c[l.id]=l.origin)}),r.push(this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[n[o][0].type],node_id:n[o].map(l=>l.id),origin:c}).then(l=>(l.data.records.map(u=>{const f=e.find(p=>p.id===u.info.id);f.detail=u}),Promise.resolve({}))))}})},addCanvasBg(){this.darkMode&&(this.darkBgRect=new ct.Rect({x:0,y:0,width:this.stage.width()/this.scale,height:this.stage.height()/this.scale,fill:"#021212",stroke:"#021212",listening:!1,draggable:!1}),this.layer.add(this.darkBgRect),this.darkBgRect.moveToBottom(),this.stage.draw())},removeCanvasBg(){this.darkBgRect&&this.darkBgRect.destroy(),this.darkBgRect=null,this.stage.draw()}}},sEe={class:"main-svg-box","element-loading-text":"布局中...","element-loading-background":"rgba(122, 122, 122)"},aEe={ref:"canvasContainer",class:"canvas-container"};function lEe(e,t,n,r,o,a){const c=s.resolveComponent("popover"),l=s.resolveComponent("node-contextmenu"),d=f5;return s.openBlock(),s.createElementBlock("div",{class:s.normalizeClass(["render-container",n.darkMode?"dark-theme "+o.uniqueClass:" "+o.uniqueClass])},[s.withDirectives((s.openBlock(),s.createElementBlock("div",sEe,[s.createElementVNode("div",aEe,null,512)])),[[d,o.ticking]]),s.createVNode(c,{"dark-mode":n.darkMode,"show-popover":o.showPopover&&!o.isDragging,"mouse-position":o.hoverNodePosition,"node-info":o.popoverNode,"module-detail":n.moduleDetail,type:o.popoverType,history:n.history,data:n.history.dataNow},null,8,["dark-mode","show-popover","mouse-position","node-info","module-detail","type","history","data"]),n.isThreatPath?s.createCommentVNode("",!0):(s.openBlock(),s.createBlock(l,{key:0,show:a.showContextMenuFlag,axis:o.mousePosition,"node-info":a.contextMenuNodes,history:n.history,"menu-options":o.menuOptions,"module-detail":n.moduleDetail,onContextmenuClick:a.handleContextMenuClick},null,8,["show","axis","node-info","history","menu-options","module-detail","onContextmenuClick"]))],2)}const $l=Bt(oEe,[["render",lEe]]),XNe="",QNe="",ZNe="",{toClipboard:xR}=uf(),cEe={name:"SnapShotDialog",components:{},mixins:[],props:{snapshot:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}}},data(){return{dialogVisible:!1,origin:window.location.origin,ruleForm:{radio:"0",event:"",group:"",graphDesc:""},rules:{event:[{required:!0,message:"请选择安全事件",trigger:"change"}],group:[{required:!1,message:"请选择团队",trigger:"change"}]},eventOptions:[{value:"",label:""}],groupOptions:[{value:"",label:""}],hostList:["https://sc.360.net","https://sc.b.qihoo.net","http://sec.test.safe.qihoo.net"],isInnerAccount:!1,visibleSuccess:!1,eventUrl:null}},computed:{},watch:{snapshot:{handler:function(e,t){e.name&&(this.ruleForm.graphDesc=e.name)},immediate:!0,deep:!0}},created(){this.graphApi.getReportList&&this.graphApi.getReportList().then(e=>{e.data!==null&&(this.eventOptions=[],e.data.map(t=>{this.eventOptions.push({label:t.title,value:t.report_id})}))}),this.graphApi.getGroupList&&this.graphApi.getGroupList().then(e=>{e.data!==null?(this.groupOptions=[],e.data.map(t=>{this.groupOptions.push({label:t.group_name,value:t.group_id})}),this.isInnerAccount=!0):this.isInnerAccount=!1})},mounted(){},updated(){},beforeUnmount(){},methods:{hanleClickCopy(e){xR(e).then(t=>Lt({message:"复制成功",type:"success"}),t=>Lt.error("复制失败"))},show(){this.dialogVisible=!0},hide(){this.dialogVisible=!1,this.resetForm("ruleForm")},submitForm(e){this.$refs[e].validate(t=>{if(t){const n=this.hostList.some(l=>l===this.origin);let r=null;n?this.origin===this.hostList[1]?r=`${this.hostList[0]}/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`:r=`${this.origin}/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`:r=`http://test.sec.360.net/graph?snapshot_id=${this.snapshot.snapshot_id}&vcode=${this.snapshot.vcode}`,this.eventUrl=window.location.origin+"/event/"+this.ruleForm.event;const o=this.snapshot.thumb;let a=null;this.groupOptions.map(l=>{l.value===this.ruleForm.group&&(a=l.label)});const c={report_id:this.ruleForm.event,group_id:this.ruleForm.group,content:o,graph_url:r,group_name:a,acl:parseInt(this.ruleForm.radio),head:this.ruleForm.graphDesc};this.graphApi.addGraph(c).then(l=>{l.code==="0"?(xR(this.eventUrl),Lt({message:"分享成功! 分享事件地址已经复制",type:"success",showClose:!0,duration:5e3})):Lt({message:"分享失败",type:"error"})}).catch(()=>{Lt({message:"分享失败",type:"error"})}),this.resetForm(e),this.dialogVisible=!1}else return!1})},resetForm(e){this.$refs[e].resetFields(),this.snapshot.name=""}}},dEe={class:"sharetoEvents"},uEe={class:"lable-header"},fEe={class:"desc"},hEe={key:0,class:"desc-font"},pEe={key:1,class:"desc-font"},gEe={class:"dialog-footer"};function mEe(e,t,n,r,o,a){const c=ZK,l=ef,d=Vu,u=r0,f=es,p=n0,h=ns,m=kc;return s.openBlock(),s.createElementBlock("div",dEe,[s.createVNode(m,{title:"分享到安全事件","append-to-body":"","close-on-click-modal":!1,width:"25%",modelValue:o.dialogVisible,"onUpdate:modelValue":t[6]||(t[6]=b=>o.dialogVisible=b),class:"el-dialog-graph"},{footer:s.withCtx(()=>[s.createElementVNode("span",gEe,[s.createVNode(h,{type:"primary",onClick:t[5]||(t[5]=b=>a.submitForm("ruleForm"))},{default:s.withCtx(()=>[s.createTextVNode("确认分享")]),_:1}),s.createVNode(h,{onClick:a.hide},{default:s.withCtx(()=>[s.createTextVNode("关闭")]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createVNode(p,{ref:"ruleForm",model:o.ruleForm,rules:o.rules,"label-width":"100px",class:"demo-ruleForm"},{default:s.withCtx(()=>[s.createElementVNode("div",uEe,[s.createVNode(c,{modelValue:o.ruleForm.radio,"onUpdate:modelValue":t[0]||(t[0]=b=>o.ruleForm.radio=b),class:"el-radio",label:"1",border:"",size:"medium"},{default:s.withCtx(()=>[s.createTextVNode("付费可见")]),_:1},8,["modelValue"]),s.createVNode(c,{modelValue:o.ruleForm.radio,"onUpdate:modelValue":t[1]||(t[1]=b=>o.ruleForm.radio=b),label:"0",border:"",size:"medium"},{default:s.withCtx(()=>[s.createTextVNode("开放")]),_:1},8,["modelValue"]),s.createElementVNode("div",fEe,[o.ruleForm.radio==="0"?(s.openBlock(),s.createElementBlock("span",hEe,"该Graph内容对所有用户可见。")):(s.openBlock(),s.createElementBlock("span",pEe,"该Graph内容对付费用户可见。"))])]),s.createVNode(u,{label:"安全事件",prop:"event"},{default:s.withCtx(()=>[s.createVNode(d,{modelValue:o.ruleForm.event,"onUpdate:modelValue":t[2]||(t[2]=b=>o.ruleForm.event=b),"popper-append-to-body":!1,filterable:"",placeholder:"请选择",class:"select-item"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.eventOptions,b=>(s.openBlock(),s.createBlock(l,{key:b.value,label:b.label,value:b.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),o.isInnerAccount?(s.openBlock(),s.createBlock(u,{key:0,label:"选择团队",prop:"group"},{default:s.withCtx(()=>[s.createVNode(d,{modelValue:o.ruleForm.group,"onUpdate:modelValue":t[3]||(t[3]=b=>o.ruleForm.group=b),class:"select-item",filterable:"",placeholder:"请选择"},{default:s.withCtx(()=>[(s.openBlock(!0),s.createElementBlock(s.Fragment,null,s.renderList(o.groupOptions,b=>(s.openBlock(),s.createBlock(l,{key:b.value,label:b.label,value:b.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(u,{label:"Graph介绍",prop:"graphDesc"},{default:s.withCtx(()=>[s.createVNode(f,{modelValue:o.ruleForm.graphDesc,"onUpdate:modelValue":t[4]||(t[4]=b=>o.ruleForm.graphDesc=b),type:"textarea",rows:2,placeholder:"请输入内容",maxlength:"50",clearable:""},null,8,["modelValue"])]),_:1})]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])])}const vEe=Bt(cEe,[["render",mEe]]),VNe="",{toClipboard:yEe}=uf(),bEe={name:"SnapShotDialog",components:{ShareToSecurityEvents:vEe},mixins:[],props:{graphUrlPath:{type:String,default:"/graph"},snapshot:{type:Object,default:()=>{}},graphApi:{type:Object,default:()=>{}}},data(){return{dialogVisible:!1,origin:window.location.origin,isInnerAccount:!1}},computed:{},watch:{},created(){},mounted(){uo(qe,"sharePermission",e=>{this.isInnerAccount=e})},updated(){},beforeUnmount(){fo(qe,"sharePermission")},methods:{hanleClickCopy(e){yEe(e).then(t=>Lt({message:"复制成功",type:"success"}),t=>Lt.error("复制失败"))},show(){this.dialogVisible=!0},hide(){this.dialogVisible=!1},shareToEvents(){this.dialogVisible=!1,this.$refs.sharetoevents.show()}}},wEe={class:"snapshotdialog-container"},_Ee={class:"dialog-footer"};function CEe(e,t,n,r,o,a){const c=es,l=EY,d=ns,u=kc,f=s.resolveComponent("ShareToSecurityEvents");return s.openBlock(),s.createElementBlock("div",wEe,[s.createVNode(u,{title:"复制链接及提取码","append-to-body":"",modelValue:o.dialogVisible,"onUpdate:modelValue":t[2]||(t[2]=p=>o.dialogVisible=p),"close-on-click-modal":!1,class:"el-dialog-graph"},{footer:s.withCtx(()=>[s.createElementVNode("span",_Ee,[o.isInnerAccount?(s.openBlock(),s.createBlock(d,{key:0,type:"primary",onClick:t[0]||(t[0]=p=>a.shareToEvents())},{default:s.withCtx(()=>[s.createTextVNode("分享到安全事件")]),_:1})):s.createCommentVNode("",!0),s.createVNode(d,{type:"primary",onClick:t[1]||(t[1]=p=>a.hanleClickCopy(`${o.origin}${n.graphUrlPath}?snapshot_id=${n.snapshot.snapshot_id}&vcode=${n.snapshot.vcode}`))},{default:s.withCtx(()=>[s.createTextVNode("复制链接及提取码")]),_:1}),s.createVNode(d,{onClick:a.hide},{default:s.withCtx(()=>[s.createTextVNode("关闭")]),_:1},8,["onClick"])])]),default:s.withCtx(()=>[s.createVNode(c,{value:`${o.origin}${n.graphUrlPath}?snapshot_id=${n.snapshot.snapshot_id}`},{prepend:s.withCtx(()=>[s.createTextVNode("链接地址:")]),_:1},8,["value"]),s.createVNode(l),s.createVNode(c,{value:n.snapshot.vcode},{prepend:s.withCtx(()=>[s.createTextVNode("提取码:")]),_:1},8,["value"])]),_:1},8,["modelValue"]),s.createVNode(f,{ref:"sharetoevents",snapshot:n.snapshot,"graph-api":n.graphApi},null,8,["snapshot","graph-api"])])}const SEe=Bt(bEe,[["render",CEe]]),eTe="",EEe={name:"ForceGraphByCanvas",components:{Loading:Su,ForceGraphSvgIcon:ss,RenderByCanvas:$l,ButtonList:nie,SnapShotDialog:SEe,RightMenu:Aee,Legend:Ine},mixins:[jr],provide:function(){return{history:this.history,hasLevel:this.hasLevel,levelList:this.levelList,levelMap:this.levelMap,getDarkMode:()=>this.darkMode,requestGraphData:this.requestGraphData,moduleDetail:()=>this.moduleDetail}},props:{showPoint:{type:Boolean,default:!0},isRenderStartNode:{type:Boolean,default:!0},isDefaultSelectStartNode:{type:Boolean,default:!0},isShowRightMenu:{type:Boolean,default:!0},hideButtonList:{type:Array,default:()=>[]},customContextMenuEvent:{type:Function},handleSelectNodeEvent:{type:Function},handleDataLoaded:{type:Function},graphApi:{type:Object,default:()=>{}},graphUrlPath:{type:String,default:"/graph"},snapshot_id:{type:String,default:""},vcode:{type:String,default:""},module:{type:String,default:""},startNode:{type:Array,default:()=>[]},enterStartNode:{type:Boolean,default:!1},hasLevel:{type:Boolean,default:!0},levelList:{type:Array,default:()=>[{level:"未知",levelName:"未知",className:"unknown",iconType:"",normalColor:"#666",darkColor:"#c6cdd5",dangerNumber:0},{level:"危险",levelName:"危险",className:"warn",iconType:"",normalColor:"#CF1322",darkColor:"#fb2400",dangerNumber:1},{level:"普通",levelName:"普通",className:"normal",iconType:"",normalColor:"#007EE2",darkColor:"#0094ff",dangerNumber:-1},{level:"安全",levelName:"安全",className:"safe",iconType:"",normalColor:"#009A75",darkColor:"#00da90",dangerNumber:-2}]},showLevelCount:{type:Boolean,default:!1},darkMode:{type:Boolean,default:!1},title:{type:String,default:""},isShowNodeMessage:{type:Boolean,default:!0},nodeTypeScale:{type:Number},singlesNodeMaxNum:{type:Number,default:100},startNodeAnimation:{type:Boolean,default:!0}},emits:["sharePermission","custom-contextmenu-click","handle-select-node","handle-data-loaded","outdate"],data(){return{history:new MQ({isShowNodeMessage:this.isShowNodeMessage}),isLoading:!1,bigLoading:!1,loadingInfo:"数据加载中",moduleDetail:{},contextMenuNode:{},contextMenuId:0,isDragging:!1,isCtrlDown:!1,selection:[],snapshot:{},inited:!1,outdateTime:0,fullScreen:!1,generateUniqueIndexNow:this.generateUniqueIndex(),screenHeight:0,margin:"0",requestGraphData:!0,nodeTypeList:[]}},computed:{topFrame(){return window.top.location===window.location},levelMap(){const e={};return this.levelList.forEach(t=>{e[t.level]=t}),e}},watch:{startNode:{handler:function(e,t){this.moduleDetail.module&&this.searchStartNode()},immediate:!0,deep:!0},screenHeight:{deep:!0,handler:function(){this.margin=this.changeMargin()}}},created(){return Te(this,null,function*(){if(this.snapshot_id)this.isLoading=!0,this.graphApi.getSnapshotDetail({snapshot_id:this.snapshot_id,vcode:this.vcode}).then(e=>{this.moduleDetail=e.data.config,this.history.initFromSnapshot(JSON.parse(e.data.data)),setTimeout(()=>{this.$refs.render.updateNodeStyle(),this.centerAndZoom(.8,!1)},1e3)}).catch(e=>{console.log(e,"e")}).finally(e=>{this.isLoading=!1});else if(this.module)this.initGraph();else{Lt.error("请传入模块名称");return}this.graphApi.userInfo&&this.graphApi.userInfo().then(e=>{e.data!==null&&(ye(qe,"sharePermission",e.data.access.graph_share),this.requestGraphData=e.data.access.request_graph_data)}).catch(e=>{this.onOutdate(e.res)})})},unmounted(){window.onresize=null},mounted(){return Te(this,null,function*(){window.onresize=()=>{this.fullScreen=!!document.fullscreenElement,this.screenHeight=document.body.clientHeight},this.margin=this.changeMargin(),uo(qe,"emitDataLoaded",()=>{this.emitDataLoaded()})})},methods:{handleCustomContextMenuClick(e){this.customContextMenuEvent&&typeof this.customContextMenuEvent=="function"?this.customContextMenuEvent(s.toRaw(e)):ye(this,"custom-contextmenu-click",s.toRaw(e))},handleSelectNode(e){this.handleSelectNodeEvent&&typeof this.handleSelectNodeEvent=="function"?this.handleSelectNodeEvent(s.toRaw(e),s.toRaw(this.history.dataNow)):ye(this,"handle-select-node",s.toRaw(e))},searchStartNode(){this.startNode.length>0&&!this.inited&&this.startNode.map(e=>{const t={type:e.type,id:e.id,startNode:!0};this.inited=!0,this.moduleDetail.nodes.findIndex(n=>e.type===n.name)>=0?this.addNewNodesAndExpand(t):(Lt({message:"无相关数据",type:"warning"}),this.emitDataLoaded())})},initGraph(){return Te(this,null,function*(){var e;(e=this.graphApi)==null||e.getGraphConfig({name:this.module}).then(t=>{this.moduleDetail=t.data,this.searchStartNode(),!this.inited&&this.enterStartNode&&this.$refs.buttonList.addNode("search")}).catch(t=>{this.onOutdate(t.res),this.emitDataLoaded(),console.log("e",t)})})},addNewNodesAndExpand(e){this.isLoading=!0,this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[e.type],node_id:[e.id],nodeType:e.type,moduleDetail:this.moduleDetail}).then(t=>{var o,a,c;let n={id:(o=t.data.records[0])==null?void 0:o.info.id,type:(a=t.data.records[0])==null?void 0:a.info.type,startNode:!0,detail:t.data.records[0],group:e.id,name:((c=t.data.records[0])==null?void 0:c.info.name)||e.id};n=_i(n,this.moduleDetail.plugs);const r={addOne:{nodes:[n],links:[]}};this.isRenderStartNode&&(this.history.pushState(r),this.history.updateData(t.data.records,[e.id]),setTimeout(()=>{this.isDefaultSelectStartNode&&(this.handleTableSelect([e.id]),setTimeout(()=>{this.selection.length&&this.handleSelectNode({isSelected:!0,_node:this.selection[0]})},0))},500)),this.expandNodes(n)}).catch(t=>{console.log(t,"e"),this.emitDataLoaded(),this.onOutdate(t.res),Lt({message:"无该节点信息",type:"warning"})}).finally(()=>{this.isLoading=!1})},onAction(e){this.history.pushState(e)},onOutdate(e){(e==null?void 0:e.code)==="AC100001"&&this.outdateTime<1&&(this.outdateTime++,ye(this,"outdate"))},expandNodes(e,t){return Te(this,null,function*(){if(!(e!=null&&e.type))return;const n=this.moduleDetail.plugs[e==null?void 0:e.type];let r=[];t?(r=Array.isArray(t)?[...t]:[t],e.apis===void 0&&(e.apis=[]),e.apis.push(...r)):(e.expand=1,e.apis=[],e.apis.push({namec:"拓线全部",value:0,name:"",flagSelect:!0}),n==null||n.map(u=>{u.children?r.push(...u.children):r.push(u)}));const o=r.map(u=>this.graphApi.getGraphRequest({api:u.name,node_id:e.id,origin:e.origin,nodeType:e.type,moduleDetail:this.moduleDetail}).then(f=>Promise.resolve(ue(ae({},f),{api:u.name,apiC:u.relay_name,icon:u.icon,note_name:u.note_name,canLoop:u.canloop}))).catch(f=>Promise.resolve(f)));this.isLoading=!0;let a;yield Promise.all(o).then(u=>{if(u.some(p=>{var h;return((h=p.res)==null?void 0:h.code)==="AC100001"})){this.onOutdate({code:"AC100001"});return}a=u.filter(p=>p.code==="0"||p.code===0)}).catch(u=>{console.log(u,"e")}).finally(u=>{this.isLoading=!1});const c=[];let l=[];if(a&&a.forEach(u=>{if(e.getData[u.api]=!0,this.history.dataNow.nodes.find(w=>w.id===e.id)&&(this.history.dataNow.nodes.find(w=>w.id===e.id).getData[u.api]=!0),!u.data)return;let f;const p=u.data.nodes.map(w=>(w.group=e.id+"-"+u.api,w.groupC=u.apiC,w=_i(w,this.moduleDetail.plugs),w)),h=e.id+"-"+u.api;let m={id:h,name:u.apiC,note_name:u.note_name,type:"nodeType",icon:u.icon};const b={source:e.id,target:h};if(m=_i(m,this.moduleDetail.plugs),this.nodeTypeList.push(u.icon||"node_type"),p.length>0&&this.isRenderStartNode){if(f=u.data.links.map(w=>{let _;if(w.source===e.id){const C=this.history.dataNow.nodes.filter(k=>k.id===w.target);if(C.length>0&&(_=this.findGrandSonNodeIds(C[0]).indexOf(w.source)>=0),!u.api.canLoop&&_)return;w.source=h}else w.target===e.id&&(w.target=h);return w}).filter(w=>w),f.length===0)return;f.push(b)}else f=u.data.links;if(this.isRenderStartNode&&p.length>=this.singlesNodeMaxNum){let w=null,_=null;const C=String(Math.floor(new Date().getTime()));w={id:C,list:p,type:"aggregation",name:"聚合",relationId:m.id},w=_i(w,this.moduleDetail.plugs),_={source:m.id,target:C,uniqueIndex:this.generateUniqueIndexNow()};const k={addOne:{nodes:[m,w],links:[b,_]},type:"aggregation"};this.history.pushState(k),this.getNodeDetail(w.list,w.id)}else f.length&&this.isRenderStartNode&&p.push(m),c.push(...p||[]),l.push(...f||[])}),!this.isRenderStartNode){const u={},f={},p=[];this.nodeTypeList.push("node_type"),l.forEach(h=>{const m=h.source+"-"+h.name;if(!u[m]){let b={id:m,name:h.name,type:"nodeType",icon:h.feature.icon};b=_i(b,this.moduleDetail.plugs),u[m]=b}f[m]?f[m].push(h):f[m]=[h]});for(const h in u)c.push(u[h]);for(const h in f)f[h].forEach(b=>{const w=ue(ae({},b),{source:b.source,target:h}),_=ue(ae({},b),{source:h,target:b.target});p.push(w),p.push(_)});l=p}l.map(u=>{u.uniqueIndex=this.generateUniqueIndexNow()});const d={addOne:{nodes:c,links:l}};(c.length>0||l.length>0)&&this.history.pushState(d),this.history.length===2&&setTimeout(()=>{this.centerAndZoom(.8,!1)},1e3),this.getNodeDetail(c)})},findGrandSonNodeIds(e){return this.history.dataNow.nodes.filter(r=>{var o;return((o=e.children)==null?void 0:o.indexOf(r.id))>=0}).reduce((r,o)=>(r.push(...o.children||[]),r),[])||[]},centerAndZoom(e,t){var n;(n=this.$refs.render)==null||n.centerAndZoom(e,t)},generateUniqueIndex(){let e=0;return function(){return e++}},reset(){this.$refs.render.reset()},getNodeDetail(e,t){const r=this.history.dataNow.nodes.filter(c=>e.findIndex(l=>l.id===c.id)>=0).filter(c=>!c.detail&&c.noDetail!==!0&&c.type!=="aggregation"&&c.type!=="nodeType"),o={};r.map(c=>{o[c.type]?o[c.type].push(c):o[c.type]=[c]});let a=Object.keys(o).length;for(const c in o){const l=o[c],d={};l.map(u=>{u.origin&&(d[u.id]=u.origin)}),this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[o[c][0].type],node_id:o[c].map(u=>u.id),origin:d,nodeType:o[c][0].type,moduleDetail:this.moduleDetail}).then(u=>{const f=u.data.records;t?this.history.updateAggregationDetail(f,o[c].map(p=>p.id),t):this.history.updateData(f,o[c].map(p=>p.id))}).catch(u=>{this.onOutdate(u.res)}).finally(()=>{a=a-1,a===0&&(Gn(" 数据加载完"),this.emitDataLoaded())})}Object.keys(o).length||this.emitDataLoaded()},emitDataLoaded(){this.handleDataLoaded&&typeof this.handleDataLoaded=="function"?this.handleDataLoaded({dataNow:s.toRaw(this.history.dataNow)}):ye(this,"handle-data-loaded",{dataNow:s.toRaw(this.history.dataNow)})},addNode({node:e,type:t,connectNode:n}){if(this.history.dataNow.nodes.findIndex(a=>a.id===e.id)>-1){Lt({type:"warning",message:"该节点已存在,添加失败"});return}let o;if(t==="diy"&&e.type==="nodeType"){let a=ue(ae({},e),{detail:null,diy:!0,group:e.id});a=_i(a,this.moduleDetail.plugs);const c=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;o={addOne:{nodes:[a],links:c?[c]:[]}},this.history.pushState(o)}else t==="diy"?this.graphApi.getNodesDetail({api:this.moduleDetail.node_info[e.type],node_id:[e.id],nodeType:e.type,moduleDetail:this.moduleDetail}).then(a=>{var d,u,f;let c={id:(d=a.data.records[0])==null?void 0:d.info.id,type:(u=a.data.records[0])==null?void 0:u.info.type,detail:a.data.records[0],group:e.id,name:((f=a.data.records[0])==null?void 0:f.info.name)||e.id};c=_i(c,this.moduleDetail.plugs);const l=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;o={addOne:{nodes:[c],links:l?[l]:[]}},this.history.pushState(o)}).catch(a=>{this.onOutdate(a.res);let c=ue(ae({},e),{detail:null,diy:!0,group:e.id});c=_i(c,this.moduleDetail.plugs);const l=n?{source:n.id,target:e.id,uniqueIndex:this.generateUniqueIndexNow()}:null;o={addOne:{nodes:[c],links:l?[l]:[]}},this.history.pushState(o)}).finally(a=>{setTimeout(()=>{},500)}):this.addNewNodesAndExpand(e)},addLink(e,t){if(!([e,t].filter(a=>a.type==="nodeType").length===1))return;const r={source:e.id,target:t.id,uniqueIndex:this.generateUniqueIndexNow(),diy:!0};let o=!1;if(this.history.dataNow.links.map(a=>{a.source.id===e.id&&a.target.id===t.id&&(o=!0)}),!o){const a={addOne:{links:[r]}};this.onAction(a)}},expandSelectedNodes(e){e.map(t=>{this.expandNodes(t)})},handleTableSelect(e=[]){this.$refs.render.handleTableSelect(e)},updateSelection(){this.selection=this.$refs.render.selection,this.$refs.render.selectEdgesByNode(this.selection),this.$refs.render.showKeyWay(this.selection),this.$refs.render.updateNodeStyle()},aggregationNodes(e,t){if(e.length===0)return;const n=[];for(const c in this.history.dataNow.nodes)e.findIndex((d,u,f)=>d===this.history.dataNow.nodes[c].id)>=0&&n.push(JSON.parse(JSON.stringify(this.history.dataNow.nodes[c])));const r=String(Math.floor(new Date().getTime()));let o={id:r,list:n,type:"aggregation",name:"聚合",relationId:t.id};o=_i(o,this.moduleDetail.plugs);const a={addOne:{nodes:[o],links:[{source:t.id,target:r,uniqueIndex:this.generateUniqueIndexNow()}]},deleteOne:{nodes:n,links:n.map(c=>({source:t.id,target:c.id}))},type:"aggregation"};this.history.pushState(a),this.emitDataLoaded()},releaseAggregation(e){let t;if(e.type==="aggregation"&&(t=e),this.history.dataNow.links.map(n=>{n.source.id===e.id&&n.target.type==="aggregation"&&(t=t||n.target,n.source)}),t){const n={deleteOne:{nodes:[t],links:[{source:t.relationId,target:t.id}]},addOne:{nodes:t.list,links:t.list.map(r=>({source:t.relationId,target:r.id}))},type:"aggregation"};for(const r in this.history.dataNow.nodes)t.list.findIndex((a,c,l)=>a===this.history.dataNow.nodes[r].id)>=0&&(this.history.dataNow.nodes[r].aggregation=!1);this.history.pushState(n),this.emitDataLoaded()}},saveSnapshot(){return Te(this,null,function*(){g5.prompt(null,"添加快照",{confirmButtonText:"确定",cancelButtonText:"取消",inputPattern:/^.{1,20}$/,inputPlaceholder:"请输入20字以内快照名称",inputErrorMessage:"请输入20字以内快照名称"}).then(t=>Te(this,[t],function*({value:e}){this.bigLoading=!0,setTimeout(()=>Te(this,null,function*(){const n=yield this.$refs.buttonList.svgToBlob(),r=new FormData;r.append("data",this.history.toString()),r.append("name",e),r.append("thumb",n),this.graphApi.addSnapshot1(r).then(o=>{this.snapshot=o.data,this.snapshot.name=e,this.$refs.snapshot.show()}).catch(o=>{this.onOutdate(o.res)}).finally(o=>{this.bigLoading=!1})}),100)})).catch(()=>{Lt({type:"info",message:"取消输入"})})})},autoDisplay(){this.$refs.render.autoDisplay()},deleteNodes(e=this.selection){const t={deleteOne:{nodes:e}};this.history.pushState(t),this.emitDataLoaded();const n=e.map(r=>r.id);this.$refs.render.selection=this.selection.filter(r=>!n.includes(r.id)),setTimeout(()=>{this.updateSelection()},300)},historyForward(){this.history.forward(),setTimeout(()=>{this.updateSelection()},100)},historyBack(){this.history.back(),setTimeout(()=>{this.updateSelection()},100)},toggleFullScreen(){en({cId:"toggleFullScreen",c:"切换全屏"}),document.fullscreenElement?document.exitFullscreen&&document.exitFullscreen():this.$refs["force-d3-container"].requestFullscreen()},zoomView(e="in"){e==="in"?(en({cId:"zoomIn",c:"zoomIn"}),this.$refs.render.zoomIn()):(en({cId:"zoomOut",c:"zoomOut"}),this.$refs.render.zoomOut())},fitScreen(){var e;en({cId:"centerAndZoom",c:"centerAndZoom"}),(e=this.$refs.render)==null||e.centerAndZoom()},changeMargin(){let e=0;const t=document.body.clientHeight;return e=Math.floor(((t-50)/20-22)/2),e>8?"8px 0":e+"px 0"},handleHighLight(e,t,n){this.$refs.render.setHighlightRule({type:e,prop:t,value:n})},handleCustomSelect(e,t,n){this.$refs.render.handleCustomSelect({type:e,prop:t,value:n})},fixAllNodes(e){this.$refs.render.fixAllNodes(e)},toggleLayout(e){this.$refs.render.toggleLayout(e)},importCsvData(e){for(const t in e.nodes)delete e.nodes[t].vx,delete e.nodes[t].vy,delete e.nodes[t].x,delete e.nodes[t].y;this.history.dataNow=Object.assign({},e)},getCanvasStage(){var e;return(e=this.$refs.render)==null?void 0:e.stage},addCanvasBg(){var e;(e=this.$refs.render)==null||e.addCanvasBg()},removeCanvasBg(){var e;(e=this.$refs.render)==null||e.removeCanvasBg()}}},xEe={ref:"force-d3-container",class:"d3-container"},kEe=["innerHTML"],NEe=s.createElementVNode("div",{class:"top-line-bg"},null,-1),TEe={class:"top-item"},AEe={class:"top-line"},OEe={key:1,class:"select-num"},IEe={class:"highlight"},REe={class:"loading-container"},PEe={class:"corner-button-box"};function LEe(e,t,n,r,o,a){const c=s.resolveComponent("ButtonList"),l=s.resolveComponent("RenderByCanvas"),d=s.resolveComponent("Loading"),u=Qe,f=s.resolveComponent("Legend"),p=s.resolveComponent("force-graph-svg-icon"),h=Hn,m=s.resolveComponent("RightMenu"),b=s.resolveComponent("SnapShotDialog"),w=f5;return s.withDirectives((s.openBlock(),s.createElementBlock("div",xEe,[s.createElementVNode("div",{class:s.normalizeClass(["graph-box",{"hide-right-menu":!n.isShowRightMenu}])},[n.title?(s.openBlock(),s.createElementBlock("div",{key:0,class:"safe-force-title",innerHTML:n.title},null,8,kEe)):s.createCommentVNode("",!0),NEe,s.createElementVNode("div",TEe,[s.createElementVNode("div",AEe,[s.createVNode(c,{ref:"buttonList","hide-button-list":n.hideButtonList,selection:o.selection,history:o.history,"module-detail":o.moduleDetail,"request-graph-data":o.requestGraphData,onSaveSnapshot:a.saveSnapshot,onAddNodes:a.addNode,onAutoDisplay:a.autoDisplay,onDeleteNodes:a.deleteNodes,onFixNodes:a.fixAllNodes,onToggleLayout:a.toggleLayout,onImportCsvData:a.importCsvData},null,8,["hide-button-list","selection","history","module-detail","request-graph-data","onSaveSnapshot","onAddNodes","onAutoDisplay","onDeleteNodes","onFixNodes","onToggleLayout","onImportCsvData"])])]),s.createVNode(l,{ref:"render","module-detail":o.moduleDetail,history:o.history,"level-list":n.levelList,selection:o.selection,data:o.history.dataNow,"request-graph-data":o.requestGraphData,"dark-mode":n.darkMode,"node-type-scale":n.nodeTypeScale,"node-type-list":o.nodeTypeList,startNodeAnimation:n.startNodeAnimation,onUpdateSelection:a.updateSelection,onOnaction:a.onAction,onHandleSelectNode:a.handleSelectNode,onCustomContextmenuClick:a.handleCustomContextMenuClick},null,8,["module-detail","history","level-list","selection","data","request-graph-data","dark-mode","node-type-scale","node-type-list","startNodeAnimation","onUpdateSelection","onOnaction","onHandleSelectNode","onCustomContextmenuClick"]),o.selection.length>0?(s.openBlock(),s.createElementBlock("p",OEe,[s.createTextVNode(" 已选择"),s.createElementVNode("span",IEe,s.toDisplayString(o.selection.length),1),s.createTextVNode("项 ")])):s.createCommentVNode("",!0),s.withDirectives(s.createElementVNode("div",REe,[s.createElementVNode("span",null,s.toDisplayString(o.loadingInfo),1),s.createVNode(u,{class:"is-loading"},{default:s.withCtx(()=>[s.createVNode(d)]),_:1})],512),[[s.vShow,o.isLoading]]),s.createVNode(f,{"show-point":n.showPoint,history:o.history,"module-detail":o.moduleDetail,"has-level":n.hasLevel,"show-level-count":n.showLevelCount,margin:o.margin,onHighLight:a.handleHighLight},null,8,["show-point","history","module-detail","has-level","show-level-count","margin","onHighLight"]),s.createElementVNode("div",PEe,[!o.fullScreen&&a.topFrame?(s.openBlock(),s.createBlock(h,{key:0,content:"进入全屏",placement:"left","popper-class":"el-tooltip-gray"},{default:s.withCtx(()=>[s.createVNode(p,{"icon-class":e.imgPath["./public/d3svg1/button18/full_button.svg"],alt:"",class:"corner-button",onClick:a.toggleFullScreen},null,8,["icon-class","onClick"])]),_:1})):s.createCommentVNode("",!0),o.fullScreen&&a.topFrame?(s.openBlock(),s.createBlock(h,{key:1,content:"退出全屏",placement:"left","popper-class":"el-tooltip-gray"},{default:s.withCtx(()=>[s.createVNode(p,{"icon-class":e.imgPath["./public/d3svg1/button18/un_full_button.svg"],alt:"",class:"corner-button",onClick:a.toggleFullScreen},null,8,["icon-class","onClick"])]),_:1})):s.createCommentVNode("",!0),s.createVNode(h,{content:"适应屏幕",placement:"left","popper-class":"el-tooltip-gray"},{default:s.withCtx(()=>[s.createVNode(p,{"icon-class":e.imgPath["./public/d3svg1/button18/fit_button.svg"],alt:"",class:"corner-button",onClick:a.fitScreen},null,8,["icon-class","onClick"])]),_:1}),s.createVNode(h,{content:"放大",placement:"left","popper-class":"el-tooltip-gray"},{default:s.withCtx(()=>[s.createVNode(p,{"icon-class":e.imgPath["./public/d3svg1/button18/zoom_in_button.svg"],alt:"",class:"corner-button",onClick:t[0]||(t[0]=_=>a.zoomView("in"))},null,8,["icon-class"])]),_:1}),s.createVNode(h,{content:"缩小",placement:"left","popper-class":"el-tooltip-gray"},{default:s.withCtx(()=>[s.createVNode(p,{"icon-class":e.imgPath["./public/d3svg1/button18/zoom_out_button.svg"],alt:"",class:"corner-button",onClick:t[1]||(t[1]=_=>a.zoomView("out"))},null,8,["icon-class"])]),_:1})])],2),n.isShowRightMenu?(s.openBlock(),s.createBlock(m,{key:0,"graph-data":o.history.dataNow,"selected-nodes":o.selection,"request-graph-data":o.requestGraphData,onChangeBox:a.handleTableSelect},null,8,["graph-data","selected-nodes","request-graph-data","onChangeBox"])):s.createCommentVNode("",!0),s.createVNode(b,{ref:"snapshot",snapshot:o.snapshot,"graph-api":n.graphApi,"graph-url-path":n.graphUrlPath},null,8,["snapshot","graph-api","graph-url-path"])])),[[w,o.bigLoading]])}const Qd=Bt(EEe,[["render",LEe]]);Qd.install=function(e){e.component(Qd.name,Qd)},$l.install=function(e){e.component($l.name,$l)};const tTe="",BEe=[Qd,$l],DEe={install:function(e,t={}){BEe.forEach(n=>{e.component(n.name,n)})}};Be.Graph=Qd,Be.Render=$l,Be.default=DEe,Object.defineProperties(Be,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|