1import{L as e,N as t,st as n}from"./LogUtils-D1uL_RU1.js";import{_ as r,h as i,y as a}from"./index-BDimrMBs.js";function o(e){return[...e].sort((e,t)=>e-t).join(`_`)}function s(e,n){let r=o(e.map(e=>e.id)),i=n.get(r);return i===void 0&&(i=t(),n.set(r,i)),i}var c=0,l=0,u=0,d=1,f=0,p=class{#e=new Map;#t;#n;#r;constructor(e,t){this.#r=e,this.#t=t,this.#n={links:new Map,triangles:new Map}}drawParticle(r,o){let{links:s,options:f}=o;if(!s?.length||!f.links)return;let p=f.links,m=o.retina.linksWidth??l,h=o.getPosition(),g=o.options.twinkle?.links,_=p.triangles.enable,v=_?new Set(s.map(e=>e.destination.id)):null,y=r.globalAlpha,b=``,x=-1,S=-1,C=!1,w=()=>{C&&=(r.stroke(),!1)};for(let y of s){if(p.frequency<d&&this.#o(o,y.destination)>p.frequency)continue;let s=y.destination.getPosition();if(_&&!y.isWarped&&v&&(w(),this.#i(f,o,y,v,h,s,r)),y.opacity<=c||m<=l||!p.enable)continue;let T=y.opacity,E=y.color,D=g?.enable&&t()<g.frequency?a(this.#r,g.color):void 0;if(g&&D&&(E=D,T=e(g.opacity)),!E){let e=p.id===void 0?this.#t.particles.linksColor:this.#t.particles.linksColors.get(p.id);E=i(o,y.destination,e)}if(!E)continue;let O=this.#a(E);if((O!==b||m!==x||T!==S)&&(w(),r.strokeStyle=O,r.lineWidth=m,r.globalAlpha=T,b=O,x=m,S=T,r.beginPath(),C=!0),y.isWarped){let e=this.#t.canvas.size,t=s.x-h.x,i=s.y-h.y,a=n.x,o=n.y;Math.abs(t)>e.width*.5&&(a=t>u?-e.width:e.width),Math.abs(i)>e.height*.5&&(o=i>u?-e.height:e.height),r.moveTo(h.x,h.y),r.lineTo(s.x+a,s.y+o),r.moveTo(h.x-a,h.y-o),r.lineTo(s.x,s.y)}else r.moveTo(h.x,h.y),r.lineTo(s.x,s.y)}w(),r.globalAlpha=y}init(){return this.#n.links.clear(),this.#n.triangles.clear(),this.#e.clear(),Promise.resolve()}particleCreated(e){if(e.links=[],!e.options.links)return;e.linksDistance=e.options.links.distance,e.linksWidth=e.options.links.width;let t=this.#t.retina.pixelRatio;e.retina.linksDistance=e.linksDistance*t,e.retina.linksWidth=e.linksWidth*t}particleDestroyed(e){e.links=[]}#i(e,t,n,r,i,o,s){let l=n.destination,u=e.links?.triangles;if(!u?.enable||!l.options.links?.triangles.enable)return;let d=l.links;if(d?.length)for(let p of d){if(p.isWarped||this.#o(l,p.destination)>l.options.links.frequency||!r.has(p.destination.id))continue;let d=p.destination;if(this.#s(t,l,d)>(e.links?.triangles.frequency??f))continue;let m=u.opacity??(n.opacity+p.opacity)*.5,h=a(this.#r,u.color)??n.color;if(!h||m<=c)continue;let g=d.getPosition();s.save(),s.fillStyle=this.#a(h),s.globalAlpha=m,s.beginPath(),s.moveTo(i.x,i.y),s.lineTo(o.x,o.y),s.lineTo(g.x,g.y),s.closePath(),s.fill(),s.restore()}}#a(e){let t=`${e.r},${e.g},${e.b}`,n=this.#e.get(t);return n||(n=r(e,this.#t.hdr),this.#e.set(t,n)),n}#o(e,t){return s([e,t],this.#n.links)}#s(e,t,n){return s([e,t,n],this.#n.triangles)}};export{p as LinkInstance};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.