@tsparticles/slim
Version:
Slim tsParticles bundle — core engine with essential plugins, presets, and interactions for lightweight particle animations. Ready to use components available for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact, Riot.js, Inferno.
1 lines • 159 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.slim=t.__tsParticlesInternals.bundles.slim||{}))}(this,function(t){"use strict";const e="generated",i="source-over",n="resize",s="visibilitychange",a=100,o=.5,r=1e3,c={x:0,y:0,z:0},l={a:1,b:0,c:0,d:1},d="random",h="mid",u=2*Math.PI,p="true",g="false",f="canvas",m=255,y=360,v=100,b=100,w=.25,x=.75;var P;function M(t){return"z"in t?t.z:c.z}t.MoveDirection=void 0,(P=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",P.bottomLeft="bottom-left",P.bottomRight="bottom-right",P.left="left",P.none="none",P.right="right",P.top="top",P.topLeft="top-left",P.topRight="top-right",P.outside="outside",P.inside="inside";class k{x;y;z;constructor(t=c.x,e=c.y,i=c.z){this.x=t,this.y=e,this.z=i}static get origin(){return k.create(c.x,c.y,c.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 k.create(t.x,t.y,M(t))}static create(t,e,i){return"number"==typeof t?new k(t,e??c.y,i??c.z):new k(t.x,t.y,M(t))}add(t){return k.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 k.clone(this)}div(t){return k.create(this.x/t,this.y/t,this.z/t)}getLengthSq(){return this.x**2+this.y**2}mult(t){return k.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 k.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),c.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=M(t)}sub(t){return k.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 D extends k{constructor(t=c.x,e=c.y){super(t,e,c.z)}static get origin(){return D.create(c.x,c.y)}static clone(t){return D.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new D(t,e??c.y):new D(t.x,t.y)}}function C(t){return"boolean"==typeof t}function O(t){return"string"==typeof t}function S(t){return"number"==typeof t}function z(t){return"object"==typeof t&&null!==t}function I(t){return Array.isArray(t)}function T(t){return null==t}const R=Math.PI/180;let E=Math.random;const _={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function L(){return V(E(),0,1-Number.EPSILON)}function A(t,e){return L()*(e-t)+t}function B(t){return _.nextFrame(t)}function F(t){_.cancel(t)}function V(t,e,i){return Math.min(Math.max(t,e),i)}function U(t,e,i,n){return Math.floor((t*i+e*n)/(i+n))}function H(t){const e=$(t);let i=W(t);return e===i&&(i=0),A(i,e)}function q(t){return S(t)?t:H(t)}function W(t){return S(t)?t:t.min}function $(t){return S(t)?t:t.max}function j(t,e){if(t===e||void 0===e&&S(t))return t;const i=W(t),n=$(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(n,e)}:j(i,n)}function G(t,e){const i=t.x-e.x,n=t.y-e.y;return{dx:i,dy:n,distance:Math.hypot(i,n)}}function N(t,e){const i=t.x-e.x,n=t.y-e.y;return i*i+n*n}function X(t,e){return Math.sqrt(N(t,e))}function Y(t,e,i){return N(t,e)<=i*i}function Q(t){return t*R}function K(e,i,n){if(S(e))return Q(e);switch(e){case t.MoveDirection.top:return-Math.PI*o;case t.MoveDirection.topRight:return-Math.PI*w;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*w;case t.MoveDirection.bottom:return Math.PI*o;case t.MoveDirection.bottomLeft:return Math.PI*x;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*x;case t.MoveDirection.inside:return Math.atan2(n.y-i.y,n.x-i.x);case t.MoveDirection.outside:return Math.atan2(i.y-n.y,i.x-n.x);default:return L()*u}}function Z(t){const e=D.origin;return e.length=1,e.angle=t,e}function J(t,e,i,n){return D.create(t.x*(i-n)/(i+n)+2*e.x*n/(i+n),t.y)}function tt(t){return{x:(t.position?.x??L()*a)*t.size.width/a,y:(t.position?.y??L()*a)*t.size.height/a}}function et(t){const{position:e,size:i}=t;return{x:e?.x??L()*i.width,y:e?.y??L()*i.height}}function it(t){return t?t.endsWith("%")?parseFloat(t)/a:parseFloat(t):1}var nt,st;t.OutModeDirection=void 0,(nt=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",nt.left="left",nt.right="right",nt.top="top",t.PixelMode=void 0,(st=t.PixelMode||(t.PixelMode={})).precise="precise",st.percent="percent";function at(){return globalThis.document}function ot(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function rt(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function ct(t,e){return t===e||I(e)&&e.includes(t)}function lt(t,e,i=!0){return t[void 0!==e&&i?e%t.length:Math.floor(L()*t.length)]}function dt(t,e,i,n,s){return ht(ut(t,n??0),e,i,s)}function ht(e,i,n,s){let a=!0;return s&&s!==t.OutModeDirection.bottom||(a=e.top<i.height+n.x),!a||s&&s!==t.OutModeDirection.left||(a=e.right>n.x),!a||s&&s!==t.OutModeDirection.right||(a=e.left<i.width+n.y),!a||s&&s!==t.OutModeDirection.top||(a=e.bottom>n.y),a}function ut(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function pt(t,...e){for(const i of e){if(T(i))continue;if(!z(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):z(t)&&!Array.isArray(t)||(t={});const e=Object.keys(i),n=new Set(["__proto__","constructor","prototype"]);if(!e.some(t=>{const e=i[t];return z(e)||Array.isArray(e)})){const s=i,a=t;for(const t of e)if(!n.has(t)&&t in s){const e=s[t];void 0!==e&&(a[t]=e)}continue}for(const s of e){if(n.has(s))continue;const e=t,a=i[s];e[s]=Array.isArray(a)?a.map(t=>pt(void 0,t)):pt(e[s],a)}}return t}function gt(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:D.create(q(t.options.bounce.horizontal.value),q(t.options.bounce.vertical.value))}}function ft(t,e){const{x:i,y:n}=t.velocity.sub(e.velocity),[s,a]=[t.position,e.position],{dx:o,dy:r}=G(a,s);if(i*o+n*r<0)return;const c=-Math.atan2(r,o),l=t.mass,d=e.mass,h=t.velocity.rotate(c),u=e.velocity.rotate(c),p=J(h,u,l,d),g=J(u,h,l,d),f=p.rotate(-c),m=g.rotate(-c);t.velocity.x=f.x*t.factor.x,t.velocity.y=f.y*t.factor.y,e.velocity.x=m.x*e.factor.x,e.velocity.y=m.y*e.factor.y}function mt(t,e){return I(t)?t.map((t,i)=>e(t,i)):e(t,0)}function yt(t,e,i){return I(t)?lt(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/a*i.width,y:e.y/a*i.height}:{width:e.width/a*i.width,height:e.height/a*i.height}}(e,i)}function bt(t){const e=at().createElement("div").style;for(const i in t){const n=t[i];if(!(i in t)||T(n))continue;const s=t.getPropertyValue?.(n);if(!s)continue;const a=t.getPropertyPriority?.(n);a?e.setProperty(n,s,a):e.setProperty(n,s)}return e}let wt,xt;function Pt(t){if(wt!==t||!xt){wt=t;const e=at().createElement("div").style,i=10,n={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 n){const i=n[t];void 0!==i&&e.setProperty(t,i)}xt=e}return xt}function Mt(t,e,i,n,s){if(n){let n={passive:!0};C(s)?n.capture=s:void 0!==s&&(n=s),t.addEventListener(e,i,n)}else{const n=s;t.removeEventListener(e,i,n)}}async function kt(t,e,i,n=!1){let s=e.get(t);return s&&!n||(s=await Promise.all([...i.values()].map(e=>e(t))),e.set(t,s)),s}async function Dt(t,e,i,n=!1){let s=e.get(t);if(!s||n){const n=await Promise.all([...i.entries()].map(([e,i])=>i(t).then(t=>[e,t])));s=new Map(n),e.set(t,s)}return s}class Ct{#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 n=i.length,s=i.indexOf(e);s<0||(1===n?this.#e.delete(t):i.splice(s,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 St{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;#n=new Map;#s;#a=new Set;#o=!1;#r=!1;#c=new Set;constructor(t){this.#s=t}get configs(){const t={};for(const[e,i]of this.#n)t[e]=i;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(e){const i=e.key??e.name??"default";this.#n.set(i,e),this.#s.dispatchEvent(t.EventType.configAdded,{data:{name:i,config:e}})}addEasing(t,e){this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.initializers.effects.set(t,e)}addPalette(t,e){this.palettes.set(t,e)}addParticleUpdater(t,e){this.initializers.updaters.set(t,e)}addPlugin(t){this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,e,i=!1){!i&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){for(const i of t)this.initializers.shapes.set(i,e)}clearPlugins(t){this.effectDrawers.delete(t),this.shapeDrawers.delete(t),this.updaters.delete(t)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getEffectDrawers(t,e=!1){return Dt(t,this.effectDrawers,this.initializers.effects,e)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.plugins.find(e=>e.id===t)}getPreset(t){return this.presets.get(t)}async getShapeDrawers(t,e=!1){return Dt(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return 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.#c);try{for(const t of this.#i)await this.#l(t,this.#a,this.#i)}finally{this.#c.clear(),this.#r=!1,this.#o=!0}}}loadParticlesOptions(t,e,...i){const n=this.updaters.get(t);n&&n.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.#l(e,this.#a,this.#i):this.#c.add(e)}async#l(t,e,i){e.has(t)||(e.add(t),i.add(t),await t(this.#s))}}const zt=t=>(...e)=>{t(...e)},It={debug:zt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:zt(console.info),log:zt(console.log),trace:zt(console.trace),verbose:zt(console.log),warning:zt(console.warn)};function Tt(){return It}const Rt="100%";class Et{pluginManager=new St(this);#d=[];#h=new Ct;#o=!1;get items(){return this.#d}get version(){return"4.2.1"}addEventListener(t,e){this.#h.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.#h.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:n}=await Promise.resolve().then(function(){return ro}),s=t.id??i?.id??`tsparticles${Math.floor(1e4*L()).toString()}`,{index:a,url:o}=t,r=o?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():(Tt().error(`${i.status.toString()} while retrieving config file`),t.fallback)}({fallback:t.options,url:o,index:a}):t.options,c=yt(r,a),{items:l}=this,d=l.findIndex(t=>t.id.description===s),h=new n({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:s,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(h);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:c});if(d>=0){const t=this.item(d),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),l.splice(d,e,h)}else l.push(h);const u="undefined"!=typeof OffscreenCanvas&&t.element instanceof OffscreenCanvas?t.element:(t=>{const i=at();let n;if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===f)n=t,n.dataset[e]??=g,n.dataset[e]===p&&(n.style.width||=Rt,n.style.height||=Rt,n.style.pointerEvents="none",n.style.setProperty("pointer-events","none"));else{const s=t.getElementsByTagName(f).item(0);s?(n=s,n.dataset[e]=g):(n=i.createElement(f),n.dataset[e]=p,t.appendChild(n)),n.style.width||=Rt,n.style.height||=Rt,n.style.pointerEvents="none",n.style.setProperty("pointer-events","none")}return n})(((t,i)=>{const n=at();let s=i??n.getElementById(t);return s||(s=n.createElement("canvas"),s.id=t,s.dataset[e]=p,n.body.append(s),s)})(s,i));return h.canvas.loadCanvas(u),await h.start(),h}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this.#h.removeEventListener(t,e)}}var _t,Lt,At,Bt,Ft,Vt,Ut,Ht,qt,Wt,$t;!function(t){t.circle="circle",t.rectangle="rectangle"}(_t||(_t={}));class jt{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 Gt extends jt{radius;constructor(t,e,i){super(t,e,_t.circle),this.radius=i}contains(t){return Y(t,this.position,this.radius)}intersects(t){const e=this.position,i=t.position,n=this.radius,s=Math.abs(i.x-e.x),a=Math.abs(i.y-e.y);if(t instanceof Gt||t.type===_t.circle){return n+t.radius>Math.hypot(s,a)}if(t instanceof Nt||t.type===_t.rectangle){const e=t,{width:i,height:o}=e.size;return Math.pow(s-i,2)+Math.pow(a-o,2)<=n**2||s<=n+i&&a<=n+o||s<=i||a<=o}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class Nt extends jt{size;constructor(t,e,i,n){super(t,e,_t.rectangle),this.size={height:n,width:i}}contains(t){const e=this.size.width,i=this.size.height,n=this.position;return t.x>=n.x&&t.x<=n.x+e&&t.y>=n.y&&t.y<=n.y+i}intersects(t){if(t instanceof Gt)return t.intersects(this);if(!(t instanceof Nt))return!1;const e=this.size.width,i=this.size.height,n=this.position,s=t.position,a=t.size,o=a.width,r=a.height;return s.x<n.x+e&&s.x+o>n.x&&s.y<n.y+i&&s.y+r>n.y}reset(t,e,i,n){return this._resetPosition(t,e),this.size.width=i,this.size.height=n,this}}t.RotateDirection=void 0,(Lt=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Lt.counterClockwise="counter-clockwise",Lt.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,(Bt=t.LimitMode||(t.LimitMode={})).delete="delete",Bt.wait="wait",t.OutMode=void 0,(Ft=t.OutMode||(t.OutMode={})).bounce="bounce",Ft.none="none",Ft.out="out",Ft.destroy="destroy",Ft.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,(Ht=t.GradientType||(t.GradientType={})).linear="linear",Ht.radial="radial",Ht.random="random",t.ParticleOutType=void 0,(qt=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",qt.inside="inside",qt.outside="outside",t.StartValueType=void 0,(Wt=t.StartValueType||(t.StartValueType={})).max="max",Wt.min="min",Wt.random="random",t.AnimationStatus=void 0,($t=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",$t.decreasing="decreasing";class Xt{load(t){T(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 Kt(t,e,i){void 0!==i&&(t[e]=j(i))}function Zt(t,e,i){void 0!==i&&t[e].load(i)}function Jt(t,e,i,n){if(void 0!==i){const s=t;s[e]??=n(),s[e].load(i)}}function te(t,e,i,...n){const s=t;s[e]??=new i;const a=s[e];for(const t of n)a.load(t?.[e])}class ee extends Xt{count=0;decay=0;delay=0;enable=!1;speed=1;sync=!1;doLoad(t){Kt(this,"count",t.count),Qt(this,"enable",t.enable),Kt(this,"speed",t.speed),Kt(this,"decay",t.decay),Kt(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 ne 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),Kt(this,"offset",t.offset)}}class se extends Xt{h=new ne(0,y);l=new ne(0,b);s=new ne(0,v);doLoad(t){this.h.load(t.h),this.s.load(t.s),this.l.load(t.l)}}class ae extends Xt{value="";static create(t,e){const i=new ae;return i.load(t),void 0!==e&&(O(e)||I(e)?i.load({value:e}):i.load(e)),i}doLoad(t){T(t.value)||(this.value=t.value)}}class oe extends ae{animation=new se;static create(t,e){const i=new oe;return i.load(t),void 0!==e&&(O(e)||I(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 ae,this.color.value=""}doLoad(t){void 0!==t.color&&(this.color=ae.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 ce extends Xt{enable=!0;zIndex=0;doLoad(t){Qt(this,"enable",t.enable),Qt(this,"zIndex",t.zIndex)}}class le extends Xt{delay=.5;enable=!0;doLoad(t){Qt(this,"delay",t.delay),Qt(this,"enable",t.enable)}}class de 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]=pt(this.options[t]??{},i))}Qt(this,"close",t.close),Qt(this,"type",t.type)}}class he extends Xt{color;enable=!0;opacity=1;doLoad(t){void 0!==t.color&&(this.color=oe.create(this.color,t.color)),Qt(this,"enable",t.enable),Kt(this,"opacity",t.opacity)}}class ue extends Xt{offset=0;value=90;doLoad(t){Kt(this,"offset",t.offset),Kt(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 ge extends Xt{acceleration=9.81;enable=!1;inverse=!1;maxSpeed=50;doLoad(t){Kt(this,"acceleration",t.acceleration),Qt(this,"enable",t.enable),Qt(this,"inverse",t.inverse),Kt(this,"maxSpeed",t.maxSpeed)}}class fe extends Xt{value=0;doLoad(t){T(t.value)||(this.value=j(t.value))}}class me extends fe{animation=new ee;doLoad(t){super.doLoad(t),Zt(this,"animation",t.animation)}}class ye extends me{animation=new ie}class ve extends Xt{clamp=!0;delay=new fe;enable=!1;generator;options={};doLoad(t){Qt(this,"clamp",t.clamp),this.delay.load(t.delay),Qt(this,"enable",t.enable),this.generator=t.generator,t.options&&(this.options=pt(this.options,t.options))}}class be 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 we extends Xt{acceleration=0;enable=!1;position;doLoad(t){Kt(this,"acceleration",t.acceleration),Qt(this,"enable",t.enable),t.position&&(this.position=pt({},t.position))}}class xe extends Xt{angle=new ue;center=new pe;decay=0;direction=t.MoveDirection.none;distance={};drift=0;enable=!1;gravity=new ge;outModes=new be;path=new ve;random=!1;size=!1;speed=2;spin=new we;straight=!1;vibrate=!1;warp=!1;doLoad(t){this.angle.load(S(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),Kt(this,"decay",t.decay),Qt(this,"direction",t.direction),void 0!==t.distance&&(this.distance=S(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),Kt(this,"drift",t.drift),Qt(this,"enable",t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(z(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),Kt(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 Pe extends Xt{color;opacity;width=0;doLoad(t){void 0!==t.color&&(this.color=oe.create(this.color,t.color)),Kt(this,"width",t.width),Kt(this,"opacity",t.opacity)}}class Me extends Xt{color;fill;stroke;doLoad(t){void 0!==t.color&&(this.color=oe.create(this.color,t.color)),Jt(this,"fill",t.fill,()=>new he),Jt(this,"stroke",t.stroke,()=>new Pe)}}class ke extends fe{value=1}class De extends Xt{horizontal=new ke;vertical=new ke;doLoad(t){this.horizontal.load(t.horizontal),this.vertical.load(t.vertical)}}class Ce 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 Se extends Xt{density=new Ce;limit=new Oe;value=0;doLoad(t){this.density.load(t.density),this.limit.load(t.limit),Qt(this,"value",t.value)}}class ze 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]=pt(this.options[t]??{},i))}Qt(this,"close",t.close),Qt(this,"type",t.type)}}class Ie extends fe{opacityRate=1;sizeRate=1;velocityRate=1;doLoad(t){super.doLoad(t),Qt(this,"opacityRate",t.opacityRate),Qt(this,"sizeRate",t.sizeRate),Qt(this,"velocityRate",t.velocityRate)}}class Te extends Xt{bounce=new De;effect=new de;groups={};move=new xe;number=new Se;paint;palette;reduceDuplicates=!1;shape=new ze;zIndex=new Ie;#u;#p;constructor(t,e){super(),this.#p=t,this.#u=e,this.paint=new Me,this.paint.color=new oe,this.paint.color.value="#fff",this.paint.fill=new he,this.paint.fill.enable=!0}doLoad(t){if(t.palette&&(this.palette=t.palette,this.#g(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]=pt(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&&(I(e)?this.paint=mt(e,t=>{const e=new Me;return e.load(t),e}):I(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)}}#g(t){const e=this.#p.getPalette(t);if(!e)return;const i=e.colors,n=(I(i)?i:[i]).flatMap(t=>{const e=t.fill,i=t.stroke,n=e?{color:{value:e.value},enable:e.enable,opacity:e.opacity}:void 0;return i?[{fill:n,stroke:{color:{value:i.value},opacity:i.opacity,width:i.width||0}}]:[{fill:n}]}),s=n.length>1?n:n[0]??{};this.load({paint:s,blend:{enable:!0,mode:e.blendMode}})}}function Re(t,e,...i){const n=new Te(t,e);return Yt(n,...i),n}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 ce,this.particles=Re(this.#p,this.#u),this.resize=new le}doLoad(t){void 0!==t.preset&&(this.preset=t.preset,mt(this.preset,t=>{this.#f(t)})),void 0!==t.palette&&(this.palette=t.palette,this.#g(this.palette)),Qt(this,"autoPlay",t.autoPlay),Qt(this,"clear",t.clear),Qt(this,"key",t.key),Qt(this,"name",t.name),Kt(this,"delay",t.delay),Qt(this,"detectRetina",t.detectRetina),Kt(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;C(e)?this.fullScreen.enable=e:this.fullScreen.load(e),this.particles.load(t.particles),this.resize.load(t.resize),this.style=pt(this.style,t.style),Qt(this,"smooth",t.smooth),this.#p.plugins.forEach(e=>{e.loadOptions(this.#u,this,t)})}#g(t){const e=this.#p.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})}#f(t){this.load(this.#p.getPreset(t))}}const _e=new Map;function Le(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 Be(t,e,i,n=!0){if(!e)return;const s=O(e)?{value:e}:e;if(O(s.value))return Fe(t,s.value,i,n);if(I(s.value)){const e=lt(s.value,i,n);if(!e)return;return Be(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(s);if(t)return t}}function Fe(t,e,i,n=!0){if(!e)return;const s=O(e)?{value:e}:e;if(O(s.value))return s.value===d?je():He(t,s.value);if(I(s.value)){const e=lt(s.value,i,n);if(!e)return;return Fe(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(s);if(t)return t}}function Ve(t,e,i,n=!0){const s=Be(t,e,i,n);return s?Ue(s):void 0}function Ue(t){const e=t.r/m,i=t.g/m,n=t.b/m,s=Math.max(e,i,n),a=Math.min(e,i,n),r={h:0,l:(s+a)*o,s:0};return s!==a&&(r.s=r.l<o?(s-a)/(s+a):(s-a)/(2-s-a),r.h=e===s?(i-n)/(s-a):i===s?2+(n-e)/(s-a):4+(e-i)/(s-a)),r.l*=b,r.s*=v,r.h*=60,r.h<0&&(r.h+=y),r.h>=y&&(r.h-=y),r}function He(t,e){return Ae(t,e)}function qe(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)),n=Math.max(0,Math.min(b,t.l)),s=e/y,a=i/v,r=n/b;if(0===i){const t=Math.round(r*m);return{r:t,g:t,b:t}}const c=r<o?r*(1+a):r+a-r*a,l=2*r-c,d=1/3,h=Math.min(m,m*qe(l,c,s+d)),u=Math.min(m,m*qe(l,c,s)),p=Math.min(m,m*qe(l,c,s-d));return{r:Math.round(h),g:Math.round(u),b:Math.round(p)}}function $e(t){const e=We(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}function je(t){const e=t??0,i=()=>Math.floor(A(e,256));return{b:i(),g:i(),r:i()}}function Ge(t,e,i){const n=i??1;return Le(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${e?"hdr":"sdr"}-${n.toString()}`,()=>e?function(t,e,i=400){const n=i/203;return`color(display-p3 ${(t.r/m*n).toString()} ${(t.g/m*n).toString()} ${(t.b/m*n).toString()} / ${(e??1).toString()})`}(t,i):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(t,i))}function Ne(t,e,i){const n=i??1;return Le(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${e?"hdr":"sdr"}-${n.toString()}`,()=>e?Ge(We(t),!0,i):`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${n.toString()})`)}function Xe(t,e,i,n){let s=t,a=e;return"r"in s||(s=We(t)),"r"in a||(a=We(e)),{b:U(s.b,a.b,i,n),g:U(s.g,a.g,i,n),r:U(s.r,a.r,i,n)}}function Ye(t,e,i){if(i===d)return je();if(i!==h)return i;{const i=t.getFillColor()??t.getStrokeColor(),n=e?.getFillColor()??e?.getStrokeColor();if(i&&n&&e)return Xe(i,n,t.getRadius(),e.getRadius());{const t=i??n;if(t)return We(t)}}}function Qe(t,e,i,n){const s=O(e)?e:e.value;return s===d?n?Be(t,{value:s}):i?d:h:s===h?h:Be(t,{value:s})}function Ke(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function Ze(t,e,i){const n={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:b}};return e&&(Je(n.h,e.h,i),Je(n.s,e.s,i),Je(n.l,e.l,i)),n}function Je(e,i,n){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=q(i.speed)/a*n,e.decay=1-q(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=q(i.count),e.time=0,e.delayTime=q(i.delay)*r,i.sync||(e.velocity*=L(),e.value*=L()),e.initialValue=e.value,e.offset=j(i.offset)):e.velocity=0}function ti(e,i,n){if(!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;if(e.time??=0,(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=n.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0))return;const s=e.offset?H(e.offset):0,a=(e.velocity??0)*n.factor+3.6*s,o=e.decay??1,r=e.max,c=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=a,e.value<c&&(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,c,r)}function ei(t,e){if(!t)return;const{h:i,s:n,l:s}=t;ti(i,!1,e),ti(n,!0,e),ti(s,!0,e)}function ii(e,i,n){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*n}}const ni=new Et;class si{enable=!1;mode="destination-out";load(t){T(t)||(Qt(this,"mode",t.mode),Qt(this,"enable",t.enable))}}class ai{id="blend";async getPlugin(t){const{BlendPluginInstance:e}=await Promise.resolve().then(function(){return co});return new e(t)}loadOptions(t,e,i){if(!this.needsPlugin(e)&&!this.needsPlugin(i))return;let n=e.blend;n?.load||(e.blend=n=new si),n.load(i?.blend)}loadParticlesOptions(t,e,i){e.blend??=new si,e.blend.load(i?.blend)}needsPlugin(t){return!!t?.blend?.enable||!!t?.particles?.blend?.enable}}async function oi(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new ai)})}class ri{draw(t){!function(t){const{context:e,particle:i,radius:n}=t;i.circleRange??={min:0,max:u};const s=i.circleRange;e.arc(c.x,c.y,n,s.min,s.max,!1)}(t)}getSidesCount(){return 12}particleInit(t,e){const i=e.shapeData,n=i?.angle??{max:360,min:0};e.circleRange=z(n)?{min:Q(n.min),max:Q(n.max)}:{min:0,max:Q(n)}}}async function ci(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["circle"],()=>Promise.resolve(new ri))})}var li;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"}(li||(li={}));const di=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,hi=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class ui{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(di,(t,e,i,n,s)=>e+e+i+i+n+n+(void 0===s?"":s+s)),i=hi.exec(e);return i?{a:i[li.a]?Number.parseInt(i[li.a],16)/255:1,b:Number.parseInt(i[li.b]??"0",16),g:Number.parseInt(i[li.g]??"0",16),r:Number.parseInt(i[li.r]??"0",16)}:void 0}}async function pi(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hex",new ui)})}var gi;!function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"}(gi||(gi={}));const fi=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class mi{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:q(e.h),l:q(e.l),s:q(e.s)})}parseString(t){if(!this.accepts(t))return;const e=fi.exec(t);return e?$e({a:e.length>4?it(e[gi.a]):1,h:Number.parseInt(e[gi.h]??"0",10),l:Number.parseInt(e[gi.l]??"0",10),s:Number.parseInt(e[gi.s]??"0",10)}):void 0}}async function yi(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hsl",new mi)})}class vi{id="move";#p;constructor(t){this.#p=t}async getPlugin(t){const{MovePluginInstance:e}=await Promise.resolve().then(function(){return ho});return new e(this.#p,t)}loadOptions(){}needsPlugin(){return!0}}async function bi(t){t.checkVersion("4.2.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,Dt(t,e.pathGenerators,e.initializers.pathGenerators,i)),t.pluginManager.addPlugin(new vi(t.pluginManager))})}function wi(e,i){const n=e.value,s=e.animation,a={delayTime:q(s.delay)*r,enable:s.enable,value:q(e.value)*i,max:$(n)*i,min:W(n)*i,loops:0,maxLoops:q(s.count),time:0};if(s.enable){switch(a.decay=1-q(s.decay),s.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=L()>=o?t.AnimationStatus.increasing:t.AnimationStatus.decreasing}const e=s.mode===t.AnimationMode.auto;switch(s.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=H(a),e&&(a.status=L()>=o?t.AnimationStatus.increasing:t.AnimationStatus.decreasing)}}return a.initialValue=a.value,a}function xi(e,i,n,s,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,c=i.max,l=i.decay??1;i.time??=0;const d=i.delayTime??0;if(!(d>0&&i.time<d&&(i.time+=a.value,i.time<d))){switch(i.status){case t.AnimationStatus.increasing:i.value+=o;break;case t.AnimationStatus.decreasing:i.value-=o}switch(i.velocity&&1!==l&&(i.velocity*=l),i.status){case t.AnimationStatus.increasing:i.value>=c&&(n?i.status=t.AnimationStatus.decreasing:i.value-=c,i.loops??=0,i.loops++);break;case t.AnimationStatus.decreasing:i.value<=r&&(n?i.status=t.AnimationStatus.increasing:i.value+=c,i.loops??=0,i.loops++)}!function(e,i,n,s,a){switch(i){case t.DestroyType.max:n>=a&&e.destroy();break;case t.DestroyType.min:n<=s&&e.destroy()}}(e,s,i.value,r,c),e.destroyed||(i.value=V(i.value,r,c))}}class Pi extends ie{destroy=t.DestroyType.none;load(t){super.load(t),T(t)||Qt(this,"destroy",t.destroy)}}class Mi extends ye{animation=new Pi;value=1;load(t){if(T(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class ki{#u;constructor(t){this.#u=t}init(t){const e=t.options.opacity;if(!e)return;t.opacity=wi(e,1);const i=e.animation;i.enable&&(t.opacity.velocity=q(i.speed)/a*this.#u.retina.reduceFactor,i.sync||(t.opacity.velocity*=L()))}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",Mi,...e)}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&t.options.opacity&&xi(t,t.opacity,!0,t.options.opacity.animation.destroy,e)}}async function Di(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new ki(t)))})}class Ci{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,n,s){if(!this.modes.includes(s))return;const a=this.#u;let o=!1;for(const t of this.#y)if(o=t.particleBounce?.(e,n,i)??!1,o)break;if(o)return;const r=e.getPosition(),c=e.offset,l=e.getRadius(),d=ut(r,l),h=a.canvas.size,u=!e.isInsideCanvasForOutMode(s,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 n=!1;if(e.outOfCanvas&&(e.direction===t.OutModeDirection.right&&i>0||e.direction===t.OutModeDirection.left&&i<0)){const t=q(e.particle.options.bounce.horizontal.value);e.particle.velocity.x*=-t,n=!0}if(!n)return;const s=e.offset.x+e.size;e.outOfCanvas&&e.direction===t.OutModeDirection.right?e.particle.position.x=e.canvasSize.width-s:e.outOfCanvas&&e.direction===t.OutModeDirection.left&&(e.particle.position.x=s),e.outMode===t.OutMode.split&&e.particle.destroy()}({particle:e,outMode:s,direction:i,bounds:d,canvasSize:h,offset:c,outOfCanvas:u,size:l}),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 n=!1;if(e.outOfCanvas&&(e.direction===t.OutModeDirection.bottom&&i>0||e.direction===t.OutModeDirection.top&&i<0)){const t=q(e.particle.options.bounce.vertical.value);e.particle.velocity.y*=-t,n=!0}if(!n)return;const s=e.offset.y+e.size;e.outOfCanvas&&e.direction===t.OutModeDirection.bottom?e.particle.position.y=e.canvasSize.height-s:e.outOfCanvas&&e.direction===t.OutModeDirection.top&&(e.particle.position.y=s),e.outMode===t.OutMode.split&&e.particle.destroy()}({particle:e,outMode:s,direction:i,bounds:d,canvasSize:h,offset:c,outOfCanvas:u,size:l})}}class Oi{modes;constructor(e){this.modes=[t.OutMode.destroy]}update(e,i,n,s){if(this.modes.includes(s)){switch(e.outType){case t.ParticleOutType.normal:case t.ParticleOutType.outside:if(e.isInsideCanvasForOutMode(s,i))return;break;case t.ParticleOutType.inside:{const{dx:t,dy:i}=G(e.position,e.moveCenter),{x:n,y:s}=e.velocity;if(n<0&&t>e.moveCenter.radius||s<0&&i>e.moveCenter.radius||n>=0&&t<-e.moveCenter.radius||s>=0&&i<-e.moveCenter.radius)return;break}}e.destroy(!0)}}}class Si{modes;#u;constructor(e){this.#u=e,this.modes=[t.OutMode.none]}update(e,i,n,s){if(!this.modes.includes(s))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,l=e.getRadius();if(a.enable){const n=e.position;(!a.inverse&&n.y>r.height+l&&i===t.OutModeDirection.bottom||a.inverse&&n.y<-l&&i===t.OutModeDirection.top)&&e.destroy()}else{if(e.velocity.y>0&&e.position.y<=r.height+l||e.velocity.y<0&&e.position.y>=-l||e.velocity.x>0&&e.position.x<=r.width+l||e.velocity.x<0&&e.position.x>=-l)return;dt(e.position,o.canvas.size,c,l,i)||e.destroy()}}}const zi=D.origin;class Ii{modes;#u;constructor(e){this.#u=e,this.modes=[t.OutMode.out]}update(e,i,n,s){if(!this.modes.includes(s))return;const a=this.#u;switch(e.outType){case t.ParticleOutType.inside:{const{x:t,y:i}=e.velocity;zi.setTo(c),zi.length=e.moveCenter.radius,zi.angle=e.velocity.angle+Math.PI,zi.addTo(e.moveCenter);const{dx:n,dy:s}=G(e.position,zi);if(t<=0&&n>=0||i<=0&&s>=0||t>=0&&n<=0||i>=0&&s<=0)return;e.position.x=Math.floor(H({min:0,max:a.canvas.size.width})),e.position.y=Math.floor(H({min:0,max:a.canvas.size.height}));const{dx:o,dy:r}=G(e.position,e.moveCenter);e.direction=Math.atan2(-r,-o),e.velocity.angle=e.direction,e.justWarped=!0;break}default:if(e.isInsideCanvasForOutMode(s,i))return;switch(e.outType){case t.ParticleOutType.outside:{e.position.x=Math.floor(H({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.x,e.position.y=Math.floor(H({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.y;const{dx:t,dy:i}=G(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 n=e.options.move.warp,s=a.canvas.size,o={bottom:s.height+e.getRadius()+e.offset.y,left:-e.getRadius()-e.offset.x,right:s.width+e.getRadius()+e.offset.x,top:-e.getRadius()-e.offset.y},r=e.getRadius(),c=ut(e.position,r);i===t.OutModeDirection.right&&c.left>s.width+e.offset.x?(e.position.x=o.left,e.initialPosition.x=e.position.x,n||(e.position.y=L()*s.height,e.initialPosition.y=e.position.y),e.justWarped=!0):i===t.OutModeDirection.left&&c.right<-e.offset.x&&(e.position.x=o.right,e.initialPosition.x=e.position.x,n||(e.position.y=L()*s.height,e.initialPosition.y=e.position.y),e.justWarped=!0),i===t.OutModeDirection.bottom&&c.top>s.height+e.offset.y?(n||(e.position.x=L()*s.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&&c.bottom<-e.offset.y&&(n||(e.position.x=L()*s.width,e.initialPosition.x=e.position.x),e.position.y=o.bottom,e.initialPosition.y=e.position.y,e.justWarped=!0);break}}}}}class Ti{updaters;#u;constructor(t){this.#u=t,this.updaters=new Map}init(e){this.#v(e,t.OutMode.bounce,t=>new Ci(t)),this.#v(e,t.OutMode.out,t=>new Ii(t)),this.#v(e,t.OutMode.destroy,t=>new Oi(t)),this.#v(e,t.OutMode.none,t=>new Si(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(e,i){const n=e.options.move.outModes;e.justWarped=!1,this.#b(e,i,n.bottom??n.default,t.OutModeDirection.bottom),this.#b(e,i,n.left??n.default,t.OutModeDirection.left),this.#b(e,i,n.right??n.default,t.OutModeDirection.right),this.#b(e,i,n.top??n.default,t.OutModeDirection.top)}#v(t,e,i){const n=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)(n,e)&&this.updaters.set(e,i(this.#u))}#b(t,e,i,n){for(const s of this.updaters.values())s.update(t,n,e,i)}}async function Ri(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("outModes",t=>Promise.resolve(new Ti(t)))})}class Ei{#u;#p;constructor(t,e){this.#u=e,this.#p=t}init(t){const e=this.#u,i=t.options,n=yt(i.paint,t.id,i.reduceDuplicates),s=n?.color,a=s??void 0,o=n?.fill,r=n?.stroke;if(o){const i=oe.create(void 0===a?void 0:oe.create(void 0,a),o.color);t.fillEnabled=o.enable,t.fillOpacity=q(o.opacity),t.fillAnimation=i.animation;const n=Ve(this.#p,i);n&&(t.fillColor=Ze(n,t.fillAnimation,e.retina.reduceFactor))}else t.fillEnabled=!1,t.fillAnimation=void 0,t.fillColor=void 0,t.fillOpacity=1;if(r){const i=oe.create(void 0===a?void 0:oe.create(void 0,a),r.color);t.strokeWidth=q(r.width)*e.retina.pixelRatio,t.strokeOpacity=q(r.opacity??1),t.strokeAnimation=i.animation;const n=Ve(this.#p,i)??t.getFillColor();n&&(t.strokeColor=Ze(n,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:n,strokeColor:s}=t,a=!!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),o=!!n&&(void 0!==s?.h.value&&s.h.enable||void 0!==s?.s.value&&s.s.enable||void 0!==s?.l.value&&s.l.enable);return!t.destroyed&&!t.spawning&&(a||o)}update(t,e){this.isEnabled(t)&&(ei(t.fillColor,e),ei(t.strokeColor,e))}}async function _i(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("paint",e=>Promise.resolve(new Ei(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 Ai=/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 Bi{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:q(e.r),g:q(e.g),b:q(e.b)}}parseString(t){if(!this.accepts(t))return;const e=Ai.exec(t);return e?{a:e.length>4?it(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 Fi(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("rgb",new Bi)})}class Vi extends ie{destroy=t.DestroyType.none;load(t){super.load(t),T(t)||Qt(this,"destroy",t.destroy)}}class Ui extends ye{animation=new Vi;value=3;load(t){if(super.load(t),T(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class Hi{#u;constructor(t){this.#u=t}init(t){const e=this.#u,i=t.options.size;if(!i)return;const n=i.animation;n.enable&&(t.size.velocity=t.retina.sizeAnimationSpeed/a*e.retina.reduceFactor,n.sync||(t.size.velocity*=L()))}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",Ui,...e)}preInit(t){const e=this.#u.retina.pixelRatio,i=t.options.size;i&&(t.size=wi(i,e),t.retina.sizeAnimationSpeed=q(i.animation.speed)*e)}reset(t){t.size.time=0,t.size.loops=0}update(t,e){this.isEnabled(t)&&t.options.size&&xi(t,t.size,!0,t.options.size.animation.destroy,e)}}async function qi(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("size",t=>Promise.resolve(new Hi(t)))})}async function Wi(t){t.checkVersion("4.2.1"),await t.pluginManager.register(async t=>{await Promise.all([oi(t),pi(t),yi(t),Fi(t),bi(t),ci(t),_i(t),Di(t),Ri(t),qi(t)])})}const $i=new Map;async function ji(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{for(const[e,i]of $i)t.pluginManager.addEasing(e,i)})}$i.set("ease-in-quad",t=>t**2),$i.set("ease-out-quad",t=>1-(1-t)**2),$i.set("ease-in-out-quad",t=>t<.5?2*t**2:1-(-2*t+2)**2/2);const Gi=["emoji"];function Ni(t,e,i){t.beginPath(),t.moveTo(e.x,e.y),t.lineTo(i.x,i.y),t.closePath()}async function Xi(t,e){try{await at().fonts.load(`${e??"400"} 36px '${t??"Verdana"}'`)}catch{}}const Yi='"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif';class Qi{#w=new Map;destroy(){for(const[t,e]of this.#w)e instanceof ImageBitmap&&e.close(),this.#w.delete(t)}draw(t){const e=t.particle.emojiDataKey;if(!e)return;const i=this.#w.get(e);i&&function(t,e){const{context:i,opacity:n}=t,s=i.globalAlpha,a=e.width,r=a*o;i.globalAlpha=n,i.drawImage(e,-r,-r,a,a),i.globalAlpha=s}(t,i)}async init(t){const e=t.actualOptions.particles.shape;if(!Gi.some(t=>ct(t,e.type)))return;const i=[Xi(Yi)];mt(Gi.map(t=>e.options[t])[0],t=>{t.font&&i.push(Xi(t.font))}),await Promise.all(i)}particleDestroy(t){t.emojiDataKey=void 0}particleInit(t,e){const i=e.shapeData;if(!i.value)return;const n=yt(i.value,e.randomIndexData);if(!n)return;const s="string"==typeof n?{font:i.font??Yi,padding:i.padding??0,value:n}:{font:Yi,padding:0,...i,...n},a=s.font,o=s.value,r=`${o}_${a}`;if(this.#w.has(r))return void(e.emojiDataKey=r);const c=2*s.padding,l=$(e.size.value),d=l+c,h=2*d,u=new OffscreenCanvas(h,h),p=u.getContext("2d",t.canvas.render.settings);if(!p)return;p.font=`400 ${(2*l).toString()}px ${a}`,p.textBaseline="middle",p.textAlign="center",p.fillText(o,d,d);const g=u instanceof HTMLCanvasElement?u:u.transferToImageBitmap();this.#w.set(r,g),e.emojiDataKey=r}}async function Ki(t){t.checkVersion("4.2.1"),await t.pluginManager.register(t=>{t.pluginManager.addShape(Gi,()=>Promise.resolve(new Qi))})}class Zi{enable=!1;mode=[];load(t){T(t)||(Qt(this,"enable",t.enable),Qt(this,"mode",t.mode))}}var Ji,tn,en;!function(t){t.circle="circle",t.rectangle="rectangle"}(Ji||(Ji={}));class nn