UNPKG

@tsparticles/basic

Version:

Easily create highly customizable particle 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 95.6 kB
!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.basic=t.__tsParticlesInternals.bundles.basic||{}))}(this,function(t){"use strict";const e="generated",i="source-over",s="resize",n="visibilitychange",a=100,o=.5,r=1e3,l={x:0,y:0,z:0},c={a:1,b:0,c:0,d:1},h="random",d="mid",u=2*Math.PI,p="true",f="false",g="canvas",y=255,m=360,v=100,P=100,b=.25,w=.75;var M;function x(t){return"z"in t?t.z:l.z}t.MoveDirection=void 0,(M=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",M.bottomLeft="bottom-left",M.bottomRight="bottom-right",M.left="left",M.none="none",M.right="right",M.top="top",M.topLeft="top-left",M.topRight="top-right",M.outside="outside",M.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,x(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,x(t))}add(t){return z.create(this.x+t.x,this.y+t.y,this.z+x(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=x(t)}copy(){return z.clone(this)}div(t){return z.create(this.x/t,this.y/t,this.z/t)}divTo(t){this.x/=t,this.y/=t,this.z/=t}getLengthSq(){return this.x**2+this.y**2}mult(t){return 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=x(t)}sub(t){return z.create(this.x-t.x,this.y-t.y,this.z-x(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=x(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class O extends z{constructor(t=l.x,e=l.y){super(t,e,l.z)}static get origin(){return O.create(l.x,l.y)}static clone(t){return O.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new O(t,e??l.y):new O(t.x,t.y)}}function S(t){return"boolean"==typeof t}function I(t){return"string"==typeof t}function C(t){return"number"==typeof t}function D(t){return"object"==typeof t&&null!==t}function k(t){return Array.isArray(t)}function _(t){return null==t}const R=Math.PI/180;let T=Math.random;const E={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function A(){return V(T(),0,1-Number.EPSILON)}function F(t,e){return A()*(e-t)+t}function L(t){return E.nextFrame(t)}function B(t){E.cancel(t)}function V(t,e,i){return Math.min(Math.max(t,e),i)}function U(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function $(t){const e=q(t);let i=W(t);return e===i&&(i=0),F(i,e)}function G(t){return C(t)?t:$(t)}function W(t){return C(t)?t:t.min}function q(t){return C(t)?t:t.max}function H(t,e){if(t===e||void 0===e&&C(t))return t;const i=W(t),s=q(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:H(i,s)}function N(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}}function j(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function Q(t,e){return Math.sqrt(j(t,e))}function X(t,e,i){return j(t,e)<=i*i}function Y(t){return t*R}function Z(e,i,s){if(C(e))return Y(e);switch(e){case t.MoveDirection.top:return-Math.PI*o;case t.MoveDirection.topRight:return-Math.PI*b;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*b;case t.MoveDirection.bottom:return Math.PI*o;case t.MoveDirection.bottomLeft:return Math.PI*w;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*w;case t.MoveDirection.inside:return Math.atan2(s.y-i.y,s.x-i.x);case t.MoveDirection.outside:return Math.atan2(i.y-s.y,i.x-s.x);default:return A()*u}}function J(t){const e=O.origin;return e.length=1,e.angle=t,e}function K(t,e,i,s){return O.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function tt(t){return{x:(t.position?.x??A()*a)*t.size.width/a,y:(t.position?.y??A()*a)*t.size.height/a}}function et(t){const{position:e,size:i}=t;return{x:e?.x??A()*i.width,y:e?.y??A()*i.height}}function it(t){return t?t.endsWith("%")?parseFloat(t)/a:parseFloat(t):1}var st,nt,at,ot,rt,lt;t.AnimationMode=void 0,(st=t.AnimationMode||(t.AnimationMode={})).auto="auto",st.increase="increase",st.decrease="decrease",st.random="random",t.AnimationStatus=void 0,(nt=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",nt.decreasing="decreasing",t.DestroyType=void 0,(at=t.DestroyType||(t.DestroyType={})).none="none",at.max="max",at.min="min",t.OutModeDirection=void 0,(ot=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",ot.left="left",ot.right="right",ot.top="top",t.PixelMode=void 0,(rt=t.PixelMode||(t.PixelMode={})).precise="precise",rt.percent="percent",t.StartValueType=void 0,(lt=t.StartValueType||(t.StartValueType={})).max="max",lt.min="min",lt.random="random";function ct(t,e){const i=new Map,s=e?.maxSize,n=e?.ttlMs,a=e?.keyFn,o=(t,e=new WeakSet)=>{if(null===t)return"null";const i=typeof t;if("undefined"===i)return"undefined";if("number"===i||"boolean"===i||"string"===i)return JSON.stringify(t);if("function"===i)try{return t.toString()}catch{return'"[Function]"'}if("symbol"===i)try{return t.toString()}catch{return'"[Symbol]"'}if(Array.isArray(t))return`[${t.map(t=>o(t,e)).join(",")}]`;if(e.has(t))return'"[Circular]"';e.add(t);return`{${Object.keys(t).sort().map(i=>`${JSON.stringify(i)}:${o(t[i],e)}`).join(",")}}`},r=t=>a?a(t):(t=>o(t))(t);return(...e)=>{const a=r(e),o=Date.now(),l=i.get(a);if(void 0!==l){if(!(n&&o-l.ts>n))return i.delete(a),i.set(a,{value:l.value,ts:l.ts}),l.value;i.delete(a)}const c=t(...e);return i.set(a,{value:c,ts:o}),(()=>{if("number"==typeof s&&s>=0)for(;i.size>s;){const t=i.keys().next().value;if(void 0===t)break;i.delete(t)}})(),c}}function ht(){return"undefined"!=typeof matchMedia}function dt(){return globalThis.document}function ut(t){if(ht())return matchMedia(t)}function pt(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function ft(t,e){return t===e||k(e)&&e.includes(t)}function gt(t){return Math.floor(A()*t.length)}function yt(t,e,i=!0){return t[void 0!==e&&i?e%t.length:gt(t)]}function mt(t,e,i,s,n){return vt(Pt(t,s??0),e,i,n)}function vt(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 Pt(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function bt(t,...e){for(const i of e){if(_(i))continue;if(!D(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):D(t)&&!Array.isArray(t)||(t={});const e=Object.keys(i),s=new Set(["__proto__","constructor","prototype"]);if(!e.some(t=>{const e=i[t];return D(e)||Array.isArray(e)})){const n=i,a=t;for(const t of e)if(!s.has(t)&&t in n){const e=n[t];void 0!==e&&(a[t]=e)}continue}for(const n of e){if(s.has(n))continue;const e=t,a=i[n];e[n]=Array.isArray(a)?a.map(t=>bt(void 0,t)):bt(e[n],a)}}return t}function wt(t,e){return k(t)?t.map((t,i)=>e(t,i)):e(t,0)}function Mt(t,e,i){return k(t)?yt(t,e,i):t}function xt(e,i){const s=e.value,n=e.animation,a={delayTime:G(n.delay)*r,enable:n.enable,value:G(e.value)*i,max:q(s)*i,min:W(s)*i,loops:0,maxLoops:G(n.count),time:0};if(n.enable){switch(a.decay=1-G(n.decay),n.mode){case t.AnimationMode.increase:a.status=t.AnimationStatus.increasing;break;case t.AnimationMode.decrease:a.status=t.AnimationStatus.decreasing;break;case t.AnimationMode.random:a.status=A()>=o?t.AnimationStatus.increasing:t.AnimationStatus.decreasing}const e=n.mode===t.AnimationMode.auto;switch(n.startValue){case t.StartValueType.min:a.value=a.min,e&&(a.status=t.AnimationStatus.increasing);break;case t.StartValueType.max:a.value=a.max,e&&(a.status=t.AnimationStatus.decreasing);break;case t.StartValueType.random:default:a.value=$(a),e&&(a.status=A()>=o?t.AnimationStatus.increasing:t.AnimationStatus.decreasing)}}return a.initialValue=a.value,a}function zt(e,i){if(!(e.mode===t.PixelMode.percent)){const{mode:t,...i}=e;return i}return"x"in e?{x:e.x/a*i.width,y:e.y/a*i.height}:{width:e.width/a*i.width,height:e.height/a*i.height}}function Ot(t,e){return zt(t,e)}function St(e,i,s,n,a){if(e.destroyed||!i.enable||(i.maxLoops??0)>0&&(i.loops??0)>(i.maxLoops??0))return;const o=(i.velocity??0)*a.factor,r=i.min,l=i.max,c=i.decay??1;if(i.time??=0,(i.delayTime??0)>0&&i.time<(i.delayTime??0)&&(i.time+=a.value),!((i.delayTime??0)>0&&i.time<(i.delayTime??0))){switch(i.status){case t.AnimationStatus.increasing:i.value+=o;break;case t.AnimationStatus.decreasing:i.value-=o}switch(i.velocity&&1!==c&&(i.velocity*=c),i.status){case t.AnimationStatus.increasing:i.value>=l&&(s?i.status=t.AnimationStatus.decreasing:i.value-=l,i.loops??=0,i.loops++);break;case t.AnimationStatus.decreasing:i.value<=r&&(s?i.status=t.AnimationStatus.increasing:i.value+=l,i.loops??=0,i.loops++)}!function(e,i,s,n,a){switch(i){case t.DestroyType.max:s>=a&&e.destroy();break;case t.DestroyType.min:s<=n&&e.destroy()}}(e,n,i.value,r,l),e.destroyed||(i.value=V(i.value,r,l))}}function It(t){const e=dt().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||_(s))continue;const n=t.getPropertyValue?.(s);if(!n)continue;const a=t.getPropertyPriority?.(s);a?e.setProperty(s,n,a):e.setProperty(s,n)}return e}const Ct=ct(function(t){const e=dt().createElement("div").style,i={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(10),"z-index":t.toString(10),top:"0",left:"0","pointer-events":"none"};for(const t in i){const s=i[t];void 0!==s&&e.setProperty(t,s)}return e});function Dt(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 kt(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 _t(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 Rt{#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 Tt;t.EventType=void 0,(Tt=t.EventType||(t.EventType={})).configAdded="configAdded",Tt.containerInit="containerInit",Tt.particlesSetup="particlesSetup",Tt.containerStarted="containerStarted",Tt.containerStopped="containerStopped",Tt.containerDestroyed="containerDestroyed",Tt.containerPaused="containerPaused",Tt.containerPlay="containerPlay",Tt.containerBuilt="containerBuilt",Tt.particleAdded="particleAdded",Tt.particleDestroyed="particleDestroyed",Tt.particleRemoved="particleRemoved";class Et{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;#o=!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 _t(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 _t(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return kt(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this.#o&&!this.#r){this.#r=!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.#r=!1,this.#o=!0}}}loadParticlesOptions(t,e,...i){const s=this.updaters.get(t);s&&s.forEach(t=>t.loadOptions?.(e,...i))}async register(...t){if(this.#o)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.#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 At=t=>(...e)=>{t(...e)},Ft={debug:At(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:At(console.info),log:At(console.log),trace:At(console.trace),verbose:At(console.log),warning:At(console.warn)};function Lt(){return Ft}const Bt="100%";class Vt{pluginManager=new Et(this);#h=[];#d=new Rt;#o=!1;get items(){return this.#h}get version(){return"4.1.1"}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.#o||(await this.pluginManager.init(),this.#o=!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 rs}),n=t.id??i?.id??`tsparticles${Math.floor(1e4*A()).toString()}`,{index:a,url:o}=t,r=o?await async function(t){const e=Mt(t.url,t.index);if(!e)return t.fallback;const i=await fetch(e);return i.ok?await i.json():(Lt().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:o,index:a}):t.options,l=Mt(r,a),{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=dt();let s;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===g)s=t,s.dataset[e]??=f,s.dataset[e]===p&&(s.style.width||=Bt,s.style.height||=Bt,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||=Bt,s.style.height||=Bt,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(((t,i)=>{const s=dt();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 Ut,$t,Gt,Wt,qt,Ht,Nt,jt;!function(t){t.circle="circle",t.rectangle="rectangle"}(Ut||(Ut={}));class Qt{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 Xt extends Qt{radius;constructor(t,e,i){super(t,e,Ut.circle),this.radius=i}contains(t){return X(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 Xt||t.type===Ut.circle){return s+t.radius>Math.hypot(n,a)}if(t instanceof Yt||t.type===Ut.rectangle){const e=t,{width:i,height:o}=e.size;return Math.pow(n-i,2)+Math.pow(a-o,2)<=s**2||n<=s+i&&a<=s+o||n<=i||a<=o}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Yt extends Qt{size;constructor(t,e,i,s){super(t,e,Ut.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 Xt)return t.intersects(this);if(!(t instanceof Yt))return!1;const e=this.size.width,i=this.size.height,s=this.position,n=t.position,a=t.size,o=a.width,r=a.height;return n.x<s.x+e&&n.x+o>s.x&&n.y<s.y+i&&n.y+r>s.y}reset(t,e,i,s){return this._resetPosition(t,e),this.size.width=i,this.size.height=s,this}}t.RotateDirection=void 0,($t=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",$t.counterClockwise="counter-clockwise",$t.random="random",t.LimitMode=void 0,(Gt=t.LimitMode||(t.LimitMode={})).delete="delete",Gt.wait="wait",t.OutMode=void 0,(Wt=t.OutMode||(t.OutMode={})).bounce="bounce",Wt.none="none",Wt.out="out",Wt.destroy="destroy",Wt.split="split",t.AlterType=void 0,(qt=t.AlterType||(t.AlterType={})).darken="darken",qt.enlighten="enlighten",t.GradientType=void 0,(Ht=t.GradientType||(t.GradientType={})).linear="linear",Ht.radial="radial",Ht.random="random",t.ParticleOutType=void 0,(Nt=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",Nt.inside="inside",Nt.outside="outside",t.EasingType=void 0,(jt=t.EasingType||(t.EasingType={})).easeInBack="ease-in-back",jt.easeInBounce="ease-in-bounce",jt.easeInCirc="ease-in-circ",jt.easeInCubic="ease-in-cubic",jt.easeInElastic="ease-in-elastic",jt.easeInExpo="ease-in-expo",jt.easeInGaussian="ease-in-gaussian",jt.easeInLinear="ease-in-linear",jt.easeInQuad="ease-in-quad",jt.easeInQuart="ease-in-quart",jt.easeInQuint="ease-in-quint",jt.easeInSigmoid="ease-in-sigmoid",jt.easeInSine="ease-in-sine",jt.easeInSmoothstep="ease-in-smoothstep",jt.easeOutBack="ease-out-back",jt.easeOutBounce="ease-out-bounce",jt.easeOutCirc="ease-out-circ",jt.easeOutCubic="ease-out-cubic",jt.easeOutElastic="ease-out-elastic",jt.easeOutExpo="ease-out-expo",jt.easeOutGaussian="ease-out-gaussian",jt.easeOutLinear="ease-out-linear",jt.easeOutQuad="ease-out-quad",jt.easeOutQuart="ease-out-quart",jt.easeOutQuint="ease-out-quint",jt.easeOutSigmoid="ease-out-sigmoid",jt.easeOutSine="ease-out-sine",jt.easeOutSmoothstep="ease-out-smoothstep",jt.easeInOutBack="ease-in-out-back",jt.easeInOutBounce="ease-in-out-bounce",jt.easeInOutCirc="ease-in-out-circ",jt.easeInOutCubic="ease-in-out-cubic",jt.easeInOutElastic="ease-in-out-elastic",jt.easeInOutExpo="ease-in-out-expo",jt.easeInOutGaussian="ease-in-out-gaussian",jt.easeInOutLinear="ease-in-out-linear",jt.easeInOutQuad="ease-in-out-quad",jt.easeInOutQuart="ease-in-out-quart",jt.easeInOutQuint="ease-in-out-quint",jt.easeInOutSigmoid="ease-in-out-sigmoid",jt.easeInOutSine="ease-in-out-sine",jt.easeInOutSmoothstep="ease-in-out-smoothstep";class Zt{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(t){_(t)||(void 0!==t.count&&(this.count=H(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=H(t.speed)),void 0!==t.decay&&(this.decay=H(t.decay)),void 0!==t.delay&&(this.delay=H(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class Jt extends Zt{mode;startValue;constructor(){super(),this.mode=t.AnimationMode.auto,this.startValue=t.StartValueType.random}load(t){super.load(t),_(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.startValue&&(this.startValue=t.startValue))}}class Kt extends Zt{max;min;offset;constructor(t,e){super(),this.min=t,this.max=e,this.offset=0,this.sync=!0}load(t){super.load(t),_(t)||(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.offset&&(this.offset=H(t.offset)))}}class te{h=new Kt(0,m);l=new Kt(0,P);s=new Kt(0,v);load(t){_(t)||(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class ee{value;constructor(){this.value=""}static create(t,e){const i=new ee;return i.load(t),void 0!==e&&(I(e)||k(e)?i.load({value:e}):i.load(e)),i}load(t){_(t)||_(t.value)||(this.value=t.value)}}class ie extends ee{animation;constructor(){super(),this.animation=new te}static create(t,e){const i=new ie;return i.load(t),void 0!==e&&(I(e)||k(e)?i.load({value:e}):i.load(e)),i}load(t){if(super.load(t),_(t))return;const e=t.animation;void 0!==e&&(void 0===e.enable?this.animation.load(t.animation):this.animation.h.load(e))}}class se{color;image;opacity;position;repeat;size;constructor(){this.color=new ee,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){_(t)||(void 0!==t.color&&(this.color=ee.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image),void 0!==t.position&&(this.position=t.position),void 0!==t.repeat&&(this.repeat=t.repeat),void 0!==t.size&&(this.size=t.size),void 0!==t.opacity&&(this.opacity=t.opacity))}}class ne{enable;zIndex;constructor(){this.enable=!0,this.zIndex=0}load(t){_(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class ae{delay;enable;constructor(){this.delay=.5,this.enable=!0}load(t){_(t)||(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class oe{close;options;type;constructor(){this.close=!0,this.options={},this.type=[]}load(t){if(_(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=bt(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class re{color;enable;opacity;constructor(){this.enable=!0,this.opacity=1}load(t){_(t)||(void 0!==t.color&&(this.color=ie.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=H(t.opacity)))}}class le{offset;value;constructor(){this.offset=0,this.value=90}load(t){_(t)||(void 0!==t.offset&&(this.offset=H(t.offset)),void 0!==t.value&&(this.value=H(t.value)))}}class ce{mode;radius;x;y;constructor(){this.x=50,this.y=50,this.mode=t.PixelMode.percent,this.radius=0}load(t){_(t)||(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.radius&&(this.radius=t.radius))}}class he{acceleration;enable;inverse;maxSpeed;constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){_(t)||(void 0!==t.acceleration&&(this.acceleration=H(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=H(t.maxSpeed)))}}class de{value;constructor(){this.value=0}load(t){_(t)||_(t.value)||(this.value=H(t.value))}}class ue extends de{animation=new Zt;load(t){if(super.load(t),_(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class pe extends ue{animation;constructor(){super(),this.animation=new Jt}load(t){super.load(t)}}class fe{clamp;delay;enable;generator;options;constructor(){this.clamp=!0,this.delay=new de,this.enable=!1,this.options={}}load(t){_(t)||(void 0!==t.clamp&&(this.clamp=t.clamp),this.delay.load(t.delay),void 0!==t.enable&&(this.enable=t.enable),this.generator=t.generator,t.options&&(this.options=bt(this.options,t.options)))}}class ge{bottom;default;left;right;top;constructor(){this.default=t.OutMode.out}load(t){_(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 ye{acceleration;enable;position;constructor(){this.acceleration=0,this.enable=!1}load(t){_(t)||(void 0!==t.acceleration&&(this.acceleration=H(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),t.position&&(this.position=bt({},t.position)))}}class me{angle;center;decay;direction;distance;drift;enable;gravity;outModes;path;random;size;speed;spin;straight;vibrate;warp;constructor(){this.angle=new le,this.center=new ce,this.decay=0,this.distance={},this.direction=t.MoveDirection.none,this.drift=0,this.enable=!1,this.gravity=new he,this.path=new fe,this.outModes=new ge,this.random=!1,this.size=!1,this.speed=2,this.spin=new ye,this.straight=!1,this.vibrate=!1,this.warp=!1}load(t){if(_(t))return;this.angle.load(C(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),void 0!==t.decay&&(this.decay=H(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance=C(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),void 0!==t.drift&&(this.drift=H(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(D(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),void 0!==t.random&&(this.random=t.random),void 0!==t.size&&(this.size=t.size),void 0!==t.speed&&(this.speed=H(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class ve{color;opacity;width;constructor(){this.width=0}load(t){_(t)||(void 0!==t.color&&(this.color=ie.create(this.color,t.color)),void 0!==t.width&&(this.width=H(t.width)),void 0!==t.opacity&&(this.opacity=H(t.opacity)))}}class Pe{color;fill;stroke;load(t){_(t)||(void 0!==t.color&&(this.color=ie.create(this.color,t.color)),void 0!==t.fill&&(this.fill??=new re,this.fill.load(t.fill)),void 0!==t.stroke&&(this.stroke??=new ve,this.stroke.load(t.stroke)))}}class be extends de{constructor(){super(),this.value=1}}class we{horizontal;vertical;constructor(){this.horizontal=new be,this.vertical=new be}load(t){_(t)||(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class Me{enable;height;width;constructor(){this.enable=!1,this.width=1920,this.height=1080}load(t){if(_(t))return;void 0!==t.enable&&(this.enable=t.enable);const e=t.width;void 0!==e&&(this.width=e);const i=t.height;void 0!==i&&(this.height=i)}}class xe{mode;value;constructor(){this.mode=t.LimitMode.delete,this.value=0}load(t){_(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class ze{density;limit;value;constructor(){this.density=new Me,this.limit=new xe,this.value=0}load(t){_(t)||(this.density.load(t.density),this.limit.load(t.limit),void 0!==t.value&&(this.value=t.value))}}class Oe{close;options;type;constructor(){this.close=!0,this.options={},this.type="circle"}load(t){if(_(t))return;const e=t.options;if(void 0!==e)for(const t in e){const i=e[t];i&&(this.options[t]=bt(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class Se extends de{opacityRate;sizeRate;velocityRate;constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),_(t)||(void 0!==t.opacityRate&&(this.opacityRate=t.opacityRate),void 0!==t.sizeRate&&(this.sizeRate=t.sizeRate),void 0!==t.velocityRate&&(this.velocityRate=t.velocityRate))}}class Ie{bounce;effect;groups;move;number;paint;palette;reduceDuplicates;shape;zIndex;#u;#p;constructor(t,e){this.#p=t,this.#u=e,this.bounce=new we,this.effect=new oe,this.groups={},this.move=new me,this.number=new ze,this.paint=new Pe,this.paint.color=new ie,this.paint.color.value="#fff",this.paint.fill=new re,this.paint.fill.enable=!0,this.reduceDuplicates=!1,this.shape=new Oe,this.zIndex=new Se}load(t){if(_(t))return;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]=bt(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&&(k(e)?this.paint=wt(e,t=>{const e=new Pe;return e.load(t),e}):k(this.paint)?(this.paint=new Pe,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=(k(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 Ce(t,...e){for(const i of e)t.load(i)}function De(t,e,...i){const s=new Ie(t,e);return Ce(s,...i),s}class ke{autoPlay;background;clear;defaultThemes;delay;detectRetina;duration;fpsLimit;fullScreen;hdr;key;name;palette;particles;pauseOnBlur;pauseOnOutsideViewport;preset;resize;smooth;style;zLayers;#u;#p;constructor(t,e){this.#p=t,this.#u=e,this.autoPlay=!0,this.background=new se,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new ne,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.hdr=!0,this.particles=De(this.#p,this.#u),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.resize=new ae,this.smooth=!1,this.style={},this.zLayers=100}load(t){if(_(t))return;void 0!==t.preset&&(this.preset=t.preset,wt(this.preset,t=>{this.#g(t)})),void 0!==t.palette&&(this.palette=t.palette,this.#f(this.palette)),void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.clear&&(this.clear=t.clear),void 0!==t.key&&(this.key=t.key),void 0!==t.name&&(this.name=t.name),void 0!==t.delay&&(this.delay=H(t.delay));const e=t.detectRetina;void 0!==e&&(this.detectRetina=e),void 0!==t.duration&&(this.duration=H(t.duration));const i=t.fpsLimit;void 0!==i&&(this.fpsLimit=i),void 0!==t.hdr&&(this.hdr=t.hdr),void 0!==t.pauseOnBlur&&(this.pauseOnBlur=t.pauseOnBlur),void 0!==t.pauseOnOutsideViewport&&(this.pauseOnOutsideViewport=t.pauseOnOutsideViewport),void 0!==t.zLayers&&(this.zLayers=t.zLayers),this.background.load(t.background);const s=t.fullScreen;S(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.particles.load(t.particles),this.resize.load(t.resize),this.style=bt(this.style,t.style),void 0!==t.smooth&&(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))}}function _e(t,e,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(l.x,l.y,e.width,e.height)}function Re(t,e,i,s){if(!i)return;const n=t.globalAlpha;t.globalAlpha=s,t.drawImage(i,l.x,l.y,e.width,e.height),t.globalAlpha=n}function Te(t,e){t.clearRect(l.x,l.y,e.width,e.height)}function Ee(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:o,opacity:r,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 y={context:i,particle:s,radius:o,drawRadius:1*o,opacity:r,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?.(y);const m=s.effect?c.get(s.effect):void 0,v=s.shape?h.get(s.shape):void 0;Fe(m,y),Ve(v,y),Le(v,y),Be(v,y),Ae(m,y),i.resetTransform()}function Ae(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}function Fe(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}function Le(t,e){if(!t)return;const{context:i,fill:s,particle:n,stroke:a}=e;n.shape&&(i.beginPath(),t.draw(e),n.shapeClose&&i.closePath(),s&&i.fill(),a&&i.stroke())}function Be(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}function Ve(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}function Ue(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}const $e=new Map;function Ge(t,e){let i=$e.get(t);if(!i){if(i=e(),$e.size>=1e3){[...$e.keys()].slice(0,500).forEach(t=>$e.delete(t))}$e.set(t,i)}return i}function We(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function qe(t,e,i,s=!0){if(!e)return;const n=I(e)?{value:e}:e;if(I(n.value))return He(t,n.value,i,s);if(k(n.value)){const e=yt(n.value,i,s);if(!e)return;return qe(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function He(t,e,i,s=!0){if(!e)return;const n=I(e)?{value:e}:e;if(I(n.value))return n.value===h?Ze():Qe(t,n.value);if(k(n.value)){const e=yt(n.value,i,s);if(!e)return;return He(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function Ne(t,e,i,s=!0){const n=qe(t,e,i,s);return n?je(n):void 0}function je(t){const e=t.r/y,i=t.g/y,s=t.b/y,n=Math.max(e,i,s),a=Math.min(e,i,s),r={h:0,l:(n+a)*o,s:0};return n!==a&&(r.s=r.l<o?(n-a)/(n+a):(n-a)/(2-n-a),r.h=e===n?(i-s)/(n-a):i===n?2+(s-e)/(n-a):4+(e-i)/(n-a)),r.l*=P,r.s*=v,r.h*=60,r.h<0&&(r.h+=m),r.h>=m&&(r.h-=m),r}function Qe(t,e){return We(t,e)}function Xe(t){const e=(t.h%m+m)%m,i=Math.max(0,Math.min(v,t.s)),s=Math.max(0,Math.min(P,t.l)),n=e/m,a=i/v,r=s/P;if(0===i){const t=Math.round(r*y);return{r:t,g:t,b:t}}const l=(t,e,i)=>{if(i<0&&i++,i>1&&i--,6*i<1)return t+6*(e-t)*i;if(2*i<1)return e;if(3*i<2){return t+(e-t)*(2/3-i)*6}return t},c=r<o?r*(1+a):r+a-r*a,h=2*r-c,d=1/3,u=Math.min(y,y*l(h,c,n+d)),p=Math.min(y,y*l(h,c,n)),f=Math.min(y,y*l(h,c,n-d));return{r:Math.round(u),g:Math.round(p),b:Math.round(f)}}function Ye(t){const e=Xe(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}function Ze(t){const e=t??0,i=()=>Math.floor(F(e,256));return{b:i(),g:i(),r:i()}}function Je(t,e,i){const s=i??1;return Ge(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?Ke(t,i):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(t,i))}function Ke(t,e){return`color(display-p3 ${(t.r/y).toString()} ${(t.g/y).toString()} ${(t.b/y).toString()} / ${(e??1).toString()})`}function ti(t,e,i){const s=i??1;return Ge(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${e?"hdr":"sdr"}-${s.toString()}`,()=>e?function(t,e){return Ke(Xe(t),e)}(t,i):function(t,e){return`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${(e??1).toString()})`}(t,i))}function ei(t,e,i,s){let n=t,a=e;return"r"in n||(n=Xe(t)),"r"in a||(a=Xe(e)),{b:U(n.b,a.b,i,s),g:U(n.g,a.g,i,s),r:U(n.r,a.r,i,s)}}function ii(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function si(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:m},s:{enable:!1,value:t.s,min:0,max:v},l:{enable:!1,value:t.l,min:0,max:P}};return e&&(ni(s.h,e.h,i),ni(s.s,e.s,i),ni(s.l,e.l,i)),s}function ni(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=G(i.speed)/a*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)*r,i.sync||(e.velocity*=A(),e.value*=A()),e.initialValue=e.value,e.offset=H(i.offset)):e.velocity=0}function ai(e,i,s){if(!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;if(e.time??=0,(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=s.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0))return;const n=e.offset?$(e.offset):0,a=(e.velocity??0)*s.factor+3.6*n,o=e.decay??1,r=e.max,l=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=a,e.value<l&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=a,e.value>r&&(e.loops??=0,e.loops++,i?e.status=t.AnimationStatus.decreasing:e.value-=r)),e.velocity&&1!==o&&(e.velocity*=o),e.value=V(e.value,l,r)}function oi(t,e){if(!t)return;const{h:i,s:s,l:n}=t;ai(i,!1,e),ai(s,!0,e),ai(n,!0,e)}function ri(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const li=new Vt;class ci{enable;mode;constructor(){this.mode="destination-out",this.enable=!1}load(t){_(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.enable&&(this.enable=t.enable))}}class hi{id="blend";async getPlugin(t){const{BlendPluginInstance:e}=await Promise.resolve().then(function(){return ls});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 ci),s.load(i?.blend)}loadParticlesOptions(t,e,i){e.blend??=new ci,e.blend.load(i?.blend)}needsPlugin(t){return!!t?.blend?.enable||!!t?.particles?.blend?.enable}}async function di(t){t.checkVersion("4.1.1"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new hi)})}class ui{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=D(s)?{min:Y(s.min),max:Y(s.max)}:{min:0,max:Y(s)}}}async function pi(t){t.checkVersion("4.1.1"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["circle"],()=>Promise.resolve(new ui))})}var fi;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"}(fi||(fi={}));const gi=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,yi=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class mi{accepts(t){return t.startsWith("#")}handleColor(t){return this.#y(t.value)}handleRangeColor(t){return this.#y(t.value)}parseString(t){return this.#y(t)}#y(t){if("string"!=typeof t||!this.accepts(t))return;const e=t.replace(gi,(t,e,i,s,n)=>e+e+i+i+s+s+(void 0===n?"":n+n)),i=yi.exec(e);return i?{a:i[fi.a]?Number.parseInt(i[fi.a],16)/255:1,b:Number.parseInt(i[fi.b]??"0",16),g:Number.parseInt(i[fi.g]??"0",16),r:Number.parseInt(i[fi.r]??"0",16)}:void 0}}async function vi(t){t.checkVersion("4.1.1"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hex",new mi)})}var Pi;!function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"}(Pi||(Pi={}));const bi=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class wi{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 Xe(e)}handleRangeColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return Xe({h:G(e.h),l:G(e.l),s:G(e.s)})}parseString(t){if(!this.accepts(t))return;const e=bi.exec(t);return e?Ye({a:e.length>4?it(e[Pi.a]):1,h:Number.parseInt(e[Pi.h]??"0",10),l:Number.parseInt(e[Pi.l]??"0",10),s:Number.parseInt(e[Pi.s]??"0",10)}):void 0}}async function Mi(t){t.checkVersion("4.1.1"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hsl",new wi)})}class xi{id="move";#p;constructor(t){this.#p=t}async getPlugin(t){const{MovePluginInstance:e}=await Promise.resolve().then(function(){return hs});return new e(this.#p,t)}loadOptions(){}needsPlugin(){return!0}}async function zi(t){t.checkVersion("4.1.1"),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,_t(t,e.pathGenerators,e.initializers.pathGenerators,i)),t.pluginManager.addPlugin(new xi(t.pluginManager))})}class Oi extends Jt{destroy;constructor(){super(),this.destroy=t.DestroyType.none,this.speed=2}load(t){super.load(t),_(t)||void 0!==t.destroy&&(this.destroy=t.destroy)}}class Si extends pe{animation;constructor(){super(),this.animation=new Oi,this.value=1}load(t){if(_(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class Ii{#u;constructor(t){this.#u=t}init(t){const e=t.options.opacity;if(!e)return;t.opacity=xt(e,1);const i=e.animation;i.enable&&(t.opacity.velocity=G(i.speed)/a*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){t.opacity??=new Si;for(const i of e)t.opacity.load(i?.opacity)}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&t.options.opacity&&St(t,t.opacity,!0,t.options.opacity.animation.destroy,e)}}async function Ci(t){t.checkVersion("4.1.1"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new Ii(t)))})}class Di{modes;#u;#m;constructor(e){this.#u=e,this.modes=[t.OutMode.bounce,t.OutMode.split],this.#m=e.plugins.filter(t=>void 0!==t.particleBounce)}update(e,i,s,n){if(!this.modes.includes(n))return;const a=this.#u;let o=!1;for(const t of this.#m)if(o=t.particleBounce?.(e,s,i)??!1,o)break;if(o)return;const r=e.getPosition(),l=e.offset,c=e.getRadius(),h=Pt(r,c),d=a.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=G(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=G(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 ki{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}=N(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 _i{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 a=e.options.move.gravity,o=this.#u,r=o.canvas.size,c=e.getRadius();if(a.enable){const s=e.position;(!a.inverse&&s.y>r.height+c&&i===t.OutModeDirection.bottom||a.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;mt(e.position,o.canvas.size,l,c,i)||e.destroy()}}}const Ri=O.origin;class Ti{modes;#u;constructor(e){this.#u=e,this.modes=[t.OutMode.out]}update(e,i,s,n){if(!this.modes.includes(n))return;const a=this.#u;switch(e.outType){case t.ParticleOutType.inside:{const{x:t,y:i}=e.velocity;Ri.setTo(l),Ri.length=e.moveCenter.radius,Ri.angle=e.velocity.angle+Math.PI,Ri.addTo(e.moveCenter);const{dx:s,dy:n}=N(e.position,Ri);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:a.canvas.size.width})),e.position.y=Math.floor($({min:0,max:a.canvas.size.height}));const{dx:o,dy:r}=N(e.position,e.moveCenter);e.direction=Math.atan2(-r,-o),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}=N(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=a.canvas.size,o={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=Pt(e.position,r);i===t.OutModeDirection.right&&l.left>n.width+e.offset.x?(e.position.x=o.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=o.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=o.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=o.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 Di(t)),this.#v(e,t.OutMode.out,t=>new Ti(t)),this.#v(e,t.OutMode.destroy,t=>new ki(t)),this.#v(e,t.OutMode.none,t=>new _i(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(e,i){const s=e.options.move.outModes;e.justWarped=!1,this.#P(e,i,s.bottom??s.default,t.OutModeDirection.bottom),this.#P(e,i,s.left??s.default,t.OutModeDirection.left)