UNPKG

@tsparticles/preset-links

Version:

tsParticles links preset

2 lines 96.5 kB
/*! For license information please see tsparticles.preset.links.bundle.min.js.LICENSE.txt */ !function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var i=e();for(var s in i)("object"==typeof exports?exports:t)[s]=i[s]}}(this,(()=>(()=>{var t={d:(e,i)=>{for(var s in i)t.o(i,s)&&!t.o(e,s)&&Object.defineProperty(e,s,{enumerable:!0,get:i[s]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{loadLinksPreset:()=>ns,tsParticles:()=>_i});const i="generated",s="pointerleave",n="pointermove",o="touchend",a="tsParticles - Error",r=100,c=1e3;var h;function l(t){return"boolean"==typeof t}function d(t){return"string"==typeof t}function u(t){return"number"==typeof t}function p(t){return"object"==typeof t&&null!==t}function f(t){return Array.isArray(t)}function v(t){return null==t}!function(t){t.bottom="bottom",t.bottomLeft="bottom-left",t.bottomRight="bottom-right",t.left="left",t.none="none",t.right="right",t.top="top",t.topLeft="top-left",t.topRight="top-right",t.outside="outside",t.inside="inside"}(h||(h={}));const g=0,y=0,m=0;class w{constructor(t,e,i){if(this._updateFromAngle=(t,e)=>{this.x=Math.cos(t)*e,this.y=Math.sin(t)*e},!u(t)&&t){this.x=t.x,this.y=t.y;const e=t;this.z=e.z?e.z:m}else{if(void 0===t||void 0===e)throw new Error(`${a} Vector3d not initialized correctly`);this.x=t,this.y=e,this.z=i??m}}static get origin(){return w.create(g,y,m)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this._updateFromAngle(t,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(t){this._updateFromAngle(this.angle,t)}static clone(t){return w.create(t.x,t.y,t.z)}static create(t,e,i){return new w(t,e,i)}add(t){return w.create(this.x+t.x,this.y+t.y,this.z+t.z)}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=t.z}copy(){return w.clone(this)}distanceTo(t){return this.sub(t).length}distanceToSq(t){return this.sub(t).getLengthSq()}div(t){return w.create(this.x/t,this.y/t,this.z/t)}divTo(t){this.x/=t,this.y/=t,this.z/=t}getLengthSq(){return this.x**2+this.y**2}mult(t){return w.create(this.x*t,this.y*t,this.z*t)}multTo(t){this.x*=t,this.y*=t,this.z*=t}normalize(){const t=this.length;0!=t&&this.multTo(1/t)}rotate(t){return w.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),m)}setTo(t){this.x=t.x,this.y=t.y;const e=t;this.z=e.z?e.z:m}sub(t){return w.create(this.x-t.x,this.y-t.y,this.z-t.z)}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=t.z}}class _ extends w{constructor(t,e){super(t,e,m)}static get origin(){return _.create(g,y)}static clone(t){return _.create(t.x,t.y)}static create(t,e){return new _(t,e)}}let b=Math.random;const x={nextFrame:t=>requestAnimationFrame(t),cancel:t=>cancelAnimationFrame(t)},k=2*Math.PI;function z(){return M(b(),0,1-Number.EPSILON)}function M(t,e,i){return Math.min(Math.max(t,e),i)}function P(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function C(t){const e=T(t);let i=S(t);return e===i&&(i=0),z()*(e-i)+i}function O(t){return u(t)?t:C(t)}function S(t){return u(t)?t:t.min}function T(t){return u(t)?t:t.max}function D(t,e){if(t===e||void 0===e&&u(t))return t;const i=S(t),s=T(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:D(i,s)}function I(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.sqrt(i**2+s**2)}}function R(t,e){return I(t,e).distance}function L(t){return t*Math.PI/180}function E(t){return{x:t.position?.x??z()*t.size.width,y:t.position?.y??z()*t.size.height}}function F(t){return t?t.endsWith("%")?parseFloat(t)/r:parseFloat(t):1}var A,q,B,W,U,H;!function(t){t.auto="auto",t.increase="increase",t.decrease="decrease",t.random="random"}(A||(A={})),function(t){t.increasing="increasing",t.decreasing="decreasing"}(q||(q={})),function(t){t.none="none",t.max="max",t.min="min"}(B||(B={})),function(t){t.bottom="bottom",t.left="left",t.right="right",t.top="top"}(W||(W={})),function(t){t.precise="precise",t.percent="percent"}(U||(U={})),function(t){t.max="max",t.min="min",t.random="random"}(H||(H={}));const V={debug:console.debug,error:console.error,info:console.info,log:console.log,verbose:console.log,warning:console.warn};function $(){return V}function G(){return"undefined"==typeof window||!window||void 0===window.document||!window.document}function j(t){if(!G()&&"undefined"!=typeof matchMedia)return matchMedia(t)}function Q(t,e){return t===e||f(e)&&e.indexOf(t)>-1}function X(t,e,i=!0){return t[void 0!==e&&i?e%t.length:function(t){return Math.floor(z()*t.length)}(t)]}function Y(t,e,i,s,n){return function(t,e,i,s){let n=!0;s&&s!==W.bottom||(n=t.top<e.height+i.x);!n||s&&s!==W.left||(n=t.right>i.x);!n||s&&s!==W.right||(n=t.left<e.width+i.y);!n||s&&s!==W.top||(n=t.bottom>i.y);return n}(N(t,s??0),e,i,n)}function N(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function Z(t,...e){for(const i of e){if(null==i)continue;if(!p(i)){t=i;continue}const e=Array.isArray(i);!e||!p(t)&&t&&Array.isArray(t)?e||!p(t)&&t&&!Array.isArray(t)||(t={}):t=[];for(const e in i){if("__proto__"===e)continue;const s=i[e],n=t;n[e]=p(s)&&Array.isArray(s)?s.map((t=>Z(n[e],t))):Z(n[e],s)}}return t}function J(t,e){return f(t)?t.map(((t,i)=>e(t,i))):e(t,0)}function K(t,e,i){return f(t)?X(t,e,i):t}function tt(t,e){const i=t.value,s=t.animation,n={delayTime:O(s.delay)*c,enable:s.enable,value:O(t.value)*e,max:T(i)*e,min:S(i)*e,loops:0,maxLoops:O(s.count),time:0};if(s.enable){switch(n.decay=1-O(s.decay),s.mode){case A.increase:n.status=q.increasing;break;case A.decrease:n.status=q.decreasing;break;case A.random:n.status=z()>=.5?q.increasing:q.decreasing}const t=s.mode===A.auto;switch(s.startValue){case H.min:n.value=n.min,t&&(n.status=q.increasing);break;case H.max:n.value=n.max,t&&(n.status=q.decreasing);break;case H.random:default:n.value=C(n),t&&(n.status=z()>=.5?q.increasing:q.decreasing)}}return n.initialValue=n.value,n}function et(t,e){if(!(t.mode===U.percent)){const{mode:e,...i}=t;return i}return"x"in t?{x:t.x/r*e.width,y:t.y/r*e.height}:{width:t.width/r*e.width,height:t.height/r*e.height}}function it(t,e){return et(t,e)}function st(t,e,i,s,n){if(t.destroyed||!e||!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;const o=(e.velocity??0)*n.factor,a=e.min,r=e.max,c=e.decay??1;if(e.time||(e.time=0),(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=n.value),!((e.delayTime??0)>0&&e.time<(e.delayTime??0))){switch(e.status){case q.increasing:e.value>=r?(i?e.status=q.decreasing:e.value-=r,e.loops||(e.loops=0),e.loops++):e.value+=o;break;case q.decreasing:e.value<=a?(i?e.status=q.increasing:e.value+=r,e.loops||(e.loops=0),e.loops++):e.value-=o}e.velocity&&1!==c&&(e.velocity*=c),function(t,e,i,s,n){switch(e){case B.max:i>=n&&t.destroy();break;case B.min:i<=s&&t.destroy()}}(t,s,e.value,a,r),t.destroyed||(e.value=M(e.value,a,r))}}function nt(t,e){if(t.version!==e)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${t.version}. Plugins version: ${e}`)}var ot;!function(t){t.darken="darken",t.enlighten="enlighten"}(ot||(ot={}));const at="random",rt="mid";function ct(t,e){if(e)for(const i of t.colorManagers.values())if(e.startsWith(i.stringPrefix))return i.parseString(e)}function ht(t,e,i,s=!0){if(!e)return;const n=d(e)?{value:e}:e;if(d(n.value))return lt(t,n.value,i,s);if(f(n.value))return ht(t,{value:X(n.value,i,s)});for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function lt(t,e,i,s=!0){if(!e)return;const n=d(e)?{value:e}:e;if(d(n.value))return n.value===at?ft():function(t,e){return ct(t,e)}(t,n.value);if(f(n.value))return lt(t,{value:X(n.value,i,s)});for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function dt(t,e,i,s=!0){const n=ht(t,e,i,s);return n?ut(n):void 0}function ut(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a={h:0,l:.5*(n+o),s:0};return n!==o&&(a.s=a.l<.5?(n-o)/(n+o):(n-o)/(2-n-o),a.h=e===n?(i-s)/(n-o):a.h=i===n?2+(s-e)/(n-o):4+(e-i)/(n-o)),a.l*=100,a.s*=100,a.h*=60,a.h<0&&(a.h+=360),a.h>=360&&(a.h-=360),a}function pt(t){const e=360,i=(t.h%e+e)%e,s=Math.max(0,Math.min(100,t.s)),n=i/e,o=s/100,a=Math.max(0,Math.min(100,t.l))/100,r=255;if(0===s){const t=Math.round(a*r);return{r:t,g:t,b:t}}const c=(t,e,i)=>{if(i<0&&i++,i>1&&i--,6*i<1)return t+6*(e-t)*i;if(2*i<1)return e;if(3*i<2){return t+(e-t)*(2/3-i)*6}return t},h=a<.5?a*(1+o):a+o-a*o,l=2*a-h,d=1/3,u=Math.min(r,r*c(l,h,n+d)),p=Math.min(r,r*c(l,h,n)),f=Math.min(r,r*c(l,h,n-d));return{r:Math.round(u),g:Math.round(p),b:Math.round(f)}}function ft(t){const e=t??0;return{b:Math.floor(C(D(e,256))),g:Math.floor(C(D(e,256))),r:Math.floor(C(D(e,256)))}}function vt(t,e){return`rgba(${t.r}, ${t.g}, ${t.b}, ${e??1})`}function gt(t,e){return`hsla(${t.h}, ${t.s}%, ${t.l}%, ${e??1})`}function yt(t,e,i){if(i===at)return ft();if(i!==rt)return i;{const i=t.getFillColor()??t.getStrokeColor(),s=e?.getFillColor()??e?.getStrokeColor();if(i&&s&&e)return function(t,e,i,s){let n=t,o=e;return void 0===n.r&&(n=pt(t)),void 0===o.r&&(o=pt(e)),{b:P(n.b,o.b,i,s),g:P(n.g,o.g,i,s),r:P(n.r,o.r,i,s)}}(i,s,t.getRadius(),e.getRadius());{const t=i??s;if(t)return pt(t)}}}function mt(t){return void 0!==t?{h:t.h.value,s:t.s.value,l:t.l.value}:void 0}function wt(t,e,i){t.enable=e.enable;t.enable?(t.velocity=O(e.speed)/r*i,t.decay=1-O(e.decay),t.status=q.increasing,t.loops=0,t.maxLoops=O(e.count),t.time=0,t.delayTime=O(e.delay)*c,e.sync||(t.velocity*=z(),t.value*=z()),t.initialValue=t.value,t.offset=D(e.offset)):t.velocity=0}function _t(t,e,i,s){if(!t||!t.enable||(t.maxLoops??0)>0&&(t.loops??0)>(t.maxLoops??0))return;if(t.time||(t.time=0),(t.delayTime??0)>0&&t.time<(t.delayTime??0)&&(t.time+=s.value),(t.delayTime??0)>0&&t.time<(t.delayTime??0))return;const n=t.offset?C(t.offset):0,o=(t.velocity??0)*s.factor+3.6*n,a=t.decay??1,r=T(e),c=S(e);if(i&&t.status!==q.increasing){t.value-=o;const e=0;t.value<e&&(t.loops||(t.loops=0),t.loops++,t.status=q.increasing)}else t.value+=o,t.value>r&&(t.loops||(t.loops=0),t.loops++,i?t.status=q.decreasing:t.value-=r);t.velocity&&1!==a&&(t.velocity*=a),t.value=M(t.value,c,r)}const bt=0,xt=0,kt=1,zt=0,Mt=0,Pt=1;function Ct(t,e,i){t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.closePath()}function Ot(t,e){t.clearRect(bt,xt,e.width,e.height)}function St(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}function Tt(t,e,i=!1){if(!e)return;if(!t)return;const s=t.style;if(s)for(const t in e){const n=e[t];s.setProperty(t,n,i?"important":"")}}class Dt{constructor(t,e){this.container=t,this._applyPostDrawUpdaters=t=>{for(const e of this._postDrawUpdaters)e.afterDraw?.(t)},this._applyPreDrawUpdaters=(t,e,i,s,n,o)=>{for(const a of this._preDrawUpdaters){if(a.getColorStyles){const{fill:o,stroke:r}=a.getColorStyles(e,t,i,s);o&&(n.fill=o),r&&(n.stroke=r)}if(a.getTransformValues){const t=a.getTransformValues(e);for(const e in t)St(o,t,e)}a.beforeDraw?.(e)}},this._applyResizePlugins=()=>{for(const t of this._resizePlugins)t.resize?.()},this._getPluginParticleColors=t=>{let e,i;for(const s of this._colorPlugins)if(!e&&s.particleFillColor&&(e=dt(this._engine,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=dt(this._engine,s.particleStrokeColor(t))),e&&i)break;return[e,i]},this._initCover=async()=>{const t=this.container.actualOptions.backgroundMask.cover,e=t.color;if(e){const i=ht(this._engine,e);if(i){const e={...i,a:t.opacity};this._coverColorStyle=vt(e,e.a)}}else await new Promise(((e,i)=>{if(!t.image)return;const s=document.createElement("img");s.addEventListener("load",(()=>{this._coverImage={image:s,opacity:t.opacity},e()})),s.addEventListener("error",(t=>{i(t.error)})),s.src=t.image}))},this._initStyle=()=>{const t=this.element,e=this.container.actualOptions;if(t){this._fullScreen?(this._originalStyle=Z({},t.style),this._setFullScreenStyle()):this._resetOriginalStyle();for(const i in e.style){if(!i||!e.style)continue;const s=e.style[i];s&&t.style.setProperty(i,s,"important")}}},this._initTrail=async()=>{const t=this.container.actualOptions.particles.move.trail,e=t.fill;if(!t.enable)return;const i=1/t.length;if(e.color){const t=ht(this._engine,e.color);if(!t)return;this._trailFill={color:{...t},opacity:i}}else await new Promise(((t,s)=>{if(!e.image)return;const n=document.createElement("img");n.addEventListener("load",(()=>{this._trailFill={image:n,opacity:i},t()})),n.addEventListener("error",(t=>{s(t.error)})),n.src=e.image}))},this._paintBase=t=>{this.draw((e=>function(t,e,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(bt,xt,e.width,e.height)}(e,this.size,t)))},this._paintImage=(t,e)=>{this.draw((i=>function(t,e,i,s){i&&(t.globalAlpha=s,t.drawImage(i,bt,xt,e.width,e.height),t.globalAlpha=1)}(i,this.size,t,e)))},this._repairStyle=()=>{const t=this.element;t&&(this._safeMutationObserver((t=>t.disconnect())),this._initStyle(),this.initBackground(),this._safeMutationObserver((e=>{t&&t instanceof Node&&e.observe(t,{attributes:!0})})))},this._resetOriginalStyle=()=>{const t=this.element,e=this._originalStyle;t&&e&&Tt(t,e)},this._safeMutationObserver=t=>{this._mutationObserver&&t(this._mutationObserver)},this._setFullScreenStyle=()=>{const t=this.element;if(!t)return;const e=this.container.actualOptions.fullScreen.zIndex.toString(10);Tt(t,{position:"fixed","z-index":e,zIndex:e,top:"0",left:"0",width:"100%",height:"100%"},!0)},this._engine=e,this._standardSize={height:0,width:0};const i=t.retina.pixelRatio,s=this._standardSize;this.size={height:s.height*i,width:s.width*i},this._context=null,this._generated=!1,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[]}get _fullScreen(){return this.container.actualOptions.fullScreen.enable}clear(){const t=this.container.actualOptions,e=t.particles.move.trail,i=this._trailFill;t.backgroundMask.enable?this.paint():e.enable&&e.length>0&&i?i.color?this._paintBase(vt(i.color,i.opacity)):i.image&&this._paintImage(i.image,i.opacity):t.clear&&this.draw((t=>{Ot(t,this.size)}))}destroy(){if(this.stop(),this._generated){const t=this.element;t?.remove()}else this._resetOriginalStyle();this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[]}draw(t){const e=this._context;if(e)return t(e)}drawAsync(t){const e=this._context;if(e)return t(e)}drawParticle(t,e){if(t.spawning||t.destroyed)return;const i=t.getRadius();if(i<=0)return;const s=t.getFillColor(),n=t.getStrokeColor()??s;let[o,a]=this._getPluginParticleColors(t);o||(o=s),a||(a=n),(o||a)&&this.draw((s=>{const n=this.container,r=n.actualOptions,c=t.options.zIndex,h=1-t.zIndexFactor,l=h**c.opacityRate,d=t.bubble.opacity??t.opacity?.value??1,u=d*l,p=(t.strokeOpacity??d)*l,f={},v={fill:o?gt(o,u):void 0};v.stroke=a?gt(a,p):v.fill,this._applyPreDrawUpdaters(s,t,i,u,v,f),function(t){const{container:e,context:i,particle:s,delta:n,colorStyles:o,backgroundMask:a,composite:r,radius:c,opacity:h,shadow:l,transform:d}=t,u=s.getPosition(),p=s.rotation+(s.pathRotation?s.velocity.angle:0),f=Math.sin(p),v=Math.cos(p),g=!!p,y={a:v*(d.a??kt),b:g?f*(d.b??1):d.b??zt,c:g?-f*(d.c??1):d.c??Mt,d:v*(d.d??Pt)};i.setTransform(y.a,y.b,y.c,y.d,u.x,u.y),a&&(i.globalCompositeOperation=r);const m=s.shadowColor;l.enable&&m&&(i.shadowBlur=l.blur,i.shadowColor=vt(m),i.shadowOffsetX=l.offset.x,i.shadowOffsetY=l.offset.y),o.fill&&(i.fillStyle=o.fill);const w=s.strokeWidth??0;i.lineWidth=w,o.stroke&&(i.strokeStyle=o.stroke);const _={container:e,context:i,particle:s,radius:c,opacity:h,delta:n,transformData:y,strokeWidth:w};!function(t){const{container:e,context:i,particle:s,radius:n,opacity:o,delta:a,strokeWidth:r,transformData:c}=t,h=0;if(!s.shape)return;const l=e.shapeDrawers.get(s.shape);l&&(i.beginPath(),l.draw({context:i,particle:s,radius:n,opacity:o,delta:a,pixelRatio:e.retina.pixelRatio,transformData:{...c}}),s.shapeClose&&i.closePath(),r>h&&i.stroke(),s.shapeFill&&i.fill())}(_),function(t){const{container:e,context:i,particle:s,radius:n,opacity:o,delta:a,transformData:r}=t;if(!s.shape)return;const c=e.shapeDrawers.get(s.shape);c?.afterDraw&&c.afterDraw({context:i,particle:s,radius:n,opacity:o,delta:a,pixelRatio:e.retina.pixelRatio,transformData:{...r}})}(_),function(t){const{container:e,context:i,particle:s,radius:n,opacity:o,delta:a,transformData:r}=t;if(!s.effect)return;const c=e.effectDrawers.get(s.effect);c&&c.draw({context:i,particle:s,radius:n,opacity:o,delta:a,pixelRatio:e.retina.pixelRatio,transformData:{...r}})}(_),i.globalCompositeOperation="source-over",i.resetTransform()}({container:n,context:s,particle:t,delta:e,colorStyles:v,backgroundMask:r.backgroundMask.enable,composite:r.backgroundMask.composite,radius:i*h**c.sizeRate,opacity:u,shadow:t.options.shadow,transform:f}),this._applyPostDrawUpdaters(t)}))}drawParticlePlugin(t,e,i){this.draw((s=>function(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}(s,t,e,i)))}drawPlugin(t,e){this.draw((i=>function(t,e,i){e.draw&&e.draw(t,i)}(i,t,e)))}async init(){this._safeMutationObserver((t=>t.disconnect())),this._mutationObserver=function(t){if(!G()&&"undefined"!=typeof MutationObserver)return new MutationObserver(t)}((t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this._repairStyle()})),this.resize(),this._initStyle(),await this._initCover();try{await this._initTrail()}catch(t){$().error(t)}this.initBackground(),this._safeMutationObserver((t=>{this.element&&this.element instanceof Node&&t.observe(this.element,{attributes:!0})})),this.initUpdaters(),this.initPlugins(),this.paint()}initBackground(){const t=this.container.actualOptions.background,e=this.element;if(!e)return;const i=e.style;if(i){if(t.color){const e=ht(this._engine,t.color);i.backgroundColor=e?vt(e,t.opacity):""}else i.backgroundColor="";i.backgroundImage=t.image||"",i.backgroundPosition=t.position||"",i.backgroundRepeat=t.repeat||"",i.backgroundSize=t.size||""}}initPlugins(){this._resizePlugins=[];for(const t of this.container.plugins.values())t.resize&&this._resizePlugins.push(t),(t.particleFillColor??t.particleStrokeColor)&&this._colorPlugins.push(t)}initUpdaters(){this._preDrawUpdaters=[],this._postDrawUpdaters=[];for(const t of this.container.particles.updaters)t.afterDraw&&this._postDrawUpdaters.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this._preDrawUpdaters.push(t)}loadCanvas(t){this._generated&&this.element&&this.element.remove(),this._generated=t.dataset&&i in t.dataset?"true"===t.dataset[i]:this._generated,this.element=t,this.element.ariaHidden="true",this._originalStyle=Z({},this.element.style);const e=this._standardSize;e.height=t.offsetHeight,e.width=t.offsetWidth;const s=this.container.retina.pixelRatio,n=this.size;t.height=n.height=e.height*s,t.width=n.width=e.width*s,this._context=this.element.getContext("2d"),this._safeMutationObserver((t=>{this.element&&this.element instanceof Node&&t.observe(this.element,{attributes:!0})})),this.container.retina.init(),this.initBackground()}paint(){const t=this.container.actualOptions;this.draw((e=>{t.backgroundMask.enable&&t.backgroundMask.cover?(Ot(e,this.size),this._coverImage?this._paintImage(this._coverImage.image,this._coverImage.opacity):this._coverColorStyle?this._paintBase(this._coverColorStyle):this._paintBase()):this._paintBase()}))}resize(){if(!this.element)return!1;const t=this.container,e=t.canvas._standardSize,i={width:this.element.offsetWidth,height:this.element.offsetHeight},s=t.retina.pixelRatio,n={width:i.width*s,height:i.height*s};if(i.height===e.height&&i.width===e.width&&n.height===this.element.height&&n.width===this.element.width)return!1;const o={...e};e.height=i.height,e.width=i.width;const a=this.size;return this.element.width=a.width=n.width,this.element.height=a.height=n.height,this.container.started&&t.particles.setResizeFactor({width:e.width/o.width,height:e.height/o.height}),!0}stop(){this._safeMutationObserver((t=>t.disconnect())),this._mutationObserver=void 0,this.draw((t=>Ot(t,this.size)))}async windowResize(){if(!this.element||!this.resize())return;const t=this.container,e=t.updateActualOptions();t.particles.setDensity(),this._applyResizePlugins(),e&&await t.refresh()}}var It;!function(t){t.canvas="canvas",t.parent="parent",t.window="window"}(It||(It={}));function Rt(t,e,i,s,n){if(s){let s={passive:!0};l(n)?s.capture=n:void 0!==n&&(s=n),t.addEventListener(e,i,s)}else{const s=n;t.removeEventListener(e,i,s)}}class Lt{constructor(t){this.container=t,this._doMouseTouchClick=t=>{const e=this.container,i=e.actualOptions;if(this._canPush){const t=e.interactivity.mouse,s=t.position;if(!s)return;t.clickPosition={...s},t.clickTime=(new Date).getTime();J(i.interactivity.events.onClick.mode,(t=>this.container.handleClickMode(t)))}if("touchend"===t.type){setTimeout((()=>this._mouseTouchFinish()),500)}},this._handleThemeChange=t=>{const e=t,i=this.container,s=i.options,n=s.defaultThemes,o=e.matches?n.dark:n.light,a=s.themes.find((t=>t.name===o));a?.default.auto&&i.loadTheme(o)},this._handleVisibilityChange=()=>{const t=this.container,e=t.actualOptions;this._mouseTouchFinish(),e.pauseOnBlur&&(document?.hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))},this._handleWindowResize=()=>{this._resizeTimeout&&(clearTimeout(this._resizeTimeout),delete this._resizeTimeout);const t=async()=>{const t=this.container.canvas;await(t?.windowResize())};this._resizeTimeout=setTimeout((()=>{t()}),this.container.actualOptions.interactivity.events.resize.delay*c)},this._manageInteractivityListeners=(t,e)=>{const i=this._handlers,s=this.container,a=s.actualOptions,r=s.interactivity.element;if(!r)return;const c=r,h=s.canvas.element;h&&(h.style.pointerEvents=c===h?"initial":"none"),(a.interactivity.events.onHover.enable||a.interactivity.events.onClick.enable)&&(Rt(r,n,i.mouseMove,e),Rt(r,"touchstart",i.touchStart,e),Rt(r,"touchmove",i.touchMove,e),a.interactivity.events.onClick.enable?(Rt(r,o,i.touchEndClick,e),Rt(r,"pointerup",i.mouseUp,e),Rt(r,"pointerdown",i.mouseDown,e)):Rt(r,o,i.touchEnd,e),Rt(r,t,i.mouseLeave,e),Rt(r,"touchcancel",i.touchCancel,e))},this._manageListeners=t=>{const e=this._handlers,i=this.container,n=i.actualOptions.interactivity.detectsOn,o=i.canvas.element;let a=s;n===It.window?(i.interactivity.element=window,a="pointerout"):n===It.parent&&o?i.interactivity.element=o.parentElement??o.parentNode:i.interactivity.element=o,this._manageMediaMatch(t),this._manageResize(t),this._manageInteractivityListeners(a,t),document&&Rt(document,"visibilitychange",e.visibilityChange,t,!1)},this._manageMediaMatch=t=>{const e=this._handlers,i=j("(prefers-color-scheme: dark)");i&&(void 0===i.addEventListener?void 0!==i.addListener&&(t?i.addListener(e.oldThemeChange):i.removeListener(e.oldThemeChange)):Rt(i,"change",e.themeChange,t))},this._manageResize=t=>{const e=this._handlers,i=this.container;if(!i.actualOptions.interactivity.events.resize)return;if("undefined"==typeof ResizeObserver)return void Rt(window,"resize",e.resize,t);const s=i.canvas.element;this._resizeObserver&&!t?(s&&this._resizeObserver.unobserve(s),this._resizeObserver.disconnect(),delete this._resizeObserver):!this._resizeObserver&&t&&s&&(this._resizeObserver=new ResizeObserver((t=>{t.find((t=>t.target===s))&&this._handleWindowResize()})),this._resizeObserver.observe(s))},this._mouseDown=()=>{const{interactivity:t}=this.container;if(!t)return;const{mouse:e}=t;e.clicking=!0,e.downPosition=e.position},this._mouseTouchClick=t=>{const e=this.container,i=e.actualOptions,{mouse:s}=e.interactivity;s.inside=!0;let n=!1;const o=s.position;if(o&&i.interactivity.events.onClick.enable){for(const t of e.plugins.values())if(t.clickPositionValid&&(n=t.clickPositionValid(o),n))break;n||this._doMouseTouchClick(t),s.clicking=!1}},this._mouseTouchFinish=()=>{const t=this.container.interactivity;if(!t)return;const e=t.mouse;delete e.position,delete e.clickPosition,delete e.downPosition,t.status=s,e.inside=!1,e.clicking=!1},this._mouseTouchMove=t=>{const e=this.container,i=e.actualOptions,s=e.interactivity,o=e.canvas.element;if(!s?.element)return;let a;if(s.mouse.inside=!0,t.type.startsWith("pointer")){this._canPush=!0;const e=t;if(s.element===window){if(o){const t=o.getBoundingClientRect();a={x:e.clientX-t.left,y:e.clientY-t.top}}}else if(i.interactivity.detectsOn===It.parent){const t=e.target,i=e.currentTarget;if(t&&i&&o){const s=t.getBoundingClientRect(),n=i.getBoundingClientRect(),r=o.getBoundingClientRect();a={x:e.offsetX+2*s.left-(n.left+r.left),y:e.offsetY+2*s.top-(n.top+r.top)}}else a={x:e.offsetX??e.clientX,y:e.offsetY??e.clientY}}else e.target===o&&(a={x:e.offsetX??e.clientX,y:e.offsetY??e.clientY})}else if(this._canPush="touchmove"!==t.type,o){const e=t,i=1,s=e.touches[e.touches.length-i],n=o.getBoundingClientRect(),r=0;a={x:s.clientX-(n.left??r),y:s.clientY-(n.top??r)}}const r=e.retina.pixelRatio;a&&(a.x*=r,a.y*=r),s.mouse.position=a,s.status=n},this._touchEnd=t=>{const e=t,i=Array.from(e.changedTouches);for(const t of i)this._touches.delete(t.identifier);this._mouseTouchFinish()},this._touchEndClick=t=>{const e=t,i=Array.from(e.changedTouches);for(const t of i)this._touches.delete(t.identifier);this._mouseTouchClick(t)},this._touchStart=t=>{const e=t,i=Array.from(e.changedTouches);for(const t of i)this._touches.set(t.identifier,performance.now());this._mouseTouchMove(t)},this._canPush=!0,this._touches=new Map,this._handlers={mouseDown:()=>this._mouseDown(),mouseLeave:()=>this._mouseTouchFinish(),mouseMove:t=>this._mouseTouchMove(t),mouseUp:t=>this._mouseTouchClick(t),touchStart:t=>this._touchStart(t),touchMove:t=>this._mouseTouchMove(t),touchEnd:t=>this._touchEnd(t),touchCancel:t=>this._touchEnd(t),touchEndClick:t=>this._touchEndClick(t),visibilityChange:()=>this._handleVisibilityChange(),themeChange:t=>this._handleThemeChange(t),oldThemeChange:t=>this._handleThemeChange(t),resize:()=>{this._handleWindowResize()}}}addListeners(){this._manageListeners(!0)}removeListeners(){this._manageListeners(!1)}}var Et,Ft;!function(t){t.configAdded="configAdded",t.containerInit="containerInit",t.particlesSetup="particlesSetup",t.containerStarted="containerStarted",t.containerStopped="containerStopped",t.containerDestroyed="containerDestroyed",t.containerPaused="containerPaused",t.containerPlay="containerPlay",t.containerBuilt="containerBuilt",t.particleAdded="particleAdded",t.particleDestroyed="particleDestroyed",t.particleRemoved="particleRemoved"}(Et||(Et={}));class At{constructor(){this.value=""}static create(t,e){const i=new At;return i.load(t),void 0!==e&&(d(e)||f(e)?i.load({value:e}):i.load(e)),i}load(t){v(t)||v(t.value)||(this.value=t.value)}}class qt{constructor(){this.color=new At,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){v(t)||(void 0!==t.color&&(this.color=At.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image),void 0!==t.position&&(this.position=t.position),void 0!==t.repeat&&(this.repeat=t.repeat),void 0!==t.size&&(this.size=t.size),void 0!==t.opacity&&(this.opacity=t.opacity))}}class Bt{constructor(){this.opacity=1}load(t){v(t)||(void 0!==t.color&&(this.color=At.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image),void 0!==t.opacity&&(this.opacity=t.opacity))}}class Wt{constructor(){this.composite="destination-out",this.cover=new Bt,this.enable=!1}load(t){if(!v(t)){if(void 0!==t.composite&&(this.composite=t.composite),void 0!==t.cover){const e=t.cover,i=d(t.cover)?{color:t.cover}:t.cover;this.cover.load(void 0!==e.color||void 0!==e.image?e:{color:i})}void 0!==t.enable&&(this.enable=t.enable)}}}class Ut{constructor(){this.enable=!0,this.zIndex=0}load(t){v(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class Ht{constructor(){this.enable=!1,this.mode=[]}load(t){v(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.mode&&(this.mode=t.mode))}}!function(t){t.circle="circle",t.rectangle="rectangle"}(Ft||(Ft={}));class Vt{constructor(){this.selectors=[],this.enable=!1,this.mode=[],this.type=Ft.circle}load(t){v(t)||(void 0!==t.selectors&&(this.selectors=t.selectors),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.type&&(this.type=t.type))}}class $t{constructor(){this.enable=!1,this.force=2,this.smooth=10}load(t){v(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.force&&(this.force=t.force),void 0!==t.smooth&&(this.smooth=t.smooth))}}class Gt{constructor(){this.enable=!1,this.mode=[],this.parallax=new $t}load(t){v(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.mode&&(this.mode=t.mode),this.parallax.load(t.parallax))}}class jt{constructor(){this.delay=.5,this.enable=!0}load(t){v(t)||(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class Qt{constructor(){this.onClick=new Ht,this.onDiv=new Vt,this.onHover=new Gt,this.resize=new jt}load(t){if(v(t))return;this.onClick.load(t.onClick);const e=t.onDiv;void 0!==e&&(this.onDiv=J(e,(t=>{const e=new Vt;return e.load(t),e}))),this.onHover.load(t.onHover),this.resize.load(t.resize)}}class Xt{constructor(t,e){this._engine=t,this._container=e}load(t){if(v(t))return;if(!this._container)return;const e=this._engine.interactors.get(this._container);if(e)for(const i of e)i.loadModeOptions&&i.loadModeOptions(this,t)}}class Yt{constructor(t,e){this.detectsOn=It.window,this.events=new Qt,this.modes=new Xt(t,e)}load(t){if(v(t))return;const e=t.detectsOn;void 0!==e&&(this.detectsOn=e),this.events.load(t.events),this.modes.load(t.modes)}}class Nt{load(t){v(t)||(t.position&&(this.position={x:t.position.x??50,y:t.position.y??50,mode:t.position.mode??U.percent}),t.options&&(this.options=Z({},t.options)))}}var Zt,Jt,Kt,te,ee,ie,se;!function(t){t.screen="screen",t.canvas="canvas"}(Zt||(Zt={}));class ne{constructor(){this.maxWidth=1/0,this.options={},this.mode=Zt.canvas}load(t){v(t)||(v(t.maxWidth)||(this.maxWidth=t.maxWidth),v(t.mode)||(t.mode===Zt.screen?this.mode=Zt.screen:this.mode=Zt.canvas),v(t.options)||(this.options=Z({},t.options)))}}!function(t){t.any="any",t.dark="dark",t.light="light"}(Jt||(Jt={}));class oe{constructor(){this.auto=!1,this.mode=Jt.any,this.value=!1}load(t){v(t)||(void 0!==t.auto&&(this.auto=t.auto),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class ae{constructor(){this.name="",this.default=new oe}load(t){v(t)||(void 0!==t.name&&(this.name=t.name),this.default.load(t.default),void 0!==t.options&&(this.options=Z({},t.options)))}}class re{constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(t){v(t)||(void 0!==t.count&&(this.count=D(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=D(t.speed)),void 0!==t.decay&&(this.decay=D(t.decay)),void 0!==t.delay&&(this.delay=D(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class ce extends re{constructor(){super(),this.mode=A.auto,this.startValue=H.random}load(t){super.load(t),v(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.startValue&&(this.startValue=t.startValue))}}class he extends re{constructor(){super(),this.offset=0,this.sync=!0}load(t){super.load(t),v(t)||void 0!==t.offset&&(this.offset=D(t.offset))}}class le{constructor(){this.h=new he,this.s=new he,this.l=new he}load(t){v(t)||(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class de extends At{constructor(){super(),this.animation=new le}static create(t,e){const i=new de;return i.load(t),void 0!==e&&(d(e)||f(e)?i.load({value:e}):i.load(e)),i}load(t){if(super.load(t),v(t))return;const e=t.animation;void 0!==e&&(void 0!==e.enable?this.animation.h.load(e):this.animation.load(t.animation))}}!function(t){t.absorb="absorb",t.bounce="bounce",t.destroy="destroy"}(Kt||(Kt={}));class ue{constructor(){this.speed=2}load(t){v(t)||void 0!==t.speed&&(this.speed=t.speed)}}class pe{constructor(){this.enable=!0,this.retries=0}load(t){v(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.retries&&(this.retries=t.retries))}}class fe{constructor(){this.value=0}load(t){v(t)||v(t.value)||(this.value=D(t.value))}}class ve extends fe{constructor(){super(),this.animation=new re}load(t){if(super.load(t),v(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class ge extends ve{constructor(){super(),this.animation=new ce}load(t){super.load(t)}}class ye extends fe{constructor(){super(),this.value=1}}class me{constructor(){this.horizontal=new ye,this.vertical=new ye}load(t){v(t)||(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class we{constructor(){this.absorb=new ue,this.bounce=new me,this.enable=!1,this.maxSpeed=50,this.mode=Kt.bounce,this.overlap=new pe}load(t){v(t)||(this.absorb.load(t.absorb),this.bounce.load(t.bounce),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.maxSpeed&&(this.maxSpeed=D(t.maxSpeed)),void 0!==t.mode&&(this.mode=t.mode),this.overlap.load(t.overlap))}}class _e{constructor(){this.close=!0,this.fill=!0,this.options={},this.type=[]}load(t){if(v(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=Z(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.fill&&(this.fill=t.fill),void 0!==t.type&&(this.type=t.type)}}class be{constructor(){this.offset=0,this.value=90}load(t){v(t)||(void 0!==t.offset&&(this.offset=D(t.offset)),void 0!==t.value&&(this.value=D(t.value)))}}class xe{constructor(){this.distance=200,this.enable=!1,this.rotate={x:3e3,y:3e3}}load(t){if(!v(t)&&(void 0!==t.distance&&(this.distance=D(t.distance)),void 0!==t.enable&&(this.enable=t.enable),t.rotate)){const e=t.rotate.x;void 0!==e&&(this.rotate.x=e);const i=t.rotate.y;void 0!==i&&(this.rotate.y=i)}}}class ke{constructor(){this.x=50,this.y=50,this.mode=U.percent,this.radius=0}load(t){v(t)||(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.radius&&(this.radius=t.radius))}}class ze{constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){v(t)||(void 0!==t.acceleration&&(this.acceleration=D(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=D(t.maxSpeed)))}}class Me{constructor(){this.clamp=!0,this.delay=new fe,this.enable=!1,this.options={}}load(t){v(t)||(void 0!==t.clamp&&(this.clamp=t.clamp),this.delay.load(t.delay),void 0!==t.enable&&(this.enable=t.enable),this.generator=t.generator,t.options&&(this.options=Z(this.options,t.options)))}}class Pe{load(t){v(t)||(void 0!==t.color&&(this.color=At.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image))}}class Ce{constructor(){this.enable=!1,this.length=10,this.fill=new Pe}load(t){v(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.fill&&this.fill.load(t.fill),void 0!==t.length&&(this.length=t.length))}}!function(t){t.bounce="bounce",t.none="none",t.out="out",t.destroy="destroy",t.split="split"}(te||(te={}));class Oe{constructor(){this.default=te.out}load(t){v(t)||(void 0!==t.default&&(this.default=t.default),this.bottom=t.bottom??t.default,this.left=t.left??t.default,this.right=t.right??t.default,this.top=t.top??t.default)}}class Se{constructor(){this.acceleration=0,this.enable=!1}load(t){v(t)||(void 0!==t.acceleration&&(this.acceleration=D(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),t.position&&(this.position=Z({},t.position)))}}class Te{constructor(){this.angle=new be,this.attract=new xe,this.center=new ke,this.decay=0,this.distance={},this.direction=h.none,this.drift=0,this.enable=!1,this.gravity=new ze,this.path=new Me,this.outModes=new Oe,this.random=!1,this.size=!1,this.speed=2,this.spin=new Se,this.straight=!1,this.trail=new Ce,this.vibrate=!1,this.warp=!1}load(t){if(v(t))return;this.angle.load(u(t.angle)?{value:t.angle}:t.angle),this.attract.load(t.attract),this.center.load(t.center),void 0!==t.decay&&(this.decay=D(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance=u(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),void 0!==t.drift&&(this.drift=D(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(p(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),void 0!==t.random&&(this.random=t.random),void 0!==t.size&&(this.size=t.size),void 0!==t.speed&&(this.speed=D(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),this.trail.load(t.trail),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class De extends ce{constructor(){super(),this.destroy=B.none,this.speed=2}load(t){super.load(t),v(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class Ie extends ge{constructor(){super(),this.animation=new De,this.value=1}load(t){if(v(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class Re{constructor(){this.enable=!1,this.width=1920,this.height=1080}load(t){if(v(t))return;void 0!==t.enable&&(this.enable=t.enable);const e=t.width;void 0!==e&&(this.width=e);const i=t.height;void 0!==i&&(this.height=i)}}!function(t){t.delete="delete",t.wait="wait"}(ee||(ee={}));class Le{constructor(){this.mode=ee.delete,this.value=0}load(t){v(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class Ee{constructor(){this.density=new Re,this.limit=new Le,this.value=0}load(t){v(t)||(this.density.load(t.density),this.limit.load(t.limit),void 0!==t.value&&(this.value=t.value))}}class Fe{constructor(){this.blur=0,this.color=new At,this.enable=!1,this.offset={x:0,y:0},this.color.value="#000"}load(t){v(t)||(void 0!==t.blur&&(this.blur=t.blur),this.color=At.create(this.color,t.color),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.offset&&(void 0!==t.offset.x&&(this.offset.x=t.offset.x),void 0!==t.offset.y&&(this.offset.y=t.offset.y)))}}class Ae{constructor(){this.close=!0,this.fill=!0,this.options={},this.type="circle"}load(t){if(v(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=Z(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.fill&&(this.fill=t.fill),void 0!==t.type&&(this.type=t.type)}}class qe extends ce{constructor(){super(),this.destroy=B.none,this.speed=5}load(t){super.load(t),v(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class Be extends ge{constructor(){super(),this.animation=new qe,this.value=3}load(t){if(super.load(t),v(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class We{constructor(){this.width=0}load(t){v(t)||(void 0!==t.color&&(this.color=de.create(this.color,t.color)),void 0!==t.width&&(this.width=D(t.width)),void 0!==t.opacity&&(this.opacity=D(t.opacity)))}}class Ue extends fe{constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),v(t)||(void 0!==t.opacityRate&&(this.opacityRate=t.opacityRate),void 0!==t.sizeRate&&(this.sizeRate=t.sizeRate),void 0!==t.velocityRate&&(this.velocityRate=t.velocityRate))}}class He{constructor(t,e){this._engine=t,this._container=e,this.bounce=new me,this.collisions=new we,this.color=new de,this.color.value="#fff",this.effect=new _e,this.groups={},this.move=new Te,this.number=new Ee,this.opacity=new Ie,this.reduceDuplicates=!1,this.shadow=new Fe,this.shape=new Ae,this.size=new Be,this.stroke=new We,this.zIndex=new Ue}load(t){if(v(t))return;if(void 0!==t.groups)for(const e of Object.keys(t.groups)){if(!Object.hasOwn(t.groups,e))continue;const i=t.groups[e];void 0!==i&&(this.groups[e]=Z(this.groups[e]??{},i))}void 0!==t.reduceDuplicates&&(this.reduceDuplicates=t.reduceDuplicates),this.bounce.load(t.bounce),this.color.load(de.create(this.color,t.color)),this.effect.load(t.effect),this.move.load(t.move),this.number.load(t.number),this.opacity.load(t.opacity),this.shape.load(t.shape),this.size.load(t.size),this.shadow.load(t.shadow),this.zIndex.load(t.zIndex),this.collisions.load(t.collisions),void 0!==t.interactivity&&(this.interactivity=Z({},t.interactivity));const e=t.stroke;if(e&&(this.stroke=J(e,(t=>{const e=new We;return e.load(t),e}))),this._container){const e=this._engine.updaters.get(this._container);if(e)for(const i of e)i.loadOptions&&i.loadOptions(this,t);const i=this._engine.interactors.get(this._container);if(i)for(const e of i)e.loadParticlesOptions&&e.loadParticlesOptions(this,t)}}}function Ve(t,...e){for(const i of e)t.load(i)}function $e(t,e,...i){const s=new He(t,e);return Ve(s,...i),s}class Ge{constructor(t,e){this._findDefaultTheme=t=>this.themes.find((e=>e.default.value&&e.default.mode===t))??this.themes.find((t=>t.default.value&&t.default.mode===Jt.any)),this._importPreset=t=>{this.load(this._engine.getPreset(t))},this._engine=t,this._container=e,this.autoPlay=!0,this.background=new qt,this.backgroundMask=new Wt,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new Ut,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.interactivity=new Yt(t,e),this.manualParticles=[],this.particles=$e(this._engine,this._container),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.responsive=[],this.smooth=!1,this.style={},this.themes=[],this.zLayers=100}load(t){if(v(t))return;void 0!==t.preset&&J(t.preset,(t=>this._importPreset(t))),void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.clear&&(this.clear=t.clear),void 0!==t.key&&(this.key=t.key),void 0!==t.name&&(this.name=t.name),void 0!==t.delay&&(this.delay=D(t.delay));const e=t.detectRetina;void 0!==e&&(this.detectRetina=e),void 0!==t.duration&&(this.duration=D(t.duration));const i=t.fpsLimit;void 0!==i&&(this.fpsLimit=i),void 0!==t.pauseOnBlur&&(this.pauseOnBlur=t.pauseOnBlur),void 0!==t.pauseOnOutsideViewport&&(this.pauseOnOutsideViewport=t.pauseOnOutsideViewport),void 0!==t.zLayers&&(this.zLayers=t.zLayers),this.background.load(t.background);const s=t.fullScreen;l(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.backgroundMask.load(t.backgroundMask),this.interactivity.load(t.interactivity),t.manualParticles&&(this.manualParticles=t.manualParticles.map((t=>{const e=new Nt;return e.load(t),e}))),this.particles.load(t.particles),this.style=Z(this.style,t.style),this._engine.loadOptions(this,t),void 0!==t.smooth&&(this.smooth=t.smooth);const n=this._engine.interactors.get(this._container);if(n)for(const e of n)e.loadOptions&&e.loadOptions(this,t);if(void 0!==t.responsive)for(const e of t.responsive){const t=new ne;t.load(e),this.responsive.push(t)}if(this.responsive.sort(((t,e)=>t.maxWidth-e.maxWidth)),void 0!==t.themes)for(const e of t.themes){const t=this.themes.find((t=>t.name===e.name));if(t)t.load(e);else{const t=new ae;t.load(e),this.themes.push(t)}}this.defaultThemes.dark=this._findDefaultTheme(Jt.dark)?.name,this.defaultThemes.light=this._findDefaultTheme(Jt.light)?.name}setResponsive(t,e,i){this.load(i);const s=this.responsive.find((i=>i.mode===Zt.screen&&screen?i.maxWidth>screen.availWidth:i.maxWidth*e>t));return this.load(s?.options),s?.maxWidth}setTheme(t){if(t){const e=this.themes.find((e=>e.name===t));e&&this.load(e.options)}else{const t=j("(prefers-color-scheme: dark)"),e=t?.matches,i=this._findDefaultTheme(e?Jt.dark:Jt.light);i&&this.load(i.options)}}}!function(t){t.external="external",t.particles="particles"}(ie||(ie={}));class je{constructor(t,e){this.container=e,this._engine=t,this._interactors=[],this._externalInteractors=[],this._particleInteractors=[]}externalInteract(t){for(const e of this._externalInteractors)e.isEnabled()&&e.interact(t)}handleClickMode(t){for(const e of this._externalInteractors)e.handleClickMode?.(t)}async init(){this._interactors=await this._engine.getInteractors(this.container,!0),this._externalInteractors=[],this._particleInteractors=[];for(const t of this._interactors){switch(t.type){case ie.external:this._externalInteractors.push(t);break;case ie.particles:this._particleInteractors.push(t)}t.init()}}particlesInteract(t,e){for(const i of this._externalInteractors)i.clear(t,e);for(const i of this._particleInteractors)i.isEnabled(t)&&i.interact(t,e)}reset(t){for(const e of this._externalInteractors)e.isEnabled()&&e.reset(t);for(const e of this._particleInteractors)e.isEnabled(t)&&e.reset(t)}}!function(t){t.normal="normal",t.inside="inside",t.outside="outside"}(se||(se={}));const Qe=.5,Xe="random";function Ye(t){if(!Q(t.outMode,t.checkModes))return;const e=2*t.radius;t.coord>t.maxCoord-e?t.setCb(-t.radius):t.coord<e&&t.setCb(t.radius)}class Ne{constructor(t,e){this.container=e,this._calcPosition=(t,e,i,s=0)=>{for(const s of t.plugins.values()){const t=void 0!==s.particlePosition?s.particlePosition(e,this):void 0;if(t)return w.create(t.x,t.y,i)}const n=E({size:t.canvas.size,position:e}),o=w.create(n.x,n.y,i),a=this.getRadius(),r=this.options.move.outModes,c=e=>{Ye({outMode:e,checkModes:[te.bounce],coord:o.x,maxCoord:t.canvas.size.width,setCb:t=>o.x+=t,radius:a})},h=e=>{Ye({outMode:e,checkModes:[te.bounce],coord:o.y,maxCoord:t.canvas.size.height,setCb:t=>o.y+=t,radius:a})};if(c(r.left??r.default),c(r.right??r.default),h(r.top??r.default),h(r.bottom??r.default),this._checkOverlap(o,s)){const e=1;return this._calcPosition(t,void 0,i,s+e)}return o},this._calculateVelocity=()=>{const t=function(t){const e=_.origin;return e.length=1,e.angle=t,e}(this.direction).copy(),e=this.options.move;if(e.direction===h.inside||e.direction===h.outside)return t;const i=L(O(e.angle.value)),s=L(O(e.angle.offset)),n={left:s-i*Qe,right:s+i*Qe};return e.straight||(t.angle+=C(D(n.left,n.right))),e.random&&"number"==typeof e.speed&&(t.length*=z()),t},this._checkOverlap=(t,e=0)=>{const i=this.options.collisions,s=this.getRadius();if(!i.enable)return!1;const n=i.overlap;if(n.enable)return!1;const o=n.retries;if(o>=0&&e>o)throw new Error(`${a} particle is overlapping and can't be placed`);return!!this.container.particles.find((e=>R(t,e.position)<s+e.getRadius()))},this._getRollColor=t=>{if(!t||!this.roll||!this.backColor&&!this.roll.alter)return t;const e=this.roll.horizontal&&this.roll.vertical?2:1,i=this.roll.horizontal?Math.PI*Qe:0;return Math.floor(((this.roll.angle??0)+i)/(Math.PI/e))%2?this.backColor?this.backColor:this.roll.alter?function(t,e,i){return{h:t.h,s:t.s,l:t.l+(e===ot.darken?-1:1)*i}}(t,this.roll.alter.type,this.roll.alter.value):t:t},this._initPosition=t=>{const e=this.container,i=O(this.options.zIndex.value);this.position=this._calcPosition(e,t,M(i,0,e.zLayers)),this.initialPosition=this.position.copy();const s=e.canvas.size;switch(this.moveCenter={...it(this.options.move.center,s),radius:this.options.move.center.radius??0,mode:this.options.move.center.mode??U.percent},this.direction=function(t,e,i){if(u(t))return L(t);const s=.25;switch(t){case h.top:return.5*-Math.PI;case h.topRight:return-Math.PI*s;case h.right:return 0;case h.bottomRight:return Math.PI*s;case h.bottom:return.5*Math.PI;case h.bottomLeft:return.75*Math.PI;case h.left:return Math.PI;case h.topLeft:return.75*-Math.PI;case h.inside:return Math.atan2(i.y-e.y,i.x-e.x);case h.outside:return Math.atan2(e.y-i.y,e.x-i.x);default:return z()*k}}(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case h.inside:this.outType=se.inside;break;case h.outside:this.outType=se.outside}this.offset=_.origin},this._engine=t}destroy(t){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const e=this.container,i=this.pathGenerator,s=e.shapeDrawers.get(this.shape);s?.particleDestroy?.(this);for(const i of e.plugins.values())i.particleDestroyed?.(this,t);for(const i of e.particles.updaters)i.particleDestroyed?.(this,t);i?.reset(this),this._engine.dispatchEvent(Et.particleDestroyed,{container:this.container,data:{particle:this}})}draw(t){const e=this.container,i=e.canvas;for(const s of e.plugins.values())i.drawParticlePlugin(s,this,t);i.drawParticle(this,t)}getFillColor(){return this._getRollColor(this.bubble.color??mt(this.color))}getMass(){return this.getRadius()**2*Math.PI*Qe}getPosition(){return{x:this.position.x+this.offset.x,y:this.position.y+this.offset.y,z:this.position.z}}getRadius(){return this.bubble.radius??this.size.value}getStrokeColor(){return this._getRollColor(this.bubble.color??mt(this.strokeColor))}init(t,e,i,s){const n=this.container,o=this._engine;this.id=t,this.group=s,this.effectClose=!0,this.effectFill=!0,this.shapeClose=!0,this.shapeFill=!0,this.pathRotation=!1,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.isRotating=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{}},this.outType=se.normal,this.ignoresResizeRatio=!0;const a=n.retina.pixelRatio,r=n.actualOptions,h=$e(this._engine,n,r.particles),{reduceDuplicates:l}=h,d=h.effect.type,u=h.shape.type;this.effect=K(d,this.id,l),this.shape=K(u,this.id,l);const p=h.effect,f=h.shape;if(i){if(i.effect?.type){const t=K(i.effect.type,this.id,l);t&&(this.effect=t,p.load(i.effect))}if(i.shape?.type){const t=K(i.shape.type,this.id,l);t&&(this.shape=t,f.load(i.shape))}}if(this.effect===Xe){const t=[...this.container.effectDrawers.keys()];this.effect=t[Math.floor(Math.random()*t.length)]}if(this.shape===Xe){const t=[...this.container.shapeDrawers.keys()];this.shape=t[Math.floor(Math.random()*t.length)]}this.effectData=function(t,e,i,s){const n=e.options[t];if(n)return Z({close:e.close,fill:e.fill},K(n,i,s))}(this.effect,p,this.id,l),this.shapeData=function(t,e,i,s){const n=e.options[t];if(n)return Z({close:e.close,fill:e.fill},K(n,i,s))}(this.shape,f,this.id,l),h.load(i);const v=this.effectData;v&&h.load(v.particles);const g=this.shapeData;g&&h.load(g.particles);const y=new Yt(o,n);y.load(n.actualOptions.interactivity),y.load(h.interactivity),this.interactivity=y,this.effectFill=v?.fill??h.effect.fill,this.effectClose=v?.close??h.effect.close,this.shapeFill=g?.fill??h.shape.fill,this.shapeClose=g?.close??h.shape.close,this.options=h;const m=this.options.move.path;this.pathDelay=O(m.delay.value)*c,m