@tsparticles/fireworks
Version:
tsParticles fireworks bundle — easily create spectacular fireworks and fountain particle effects with built-in presets. Ready to use components available for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.
1 lines • 128 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.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.bundles.fireworks=t.__tsParticlesInternals.bundles.fireworks||{}))}(this,function(t){"use strict";const e="generated",i="source-over",s="resize",n="visibilitychange",o=100,a=.5,r=1e3,l={x:0,y:0,z:0},c={a:1,b:0,c:0,d:1},h="random",d="mid",u=2*Math.PI,p="true",f="false",g="canvas",m=255,y=360,v=100,w=100,P=.25,b=.75;var x;function M(t){return"z"in t?t.z:l.z}t.MoveDirection=void 0,(x=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",x.bottomLeft="bottom-left",x.bottomRight="bottom-right",x.left="left",x.none="none",x.right="right",x.top="top",x.topLeft="top-left",x.topRight="top-right",x.outside="outside",x.inside="inside";class z{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 z.create(l.x,l.y,l.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 z.create(t.x,t.y,M(t))}static create(t,e,i){return"number"==typeof t?new z(t,e??l.y,i??l.z):new z(t.x,t.y,M(t))}add(t){return z.create(this.x+t.x,this.y+t.y,this.z+M(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=M(t)}copy(){return z.clone(this)}div(t){return z.create(this.x/t,this.y/t,this.z/t)}getLengthSq(){return this.x**2+this.y**2}mult(t){return z.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 z.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=M(t)}sub(t){return z.create(this.x-t.x,this.y-t.y,this.z-M(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=M(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class C extends z{constructor(t=l.x,e=l.y){super(t,e,l.z)}static get origin(){return C.create(l.x,l.y)}static clone(t){return C.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new C(t,e??l.y):new C(t.x,t.y)}}function S(t){return"boolean"==typeof t}function O(t){return"string"==typeof t}function k(t){return"number"==typeof t}function D(t){return"function"==typeof t}function I(t){return"object"==typeof t&&null!==t}function F(t){return Array.isArray(t)}function R(t){return null==t}const E=Math.PI/180;let _=Math.random;const T={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function A(){return U(_(),0,1-Number.EPSILON)}function L(t,e){return A()*(e-t)+t}function B(t){return T.nextFrame(t)}function V(t){T.cancel(t)}function U(t,e,i){return Math.min(Math.max(t,e),i)}function G(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function $(t){const e=H(t);let i=N(t);return e===i&&(i=0),L(i,e)}function W(t){return k(t)?t:$(t)}function N(t){return k(t)?t:t.min}function H(t){return k(t)?t:t.max}function q(t,e){if(t===e||void 0===e&&k(t))return t;const i=N(t),s=H(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:q(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 X(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function Y(t,e){return Math.sqrt(X(t,e))}function Q(t,e,i){return X(t,e)<=i*i}function Z(t){return t*E}function K(e,i,s){if(k(e))return Z(e);switch(e){case t.MoveDirection.top:return-Math.PI*a;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*a;case t.MoveDirection.bottomLeft:return Math.PI*b;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*b;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 A()*u}}function J(t){const e=C.origin;return e.length=1,e.angle=t,e}function tt(t,e,i,s){return C.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function et(t){return{x:(t.position?.x??A()*o)*t.size.width/o,y:(t.position?.y??A()*o)*t.size.height/o}}function it(t){const e={x:void 0!==t.position?.x?W(t.position.x):void 0,y:void 0!==t.position?.y?W(t.position.y):void 0};return et({size:t.size,position:e})}function st(t){const{position:e,size:i}=t;return{x:e?.x??A()*i.width,y:e?.y??A()*i.height}}function nt(t){return t?t.endsWith("%")?parseFloat(t)/o:parseFloat(t):1}var ot,at;t.OutModeDirection=void 0,(ot=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",ot.left="left",ot.right="right",ot.top="top",t.PixelMode=void 0,(at=t.PixelMode||(t.PixelMode={})).precise="precise",at.percent="percent";function rt(){return globalThis.document}function lt(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function ct(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function ht(t,e){return t===e||F(e)&&e.includes(t)}function dt(t,e,i=!0){return t[void 0!==e&&i?e%t.length:Math.floor(A()*t.length)]}function ut(t,e,i,s,n){return pt(ft(t,s??0),e,i,n)}function pt(e,i,s,n){let o=!0;return n&&n!==t.OutModeDirection.bottom||(o=e.top<i.height+s.x),!o||n&&n!==t.OutModeDirection.left||(o=e.right>s.x),!o||n&&n!==t.OutModeDirection.right||(o=e.left<i.width+s.y),!o||n&&n!==t.OutModeDirection.top||(o=e.bottom>s.y),o}function ft(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function gt(t,...e){for(const i of e){if(R(i))continue;if(!I(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):I(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 I(e)||Array.isArray(e)})){const n=i,o=t;for(const t of e)if(!s.has(t)&&t in n){const e=n[t];void 0!==e&&(o[t]=e)}continue}for(const n of e){if(s.has(n))continue;const e=t,o=i[n];e[n]=Array.isArray(o)?o.map(t=>gt(void 0,t)):gt(e[n],o)}}return t}function mt(t,e){return F(t)?t.map((t,i)=>e(t,i)):e(t,0)}function yt(t,e,i){return F(t)?dt(t,e,i):t}function vt(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/o*i.width,y:e.y/o*i.height}:{width:e.width/o*i.width,height:e.height/o*i.height}}(e,i)}function wt(t){const e=rt().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 o=t.getPropertyPriority?.(s);o?e.setProperty(s,n,o):e.setProperty(s,n)}return e}let Pt,bt;function xt(t){if(Pt!==t||!bt){Pt=t;const e=rt().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)}bt=e}return bt}function Mt(t,e,i,s,n){if(s){let s={passive:!0};S(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 zt(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 Ct(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 St{#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 Ot;t.EventType=void 0,(Ot=t.EventType||(t.EventType={})).configAdded="configAdded",Ot.containerInit="containerInit",Ot.particlesSetup="particlesSetup",Ot.containerStarted="containerStarted",Ot.containerStopped="containerStopped",Ot.containerDestroyed="containerDestroyed",Ot.containerPaused="containerPaused",Ot.containerPlay="containerPlay",Ot.containerBuilt="containerBuilt",Ot.particleAdded="particleAdded",Ot.particleDestroyed="particleDestroyed",Ot.particleRemoved="particleRemoved";class kt{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;#o=new Set;#a=!1;#r=!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 Ct(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 Ct(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return zt(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this.#a&&!this.#r){this.#r=!0,this.#o=new Set,this.#i=new Set(this.#l);try{for(const t of this.#i)await this.#c(t,this.#o,this.#i)}finally{this.#l.clear(),this.#r=!1,this.#a=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}async register(...t){if(this.#a)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this.#r?await this.#c(e,this.#o,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 Dt=t=>(...e)=>{t(...e)},It={debug:Dt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:Dt(console.info),log:Dt(console.log),trace:Dt(console.trace),verbose:Dt(console.log),warning:Dt(console.warn)};function Ft(){return It}const Rt="100%";class Et{pluginManager=new kt(this);#h=[];#d=new St;#a=!1;get items(){return this.#h}get version(){return"4.2.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.#a||(await this.pluginManager.init(),this.#a=!0)}item(t){const e=this.items,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){let i;await this.init(),"undefined"!=typeof HTMLElement&&t.element instanceof HTMLElement&&(i=t.element);const{Container:s}=await Promise.resolve().then(function(){return gn}),n=t.id??i?.id??`tsparticles${Math.floor(1e4*A()).toString()}`,{index:o,url:a}=t,r=a?await async function(t){const e=yt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(Ft().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:a,index:o}):t.options,l=yt(r,o),{items:c}=this,h=c.findIndex(t=>t.id.description===n),d=new s({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:n,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(d);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:l});if(h>=0){const t=this.item(h),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),c.splice(h,e,d)}else c.push(d);const u="undefined"!=typeof OffscreenCanvas&&t.element instanceof OffscreenCanvas?t.element:(t=>{const i=rt();let s;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===g)s=t,s.dataset[e]??=f,s.dataset[e]===p&&(s.style.width||=Rt,s.style.height||=Rt,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const n=t.getElementsByTagName(g).item(0);n?(s=n,s.dataset[e]=f):(s=i.createElement(g),s.dataset[e]=p,t.appendChild(s)),s.style.width||=Rt,s.style.height||=Rt,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(((t,i)=>{const s=rt();let n=i??s.getElementById(t);return n||(n=s.createElement("canvas"),n.id=t,n.dataset[e]=p,s.body.append(n),n)})(n,i));return d.canvas.loadCanvas(u),await d.start(),d}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this.#d.removeEventListener(t,e)}}var _t,Tt,At,Lt,Bt,Vt,Ut,Gt,$t,Wt,Nt;!function(t){t.circle="circle",t.rectangle="rectangle"}(_t||(_t={}));class Ht{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 qt extends Ht{radius;constructor(t,e,i){super(t,e,_t.circle),this.radius=i}contains(t){return Q(t,this.position,this.radius)}intersects(t){const e=this.position,i=t.position,s=this.radius,n=Math.abs(i.x-e.x),o=Math.abs(i.y-e.y);if(t instanceof qt||t.type===_t.circle){return s+t.radius>Math.hypot(n,o)}if(t instanceof jt||t.type===_t.rectangle){const e=t,{width:i,height:a}=e.size;return Math.pow(n-i,2)+Math.pow(o-a,2)<=s**2||n<=s+i&&o<=s+a||n<=i||o<=a}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class jt extends Ht{size;constructor(t,e,i,s){super(t,e,_t.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 qt)return t.intersects(this);if(!(t instanceof jt))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,o=t.size,a=o.width,r=o.height;return n.x<s.x+e&&n.x+a>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,(Tt=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Tt.counterClockwise="counter-clockwise",Tt.random="random",t.AnimationMode=void 0,(At=t.AnimationMode||(t.AnimationMode={})).auto="auto",At.increase="increase",At.decrease="decrease",At.random="random",t.LimitMode=void 0,(Lt=t.LimitMode||(t.LimitMode={})).delete="delete",Lt.wait="wait",t.OutMode=void 0,(Bt=t.OutMode||(t.OutMode={})).bounce="bounce",Bt.none="none",Bt.out="out",Bt.destroy="destroy",Bt.split="split",t.AlterType=void 0,(Vt=t.AlterType||(t.AlterType={})).darken="darken",Vt.enlighten="enlighten",t.DestroyType=void 0,(Ut=t.DestroyType||(t.DestroyType={})).none="none",Ut.max="max",Ut.min="min",t.GradientType=void 0,(Gt=t.GradientType||(t.GradientType={})).linear="linear",Gt.radial="radial",Gt.random="random",t.ParticleOutType=void 0,($t=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",$t.inside="inside",$t.outside="outside",t.StartValueType=void 0,(Wt=t.StartValueType||(t.StartValueType={})).max="max",Wt.min="min",Wt.random="random",t.AnimationStatus=void 0,(Nt=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",Nt.decreasing="decreasing";class Xt{load(t){R(t)||this.doLoad(t)}}function Yt(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]=q(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)}}function te(t,e,i,...s){const n=t;n[e]??=new i;const o=n[e];for(const t of s)o.load(t?.[e])}class ee extends Xt{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 ie extends ee{mode=t.AnimationMode.auto;startValue=t.StartValueType.random;doLoad(t){super.doLoad(t),Qt(this,"mode",t.mode),Qt(this,"startValue",t.startValue)}}class se extends ee{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 ne extends Xt{h=new se(0,y);l=new se(0,w);s=new se(0,v);doLoad(t){this.h.load(t.h),this.s.load(t.s),this.l.load(t.l)}}class oe extends Xt{value="";static create(t,e){const i=new oe;return i.load(t),void 0!==e&&(O(e)||F(e)?i.load({value:e}):i.load(e)),i}doLoad(t){R(t.value)||(this.value=t.value)}}class ae extends oe{animation=new ne;static create(t,e){const i=new ae;return i.load(t),void 0!==e&&(O(e)||F(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 Xt{color;image="";opacity=1;position="";repeat="";size="";constructor(){super(),this.color=new oe,this.color.value=""}doLoad(t){void 0!==t.color&&(this.color=oe.create(this.color,t.color)),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 le extends Xt{enable=!0;zIndex=0;doLoad(t){Qt(this,"enable",t.enable),Qt(this,"zIndex",t.zIndex)}}class ce extends Xt{delay=.5;enable=!0;doLoad(t){Qt(this,"delay",t.delay),Qt(this,"enable",t.enable)}}class he extends Xt{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]=gt(this.options[t]??{},i))}Qt(this,"close",t.close),Qt(this,"type",t.type)}}class de extends Xt{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 ue extends Xt{offset=0;value=90;doLoad(t){Zt(this,"offset",t.offset),Zt(this,"value",t.value)}}class pe extends Xt{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 fe extends Xt{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 ge extends Xt{value=0;doLoad(t){R(t.value)||(this.value=q(t.value))}}class me extends ge{animation=new ee;doLoad(t){super.doLoad(t),Kt(this,"animation",t.animation)}}class ye extends me{animation=new ie}class ve extends Xt{clamp=!0;delay=new ge;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=gt(this.options,t.options))}}class we extends Xt{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 Pe extends Xt{acceleration=0;enable=!1;position;doLoad(t){Zt(this,"acceleration",t.acceleration),Qt(this,"enable",t.enable),t.position&&(this.position=gt({},t.position))}}class be extends Xt{angle=new ue;center=new pe;decay=0;direction=t.MoveDirection.none;distance={};drift=0;enable=!1;gravity=new fe;outModes=new we;path=new ve;random=!1;size=!1;speed=2;spin=new Pe;straight=!1;vibrate=!1;warp=!1;doLoad(t){this.angle.load(k(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=k(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&&(I(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 xe extends Xt{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 Me extends Xt{color;fill;stroke;doLoad(t){void 0!==t.color&&(this.color=ae.create(this.color,t.color)),Jt(this,"fill",t.fill,()=>new de),Jt(this,"stroke",t.stroke,()=>new xe)}}class ze extends ge{value=1}class Ce extends Xt{horizontal=new ze;vertical=new ze;doLoad(t){this.horizontal.load(t.horizontal),this.vertical.load(t.vertical)}}class Se extends Xt{enable=!1;height=1080;width=1920;doLoad(t){Qt(this,"enable",t.enable),Qt(this,"width",t.width),Qt(this,"height",t.height)}}class Oe extends Xt{mode=t.LimitMode.delete;value=0;doLoad(t){Qt(this,"mode",t.mode),Qt(this,"value",t.value)}}class ke extends Xt{density=new Se;limit=new Oe;value=0;doLoad(t){this.density.load(t.density),this.limit.load(t.limit),Qt(this,"value",t.value)}}class De extends Xt{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]=gt(this.options[t]??{},i))}Qt(this,"close",t.close),Qt(this,"type",t.type)}}class Ie extends ge{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 Fe extends Xt{bounce=new Ce;effect=new he;groups={};move=new be;number=new ke;paint;palette;reduceDuplicates=!1;shape=new De;zIndex=new Ie;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.paint=new Me,this.paint.color=new ae,this.paint.color.value="#fff",this.paint.fill=new de,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]=gt(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&&(F(e)?this.paint=mt(e,t=>{const e=new Me;return e.load(t),e}):F(this.paint)?(this.paint=new Me,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=(F(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 Re(t,e,...i){const s=new Fe(t,e);return Yt(s,...i),s}class Ee extends Xt{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 le,this.particles=Re(this.#p,this.#u),this.resize=new ce}doLoad(t){void 0!==t.preset&&(this.preset=t.preset,mt(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;S(e)?this.fullScreen.enable=e:this.fullScreen.load(e),this.particles.load(t.particles),this.resize.load(t.resize),this.style=gt(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 Te(t,e){let i=_e.get(t);return i||(i=e(),_e.size>2e3&&_e.clear(),_e.set(t,i)),i}function Ae(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function Le(t,e,i,s=!0){if(!e)return;const n=O(e)?{value:e}:e;if(O(n.value))return Be(t,n.value,i,s);if(F(n.value)){const e=dt(n.value,i,s);if(!e)return;return Le(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function Be(t,e,i,s=!0){if(!e)return;const n=O(e)?{value:e}:e;if(O(n.value))return n.value===h?He():Ge(t,n.value);if(F(n.value)){const e=dt(n.value,i,s);if(!e)return;return Be(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Ve(t,e,i,s=!0){const n=Le(t,e,i,s);return n?Ue(n):void 0}function Ue(t){const e=t.r/m,i=t.g/m,s=t.b/m,n=Math.max(e,i,s),o=Math.min(e,i,s),r={h:0,l:(n+o)*a,s:0};return n!==o&&(r.s=r.l<a?(n-o)/(n+o):(n-o)/(2-n-o),r.h=e===n?(i-s)/(n-o):i===n?2+(s-e)/(n-o):4+(e-i)/(n-o)),r.l*=w,r.s*=v,r.h*=60,r.h<0&&(r.h+=y),r.h>=y&&(r.h-=y),r}function Ge(t,e){return Ae(t,e)}function $e(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 We(t){const e=(t.h%y+y)%y,i=Math.max(0,Math.min(v,t.s)),s=Math.max(0,Math.min(w,t.l)),n=e/y,o=i/v,r=s/w;if(0===i){const t=Math.round(r*m);return{r:t,g:t,b:t}}const l=r<a?r*(1+o):r+o-r*o,c=2*r-l,h=1/3,d=Math.min(m,m*$e(c,l,n+h)),u=Math.min(m,m*$e(c,l,n)),p=Math.min(m,m*$e(c,l,n-h));return{r:Math.round(d),g:Math.round(u),b:Math.round(p)}}function Ne(t){const e=We(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}function He(t){const e=t??0,i=()=>Math.floor(L(e,256));return{b:i(),g:i(),r:i()}}function qe(t,e,i){const s=i??1;return Te(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?function(t,e,i=400){const s=i/203;return`color(display-p3 ${(t.r/m*s).toString()} ${(t.g/m*s).toString()} ${(t.b/m*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 je(t,e,i){const s=i??1;return Te(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?qe(We(t),!0,i):`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${s.toString()})`)}function Xe(t,e,i,s){let n=t,o=e;return"r"in n||(n=We(t)),"r"in o||(o=We(e)),{b:G(n.b,o.b,i,s),g:G(n.g,o.g,i,s),r:G(n.r,o.r,i,s)}}function Ye(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function Qe(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:y},s:{enable:!1,value:t.s,min:0,max:v},l:{enable:!1,value:t.l,min:0,max:w}};return e&&(Ze(s.h,e.h,i),Ze(s.s,e.s,i),Ze(s.l,e.l,i)),s}function Ze(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=W(i.speed)/o*s,e.decay=1-W(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=W(i.count),e.time=0,e.delayTime=W(i.delay)*r,i.sync||(e.velocity*=A(),e.value*=A()),e.initialValue=e.value,e.offset=q(i.offset)):e.velocity=0}function Ke(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,o=(e.velocity??0)*s.factor+3.6*n,a=e.decay??1,r=e.max,l=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=o,e.value<l&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=o,e.value>r&&(e.loops??=0,e.loops++,i?e.status=t.AnimationStatus.decreasing:e.value-=r)),e.velocity&&1!==a&&(e.velocity*=a),e.value=U(e.value,l,r)}function Je(t,e){if(!t)return;const{h:i,s:s,l:n}=t;Ke(i,!1,e),Ke(s,!0,e),Ke(n,!0,e)}function ti(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const ei=new Et;class ii{background;brightness;colors;gravity;minHeight;rate;saturation;sounds;speed;splitCount;constructor(){this.background="none",this.brightness={min:-30,max:30},this.colors=["#FF0000","#FF2A00","#FF5500","#FF8000","#FFAA00","#FFD400","#FFFF00","#D4FF00","#AAFF00","#80FF00","#55FF00","#2AFF00","#00FF00","#00FF2A","#00FF55","#00FF80","#00FFAA","#00FFD4","#00FFFF","#00D4FF","#00AAFF","#0080FF","#0055FF","#002AFF","#0000FF","#2A00FF","#5500FF","#8000FF","#AA00FF","#D400FF","#FF00FF","#FF00D4","#FF00AA","#FF0080","#FF0055","#FF002A"],this.gravity=30,this.minHeight={min:10,max:30},this.rate=10,this.saturation={min:-30,max:30},this.sounds=!0,this.speed={min:20,max:40},this.splitCount=100}load(t){R(t)||(void 0!==t.colors&&(F(t.colors)?this.colors=[...t.colors]:this.colors=t.colors),Qt(this,"background",t.background),Zt(this,"brightness",t.brightness),Zt(this,"gravity",t.gravity),Zt(this,"minHeight",t.minHeight),Zt(this,"rate",t.rate),Zt(this,"saturation",t.saturation),Qt(this,"sounds",t.sounds),Zt(this,"speed",t.speed),Zt(this,"splitCount",t.splitCount))}}const si=new Map;const ni=t=>{const e=t.data;return e?.particle?.options.move.gravity.enable??!1};async function oi(e,i,s,n){const o=si.get(i);if(o instanceof Promise)return o;if(o){if(!o.destroyed)return o;si.delete(i)}const a=(async()=>{const o=new ii;o.load(s);const a=function(e,i){return{detectRetina:!0,background:{color:e.background},blend:{enable:!0,mode:"lighter"},fullScreen:{enable:!i},fpsLimit:60,emitters:{direction:t.MoveDirection.top,life:{count:0,duration:.1,delay:.1},rate:{delay:k(e.rate)?1/e.rate:{min:1/N(e.rate),max:1/H(e.rate)},quantity:1},size:{width:100,height:0},position:{y:100,x:50}},particles:{number:{value:0},paint:{fill:{enable:!1},stroke:{color:{value:e.colors},width:2}},destroy:{mode:"split",bounds:{top:q(e.minHeight)},split:{count:1,factor:{value:.333333},rate:{value:e.splitCount},strokeColorOffset:{s:e.saturation,l:e.brightness},particles:{group:"split",number:{value:0},opacity:{value:{min:.1,max:1},animation:{enable:!0,speed:{min:2,max:4},sync:!0,startValue:t.StartValueType.max,destroy:t.DestroyType.min,count:1}},size:{value:{min:5,max:10}},life:{count:1,duration:{value:{min:.5,max:1}}},move:{decay:.05,enable:!0,gravity:{enable:!1},speed:{min:10,max:25},direction:"outside",outModes:t.OutMode.destroy}}}},life:{count:1},shape:{type:"line",options:{line:{cap:"round"}}},size:{value:{min:10,max:20}},rotate:{path:!0},move:{enable:!0,gravity:{acceleration:q(e.gravity),enable:!0,inverse:!0,maxSpeed:150},speed:q(e.speed),outModes:{default:t.OutMode.destroy,top:t.OutMode.none}}},sounds:{enable:e.sounds,events:[{event:t.EventType.particleRemoved,filter:ni,audio:["https://particles.js.org/audio/explosion0.mp3","https://particles.js.org/audio/explosion1.mp3","https://particles.js.org/audio/explosion2.mp3"]}],volume:50}}}(o,n),r=await e.load({id:i,element:n,options:a});if(!r)return void si.delete(i);const{FireworksInstance:l}=await Promise.resolve().then(function(){return mn}),c=new l(r,i);return si.set(i,c),c})();return si.set(i,a),a}class ai{enable=!1;mode="destination-out";load(t){R(t)||(Qt(this,"mode",t.mode),Qt(this,"enable",t.enable))}}class ri{id="blend";async getPlugin(t){const{BlendPluginInstance:e}=await Promise.resolve().then(function(){return yn});return new e(t)}loadOptions(t,e,i){if(!this.needsPlugin(e)&&!this.needsPlugin(i))return;let s=e.blend;s?.load||(e.blend=s=new ai),s.load(i?.blend)}loadParticlesOptions(t,e,i){e.blend??=new ai,e.blend.load(i?.blend)}needsPlugin(t){return!!t?.blend?.enable||!!t?.particles?.blend?.enable}}async function li(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new ri)})}class ci{draw(t){!function(t){const{context:e,particle:i,radius:s}=t;i.circleRange??={min:0,max:u};const n=i.circleRange;e.arc(l.x,l.y,s,n.min,n.max,!1)}(t)}getSidesCount(){return 12}particleInit(t,e){const i=e.shapeData,s=i?.angle??{max:360,min:0};e.circleRange=I(s)?{min:Z(s.min),max:Z(s.max)}:{min:0,max:Z(s)}}}async function hi(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["circle"],()=>Promise.resolve(new ci))})}var di;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"}(di||(di={}));const ui=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,pi=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class fi{accepts(t){return t.startsWith("#")}handleColor(t){return this.#m(t.value)}handleRangeColor(t){return this.#m(t.value)}parseString(t){return this.#m(t)}#m(t){if("string"!=typeof t||!this.accepts(t))return;const e=t.replace(ui,(t,e,i,s,n)=>e+e+i+i+s+s+(void 0===n?"":n+n)),i=pi.exec(e);return i?{a:i[di.a]?Number.parseInt(i[di.a],16)/255:1,b:Number.parseInt(i[di.b]??"0",16),g:Number.parseInt(i[di.g]??"0",16),r:Number.parseInt(i[di.r]??"0",16)}:void 0}}async function gi(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hex",new fi)})}var mi;!function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"}(mi||(mi={}));const yi=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class vi{accepts(t){return t.startsWith("hsl")}handleColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return We(e)}handleRangeColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return We({h:W(e.h),l:W(e.l),s:W(e.s)})}parseString(t){if(!this.accepts(t))return;const e=yi.exec(t);return e?Ne({a:e.length>4?nt(e[mi.a]):1,h:Number.parseInt(e[mi.h]??"0",10),l:Number.parseInt(e[mi.l]??"0",10),s:Number.parseInt(e[mi.s]??"0",10)}):void 0}}async function wi(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hsl",new vi)})}class Pi{id="move";#p;constructor(t){this.#p=t}async getPlugin(t){const{MovePluginInstance:e}=await Promise.resolve().then(function(){return wn});return new e(this.#p,t)}loadOptions(){}needsPlugin(){return!0}}async function bi(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{const e=t.pluginManager;e.initializers.pathGenerators??=new Map,e.pathGenerators??=new Map,e.addPathGenerator=(t,i)=>{e.initializers.pathGenerators??=new Map,e.initializers.pathGenerators.set(t,i)},e.getPathGenerators=async(t,i=!1)=>(e.initializers.pathGenerators??=new Map,e.pathGenerators??=new Map,Ct(t,e.pathGenerators,e.initializers.pathGenerators,i)),t.pluginManager.addPlugin(new Pi(t.pluginManager))})}function xi(e,i){const s=e.value,n=e.animation,o={delayTime:W(n.delay)*r,enable:n.enable,value:W(e.value)*i,max:H(s)*i,min:N(s)*i,loops:0,maxLoops:W(n.count),time:0};if(n.enable){switch(o.decay=1-W(n.decay),n.mode){case t.AnimationMode.increase:o.status=t.AnimationStatus.increasing;break;case t.AnimationMode.decrease:o.status=t.AnimationStatus.decreasing;break;case t.AnimationMode.random:o.status=A()>=a?t.AnimationStatus.increasing:t.AnimationStatus.decreasing}const e=n.mode===t.AnimationMode.auto;switch(n.startValue){case t.StartValueType.min:o.value=o.min,e&&(o.status=t.AnimationStatus.increasing);break;case t.StartValueType.max:o.value=o.max,e&&(o.status=t.AnimationStatus.decreasing);break;case t.StartValueType.random:default:o.value=$(o),e&&(o.status=A()>=a?t.AnimationStatus.increasing:t.AnimationStatus.decreasing)}}return o.initialValue=o.value,o}function Mi(e,i,s,n,o){if(e.destroyed||!i.enable||(i.maxLoops??0)>0&&(i.loops??0)>(i.maxLoops??0))return;const a=(i.velocity??0)*o.factor,r=i.min,l=i.max,c=i.decay??1;i.time??=0;const h=i.delayTime??0;if(!(h>0&&i.time<h&&(i.time+=o.value,i.time<h))){switch(i.status){case t.AnimationStatus.increasing:i.value+=a;break;case t.AnimationStatus.decreasing:i.value-=a}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,o){switch(i){case t.DestroyType.max:s>=o&&e.destroy();break;case t.DestroyType.min:s<=n&&e.destroy()}}(e,n,i.value,r,l),e.destroyed||(i.value=U(i.value,r,l))}}class zi extends ie{destroy=t.DestroyType.none;load(t){super.load(t),R(t)||Qt(this,"destroy",t.destroy)}}class Ci extends ye{animation=new zi;value=1;load(t){if(R(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class Si{#u;constructor(t){this.#u=t}init(t){const e=t.options.opacity;if(!e)return;t.opacity=xi(e,1);const i=e.animation;i.enable&&(t.opacity.velocity=W(i.speed)/o*this.#u.retina.reduceFactor,i.sync||(t.opacity.velocity*=A()))}isEnabled(t){return!t.destroyed&&!t.spawning&&!!t.opacity&&t.opacity.enable&&((t.opacity.maxLoops??0)<=0||(t.opacity.maxLoops??0)>0&&(t.opacity.loops??0)<(t.opacity.maxLoops??0))}loadOptions(t,...e){te(t,"opacity",Ci,...e)}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&t.options.opacity&&Mi(t,t.opacity,!0,t.options.opacity.animation.destroy,e)}}async function Oi(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new Si(t)))})}class ki{modes;#u;#y;constructor(e){this.#u=e,this.modes=[t.OutMode.bounce,t.OutMode.split],this.#y=e.plugins.filter(t=>void 0!==t.particleBounce)}update(e,i,s,n){if(!this.modes.includes(n))return;const o=this.#u;let a=!1;for(const t of this.#y)if(a=t.particleBounce?.(e,s,i)??!1,a)break;if(a)return;const r=e.getPosition(),l=e.offset,c=e.getRadius(),h=ft(r,c),d=o.canvas.size,u=!e.isInsideCanvasForOutMode(n,i);!function(e){if(e.outMode!==t.OutMode.bounce&&e.outMode!==t.OutMode.split||e.direction!==t.OutModeDirection.left&&e.direction!==t.OutModeDirection.right)return;e.bounds.right<0&&e.direction===t.OutModeDirection.left?e.particle.position.x=e.size+e.offset.x:e.bounds.left>e.canvasSize.width&&e.direction===t.OutModeDirection.right&&(e.particle.position.x=e.canvasSize.width-e.size-e.offset.x);const i=e.particle.velocity.x;let s=!1;if(e.outOfCanvas&&(e.direction===t.OutModeDirection.right&&i>0||e.direction===t.OutModeDirection.left&&i<0)){const t=W(e.particle.options.bounce.horizontal.value);e.particle.velocity.x*=-t,s=!0}if(!s)return;const n=e.offset.x+e.size;e.outOfCanvas&&e.direction===t.OutModeDirection.right?e.particle.position.x=e.canvasSize.width-n:e.outOfCanvas&&e.direction===t.OutModeDirection.left&&(e.particle.position.x=n),e.outMode===t.OutMode.split&&e.particle.destroy()}({particle:e,outMode:n,direction:i,bounds:h,canvasSize:d,offset:l,outOfCanvas:u,size:c}),function(e){if(e.outMode!==t.OutMode.bounce&&e.outMode!==t.OutMode.split||e.direction!==t.OutModeDirection.bottom&&e.direction!==t.OutModeDirection.top)return;e.bounds.bottom<0&&e.direction===t.OutModeDirection.top?e.particle.position.y=e.size+e.offset.y:e.bounds.top>e.canvasSize.height&&e.direction===t.OutModeDirection.bottom&&(e.particle.position.y=e.canvasSize.height-e.size-e.offset.y);const i=e.particle.velocity.y;let s=!1;if(e.outOfCanvas&&(e.direction===t.OutModeDirection.bottom&&i>0||e.direction===t.OutModeDirection.top&&i<0)){const t=W(e.particle.options.bounce.vertical.value);e.particle.velocity.y*=-t,s=!0}if(!s)return;const n=e.offset.y+e.size;e.outOfCanvas&&e.direction===t.OutModeDirection.bottom?e.particle.position.y=e.canvasSize.height-n:e.outOfCanvas&&e.direction===t.OutModeDirection.top&&(e.particle.position.y=n),e.outMode===t.OutMode.split&&e.particle.destroy()}({particle:e,outMode:n,direction:i,bounds:h,canvasSize:d,offset:l,outOfCanvas:u,size:c})}}class Di{modes;constructor(e){this.modes=[t.OutMode.destroy]}update(e,i,s,n){if(this.modes.includes(n)){switch(e.outType){case t.ParticleOutType.normal:case t.ParticleOutType.outside:if(e.isInsideCanvasForOutMode(n,i))return;break;case t.ParticleOutType.inside:{const{dx:t,dy:i}=j(e.position,e.moveCenter),{x:s,y:n}=e.velocity;if(s<0&&t>e.moveCenter.radius||n<0&&i>e.moveCenter.radius||s>=0&&t<-e.moveCenter.radius||n>=0&&i<-e.moveCenter.radius)return;break}}e.destroy(!0)}}}class Ii{modes;#u;constructor(e){this.#u=e,this.modes=[t.OutMode.none]}update(e,i,s,n){if(!this.modes.includes(n))return;if((e.options.move.distance.horizontal&&(i===t.OutModeDirection.left||i===t.OutModeDirection.right))??(e.options.move.distance.vertical&&(i===t.OutModeDirection.top||i===t.OutModeDirection.bottom)))return;const o=e.options.move.gravity,a=this.#u,r=a.canvas.size,c=e.getRadius();if(o.enable){const s=e.position;(!o.inverse&&s.y>r.height+c&&i===t.OutModeDirection.bottom||o.inverse&&s.y<-c&&i===t.OutModeDirection.top)&&e.destroy()}else{if(e.velocity.y>0&&e.position.y<=r.height+c||e.velocity.y<0&&e.position.y>=-c||e.velocity.x>0&&e.position.x<=r.width+c||e.velocity.x<0&&e.position.x>=-c)return;ut(e.position,a.canvas.size,l,c,i)||e.destroy()}}}const Fi=C.origin;class Ri{modes;#u;constructor(e){this.#u=e,this.modes=[t.OutMode.out]}update(e,i,s,n){if(!this.modes.includes(n))return;const o=this.#u;switch(e.outType){case t.ParticleOutType.inside:{const{x:t,y:i}=e.velocity;Fi.setTo(l),Fi.length=e.moveCenter.radius,Fi.angle=e.velocity.angle+Math.PI,Fi.addTo(e.moveCenter);const{dx:s,dy:n}=j(e.position,Fi);if(t<=0&&s>=0||i<=0&&n>=0||t>=0&&s<=0||i>=0&&n<=0)return;e.position.x=Math.floor($({min:0,max:o.canvas.size.width})),e.position.y=Math.floor($({min:0,max:o.canvas.size.height}));const{dx:a,dy:r}=j(e.position,e.moveCenter);e.direction=Math.atan2(-r,-a),e.velocity.angle=e.direction,e.justWarped=!0;break}default:if(e.isInsideCanvasForOutMode(n,i))return;switch(e.outType){case t.ParticleOutType.outside:{e.position.x=Math.floor($({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.x,e.position.y=Math.floor($({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.y;const{dx:t,dy:i}=j(e.position,e.moveCenter);e.moveCenter.radius&&(e.direction=Math.atan2(i,t),e.velocity.angle=e.direction),e.justWarped=!0;break}case t.ParticleOutType.normal:{const s=e.options.move.warp,n=o.canvas.size,a={bottom:n.height+e.getRadius()+e.offset.y,left:-e.getRadius()-e.offset.x,right:n.width+e.getRadius()+e.offset.x,top:-e.getRadius()-e.offset.y},r=e.getRadius(),l=ft(e.position,r);i===t.OutModeDirection.right&&l.left>n.width+e.offset.x?(e.position.x=a.left,e.initialPosition.x=e.position.x,s||(e.position.y=A()*n.height,e.initialPosition.y=e.position.y),e.justWarped=!0):i===t.OutModeDirection.left&&l.right<-e.offset.x&&(e.position.x=a.right,e.initialPosition.x=e.position.x,s||(e.position.y=A()*n.height,e.initialPosition.y=e.position.y),e.justWarped=!0),i===t.OutModeDirection.bottom&&l.top>n.height+e.offset.y?(s||(e.position.x=A()*n.width,e.initialPosition.x=e.position.x),e.position.y=a.top,e.initialPosition.y=e.position.y,e.justWarped=!0):i===t.OutModeDirection.top&&l.bottom<-e.offset.y&&(s||(e.position.x=A()*n.width,e.initialPosition.x=e.position.x),e.position.y=a.bottom,e.initialPosition.y=e.position.y,e.justWarped=!0);break}}}}}class Ei{updaters;#u;constructor(t){this.#u=t,this.updaters=new Map}init(e){this.#v(e,t.OutMode.bounce,t=>new ki(t)),this.#v(e,t.OutMode.out,t=>new Ri(t)),this.#v(e,t.OutMode.destroy,t=>new Di(t)),this.#v(e,t.OutMode.none,t=>new Ii(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(e,i){const s=e.options.move.outModes;e.justWarped=!1,this.#w(e,i,s.bottom??s.default,t.OutModeDirection.bottom),this.#w(e,i,s.left??s.default,t.OutModeDirection.left),this.#w(e,i,s.right??s.default,t.OutModeDirection.right),this.#w(e,i,s.top??s.default,t.OutModeDirection.top)}#v(t,e,i){const s=t.options.move.outModes;!this.updaters.has(e)&&((t,e)=>t.default===e||t.bottom===e||t.left===e||t.right===e||t.top===e)(s,e)&&this.updaters.set(e,i(this.#u))}#w(t,e,i,s){for(const n of this.updaters.values())n.update(t,s,e,i)}}async function _i(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("outModes",t=>Promise.resolve(new Ei(t)))})}class Ti{#u;#p;constructor(t,e){this.#u=e,this.#p=t}init(t){const e=this.#u,i=t.options,s=yt(i.paint,t.id,i.reduceDuplicates),n=s?.color,o=n??void 0,a=s?.fill,r=s?.stroke;if(a){const i=ae.create(void 0===o?void 0:ae.create(void 0,o),a.color);t.fillEnabled=a.enable,t.fillOpacity=W(a.opacity),t.fillAnimation=i.animation;const s=Ve(this.#p,i);s&&(t.fillColor=Qe(s,t.fillAnimation,e.retina.reduceFactor))}else t.fillEnabled=!1,t.fillAnimation=void 0,t.fillColor=void 0,t.fillOpacity=1;if(r){const i=ae.create(void 0===o?void 0:ae.create(void 0,o),r.color);t.strokeWidth=W(r.width)*e.retina.pixelRatio,t.strokeOpacity=W(r.opacity??1),t.strokeAnimation=i.animation;const s=Ve(this.#p,i)??t.getFillColor();s&&(t.strokeColor=Qe(s,t.strokeAnimation,e.retina.reduceFactor))}else t.strokeAnimation=void 0,t.strokeColor=void 0,t.strokeOpacity=1,t.strokeWidth=0}isEnabled(t){const{fillAnimation:e,fillColor:i,strokeAnimation:s,strokeColor:n}=t,o=!!e&&(void 0!==i?.h.value&&i.h.enable||void 0!==i?.s.value&&i.s.enable||void 0!==i?.l.value&&i.l.enable),a=!!s&&(void 0!==n?.h.value&&n.h.enable||void 0!==n?.s.value&&n.s.enable||void 0!==n?.l.value&&n.l.enable);return!t.destroyed&&!t.spawning&&(o||a)}update(t,e){this.isEnabled(t)&&(Je(t.fillColor,e),Je(t.strokeColor,e))}}async function Ai(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("paint",e=>Promise.resolve(new Ti(t.pluginManager,e)))})}var Li;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=5]="a"}(Li||(Li={}));const Bi=/rgba?\(\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*[\s,]\s*(\d{1,3})\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class Vi{accepts(t){return t.startsWith("rgb")}handleColor(t){const e=t.value.rgb??t.value;if("r"in e&&"g"in e&&"b"in e)return e}handleRangeColor(t){const e=t.value.rgb??t.value;if("r"in e&&"g"in e&&"b"in e)return{r:W(e.r),g:W(e.g),b:W(e.b)}}parseString(t){if(!this.accepts(t))return;const e=Bi.exec(t);return e?{a:e.length>4?nt(e[Li.a]):1,b:parseInt(e[Li.b]??"0",10),g:parseInt(e[Li.g]??"0",10),r:parseInt(e[Li.r]??"0",10)}:void 0}}async function Ui(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("rgb",new Vi)})}class Gi extends ie{destroy=t.DestroyType.none;load(t){super.load(t),R(t)||Qt(this,"destroy",t.destroy)}}class $i extends ye{animation=new Gi;value=3;load(t){if(super.load(t),R(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class Wi{#u;constructor(t){this.#u=t}init(t){const e=this.#u,i=t.options.size;if(!i)return;const s=i.animation;s.enable&&(t.size.velocity=t.retina.sizeAnimationSpeed/o*e.retina.reduceFactor,s.sync||(t.size.velocity*=A()))}isEnabled(t){return!t.destroyed&&!t.spawning&&t.size.enable&&((t.size.maxLoops??0)<=0||(t.size.maxLoops??0)>0&&(t.size.loops??0)<(t.size.maxLoops??0))}loadOptions(t,...e){te(t,"size",$i,...e)}preInit(t){const e=this.#u.retina.pixelRatio,i=t.options.size;i&&(t.size=xi(i,e),t.retina.sizeAnimationSpeed=W(i.animation.speed)*e)}reset(t){t.size.time=0,t.size.loops=0}update(t,e){this.isEnabled(t)&&t.options.size&&Mi(t,t.size,!0,t.options.size.animation.destroy,e)}}async function Ni(t){t.checkVersion("4.2.0"),await