@tsparticles/engine
Version:
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.
1 lines • 70.8 kB
JavaScript
!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=t=>(...e)=>{t(...e)},i={debug:e(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:e(console.info),log:e(console.log),trace:e(console.trace),verbose:e(console.log),warning:e(console.warn)};function s(t){t.debug&&(i.debug=e(t.debug)),t.error&&(i.error=e(t.error)),t.info&&(i.info=e(t.info)),t.log&&(i.log=e(t.log)),t.trace&&(i.trace=e(t.trace)),t.verbose&&(i.verbose=e(t.verbose)),t.warning&&(i.warning=e(t.warning))}function n(){return i}var a;t.MoveDirection=void 0,(a=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",a.bottomLeft="bottom-left",a.bottomRight="bottom-right",a.left="left",a.none="none",a.right="right",a.top="top",a.topLeft="top-left",a.topRight="top-right",a.outside="outside",a.inside="inside";const r="generated",o="source-over",l="resize",c="visibilitychange",h=100,d=.5,u=1e3,p={x:0,y:0,z:0},f={a:1,b:0,c:0,d:1},g="random",m="mid",y=2*Math.PI,v="true",P="false",w="canvas",x=255,b=360,M=100,z=100,S=.25,C=.75,D=400;function k(t){return"z"in t?t.z:p.z}class I{x;y;z;constructor(t=p.x,e=p.y,i=p.z){this.x=t,this.y=e,this.z=i}static get origin(){return I.create(p.x,p.y,p.z)}get angle(){return Math.atan2(this.y,this.x)}set angle(t){this.#t(t,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(t){this.#t(this.angle,t)}static clone(t){return I.create(t.x,t.y,k(t))}static create(t,e,i){return"number"==typeof t?new I(t,e??p.y,i??p.z):new I(t.x,t.y,k(t))}add(t){return I.create(this.x+t.x,this.y+t.y,this.z+k(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=k(t)}copy(){return I.clone(this)}div(t){return I.create(this.x/t,this.y/t,this.z/t)}getLengthSq(){return this.x**2+this.y**2}mult(t){return I.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 I.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),p.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=k(t)}sub(t){return I.create(this.x-t.x,this.y-t.y,this.z-k(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=k(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class O extends I{constructor(t=p.x,e=p.y){super(t,e,p.z)}static get origin(){return O.create(p.x,p.y)}static clone(t){return O.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new O(t,e??p.y):new O(t.x,t.y)}}function L(t){return"boolean"==typeof t}function _(t){return"string"==typeof t}function R(t){return"number"==typeof t}function T(t){return"object"==typeof t&&null!==t}function E(t){return Array.isArray(t)}function F(t){return null==t}const A=Math.PI/180;let B=Math.random;const U={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function V(t=Math.random){B=t}function $(){return B}function H(){return j(B(),0,1-Number.EPSILON)}function W(t,e){return H()*(e-t)+t}function q(t){return U.nextFrame(t)}function N(t){U.cancel(t)}function j(t,e,i){return Math.min(Math.max(t,e),i)}function X(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function Y(t){const e=Z(t);let i=Q(t);return e===i&&(i=0),W(i,e)}function G(t){return R(t)?t:Y(t)}function Q(t){return R(t)?t:t.min}function Z(t){return R(t)?t:t.max}function K(t,e){if(t===e||void 0===e&&R(t))return t;const i=Q(t),s=Z(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:K(i,s)}function J(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}}function tt(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function et(t,e,i){return tt(t,e)<=i*i}function it(t){return t*A}function st(e,i,s){if(R(e))return it(e);switch(e){case t.MoveDirection.top:return-Math.PI*d;case t.MoveDirection.topRight:return-Math.PI*S;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*S;case t.MoveDirection.bottom:return Math.PI*d;case t.MoveDirection.bottomLeft:return Math.PI*C;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*C;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 H()*y}}function nt(t){const e=O.origin;return e.length=1,e.angle=t,e}function at(t,e,i,s){return O.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function rt(t){return{x:(t.position?.x??H()*h)*t.size.width/h,y:(t.position?.y??H()*h)*t.size.height/h}}function ot(t){const{position:e,size:i}=t;return{x:e?.x??H()*i.width,y:e?.y??H()*i.height}}var lt,ct;t.OutModeDirection=void 0,(lt=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",lt.left="left",lt.right="right",lt.top="top",t.PixelMode=void 0,(ct=t.PixelMode||(t.PixelMode={})).precise="precise",ct.percent="percent";function ht(){return globalThis.document}function dt(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function ut(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function pt(t,e){return t===e||E(e)&&e.includes(t)}function ft(t,e,i=!0){return t[void 0!==e&&i?e%t.length:Math.floor(H()*t.length)]}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 mt(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function yt(t,...e){for(const i of e){if(F(i))continue;if(!T(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):T(t)&&!Array.isArray(t)||(t=Object.create(null));const e=Object.keys(i);if(!e.some(t=>{const e=i[t];return T(e)||Array.isArray(e)})){const s=i,n=t;for(const t of e){if("__proto__"===t||"constructor"===t||"prototype"===t)continue;const e=s[t];void 0!==e&&(n[t]=e)}continue}for(const s of e){if("__proto__"===s||"constructor"===s||"prototype"===s)continue;const e=t,n=i[s];e[s]=Array.isArray(n)?n.map(t=>yt(void 0,t)):yt(e[s],n)}}return t}function vt(t,e){return E(t)?t.map((t,i)=>e(t,i)):e(t,0)}function Pt(t,e,i){return E(t)?ft(t,e,i):t}function wt(e,i){return function(e,i){if(e.mode!==t.PixelMode.percent){const{mode:t,...i}=e;return i}return"x"in e?{x:e.x/h*i.width,y:e.y/h*i.height}:{width:e.width/h*i.width,height:e.height/h*i.height}}(e,i)}function xt(t){const e=ht().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||F(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}let bt,Mt;function zt(t){if(bt!==t||!Mt){bt=t;const e=ht().createElement("div").style,i=10,s={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(i),"z-index":t.toString(i),top:"0",left:"0","pointer-events":"none"};for(const t in s){const i=s[t];void 0!==i&&e.setProperty(t,i)}Mt=e}return Mt}function St(t,e,i,s,n){if(s){let s={passive:!0};L(n)?s.capture=n:void 0!==n&&(s=n),t.addEventListener(e,i,s)}else{const s=n;t.removeEventListener(e,i,s)}}async function Ct(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 Dt(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 kt{#e;constructor(){this.#e=new Map}addEventListener(t,e){this.removeEventListener(t,e);let i=this.#e.get(t);i||(i=[],this.#e.set(t,i)),i.push(e)}dispatchEvent(t,e){const i=this.#e.get(t);i?.forEach(t=>{t(e)})}hasEventListener(t){return!!this.#e.get(t)}removeAllEventListeners(t){t?this.#e.delete(t):this.#e=new Map}removeEventListener(t,e){const i=this.#e.get(t);if(!i)return;const s=i.length,n=i.indexOf(e);n<0||(1===s?this.#e.delete(t):i.splice(n,1))}}var It;t.EventType=void 0,(It=t.EventType||(t.EventType={})).configAdded="configAdded",It.containerInit="containerInit",It.particlesSetup="particlesSetup",It.containerStarted="containerStarted",It.containerStopped="containerStopped",It.containerDestroyed="containerDestroyed",It.containerPaused="containerPaused",It.containerPlay="containerPlay",It.containerBuilt="containerBuilt",It.particleAdded="particleAdded",It.particleDestroyed="particleDestroyed",It.particleRemoved="particleRemoved";class Ot{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;#i=new Set;#s=new Map;#n;#a=new Set;#r=!1;#o=!1;#l=new Set;constructor(t){this.#n=t}get configs(){const t={};for(const[e,i]of this.#s)t[e]=i;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(e){const i=e.key??e.name??"default";this.#s.set(i,e),this.#n.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 Dt(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 Dt(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return Ct(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this.#r&&!this.#o){this.#o=!0,this.#a=new Set,this.#i=new Set(this.#l);try{for(const t of this.#i)await this.#c(t,this.#a,this.#i)}finally{this.#l.clear(),this.#o=!1,this.#r=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}async register(...t){if(this.#r)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this.#o?await this.#c(e,this.#a,this.#i):this.#l.add(e)}async#c(t,e,i){e.has(t)||(e.add(t),i.add(t),await t(this.#n))}}const Lt="100%";class _t{pluginManager=new Ot(this);#h=[];#d=new kt;#r=!1;get items(){return this.#h}get version(){return"4.3.0"}addEventListener(t,e){this.#d.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.#d.dispatchEvent(t,e)}async init(){this.#r||(await this.pluginManager.init(),this.#r=!0)}item(t){const e=this.items,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){let e;await this.init(),"undefined"!=typeof HTMLElement&&t.element instanceof HTMLElement&&(e=t.element);const{Container:i}=await Promise.resolve().then(function(){return fi}),s=t.id??e?.id??`tsparticles${Math.floor(1e4*H()).toString()}`,{index:a,url:o}=t,l=o?await async function(t){const e=Pt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(n().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:o,index:a}):t.options,c=Pt(l,a),{items:h}=this,d=h.findIndex(t=>t.id.description===s),u=new i({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:s,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(u);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:c});if(d>=0){const t=this.item(d),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),h.splice(d,e,u)}else h.push(u);const p="undefined"!=typeof OffscreenCanvas&&t.element instanceof OffscreenCanvas?t.element:(t=>{const e=ht();let i;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===w)i=t,i.dataset[r]??=P,i.dataset[r]===v&&(i.style.width||=Lt,i.style.height||=Lt,i.style.pointerEvents="none",i.style.setProperty("pointer-events","none"));else{const s=t.getElementsByTagName(w).item(0);s?(i=s,i.dataset[r]=P):(i=e.createElement(w),i.dataset[r]=v,t.appendChild(i)),i.style.width||=Lt,i.style.height||=Lt,i.style.pointerEvents="none",i.style.setProperty("pointer-events","none")}return i})(((t,e)=>{const i=ht();let s=e??i.getElementById(t);return s||(s=i.createElement("canvas"),s.id=t,s.dataset[r]=v,i.body.append(s),s)})(s,e));return u.canvas.loadCanvas(p),await u.start(),u}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this.#d.removeEventListener(t,e)}}var Rt,Tt,Et,Ft,At,Bt,Ut,Vt,$t,Ht,Wt,qt;!function(t){t.circle="circle",t.rectangle="rectangle"}(Rt||(Rt={}));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 jt extends Nt{radius;constructor(t,e,i){super(t,e,Rt.circle),this.radius=i}contains(t){return et(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 jt||t.type===Rt.circle){return s+t.radius>Math.hypot(n,a)}if(t instanceof Xt||t.type===Rt.rectangle){const e=t,{width:i,height:r}=e.size;return Math.pow(n-i,2)+Math.pow(a-r,2)<=s**2||n<=s+i&&a<=s+r||n<=i||a<=r}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Xt extends Nt{size;constructor(t,e,i,s){super(t,e,Rt.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 jt)return t.intersects(this);if(!(t instanceof Xt))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,a=t.size,r=a.width,o=a.height;return n.x<s.x+e&&n.x+r>s.x&&n.y<s.y+i&&n.y+o>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,(Tt=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Tt.counterClockwise="counter-clockwise",Tt.random="random",t.AnimationMode=void 0,(Et=t.AnimationMode||(t.AnimationMode={})).auto="auto",Et.increase="increase",Et.decrease="decrease",Et.random="random",t.LimitMode=void 0,(Ft=t.LimitMode||(t.LimitMode={})).delete="delete",Ft.wait="wait",t.OutMode=void 0,(At=t.OutMode||(t.OutMode={})).bounce="bounce",At.none="none",At.out="out",At.destroy="destroy",At.split="split",t.AlterType=void 0,(Bt=t.AlterType||(t.AlterType={})).darken="darken",Bt.enlighten="enlighten",t.DestroyType=void 0,(Ut=t.DestroyType||(t.DestroyType={})).none="none",Ut.max="max",Ut.min="min",t.GradientType=void 0,(Vt=t.GradientType||(t.GradientType={})).linear="linear",Vt.radial="radial",Vt.random="random",t.ParticleOutType=void 0,($t=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",$t.inside="inside",$t.outside="outside",t.StartValueType=void 0,(Ht=t.StartValueType||(t.StartValueType={})).max="max",Ht.min="min",Ht.random="random",t.AnimationStatus=void 0,(Wt=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",Wt.decreasing="decreasing",t.DrawLayer=void 0,(qt=t.DrawLayer||(t.DrawLayer={}))[qt.BackgroundElement=0]="BackgroundElement",qt[qt.BackgroundDraw=1]="BackgroundDraw",qt[qt.BackgroundMask=2]="BackgroundMask",qt[qt.CanvasSetup=3]="CanvasSetup",qt[qt.PluginContent=4]="PluginContent",qt[qt.Particles=5]="Particles",qt[qt.CanvasCleanup=6]="CanvasCleanup",qt[qt.Foreground=7]="Foreground";class Yt{load(t){F(t)||this.doLoad(t)}}function Gt(t,...e){for(const i of e)t.load(i)}function Qt(t,e,i){void 0!==i&&(t[e]=i)}function Zt(t,e,i){void 0!==i&&(t[e]=K(i))}function Kt(t,e,i){void 0!==i&&t[e].load(i)}function Jt(t,e,i,s){if(void 0!==i){const n=t;n[e]??=s(),n[e].load(i)}}class te extends Yt{count=0;decay=0;delay=0;enable=!1;speed=1;sync=!1;doLoad(t){Zt(this,"count",t.count),Qt(this,"enable",t.enable),Zt(this,"speed",t.speed),Zt(this,"decay",t.decay),Zt(this,"delay",t.delay),Qt(this,"sync",t.sync)}}class ee extends te{mode=t.AnimationMode.auto;startValue=t.StartValueType.random;doLoad(t){super.doLoad(t),Qt(this,"mode",t.mode),Qt(this,"startValue",t.startValue)}}class ie extends te{max;min;offset=0;sync=!0;constructor(t,e){super(),this.min=t,this.max=e}doLoad(t){super.doLoad(t),Qt(this,"max",t.max),Qt(this,"min",t.min),Zt(this,"offset",t.offset)}}class se extends Yt{h=new ie(0,b);l=new ie(0,z);s=new ie(0,M);doLoad(t){this.h.load(t.h),this.s.load(t.s),this.l.load(t.l)}}class ne extends Yt{value="";static create(t,e){const i=new ne;return i.load(t),void 0!==e&&(_(e)||E(e)?i.load({value:e}):i.load(e)),i}doLoad(t){F(t.value)||(this.value=t.value)}}class ae extends ne{animation=new se;static create(t,e){const i=new ae;return i.load(t),void 0!==e&&(_(e)||E(e)?i.load({value:e}):i.load(e)),i}doLoad(t){super.doLoad(t);const e=t.animation;void 0!==e&&(void 0===e.enable?this.animation.load(t.animation):this.animation.h.load(e))}}class re extends Yt{color;draw;element;image="";opacity=1;position="";repeat="";size="";constructor(){super(),this.color=new ne,this.color.value=""}doLoad(t){void 0!==t.color&&(this.color=ne.create(this.color,t.color)),Qt(this,"element",t.element),Qt(this,"draw",t.draw),Qt(this,"image",t.image),Qt(this,"position",t.position),Qt(this,"repeat",t.repeat),Qt(this,"size",t.size),Qt(this,"opacity",t.opacity)}}class oe extends Yt{enable=!0;zIndex=0;doLoad(t){Qt(this,"enable",t.enable),Qt(this,"zIndex",t.zIndex)}}class le extends Yt{delay=.5;enable=!0;doLoad(t){Qt(this,"delay",t.delay),Qt(this,"enable",t.enable)}}class ce extends Yt{close=!0;options={};type=[];doLoad(t){const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=yt(this.options[t]??{},i))}Qt(this,"close",t.close),Qt(this,"type",t.type)}}class he extends Yt{color;enable=!0;opacity=1;doLoad(t){void 0!==t.color&&(this.color=ae.create(this.color,t.color)),Qt(this,"enable",t.enable),Zt(this,"opacity",t.opacity)}}class de extends Yt{offset=0;value=90;doLoad(t){Zt(this,"offset",t.offset),Zt(this,"value",t.value)}}class ue extends Yt{mode=t.PixelMode.percent;radius=0;x=50;y=50;doLoad(t){Qt(this,"x",t.x),Qt(this,"y",t.y),Qt(this,"mode",t.mode),Qt(this,"radius",t.radius)}}class pe extends Yt{acceleration=9.81;enable=!1;inverse=!1;maxSpeed=50;doLoad(t){Zt(this,"acceleration",t.acceleration),Qt(this,"enable",t.enable),Qt(this,"inverse",t.inverse),Zt(this,"maxSpeed",t.maxSpeed)}}class fe extends Yt{value=0;doLoad(t){F(t.value)||(this.value=K(t.value))}}class ge extends fe{animation=new te;doLoad(t){super.doLoad(t),Kt(this,"animation",t.animation)}}class me extends Yt{clamp=!0;delay=new fe;enable=!1;generator;options={};doLoad(t){Qt(this,"clamp",t.clamp),this.delay.load(t.delay),Qt(this,"enable",t.enable),this.generator=t.generator,t.options&&(this.options=yt(this.options,t.options))}}class ye extends Yt{bottom;default=t.OutMode.out;left;right;top;doLoad(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 ve extends Yt{acceleration=0;enable=!1;position;doLoad(t){Zt(this,"acceleration",t.acceleration),Qt(this,"enable",t.enable),t.position&&(this.position=yt({},t.position))}}class Pe extends Yt{angle=new de;center=new ue;decay=0;direction=t.MoveDirection.none;distance={};drift=0;enable=!1;gravity=new pe;outModes=new ye;path=new me;random=!1;size=!1;speed=2;spin=new ve;straight=!1;vibrate=!1;warp=!1;doLoad(t){this.angle.load(R(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),Zt(this,"decay",t.decay),Qt(this,"direction",t.direction),void 0!==t.distance&&(this.distance=R(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),Zt(this,"drift",t.drift),Qt(this,"enable",t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(T(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),Qt(this,"random",t.random),Qt(this,"size",t.size),Zt(this,"speed",t.speed),this.spin.load(t.spin),Qt(this,"straight",t.straight),Qt(this,"vibrate",t.vibrate),Qt(this,"warp",t.warp)}}class we extends Yt{color;opacity;width=0;doLoad(t){void 0!==t.color&&(this.color=ae.create(this.color,t.color)),Zt(this,"width",t.width),Zt(this,"opacity",t.opacity)}}class xe extends Yt{color;fill;stroke;doLoad(t){void 0!==t.color&&(this.color=ae.create(this.color,t.color)),Jt(this,"fill",t.fill,()=>new he),Jt(this,"stroke",t.stroke,()=>new we)}}class be extends fe{value=1}class Me extends Yt{horizontal=new be;vertical=new be;doLoad(t){this.horizontal.load(t.horizontal),this.vertical.load(t.vertical)}}class ze extends Yt{enable=!1;height=1080;width=1920;doLoad(t){Qt(this,"enable",t.enable),Qt(this,"width",t.width),Qt(this,"height",t.height)}}class Se extends Yt{mode=t.LimitMode.delete;value=0;doLoad(t){Qt(this,"mode",t.mode),Qt(this,"value",t.value)}}class Ce extends Yt{density=new ze;limit=new Se;value=0;doLoad(t){this.density.load(t.density),this.limit.load(t.limit),Qt(this,"value",t.value)}}class De extends Yt{close=!0;options={};type="circle";doLoad(t){const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=yt(this.options[t]??{},i))}Qt(this,"close",t.close),Qt(this,"type",t.type)}}class ke extends fe{opacityRate=1;sizeRate=1;velocityRate=1;doLoad(t){super.doLoad(t),Qt(this,"opacityRate",t.opacityRate),Qt(this,"sizeRate",t.sizeRate),Qt(this,"velocityRate",t.velocityRate)}}class Ie extends Yt{bounce=new Me;effect=new ce;groups={};move=new Pe;number=new Ce;paint;palette;reduceDuplicates=!1;shape=new De;zIndex=new ke;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.paint=new xe,this.paint.color=new ae,this.paint.color.value="#fff",this.paint.fill=new he,this.paint.fill.enable=!0}doLoad(t){if(t.palette&&(this.palette=t.palette,this.#f(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]=yt(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);const e=t.paint;if(e&&(E(e)?this.paint=vt(e,t=>{const e=new xe;return e.load(t),e}):E(this.paint)?(this.paint=new xe,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#u){for(const e of this.#p.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this.#u,this,t);const e=this.#p.updaters.get(this.#u);if(e)for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}#f(t){const e=this.#p.getPalette(t);if(!e)return;const i=e.colors,s=(E(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,...i){const s=new Ie(t,e);return Gt(s,...i),s}class Le extends Yt{autoPlay=!0;background;clear=!0;defaultThemes={};delay=0;detectRetina=!0;duration=0;fpsLimit=120;fullScreen;hdr=!0;key;name;palette;particles;pauseOnBlur=!0;pauseOnOutsideViewport=!0;preset;resize;smooth=!1;style={};zLayers=100;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.background=new re,this.fullScreen=new oe,this.particles=Oe(this.#p,this.#u),this.resize=new le}doLoad(t){void 0!==t.preset&&(this.preset=t.preset,vt(this.preset,t=>{this.#g(t)})),void 0!==t.palette&&(this.palette=t.palette,this.#f(this.palette)),Qt(this,"autoPlay",t.autoPlay),Qt(this,"clear",t.clear),Qt(this,"key",t.key),Qt(this,"name",t.name),Zt(this,"delay",t.delay),Qt(this,"detectRetina",t.detectRetina),Zt(this,"duration",t.duration),Qt(this,"fpsLimit",t.fpsLimit),Qt(this,"hdr",t.hdr),Qt(this,"pauseOnBlur",t.pauseOnBlur),Qt(this,"pauseOnOutsideViewport",t.pauseOnOutsideViewport),Qt(this,"zLayers",t.zLayers),this.background.load(t.background);const e=t.fullScreen;L(e)?this.fullScreen.enable=e:this.fullScreen.load(e),this.particles.load(t.particles),this.resize.load(t.resize),this.style=yt(this.style,t.style),Qt(this,"smooth",t.smooth),this.#p.plugins.forEach(e=>{e.loadOptions(this.#u,this,t)})}#f(t){const e=this.#p.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})}#g(t){this.load(this.#p.getPreset(t))}}const _e=new Map;function Re(t,e){let i=_e.get(t);return i||(i=e(),_e.size>2e3&&_e.clear(),_e.set(t,i)),i}function Te(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function Ee(t,e,i,s=!0){if(!e)return;const n=_(e)?{value:e}:e;if(_(n.value))return Fe(t,n.value,i,s);if(E(n.value)){const e=ft(n.value,i,s);if(!e)return;return Ee(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function Fe(t,e,i,s=!0){if(!e)return;const n=_(e)?{value:e}:e;if(_(n.value))return n.value===g?We():Ue(t,n.value);if(E(n.value)){const e=ft(n.value,i,s);if(!e)return;return Fe(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Ae(t,e,i,s=!0){const n=Ee(t,e,i,s);return n?Be(n):void 0}function Be(t){const e=t.r/x,i=t.g/x,s=t.b/x,n=Math.max(e,i,s),a=Math.min(e,i,s),r={h:0,l:(n+a)*d,s:0};return n!==a&&(r.s=r.l<d?(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*=z,r.s*=M,r.h*=60,r.h<0&&(r.h+=b),r.h>=b&&(r.h-=b),r}function Ue(t,e){return Te(t,e)}function Ve(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}function $e(t){const e=(t.h%b+b)%b,i=Math.max(0,Math.min(M,t.s)),s=Math.max(0,Math.min(z,t.l)),n=e/b,a=i/M,r=s/z;if(0===i){const t=Math.round(r*x);return{r:t,g:t,b:t}}const o=r<d?r*(1+a):r+a-r*a,l=2*r-o,c=1/3,h=Math.min(x,x*Ve(l,o,n+c)),u=Math.min(x,x*Ve(l,o,n)),p=Math.min(x,x*Ve(l,o,n-c));return{r:Math.round(h),g:Math.round(u),b:Math.round(p)}}function He(t){const e=(t.h%b+b)%b,i=Math.max(0,Math.min(M,t.s)),s=Math.max(0,Math.min(z,t.l)),n=e/b,a=i/M,r=s/z;if(0===i){const t=r*x;return{r:t,g:t,b:t}}const o=r<d?r*(1+a):r+a-r*a,l=2*r-o,c=1/3;return{r:Math.min(x,x*Ve(l,o,n+c)),g:Math.min(x,x*Ve(l,o,n)),b:Math.min(x,x*Ve(l,o,n-c))}}function We(t,e){const i=t??0;if(e)return{r:W(i,x),g:W(i,x),b:W(i,x)};const s=()=>Math.floor(W(i,256));return{b:s(),g:s(),r:s()}}function qe(t,e,i){const s=e?4:2,n=i??1;return Re(`rgb-${t.r.toFixed(s)}-${t.g.toFixed(s)}-${t.b.toFixed(s)}-${e?"hdr":"sdr"}-${n.toString()}`,()=>e?function(t,e,i=400){const s=i/203;return`color(display-p3 ${(t.r/x*s).toString()} ${(t.g/x*s).toString()} ${(t.b/x*s).toString()} / ${(e??1).toString()})`}(t,i):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(t,i))}function Ne(t,e,i){const s=e?4:2,n=i??1;return Re(`hsl-${t.h.toFixed(s)}-${t.s.toFixed(s)}-${t.l.toFixed(s)}-${e?"hdr":"sdr"}-${n.toString()}`,()=>e?qe(He(t),!0,i):`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${n.toString()})`)}function je(t,e,i,s){let n=t,a=e;return"r"in n||(n=$e(t)),"r"in a||(a=$e(e)),{b:X(n.b,a.b,i,s),g:X(n.g,a.g,i,s),r:X(n.r,a.r,i,s)}}function Xe(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function Ye(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=G(i.speed)/h*s,e.decay=1-G(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=G(i.count),e.time=0,e.delayTime=G(i.delay)*u,i.sync||(e.velocity*=H(),e.value*=H()),e.initialValue=e.value,e.offset=K(i.offset)):e.velocity=0}function Ge(e,i,s,n){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 a=e.offset?Y(e.offset):0,r=((e.velocity??0)*s.factor+3.6*a)*(n?.5075:1),o=e.decay??1,l=e.max,c=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=r,e.value<c&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=r,e.value>l&&(e.loops??=0,e.loops++,i?e.status=t.AnimationStatus.decreasing:e.value-=l)),e.velocity&&1!==o&&(e.velocity*=o),e.value=j(e.value,c,l)}function Qe(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const Ze=new _t,Ke=globalThis;Ke.__tsParticlesInternals=Ke.__tsParticlesInternals??{},Ke.tsParticles=Ze,Ke.getParticlesLogger=n,Ke.setParticlesLogger=s,Ke.getParticlesRandom=H,Ke.getParticlesRandomFn=$,Ke.setParticlesRandom=V;function Je(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class ti{#m;#y;#v;#P;#w;#u;#x;#b;#M;#z;#S;#C;#p;#D;#k;#I={};#O=[void 0,void 0];#L={};constructor(t,e,i){this.#p=t,this.#u=e,this.#P=i,this.#x=null,this.#m=null,this.#y=new Set,this.#k=[],this.#D=[],this.#v=[],this.#w=[],this.#M=[],this.#z=[],this.#S=[],this.#C={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[]}}get settings(){return this.#b}canvasClear(){this.#u.actualOptions.clear&&this.draw(t=>{t.clearRect(p.x,p.y,this.#P.size.width,this.#P.size.height)})}clear(){for(const t of this.#v)if(t.canvasClear?.())return;for(const e of Object.values(t.DrawLayer))if("number"==typeof e)for(const t of this.#_(e))if(t.canvasClear?.())return;this.canvasClear()}destroy(){this.stop(),this.#m=null,this.#y.clear(),this.#k=[],this.#D=[],this.#v=[],this.#w=[],this.#M=[],this.#z=[],this.#S=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#C[e]=[])}draw(t){const e=this.#x;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,r]=this.#R(t);if(a??=s,r??=n,!a&&!r)return;const o=this.#u,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:h,opacity:d,strokeOpacity:u}=t.getOpacity(),p=this.#L,f=this.#I,g=a?Ne(a,o.hdr,h*d):void 0,m=r?Ne(r,o.hdr,u*d):g;p.a=p.b=p.c=p.d=void 0,f.fill=g,f.stroke=m,this.draw(s=>{for(const i of this.#S)i.drawParticleSetup?.(s,t,e);this.#T(s,t,i,d,f,p),this.#E({container:o,context:s,particle:t,delta:e,colorStyles:f,radius:i*c**l.sizeRate,opacity:d,transform:p}),this.#F(t);for(const i of this.#z)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this.#M)this.#A(i,s,t,e)})}drawParticles(e){const{particles:i,actualOptions:s}=this.#u;this.clear(),i.update(e),this.draw(n=>{const a=this.#P.size.width,r=this.#P.size.height;if(this.#m)try{n.drawImage(this.#m,p.x,p.y,a,r)}catch{this.#B("background-element-draw-error","Error drawing background element onto canvas")}const o=s.background;if(o.draw)try{o.draw(n,e)}catch{this.#B("background-draw-error","Error in background.draw callback")}for(const e of this.#_(t.DrawLayer.BackgroundMask))e.canvasPaint?.();for(const i of this.#_(t.DrawLayer.CanvasSetup))i.drawSettingsSetup?.(n,e);for(const i of this.#_(t.DrawLayer.PluginContent))i.draw?.(n,e);i.drawParticles(e);for(const i of this.#_(t.DrawLayer.CanvasCleanup))i.clearDraw?.(n,e),i.drawSettingsCleanup?.(n,e)})}init(){this.initUpdaters(),this.initPlugins(),this.#U(),this.paint()}initPlugins(){this.#v=[],this.#w=[],this.#M=[],this.#S=[],this.#z=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#C[e]=[]);for(const e of this.#u.plugins)(e.particleFillColor??e.particleStrokeColor)&&this.#w.push(e),e.drawParticle&&this.#M.push(e),e.drawParticleSetup&&this.#S.push(e),e.drawParticleCleanup&&this.#z.push(e),e.canvasClear&&this.#v.push(e),e.canvasPaint&&this.#_(t.DrawLayer.BackgroundMask).push(e),e.drawSettingsSetup&&this.#_(t.DrawLayer.CanvasSetup).push(e),e.draw&&this.#_(t.DrawLayer.PluginContent).push(e),(e.clearDraw??e.drawSettingsCleanup)&&this.#_(t.DrawLayer.CanvasCleanup).push(e)}initUpdaters(){this.#k=[],this.#D=[];for(const t of this.#u.particleUpdaters)t.afterDraw&&this.#D.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#k.push(t)}paint(){let e=!1;for(const i of this.#_(t.DrawLayer.BackgroundMask))if(e=i.canvasPaint?.()??!1,e)break;e||this.paintBase()}paintBase(t){this.draw(e=>{e.fillStyle=t??"rgba(0,0,0,0)",e.fillRect(p.x,p.y,this.#P.size.width,this.#P.size.height)})}paintImage(t,e){this.draw(i=>{if(!t)return;const s=i.globalAlpha;i.globalAlpha=e,i.drawImage(t,p.x,p.y,this.#P.size.width,this.#P.size.height),i.globalAlpha=s})}setContext(t){this.#x=t,this.#x&&(this.#x.globalCompositeOperation=o)}setContextSettings(t){this.#b=t}stop(){this.draw(t=>{t.clearRect(p.x,p.y,this.#P.size.width,this.#P.size.height)})}#F(t){for(const e of this.#D)e.afterDraw?.(t)}#T(t,e,i,s,n,a){for(const r of this.#k){if(r.getColorStyles){const{fill:a,stroke:o}=r.getColorStyles(e,t,i,s);a&&(n.fill=a),o&&(n.stroke=o)}if(r.getTransformValues){const t=r.getTransformValues(e);for(const e in t)Je(a,t,e)}r.beforeDraw?.(e)}}#V(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}#$(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}#E(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:r,opacity:o,transform:l}=t,{effectDrawers:c,shapeDrawers:h}=e,d=s.getPosition(),u=s.getTransformData(l),p={x:d.x,y:d.y};i.setTransform(u.a,u.b,u.c,u.d,d.x,d.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 m={context:i,particle:s,radius:r,drawRadius:1*r,opacity:o,delta:n,pixelRatio:e.retina.pixelRatio,fill:f,stroke:g>0,transformData:u,position:{...d},drawPosition:p,drawScale:1};for(const t of e.plugins)t.drawParticleTransform?.(m);const y=s.effect?c.get(s.effect):void 0,v=s.shape?h.get(s.shape):void 0;this.#$(y,m),this.#H(v,m),this.#W(v,m),this.#q(v,m),this.#V(y,m),i.resetTransform()}#A(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}#W(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())}#q(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}#H(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}#_(t){return this.#C[t]}#R(t){let e,i;for(const s of this.#w)if(!e&&s.particleFillColor&&(e=Ae(this.#p,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=Ae(this.#p,s.particleStrokeColor(t))),e&&i)break;return this.#O[0]=e,this.#O[1]=i,this.#O}#U(){const t=this.#u.actualOptions.background;if(this.#m=null,t.element)if("string"==typeof t.element){if("undefined"!=typeof document){const e=document.querySelector(t.element);e instanceof HTMLCanvasElement||e instanceof HTMLVideoElement||e instanceof HTMLImageElement?this.#m=e:e?this.#B("background-element-not-supported",`Background element "${t.element}" is not a supported drawable element (canvas, video, or img)`):this.#B("background-element-not-found",`Background element selector "${t.element}" not found`)}}else(t.element instanceof HTMLCanvasElement||t.element instanceof OffscreenCanvas||t.element instanceof HTMLVideoElement||t.element instanceof HTMLImageElement)&&(this.#m=t.element)}#B(t,e){this.#y.has(t)||(this.#y.add(t),n().warning(e))}}const ei=new WeakMap;function ii(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 si{domElement;render;renderCanvas;size;zoom=1;#u;#N;#j;#X;#p;#Y;#G;#Q;#Z;constructor(t,e){this.#p=t,this.#u=e,this.render=new ti(t,e,this),this.#Q={height:0,width:0};const i=e.retina.pixelRatio,s=this.#Q;this.size={height:s.height*i,width:s.width*i},this.#N=!1,this.#G=[],this.#Y="none"}get#K(){return this.#u.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this.#N){const t=this.domElement;t?.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this.#J();this.render.destroy(),this.#G=[]}getZoomCenter(){const t=this.#u.retina.pixelRatio,{width:e,height:i}=this.size;return this.#Z?this.#Z:{x:e*d/t,y:i*d/t}}init(){this.#tt(t=>{t.disconnect()}),this.#j=ut(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this.#et()}),this.resize(),this.#it(),this.initBackground(),this.#tt(t=>{const e=this.domElement;e&&e instanceof Node&&t.observe(e,{attributes:!0})}),this.initPlugins(),this.#st(),this.render.init()}initBackground(){const t=this.#u,e=t.actualOptions.background,i=this.domElement;if(!i)return;const s=i.style,n=Ee(this.#p,e.color);s.backgroundColor=n?qe(n,t.actualOptions.hdr,e.opacity):"",s.backgroundImage=e.image||"",s.backgroundPosition=e.position||"",s.backgroundRepeat=e.repeat||"",s.backgroundSize=e.size||""}initPlugins(){this.#G=[];for(const t of this.#u.plugins)t.resize&&this.#G.push(t)}loadCanvas(t){this.#N&&this.domElement&&this.domElement.remove();const e=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=e,this.#N=!!e&&"true"===e.dataset[r],this.renderCanvas=e?(t=>{const e=ei.get(t);if(e)return e;if("function"!=typeof t.transferControlToOffscreen)throw new TypeError("OffscreenCanvas is required but not supported by this browser");try{const e=t.transferControlToOffscreen();return ei.set(t,e),e}catch{throw new TypeError("OffscreenCanvas transfer failed")}})(e):t;const i=this.domElement;i&&(i.ariaHidden="true",this.#X=xt(i.style));const s=this.#Q,n=this.renderCanvas;i?(s.height=i.offsetHeight,s.width=i.offsetWidth):(s.height=n.height,s.width=n.width);const a=this.#u.retina.pixelRatio,o=this.size;n.height=o.height=s.height*a,n.width=o.width=s.width*a}resize(){const t=this.domElement;if(!t)return!1;const e=this.#u,i=this.renderCanvas;if(void 0===i)return!1;const s=e.canvas.#Q,n={width:t.offsetWidth,height:t.offsetHeight},a=e.retina.pixelRatio,r={width:n.width*a,height:n.height*a};if(n.height===s.height&&n.width===s.width&&r.height===i.height&&r.width===i.width)return!1;const o={...s};s.height=n.height,s.width=n.width;const l=this.size;return i.width=l.width=r.width,i.height=l.height=r.height,this.#u.started&&e.particles.setResizeFactor({width:s.width/o.width,height:s.height/o.height}),!0}setPointerEvents(t){this.domElement&&(this.#Y=t,this.#et())}setZoom(t,e){this.zoom=t,this.#Z=e}stop(){this.#tt(t=>{t.disconnect()}),this.#j=void 0,this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#u,e=t.updateActualOptions();t.particles.setDensity(),this.#nt(),e&&await t.refresh()}#nt(){for(const t of this.#G)t.resize?.()}#st(){const t=this.#u.actualOptions.hdr&&dt("(color-gamut: p3)")?.matches&&dt("(dynamic-range: high)")?.matches;this.render.setContextSettings({alpha:!0,desynchronized:!0,willReadFrequently:!1,...t?{colorSpace:"display-p3",colorType:"float16"}:{colorSpace:"srgb"}});const e=this.renderCanvas;e&&this.render.setContext(e.getContext("2d",this.render.settings))}#it(){const t=this.domElement,e=this.#u.actualOptions;if(t){this.#K?this.#at():this.#J();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")}}}#et(){const t=this.domElement;if(!t)return;this.#tt(t=>{t.disconnect()}),this.#it(),this.initBackground();const e=this.#Y;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this.#tt(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})}#J(){const t=this.domElement,e=this.#X;t&&e&&ii(t,e,!0)}#tt(t){this.#j&&t(this.#j)}#at(){const t=this.domElement;t&&ii(t,zt(this.#u.actualOptions.fullScreen.zIndex),!0)}}class ni{#u;#rt;#ot;#lt;constructor(t){this.#u=t,this.#rt={visibilityChange:()=>{this.#ct()},resize:()=>{this.#ht()}}}addListeners(){this.#dt(!0)}removeListeners(){this.#dt(!1)}#ct(){const t=this.#u;t.actualOptions.pauseOnBlur&&(ht().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))}#ht(){this.#lt&&(clearTimeout(this.#lt),this.#lt=void 0);const t=async()=>{const t=this.#u.canvas;await t.windowResize()};this.#lt=setTimeout(()=>{t()},this.#u.actualOptions.resize.delay*u)}#dt(t){const e=this.#rt;this.#ut(t),St(document,c,e.visibilityChange,t,!1)}#ut(t){const e=this.#rt,i=this.#u;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void St(globalThis,l,e.resize,t);const s=i.canvas.domElement;this.#ot&&!t?(s&&this.#ot.unobserve(s),this.#ot.disconnect(),this.#ot=void 0):!this.#ot&&t&&s&&(this.#ot=new ResizeObserver(t=>{t.find(t=>t.target===s)&&this.#ht()}),this.#ot.observe(s))}}function ai(t){if(!pt(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)}function ri(t,e){const i=t%e;return i<0?i+e:i}function oi(t,e,i,s){const n=Oe(i,e,e.actualOptions.particles),a=n.reduceDuplicates;t.effect=Pt(n.effect.type,t.id,a),t.shape=Pt(n.shape.type,t.id,a);const r=n.effect,o=n.shape;if(s){if(s.effect){const e=s.effect.type;if(e&&e!==t.effect){const i=Pt(e,t.id,a);i&&(t.effect=i)}r.load(s.effect)}if(s.shape){const e=s.shape.type;if(e&&e!==t.shape){const i=Pt(e,t.id,a);i&&(t.shape=i)}o.load(s.shape)}}if(t.effect===g){const i=[...e.effectDrawers.keys()];t.effect=i[Math.floor(H()*i.length)]}if(t.shape===g){const i=[...e.shapeDrawers.keys()];t.shape=i[Math.floor(H()*i.length)]}t.effectData=t.effect?function(t,e,i,s){const n=e.options[t];return yt({close:e.close},Pt(n,i,s))}(t.effect,r,t.id,a):void 0,t.shapeData=t.shape?function(t,e,i,s){const n=e.options[t];return yt({close:e.close},Pt(n,i,s))}(t.shape,o,t.id,a):void 0,n.load(s);const l=t.effectData,c=t.shapeData;return l&&n.load(l.particles),c&&n.load(c.particles),t.effectClose=l?.close??n.effect.close,t.shapeClose=c?.close??n.shape.close,n}class li{backColor;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;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;#pt={fillOpacity:1,opacity:1,strokeOpacity:1};#ft=I.origin;#gt={sin:0,cos:0};#mt={a:1,b:0,c:0,d:1};#u;#yt=[];#p;constructor(t,e){this.#p=t,this.#u=e}addModifier(t){this.#yt.push(t),this.#yt.sort((t,e)=>t.priority-e.priority)}clearModifiers(){this.#yt.length=0}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.clearModifiers();const i=this.#u,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.#u.dispatchEvent(t.EventType.particleDestroyed,{particle:this})}draw(t){const e=this.#u.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this.#vt(this.#Pt(Xe(this.fillColor),t=>t.fillColor))}getMass(){return this.getRadius()**2*Math.PI*d}getModifier(t){return this.#yt.find(e=>e.id===t)}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=G(this.opacity?.value??1),s=this.#Pt(void 0,t=>t.opacity)??i,n=this.fillOpacity??1,a=this.strokeOpacity??1;return this.#pt.fillOpacity=s*n*e,this.#pt.opacity=s*e,this.#pt.strokeOpacity=s*a*e,this.#pt}getPosition(){return this.#ft.x=this.position.x+this.offset.x,this.#ft.y=this.position.y+this.offset.y,this.#ft.z=this.position.z,this.#ft}getRadius(){return this.#Pt(this.size.value,t=>t.radius)}getRotateData(){const t=this.getAngle();return this.#gt.sin=Math.sin(t),this.#gt.cos=Math.cos(t),this.#gt}getStrokeColor(){return this.#vt(this.#Pt(Xe(this.strokeColor),t=>t.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this.#mt.a=e.cos*(t.a??f.a),this.#mt.b=i?e.sin*(t.b??1):t.b??f.b,this.#mt.c=i?-e.sin*(t.c??1):t.c??f.c,this.#mt.d=e.cos*(t.d??f.d),this.#mt}init(e,i,s,n){const a=this.#u;!function(e,i,s){e.id=i,e.group=s,e.justWarped=!1,e.effectClose=!0,e.shapeClose=!0,e.pathRotation=!1,e.lastPathTime=0,e.destroyed=!1,e.unbreakable=!1,e.isRotating=!1,e.rotation=0,e.misplaced=!1,e.retina={maxDistance:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},e.size={value:1,max:1,min:1,enable:!1},e.outType=t.ParticleOutType.normal,e.ignoresResizeRatio=!0}(this,e,n),this.options=oi(this,a,this.#p,s),a.retina.initParticle(this),function(t,e){for(const i of t)i.preInit?.(e)}(a.particleUpdaters,this),this.#wt(i),this.initialVelocity=this.#xt(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/a.zLayers,this.sides=24,function(t,e){let i,s;t.effect&&(i=e.effectDrawers.get(t.effect)),i?.loadEffect&&i.loadEffect(t),t.shape&&(s=e.shapeDrawers.get(t.shape)),s?.loadShape&&s.loadShape(t);const n=s?.getSidesCount;n&&(t.sides=n(t))}(this,a),this.spawning=!1,function(t,e){for(const i of t)i.init(e)}(a.particleUpdaters,this),function(t,e){const i=e.shape?t.shapeDrawers.get(e.shape):void 0,s=e.effect?t.effectDrawers.get(e.effect):void 0;s?.particleInit?.(t,e),i?.particleInit?.(t,e)}(a,this),function(t,e){for(const i of t.particleCreatedPlugins)i.particleCreated?.(e)}(a,this)}isInsideCanvas(t){return this.#bt({direction:t}).inside}isInsideCanvasForOutMode(t,e){return this.#bt({direction:e,outMode:t}).inside}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const e=ri(t,y);return e>=Math.PI*d&&e<3*Math.PI*d}if(this.roll.horizontal){const e=ri(t+Math.PI*d,y);return e>=Math.PI&&e<2*Math.PI}if(this.roll.vertical){const e=ri(t,y);return e>=Math.PI&&e<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}removeModifier(t){const e=this.#yt.findIndex(e=>e.id===t);e>=0&&this.#yt.splice(e,1)}reset(){for(const t of this.#u.particleUpdaters)t.reset?.(this)}#Pt(t,e){let i=t;for(const t of this.#yt)if(t.enabled){const s=e(t);void 0!==s&&(i=s)}return i}#Mt(t,e){let i=0,s=t?I.create(t.x,t.y,e):void 0;const n=this.#u,a=n.particlePositionPlugins,r=this.options.move.outModes,o=this.getRadius(),l=n.canvas.size;for(;;){for(const t of a){const i=t.particlePosition?.(s,this);if(i)return I.create(i.x,i.y,e)}const t=ot({size:l,position:s}),c=I.create(t.x,t.y,e);this.#zt(c,o,r.left??r.default),this.#zt(c,o,r.right??r.default),this.#St(c,o,r.top??r.default),this.#St(c,o,r.bottom??r.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}}#xt(){const e=this.options.move,i=nt(this.direction).copy();if(e.direction===t.MoveDirection.inside||e.direction===t.MoveDirection.outside)return i;const s=it(G(e.angle.value)),n=it(G(e.angle.offset)),a={left:n-s*d,right:n+s*d};return e.straight||(i.angle+=Y(K(a.left,a.right))),e.random&&"number"==typeof e.speed&&(i.length*=H()),i}#zt(e,i,s){ai({outMode:s,checkModes:[t.OutMode.bounce],coord:e.x,maxCoord:this.#u.canvas.size.width,setCb:t=>e.x+=t,radius:i})}#St(e,i,s){ai({outMode:s,checkModes:[t.OutMode.bounce],coord:e.y,maxCoord:this.#u.canvas.size.height,setCb:t=>e.y+=t,radius:i})}#Ct(e,i){const s=this.getRadius(),n=this.#u.canvas.size,a=this.position,r=i===t.OutMode.bounce;return e===t.