@tsparticles/engine 4.0.0-beta.15 → 4.0.0-beta.16

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.
@@ -69,7 +69,7 @@ export class Engine {
69
69
  return this._domArray;
70
70
  }
71
71
  get version() {
72
- return "4.0.0-beta.15";
72
+ return "4.0.0-beta.16";
73
73
  }
74
74
  addEventListener(type, listener) {
75
75
  this._eventDispatcher.addEventListener(type, listener);
@@ -69,7 +69,7 @@ export class Engine {
69
69
  return this._domArray;
70
70
  }
71
71
  get version() {
72
- return "4.0.0-beta.15";
72
+ return "4.0.0-beta.16";
73
73
  }
74
74
  addEventListener(type, listener) {
75
75
  this._eventDispatcher.addEventListener(type, listener);
@@ -69,7 +69,7 @@ export class Engine {
69
69
  return this._domArray;
70
70
  }
71
71
  get version() {
72
- return "4.0.0-beta.15";
72
+ return "4.0.0-beta.16";
73
73
  }
74
74
  addEventListener(type, listener) {
75
75
  this._eventDispatcher.addEventListener(type, listener);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/engine",
3
- "version": "4.0.0-beta.15",
3
+ "version": "4.0.0-beta.16",
4
4
  "description": "Easily create highly customizable particle, confetti and fireworks animations and use them as animated backgrounds for your website. Ready to use components available also for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.",
5
5
  "homepage": "https://particles.js.org",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  (function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
- /* tsParticles Engine v4.0.0-beta.15 */
2
+ /* tsParticles Engine v4.0.0-beta.16 */
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
5
5
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
@@ -1118,7 +1118,7 @@
1118
1118
  return this._domArray;
1119
1119
  }
1120
1120
  get version() {
1121
- return "4.0.0-beta.15";
1121
+ return "4.0.0-beta.16";
1122
1122
  }
1123
1123
  addEventListener(type, listener) {
1124
1124
  this._eventDispatcher.addEventListener(type, listener);
@@ -1 +1 @@
1
- !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{}))}(this,function(t){"use strict";const e="generated",i="source-over",s="resize",n="visibilitychange",a=100,o=.5,r=1e3,l={x:0,y:0,z:0},c={a:1,b:0,c:0,d:1},h="random",u="mid",d=2*Math.PI,p="true",f="false",g="canvas",_=255,m=360,y=100,v=100,P=.25,w=.75;var b;function x(t){return"z"in t?t.z:l.z}t.MoveDirection=void 0,(b=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",b.bottomLeft="bottom-left",b.bottomRight="bottom-right",b.left="left",b.none="none",b.right="right",b.top="top",b.topLeft="top-left",b.topRight="top-right",b.outside="outside",b.inside="inside";class S{x;y;z;constructor(t=l.x,e=l.y,i=l.z){this.x=t,this.y=e,this.z=i}static get origin(){return S.create(l.x,l.y,l.z)}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 S.create(t.x,t.y,x(t))}static create(t,e,i){return"number"==typeof t?new S(t,e??l.y,i??l.z):new S(t.x,t.y,x(t))}add(t){return S.create(this.x+t.x,this.y+t.y,this.z+x(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=x(t)}copy(){return S.clone(this)}div(t){return S.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 S.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 S.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),l.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=x(t)}sub(t){return S.create(this.x-t.x,this.y-t.y,this.z-x(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=x(t)}_updateFromAngle(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class z extends S{constructor(t=l.x,e=l.y){super(t,e,l.z)}static get origin(){return z.create(l.x,l.y)}static clone(t){return z.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new z(t,e??l.y):new z(t.x,t.y)}}function M(t){return"boolean"==typeof t}function I(t){return"string"==typeof t}function O(t){return"number"==typeof t}function D(t){return"object"==typeof t&&null!==t}function C(t){return Array.isArray(t)}function R(t){return null==t}const T=Math.PI/180;let k=Math.random;const A={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function E(){return V(k(),0,1-Number.EPSILON)}function L(t,e){return E()*(e-t)+t}function F(t){return A.nextFrame(t)}function U(t){A.cancel(t)}function V(t,e,i){return Math.min(Math.max(t,e),i)}function B(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function $(t){const e=N(t);let i=H(t);return e===i&&(i=0),L(i,e)}function q(t){return O(t)?t:$(t)}function H(t){return O(t)?t:t.min}function N(t){return O(t)?t:t.max}function W(t,e){if(t===e||void 0===e&&O(t))return t;const i=H(t),s=N(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:W(i,s)}function Z(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}}function Q(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function j(t,e,i){return Q(t,e)<=i*i}function G(t){return t*T}function X(e,i,s){if(O(e))return G(e);switch(e){case t.MoveDirection.top:return-Math.PI*o;case t.MoveDirection.topRight:return-Math.PI*P;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*P;case t.MoveDirection.bottom:return Math.PI*o;case t.MoveDirection.bottomLeft:return Math.PI*w;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*w;case t.MoveDirection.inside:return Math.atan2(s.y-i.y,s.x-i.x);case t.MoveDirection.outside:return Math.atan2(i.y-s.y,i.x-s.x);default:return E()*d}}function Y(t){const e=z.origin;return e.length=1,e.angle=t,e}function J(t,e,i,s){return z.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function K(t){return{x:(t.position?.x??E()*a)*t.size.width/a,y:(t.position?.y??E()*a)*t.size.height/a}}function tt(t){const{position:e,size:i}=t;return{x:e?.x??E()*i.width,y:e?.y??E()*i.height}}var et,it,st,nt,at,ot;t.AnimationMode=void 0,(et=t.AnimationMode||(t.AnimationMode={})).auto="auto",et.increase="increase",et.decrease="decrease",et.random="random",t.AnimationStatus=void 0,(it=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",it.decreasing="decreasing",t.DestroyType=void 0,(st=t.DestroyType||(t.DestroyType={})).none="none",st.max="max",st.min="min",t.OutModeDirection=void 0,(nt=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",nt.left="left",nt.right="right",nt.top="top",t.PixelMode=void 0,(at=t.PixelMode||(t.PixelMode={})).precise="precise",at.percent="percent",t.StartValueType=void 0,(ot=t.StartValueType||(t.StartValueType={})).max="max",ot.min="min",ot.random="random";function rt(t,e){const i=new Map,s=e?.maxSize,n=e?.ttlMs,a=e?.keyFn,o=(t,e=new WeakSet)=>{if(null===t)return"null";const i=typeof t;if("undefined"===i)return"undefined";if("number"===i||"boolean"===i||"string"===i)return JSON.stringify(t);if("function"===i)try{return t.toString()}catch{return'"[Function]"'}if("symbol"===i)try{return t.toString()}catch{return'"[Symbol]"'}if(Array.isArray(t))return`[${t.map(t=>o(t,e)).join(",")}]`;if(e.has(t))return'"[Circular]"';e.add(t);return`{${Object.keys(t).sort().map(i=>`${JSON.stringify(i)}:${o(t[i],e)}`).join(",")}}`},r=t=>a?a(t):(t=>o(t))(t);return(...e)=>{const a=r(e),o=Date.now(),l=i.get(a);if(void 0!==l){if(!(n&&o-l.ts>n))return i.delete(a),i.set(a,{value:l.value,ts:l.ts}),l.value;i.delete(a)}const c=t(...e);return i.set(a,{value:c,ts:o}),(()=>{if("number"==typeof s&&s>=0)for(;i.size>s;){const t=i.keys().next().value;if(void 0===t)break;i.delete(t)}})(),c}}function lt(){return"undefined"!=typeof matchMedia}function ct(){return globalThis.document}function ht(t){if(lt())return matchMedia(t)}function ut(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function dt(t,e){return t===e||C(e)&&e.includes(t)}function pt(t){return Math.floor(E()*t.length)}function ft(t,e,i=!0){return t[void 0!==e&&i?e%t.length:pt(t)]}function gt(e,i,s,n){let a=!0;return n&&n!==t.OutModeDirection.bottom||(a=e.top<i.height+s.x),!a||n&&n!==t.OutModeDirection.left||(a=e.right>s.x),!a||n&&n!==t.OutModeDirection.right||(a=e.left<i.width+s.y),!a||n&&n!==t.OutModeDirection.top||(a=e.bottom>s.y),a}function _t(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function mt(t,...e){for(const i of e){if(R(i))continue;if(!D(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):D(t)&&!Array.isArray(t)||(t={});const e=Object.keys(i),s=new Set(["__proto__","constructor","prototype"]);if(!e.some(t=>{const e=i[t];return D(e)||Array.isArray(e)})){const n=i,a=t;for(const t of e)if(!s.has(t)&&t in n){const e=n[t];void 0!==e&&(a[t]=e)}continue}for(const n of e){if(s.has(n))continue;const e=t,a=i[n];e[n]=Array.isArray(a)?a.map(t=>mt(void 0,t)):mt(e[n],a)}}return t}function yt(t,e){return C(t)?t.map((t,i)=>e(t,i)):e(t,0)}function vt(t,e,i){return C(t)?ft(t,e,i):t}function Pt(e,i){const s=e.value,n=e.animation,a={delayTime:q(n.delay)*r,enable:n.enable,value:q(e.value)*i,max:N(s)*i,min:H(s)*i,loops:0,maxLoops:q(n.count),time:0};if(n.enable){switch(a.decay=1-q(n.decay),n.mode){case t.AnimationMode.increase:a.status=t.AnimationStatus.increasing;break;case t.AnimationMode.decrease:a.status=t.AnimationStatus.decreasing;break;case t.AnimationMode.random:a.status=E()>=o?t.AnimationStatus.increasing:t.AnimationStatus.decreasing}const e=n.mode===t.AnimationMode.auto;switch(n.startValue){case t.StartValueType.min:a.value=a.min,e&&(a.status=t.AnimationStatus.increasing);break;case t.StartValueType.max:a.value=a.max,e&&(a.status=t.AnimationStatus.decreasing);break;case t.StartValueType.random:default:a.value=$(a),e&&(a.status=E()>=o?t.AnimationStatus.increasing:t.AnimationStatus.decreasing)}}return a.initialValue=a.value,a}function wt(e,i){if(!(e.mode===t.PixelMode.percent)){const{mode:t,...i}=e;return i}return"x"in e?{x:e.x/a*i.width,y:e.y/a*i.height}:{width:e.width/a*i.width,height:e.height/a*i.height}}function bt(t,e){return wt(t,e)}function xt(t){const e=ct().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||R(s))continue;const n=t.getPropertyValue?.(s);if(!n)continue;const a=t.getPropertyPriority?.(s);a?e.setProperty(s,n,a):e.setProperty(s,n)}return e}const St=rt(function(t){const e=ct().createElement("div").style,i={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(10),"z-index":t.toString(10),top:"0",left:"0","pointer-events":"none"};for(const t in i){const s=i[t];void 0!==s&&e.setProperty(t,s)}return e});function zt(t,e,i,s,n){if(s){let s={passive:!0};M(n)?s.capture=n:void 0!==n&&(s=n),t.addEventListener(e,i,s)}else{const s=n;t.removeEventListener(e,i,s)}}async function Mt(t,e,i,s=!1){let n=e.get(t);return n&&!s||(n=await Promise.all([...i.values()].map(e=>e(t))),e.set(t,n)),n}async function It(t,e,i,s=!1){let n=e.get(t);if(!n||s){const s=await Promise.all([...i.entries()].map(([e,i])=>i(t).then(t=>[e,t])));n=new Map(s),e.set(t,n)}return n}class Ot{_listeners;constructor(){this._listeners=new Map}addEventListener(t,e){this.removeEventListener(t,e);let i=this._listeners.get(t);i||(i=[],this._listeners.set(t,i)),i.push(e)}dispatchEvent(t,e){const i=this._listeners.get(t);i?.forEach(t=>{t(e)})}hasEventListener(t){return!!this._listeners.get(t)}removeAllEventListeners(t){t?this._listeners.delete(t):this._listeners=new Map}removeEventListener(t,e){const i=this._listeners.get(t);if(!i)return;const s=i.length,n=i.indexOf(e);n<0||(1===s?this._listeners.delete(t):i.splice(n,1))}}var Dt;t.EventType=void 0,(Dt=t.EventType||(t.EventType={})).configAdded="configAdded",Dt.containerInit="containerInit",Dt.particlesSetup="particlesSetup",Dt.containerStarted="containerStarted",Dt.containerStopped="containerStopped",Dt.containerDestroyed="containerDestroyed",Dt.containerPaused="containerPaused",Dt.containerPlay="containerPlay",Dt.containerBuilt="containerBuilt",Dt.particleAdded="particleAdded",Dt.particleDestroyed="particleDestroyed",Dt.particleRemoved="particleRemoved";class Ct{colorManagers=new Map;easingFunctions=new Map;effectDrawers=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;plugins=[];presets=new Map;shapeDrawers=new Map;updaters=new Map;_allLoadersSet=new Set;_configs=new Map;_engine;_executedSet=new Set;_initialized=!1;_isRunningLoaders=!1;_loadPromises=new Set;constructor(t){this._engine=t}get configs(){const t={};for(const[e,i]of this._configs)t[e]=i;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(e){const i=e.key??e.name??"default";this._configs.set(i,e),this._engine.dispatchEvent(t.EventType.configAdded,{data:{name:i,config:e}})}addEasing(t,e){this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.initializers.effects.set(t,e)}addPalette(t,e){this.palettes.set(t,e)}addParticleUpdater(t,e){this.initializers.updaters.set(t,e)}addPlugin(t){this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,e,i=!1){!i&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){for(const i of t)this.initializers.shapes.set(i,e)}clearPlugins(t){this.effectDrawers.delete(t),this.shapeDrawers.delete(t),this.updaters.delete(t)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getEffectDrawers(t,e=!1){return It(t,this.effectDrawers,this.initializers.effects,e)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.plugins.find(e=>e.id===t)}getPreset(t){return this.presets.get(t)}async getShapeDrawers(t,e=!1){return It(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return Mt(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this._initialized&&!this._isRunningLoaders){this._isRunningLoaders=!0,this._executedSet=new Set,this._allLoadersSet=new Set(this._loadPromises);try{for(const t of this._allLoadersSet)await this._runLoader(t,this._executedSet,this._allLoadersSet)}finally{this._loadPromises.clear(),this._isRunningLoaders=!1,this._initialized=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}async register(...t){if(this._initialized)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this._isRunningLoaders?await this._runLoader(e,this._executedSet,this._allLoadersSet):this._loadPromises.add(e)}async _runLoader(t,e,i){e.has(t)||(e.add(t),i.add(t),await t(this._engine))}}const Rt=t=>(...e)=>{t(...e)},Tt={debug:Rt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:Rt(console.info),log:Rt(console.log),trace:Rt(console.trace),verbose:Rt(console.log),warning:Rt(console.warn)};function kt(){return Tt}const At="100%";class Et{pluginManager=new Ct(this);_domArray=[];_eventDispatcher=new Ot;_initialized=!1;get items(){return this._domArray}get version(){return"4.0.0-beta.15"}addEventListener(t,e){this._eventDispatcher.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${t}`)}dispatchEvent(t,e){this._eventDispatcher.dispatchEvent(t,e)}async init(){this._initialized||(await this.pluginManager.init(),this._initialized=!0)}item(t){const{items:e}=this,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){await this.init();const{Container:i}=await Promise.resolve().then(function(){return vi}),s=t.id??t.element?.id??`tsparticles${Math.floor(1e4*E()).toString()}`,{index:n,url:a}=t,o=a?await async function(t){const e=vt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(kt().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:a,index:n}):t.options,r=vt(o,n),{items:l}=this,c=l.findIndex(t=>t.id.description===s),h=new i({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:s,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(h);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:r});if(c>=0){const t=this.item(c),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),l.splice(c,e,h)}else l.push(h);const u=((t,i)=>{const s=ct();let n=i??s.getElementById(t);return n||(n=s.createElement("canvas"),n.id=t,n.dataset[e]=p,s.body.append(n),n)})(s,t.element),d=(t=>{const i=ct();let s;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===g)s=t,s.dataset[e]??=f,s.dataset[e]===p&&(s.style.width||=At,s.style.height||=At,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const n=t.getElementsByTagName(g)[0];n?(s=n,s.dataset[e]=f):(s=i.createElement(g),s.dataset[e]=p,t.appendChild(s)),s.style.width||=At,s.style.height||=At,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(u);return h.canvas.loadCanvas(d),await h.start(),h}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this._eventDispatcher.removeEventListener(t,e)}}var Lt,Ft,Ut,Vt,Bt,$t,qt,Ht;!function(t){t.circle="circle",t.rectangle="rectangle"}(Lt||(Lt={}));class Nt{position;type;constructor(t,e,i){this.position={x:t,y:e},this.type=i}_resetPosition(t,e){this.position.x=t,this.position.y=e}}class Wt extends Nt{radius;constructor(t,e,i){super(t,e,Lt.circle),this.radius=i}contains(t){return j(t,this.position,this.radius)}intersects(t){const e=this.position,i=t.position,s=this.radius,n=Math.abs(i.x-e.x),a=Math.abs(i.y-e.y);if(t instanceof Wt||t.type===Lt.circle){return s+t.radius>Math.hypot(n,a)}if(t instanceof Zt||t.type===Lt.rectangle){const e=t,{width:i,height:o}=e.size;return Math.pow(n-i,2)+Math.pow(a-o,2)<=s**2||n<=s+i&&a<=s+o||n<=i||a<=o}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Zt extends Nt{size;constructor(t,e,i,s){super(t,e,Lt.rectangle),this.size={height:s,width:i}}contains(t){const e=this.size.width,i=this.size.height,s=this.position;return t.x>=s.x&&t.x<=s.x+e&&t.y>=s.y&&t.y<=s.y+i}intersects(t){if(t instanceof Wt)return t.intersects(this);if(!(t instanceof Zt))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,a=t.size,o=a.width,r=a.height;return n.x<s.x+e&&n.x+o>s.x&&n.y<s.y+i&&n.y+r>s.y}reset(t,e,i,s){return this._resetPosition(t,e),this.size.width=i,this.size.height=s,this}}t.RotateDirection=void 0,(Ft=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Ft.counterClockwise="counter-clockwise",Ft.random="random",t.LimitMode=void 0,(Ut=t.LimitMode||(t.LimitMode={})).delete="delete",Ut.wait="wait",t.OutMode=void 0,(Vt=t.OutMode||(t.OutMode={})).bounce="bounce",Vt.none="none",Vt.out="out",Vt.destroy="destroy",Vt.split="split",t.AlterType=void 0,(Bt=t.AlterType||(t.AlterType={})).darken="darken",Bt.enlighten="enlighten",t.GradientType=void 0,($t=t.GradientType||(t.GradientType={})).linear="linear",$t.radial="radial",$t.random="random",t.ParticleOutType=void 0,(qt=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",qt.inside="inside",qt.outside="outside",t.EasingType=void 0,(Ht=t.EasingType||(t.EasingType={})).easeInBack="ease-in-back",Ht.easeInBounce="ease-in-bounce",Ht.easeInCirc="ease-in-circ",Ht.easeInCubic="ease-in-cubic",Ht.easeInElastic="ease-in-elastic",Ht.easeInExpo="ease-in-expo",Ht.easeInGaussian="ease-in-gaussian",Ht.easeInLinear="ease-in-linear",Ht.easeInQuad="ease-in-quad",Ht.easeInQuart="ease-in-quart",Ht.easeInQuint="ease-in-quint",Ht.easeInSigmoid="ease-in-sigmoid",Ht.easeInSine="ease-in-sine",Ht.easeInSmoothstep="ease-in-smoothstep",Ht.easeOutBack="ease-out-back",Ht.easeOutBounce="ease-out-bounce",Ht.easeOutCirc="ease-out-circ",Ht.easeOutCubic="ease-out-cubic",Ht.easeOutElastic="ease-out-elastic",Ht.easeOutExpo="ease-out-expo",Ht.easeOutGaussian="ease-out-gaussian",Ht.easeOutLinear="ease-out-linear",Ht.easeOutQuad="ease-out-quad",Ht.easeOutQuart="ease-out-quart",Ht.easeOutQuint="ease-out-quint",Ht.easeOutSigmoid="ease-out-sigmoid",Ht.easeOutSine="ease-out-sine",Ht.easeOutSmoothstep="ease-out-smoothstep",Ht.easeInOutBack="ease-in-out-back",Ht.easeInOutBounce="ease-in-out-bounce",Ht.easeInOutCirc="ease-in-out-circ",Ht.easeInOutCubic="ease-in-out-cubic",Ht.easeInOutElastic="ease-in-out-elastic",Ht.easeInOutExpo="ease-in-out-expo",Ht.easeInOutGaussian="ease-in-out-gaussian",Ht.easeInOutLinear="ease-in-out-linear",Ht.easeInOutQuad="ease-in-out-quad",Ht.easeInOutQuart="ease-in-out-quart",Ht.easeInOutQuint="ease-in-out-quint",Ht.easeInOutSigmoid="ease-in-out-sigmoid",Ht.easeInOutSine="ease-in-out-sine",Ht.easeInOutSmoothstep="ease-in-out-smoothstep";class Qt{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(t){R(t)||(void 0!==t.count&&(this.count=W(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=W(t.speed)),void 0!==t.decay&&(this.decay=W(t.decay)),void 0!==t.delay&&(this.delay=W(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class jt extends Qt{mode;startValue;constructor(){super(),this.mode=t.AnimationMode.auto,this.startValue=t.StartValueType.random}load(t){super.load(t),R(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.startValue&&(this.startValue=t.startValue))}}class Gt extends Qt{max;min;offset;constructor(t,e){super(),this.min=t,this.max=e,this.offset=0,this.sync=!0}load(t){super.load(t),R(t)||(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.offset&&(this.offset=W(t.offset)))}}class Xt{h=new Gt(0,m);l=new Gt(0,v);s=new Gt(0,y);load(t){R(t)||(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class Yt{value;constructor(){this.value=""}static create(t,e){const i=new Yt;return i.load(t),void 0!==e&&(I(e)||C(e)?i.load({value:e}):i.load(e)),i}load(t){R(t)||R(t.value)||(this.value=t.value)}}class Jt extends Yt{animation;constructor(){super(),this.animation=new Xt}static create(t,e){const i=new Jt;return i.load(t),void 0!==e&&(I(e)||C(e)?i.load({value:e}):i.load(e)),i}load(t){if(super.load(t),R(t))return;const e=t.animation;void 0!==e&&(void 0===e.enable?this.animation.load(t.animation):this.animation.h.load(e))}}class Kt{color;image;opacity;position;repeat;size;constructor(){this.color=new Yt,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){R(t)||(void 0!==t.color&&(this.color=Yt.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 te{enable;zIndex;constructor(){this.enable=!0,this.zIndex=0}load(t){R(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class ee{delay;enable;constructor(){this.delay=.5,this.enable=!0}load(t){R(t)||(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class ie{close;options;type;constructor(){this.close=!0,this.options={},this.type=[]}load(t){if(R(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=mt(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class se{color;enable;opacity;constructor(){this.enable=!0,this.opacity=1}load(t){R(t)||(void 0!==t.color&&(this.color=Jt.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=W(t.opacity)))}}class ne{offset;value;constructor(){this.offset=0,this.value=90}load(t){R(t)||(void 0!==t.offset&&(this.offset=W(t.offset)),void 0!==t.value&&(this.value=W(t.value)))}}class ae{mode;radius;x;y;constructor(){this.x=50,this.y=50,this.mode=t.PixelMode.percent,this.radius=0}load(t){R(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 oe{acceleration;enable;inverse;maxSpeed;constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){R(t)||(void 0!==t.acceleration&&(this.acceleration=W(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=W(t.maxSpeed)))}}class re{value;constructor(){this.value=0}load(t){R(t)||R(t.value)||(this.value=W(t.value))}}class le extends re{animation=new Qt;load(t){if(super.load(t),R(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class ce extends le{animation;constructor(){super(),this.animation=new jt}load(t){super.load(t)}}class he{clamp;delay;enable;generator;options;constructor(){this.clamp=!0,this.delay=new re,this.enable=!1,this.options={}}load(t){R(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=mt(this.options,t.options)))}}class ue{bottom;default;left;right;top;constructor(){this.default=t.OutMode.out}load(t){R(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 de{acceleration;enable;position;constructor(){this.acceleration=0,this.enable=!1}load(t){R(t)||(void 0!==t.acceleration&&(this.acceleration=W(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),t.position&&(this.position=mt({},t.position)))}}class pe{angle;center;decay;direction;distance;drift;enable;gravity;outModes;path;random;size;speed;spin;straight;vibrate;warp;constructor(){this.angle=new ne,this.center=new ae,this.decay=0,this.distance={},this.direction=t.MoveDirection.none,this.drift=0,this.enable=!1,this.gravity=new oe,this.path=new he,this.outModes=new ue,this.random=!1,this.size=!1,this.speed=2,this.spin=new de,this.straight=!1,this.vibrate=!1,this.warp=!1}load(t){if(R(t))return;this.angle.load(O(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),void 0!==t.decay&&(this.decay=W(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance=O(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),void 0!==t.drift&&(this.drift=W(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(D(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=W(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class fe extends jt{destroy;constructor(){super(),this.destroy=t.DestroyType.none,this.speed=2}load(t){super.load(t),R(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class ge extends ce{animation;constructor(){super(),this.animation=new fe,this.value=1}load(t){if(R(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class _e{color;opacity;width;constructor(){this.width=0}load(t){R(t)||(void 0!==t.color&&(this.color=Jt.create(this.color,t.color)),void 0!==t.width&&(this.width=W(t.width)),void 0!==t.opacity&&(this.opacity=W(t.opacity)))}}class me{color;fill;stroke;load(t){R(t)||(void 0!==t.color&&(this.color=Jt.create(this.color,t.color)),void 0!==t.fill&&(this.fill??=new se,this.fill.load(t.fill)),void 0!==t.stroke&&(this.stroke??=new _e,this.stroke.load(t.stroke)))}}class ye extends re{constructor(){super(),this.value=1}}class ve{horizontal;vertical;constructor(){this.horizontal=new ye,this.vertical=new ye}load(t){R(t)||(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class Pe{enable;height;width;constructor(){this.enable=!1,this.width=1920,this.height=1080}load(t){if(R(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)}}class we{mode;value;constructor(){this.mode=t.LimitMode.delete,this.value=0}load(t){R(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class be{density;limit;value;constructor(){this.density=new Pe,this.limit=new we,this.value=0}load(t){R(t)||(this.density.load(t.density),this.limit.load(t.limit),void 0!==t.value&&(this.value=t.value))}}class xe{close;options;type;constructor(){this.close=!0,this.options={},this.type="circle"}load(t){if(R(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=mt(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class Se extends jt{destroy;constructor(){super(),this.destroy=t.DestroyType.none,this.speed=5}load(t){super.load(t),R(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class ze extends ce{animation;constructor(){super(),this.animation=new Se,this.value=3}load(t){if(super.load(t),R(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class Me extends re{opacityRate;sizeRate;velocityRate;constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),R(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 Ie{bounce;effect;groups;move;number;opacity;paint;palette;reduceDuplicates;shape;size;zIndex;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.bounce=new ve,this.effect=new ie,this.groups={},this.move=new pe,this.number=new be,this.opacity=new ge,this.paint=new me,this.paint.color=new Jt,this.paint.color.value="#fff",this.paint.fill=new se,this.paint.fill.enable=!0,this.reduceDuplicates=!1,this.shape=new xe,this.size=new ze,this.zIndex=new Me}load(t){if(R(t))return;if(t.palette&&(this.palette=t.palette,this._importPalette(this.palette)),void 0!==t.groups)for(const e of Object.keys(t.groups)){if(!(e in t.groups))continue;const i=t.groups[e];void 0!==i&&(this.groups[e]=mt(this.groups[e]??{},i))}void 0!==t.reduceDuplicates&&(this.reduceDuplicates=t.reduceDuplicates),this.bounce.load(t.bounce),this.effect.load(t.effect),this.move.load(t.move),this.number.load(t.number),this.opacity.load(t.opacity);const e=t.paint;if(e&&(C(e)?this.paint=yt(e,t=>{const e=new me;return e.load(t),e}):C(this.paint)?(this.paint=new me,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.size.load(t.size),this.zIndex.load(t.zIndex),this._container){for(const e of this._pluginManager.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this._container,this,t);const e=this._pluginManager.updaters.get(this._container);if(e)for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}_importPalette=t=>{const e=this._pluginManager.getPalette(t);if(!e)return;const i=e.colors,s=(C(i)?i:[i]).flatMap(t=>{const e=t.fill,i=t.stroke,s=e?{color:{value:e.value},enable:e.enable,opacity:e.opacity}:void 0;return i?[{fill:s,stroke:{color:{value:i.value},opacity:i.opacity,width:i.width||0}}]:[{fill:s}]}),n=s.length>1?s:s[0]??{};this.load({paint:n,blend:{enable:!0,mode:e.blendMode}})}}function Oe(t,...e){for(const i of e)t.load(i)}function De(t,e,...i){const s=new Ie(t,e);return Oe(s,...i),s}class Ce{autoPlay;background;clear;defaultThemes;delay;detectRetina;duration;fpsLimit;fullScreen;hdr;key;name;palette;particles;pauseOnBlur;pauseOnOutsideViewport;preset;resize;smooth;style;zLayers;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.autoPlay=!0,this.background=new Kt,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new te,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.hdr=!0,this.particles=De(this._pluginManager,this._container),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.resize=new ee,this.smooth=!1,this.style={},this.zLayers=100}load(t){if(R(t))return;void 0!==t.preset&&(this.preset=t.preset,yt(this.preset,t=>{this._importPreset(t)})),void 0!==t.palette&&(this.palette=t.palette,this._importPalette(this.palette)),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=W(t.delay));const e=t.detectRetina;void 0!==e&&(this.detectRetina=e),void 0!==t.duration&&(this.duration=W(t.duration));const i=t.fpsLimit;void 0!==i&&(this.fpsLimit=i),void 0!==t.hdr&&(this.hdr=t.hdr),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;M(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.particles.load(t.particles),this.resize.load(t.resize),this.style=mt(this.style,t.style),void 0!==t.smooth&&(this.smooth=t.smooth),this._pluginManager.plugins.forEach(e=>{e.loadOptions(this._container,this,t)})}_importPalette=t=>{const e=this._pluginManager.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})};_importPreset=t=>{this.load(this._pluginManager.getPreset(t))}}function Re(t,e,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(l.x,l.y,e.width,e.height)}function Te(t,e,i,s){if(!i)return;const n=t.globalAlpha;t.globalAlpha=s,t.drawImage(i,l.x,l.y,e.width,e.height),t.globalAlpha=n}function ke(t,e){t.clearRect(l.x,l.y,e.width,e.height)}function Ae(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:o,opacity:r,transform:l}=t,{effectDrawers:c,shapeDrawers:h}=e,u=s.getPosition(),d=s.getTransformData(l),p={x:u.x,y:u.y};i.setTransform(d.a,d.b,d.c,d.d,u.x,u.y),a.fill&&(i.fillStyle=a.fill);const f=!!s.fillEnabled,g=s.strokeWidth??0;i.lineWidth=g,a.stroke&&(i.strokeStyle=a.stroke);const _={context:i,particle:s,radius:o,drawRadius:1*o,opacity:r,delta:n,pixelRatio:e.retina.pixelRatio,fill:f,stroke:g>0,transformData:d,position:{...u},drawPosition:p,drawScale:1};for(const t of e.plugins)t.drawParticleTransform?.(_);const m=s.effect?c.get(s.effect):void 0,y=s.shape?h.get(s.shape):void 0;Le(m,_),Ve(y,_),Fe(y,_),Ue(y,_),Ee(m,_),i.resetTransform()}function Ee(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}function Le(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}function Fe(t,e){if(!t)return;const{context:i,fill:s,particle:n,stroke:a}=e;n.shape&&(i.beginPath(),t.draw(e),n.shapeClose&&i.closePath(),s&&i.fill(),a&&i.stroke())}function Ue(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}function Ve(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}function Be(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}const $e=new Map;function qe(t,e){let i=$e.get(t);if(!i){if(i=e(),$e.size>=1e3){[...$e.keys()].slice(0,500).forEach(t=>$e.delete(t))}$e.set(t,i)}return i}function He(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function Ne(t,e,i,s=!0){if(!e)return;const n=I(e)?{value:e}:e;if(I(n.value))return We(t,n.value,i,s);if(C(n.value)){const e=ft(n.value,i,s);if(!e)return;return Ne(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function We(t,e,i,s=!0){if(!e)return;const n=I(e)?{value:e}:e;if(I(n.value))return n.value===h?Xe():je(t,n.value);if(C(n.value)){const e=ft(n.value,i,s);if(!e)return;return We(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Ze(t,e,i,s=!0){const n=Ne(t,e,i,s);return n?Qe(n):void 0}function Qe(t){const e=t.r/_,i=t.g/_,s=t.b/_,n=Math.max(e,i,s),a=Math.min(e,i,s),r={h:0,l:(n+a)*o,s:0};return n!==a&&(r.s=r.l<o?(n-a)/(n+a):(n-a)/(2-n-a),r.h=e===n?(i-s)/(n-a):i===n?2+(s-e)/(n-a):4+(e-i)/(n-a)),r.l*=v,r.s*=y,r.h*=60,r.h<0&&(r.h+=m),r.h>=m&&(r.h-=m),r}function je(t,e){return He(t,e)}function Ge(t){const e=(t.h%m+m)%m,i=Math.max(0,Math.min(y,t.s)),s=Math.max(0,Math.min(v,t.l)),n=e/m,a=i/y,r=s/v;if(0===i){const t=Math.round(r*_);return{r:t,g:t,b:t}}const l=(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},c=r<o?r*(1+a):r+a-r*a,h=2*r-c,u=1/3,d=Math.min(_,_*l(h,c,n+u)),p=Math.min(_,_*l(h,c,n)),f=Math.min(_,_*l(h,c,n-u));return{r:Math.round(d),g:Math.round(p),b:Math.round(f)}}function Xe(t){const e=t??0,i=()=>Math.floor(L(e,256));return{b:i(),g:i(),r:i()}}function Ye(t,e,i){const s=i??1;return qe(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?Je(t,i):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(t,i))}function Je(t,e){return`color(display-p3 ${(t.r/_).toString()} ${(t.g/_).toString()} ${(t.b/_).toString()} / ${(e??1).toString()})`}function Ke(t,e,i){const s=i??1;return qe(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?function(t,e){return Je(Ge(t),e)}(t,i):function(t,e){return`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${(e??1).toString()})`}(t,i))}function ti(t,e,i,s){let n=t,a=e;return"r"in n||(n=Ge(t)),"r"in a||(a=Ge(e)),{b:B(n.b,a.b,i,s),g:B(n.g,a.g,i,s),r:B(n.r,a.r,i,s)}}function ei(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function ii(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=q(i.speed)/a*s,e.decay=1-q(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=q(i.count),e.time=0,e.delayTime=q(i.delay)*r,i.sync||(e.velocity*=E(),e.value*=E()),e.initialValue=e.value,e.offset=W(i.offset)):e.velocity=0}function si(e,i,s){if(!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;if(e.time??=0,(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=s.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0))return;const n=e.offset?$(e.offset):0,a=(e.velocity??0)*s.factor+3.6*n,o=e.decay??1,r=e.max,l=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=a,e.value<l&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=a,e.value>r&&(e.loops??=0,e.loops++,i?e.status=t.AnimationStatus.decreasing:e.value-=r)),e.velocity&&1!==o&&(e.velocity*=o),e.value=V(e.value,l,r)}function ni(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const ai=new Et,oi=globalThis;oi.__tsParticlesInternals=oi.__tsParticlesInternals??{},oi.tsParticles=ai;function ri(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class li{_canvasClearPlugins;_canvasManager;_canvasPaintPlugins;_clearDrawPlugins;_colorPlugins;_container;_context;_contextSettings;_drawParticlePlugins;_drawParticlesCleanupPlugins;_drawParticlesSetupPlugins;_drawPlugins;_drawSettingsCleanupPlugins;_drawSettingsSetupPlugins;_pluginManager;_postDrawUpdaters;_preDrawUpdaters;_reusableColorStyles={};_reusablePluginColors=[void 0,void 0];_reusableTransform={};constructor(t,e,i){this._pluginManager=t,this._container=e,this._canvasManager=i,this._context=null,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesCleanupPlugins=[],this._drawParticlesSetupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[]}get settings(){return this._contextSettings}canvasClear(){this._container.actualOptions.clear&&this.draw(t=>{ke(t,this._canvasManager.size)})}clear(){let t=!1;for(const e of this._canvasClearPlugins)if(t=e.canvasClear?.()??!1,t)break;t||this.canvasClear()}destroy(){this.stop(),this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesCleanupPlugins=[],this._drawParticlesSetupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[]}draw(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();let[a,o]=this._getPluginParticleColors(t);if(a??=s,o??=n,!a&&!o)return;const r=this._container,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:h,opacity:u,strokeOpacity:d}=t.getOpacity(),p=this._reusableTransform,f=this._reusableColorStyles,g=a?Ke(a,r.hdr,h*u):void 0,_=o?Ke(o,r.hdr,d*u):g;p.a=p.b=p.c=p.d=void 0,f.fill=g,f.stroke=_,this.draw(s=>{for(const i of this._drawParticlesSetupPlugins)i.drawParticleSetup?.(s,t,e);this._applyPreDrawUpdaters(s,t,i,u,f,p),Ae({container:r,context:s,particle:t,delta:e,colorStyles:f,radius:i*c**l.sizeRate,opacity:u,transform:p}),this._applyPostDrawUpdaters(t);for(const i of this._drawParticlesCleanupPlugins)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this._drawParticlePlugins)Be(i,s,t,e)})}drawParticles(t){const{particles:e}=this._container;this.clear(),e.update(t),this.draw(i=>{for(const e of this._drawSettingsSetupPlugins)e.drawSettingsSetup?.(i,t);for(const e of this._drawPlugins)e.draw?.(i,t);e.drawParticles(t);for(const e of this._clearDrawPlugins)e.clearDraw?.(i,t);for(const e of this._drawSettingsCleanupPlugins)e.drawSettingsCleanup?.(i,t)})}init(){this.initUpdaters(),this.initPlugins(),this.paint()}initPlugins(){this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesSetupPlugins=[],this._drawParticlesCleanupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[];for(const t of this._container.plugins)(t.particleFillColor??t.particleStrokeColor)&&this._colorPlugins.push(t),t.canvasClear&&this._canvasClearPlugins.push(t),t.canvasPaint&&this._canvasPaintPlugins.push(t),t.drawParticle&&this._drawParticlePlugins.push(t),t.drawParticleSetup&&this._drawParticlesSetupPlugins.push(t),t.drawParticleCleanup&&this._drawParticlesCleanupPlugins.push(t),t.draw&&this._drawPlugins.push(t),t.drawSettingsSetup&&this._drawSettingsSetupPlugins.push(t),t.drawSettingsCleanup&&this._drawSettingsCleanupPlugins.push(t),t.clearDraw&&this._clearDrawPlugins.push(t)}initUpdaters(){this._preDrawUpdaters=[],this._postDrawUpdaters=[];for(const t of this._container.particleUpdaters)t.afterDraw&&this._postDrawUpdaters.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this._preDrawUpdaters.push(t)}paint(){let t=!1;for(const e of this._canvasPaintPlugins)if(t=e.canvasPaint?.()??!1,t)break;t||this.paintBase()}paintBase(t){this.draw(e=>{Re(e,this._canvasManager.size,t)})}paintImage(t,e){this.draw(i=>{Te(i,this._canvasManager.size,t,e)})}setContext(t){this._context=t,this._context&&(this._context.globalCompositeOperation=i)}setContextSettings(t){this._contextSettings=t}stop(){this.draw(t=>{ke(t,this._canvasManager.size)})}_applyPostDrawUpdaters=t=>{for(const e of this._postDrawUpdaters)e.afterDraw?.(t)};_applyPreDrawUpdaters=(t,e,i,s,n,a)=>{for(const o of this._preDrawUpdaters){if(o.getColorStyles){const{fill:a,stroke:r}=o.getColorStyles(e,t,i,s);a&&(n.fill=a),r&&(n.stroke=r)}if(o.getTransformValues){const t=o.getTransformValues(e);for(const e in t)ri(a,t,e)}o.beforeDraw?.(e)}};_getPluginParticleColors=t=>{let e,i;for(const s of this._colorPlugins)if(!e&&s.particleFillColor&&(e=Ze(this._pluginManager,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=Ze(this._pluginManager,s.particleStrokeColor(t))),e&&i)break;return this._reusablePluginColors[0]=e,this._reusablePluginColors[1]=i,this._reusablePluginColors}}function ci(t,e,i=!1){if(!e)return;const s=t.style,n=new Set;for(let t=0;t<s.length;t++){const e=s.item(t);e&&n.add(e)}for(let t=0;t<e.length;t++){const i=e.item(t);i&&n.add(i)}for(const t of n){const n=e.getPropertyValue(t);n?s.setProperty(t,n,i?"important":""):s.removeProperty(t)}}class hi{element;render;size;zoom=1;_container;_generated;_mutationObserver;_originalStyle;_pluginManager;_pointerEvents;_resizePlugins;_standardSize;_zoomCenter;constructor(t,e){this._pluginManager=t,this._container=e,this.render=new li(t,e,this),this._standardSize={height:0,width:0};const i=e.retina.pixelRatio,s=this._standardSize;this.size={height:s.height*i,width:s.width*i},this._generated=!1,this._resizePlugins=[],this._pointerEvents="none"}get _fullScreen(){return this._container.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this._generated){const t=this.element;t?.remove(),this.element=void 0}else this._resetOriginalStyle();this.render.destroy(),this._resizePlugins=[]}getZoomCenter(){const t=this._container.retina.pixelRatio,{width:e,height:i}=this.size;return this._zoomCenter?this._zoomCenter:{x:e*o/t,y:i*o/t}}init(){this._safeMutationObserver(t=>{t.disconnect()}),this._mutationObserver=ut(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this._repairStyle()}),this.resize(),this._initStyle(),this.initBackground(),this._safeMutationObserver(t=>{this.element&&this.element instanceof Node&&t.observe(this.element,{attributes:!0})}),this.initPlugins(),this.render.init()}initBackground(){const{_container:t}=this,e=t.actualOptions.background,i=this.element;if(!i)return;const s=i.style,n=Ne(this._pluginManager,e.color);s.backgroundColor=n?Ye(n,t.hdr,e.opacity):"",s.backgroundImage=e.image||"",s.backgroundPosition=e.position||"",s.backgroundRepeat=e.repeat||"",s.backgroundSize=e.size||""}initPlugins(){this._resizePlugins=[];for(const t of this._container.plugins)t.resize&&this._resizePlugins.push(t)}loadCanvas(t){this._generated&&this.element&&this.element.remove();const i=this._container;this._generated=e in t.dataset?"true"===t.dataset[e]:this._generated,this.element=t,this.element.ariaHidden="true",this._originalStyle=xt(this.element.style);const s=this._standardSize;s.height=t.offsetHeight,s.width=t.offsetWidth;const n=this._container.retina.pixelRatio,a=this.size;t.height=a.height=s.height*n,t.width=a.width=s.width*n;const o=ht("(color-gamut: p3)");this.render.setContextSettings({alpha:!0,colorSpace:o?.matches&&i.hdr?"display-p3":"srgb",desynchronized:!0,willReadFrequently:!1}),this.render.setContext(this.element.getContext("2d",this.render.settings)),this._safeMutationObserver(t=>{t.disconnect()}),i.retina.init(),this.initBackground(),this._safeMutationObserver(t=>{this.element&&this.element instanceof Node&&t.observe(this.element,{attributes:!0})})}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 a={...e};e.height=i.height,e.width=i.width;const o=this.size;return this.element.width=o.width=n.width,this.element.height=o.height=n.height,this._container.started&&t.particles.setResizeFactor({width:e.width/a.width,height:e.height/a.height}),!0}setPointerEvents(t){this.element&&(this._pointerEvents=t,this._repairStyle())}setZoom(t,e){this.zoom=t,this._zoomCenter=e}stop(){this._safeMutationObserver(t=>{t.disconnect()}),this._mutationObserver=void 0,this.render.stop()}async windowResize(){if(!this.element||!this.resize())return;const t=this._container,e=t.updateActualOptions();t.particles.setDensity(),this._applyResizePlugins(),e&&await t.refresh()}_applyResizePlugins=()=>{for(const t of this._resizePlugins)t.resize?.()};_initStyle=()=>{const t=this.element,e=this._container.actualOptions;if(t){this._fullScreen?this._setFullScreenStyle():this._resetOriginalStyle();for(const i in e.style){if(!i||!(i in e.style))continue;const s=e.style[i];s&&t.style.setProperty(i,s,"important")}}};_repairStyle=()=>{const t=this.element;if(!t)return;this._safeMutationObserver(t=>{t.disconnect()}),this._initStyle(),this.initBackground();const e=this._pointerEvents;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this._safeMutationObserver(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})};_resetOriginalStyle=()=>{const t=this.element,e=this._originalStyle;t&&e&&ci(t,e,!0)};_safeMutationObserver=t=>{this._mutationObserver&&t(this._mutationObserver)};_setFullScreenStyle=()=>{const t=this.element;t&&ci(t,St(this._container.actualOptions.fullScreen.zIndex),!0)}}class ui{container;_handlers;_resizeObserver;_resizeTimeout;constructor(t){this.container=t,this._handlers={visibilityChange:()=>{this._handleVisibilityChange()},resize:()=>{this._handleWindowResize()}}}addListeners(){this._manageListeners(!0)}removeListeners(){this._manageListeners(!1)}_handleVisibilityChange=()=>{const t=this.container;t.actualOptions.pauseOnBlur&&(ct().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))};_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.resize.delay*r)};_manageListeners=t=>{const e=this._handlers;this._manageResize(t),zt(document,n,e.visibilityChange,t,!1)};_manageResize=t=>{const e=this._handlers,i=this.container;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void zt(globalThis,s,e.resize,t);const n=i.canvas.element;this._resizeObserver&&!t?(n&&this._resizeObserver.unobserve(n),this._resizeObserver.disconnect(),delete this._resizeObserver):!this._resizeObserver&&t&&n&&(this._resizeObserver=new ResizeObserver(t=>{t.find(t=>t.target===n)&&this._handleWindowResize()}),this._resizeObserver.observe(n))}}function di(t){if(!dt(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 pi{backColor;bubble;destroyed;direction;effect;effectClose;effectData;fillColor;fillEnabled;fillOpacity;group;id;ignoresResizeRatio;initialPosition;initialVelocity;isRotating;justWarped;lastPathTime;misplaced;moveCenter;offset;opacity;options;outType;pathRotation;position;randomIndexData;retina;roll;rotation;shape;shapeClose;shapeData;sides;size;slow;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;_cachedOpacityData={fillOpacity:1,opacity:1,strokeOpacity:1};_cachedPosition=S.origin;_cachedRotateData={sin:0,cos:0};_cachedTransform={a:1,b:0,c:0,d:1};_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const i=this._container,s=this.shape?i.shapeDrawers.get(this.shape):void 0;s?.particleDestroy?.(this);for(const t of i.particleDestroyedPlugins)t.particleDestroyed?.(this,e);for(const t of i.particleUpdaters)t.particleDestroyed?.(this,e);this._container.dispatchEvent(t.EventType.particleDestroyed,{particle:this})}draw(t){const e=this._container.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this._getRollColor(this.bubble.color??ei(this.fillColor))}getMass(){return this.getRadius()**2*Math.PI*o}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=this.bubble.opacity??q(this.opacity?.value??1),s=this.fillOpacity??1,n=this.strokeOpacity??1;return this._cachedOpacityData.fillOpacity=i*s*e,this._cachedOpacityData.opacity=i*e,this._cachedOpacityData.strokeOpacity=i*n*e,this._cachedOpacityData}getPosition(){return this._cachedPosition.x=this.position.x+this.offset.x,this._cachedPosition.y=this.position.y+this.offset.y,this._cachedPosition.z=this.position.z,this._cachedPosition}getRadius(){return this.bubble.radius??this.size.value}getRotateData(){const t=this.getAngle();return this._cachedRotateData.sin=Math.sin(t),this._cachedRotateData.cos=Math.cos(t),this._cachedRotateData}getStrokeColor(){return this._getRollColor(this.bubble.color??ei(this.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this._cachedTransform.a=e.cos*(t.a??c.a),this._cachedTransform.b=i?e.sin*(t.b??1):t.b??c.b,this._cachedTransform.c=i?-e.sin*(t.c??1):t.c??c.c,this._cachedTransform.d=e.cos*(t.d??c.d),this._cachedTransform}init(e,i,s,n){const a=this._container;this.id=e,this.group=n,this.justWarped=!1,this.effectClose=!0,this.shapeClose=!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:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},this.outType=t.ParticleOutType.normal,this.ignoresResizeRatio=!0;const o=a.retina.pixelRatio,r=a.actualOptions,l=De(this._pluginManager,a,r.particles),c=l.reduceDuplicates,u=l.effect.type,d=l.shape.type;this.effect=vt(u,this.id,c),this.shape=vt(d,this.id,c);const p=l.effect,f=l.shape;if(s){if(s.effect?.type){const t=vt(s.effect.type,this.id,c);t&&(this.effect=t,p.load(s.effect))}if(s.shape?.type){const t=vt(s.shape.type,this.id,c);t&&(this.shape=t,f.load(s.shape))}}if(this.effect===h){const t=[...this._container.effectDrawers.keys()];this.effect=t[Math.floor(E()*t.length)]}if(this.shape===h){const t=[...this._container.shapeDrawers.keys()];this.shape=t[Math.floor(E()*t.length)]}this.effectData=this.effect?function(t,e,i,s){const n=e.options[t];return mt({close:e.close},vt(n,i,s))}(this.effect,p,this.id,c):void 0,this.shapeData=this.shape?function(t,e,i,s){const n=e.options[t];return mt({close:e.close},vt(n,i,s))}(this.shape,f,this.id,c):void 0,l.load(s);const g=this.effectData;g&&l.load(g.particles);const _=this.shapeData;_&&l.load(_.particles),this.effectClose=g?.close??l.effect.close,this.shapeClose=_?.close??l.shape.close,this.options=l,a.retina.initParticle(this),this.size=Pt(this.options.size,o),this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this._initPosition(i),this.initialVelocity=this._calculateVelocity(),this.velocity=this.initialVelocity.copy();let m,y;a.particles.setLastZIndex(this.position.z),this.zIndexFactor=this.position.z/a.zLayers,this.sides=24,this.effect&&(m=a.effectDrawers.get(this.effect)),m?.loadEffect&&m.loadEffect(this),this.shape&&(y=a.shapeDrawers.get(this.shape)),y?.loadShape&&y.loadShape(this);const v=y?.getSidesCount;v&&(this.sides=v(this)),this.spawning=!1;for(const t of a.particleUpdaters)t.init(this);m?.particleInit?.(a,this),y?.particleInit?.(a,this);for(const t of a.particleCreatedPlugins)t.particleCreated?.(this)}isInsideCanvas(){const t=this.getRadius(),e=this._container.canvas.size,i=this.position;return i.x>=-t&&i.y>=-t&&i.y<=e.height+t&&i.x<=e.width+t}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const e=t%d,i=e<0?e+d:e;return i>=Math.PI*o&&i<3*Math.PI*o}if(this.roll.horizontal){const e=(t+Math.PI*o)%(2*Math.PI),i=e<0?e+2*Math.PI:e;return i>=Math.PI&&i<2*Math.PI}if(this.roll.vertical){const e=t%(2*Math.PI),i=e<0?e+2*Math.PI:e;return i>=Math.PI&&i<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){for(const t of this._container.particleUpdaters)t.reset?.(this)}_calcPosition=(t,e)=>{let i=0,s=t?S.create(t.x,t.y,e):void 0;const n=this._container,a=n.particlePositionPlugins,o=this.options.move.outModes,r=this.getRadius(),l=n.canvas.size,c=new AbortController,{signal:h}=c;for(;!h.aborted;){for(const t of a){const i=t.particlePosition?.(s,this);if(i)return S.create(i.x,i.y,e)}const t=tt({size:l,position:s}),c=S.create(t.x,t.y,e);this._fixHorizontal(c,r,o.left??o.default),this._fixHorizontal(c,r,o.right??o.default),this._fixVertical(c,r,o.top??o.default),this._fixVertical(c,r,o.bottom??o.default);let h=!0;for(const t of n.particles.checkParticlePositionPlugins)if(h=t.checkParticlePosition?.(this,c,i)??!0,!h)break;if(h)return c;i+=1,s=void 0}return s};_calculateVelocity=()=>{const e=Y(this.direction).copy(),i=this.options.move;if(i.direction===t.MoveDirection.inside||i.direction===t.MoveDirection.outside)return e;const s=G(q(i.angle.value)),n=G(q(i.angle.offset)),a={left:n-s*o,right:n+s*o};return i.straight||(e.angle+=$(W(a.left,a.right))),i.random&&"number"==typeof i.speed&&(e.length*=E()),e};_fixHorizontal=(e,i,s)=>{di({outMode:s,checkModes:[t.OutMode.bounce],coord:e.x,maxCoord:this._container.canvas.size.width,setCb:t=>e.x+=t,radius:i})};_fixVertical=(e,i,s)=>{di({outMode:s,checkModes:[t.OutMode.bounce],coord:e.y,maxCoord:this._container.canvas.size.height,setCb:t=>e.y+=t,radius:i})};_getRollColor=t=>t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?ni(t,this.roll.alter.type,this.roll.alter.value):t:t;_initPosition=e=>{const i=this._container,s=q(this.options.zIndex.value),n=this._calcPosition(e,V(s,0,i.zLayers));if(!n)throw new Error("a valid position cannot be found for particle");this.position=n,this.initialPosition=this.position.copy();const a=i.canvas.size;switch(this.moveCenter={...bt(this.options.move.center,a),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=X(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case t.MoveDirection.inside:this.outType=t.ParticleOutType.inside;break;case t.MoveDirection.outside:this.outType=t.ParticleOutType.outside}this.offset=z.origin}}class fi{_cellSize;_cells=new Map;_circlePool=[];_circlePoolIdx;_pendingCellSize;_rectanglePool=[];_rectanglePoolIdx;constructor(t){this._cellSize=t,this._circlePoolIdx=0,this._rectanglePoolIdx=0}clear(){this._cells.clear();const t=this._pendingCellSize;t&&(this._cellSize=t),this._pendingCellSize=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this._cellKeyFromCoords(e,i);this._cells.has(s)||this._cells.set(s,[]),this._cells.get(s)?.push(t)}query(t,e,i=[]){const s=this._getRangeBounds(t);if(!s)return i;const n=Math.floor(s.minX/this._cellSize),a=Math.floor(s.maxX/this._cellSize),o=Math.floor(s.minY/this._cellSize),r=Math.floor(s.maxY/this._cellSize);for(let s=n;s<=a;s++)for(let n=o;n<=r;n++){const a=`${s}_${n}`,o=this._cells.get(a);if(o)for(const s of o)e&&!e(s)||t.contains(s.getPosition())&&i.push(s)}return i}queryCircle(t,e,i,s=[]){const n=this._acquireCircle(t.x,t.y,e),a=this.query(n,i,s);return this._releaseShapes(),a}queryRectangle(t,e,i,s=[]){const n=this._acquireRectangle(t.x,t.y,e.width,e.height),a=this.query(n,i,s);return this._releaseShapes(),a}setCellSize(t){this._pendingCellSize=t}_acquireCircle(t,e,i){return(this._circlePool[this._circlePoolIdx++]??=new Wt(t,e,i)).reset(t,e,i)}_acquireRectangle(t,e,i,s){return(this._rectanglePool[this._rectanglePoolIdx++]??=new Zt(t,e,i,s)).reset(t,e,i,s)}_cellKeyFromCoords(t,e){return`${Math.floor(t/this._cellSize)}_${Math.floor(e/this._cellSize)}`}_getRangeBounds(t){if(t instanceof Wt){const e=t.radius,{x:i,y:s}=t.position;return{minX:i-e,maxX:i+e,minY:s-e,maxY:s+e}}if(t instanceof Zt){const{x:e,y:i}=t.position,{width:s,height:n}=t.size;return{minX:e,maxX:e+s,minY:i,maxY:i+n}}return null}_releaseShapes(){this._circlePoolIdx=0,this._rectanglePoolIdx=0}}class gi{checkParticlePositionPlugins;grid;_array;_container;_groupLimits;_limit;_maxZIndex;_minZIndex;_needsSort;_nextId;_particleResetPlugins;_particleUpdatePlugins;_pluginManager;_pool;_postParticleUpdatePlugins;_postUpdatePlugins;_resizeFactor;_updatePlugins;_zArray;constructor(t,e){this._pluginManager=t,this._container=e,this._nextId=0,this._array=[],this._zArray=[],this._pool=[],this._limit=0,this._groupLimits=new Map,this._needsSort=!1,this._minZIndex=0,this._maxZIndex=0,this.grid=new fi(100),this.checkParticlePositionPlugins=[],this._particleResetPlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._postParticleUpdatePlugins=[],this._updatePlugins=[]}get count(){return this._array.length}addParticle(e,i,s,n){const a=this._container.actualOptions.particles.number.limit.mode,o=void 0===s?this._limit:this._groupLimits.get(s)??this._limit,r=this.count;if(o>0)switch(a){case t.LimitMode.delete:{const t=r+1-o;t>0&&this.removeQuantity(t);break}case t.LimitMode.wait:if(r>=o)return}try{const a=this._pool.pop()??new pi(this._pluginManager,this._container);a.init(this._nextId,e,i,s);let o=!0;return n&&(o=n(a)),o?(this._array.push(a),this._zArray.push(a),this._nextId++,this._container.dispatchEvent(t.EventType.particleAdded,{particle:a}),a):void this._pool.push(a)}catch(t){kt().warning(`error adding particle: ${t}`)}}clear(){this._array=[],this._zArray=[]}destroy(){this._array=[],this._pool.length=0,this._zArray=[],this.checkParticlePositionPlugins=[],this._particleResetPlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._postParticleUpdatePlugins=[],this._updatePlugins=[]}drawParticles(t){for(const e of this._zArray)e.draw(t)}filter(t){return this._array.filter(t)}find(t){return this._array.find(t)}get(t){return this._array[t]}async init(){const t=this._container,e=t.actualOptions;this._minZIndex=0,this._maxZIndex=0,this._needsSort=!1,this.checkParticlePositionPlugins=[],this._updatePlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._particleResetPlugins=[],this._postParticleUpdatePlugins=[],this.grid=new fi(100*t.retina.pixelRatio);for(const e of t.plugins)e.redrawInit&&await e.redrawInit(),e.checkParticlePosition&&this.checkParticlePositionPlugins.push(e),e.update&&this._updatePlugins.push(e),e.particleUpdate&&this._particleUpdatePlugins.push(e),e.postUpdate&&this._postUpdatePlugins.push(e),e.particleReset&&this._particleResetPlugins.push(e),e.postParticleUpdate&&this._postParticleUpdatePlugins.push(e);await this._container.initDrawersAndUpdaters();for(const e of this._container.effectDrawers.values())await(e.init?.(t));for(const e of this._container.shapeDrawers.values())await(e.init?.(t));let i=!1;for(const e of t.plugins)if(i=e.particlesInitialization?.()??i,i)break;if(!i){const t=e.particles,i=t.groups;for(const e in i){const s=i[e];if(s)for(let i=this.count,n=0;n<s.number.value&&i<t.number.value;i++,n++)this.addParticle(void 0,s,e)}for(let e=this.count;e<t.number.value;e++)this.addParticle()}}push(t,e,i,s){for(let n=0;n<t;n++)this.addParticle(e,i,s)}async redraw(){this.clear(),await this.init(),this._container.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this._array.indexOf(t),void 0,e,i)}removeAt(t,e=1,i,s){if(t<0||t>this.count)return;let n=0;for(let a=t;n<e&&a<this.count;a++)this._removeParticle(a,i,s)&&(a--,n++)}removeQuantity(t,e){this.removeAt(0,t,e)}setDensity(){const t=this._container.actualOptions,e=t.particles.groups;let i=0;for(const t of this._container.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in e){const s=e[t];if(!s)continue;const n=De(this._pluginManager,this._container,s);this._applyDensity(n,i,t)}this._applyDensity(t.particles,i)}setLastZIndex(t){this._needsSort||=t>=this._maxZIndex||t>this._minZIndex&&t<this._maxZIndex}setResizeFactor(t){this._resizeFactor=t}update(t){const e=new Set;this.grid.clear();for(const e of this._updatePlugins)e.update?.(t);const i=this._resizeFactor;for(const s of this._array){i&&!s.ignoresResizeRatio&&(s.position.x*=i.width,s.position.y*=i.height,s.initialPosition.x*=i.width,s.initialPosition.y*=i.height),s.ignoresResizeRatio=!1;for(const t of this._particleResetPlugins)t.particleReset?.(s);for(const e of this._particleUpdatePlugins){if(s.destroyed)break;e.particleUpdate?.(s,t)}s.destroyed?e.add(s):this.grid.insert(s)}for(const e of this._postUpdatePlugins)e.postUpdate?.(t);for(const i of this._array)if(i.destroyed)e.add(i);else{for(const e of this._container.particleUpdaters)e.update(i,t);if(i.destroyed||i.spawning)i.destroyed&&e.add(i);else for(const e of this._postParticleUpdatePlugins)e.postParticleUpdate?.(i,t)}if(e.size)for(const t of e)this.remove(t);if(delete this._resizeFactor,this._needsSort){const t=this._zArray;t.sort((t,e)=>e.position.z-t.position.z||t.id-e.id);const e=t[0],i=t[t.length-1];if(!e||!i)return;this._maxZIndex=e.position.z,this._minZIndex=i.position.z,this._needsSort=!1}}_addToPool=(...t)=>{this._pool.push(...t)};_applyDensity=(t,e,i,s)=>{const n=t.number;if(!n.density.enable)return void(void 0===i?this._limit=n.limit.value:(s?.number.limit.value??n.limit.value)&&this._groupLimits.set(i,s?.number.limit.value??n.limit.value));const a=this._initDensityFactor(n.density),o=n.value,r=n.limit.value>0?n.limit.value:o,l=Math.min(o,r)*a+e,c=Math.min(this.count,this.filter(t=>t.group===i).length);void 0===i?this._limit=n.limit.value*a:this._groupLimits.set(i,n.limit.value*a),c<l?this.push(Math.abs(l-c),void 0,t,i):c>l&&this.removeQuantity(c-l,i)};_initDensityFactor=t=>{const e=this._container;if(!e.canvas.element||!t.enable)return 1;const i=e.canvas.element,s=e.retina.pixelRatio;return i.width*i.height/(t.height*t.width*s**2)};_removeParticle=(e,i,s)=>{const n=this._array[e];if(!n)return!1;if(n.group!==i)return!1;const a=this._zArray.indexOf(n);return this._array.splice(e,1),this._zArray.splice(a,1),n.destroy(s),this._container.dispatchEvent(t.EventType.particleRemoved,{particle:n}),this._addToPool(n),!0}}class _i{container;pixelRatio;reduceFactor;constructor(t){this.container=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.container,e=t.actualOptions;this.pixelRatio=e.detectRetina?devicePixelRatio:1,this.reduceFactor=1;const i=this.pixelRatio,s=t.canvas;if(s.element){const t=s.element;s.size.width=t.offsetWidth*i,s.size.height=t.offsetHeight*i}}initParticle(t){const e=t.options,i=this.pixelRatio,s=e.move,n=s.distance,a=t.retina;a.maxSpeed=q(s.gravity.maxSpeed)*i,a.moveDrift=q(s.drift)*i,a.moveSpeed=q(s.speed)*i,a.sizeAnimationSpeed=q(e.size.animation.speed)*i;const o=a.maxDistance;o.horizontal=void 0===n.horizontal?void 0:n.horizontal*i,o.vertical=void 0===n.vertical?void 0:n.vertical*i}}function mi(t){return!t.destroyed}function yi(t,e,...i){const s=new Ce(t,e);return Oe(s,...i),s}var vi=Object.freeze({__proto__:null,Container:class{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;plugins;retina;shapeDrawers;started;zLayers;_delay;_delayTimeout;_delta={value:0,factor:0};_dispatchCallback;_drawAnimationFrame;_duration;_eventListeners;_firstStart;_initialSourceOptions;_lastFrameTime;_lifeTime;_onDestroy;_options;_paused;_pluginManager;_smooth;_sourceOptions;constructor(e){const{dispatchCallback:i,pluginManager:s,id:n,onDestroy:a,sourceOptions:o}=e;this._pluginManager=s,this._dispatchCallback=i,this._onDestroy=a,this.id=Symbol(n),this.fpsLimit=120,this.hdr=!1,this._smooth=!1,this._delay=0,this._duration=0,this._lifeTime=0,this._firstStart=!0,this.started=!1,this.destroyed=!1,this._paused=!0,this._lastFrameTime=0,this.zLayers=100,this.pageHidden=!1,this._sourceOptions=o,this._initialSourceOptions=o,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new _i(this),this.canvas=new hi(this._pluginManager,this),this.particles=new gi(this._pluginManager,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this._options=yi(this._pluginManager,this),this.actualOptions=yi(this._pluginManager,this),this._eventListeners=new ui(this),this.dispatchEvent(t.EventType.containerBuilt)}get animationStatus(){return!this._paused&&!this.pageHidden&&mi(this)}get options(){return this._options}get sourceOptions(){return this._sourceOptions}addLifeTime(t){this._lifeTime+=t}alive(){return!this._duration||this._lifeTime<=this._duration}destroy(e=!0){if(mi(this)){this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.effectDrawers)t.destroy?.(this);for(const[,t]of this.shapeDrawers)t.destroy?.(this);for(const t of this.plugins)t.destroy?.();this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.plugins.length=0,this._pluginManager.clearPlugins(this),this.destroyed=!0,this._onDestroy(e),this.dispatchEvent(t.EventType.containerDestroyed)}}dispatchEvent(t,e){this._dispatchCallback(t,{container:this,data:e})}draw(t){if(!mi(this))return;let e=t;this._drawAnimationFrame=F(t=>{e&&(this._lastFrameTime=void 0,e=!1),this._nextFrame(t)})}async export(t,e={}){for(const i of this.plugins){if(!i.export)continue;const s=await i.export(t,e);if(s.supported)return s.blob}kt().error(`Export plugin with type ${t} not found`)}async init(){if(!mi(this))return;const e=new Map;for(const t of this._pluginManager.plugins){const i=await t.getPlugin(this);i.preInit&&await i.preInit(),e.set(t,i)}await this.initDrawersAndUpdaters(),this._options=yi(this._pluginManager,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=yi(this._pluginManager,this,this._options),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[t,i]of e)t.needsPlugin(this.actualOptions)&&(this.plugins.push(i),i.particleCreated&&this.particleCreatedPlugins.push(i),i.particleDestroyed&&this.particleDestroyedPlugins.push(i),i.particlePosition&&this.particlePositionPlugins.push(i));this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:i,duration:s,fpsLimit:n,hdr:a,smooth:o,zLayers:l}=this.actualOptions;this.hdr=a,this.zLayers=l,this._duration=q(s)*r,this._delay=q(i)*r,this._lifeTime=0,this.fpsLimit=n>0?n:120,this._smooth=o;for(const t of this.plugins)await(t.init?.());await this.particles.init(),this.dispatchEvent(t.EventType.containerInit),this.particles.setDensity();for(const t of this.plugins)t.particlesSetup?.();this.dispatchEvent(t.EventType.particlesSetup)}async initDrawersAndUpdaters(){const t=this._pluginManager;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){if(mi(this)&&(void 0!==this._drawAnimationFrame&&(U(this._drawAnimationFrame),delete this._drawAnimationFrame),!this._paused)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this._paused=!0),this.dispatchEvent(t.EventType.containerPaused)}}play(e){if(!mi(this))return;const i=this._paused||e;if(!this._firstStart||this.actualOptions.autoPlay){if(this._paused&&(this._paused=!1),i)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(t.EventType.containerPlay),this.draw(i??!1)}else this._firstStart=!1}async refresh(){if(mi(this))return this.stop(),this.start()}async reset(t){if(mi(this))return this._initialSourceOptions=t,this._sourceOptions=t,this._options=yi(this._pluginManager,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=yi(this._pluginManager,this,this._options),this.refresh()}async start(){mi(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise(e=>{const i=async()=>{this._eventListeners.addListeners();for(const t of this.plugins)await(t.start?.());this.dispatchEvent(t.EventType.containerStarted),this.play(),e()};this._delayTimeout=setTimeout(()=>{i()},this._delay)}))}stop(){if(mi(this)&&this.started){this._delayTimeout&&(clearTimeout(this._delayTimeout),delete this._delayTimeout),this._firstStart=!0,this.started=!1,this._eventListeners.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const t of this.plugins)t.stop?.();this.particleCreatedPlugins.length=0,this.particleDestroyedPlugins.length=0,this.particlePositionPlugins.length=0,this._sourceOptions=this._options,this.dispatchEvent(t.EventType.containerStopped)}}updateActualOptions(){let t=!1;for(const e of this.plugins)e.updateActualOptions&&(t=e.updateActualOptions()||t);return t}_nextFrame=t=>{try{if(!this._smooth&&void 0!==this._lastFrameTime&&t<this._lastFrameTime+r/this.fpsLimit)return void this.draw(!1);if(this._lastFrameTime??=t,function(t,e,i=60,s=!1){t.value=e,t.factor=s?60/i:60*e/r}(this._delta,t-this._lastFrameTime,this.fpsLimit,this._smooth),this.addLifeTime(this._delta.value),this._lastFrameTime=t,this._delta.value>r)return void this.draw(!1);if(this.canvas.render.drawParticles(this._delta),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){kt().error("error in animation loop",t)}}}});t.AnimatableColor=Jt,t.AnimationOptions=Qt,t.AnimationValueWithRandom=le,t.Background=Kt,t.BaseRange=Nt,t.Circle=Wt,t.ColorAnimation=Gt,t.Fill=se,t.FullScreen=te,t.HslAnimation=Xt,t.Move=pe,t.MoveAngle=ne,t.MoveCenter=ae,t.MoveGravity=oe,t.MovePath=he,t.Opacity=ge,t.OpacityAnimation=fe,t.Options=Ce,t.OptionsColor=Yt,t.OutModes=ue,t.Paint=me,t.ParticlesBounce=ve,t.ParticlesBounceFactor=ye,t.ParticlesDensity=Pe,t.ParticlesNumber=be,t.ParticlesNumberLimit=we,t.ParticlesOptions=Ie,t.RangedAnimationOptions=jt,t.RangedAnimationValueWithRandom=ce,t.Rectangle=Zt,t.ResizeEvent=ee,t.Shape=xe,t.Size=ze,t.SizeAnimation=Se,t.Spin=de,t.Stroke=_e,t.ValueWithRandom=re,t.Vector=z,t.Vector3d=S,t.ZIndex=Me,t.alterHsl=ni,t.animate=F,t.areBoundsInside=gt,t.arrayRandomIndex=pt,t.calcExactPositionOrRandomFromSize=tt,t.calcExactPositionOrRandomFromSizeRanged=function(t){const e={x:void 0!==t.position?.x?q(t.position.x):void 0,y:void 0!==t.position?.y?q(t.position.y):void 0};return tt({size:t.size,position:e})},t.calcPositionFromSize=function(t){return void 0!==t.position?.x&&void 0!==t.position.y?{x:t.position.x*t.size.width/a,y:t.position.y*t.size.height/a}:void 0},t.calcPositionOrRandomFromSize=K,t.calcPositionOrRandomFromSizeRanged=function(t){const e={x:void 0!==t.position?.x?q(t.position.x):void 0,y:void 0!==t.position?.y?q(t.position.y):void 0};return K({size:t.size,position:e})},t.calculateBounds=_t,t.cancelAnimation=U,t.canvasFirstIndex=0,t.canvasTag=g,t.checkDistance=j,t.circleBounce=function(t,e){const{x:i,y:s}=t.velocity.sub(e.velocity),[n,a]=[t.position,e.position],{dx:o,dy:r}=Z(a,n);if(i*o+s*r<0)return;const l=-Math.atan2(r,o),c=t.mass,h=e.mass,u=t.velocity.rotate(l),d=e.velocity.rotate(l),p=J(u,d,c,h),f=J(d,u,c,h),g=p.rotate(-l),_=f.rotate(-l);t.velocity.x=g.x*t.factor.x,t.velocity.y=g.y*t.factor.y,e.velocity.x=_.x*e.factor.x,e.velocity.y=_.y*e.factor.y},t.circleBounceDataFromParticle=function(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:z.create(q(t.options.bounce.horizontal.value),q(t.options.bounce.vertical.value))}},t.clamp=V,t.clear=ke,t.cloneStyle=xt,t.collisionVelocity=J,t.colorMix=ti,t.colorToHsl=function(t,e,i,s=!0){const n=We(t,e,i,s);return n?Qe(n):void 0},t.colorToRgb=We,t.countOffset=1,t.decayOffset=1,t.deepExtend=mt,t.defaultAlpha=1,t.defaultAngle=0,t.defaultCompositeValue=i,t.defaultDensityFactor=1,t.defaultFps=60,t.defaultFpsLimit=120,t.defaultLoops=0,t.defaultOpacity=1,t.defaultRatio=1,t.defaultReduceFactor=1,t.defaultRemoveQuantity=1,t.defaultRetryCount=0,t.defaultRgbMin=0,t.defaultTime=0,t.defaultTransform=c,t.defaultTransformValue=1,t.defaultVelocity=0,t.defaultZoom=1,t.degToRad=G,t.deleteCount=1,t.double=2,t.doublePI=d,t.drawAfterEffect=Ee,t.drawBeforeEffect=Le,t.drawParticle=Ae,t.drawParticlePlugin=Be,t.drawShape=Fe,t.drawShapeAfterDraw=Ue,t.drawShapeBeforeDraw=Ve,t.empty=0,t.executeOnSingleOrMultiple=yt,t.findItemFromSingleOrMultiple=function(t,e){return C(t)?t.find((t,i)=>e(t,i)):e(t,0)?t:void 0},t.generatedAttribute=e,t.generatedFalse=f,t.generatedTrue=p,t.getDistance=function(t,e){return Math.sqrt(Q(t,e))},t.getDistanceSq=Q,t.getDistances=Z,t.getFullScreenStyle=St,t.getHslAnimationFromHsl=function(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:m},s:{enable:!1,value:t.s,min:0,max:y},l:{enable:!1,value:t.l,min:0,max:v}};return e&&(ii(s.h,e.h,i),ii(s.s,e.s,i),ii(s.l,e.l,i)),s},t.getHslFromAnimation=ei,t.getItemMapFromInitializer=It,t.getItemsFromInitializer=Mt,t.getLinkColor=function(t,e,i){if(i===h)return Xe();if(i!==u)return i;{const i=t.getFillColor()??t.getStrokeColor(),s=e?.getFillColor()??e?.getStrokeColor();if(i&&s&&e)return ti(i,s,t.getRadius(),e.getRadius());{const t=i??s;if(t)return Ge(t)}}},t.getLinkRandomColor=function(t,e,i,s){const n=I(e)?e:e.value;return n===h?s?Ne(t,{value:n}):i?h:u:n===u?u:Ne(t,{value:n})},t.getLogger=kt,t.getParticleBaseVelocity=Y,t.getParticleDirectionAngle=X,t.getPosition=bt,t.getRandom=E,t.getRandomInRange=L,t.getRandomRgbColor=Xe,t.getRangeMax=N,t.getRangeMin=H,t.getRangeValue=q,t.getSize=function(t,e){return wt(t,e)},t.getStyleFromHsl=Ke,t.getStyleFromRgb=Ye,t.hMax=m,t.hMin=0,t.hPhase=60,t.half=o,t.hasMatchMedia=lt,t.hslToRgb=Ge,t.hslaToRgba=function(t){const e=Ge(t);return{a:t.a,b:e.b,g:e.g,r:e.r}},t.identity=1,t.initParticleNumericAnimationValue=Pt,t.inverseFactorNumerator=1,t.isArray=C,t.isBoolean=M,t.isFunction=function(t){return"function"==typeof t},t.isInArray=dt,t.isNull=R,t.isNumber=O,t.isObject=D,t.isPointInside=function(t,e,i,s,n){return gt(_t(t,s??0),e,i,n)},t.isString=I,t.itemFromArray=ft,t.itemFromSingleOrMultiple=vt,t.lFactor=1,t.lMax=v,t.lMin=0,t.lengthOffset=1,t.loadMinIndex=0,t.loadOptions=Oe,t.loadParticlesOptions=De,t.loadRandomFactor=1e4,t.manageListener=zt,t.memoize=rt,t.midColorValue=u,t.millisecondsToSeconds=r,t.minCount=0,t.minFpsLimit=0,t.minIndex=0,t.minLimit=0,t.minStrokeWidth=0,t.minVelocity=0,t.minZ=0,t.minimumSize=0,t.mix=B,t.none=0,t.one=1,t.originPoint=l,t.paintBase=Re,t.paintImage=Te,t.parseAlpha=function(t){return t?t.endsWith("%")?parseFloat(t)/a:parseFloat(t):1},t.percentDenominator=a,t.phaseNumerator=1,t.quarter=P,t.randomColorValue=h,t.randomInRangeValue=$,t.rangeColorToHsl=Ze,t.rangeColorToRgb=Ne,t.removeDeleteCount=1,t.removeMinIndex=0,t.resizeEvent=s,t.rgbMax=_,t.rgbToHsl=Qe,t.sMax=y,t.sMin=0,t.sNormalizedOffset=1,t.safeDocument=ct,t.safeIntersectionObserver=function(t){if("undefined"!=typeof IntersectionObserver)return new IntersectionObserver(t)},t.safeMatchMedia=ht,t.safeMutationObserver=ut,t.setAnimationFunctions=function(t,e){A.nextFrame=t,A.cancel=e},t.setLogger=function(t){t.debug&&(Tt.debug=Rt(t.debug)),t.error&&(Tt.error=Rt(t.error)),t.info&&(Tt.info=Rt(t.info)),t.log&&(Tt.log=Rt(t.log)),t.trace&&(Tt.trace=Rt(t.trace)),t.verbose&&(Tt.verbose=Rt(t.verbose)),t.warning&&(Tt.warning=Rt(t.warning))},t.setRandom=function(t=Math.random){k=t},t.setRangeValue=W,t.sextuple=6,t.spatialHashGridCellSize=100,t.squareExp=2,t.stringToAlpha=function(t,e){return He(t,e)?.a},t.stringToRgb=je,t.threeQuarter=w,t.triple=3,t.tryCountIncrement=1,t.tsParticles=ai,t.updateAnimation=function(e,i,s,n,a){if(e.destroyed||!i.enable||(i.maxLoops??0)>0&&(i.loops??0)>(i.maxLoops??0))return;const o=(i.velocity??0)*a.factor,r=i.min,l=i.max,c=i.decay??1;if(i.time??=0,(i.delayTime??0)>0&&i.time<(i.delayTime??0)&&(i.time+=a.value),!((i.delayTime??0)>0&&i.time<(i.delayTime??0))){switch(i.status){case t.AnimationStatus.increasing:i.value+=o;break;case t.AnimationStatus.decreasing:i.value-=o}switch(i.velocity&&1!==c&&(i.velocity*=c),i.status){case t.AnimationStatus.increasing:i.value>=l&&(s?i.status=t.AnimationStatus.decreasing:i.value-=l,i.loops??=0,i.loops++);break;case t.AnimationStatus.decreasing:i.value<=r&&(s?i.status=t.AnimationStatus.increasing:i.value+=l,i.loops??=0,i.loops++)}!function(e,i,s,n,a){switch(i){case t.DestroyType.max:s>=a&&e.destroy();break;case t.DestroyType.min:s<=n&&e.destroy()}}(e,n,i.value,r,l),e.destroyed||(i.value=V(i.value,r,l))}},t.updateColor=function(t,e){if(!t)return;const{h:i,s:s,l:n}=t;si(i,!1,e),si(s,!0,e),si(n,!0,e)},t.updateColorValue=si,t.visibilityChangeEvent=n,t.zIndexFactorOffset=1}),Object.assign(globalThis.window||globalThis,{tsParticles:(globalThis.__tsParticlesInternals.engine||{}).tsParticles}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
1
+ !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{}))}(this,function(t){"use strict";const e="generated",i="source-over",s="resize",n="visibilitychange",a=100,o=.5,r=1e3,l={x:0,y:0,z:0},c={a:1,b:0,c:0,d:1},h="random",u="mid",d=2*Math.PI,p="true",f="false",g="canvas",_=255,m=360,y=100,v=100,P=.25,w=.75;var b;function x(t){return"z"in t?t.z:l.z}t.MoveDirection=void 0,(b=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",b.bottomLeft="bottom-left",b.bottomRight="bottom-right",b.left="left",b.none="none",b.right="right",b.top="top",b.topLeft="top-left",b.topRight="top-right",b.outside="outside",b.inside="inside";class S{x;y;z;constructor(t=l.x,e=l.y,i=l.z){this.x=t,this.y=e,this.z=i}static get origin(){return S.create(l.x,l.y,l.z)}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 S.create(t.x,t.y,x(t))}static create(t,e,i){return"number"==typeof t?new S(t,e??l.y,i??l.z):new S(t.x,t.y,x(t))}add(t){return S.create(this.x+t.x,this.y+t.y,this.z+x(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=x(t)}copy(){return S.clone(this)}div(t){return S.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 S.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 S.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),l.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=x(t)}sub(t){return S.create(this.x-t.x,this.y-t.y,this.z-x(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=x(t)}_updateFromAngle(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class z extends S{constructor(t=l.x,e=l.y){super(t,e,l.z)}static get origin(){return z.create(l.x,l.y)}static clone(t){return z.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new z(t,e??l.y):new z(t.x,t.y)}}function M(t){return"boolean"==typeof t}function I(t){return"string"==typeof t}function O(t){return"number"==typeof t}function D(t){return"object"==typeof t&&null!==t}function C(t){return Array.isArray(t)}function R(t){return null==t}const T=Math.PI/180;let k=Math.random;const A={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function E(){return V(k(),0,1-Number.EPSILON)}function L(t,e){return E()*(e-t)+t}function F(t){return A.nextFrame(t)}function U(t){A.cancel(t)}function V(t,e,i){return Math.min(Math.max(t,e),i)}function B(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function $(t){const e=N(t);let i=H(t);return e===i&&(i=0),L(i,e)}function q(t){return O(t)?t:$(t)}function H(t){return O(t)?t:t.min}function N(t){return O(t)?t:t.max}function W(t,e){if(t===e||void 0===e&&O(t))return t;const i=H(t),s=N(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:W(i,s)}function Z(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}}function Q(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function j(t,e,i){return Q(t,e)<=i*i}function G(t){return t*T}function X(e,i,s){if(O(e))return G(e);switch(e){case t.MoveDirection.top:return-Math.PI*o;case t.MoveDirection.topRight:return-Math.PI*P;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*P;case t.MoveDirection.bottom:return Math.PI*o;case t.MoveDirection.bottomLeft:return Math.PI*w;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*w;case t.MoveDirection.inside:return Math.atan2(s.y-i.y,s.x-i.x);case t.MoveDirection.outside:return Math.atan2(i.y-s.y,i.x-s.x);default:return E()*d}}function Y(t){const e=z.origin;return e.length=1,e.angle=t,e}function J(t,e,i,s){return z.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function K(t){return{x:(t.position?.x??E()*a)*t.size.width/a,y:(t.position?.y??E()*a)*t.size.height/a}}function tt(t){const{position:e,size:i}=t;return{x:e?.x??E()*i.width,y:e?.y??E()*i.height}}var et,it,st,nt,at,ot;t.AnimationMode=void 0,(et=t.AnimationMode||(t.AnimationMode={})).auto="auto",et.increase="increase",et.decrease="decrease",et.random="random",t.AnimationStatus=void 0,(it=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",it.decreasing="decreasing",t.DestroyType=void 0,(st=t.DestroyType||(t.DestroyType={})).none="none",st.max="max",st.min="min",t.OutModeDirection=void 0,(nt=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",nt.left="left",nt.right="right",nt.top="top",t.PixelMode=void 0,(at=t.PixelMode||(t.PixelMode={})).precise="precise",at.percent="percent",t.StartValueType=void 0,(ot=t.StartValueType||(t.StartValueType={})).max="max",ot.min="min",ot.random="random";function rt(t,e){const i=new Map,s=e?.maxSize,n=e?.ttlMs,a=e?.keyFn,o=(t,e=new WeakSet)=>{if(null===t)return"null";const i=typeof t;if("undefined"===i)return"undefined";if("number"===i||"boolean"===i||"string"===i)return JSON.stringify(t);if("function"===i)try{return t.toString()}catch{return'"[Function]"'}if("symbol"===i)try{return t.toString()}catch{return'"[Symbol]"'}if(Array.isArray(t))return`[${t.map(t=>o(t,e)).join(",")}]`;if(e.has(t))return'"[Circular]"';e.add(t);return`{${Object.keys(t).sort().map(i=>`${JSON.stringify(i)}:${o(t[i],e)}`).join(",")}}`},r=t=>a?a(t):(t=>o(t))(t);return(...e)=>{const a=r(e),o=Date.now(),l=i.get(a);if(void 0!==l){if(!(n&&o-l.ts>n))return i.delete(a),i.set(a,{value:l.value,ts:l.ts}),l.value;i.delete(a)}const c=t(...e);return i.set(a,{value:c,ts:o}),(()=>{if("number"==typeof s&&s>=0)for(;i.size>s;){const t=i.keys().next().value;if(void 0===t)break;i.delete(t)}})(),c}}function lt(){return"undefined"!=typeof matchMedia}function ct(){return globalThis.document}function ht(t){if(lt())return matchMedia(t)}function ut(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function dt(t,e){return t===e||C(e)&&e.includes(t)}function pt(t){return Math.floor(E()*t.length)}function ft(t,e,i=!0){return t[void 0!==e&&i?e%t.length:pt(t)]}function gt(e,i,s,n){let a=!0;return n&&n!==t.OutModeDirection.bottom||(a=e.top<i.height+s.x),!a||n&&n!==t.OutModeDirection.left||(a=e.right>s.x),!a||n&&n!==t.OutModeDirection.right||(a=e.left<i.width+s.y),!a||n&&n!==t.OutModeDirection.top||(a=e.bottom>s.y),a}function _t(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function mt(t,...e){for(const i of e){if(R(i))continue;if(!D(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):D(t)&&!Array.isArray(t)||(t={});const e=Object.keys(i),s=new Set(["__proto__","constructor","prototype"]);if(!e.some(t=>{const e=i[t];return D(e)||Array.isArray(e)})){const n=i,a=t;for(const t of e)if(!s.has(t)&&t in n){const e=n[t];void 0!==e&&(a[t]=e)}continue}for(const n of e){if(s.has(n))continue;const e=t,a=i[n];e[n]=Array.isArray(a)?a.map(t=>mt(void 0,t)):mt(e[n],a)}}return t}function yt(t,e){return C(t)?t.map((t,i)=>e(t,i)):e(t,0)}function vt(t,e,i){return C(t)?ft(t,e,i):t}function Pt(e,i){const s=e.value,n=e.animation,a={delayTime:q(n.delay)*r,enable:n.enable,value:q(e.value)*i,max:N(s)*i,min:H(s)*i,loops:0,maxLoops:q(n.count),time:0};if(n.enable){switch(a.decay=1-q(n.decay),n.mode){case t.AnimationMode.increase:a.status=t.AnimationStatus.increasing;break;case t.AnimationMode.decrease:a.status=t.AnimationStatus.decreasing;break;case t.AnimationMode.random:a.status=E()>=o?t.AnimationStatus.increasing:t.AnimationStatus.decreasing}const e=n.mode===t.AnimationMode.auto;switch(n.startValue){case t.StartValueType.min:a.value=a.min,e&&(a.status=t.AnimationStatus.increasing);break;case t.StartValueType.max:a.value=a.max,e&&(a.status=t.AnimationStatus.decreasing);break;case t.StartValueType.random:default:a.value=$(a),e&&(a.status=E()>=o?t.AnimationStatus.increasing:t.AnimationStatus.decreasing)}}return a.initialValue=a.value,a}function wt(e,i){if(!(e.mode===t.PixelMode.percent)){const{mode:t,...i}=e;return i}return"x"in e?{x:e.x/a*i.width,y:e.y/a*i.height}:{width:e.width/a*i.width,height:e.height/a*i.height}}function bt(t,e){return wt(t,e)}function xt(t){const e=ct().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||R(s))continue;const n=t.getPropertyValue?.(s);if(!n)continue;const a=t.getPropertyPriority?.(s);a?e.setProperty(s,n,a):e.setProperty(s,n)}return e}const St=rt(function(t){const e=ct().createElement("div").style,i={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(10),"z-index":t.toString(10),top:"0",left:"0","pointer-events":"none"};for(const t in i){const s=i[t];void 0!==s&&e.setProperty(t,s)}return e});function zt(t,e,i,s,n){if(s){let s={passive:!0};M(n)?s.capture=n:void 0!==n&&(s=n),t.addEventListener(e,i,s)}else{const s=n;t.removeEventListener(e,i,s)}}async function Mt(t,e,i,s=!1){let n=e.get(t);return n&&!s||(n=await Promise.all([...i.values()].map(e=>e(t))),e.set(t,n)),n}async function It(t,e,i,s=!1){let n=e.get(t);if(!n||s){const s=await Promise.all([...i.entries()].map(([e,i])=>i(t).then(t=>[e,t])));n=new Map(s),e.set(t,n)}return n}class Ot{_listeners;constructor(){this._listeners=new Map}addEventListener(t,e){this.removeEventListener(t,e);let i=this._listeners.get(t);i||(i=[],this._listeners.set(t,i)),i.push(e)}dispatchEvent(t,e){const i=this._listeners.get(t);i?.forEach(t=>{t(e)})}hasEventListener(t){return!!this._listeners.get(t)}removeAllEventListeners(t){t?this._listeners.delete(t):this._listeners=new Map}removeEventListener(t,e){const i=this._listeners.get(t);if(!i)return;const s=i.length,n=i.indexOf(e);n<0||(1===s?this._listeners.delete(t):i.splice(n,1))}}var Dt;t.EventType=void 0,(Dt=t.EventType||(t.EventType={})).configAdded="configAdded",Dt.containerInit="containerInit",Dt.particlesSetup="particlesSetup",Dt.containerStarted="containerStarted",Dt.containerStopped="containerStopped",Dt.containerDestroyed="containerDestroyed",Dt.containerPaused="containerPaused",Dt.containerPlay="containerPlay",Dt.containerBuilt="containerBuilt",Dt.particleAdded="particleAdded",Dt.particleDestroyed="particleDestroyed",Dt.particleRemoved="particleRemoved";class Ct{colorManagers=new Map;easingFunctions=new Map;effectDrawers=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;plugins=[];presets=new Map;shapeDrawers=new Map;updaters=new Map;_allLoadersSet=new Set;_configs=new Map;_engine;_executedSet=new Set;_initialized=!1;_isRunningLoaders=!1;_loadPromises=new Set;constructor(t){this._engine=t}get configs(){const t={};for(const[e,i]of this._configs)t[e]=i;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(e){const i=e.key??e.name??"default";this._configs.set(i,e),this._engine.dispatchEvent(t.EventType.configAdded,{data:{name:i,config:e}})}addEasing(t,e){this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.initializers.effects.set(t,e)}addPalette(t,e){this.palettes.set(t,e)}addParticleUpdater(t,e){this.initializers.updaters.set(t,e)}addPlugin(t){this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,e,i=!1){!i&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){for(const i of t)this.initializers.shapes.set(i,e)}clearPlugins(t){this.effectDrawers.delete(t),this.shapeDrawers.delete(t),this.updaters.delete(t)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getEffectDrawers(t,e=!1){return It(t,this.effectDrawers,this.initializers.effects,e)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.plugins.find(e=>e.id===t)}getPreset(t){return this.presets.get(t)}async getShapeDrawers(t,e=!1){return It(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return Mt(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this._initialized&&!this._isRunningLoaders){this._isRunningLoaders=!0,this._executedSet=new Set,this._allLoadersSet=new Set(this._loadPromises);try{for(const t of this._allLoadersSet)await this._runLoader(t,this._executedSet,this._allLoadersSet)}finally{this._loadPromises.clear(),this._isRunningLoaders=!1,this._initialized=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}async register(...t){if(this._initialized)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this._isRunningLoaders?await this._runLoader(e,this._executedSet,this._allLoadersSet):this._loadPromises.add(e)}async _runLoader(t,e,i){e.has(t)||(e.add(t),i.add(t),await t(this._engine))}}const Rt=t=>(...e)=>{t(...e)},Tt={debug:Rt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:Rt(console.info),log:Rt(console.log),trace:Rt(console.trace),verbose:Rt(console.log),warning:Rt(console.warn)};function kt(){return Tt}const At="100%";class Et{pluginManager=new Ct(this);_domArray=[];_eventDispatcher=new Ot;_initialized=!1;get items(){return this._domArray}get version(){return"4.0.0-beta.16"}addEventListener(t,e){this._eventDispatcher.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${t}`)}dispatchEvent(t,e){this._eventDispatcher.dispatchEvent(t,e)}async init(){this._initialized||(await this.pluginManager.init(),this._initialized=!0)}item(t){const{items:e}=this,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){await this.init();const{Container:i}=await Promise.resolve().then(function(){return vi}),s=t.id??t.element?.id??`tsparticles${Math.floor(1e4*E()).toString()}`,{index:n,url:a}=t,o=a?await async function(t){const e=vt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(kt().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:a,index:n}):t.options,r=vt(o,n),{items:l}=this,c=l.findIndex(t=>t.id.description===s),h=new i({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:s,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(h);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:r});if(c>=0){const t=this.item(c),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),l.splice(c,e,h)}else l.push(h);const u=((t,i)=>{const s=ct();let n=i??s.getElementById(t);return n||(n=s.createElement("canvas"),n.id=t,n.dataset[e]=p,s.body.append(n),n)})(s,t.element),d=(t=>{const i=ct();let s;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===g)s=t,s.dataset[e]??=f,s.dataset[e]===p&&(s.style.width||=At,s.style.height||=At,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const n=t.getElementsByTagName(g)[0];n?(s=n,s.dataset[e]=f):(s=i.createElement(g),s.dataset[e]=p,t.appendChild(s)),s.style.width||=At,s.style.height||=At,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(u);return h.canvas.loadCanvas(d),await h.start(),h}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this._eventDispatcher.removeEventListener(t,e)}}var Lt,Ft,Ut,Vt,Bt,$t,qt,Ht;!function(t){t.circle="circle",t.rectangle="rectangle"}(Lt||(Lt={}));class Nt{position;type;constructor(t,e,i){this.position={x:t,y:e},this.type=i}_resetPosition(t,e){this.position.x=t,this.position.y=e}}class Wt extends Nt{radius;constructor(t,e,i){super(t,e,Lt.circle),this.radius=i}contains(t){return j(t,this.position,this.radius)}intersects(t){const e=this.position,i=t.position,s=this.radius,n=Math.abs(i.x-e.x),a=Math.abs(i.y-e.y);if(t instanceof Wt||t.type===Lt.circle){return s+t.radius>Math.hypot(n,a)}if(t instanceof Zt||t.type===Lt.rectangle){const e=t,{width:i,height:o}=e.size;return Math.pow(n-i,2)+Math.pow(a-o,2)<=s**2||n<=s+i&&a<=s+o||n<=i||a<=o}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Zt extends Nt{size;constructor(t,e,i,s){super(t,e,Lt.rectangle),this.size={height:s,width:i}}contains(t){const e=this.size.width,i=this.size.height,s=this.position;return t.x>=s.x&&t.x<=s.x+e&&t.y>=s.y&&t.y<=s.y+i}intersects(t){if(t instanceof Wt)return t.intersects(this);if(!(t instanceof Zt))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,a=t.size,o=a.width,r=a.height;return n.x<s.x+e&&n.x+o>s.x&&n.y<s.y+i&&n.y+r>s.y}reset(t,e,i,s){return this._resetPosition(t,e),this.size.width=i,this.size.height=s,this}}t.RotateDirection=void 0,(Ft=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Ft.counterClockwise="counter-clockwise",Ft.random="random",t.LimitMode=void 0,(Ut=t.LimitMode||(t.LimitMode={})).delete="delete",Ut.wait="wait",t.OutMode=void 0,(Vt=t.OutMode||(t.OutMode={})).bounce="bounce",Vt.none="none",Vt.out="out",Vt.destroy="destroy",Vt.split="split",t.AlterType=void 0,(Bt=t.AlterType||(t.AlterType={})).darken="darken",Bt.enlighten="enlighten",t.GradientType=void 0,($t=t.GradientType||(t.GradientType={})).linear="linear",$t.radial="radial",$t.random="random",t.ParticleOutType=void 0,(qt=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",qt.inside="inside",qt.outside="outside",t.EasingType=void 0,(Ht=t.EasingType||(t.EasingType={})).easeInBack="ease-in-back",Ht.easeInBounce="ease-in-bounce",Ht.easeInCirc="ease-in-circ",Ht.easeInCubic="ease-in-cubic",Ht.easeInElastic="ease-in-elastic",Ht.easeInExpo="ease-in-expo",Ht.easeInGaussian="ease-in-gaussian",Ht.easeInLinear="ease-in-linear",Ht.easeInQuad="ease-in-quad",Ht.easeInQuart="ease-in-quart",Ht.easeInQuint="ease-in-quint",Ht.easeInSigmoid="ease-in-sigmoid",Ht.easeInSine="ease-in-sine",Ht.easeInSmoothstep="ease-in-smoothstep",Ht.easeOutBack="ease-out-back",Ht.easeOutBounce="ease-out-bounce",Ht.easeOutCirc="ease-out-circ",Ht.easeOutCubic="ease-out-cubic",Ht.easeOutElastic="ease-out-elastic",Ht.easeOutExpo="ease-out-expo",Ht.easeOutGaussian="ease-out-gaussian",Ht.easeOutLinear="ease-out-linear",Ht.easeOutQuad="ease-out-quad",Ht.easeOutQuart="ease-out-quart",Ht.easeOutQuint="ease-out-quint",Ht.easeOutSigmoid="ease-out-sigmoid",Ht.easeOutSine="ease-out-sine",Ht.easeOutSmoothstep="ease-out-smoothstep",Ht.easeInOutBack="ease-in-out-back",Ht.easeInOutBounce="ease-in-out-bounce",Ht.easeInOutCirc="ease-in-out-circ",Ht.easeInOutCubic="ease-in-out-cubic",Ht.easeInOutElastic="ease-in-out-elastic",Ht.easeInOutExpo="ease-in-out-expo",Ht.easeInOutGaussian="ease-in-out-gaussian",Ht.easeInOutLinear="ease-in-out-linear",Ht.easeInOutQuad="ease-in-out-quad",Ht.easeInOutQuart="ease-in-out-quart",Ht.easeInOutQuint="ease-in-out-quint",Ht.easeInOutSigmoid="ease-in-out-sigmoid",Ht.easeInOutSine="ease-in-out-sine",Ht.easeInOutSmoothstep="ease-in-out-smoothstep";class Qt{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(t){R(t)||(void 0!==t.count&&(this.count=W(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=W(t.speed)),void 0!==t.decay&&(this.decay=W(t.decay)),void 0!==t.delay&&(this.delay=W(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class jt extends Qt{mode;startValue;constructor(){super(),this.mode=t.AnimationMode.auto,this.startValue=t.StartValueType.random}load(t){super.load(t),R(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.startValue&&(this.startValue=t.startValue))}}class Gt extends Qt{max;min;offset;constructor(t,e){super(),this.min=t,this.max=e,this.offset=0,this.sync=!0}load(t){super.load(t),R(t)||(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.offset&&(this.offset=W(t.offset)))}}class Xt{h=new Gt(0,m);l=new Gt(0,v);s=new Gt(0,y);load(t){R(t)||(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class Yt{value;constructor(){this.value=""}static create(t,e){const i=new Yt;return i.load(t),void 0!==e&&(I(e)||C(e)?i.load({value:e}):i.load(e)),i}load(t){R(t)||R(t.value)||(this.value=t.value)}}class Jt extends Yt{animation;constructor(){super(),this.animation=new Xt}static create(t,e){const i=new Jt;return i.load(t),void 0!==e&&(I(e)||C(e)?i.load({value:e}):i.load(e)),i}load(t){if(super.load(t),R(t))return;const e=t.animation;void 0!==e&&(void 0===e.enable?this.animation.load(t.animation):this.animation.h.load(e))}}class Kt{color;image;opacity;position;repeat;size;constructor(){this.color=new Yt,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){R(t)||(void 0!==t.color&&(this.color=Yt.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 te{enable;zIndex;constructor(){this.enable=!0,this.zIndex=0}load(t){R(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class ee{delay;enable;constructor(){this.delay=.5,this.enable=!0}load(t){R(t)||(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class ie{close;options;type;constructor(){this.close=!0,this.options={},this.type=[]}load(t){if(R(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=mt(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class se{color;enable;opacity;constructor(){this.enable=!0,this.opacity=1}load(t){R(t)||(void 0!==t.color&&(this.color=Jt.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=W(t.opacity)))}}class ne{offset;value;constructor(){this.offset=0,this.value=90}load(t){R(t)||(void 0!==t.offset&&(this.offset=W(t.offset)),void 0!==t.value&&(this.value=W(t.value)))}}class ae{mode;radius;x;y;constructor(){this.x=50,this.y=50,this.mode=t.PixelMode.percent,this.radius=0}load(t){R(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 oe{acceleration;enable;inverse;maxSpeed;constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){R(t)||(void 0!==t.acceleration&&(this.acceleration=W(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=W(t.maxSpeed)))}}class re{value;constructor(){this.value=0}load(t){R(t)||R(t.value)||(this.value=W(t.value))}}class le extends re{animation=new Qt;load(t){if(super.load(t),R(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class ce extends le{animation;constructor(){super(),this.animation=new jt}load(t){super.load(t)}}class he{clamp;delay;enable;generator;options;constructor(){this.clamp=!0,this.delay=new re,this.enable=!1,this.options={}}load(t){R(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=mt(this.options,t.options)))}}class ue{bottom;default;left;right;top;constructor(){this.default=t.OutMode.out}load(t){R(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 de{acceleration;enable;position;constructor(){this.acceleration=0,this.enable=!1}load(t){R(t)||(void 0!==t.acceleration&&(this.acceleration=W(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),t.position&&(this.position=mt({},t.position)))}}class pe{angle;center;decay;direction;distance;drift;enable;gravity;outModes;path;random;size;speed;spin;straight;vibrate;warp;constructor(){this.angle=new ne,this.center=new ae,this.decay=0,this.distance={},this.direction=t.MoveDirection.none,this.drift=0,this.enable=!1,this.gravity=new oe,this.path=new he,this.outModes=new ue,this.random=!1,this.size=!1,this.speed=2,this.spin=new de,this.straight=!1,this.vibrate=!1,this.warp=!1}load(t){if(R(t))return;this.angle.load(O(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),void 0!==t.decay&&(this.decay=W(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance=O(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),void 0!==t.drift&&(this.drift=W(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(D(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=W(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class fe extends jt{destroy;constructor(){super(),this.destroy=t.DestroyType.none,this.speed=2}load(t){super.load(t),R(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class ge extends ce{animation;constructor(){super(),this.animation=new fe,this.value=1}load(t){if(R(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class _e{color;opacity;width;constructor(){this.width=0}load(t){R(t)||(void 0!==t.color&&(this.color=Jt.create(this.color,t.color)),void 0!==t.width&&(this.width=W(t.width)),void 0!==t.opacity&&(this.opacity=W(t.opacity)))}}class me{color;fill;stroke;load(t){R(t)||(void 0!==t.color&&(this.color=Jt.create(this.color,t.color)),void 0!==t.fill&&(this.fill??=new se,this.fill.load(t.fill)),void 0!==t.stroke&&(this.stroke??=new _e,this.stroke.load(t.stroke)))}}class ye extends re{constructor(){super(),this.value=1}}class ve{horizontal;vertical;constructor(){this.horizontal=new ye,this.vertical=new ye}load(t){R(t)||(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class Pe{enable;height;width;constructor(){this.enable=!1,this.width=1920,this.height=1080}load(t){if(R(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)}}class we{mode;value;constructor(){this.mode=t.LimitMode.delete,this.value=0}load(t){R(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class be{density;limit;value;constructor(){this.density=new Pe,this.limit=new we,this.value=0}load(t){R(t)||(this.density.load(t.density),this.limit.load(t.limit),void 0!==t.value&&(this.value=t.value))}}class xe{close;options;type;constructor(){this.close=!0,this.options={},this.type="circle"}load(t){if(R(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=mt(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class Se extends jt{destroy;constructor(){super(),this.destroy=t.DestroyType.none,this.speed=5}load(t){super.load(t),R(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class ze extends ce{animation;constructor(){super(),this.animation=new Se,this.value=3}load(t){if(super.load(t),R(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class Me extends re{opacityRate;sizeRate;velocityRate;constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),R(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 Ie{bounce;effect;groups;move;number;opacity;paint;palette;reduceDuplicates;shape;size;zIndex;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.bounce=new ve,this.effect=new ie,this.groups={},this.move=new pe,this.number=new be,this.opacity=new ge,this.paint=new me,this.paint.color=new Jt,this.paint.color.value="#fff",this.paint.fill=new se,this.paint.fill.enable=!0,this.reduceDuplicates=!1,this.shape=new xe,this.size=new ze,this.zIndex=new Me}load(t){if(R(t))return;if(t.palette&&(this.palette=t.palette,this._importPalette(this.palette)),void 0!==t.groups)for(const e of Object.keys(t.groups)){if(!(e in t.groups))continue;const i=t.groups[e];void 0!==i&&(this.groups[e]=mt(this.groups[e]??{},i))}void 0!==t.reduceDuplicates&&(this.reduceDuplicates=t.reduceDuplicates),this.bounce.load(t.bounce),this.effect.load(t.effect),this.move.load(t.move),this.number.load(t.number),this.opacity.load(t.opacity);const e=t.paint;if(e&&(C(e)?this.paint=yt(e,t=>{const e=new me;return e.load(t),e}):C(this.paint)?(this.paint=new me,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.size.load(t.size),this.zIndex.load(t.zIndex),this._container){for(const e of this._pluginManager.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this._container,this,t);const e=this._pluginManager.updaters.get(this._container);if(e)for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}_importPalette=t=>{const e=this._pluginManager.getPalette(t);if(!e)return;const i=e.colors,s=(C(i)?i:[i]).flatMap(t=>{const e=t.fill,i=t.stroke,s=e?{color:{value:e.value},enable:e.enable,opacity:e.opacity}:void 0;return i?[{fill:s,stroke:{color:{value:i.value},opacity:i.opacity,width:i.width||0}}]:[{fill:s}]}),n=s.length>1?s:s[0]??{};this.load({paint:n,blend:{enable:!0,mode:e.blendMode}})}}function Oe(t,...e){for(const i of e)t.load(i)}function De(t,e,...i){const s=new Ie(t,e);return Oe(s,...i),s}class Ce{autoPlay;background;clear;defaultThemes;delay;detectRetina;duration;fpsLimit;fullScreen;hdr;key;name;palette;particles;pauseOnBlur;pauseOnOutsideViewport;preset;resize;smooth;style;zLayers;_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e,this.autoPlay=!0,this.background=new Kt,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new te,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.hdr=!0,this.particles=De(this._pluginManager,this._container),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.resize=new ee,this.smooth=!1,this.style={},this.zLayers=100}load(t){if(R(t))return;void 0!==t.preset&&(this.preset=t.preset,yt(this.preset,t=>{this._importPreset(t)})),void 0!==t.palette&&(this.palette=t.palette,this._importPalette(this.palette)),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=W(t.delay));const e=t.detectRetina;void 0!==e&&(this.detectRetina=e),void 0!==t.duration&&(this.duration=W(t.duration));const i=t.fpsLimit;void 0!==i&&(this.fpsLimit=i),void 0!==t.hdr&&(this.hdr=t.hdr),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;M(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.particles.load(t.particles),this.resize.load(t.resize),this.style=mt(this.style,t.style),void 0!==t.smooth&&(this.smooth=t.smooth),this._pluginManager.plugins.forEach(e=>{e.loadOptions(this._container,this,t)})}_importPalette=t=>{const e=this._pluginManager.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})};_importPreset=t=>{this.load(this._pluginManager.getPreset(t))}}function Re(t,e,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(l.x,l.y,e.width,e.height)}function Te(t,e,i,s){if(!i)return;const n=t.globalAlpha;t.globalAlpha=s,t.drawImage(i,l.x,l.y,e.width,e.height),t.globalAlpha=n}function ke(t,e){t.clearRect(l.x,l.y,e.width,e.height)}function Ae(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:o,opacity:r,transform:l}=t,{effectDrawers:c,shapeDrawers:h}=e,u=s.getPosition(),d=s.getTransformData(l),p={x:u.x,y:u.y};i.setTransform(d.a,d.b,d.c,d.d,u.x,u.y),a.fill&&(i.fillStyle=a.fill);const f=!!s.fillEnabled,g=s.strokeWidth??0;i.lineWidth=g,a.stroke&&(i.strokeStyle=a.stroke);const _={context:i,particle:s,radius:o,drawRadius:1*o,opacity:r,delta:n,pixelRatio:e.retina.pixelRatio,fill:f,stroke:g>0,transformData:d,position:{...u},drawPosition:p,drawScale:1};for(const t of e.plugins)t.drawParticleTransform?.(_);const m=s.effect?c.get(s.effect):void 0,y=s.shape?h.get(s.shape):void 0;Le(m,_),Ve(y,_),Fe(y,_),Ue(y,_),Ee(m,_),i.resetTransform()}function Ee(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}function Le(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}function Fe(t,e){if(!t)return;const{context:i,fill:s,particle:n,stroke:a}=e;n.shape&&(i.beginPath(),t.draw(e),n.shapeClose&&i.closePath(),s&&i.fill(),a&&i.stroke())}function Ue(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}function Ve(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}function Be(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}const $e=new Map;function qe(t,e){let i=$e.get(t);if(!i){if(i=e(),$e.size>=1e3){[...$e.keys()].slice(0,500).forEach(t=>$e.delete(t))}$e.set(t,i)}return i}function He(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function Ne(t,e,i,s=!0){if(!e)return;const n=I(e)?{value:e}:e;if(I(n.value))return We(t,n.value,i,s);if(C(n.value)){const e=ft(n.value,i,s);if(!e)return;return Ne(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function We(t,e,i,s=!0){if(!e)return;const n=I(e)?{value:e}:e;if(I(n.value))return n.value===h?Xe():je(t,n.value);if(C(n.value)){const e=ft(n.value,i,s);if(!e)return;return We(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Ze(t,e,i,s=!0){const n=Ne(t,e,i,s);return n?Qe(n):void 0}function Qe(t){const e=t.r/_,i=t.g/_,s=t.b/_,n=Math.max(e,i,s),a=Math.min(e,i,s),r={h:0,l:(n+a)*o,s:0};return n!==a&&(r.s=r.l<o?(n-a)/(n+a):(n-a)/(2-n-a),r.h=e===n?(i-s)/(n-a):i===n?2+(s-e)/(n-a):4+(e-i)/(n-a)),r.l*=v,r.s*=y,r.h*=60,r.h<0&&(r.h+=m),r.h>=m&&(r.h-=m),r}function je(t,e){return He(t,e)}function Ge(t){const e=(t.h%m+m)%m,i=Math.max(0,Math.min(y,t.s)),s=Math.max(0,Math.min(v,t.l)),n=e/m,a=i/y,r=s/v;if(0===i){const t=Math.round(r*_);return{r:t,g:t,b:t}}const l=(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},c=r<o?r*(1+a):r+a-r*a,h=2*r-c,u=1/3,d=Math.min(_,_*l(h,c,n+u)),p=Math.min(_,_*l(h,c,n)),f=Math.min(_,_*l(h,c,n-u));return{r:Math.round(d),g:Math.round(p),b:Math.round(f)}}function Xe(t){const e=t??0,i=()=>Math.floor(L(e,256));return{b:i(),g:i(),r:i()}}function Ye(t,e,i){const s=i??1;return qe(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?Je(t,i):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(t,i))}function Je(t,e){return`color(display-p3 ${(t.r/_).toString()} ${(t.g/_).toString()} ${(t.b/_).toString()} / ${(e??1).toString()})`}function Ke(t,e,i){const s=i??1;return qe(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?function(t,e){return Je(Ge(t),e)}(t,i):function(t,e){return`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${(e??1).toString()})`}(t,i))}function ti(t,e,i,s){let n=t,a=e;return"r"in n||(n=Ge(t)),"r"in a||(a=Ge(e)),{b:B(n.b,a.b,i,s),g:B(n.g,a.g,i,s),r:B(n.r,a.r,i,s)}}function ei(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function ii(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=q(i.speed)/a*s,e.decay=1-q(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=q(i.count),e.time=0,e.delayTime=q(i.delay)*r,i.sync||(e.velocity*=E(),e.value*=E()),e.initialValue=e.value,e.offset=W(i.offset)):e.velocity=0}function si(e,i,s){if(!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;if(e.time??=0,(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=s.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0))return;const n=e.offset?$(e.offset):0,a=(e.velocity??0)*s.factor+3.6*n,o=e.decay??1,r=e.max,l=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=a,e.value<l&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=a,e.value>r&&(e.loops??=0,e.loops++,i?e.status=t.AnimationStatus.decreasing:e.value-=r)),e.velocity&&1!==o&&(e.velocity*=o),e.value=V(e.value,l,r)}function ni(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const ai=new Et,oi=globalThis;oi.__tsParticlesInternals=oi.__tsParticlesInternals??{},oi.tsParticles=ai;function ri(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class li{_canvasClearPlugins;_canvasManager;_canvasPaintPlugins;_clearDrawPlugins;_colorPlugins;_container;_context;_contextSettings;_drawParticlePlugins;_drawParticlesCleanupPlugins;_drawParticlesSetupPlugins;_drawPlugins;_drawSettingsCleanupPlugins;_drawSettingsSetupPlugins;_pluginManager;_postDrawUpdaters;_preDrawUpdaters;_reusableColorStyles={};_reusablePluginColors=[void 0,void 0];_reusableTransform={};constructor(t,e,i){this._pluginManager=t,this._container=e,this._canvasManager=i,this._context=null,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesCleanupPlugins=[],this._drawParticlesSetupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[]}get settings(){return this._contextSettings}canvasClear(){this._container.actualOptions.clear&&this.draw(t=>{ke(t,this._canvasManager.size)})}clear(){let t=!1;for(const e of this._canvasClearPlugins)if(t=e.canvasClear?.()??!1,t)break;t||this.canvasClear()}destroy(){this.stop(),this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesCleanupPlugins=[],this._drawParticlesSetupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[]}draw(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();let[a,o]=this._getPluginParticleColors(t);if(a??=s,o??=n,!a&&!o)return;const r=this._container,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:h,opacity:u,strokeOpacity:d}=t.getOpacity(),p=this._reusableTransform,f=this._reusableColorStyles,g=a?Ke(a,r.hdr,h*u):void 0,_=o?Ke(o,r.hdr,d*u):g;p.a=p.b=p.c=p.d=void 0,f.fill=g,f.stroke=_,this.draw(s=>{for(const i of this._drawParticlesSetupPlugins)i.drawParticleSetup?.(s,t,e);this._applyPreDrawUpdaters(s,t,i,u,f,p),Ae({container:r,context:s,particle:t,delta:e,colorStyles:f,radius:i*c**l.sizeRate,opacity:u,transform:p}),this._applyPostDrawUpdaters(t);for(const i of this._drawParticlesCleanupPlugins)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this._drawParticlePlugins)Be(i,s,t,e)})}drawParticles(t){const{particles:e}=this._container;this.clear(),e.update(t),this.draw(i=>{for(const e of this._drawSettingsSetupPlugins)e.drawSettingsSetup?.(i,t);for(const e of this._drawPlugins)e.draw?.(i,t);e.drawParticles(t);for(const e of this._clearDrawPlugins)e.clearDraw?.(i,t);for(const e of this._drawSettingsCleanupPlugins)e.drawSettingsCleanup?.(i,t)})}init(){this.initUpdaters(),this.initPlugins(),this.paint()}initPlugins(){this._colorPlugins=[],this._canvasClearPlugins=[],this._canvasPaintPlugins=[],this._clearDrawPlugins=[],this._drawParticlePlugins=[],this._drawParticlesSetupPlugins=[],this._drawParticlesCleanupPlugins=[],this._drawPlugins=[],this._drawSettingsSetupPlugins=[],this._drawSettingsCleanupPlugins=[];for(const t of this._container.plugins)(t.particleFillColor??t.particleStrokeColor)&&this._colorPlugins.push(t),t.canvasClear&&this._canvasClearPlugins.push(t),t.canvasPaint&&this._canvasPaintPlugins.push(t),t.drawParticle&&this._drawParticlePlugins.push(t),t.drawParticleSetup&&this._drawParticlesSetupPlugins.push(t),t.drawParticleCleanup&&this._drawParticlesCleanupPlugins.push(t),t.draw&&this._drawPlugins.push(t),t.drawSettingsSetup&&this._drawSettingsSetupPlugins.push(t),t.drawSettingsCleanup&&this._drawSettingsCleanupPlugins.push(t),t.clearDraw&&this._clearDrawPlugins.push(t)}initUpdaters(){this._preDrawUpdaters=[],this._postDrawUpdaters=[];for(const t of this._container.particleUpdaters)t.afterDraw&&this._postDrawUpdaters.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this._preDrawUpdaters.push(t)}paint(){let t=!1;for(const e of this._canvasPaintPlugins)if(t=e.canvasPaint?.()??!1,t)break;t||this.paintBase()}paintBase(t){this.draw(e=>{Re(e,this._canvasManager.size,t)})}paintImage(t,e){this.draw(i=>{Te(i,this._canvasManager.size,t,e)})}setContext(t){this._context=t,this._context&&(this._context.globalCompositeOperation=i)}setContextSettings(t){this._contextSettings=t}stop(){this.draw(t=>{ke(t,this._canvasManager.size)})}_applyPostDrawUpdaters=t=>{for(const e of this._postDrawUpdaters)e.afterDraw?.(t)};_applyPreDrawUpdaters=(t,e,i,s,n,a)=>{for(const o of this._preDrawUpdaters){if(o.getColorStyles){const{fill:a,stroke:r}=o.getColorStyles(e,t,i,s);a&&(n.fill=a),r&&(n.stroke=r)}if(o.getTransformValues){const t=o.getTransformValues(e);for(const e in t)ri(a,t,e)}o.beforeDraw?.(e)}};_getPluginParticleColors=t=>{let e,i;for(const s of this._colorPlugins)if(!e&&s.particleFillColor&&(e=Ze(this._pluginManager,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=Ze(this._pluginManager,s.particleStrokeColor(t))),e&&i)break;return this._reusablePluginColors[0]=e,this._reusablePluginColors[1]=i,this._reusablePluginColors}}function ci(t,e,i=!1){if(!e)return;const s=t.style,n=new Set;for(let t=0;t<s.length;t++){const e=s.item(t);e&&n.add(e)}for(let t=0;t<e.length;t++){const i=e.item(t);i&&n.add(i)}for(const t of n){const n=e.getPropertyValue(t);n?s.setProperty(t,n,i?"important":""):s.removeProperty(t)}}class hi{element;render;size;zoom=1;_container;_generated;_mutationObserver;_originalStyle;_pluginManager;_pointerEvents;_resizePlugins;_standardSize;_zoomCenter;constructor(t,e){this._pluginManager=t,this._container=e,this.render=new li(t,e,this),this._standardSize={height:0,width:0};const i=e.retina.pixelRatio,s=this._standardSize;this.size={height:s.height*i,width:s.width*i},this._generated=!1,this._resizePlugins=[],this._pointerEvents="none"}get _fullScreen(){return this._container.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this._generated){const t=this.element;t?.remove(),this.element=void 0}else this._resetOriginalStyle();this.render.destroy(),this._resizePlugins=[]}getZoomCenter(){const t=this._container.retina.pixelRatio,{width:e,height:i}=this.size;return this._zoomCenter?this._zoomCenter:{x:e*o/t,y:i*o/t}}init(){this._safeMutationObserver(t=>{t.disconnect()}),this._mutationObserver=ut(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this._repairStyle()}),this.resize(),this._initStyle(),this.initBackground(),this._safeMutationObserver(t=>{this.element&&this.element instanceof Node&&t.observe(this.element,{attributes:!0})}),this.initPlugins(),this.render.init()}initBackground(){const{_container:t}=this,e=t.actualOptions.background,i=this.element;if(!i)return;const s=i.style,n=Ne(this._pluginManager,e.color);s.backgroundColor=n?Ye(n,t.hdr,e.opacity):"",s.backgroundImage=e.image||"",s.backgroundPosition=e.position||"",s.backgroundRepeat=e.repeat||"",s.backgroundSize=e.size||""}initPlugins(){this._resizePlugins=[];for(const t of this._container.plugins)t.resize&&this._resizePlugins.push(t)}loadCanvas(t){this._generated&&this.element&&this.element.remove();const i=this._container;this._generated=e in t.dataset?"true"===t.dataset[e]:this._generated,this.element=t,this.element.ariaHidden="true",this._originalStyle=xt(this.element.style);const s=this._standardSize;s.height=t.offsetHeight,s.width=t.offsetWidth;const n=this._container.retina.pixelRatio,a=this.size;t.height=a.height=s.height*n,t.width=a.width=s.width*n;const o=ht("(color-gamut: p3)");this.render.setContextSettings({alpha:!0,colorSpace:o?.matches&&i.hdr?"display-p3":"srgb",desynchronized:!0,willReadFrequently:!1}),this.render.setContext(this.element.getContext("2d",this.render.settings)),this._safeMutationObserver(t=>{t.disconnect()}),i.retina.init(),this.initBackground(),this._safeMutationObserver(t=>{this.element&&this.element instanceof Node&&t.observe(this.element,{attributes:!0})})}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 a={...e};e.height=i.height,e.width=i.width;const o=this.size;return this.element.width=o.width=n.width,this.element.height=o.height=n.height,this._container.started&&t.particles.setResizeFactor({width:e.width/a.width,height:e.height/a.height}),!0}setPointerEvents(t){this.element&&(this._pointerEvents=t,this._repairStyle())}setZoom(t,e){this.zoom=t,this._zoomCenter=e}stop(){this._safeMutationObserver(t=>{t.disconnect()}),this._mutationObserver=void 0,this.render.stop()}async windowResize(){if(!this.element||!this.resize())return;const t=this._container,e=t.updateActualOptions();t.particles.setDensity(),this._applyResizePlugins(),e&&await t.refresh()}_applyResizePlugins=()=>{for(const t of this._resizePlugins)t.resize?.()};_initStyle=()=>{const t=this.element,e=this._container.actualOptions;if(t){this._fullScreen?this._setFullScreenStyle():this._resetOriginalStyle();for(const i in e.style){if(!i||!(i in e.style))continue;const s=e.style[i];s&&t.style.setProperty(i,s,"important")}}};_repairStyle=()=>{const t=this.element;if(!t)return;this._safeMutationObserver(t=>{t.disconnect()}),this._initStyle(),this.initBackground();const e=this._pointerEvents;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this._safeMutationObserver(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})};_resetOriginalStyle=()=>{const t=this.element,e=this._originalStyle;t&&e&&ci(t,e,!0)};_safeMutationObserver=t=>{this._mutationObserver&&t(this._mutationObserver)};_setFullScreenStyle=()=>{const t=this.element;t&&ci(t,St(this._container.actualOptions.fullScreen.zIndex),!0)}}class ui{container;_handlers;_resizeObserver;_resizeTimeout;constructor(t){this.container=t,this._handlers={visibilityChange:()=>{this._handleVisibilityChange()},resize:()=>{this._handleWindowResize()}}}addListeners(){this._manageListeners(!0)}removeListeners(){this._manageListeners(!1)}_handleVisibilityChange=()=>{const t=this.container;t.actualOptions.pauseOnBlur&&(ct().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))};_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.resize.delay*r)};_manageListeners=t=>{const e=this._handlers;this._manageResize(t),zt(document,n,e.visibilityChange,t,!1)};_manageResize=t=>{const e=this._handlers,i=this.container;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void zt(globalThis,s,e.resize,t);const n=i.canvas.element;this._resizeObserver&&!t?(n&&this._resizeObserver.unobserve(n),this._resizeObserver.disconnect(),delete this._resizeObserver):!this._resizeObserver&&t&&n&&(this._resizeObserver=new ResizeObserver(t=>{t.find(t=>t.target===n)&&this._handleWindowResize()}),this._resizeObserver.observe(n))}}function di(t){if(!dt(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 pi{backColor;bubble;destroyed;direction;effect;effectClose;effectData;fillColor;fillEnabled;fillOpacity;group;id;ignoresResizeRatio;initialPosition;initialVelocity;isRotating;justWarped;lastPathTime;misplaced;moveCenter;offset;opacity;options;outType;pathRotation;position;randomIndexData;retina;roll;rotation;shape;shapeClose;shapeData;sides;size;slow;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;_cachedOpacityData={fillOpacity:1,opacity:1,strokeOpacity:1};_cachedPosition=S.origin;_cachedRotateData={sin:0,cos:0};_cachedTransform={a:1,b:0,c:0,d:1};_container;_pluginManager;constructor(t,e){this._pluginManager=t,this._container=e}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const i=this._container,s=this.shape?i.shapeDrawers.get(this.shape):void 0;s?.particleDestroy?.(this);for(const t of i.particleDestroyedPlugins)t.particleDestroyed?.(this,e);for(const t of i.particleUpdaters)t.particleDestroyed?.(this,e);this._container.dispatchEvent(t.EventType.particleDestroyed,{particle:this})}draw(t){const e=this._container.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this._getRollColor(this.bubble.color??ei(this.fillColor))}getMass(){return this.getRadius()**2*Math.PI*o}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=this.bubble.opacity??q(this.opacity?.value??1),s=this.fillOpacity??1,n=this.strokeOpacity??1;return this._cachedOpacityData.fillOpacity=i*s*e,this._cachedOpacityData.opacity=i*e,this._cachedOpacityData.strokeOpacity=i*n*e,this._cachedOpacityData}getPosition(){return this._cachedPosition.x=this.position.x+this.offset.x,this._cachedPosition.y=this.position.y+this.offset.y,this._cachedPosition.z=this.position.z,this._cachedPosition}getRadius(){return this.bubble.radius??this.size.value}getRotateData(){const t=this.getAngle();return this._cachedRotateData.sin=Math.sin(t),this._cachedRotateData.cos=Math.cos(t),this._cachedRotateData}getStrokeColor(){return this._getRollColor(this.bubble.color??ei(this.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this._cachedTransform.a=e.cos*(t.a??c.a),this._cachedTransform.b=i?e.sin*(t.b??1):t.b??c.b,this._cachedTransform.c=i?-e.sin*(t.c??1):t.c??c.c,this._cachedTransform.d=e.cos*(t.d??c.d),this._cachedTransform}init(e,i,s,n){const a=this._container;this.id=e,this.group=n,this.justWarped=!1,this.effectClose=!0,this.shapeClose=!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:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},this.outType=t.ParticleOutType.normal,this.ignoresResizeRatio=!0;const o=a.retina.pixelRatio,r=a.actualOptions,l=De(this._pluginManager,a,r.particles),c=l.reduceDuplicates,u=l.effect.type,d=l.shape.type;this.effect=vt(u,this.id,c),this.shape=vt(d,this.id,c);const p=l.effect,f=l.shape;if(s){if(s.effect?.type){const t=vt(s.effect.type,this.id,c);t&&(this.effect=t,p.load(s.effect))}if(s.shape?.type){const t=vt(s.shape.type,this.id,c);t&&(this.shape=t,f.load(s.shape))}}if(this.effect===h){const t=[...this._container.effectDrawers.keys()];this.effect=t[Math.floor(E()*t.length)]}if(this.shape===h){const t=[...this._container.shapeDrawers.keys()];this.shape=t[Math.floor(E()*t.length)]}this.effectData=this.effect?function(t,e,i,s){const n=e.options[t];return mt({close:e.close},vt(n,i,s))}(this.effect,p,this.id,c):void 0,this.shapeData=this.shape?function(t,e,i,s){const n=e.options[t];return mt({close:e.close},vt(n,i,s))}(this.shape,f,this.id,c):void 0,l.load(s);const g=this.effectData;g&&l.load(g.particles);const _=this.shapeData;_&&l.load(_.particles),this.effectClose=g?.close??l.effect.close,this.shapeClose=_?.close??l.shape.close,this.options=l,a.retina.initParticle(this),this.size=Pt(this.options.size,o),this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this._initPosition(i),this.initialVelocity=this._calculateVelocity(),this.velocity=this.initialVelocity.copy();let m,y;a.particles.setLastZIndex(this.position.z),this.zIndexFactor=this.position.z/a.zLayers,this.sides=24,this.effect&&(m=a.effectDrawers.get(this.effect)),m?.loadEffect&&m.loadEffect(this),this.shape&&(y=a.shapeDrawers.get(this.shape)),y?.loadShape&&y.loadShape(this);const v=y?.getSidesCount;v&&(this.sides=v(this)),this.spawning=!1;for(const t of a.particleUpdaters)t.init(this);m?.particleInit?.(a,this),y?.particleInit?.(a,this);for(const t of a.particleCreatedPlugins)t.particleCreated?.(this)}isInsideCanvas(){const t=this.getRadius(),e=this._container.canvas.size,i=this.position;return i.x>=-t&&i.y>=-t&&i.y<=e.height+t&&i.x<=e.width+t}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const e=t%d,i=e<0?e+d:e;return i>=Math.PI*o&&i<3*Math.PI*o}if(this.roll.horizontal){const e=(t+Math.PI*o)%(2*Math.PI),i=e<0?e+2*Math.PI:e;return i>=Math.PI&&i<2*Math.PI}if(this.roll.vertical){const e=t%(2*Math.PI),i=e<0?e+2*Math.PI:e;return i>=Math.PI&&i<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){for(const t of this._container.particleUpdaters)t.reset?.(this)}_calcPosition=(t,e)=>{let i=0,s=t?S.create(t.x,t.y,e):void 0;const n=this._container,a=n.particlePositionPlugins,o=this.options.move.outModes,r=this.getRadius(),l=n.canvas.size,c=new AbortController,{signal:h}=c;for(;!h.aborted;){for(const t of a){const i=t.particlePosition?.(s,this);if(i)return S.create(i.x,i.y,e)}const t=tt({size:l,position:s}),c=S.create(t.x,t.y,e);this._fixHorizontal(c,r,o.left??o.default),this._fixHorizontal(c,r,o.right??o.default),this._fixVertical(c,r,o.top??o.default),this._fixVertical(c,r,o.bottom??o.default);let h=!0;for(const t of n.particles.checkParticlePositionPlugins)if(h=t.checkParticlePosition?.(this,c,i)??!0,!h)break;if(h)return c;i+=1,s=void 0}return s};_calculateVelocity=()=>{const e=Y(this.direction).copy(),i=this.options.move;if(i.direction===t.MoveDirection.inside||i.direction===t.MoveDirection.outside)return e;const s=G(q(i.angle.value)),n=G(q(i.angle.offset)),a={left:n-s*o,right:n+s*o};return i.straight||(e.angle+=$(W(a.left,a.right))),i.random&&"number"==typeof i.speed&&(e.length*=E()),e};_fixHorizontal=(e,i,s)=>{di({outMode:s,checkModes:[t.OutMode.bounce],coord:e.x,maxCoord:this._container.canvas.size.width,setCb:t=>e.x+=t,radius:i})};_fixVertical=(e,i,s)=>{di({outMode:s,checkModes:[t.OutMode.bounce],coord:e.y,maxCoord:this._container.canvas.size.height,setCb:t=>e.y+=t,radius:i})};_getRollColor=t=>t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?ni(t,this.roll.alter.type,this.roll.alter.value):t:t;_initPosition=e=>{const i=this._container,s=q(this.options.zIndex.value),n=this._calcPosition(e,V(s,0,i.zLayers));if(!n)throw new Error("a valid position cannot be found for particle");this.position=n,this.initialPosition=this.position.copy();const a=i.canvas.size;switch(this.moveCenter={...bt(this.options.move.center,a),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=X(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case t.MoveDirection.inside:this.outType=t.ParticleOutType.inside;break;case t.MoveDirection.outside:this.outType=t.ParticleOutType.outside}this.offset=z.origin}}class fi{_cellSize;_cells=new Map;_circlePool=[];_circlePoolIdx;_pendingCellSize;_rectanglePool=[];_rectanglePoolIdx;constructor(t){this._cellSize=t,this._circlePoolIdx=0,this._rectanglePoolIdx=0}clear(){this._cells.clear();const t=this._pendingCellSize;t&&(this._cellSize=t),this._pendingCellSize=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this._cellKeyFromCoords(e,i);this._cells.has(s)||this._cells.set(s,[]),this._cells.get(s)?.push(t)}query(t,e,i=[]){const s=this._getRangeBounds(t);if(!s)return i;const n=Math.floor(s.minX/this._cellSize),a=Math.floor(s.maxX/this._cellSize),o=Math.floor(s.minY/this._cellSize),r=Math.floor(s.maxY/this._cellSize);for(let s=n;s<=a;s++)for(let n=o;n<=r;n++){const a=`${s}_${n}`,o=this._cells.get(a);if(o)for(const s of o)e&&!e(s)||t.contains(s.getPosition())&&i.push(s)}return i}queryCircle(t,e,i,s=[]){const n=this._acquireCircle(t.x,t.y,e),a=this.query(n,i,s);return this._releaseShapes(),a}queryRectangle(t,e,i,s=[]){const n=this._acquireRectangle(t.x,t.y,e.width,e.height),a=this.query(n,i,s);return this._releaseShapes(),a}setCellSize(t){this._pendingCellSize=t}_acquireCircle(t,e,i){return(this._circlePool[this._circlePoolIdx++]??=new Wt(t,e,i)).reset(t,e,i)}_acquireRectangle(t,e,i,s){return(this._rectanglePool[this._rectanglePoolIdx++]??=new Zt(t,e,i,s)).reset(t,e,i,s)}_cellKeyFromCoords(t,e){return`${Math.floor(t/this._cellSize)}_${Math.floor(e/this._cellSize)}`}_getRangeBounds(t){if(t instanceof Wt){const e=t.radius,{x:i,y:s}=t.position;return{minX:i-e,maxX:i+e,minY:s-e,maxY:s+e}}if(t instanceof Zt){const{x:e,y:i}=t.position,{width:s,height:n}=t.size;return{minX:e,maxX:e+s,minY:i,maxY:i+n}}return null}_releaseShapes(){this._circlePoolIdx=0,this._rectanglePoolIdx=0}}class gi{checkParticlePositionPlugins;grid;_array;_container;_groupLimits;_limit;_maxZIndex;_minZIndex;_needsSort;_nextId;_particleResetPlugins;_particleUpdatePlugins;_pluginManager;_pool;_postParticleUpdatePlugins;_postUpdatePlugins;_resizeFactor;_updatePlugins;_zArray;constructor(t,e){this._pluginManager=t,this._container=e,this._nextId=0,this._array=[],this._zArray=[],this._pool=[],this._limit=0,this._groupLimits=new Map,this._needsSort=!1,this._minZIndex=0,this._maxZIndex=0,this.grid=new fi(100),this.checkParticlePositionPlugins=[],this._particleResetPlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._postParticleUpdatePlugins=[],this._updatePlugins=[]}get count(){return this._array.length}addParticle(e,i,s,n){const a=this._container.actualOptions.particles.number.limit.mode,o=void 0===s?this._limit:this._groupLimits.get(s)??this._limit,r=this.count;if(o>0)switch(a){case t.LimitMode.delete:{const t=r+1-o;t>0&&this.removeQuantity(t);break}case t.LimitMode.wait:if(r>=o)return}try{const a=this._pool.pop()??new pi(this._pluginManager,this._container);a.init(this._nextId,e,i,s);let o=!0;return n&&(o=n(a)),o?(this._array.push(a),this._zArray.push(a),this._nextId++,this._container.dispatchEvent(t.EventType.particleAdded,{particle:a}),a):void this._pool.push(a)}catch(t){kt().warning(`error adding particle: ${t}`)}}clear(){this._array=[],this._zArray=[]}destroy(){this._array=[],this._pool.length=0,this._zArray=[],this.checkParticlePositionPlugins=[],this._particleResetPlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._postParticleUpdatePlugins=[],this._updatePlugins=[]}drawParticles(t){for(const e of this._zArray)e.draw(t)}filter(t){return this._array.filter(t)}find(t){return this._array.find(t)}get(t){return this._array[t]}async init(){const t=this._container,e=t.actualOptions;this._minZIndex=0,this._maxZIndex=0,this._needsSort=!1,this.checkParticlePositionPlugins=[],this._updatePlugins=[],this._particleUpdatePlugins=[],this._postUpdatePlugins=[],this._particleResetPlugins=[],this._postParticleUpdatePlugins=[],this.grid=new fi(100*t.retina.pixelRatio);for(const e of t.plugins)e.redrawInit&&await e.redrawInit(),e.checkParticlePosition&&this.checkParticlePositionPlugins.push(e),e.update&&this._updatePlugins.push(e),e.particleUpdate&&this._particleUpdatePlugins.push(e),e.postUpdate&&this._postUpdatePlugins.push(e),e.particleReset&&this._particleResetPlugins.push(e),e.postParticleUpdate&&this._postParticleUpdatePlugins.push(e);await this._container.initDrawersAndUpdaters();for(const e of this._container.effectDrawers.values())await(e.init?.(t));for(const e of this._container.shapeDrawers.values())await(e.init?.(t));let i=!1;for(const e of t.plugins)if(i=e.particlesInitialization?.()??i,i)break;if(!i){const t=e.particles,i=t.groups;for(const e in i){const s=i[e];if(s)for(let i=this.count,n=0;n<s.number.value&&i<t.number.value;i++,n++)this.addParticle(void 0,s,e)}for(let e=this.count;e<t.number.value;e++)this.addParticle()}}push(t,e,i,s){for(let n=0;n<t;n++)this.addParticle(e,i,s)}async redraw(){this.clear(),await this.init(),this._container.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this._array.indexOf(t),void 0,e,i)}removeAt(t,e=1,i,s){if(t<0||t>this.count)return;let n=0;for(let a=t;n<e&&a<this.count;a++)this._removeParticle(a,i,s)&&(a--,n++)}removeQuantity(t,e){this.removeAt(0,t,e)}setDensity(){const t=this._container.actualOptions,e=t.particles.groups;let i=0;for(const t of this._container.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in e){const s=e[t];if(!s)continue;const n=De(this._pluginManager,this._container,s);this._applyDensity(n,i,t)}this._applyDensity(t.particles,i)}setLastZIndex(t){this._needsSort||=t>=this._maxZIndex||t>this._minZIndex&&t<this._maxZIndex}setResizeFactor(t){this._resizeFactor=t}update(t){const e=new Set;this.grid.clear();for(const e of this._updatePlugins)e.update?.(t);const i=this._resizeFactor;for(const s of this._array){i&&!s.ignoresResizeRatio&&(s.position.x*=i.width,s.position.y*=i.height,s.initialPosition.x*=i.width,s.initialPosition.y*=i.height),s.ignoresResizeRatio=!1;for(const t of this._particleResetPlugins)t.particleReset?.(s);for(const e of this._particleUpdatePlugins){if(s.destroyed)break;e.particleUpdate?.(s,t)}s.destroyed?e.add(s):this.grid.insert(s)}for(const e of this._postUpdatePlugins)e.postUpdate?.(t);for(const i of this._array)if(i.destroyed)e.add(i);else{for(const e of this._container.particleUpdaters)e.update(i,t);if(i.destroyed||i.spawning)i.destroyed&&e.add(i);else for(const e of this._postParticleUpdatePlugins)e.postParticleUpdate?.(i,t)}if(e.size)for(const t of e)this.remove(t);if(delete this._resizeFactor,this._needsSort){const t=this._zArray;t.sort((t,e)=>e.position.z-t.position.z||t.id-e.id);const e=t[0],i=t[t.length-1];if(!e||!i)return;this._maxZIndex=e.position.z,this._minZIndex=i.position.z,this._needsSort=!1}}_addToPool=(...t)=>{this._pool.push(...t)};_applyDensity=(t,e,i,s)=>{const n=t.number;if(!n.density.enable)return void(void 0===i?this._limit=n.limit.value:(s?.number.limit.value??n.limit.value)&&this._groupLimits.set(i,s?.number.limit.value??n.limit.value));const a=this._initDensityFactor(n.density),o=n.value,r=n.limit.value>0?n.limit.value:o,l=Math.min(o,r)*a+e,c=Math.min(this.count,this.filter(t=>t.group===i).length);void 0===i?this._limit=n.limit.value*a:this._groupLimits.set(i,n.limit.value*a),c<l?this.push(Math.abs(l-c),void 0,t,i):c>l&&this.removeQuantity(c-l,i)};_initDensityFactor=t=>{const e=this._container;if(!e.canvas.element||!t.enable)return 1;const i=e.canvas.element,s=e.retina.pixelRatio;return i.width*i.height/(t.height*t.width*s**2)};_removeParticle=(e,i,s)=>{const n=this._array[e];if(!n)return!1;if(n.group!==i)return!1;const a=this._zArray.indexOf(n);return this._array.splice(e,1),this._zArray.splice(a,1),n.destroy(s),this._container.dispatchEvent(t.EventType.particleRemoved,{particle:n}),this._addToPool(n),!0}}class _i{container;pixelRatio;reduceFactor;constructor(t){this.container=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.container,e=t.actualOptions;this.pixelRatio=e.detectRetina?devicePixelRatio:1,this.reduceFactor=1;const i=this.pixelRatio,s=t.canvas;if(s.element){const t=s.element;s.size.width=t.offsetWidth*i,s.size.height=t.offsetHeight*i}}initParticle(t){const e=t.options,i=this.pixelRatio,s=e.move,n=s.distance,a=t.retina;a.maxSpeed=q(s.gravity.maxSpeed)*i,a.moveDrift=q(s.drift)*i,a.moveSpeed=q(s.speed)*i,a.sizeAnimationSpeed=q(e.size.animation.speed)*i;const o=a.maxDistance;o.horizontal=void 0===n.horizontal?void 0:n.horizontal*i,o.vertical=void 0===n.vertical?void 0:n.vertical*i}}function mi(t){return!t.destroyed}function yi(t,e,...i){const s=new Ce(t,e);return Oe(s,...i),s}var vi=Object.freeze({__proto__:null,Container:class{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;plugins;retina;shapeDrawers;started;zLayers;_delay;_delayTimeout;_delta={value:0,factor:0};_dispatchCallback;_drawAnimationFrame;_duration;_eventListeners;_firstStart;_initialSourceOptions;_lastFrameTime;_lifeTime;_onDestroy;_options;_paused;_pluginManager;_smooth;_sourceOptions;constructor(e){const{dispatchCallback:i,pluginManager:s,id:n,onDestroy:a,sourceOptions:o}=e;this._pluginManager=s,this._dispatchCallback=i,this._onDestroy=a,this.id=Symbol(n),this.fpsLimit=120,this.hdr=!1,this._smooth=!1,this._delay=0,this._duration=0,this._lifeTime=0,this._firstStart=!0,this.started=!1,this.destroyed=!1,this._paused=!0,this._lastFrameTime=0,this.zLayers=100,this.pageHidden=!1,this._sourceOptions=o,this._initialSourceOptions=o,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new _i(this),this.canvas=new hi(this._pluginManager,this),this.particles=new gi(this._pluginManager,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this._options=yi(this._pluginManager,this),this.actualOptions=yi(this._pluginManager,this),this._eventListeners=new ui(this),this.dispatchEvent(t.EventType.containerBuilt)}get animationStatus(){return!this._paused&&!this.pageHidden&&mi(this)}get options(){return this._options}get sourceOptions(){return this._sourceOptions}addLifeTime(t){this._lifeTime+=t}alive(){return!this._duration||this._lifeTime<=this._duration}destroy(e=!0){if(mi(this)){this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.effectDrawers)t.destroy?.(this);for(const[,t]of this.shapeDrawers)t.destroy?.(this);for(const t of this.plugins)t.destroy?.();this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.plugins.length=0,this._pluginManager.clearPlugins(this),this.destroyed=!0,this._onDestroy(e),this.dispatchEvent(t.EventType.containerDestroyed)}}dispatchEvent(t,e){this._dispatchCallback(t,{container:this,data:e})}draw(t){if(!mi(this))return;let e=t;this._drawAnimationFrame=F(t=>{e&&(this._lastFrameTime=void 0,e=!1),this._nextFrame(t)})}async export(t,e={}){for(const i of this.plugins){if(!i.export)continue;const s=await i.export(t,e);if(s.supported)return s.blob}kt().error(`Export plugin with type ${t} not found`)}async init(){if(!mi(this))return;const e=new Map;for(const t of this._pluginManager.plugins){const i=await t.getPlugin(this);i.preInit&&await i.preInit(),e.set(t,i)}await this.initDrawersAndUpdaters(),this._options=yi(this._pluginManager,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=yi(this._pluginManager,this,this._options),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[t,i]of e)t.needsPlugin(this.actualOptions)&&(this.plugins.push(i),i.particleCreated&&this.particleCreatedPlugins.push(i),i.particleDestroyed&&this.particleDestroyedPlugins.push(i),i.particlePosition&&this.particlePositionPlugins.push(i));this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:i,duration:s,fpsLimit:n,hdr:a,smooth:o,zLayers:l}=this.actualOptions;this.hdr=a,this.zLayers=l,this._duration=q(s)*r,this._delay=q(i)*r,this._lifeTime=0,this.fpsLimit=n>0?n:120,this._smooth=o;for(const t of this.plugins)await(t.init?.());await this.particles.init(),this.dispatchEvent(t.EventType.containerInit),this.particles.setDensity();for(const t of this.plugins)t.particlesSetup?.();this.dispatchEvent(t.EventType.particlesSetup)}async initDrawersAndUpdaters(){const t=this._pluginManager;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){if(mi(this)&&(void 0!==this._drawAnimationFrame&&(U(this._drawAnimationFrame),delete this._drawAnimationFrame),!this._paused)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this._paused=!0),this.dispatchEvent(t.EventType.containerPaused)}}play(e){if(!mi(this))return;const i=this._paused||e;if(!this._firstStart||this.actualOptions.autoPlay){if(this._paused&&(this._paused=!1),i)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(t.EventType.containerPlay),this.draw(i??!1)}else this._firstStart=!1}async refresh(){if(mi(this))return this.stop(),this.start()}async reset(t){if(mi(this))return this._initialSourceOptions=t,this._sourceOptions=t,this._options=yi(this._pluginManager,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=yi(this._pluginManager,this,this._options),this.refresh()}async start(){mi(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise(e=>{const i=async()=>{this._eventListeners.addListeners();for(const t of this.plugins)await(t.start?.());this.dispatchEvent(t.EventType.containerStarted),this.play(),e()};this._delayTimeout=setTimeout(()=>{i()},this._delay)}))}stop(){if(mi(this)&&this.started){this._delayTimeout&&(clearTimeout(this._delayTimeout),delete this._delayTimeout),this._firstStart=!0,this.started=!1,this._eventListeners.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const t of this.plugins)t.stop?.();this.particleCreatedPlugins.length=0,this.particleDestroyedPlugins.length=0,this.particlePositionPlugins.length=0,this._sourceOptions=this._options,this.dispatchEvent(t.EventType.containerStopped)}}updateActualOptions(){let t=!1;for(const e of this.plugins)e.updateActualOptions&&(t=e.updateActualOptions()||t);return t}_nextFrame=t=>{try{if(!this._smooth&&void 0!==this._lastFrameTime&&t<this._lastFrameTime+r/this.fpsLimit)return void this.draw(!1);if(this._lastFrameTime??=t,function(t,e,i=60,s=!1){t.value=e,t.factor=s?60/i:60*e/r}(this._delta,t-this._lastFrameTime,this.fpsLimit,this._smooth),this.addLifeTime(this._delta.value),this._lastFrameTime=t,this._delta.value>r)return void this.draw(!1);if(this.canvas.render.drawParticles(this._delta),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){kt().error("error in animation loop",t)}}}});t.AnimatableColor=Jt,t.AnimationOptions=Qt,t.AnimationValueWithRandom=le,t.Background=Kt,t.BaseRange=Nt,t.Circle=Wt,t.ColorAnimation=Gt,t.Fill=se,t.FullScreen=te,t.HslAnimation=Xt,t.Move=pe,t.MoveAngle=ne,t.MoveCenter=ae,t.MoveGravity=oe,t.MovePath=he,t.Opacity=ge,t.OpacityAnimation=fe,t.Options=Ce,t.OptionsColor=Yt,t.OutModes=ue,t.Paint=me,t.ParticlesBounce=ve,t.ParticlesBounceFactor=ye,t.ParticlesDensity=Pe,t.ParticlesNumber=be,t.ParticlesNumberLimit=we,t.ParticlesOptions=Ie,t.RangedAnimationOptions=jt,t.RangedAnimationValueWithRandom=ce,t.Rectangle=Zt,t.ResizeEvent=ee,t.Shape=xe,t.Size=ze,t.SizeAnimation=Se,t.Spin=de,t.Stroke=_e,t.ValueWithRandom=re,t.Vector=z,t.Vector3d=S,t.ZIndex=Me,t.alterHsl=ni,t.animate=F,t.areBoundsInside=gt,t.arrayRandomIndex=pt,t.calcExactPositionOrRandomFromSize=tt,t.calcExactPositionOrRandomFromSizeRanged=function(t){const e={x:void 0!==t.position?.x?q(t.position.x):void 0,y:void 0!==t.position?.y?q(t.position.y):void 0};return tt({size:t.size,position:e})},t.calcPositionFromSize=function(t){return void 0!==t.position?.x&&void 0!==t.position.y?{x:t.position.x*t.size.width/a,y:t.position.y*t.size.height/a}:void 0},t.calcPositionOrRandomFromSize=K,t.calcPositionOrRandomFromSizeRanged=function(t){const e={x:void 0!==t.position?.x?q(t.position.x):void 0,y:void 0!==t.position?.y?q(t.position.y):void 0};return K({size:t.size,position:e})},t.calculateBounds=_t,t.cancelAnimation=U,t.canvasFirstIndex=0,t.canvasTag=g,t.checkDistance=j,t.circleBounce=function(t,e){const{x:i,y:s}=t.velocity.sub(e.velocity),[n,a]=[t.position,e.position],{dx:o,dy:r}=Z(a,n);if(i*o+s*r<0)return;const l=-Math.atan2(r,o),c=t.mass,h=e.mass,u=t.velocity.rotate(l),d=e.velocity.rotate(l),p=J(u,d,c,h),f=J(d,u,c,h),g=p.rotate(-l),_=f.rotate(-l);t.velocity.x=g.x*t.factor.x,t.velocity.y=g.y*t.factor.y,e.velocity.x=_.x*e.factor.x,e.velocity.y=_.y*e.factor.y},t.circleBounceDataFromParticle=function(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:z.create(q(t.options.bounce.horizontal.value),q(t.options.bounce.vertical.value))}},t.clamp=V,t.clear=ke,t.cloneStyle=xt,t.collisionVelocity=J,t.colorMix=ti,t.colorToHsl=function(t,e,i,s=!0){const n=We(t,e,i,s);return n?Qe(n):void 0},t.colorToRgb=We,t.countOffset=1,t.decayOffset=1,t.deepExtend=mt,t.defaultAlpha=1,t.defaultAngle=0,t.defaultCompositeValue=i,t.defaultDensityFactor=1,t.defaultFps=60,t.defaultFpsLimit=120,t.defaultLoops=0,t.defaultOpacity=1,t.defaultRatio=1,t.defaultReduceFactor=1,t.defaultRemoveQuantity=1,t.defaultRetryCount=0,t.defaultRgbMin=0,t.defaultTime=0,t.defaultTransform=c,t.defaultTransformValue=1,t.defaultVelocity=0,t.defaultZoom=1,t.degToRad=G,t.deleteCount=1,t.double=2,t.doublePI=d,t.drawAfterEffect=Ee,t.drawBeforeEffect=Le,t.drawParticle=Ae,t.drawParticlePlugin=Be,t.drawShape=Fe,t.drawShapeAfterDraw=Ue,t.drawShapeBeforeDraw=Ve,t.empty=0,t.executeOnSingleOrMultiple=yt,t.findItemFromSingleOrMultiple=function(t,e){return C(t)?t.find((t,i)=>e(t,i)):e(t,0)?t:void 0},t.generatedAttribute=e,t.generatedFalse=f,t.generatedTrue=p,t.getDistance=function(t,e){return Math.sqrt(Q(t,e))},t.getDistanceSq=Q,t.getDistances=Z,t.getFullScreenStyle=St,t.getHslAnimationFromHsl=function(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:m},s:{enable:!1,value:t.s,min:0,max:y},l:{enable:!1,value:t.l,min:0,max:v}};return e&&(ii(s.h,e.h,i),ii(s.s,e.s,i),ii(s.l,e.l,i)),s},t.getHslFromAnimation=ei,t.getItemMapFromInitializer=It,t.getItemsFromInitializer=Mt,t.getLinkColor=function(t,e,i){if(i===h)return Xe();if(i!==u)return i;{const i=t.getFillColor()??t.getStrokeColor(),s=e?.getFillColor()??e?.getStrokeColor();if(i&&s&&e)return ti(i,s,t.getRadius(),e.getRadius());{const t=i??s;if(t)return Ge(t)}}},t.getLinkRandomColor=function(t,e,i,s){const n=I(e)?e:e.value;return n===h?s?Ne(t,{value:n}):i?h:u:n===u?u:Ne(t,{value:n})},t.getLogger=kt,t.getParticleBaseVelocity=Y,t.getParticleDirectionAngle=X,t.getPosition=bt,t.getRandom=E,t.getRandomInRange=L,t.getRandomRgbColor=Xe,t.getRangeMax=N,t.getRangeMin=H,t.getRangeValue=q,t.getSize=function(t,e){return wt(t,e)},t.getStyleFromHsl=Ke,t.getStyleFromRgb=Ye,t.hMax=m,t.hMin=0,t.hPhase=60,t.half=o,t.hasMatchMedia=lt,t.hslToRgb=Ge,t.hslaToRgba=function(t){const e=Ge(t);return{a:t.a,b:e.b,g:e.g,r:e.r}},t.identity=1,t.initParticleNumericAnimationValue=Pt,t.inverseFactorNumerator=1,t.isArray=C,t.isBoolean=M,t.isFunction=function(t){return"function"==typeof t},t.isInArray=dt,t.isNull=R,t.isNumber=O,t.isObject=D,t.isPointInside=function(t,e,i,s,n){return gt(_t(t,s??0),e,i,n)},t.isString=I,t.itemFromArray=ft,t.itemFromSingleOrMultiple=vt,t.lFactor=1,t.lMax=v,t.lMin=0,t.lengthOffset=1,t.loadMinIndex=0,t.loadOptions=Oe,t.loadParticlesOptions=De,t.loadRandomFactor=1e4,t.manageListener=zt,t.memoize=rt,t.midColorValue=u,t.millisecondsToSeconds=r,t.minCount=0,t.minFpsLimit=0,t.minIndex=0,t.minLimit=0,t.minStrokeWidth=0,t.minVelocity=0,t.minZ=0,t.minimumSize=0,t.mix=B,t.none=0,t.one=1,t.originPoint=l,t.paintBase=Re,t.paintImage=Te,t.parseAlpha=function(t){return t?t.endsWith("%")?parseFloat(t)/a:parseFloat(t):1},t.percentDenominator=a,t.phaseNumerator=1,t.quarter=P,t.randomColorValue=h,t.randomInRangeValue=$,t.rangeColorToHsl=Ze,t.rangeColorToRgb=Ne,t.removeDeleteCount=1,t.removeMinIndex=0,t.resizeEvent=s,t.rgbMax=_,t.rgbToHsl=Qe,t.sMax=y,t.sMin=0,t.sNormalizedOffset=1,t.safeDocument=ct,t.safeIntersectionObserver=function(t){if("undefined"!=typeof IntersectionObserver)return new IntersectionObserver(t)},t.safeMatchMedia=ht,t.safeMutationObserver=ut,t.setAnimationFunctions=function(t,e){A.nextFrame=t,A.cancel=e},t.setLogger=function(t){t.debug&&(Tt.debug=Rt(t.debug)),t.error&&(Tt.error=Rt(t.error)),t.info&&(Tt.info=Rt(t.info)),t.log&&(Tt.log=Rt(t.log)),t.trace&&(Tt.trace=Rt(t.trace)),t.verbose&&(Tt.verbose=Rt(t.verbose)),t.warning&&(Tt.warning=Rt(t.warning))},t.setRandom=function(t=Math.random){k=t},t.setRangeValue=W,t.sextuple=6,t.spatialHashGridCellSize=100,t.squareExp=2,t.stringToAlpha=function(t,e){return He(t,e)?.a},t.stringToRgb=je,t.threeQuarter=w,t.triple=3,t.tryCountIncrement=1,t.tsParticles=ai,t.updateAnimation=function(e,i,s,n,a){if(e.destroyed||!i.enable||(i.maxLoops??0)>0&&(i.loops??0)>(i.maxLoops??0))return;const o=(i.velocity??0)*a.factor,r=i.min,l=i.max,c=i.decay??1;if(i.time??=0,(i.delayTime??0)>0&&i.time<(i.delayTime??0)&&(i.time+=a.value),!((i.delayTime??0)>0&&i.time<(i.delayTime??0))){switch(i.status){case t.AnimationStatus.increasing:i.value+=o;break;case t.AnimationStatus.decreasing:i.value-=o}switch(i.velocity&&1!==c&&(i.velocity*=c),i.status){case t.AnimationStatus.increasing:i.value>=l&&(s?i.status=t.AnimationStatus.decreasing:i.value-=l,i.loops??=0,i.loops++);break;case t.AnimationStatus.decreasing:i.value<=r&&(s?i.status=t.AnimationStatus.increasing:i.value+=l,i.loops??=0,i.loops++)}!function(e,i,s,n,a){switch(i){case t.DestroyType.max:s>=a&&e.destroy();break;case t.DestroyType.min:s<=n&&e.destroy()}}(e,n,i.value,r,l),e.destroyed||(i.value=V(i.value,r,l))}},t.updateColor=function(t,e){if(!t)return;const{h:i,s:s,l:n}=t;si(i,!1,e),si(s,!0,e),si(n,!0,e)},t.updateColorValue=si,t.visibilityChangeEvent=n,t.zIndexFactorOffset=1}),Object.assign(globalThis.window||globalThis,{tsParticles:(globalThis.__tsParticlesInternals.engine||{}).tsParticles}),delete(globalThis.window||globalThis).tsparticlesInternalExports;