@tsparticles/confetti
Version:
tsParticles confetti bundle — easily create confetti, confetti cannon, confetti explosions, confetti falling, and confetti parade animations with presets. Ready to use components available for React, Vue.js (2.x and 3.x), Angular, Svelte, jQuery, Preact,
2 lines • 137 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)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},function(t){"use strict";const e=/^\[tsParticles Error (TSP-\d+)\]\s*/,i=t=>(...e)=>{t(...e)},s={debug:i(console.debug),error:(t,...i)=>{if("string"==typeof t){const s=e.exec(t);if(s?.[1])return void console.error(`tsParticles - ${s[1]} - ${t.slice(s[0].length)}`,...i)}console.error(`tsParticles - Error - ${t}`,...i)},info:i(console.info),log:i(console.log),trace:i(console.trace),verbose:i(console.log),warning:i(console.warn)};function n(){return s}var a;t.MoveDirection=void 0,(a=t.MoveDirection||(t.MoveDirection={})).bottom="bottom",a.bottomLeft="bottom-left",a.bottomRight="bottom-right",a.left="left",a.none="none",a.right="right",a.top="top",a.topLeft="top-left",a.topRight="top-right",a.outside="outside",a.inside="inside";const o="generated",r="100%",l="source-over",c="resize",d="visibilitychange",h=100,u=.5,p=1e3,g={x:0,y:0,z:0},f={a:1,b:0,c:0,d:1},m="random",y="mid",v=2*Math.PI,w="true",b="false",P="canvas",x=255,M=360,z=100,C=100,k=.25,S=.75,O=1e4,D=400;function I(t){return"z"in t?t.z:g.z}class E{x;y;z;constructor(t=g.x,e=g.y,i=g.z){this.x=t,this.y=e,this.z=i}static get origin(){return E.create(g.x,g.y,g.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 E.create(t.x,t.y,I(t))}static create(t,e,i){return"number"==typeof t?new E(t,e??g.y,i??g.z):new E(t.x,t.y,I(t))}add(t){return E.create(this.x+t.x,this.y+t.y,this.z+I(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=I(t)}copy(){return E.clone(this)}div(t){return E.create(this.x/t,this.y/t,this.z/t)}getLengthSq(){return this.x*this.x+this.y*this.y}mult(t){return E.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 E.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),g.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=I(t)}sub(t){return E.create(this.x-t.x,this.y-t.y,this.z-I(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=I(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class T extends E{constructor(t=g.x,e=g.y){super(t,e,g.z)}static get origin(){return T.create(g.x,g.y)}static clone(t){return T.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new T(t,e??g.y):new T(t.x,t.y)}}function L(t){return"boolean"==typeof t}function R(t){return"string"==typeof t}function _(t){return"number"==typeof t}function F(t,e){return Object.values(t).some(t=>t===e)}function A(t,e,i){return F(t,e)?e:i}function B(t){return"object"==typeof t&&null!==t}function V(t){return Array.isArray(t)}function U(t){return null==t}const N=Math.PI/180;let H=Math.random;const $={nextFrame:t=>requestAnimationFrame(t),cancel:t=>{cancelAnimationFrame(t)}};function j(){return K(H(),0,1-Number.EPSILON)}function q(t,e){return j()*(e-t)+t}function G(t){return $.nextFrame(t)}function W(t){$.cancel(t)}function K(t,e,i){return Math.min(Math.max(t,e),i)}function Q(t,e,i,s){return Math.floor((t*i+e*s)/(i+s))}function X(t){const e=J(t);let i=Z(t);return e===i&&(i=0),q(i,e)}function Y(t){return _(t)?t:X(t)}function Z(t){return _(t)?t:t.min}function J(t){return _(t)?t:t.max}function tt(t,e){if(t===e||void 0===e&&_(t))return t;const i=Z(t),s=J(t);return void 0!==e?{min:Math.min(i,e),max:Math.max(s,e)}:tt(i,s)}function et(t,e){const i=t.x-e.x,s=t.y-e.y;return i*i+s*s}function it(t,e){return Math.sqrt(et(t,e))}function st(t,e,i){return et(t,e)<=i*i}function nt(t){return t*N}function at(e,i,s){if(_(e))return nt(e);switch(e){case t.MoveDirection.top:return-Math.PI*u;case t.MoveDirection.topRight:return-Math.PI*k;case t.MoveDirection.right:return 0;case t.MoveDirection.bottomRight:return Math.PI*k;case t.MoveDirection.bottom:return Math.PI*u;case t.MoveDirection.bottomLeft:return Math.PI*S;case t.MoveDirection.left:return Math.PI;case t.MoveDirection.topLeft:return-Math.PI*S;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 j()*v}}function ot(t){const e=T.origin;return e.length=1,e.angle=t,e}function rt(t,e,i,s){return T.create(t.x*(i-s)/(i+s)+2*e.x*s/(i+s),t.y)}function lt(t){return{x:(t.position?.x??j()*h)*t.size.width/h,y:(t.position?.y??j()*h)*t.size.height/h}}function ct(t){const e={x:void 0!==t.position?.x?Y(t.position.x):void 0,y:void 0!==t.position?.y?Y(t.position.y):void 0};return lt({size:t.size,position:e})}function dt(t){const{position:e,size:i}=t;return{x:e?.x??j()*i.width,y:e?.y??j()*i.height}}function ht(t){return t?t.endsWith("%")?Number.parseFloat(t)/h:Number.parseFloat(t):1}const ut={engineVersionMismatch:"TSP-1001",particlePositionNotFound:"TSP-1002",pluginRegisterAfterLoad:"TSP-1003",offscreenCanvasUnsupported:"TSP-1101",offscreenCanvasTransferFailed:"TSP-1102",hdrEnableInvalid:"TSP-1201",hdrModeInvalid:"TSP-1202",hdrPeakNitsInvalid:"TSP-1203"};function pt(t,...e){return`[tsParticles Error ${t}] https://particles.js.org/errors/#${t}`}var gt,ft;function mt(t){return"__proto__"===t||"constructor"===t||"prototype"===t}function yt(){return globalThis.document}function vt(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function wt(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function bt(t,e){return t===e||V(e)&&e.includes(t)}function Pt(t,e,i=!0){return t[void 0!==e&&i?e%t.length:Math.floor(j()*t.length)]}function xt(t,e,i,s,n){return Mt(zt(t,s??0),e,i,n)}function Mt(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 zt(t,e){return{bottom:t.y+e,left:t.x-e,right:t.x+e,top:t.y-e}}function Ct(t,...e){for(const i of e){if(U(i))continue;if(!B(i)){t=i;continue}Array.isArray(i)?Array.isArray(t)||(t=[]):B(t)&&!Array.isArray(t)||(t=Object.create(null));const e=Object.keys(i);if(!e.some(t=>{const e=i[t];return B(e)||Array.isArray(e)})){const s=i,n=t;for(const t of e){if(mt(t))continue;const e=s[t];void 0!==e&&(n[t]=e)}continue}for(const s of e){if(mt(s))continue;const e=t,n=i[s];e[s]=Array.isArray(n)?n.map(t=>Ct(void 0,t)):Ct(e[s],n)}}return t}function kt(t,e){return V(t)?t.map((t,i)=>e(t,i)):e(t,0)}function St(t,e,i){return V(t)?Pt(t,e,i):t}function Ot(e,i){return function(e,i){if(e.mode!==t.PixelMode.percent){const{mode:t,...i}=e;return i}return"x"in e?{x:e.x/h*i.width,y:e.y/h*i.height}:{width:e.width/h*i.width,height:e.height/h*i.height}}(e,i)}function Dt(t){const e=yt().createElement("div").style;for(const i in t){const s=t[i];if(!(i in t)||U(s))continue;const n=t.getPropertyValue?.(s);if(!n)continue;const a=t.getPropertyPriority?.(s);a?e.setProperty(s,n,a):e.setProperty(s,n)}return e}let It,Et;function Tt(t){if(It!==t||!Et){It=t;const e=yt().createElement("div").style,i=10,s={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(i),"z-index":t.toString(i),top:"0",left:"0","pointer-events":"none"};for(const t in s){const i=s[t];void 0!==i&&e.setProperty(t,i)}Et=e}return Et}function Lt(t,e,i,s,n){if(s){let s={passive:!0};L(n)?s.capture=n:void 0!==n&&(s=n),t.addEventListener(e,i,s)}else{const s=n;t.removeEventListener(e,i,s)}}async function Rt(t,e){return await Promise.all([...e.values()].map(e=>e(t)))}async function _t(t,e){const i=await Promise.all([...e.entries()].map(([e,i])=>i(t).then(t=>[e,t])));return new Map(i)}async function Ft(t){const e=St(t.url,t.index);if(!e)return t.fallback;try{const t=await fetch(e);if(t.ok){const e=await t.json();if(function(t){if(V(t))return t.every(t=>B(t)&&!V(t));return B(t)&&!V(t)}(e))return e;n().error("invalid configuration data while retrieving config file")}else n().error(`${t.status.toString()} while retrieving config file`)}catch(t){n().error(`error while retrieving config file: ${t}`)}return t.fallback}function At(t){let e;const i=yt();if(t instanceof HTMLCanvasElement||t.tagName.toLowerCase()===P)e=t,e.dataset[o]??=b,e.dataset[o]===w&&(e.style.width||=r,e.style.height||=r,e.style.pointerEvents="none",e.style.setProperty("pointer-events","none"));else{const s=t.getElementsByTagName(P).item(0);s?(e=s,e.dataset[o]=b):(e=i.createElement(P),e.dataset[o]=w,t.appendChild(e)),e.style.width||=r,e.style.height||=r,e.style.pointerEvents="none",e.style.setProperty("pointer-events","none")}return e}function Bt(t,e){const i=yt();let s=e??i.getElementById(t);return s||(s=i.createElement("canvas"),s.id=t,s.dataset[o]=w,i.body.append(s),s)}t.OutModeDirection=void 0,(gt=t.OutModeDirection||(t.OutModeDirection={})).bottom="bottom",gt.left="left",gt.right="right",gt.top="top",t.PixelMode=void 0,(ft=t.PixelMode||(t.PixelMode={})).precise="precise",ft.percent="percent";class Vt{#e;constructor(){this.#e=new Map}addEventListener(t,e){this.removeEventListener(t,e);const i=this.#e.get(t);this.#e.set(t,i?[...i,e]:[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):this.#e.set(t,[...i.slice(0,n),...i.slice(n+1)]))}}var Ut,Nt,Ht,$t,jt,qt,Gt,Wt,Kt,Qt,Xt,Yt,Zt,Jt;t.EventType=void 0,(Ut=t.EventType||(t.EventType={})).configAdded="configAdded",Ut.containerInit="containerInit",Ut.particlesSetup="particlesSetup",Ut.containerStarted="containerStarted",Ut.containerStopped="containerStopped",Ut.containerDestroyed="containerDestroyed",Ut.containerPaused="containerPaused",Ut.containerPlay="containerPlay",Ut.containerBuilt="containerBuilt",Ut.particleAdded="particleAdded",Ut.particleDestroyed="particleDestroyed",Ut.particleRemoved="particleRemoved";class te{colorManagers=new Map;easingFunctions=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;presets=new Map;#i=0;#s=new Set;#n=new Map;#a;#o=new Set;#r=new Set;#l=!1;#c;#d=!1;#h;#u=new Set;#p=[];#g;constructor(t){this.#a=t;const e=new WeakMap,i=()=>this.#i>0?Promise.resolve():t.init();this.#h=new Proxy(t,{get:(t,s)=>{if("init"===s)return i;const n=Reflect.get(t,s,t);if("function"!=typeof n)return n;let a=e.get(n);return a||(a=(...e)=>Reflect.apply(n,t,e),e.set(n,a)),a}})}get configs(){const t={};for(const[e,i]of this.#n)t[e]=i;return t}get initialized(){return this.#l}get plugins(){return this.#g??=Object.freeze([...this.#p])}addColorManager(t,e){this.#f(),this.colorManagers.set(t,e)}addConfig(e){this.#f();const i=e.key??e.name??"default";this.#n.set(i,e),this.#a.dispatchEvent(t.EventType.configAdded,{data:{name:i,config:e}})}addEasing(t,e){this.#f(),this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.#f(),this.initializers.effects.set(t,e)}addPalette(t,e){this.#f(),this.palettes.set(t,e)}addParticleUpdater(t,e){this.#f(),this.initializers.updaters.set(t,e)}addPlugin(t){if(!this.#d)throw new Error(pt(ut.pluginRegisterAfterLoad));this.getPlugin(t.id)||(this.#p.push(t),this.#g=void 0)}addPreset(t,e,i=!1){this.#f(),!i&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){this.#f();for(const i of t)this.initializers.shapes.set(i,e)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.#p.find(e=>e.id===t)}getPreset(t){return this.presets.get(t)}async init(){if(!this.#l)return this.#c||(this.#c=Promise.resolve().then(async()=>{this.#d=!0,this.#s=new Set(this.#u);try{for(;this.#r.size>0||[...this.#s].some(t=>!this.#o.has(t));){for(const t of this.#s)await this.#m(t,this.#o,this.#s);const t=[...this.#r];t.length&&await Promise.all(t)}this.#u.clear(),this.#l=!0}finally{this.#d=!1,this.#c=void 0}})),this.#c}async register(...t){this.#f();for(const e of t)this.#d?(this.#u.add(e),await this.#m(e,this.#o,this.#s)):this.#u.add(e)}#f(){if(this.#l)throw new Error(pt(ut.pluginRegisterAfterLoad))}async#m(t,e,i){if(e.has(t))return;e.add(t),i.add(t),this.#i++;const s=(async()=>t(this.#h))();this.#r.add(s);try{await s}catch(i){throw e.delete(t),i}finally{this.#i--,this.#r.delete(s)}}}class ee{pluginManager=new te(this);#y=0;#v=new WeakMap;#w=[];#b=new Vt;#l=!1;#P=0;#x=new Map;get items(){return this.#w}get version(){return"4.6.0"}addEventListener(t,e){this.#b.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(pt(ut.engineVersionMismatch,this.version))}dispatchEvent(t,e){this.#b.dispatchEvent(t,e)}async init(){this.#l||(await this.pluginManager.init(),this.#l=!0)}item(t){const e=this.items,i=e[t];if(!i?.destroyed)return i;e.splice(t,1)}async load(t){let e;"undefined"!=typeof HTMLElement&&t.element instanceof HTMLElement&&(e=t.element);const i=t.id??(e?this.#M(e):void 0)??`tsparticles${Math.floor(j()*O).toString()}`,s=++this.#P;this.#x.set(i,s);try{await this.init();const{Container:n}=await Promise.resolve().then(function(){return xa}),{index:a,url:o}=t,r=o?await Ft({fallback:t.options,url:o,index:a}):t.options;if(this.#x.get(i)!==s)return;const l=St(r,a),{items:c}=this,d=c.findIndex(t=>t.id.description===i),h=new n({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:i,onDestroy:t=>{if(!t)return;const e=this.items,i=e.indexOf(h);i>=0&&e.splice(i,1)},pluginManager:this.pluginManager,sourceOptions:l});if(d>=0){const t=this.item(d),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),c.splice(d,e,h)}else c.push(h);const u="undefined"!=typeof OffscreenCanvas&&t.element instanceof OffscreenCanvas?t.element:At(Bt(i,e));h.canvas.loadCanvas(u);try{await h.start()}catch(t){h.destroy(!1);const e=c.indexOf(h);throw e>=0&&c.splice(e,1),t}if(h.destroyed)return;return h}finally{this.#x.get(i)===s&&this.#x.delete(i)}}async refresh(t=!0){t&&await Promise.all(this.items.map(t=>t.refresh()))}removeEventListener(t,e){this.#b.removeEventListener(t,e)}#z(t){let e=this.#v.get(t);return e||(e=`tsparticles${Math.floor(j()*O).toString()}_${this.#y++}`,this.#v.set(t,e)),e}#M(t){return t.id.length?t.id:this.#z(t)}}!function(t){t.circle="circle",t.rectangle="rectangle"}(Nt||(Nt={}));class ie{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 se extends ie{radius;constructor(t,e,i){super(t,e,Nt.circle),this.radius=i}contains(t){return st(t,this.position,this.radius)}intersects(t){const e=this.position,i=t.position,s=this.radius,n=i.x-e.x,a=i.y-e.y;if(t instanceof se||t.type===Nt.circle){const e=s+t.radius;return e>0&&n*n+a*a<e*e}if(t instanceof ne||t.type===Nt.rectangle){const e=t,{width:i,height:o}=e.size,r=Math.abs(n),l=Math.abs(a),c=r-i,d=l-o;return c*c+d*d<=s*s||r<=s+i&&l<=s+o||r<=i||l<=o}return!1}reset(t,e,i){return this._resetPosition(t,e),this.radius=i,this}}class ne extends ie{size;constructor(t,e,i,s){super(t,e,Nt.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 se)return t.intersects(this);if(!(t instanceof ne))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}}function ae(t,e,i){void 0!==i&&(t[e]=i)}function oe(t,e,i){void 0!==i&&(t[e]=tt(i))}function re(t,e,i){void 0!==i&&t[e].load(i)}function le(t,e,i,s){if(void 0!==i){const n=t;n[e]??=s(),n[e].load(i)}}function ce(t,e,i,...s){const n=t;n[e]??=new i;const a=n[e];for(const t of s)a.load(t?.[e])}t.RotateDirection=void 0,(Ht=t.RotateDirection||(t.RotateDirection={})).clockwise="clockwise",Ht.counterClockwise="counter-clockwise",Ht.random="random",t.AnimationMode=void 0,($t=t.AnimationMode||(t.AnimationMode={})).auto="auto",$t.increase="increase",$t.decrease="decrease",$t.random="random",t.HdrMode=void 0,(jt=t.HdrMode||(t.HdrMode={})).standard="standard",jt.natural="natural",jt.vivid="vivid",jt.cinematic="cinematic",jt.dynamic="dynamic",t.LimitMode=void 0,(qt=t.LimitMode||(t.LimitMode={})).delete="delete",qt.wait="wait",t.OutMode=void 0,(Gt=t.OutMode||(t.OutMode={})).bounce="bounce",Gt.none="none",Gt.out="out",Gt.destroy="destroy",Gt.split="split",t.AlterType=void 0,(Wt=t.AlterType||(t.AlterType={})).darken="darken",Wt.enlighten="enlighten",t.DestroyType=void 0,(Kt=t.DestroyType||(t.DestroyType={})).none="none",Kt.max="max",Kt.min="min",t.GradientType=void 0,(Qt=t.GradientType||(t.GradientType={})).linear="linear",Qt.radial="radial",Qt.random="random",t.ParticleOutType=void 0,(Xt=t.ParticleOutType||(t.ParticleOutType={})).normal="normal",Xt.inside="inside",Xt.outside="outside",t.StartValueType=void 0,(Yt=t.StartValueType||(t.StartValueType={})).max="max",Yt.min="min",Yt.random="random",t.AnimationStatus=void 0,(Zt=t.AnimationStatus||(t.AnimationStatus={})).increasing="increasing",Zt.decreasing="decreasing",t.DrawLayer=void 0,(Jt=t.DrawLayer||(t.DrawLayer={}))[Jt.BackgroundElement=0]="BackgroundElement",Jt[Jt.BackgroundDraw=1]="BackgroundDraw",Jt[Jt.BackgroundMask=2]="BackgroundMask",Jt[Jt.CanvasSetup=3]="CanvasSetup",Jt[Jt.PluginContent=4]="PluginContent",Jt[Jt.Particles=5]="Particles",Jt[Jt.CanvasCleanup=6]="CanvasCleanup",Jt[Jt.Foreground=7]="Foreground";class de{load(t){U(t)||this.doLoad(t)}}function he(t,...e){for(const i of e)t.load(i)}class ue extends de{count=0;decay=0;delay=0;enable=!1;speed=1;sync=!1;doLoad(t){oe(this,"count",t.count),ae(this,"enable",t.enable),oe(this,"speed",t.speed),oe(this,"decay",t.decay),oe(this,"delay",t.delay),ae(this,"sync",t.sync)}}class pe extends ue{mode=t.AnimationMode.auto;startValue=t.StartValueType.random;doLoad(t){super.doLoad(t),ae(this,"mode",t.mode),ae(this,"startValue",t.startValue)}}class ge extends ue{max;min;offset=0;sync=!0;constructor(t,e){super(),this.min=t,this.max=e}doLoad(t){super.doLoad(t),ae(this,"max",t.max),ae(this,"min",t.min),oe(this,"offset",t.offset)}}class fe extends de{h=new ge(0,M);l=new ge(0,C);s=new ge(0,z);doLoad(t){this.h.load(t.h),this.s.load(t.s),this.l.load(t.l)}}class me extends de{value="";static create(t,e){const i=new me;return i.load(t),void 0!==e&&(R(e)||V(e)?i.load({value:e}):i.load(e)),i}doLoad(t){U(t.value)||(this.value=t.value)}}class ye extends me{animation=new fe;static create(t,e){const i=new ye;return i.load(t),void 0!==e&&(R(e)||V(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 ve extends de{color;draw;element;image="";opacity=1;position="";repeat="";size="";constructor(){super(),this.color=new me,this.color.value=""}doLoad(t){void 0!==t.color&&(this.color=me.create(this.color,t.color)),ae(this,"element",t.element),ae(this,"draw",t.draw),ae(this,"image",t.image),ae(this,"position",t.position),ae(this,"repeat",t.repeat),ae(this,"size",t.size),ae(this,"opacity",t.opacity)}}class we extends de{enable=!0;zIndex=0;doLoad(t){ae(this,"enable",t.enable),ae(this,"zIndex",t.zIndex)}}class be extends de{enable=!0;mode=t.HdrMode.standard;peakNits=400;doLoad(e){if(void 0!==e.enable&&!L(e.enable))throw new Error(pt(ut.hdrEnableInvalid,String(e.enable)));if(void 0!==e.mode&&!F(t.HdrMode,e.mode))throw new Error(pt(ut.hdrModeInvalid,Object.values(t.HdrMode).join(", "),(i=e.mode,String(i))));var i;if(void 0!==e.peakNits&&(!_(e.peakNits)||!Number.isFinite(e.peakNits)||e.peakNits<=0))throw new Error(pt(ut.hdrPeakNitsInvalid,String(e.peakNits)));ae(this,"enable",e.enable),ae(this,"mode",e.mode),ae(this,"peakNits",e.peakNits)}}class Pe extends de{delay=.5;enable=!0;doLoad(t){ae(this,"delay",t.delay),ae(this,"enable",t.enable)}}class xe extends de{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]=Ct(this.options[t]??{},i))}ae(this,"close",t.close),ae(this,"type",t.type)}}class Me extends de{color;enable=!0;opacity=1;doLoad(t){void 0!==t.color&&(this.color=ye.create(this.color,t.color)),ae(this,"enable",t.enable),oe(this,"opacity",t.opacity)}}class ze extends de{offset=0;value=90;doLoad(t){oe(this,"offset",t.offset),oe(this,"value",t.value)}}class Ce extends de{mode=t.PixelMode.percent;radius=0;x=50;y=50;doLoad(t){ae(this,"x",t.x),ae(this,"y",t.y),ae(this,"mode",t.mode),ae(this,"radius",t.radius)}}class ke extends de{acceleration=9.81;enable=!1;inverse=!1;maxSpeed=50;doLoad(t){oe(this,"acceleration",t.acceleration),ae(this,"enable",t.enable),ae(this,"inverse",t.inverse),oe(this,"maxSpeed",t.maxSpeed)}}class Se extends de{value=0;doLoad(t){U(t.value)||(this.value=tt(t.value))}}class Oe extends Se{animation=new ue;doLoad(t){super.doLoad(t),re(this,"animation",t.animation)}}class De extends Oe{animation=new pe}class Ie extends de{clamp=!0;delay=new Se;enable=!1;generator;options={};doLoad(t){ae(this,"clamp",t.clamp),this.delay.load(t.delay),ae(this,"enable",t.enable),this.generator=t.generator,t.options&&(this.options=Ct(this.options,t.options))}}class Ee extends de{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 Te extends de{acceleration=0;enable=!1;position;doLoad(t){oe(this,"acceleration",t.acceleration),ae(this,"enable",t.enable),t.position&&(this.position=Ct({},t.position))}}class Le extends de{angle=new ze;center=new Ce;decay=0;direction=t.MoveDirection.none;distance={};drift=0;enable=!1;gravity=new ke;outModes=new Ee;path=new Ie;random=!1;size=!1;speed=2;spin=new Te;straight=!1;vibrate=!1;warp=!1;doLoad(t){this.angle.load(_(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),oe(this,"decay",t.decay),ae(this,"direction",t.direction),void 0!==t.distance&&(this.distance=_(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),oe(this,"drift",t.drift),ae(this,"enable",t.enable),this.gravity.load(t.gravity);const e=t.outModes;void 0!==e&&(B(e)?this.outModes.load(e):this.outModes.load({default:e})),this.path.load(t.path),ae(this,"random",t.random),ae(this,"size",t.size),oe(this,"speed",t.speed),this.spin.load(t.spin),ae(this,"straight",t.straight),ae(this,"vibrate",t.vibrate),ae(this,"warp",t.warp)}}class Re extends de{color;opacity;width=0;doLoad(t){void 0!==t.color&&(this.color=ye.create(this.color,t.color)),oe(this,"width",t.width),oe(this,"opacity",t.opacity)}}class _e extends de{color;fill;stroke;doLoad(t){void 0!==t.color&&(this.color=ye.create(this.color,t.color)),le(this,"fill",t.fill,()=>new Me),le(this,"stroke",t.stroke,()=>new Re)}}class Fe extends Se{value=1}class Ae extends de{horizontal=new Fe;vertical=new Fe;doLoad(t){this.horizontal.load(t.horizontal),this.vertical.load(t.vertical)}}class Be extends de{enable=!1;height=1080;width=1920;doLoad(t){ae(this,"enable",t.enable),ae(this,"width",t.width),ae(this,"height",t.height)}}class Ve extends de{mode=t.LimitMode.delete;value=0;doLoad(t){ae(this,"mode",t.mode),ae(this,"value",t.value)}}class Ue extends de{density=new Be;limit=new Ve;value=0;doLoad(t){this.density.load(t.density),this.limit.load(t.limit),ae(this,"value",t.value)}}class Ne extends de{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]=Ct(this.options[t]??{},i))}ae(this,"close",t.close),ae(this,"type",t.type)}}class He extends Se{opacityRate=1;sizeRate=1;velocityRate=1;doLoad(t){super.doLoad(t),ae(this,"opacityRate",t.opacityRate),ae(this,"sizeRate",t.sizeRate),ae(this,"velocityRate",t.velocityRate)}}class $e extends de{bounce=new Ae;effect=new xe;groups={};move=new Le;number=new Ue;paint;palette;reduceDuplicates=!1;shape=new Ne;zIndex=new He;#C;#k;constructor(t,e){super(),this.#k=t,this.#C=e,this.paint=new _e,this.paint.color=new ye,this.paint.color.value="#fff",this.paint.fill=new Me,this.paint.fill.enable=!0}doLoad(t){if(t.palette&&(this.palette=t.palette,this.#S(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]=Ct(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&&(V(e)?this.paint=kt(e,t=>{const e=new _e;return e.load(t),e}):V(this.paint)?(this.paint=new _e,this.paint.load(e)):this.paint.load(e)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#C){for(const e of this.#k.plugins)e.loadParticlesOptions&&e.loadParticlesOptions(this.#C,this,t);const e=this.#C.particleUpdaters;for(const i of e)i.loadOptions&&i.loadOptions(this,t)}}#S(t){const e=this.#k.getPalette(t);if(!e)return;const i=e.colors,s=(V(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 je(t,e,...i){const s=new $e(t,e);return he(s,...i),s}class qe extends de{autoPlay=!0;background;clear=!0;defaultThemes={};delay=0;detectRetina=!0;duration=0;fpsLimit=120;fullScreen;hdr;key;name;palette;particles;pauseOnBlur=!0;pauseOnOutsideViewport=!0;preset;resize;smooth=!1;style={};zLayers=100;#C;#k;constructor(t,e){super(),this.#k=t,this.#C=e,this.background=new ve,this.fullScreen=new we,this.hdr=new be,this.particles=je(this.#k,this.#C),this.resize=new Pe}doLoad(e){void 0!==e.preset&&(this.preset=e.preset,kt(this.preset,t=>{this.#O(t)})),void 0!==e.palette&&(this.palette=e.palette,this.#S(this.palette)),ae(this,"autoPlay",e.autoPlay),ae(this,"clear",e.clear),ae(this,"key",e.key),ae(this,"name",e.name),oe(this,"delay",e.delay),ae(this,"detectRetina",e.detectRetina),oe(this,"duration",e.duration),ae(this,"fpsLimit",e.fpsLimit);const i=e.hdr;L(i)?(this.hdr.enable=i,this.hdr.mode=t.HdrMode.standard,this.hdr.peakNits=400):this.hdr.load(i),ae(this,"pauseOnBlur",e.pauseOnBlur),ae(this,"pauseOnOutsideViewport",e.pauseOnOutsideViewport),ae(this,"zLayers",e.zLayers),this.background.load(e.background);const s=e.fullScreen;L(s)?this.fullScreen.enable=s:this.fullScreen.load(s),this.particles.load(e.particles),this.resize.load(e.resize),this.style=Ct(this.style,e.style),ae(this,"smooth",e.smooth),this.#k.plugins.forEach(t=>{t.loadOptions(this.#C,this,e)})}#S(t){const e=this.#k.getPalette(t);e&&this.load({background:{color:e.background},blend:{enable:!0,mode:e.blendMode},particles:{palette:t}})}#O(t){this.load(this.#k.getPreset(t))}}const Ge=new Map,We=1.15,Ke=1.05,Qe=.2126,Xe=.7152,Ye=.0722;function Ze(t,e){let i=Ge.get(t);return i||(i=e(),Ge.size>2e3&&Ge.clear(),Ge.set(t,i)),i}function Je(t){return K(t*(2.51*t+.03)/(t*(2.43*t+.59)+.14),0,1)}function ti(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function ei(t){return t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055}function ii(t,e){if(e)for(const i of t.colorManagers.values())if(i.accepts(e))return i.parseString(e)}function si(t,e,i,s=!0){if(!e)return;const n=R(e)?{value:e}:e;if(R(n.value))return ni(t,n.value,i,s);if(V(n.value)){const e=Pt(n.value,i,s);if(!e)return;return si(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleRangeColor(n);if(t)return t}}function ni(t,e,i,s=!0){if(!e)return;const n=R(e)?{value:e}:e;if(R(n.value))return n.value===m?ui():ri(t,n.value);if(V(n.value)){const e=Pt(n.value,i,s);if(!e)return;return ni(t,{value:e})}for(const e of t.colorManagers.values()){const t=e.handleColor(n);if(t)return t}}function ai(t,e,i,s=!0){const n=si(t,e,i,s);return n?oi(n):void 0}function oi(t){const e=t.r/x,i=t.g/x,s=t.b/x,n=Math.max(e,i,s),a=Math.min(e,i,s),o={h:0,l:(n+a)*u,s:0};return n!==a&&(o.s=o.l<u?(n-a)/(n+a):(n-a)/(2-n-a),o.h=e===n?(i-s)/(n-a):i===n?2+(s-e)/(n-a):4+(e-i)/(n-a)),o.l*=C,o.s*=z,o.h*=60,o.h<0&&(o.h+=M),o.h>=M&&(o.h-=M),o}function ri(t,e){return ii(t,e)}function li(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 ci(t){const e=(t.h%M+M)%M,i=Math.max(0,Math.min(z,t.s)),s=Math.max(0,Math.min(C,t.l)),n=e/M,a=i/z,o=s/C;if(0===i){const t=Math.round(o*x);return{r:t,g:t,b:t}}const r=o<u?o*(1+a):o+a-o*a,l=2*o-r,c=1/3,d=Math.min(x,x*li(l,r,n+c)),h=Math.min(x,x*li(l,r,n)),p=Math.min(x,x*li(l,r,n-c));return{r:Math.round(d),g:Math.round(h),b:Math.round(p)}}function di(t){const e=(t.h%M+M)%M,i=Math.max(0,Math.min(z,t.s)),s=Math.max(0,Math.min(C,t.l)),n=e/M,a=i/z,o=s/C;if(0===i){const t=o*x;return{r:t,g:t,b:t}}const r=o<u?o*(1+a):o+a-o*a,l=2*o-r,c=1/3;return{r:Math.min(x,x*li(l,r,n+c)),g:Math.min(x,x*li(l,r,n)),b:Math.min(x,x*li(l,r,n-c))}}function hi(t){const e=ci(t);return{a:t.a,b:e.b,g:e.g,r:e.r}}function ui(t,e){const i=t??0;if(e)return{r:q(i,x),g:q(i,x),b:q(i,x)};const s=()=>Math.floor(q(i,256));return{b:s(),g:s(),r:s()}}function pi(e,i,s,n,a){const o=i?4:2,r=s??1;return Ze(i?`rgb-${e.r.toFixed(o)}-${e.g.toFixed(o)}-${e.b.toFixed(o)}-hdr-${r.toString()}-${(n??D).toString()}-${a??t.HdrMode.standard}`:`rgb-${e.r.toFixed(o)}-${e.g.toFixed(o)}-${e.b.toFixed(o)}-sdr-${r.toString()}`,()=>i?function(e,i,s=400,n=t.HdrMode.standard){const a=s/203,o=function(e,i,s,n){const a=e.r/x,o=e.g/x,r=e.b/x;if(n!==t.HdrMode.natural&&n!==t.HdrMode.vivid&&n!==t.HdrMode.cinematic&&n!==t.HdrMode.dynamic)return{b:r,g:o,r:a};const l=Math.max(1,i),c=Qe*a+Xe*o+Ye*r,d=function(t,e,i){if(t<=i)return Je(t);const s=t+(t-i)*(e-1);return Je(s)}(c,i,s),h=c>0?d/c:1;return function(e,i,s,n,a){switch(n){case t.HdrMode.vivid:{const t=(e+i+s)/3;return{b:K(K(t+(s-t)*We,0,a)*Ke,0,a),g:K(K(t+(i-t)*We,0,a)*Ke,0,a),r:K(K(t+(e-t)*We,0,a)*Ke,0,a)}}case t.HdrMode.cinematic:{const t=1.05*e,n=.95*s,o=(t+i+n)/3;return{b:K(o+1.1*(n-o),0,a),g:K(o+1.1*(i-o),0,a),r:K(o+1.1*(t-o),0,a)}}case t.HdrMode.dynamic:{const t=Qe*e+Xe*i+Ye*s,n=Math.min(1,2*t),o=1-n,r=(e+i+s)/3,l=K(r+(e-r)*We,0,a)*Ke,c=K(r+(i-r)*We,0,a)*Ke,d=K(r+(s-r)*We,0,a)*Ke;return{b:K(s*o+d*n,0,a),g:K(i*o+c*n,0,a),r:K(e*o+l*n,0,a)}}case t.HdrMode.standard:case t.HdrMode.natural:default:return{b:s,g:i,r:e}}}(K(a*h,0,l),K(o*h,0,l),K(r*h,0,l),n,l)}(e,a,.18,n);return`color(display-p3 ${o.r.toString()} ${o.g.toString()} ${o.b.toString()} / ${(i??1).toString()})`}(e,s,n,a):function(t,e){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(e??1).toString()})`}(e,s))}function gi(e,i,s,n,a){const o=i?4:2,r=s??1;return Ze(i?`hsl-${e.h.toFixed(o)}-${e.s.toFixed(o)}-${e.l.toFixed(o)}-hdr-${r.toString()}-${(n??D).toString()}-${a??t.HdrMode.standard}`:`hsl-${e.h.toFixed(o)}-${e.s.toFixed(o)}-${e.l.toFixed(o)}-sdr-${r.toString()}`,()=>i?pi(di(e),!0,s,n,a):`hsla(${e.h.toString()}, ${e.s.toString()}%, ${e.l.toString()}%, ${r.toString()})`)}function fi(t,e,i,s,n){let a=t,o=e;if("r"in a||(a=n?di(t):ci(t)),"r"in o||(o=n?di(e):ci(e)),n){const t={b:ti(a.b/x),g:ti(a.g/x),r:ti(a.r/x)},e={b:ti(o.b/x),g:ti(o.g/x),r:ti(o.r/x)},n=i+s;return{b:ei((t.b*i+e.b*s)/n)*x,g:ei((t.g*i+e.g*s)/n)*x,r:ei((t.r*i+e.r*s)/n)*x}}return{b:Q(a.b,o.b,i,s),g:Q(a.g,o.g,i,s),r:Q(a.r,o.r,i,s)}}function mi(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function yi(t,e,i){const s={h:{enable:!1,value:t.h,min:0,max:M},s:{enable:!1,value:t.s,min:0,max:z},l:{enable:!1,value:t.l,min:0,max:C}};return e&&(vi(s.h,e.h,i),vi(s.s,e.s,i),vi(s.l,e.l,i)),s}function vi(e,i,s){e.enable=i.enable,e.min=i.min,e.max=i.max,e.enable?(e.velocity=Y(i.speed)/h*s,e.decay=1-Y(i.decay),e.status=t.AnimationStatus.increasing,e.loops=0,e.maxLoops=Y(i.count),e.time=0,e.delayTime=Y(i.delay)*p,i.sync||(e.velocity*=j(),e.value*=j()),e.initialValue=e.value,e.offset=tt(i.offset)):e.velocity=0}function wi(e,i,s,n){if(!e.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0))return;if(e.time??=0,(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=s.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0))return;const a=e.offset?X(e.offset):0,o=(e.velocity??0)*s.factor+3.6*a,r=e.decay??1,l=e.max,c=e.min;i&&e.status!==t.AnimationStatus.increasing?(e.value-=o,e.value<c&&(e.loops??=0,e.loops++,e.status=t.AnimationStatus.increasing)):(e.value+=o,e.value>l&&(e.loops??=0,e.loops++,i?e.status=t.AnimationStatus.decreasing:e.value-=l)),e.velocity&&1!==r&&(e.velocity*=r),e.value=K(e.value,c,l)}function bi(t,e,i){if(!t)return;const{h:s,s:n,l:a}=t;wi(s,!1,e),wi(n,!0,e),wi(a,!0,e)}function Pi(e,i,s){return{h:e.h,s:e.s,l:e.l+(i===t.AlterType.darken?-1:1)*s}}const xi=function(){const t=globalThis.tsParticles;return t?.pluginManager?t:new ee}();class Mi{enable=!1;mode="destination-out";load(t){U(t)||(ae(this,"mode",t.mode),ae(this,"enable",t.enable))}}function zi(t){if(!t||"object"!=typeof t||!("blend"in t))return!1;const e=t.blend;return!!e&&"object"==typeof e&&"enable"in e&&!!e.enable}class Ci{id="blend";async getPlugin(t){const{BlendPluginInstance:e}=await Promise.resolve().then(function(){return Ma});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 Mi),s.load(i?.blend)}loadParticlesOptions(t,e,i){e.blend??=new Mi,e.blend.load(i?.blend)}needsPlugin(t){if(t?.blend?.enable||t?.particles?.blend?.enable||Object.values(t?.particles?.groups??{}).some(zi))return!0;const e=t?.emitters;let i=[];return Array.isArray(e)?i=e:e&&(i=[e]),i.some(t=>{if(!t||"object"!=typeof t||!("particles"in t))return!1;const e=t.particles;return Array.isArray(e)?e.some(zi):zi(e)})}}async function ki(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new Ci)})}class Si{draw(t){!function(t){const{context:e,particle:i,radius:s}=t;i.circleRange??={min:0,max:v};const n=i.circleRange;e.arc(g.x,g.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=B(s)?{min:nt(s.min),max:nt(s.max)}:{min:0,max:nt(s)}}}async function Oi(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["circle"],()=>Promise.resolve(new Si))})}var Di;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=4]="a"}(Di||(Di={}));const Ii=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,Ei=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;class Ti{accepts(t){return t.startsWith("#")}handleColor(t){return this.#D(t.value)}handleRangeColor(t){return this.#D(t.value)}parseString(t){return this.#D(t)}#D(t){if("string"!=typeof t||!this.accepts(t))return;const e=t.replace(Ii,(t,e,i,s,n)=>e+e+i+i+s+s+(void 0===n?"":n+n)),i=Ei.exec(e);return i?{a:i[Di.a]?Number.parseInt(i[Di.a],16)/255:1,b:Number.parseInt(i[Di.b]??"0",16),g:Number.parseInt(i[Di.g]??"0",16),r:Number.parseInt(i[Di.r]??"0",16)}:void 0}}async function Li(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hex",new Ti)})}var Ri;!function(t){t[t.h=1]="h",t[t.s=2]="s",t[t.l=3]="l",t[t.a=5]="a"}(Ri||(Ri={}));const _i=/hsla?\(\s*(\d+)\s*[\s,]\s*(\d+)%\s*[\s,]\s*(\d+)%\s*([\s,]\s*(0|1|0?\.\d+|(\d{1,3})%)\s*)?\)/i;class Fi{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 ci(e)}handleRangeColor(t){const e=t.value.hsl??t.value;if("h"in e&&"s"in e&&"l"in e)return ci({h:Y(e.h),l:Y(e.l),s:Y(e.s)})}parseString(t){if(!this.accepts(t))return;const e=_i.exec(t);return e?hi({a:e.length>4?ht(e[Ri.a]):1,h:Number.parseInt(e[Ri.h]??"0",10),l:Number.parseInt(e[Ri.l]??"0",10),s:Number.parseInt(e[Ri.s]??"0",10)}):void 0}}async function Ai(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("hsl",new Fi)})}class Bi{id="move";#k;constructor(t){this.#k=t}async getPlugin(t){const{MovePluginInstance:e}=await Promise.resolve().then(function(){return Ca});return new e(this.#k,t)}loadOptions(){}needsPlugin(){return!0}}async function Vi(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{const e=t.pluginManager;e.initializers.pathGenerators??=new Map,e.addPathGenerator=(t,i)=>{e.initialized||(e.initializers.pathGenerators??=new Map,e.initializers.pathGenerators.set(t,i))},t.pluginManager.addPlugin(new Bi(t.pluginManager))})}function Ui(e,i){const s=e.value,n=e.animation,a={delayTime:Y(n.delay)*p,enable:n.enable,value:Y(e.value)*i,max:J(s)*i,min:Z(s)*i,loops:0,maxLoops:Y(n.count),time:0};if(n.enable){switch(a.decay=1-Y(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=j()>=u?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=X(a),e&&(a.status=j()>=u?t.AnimationStatus.increasing:t.AnimationStatus.decreasing)}}return a.initialValue=a.value,a}function Ni(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;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!==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=K(i.value,r,l))}}class Hi extends pe{destroy=t.DestroyType.none;load(t){super.load(t),U(t)||ae(this,"destroy",t.destroy)}}class $i extends De{animation=new Hi;value=1;load(t){if(U(t))return;super.load(t);const e=t.animation;void 0!==e&&this.animation.load(e)}}class ji{#C;constructor(t){this.#C=t}init(t){const e=t.options.opacity;if(!e)return;t.opacity=Ui(e,1);const i=e.animation;i.enable&&(t.opacity.velocity=Y(i.speed)/h*this.#C.retina.reduceFactor,i.sync||(t.opacity.velocity*=j()))}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){ce(t,"opacity",$i,...e)}reset(t){t.opacity&&(t.opacity.time=0,t.opacity.loops=0)}update(t,e){this.isEnabled(t)&&t.opacity&&t.options.opacity&&Ni(t,t.opacity,!0,t.options.opacity.animation.destroy,e)}}async function qi(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("opacity",t=>Promise.resolve(new ji(t)))})}const Gi={[t.OutModeDirection.left]:{axis:"x",canvas:"width",bounce:"horizontal",negativeEdge:"right",positiveEdge:"left",negative:!0},[t.OutModeDirection.right]:{axis:"x",canvas:"width",bounce:"horizontal",negativeEdge:"right",positiveEdge:"left",negative:!1},[t.OutModeDirection.top]:{axis:"y",canvas:"height",bounce:"vertical",negativeEdge:"bottom",positiveEdge:"top",negative:!0},[t.OutModeDirection.bottom]:{axis:"y",canvas:"height",bounce:"vertical",negativeEdge:"bottom",positiveEdge:"top",negative:!1}};class Wi{modes;#C;#I;constructor(e){this.#C=e,this.modes=[t.OutMode.bounce,t.OutMode.split],this.#I=e.plugins.filter(t=>!!t.particleBounce)}update(e,i,s,n){if(!this.modes.includes(n))return;for(const t of this.#I)if(t.particleBounce?.(e,s,i))return;const a=e.getPosition(),o=e.offset,r=e.getRadius(),l=zt(a,r),c=this.#C.canvas.size,d=!e.isInsideCanvasForOutMode(n,i);!function(e){if(e.outMode!==t.OutMode.bounce&&e.outMode!==t.OutMode.split||!(e.direction in Gi))return;const i=Gi[e.direction],s=e.bounds,n=e.canvasSize[i.canvas],a=e.particle.position,o=e.particle.velocity[i.axis];if(i.negative&&s[i.negativeEdge]<0?a[i.axis]=e.size+e.offset[i.axis]:!i.negative&&s[i.positiveEdge]>n&&(a[i.axis]=n-e.size-e.offset[i.axis]),!e.outOfCanvas||!(i.negative&&o<0||!i.negative&&o>0))return;e.particle.velocity[i.axis]*=-Y(e.particle.options.bounce[i.bounce].value);const r=e.offset[i.axis]+e.size;a[i.axis]=i.negative?r:n-r,e.outMode===t.OutMode.split&&e.particle.destroy()}({particle:e,outMode:n,direction:i,bounds:l,canvasSize:c,offset:o,outOfCanvas:d,size:r})}}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 t=e.position.x-e.moveCenter.x,i=e.position.y-e.moveCenter.y,{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 Qi{modes;#C;constructor(e){this.#C=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.#C,r=o.canvas.size,l=e.getRadius();if(a.enable){const s=e.position;(!a.inverse&&s.y>r.height+l&&i===t.OutModeDirection.bottom||a.inverse&&s.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;xt(e.position,o.canvas.size,g,l,i)||e.destroy()}}}const Xi=T.origin;class Yi{modes;#C;constructor(e){this.#C=e,this.modes=[t.OutMode.out]}update(e,i,s,n){if(!this.modes.includes(n))return;const a=this.#C;if(e.outType===t.ParticleOutType.inside)this.#E(e,a);else{if(e.isInsideCanvasForOutMode(n,i))return;e.outType===t.ParticleOutType.outside?this.#T(e):this.#L(e,a,i)}}#E(t,e){const{x:i,y:s}=t.velocity;Xi.setTo(g),Xi.length=t.moveCenter.radius,Xi.angle=t.velocity.angle+Math.PI,Xi.addTo(t.moveCenter);const n=t.position.x-Xi.x,a=t.position.y-Xi.y;if(i<=0&&n>=0||s<=0&&a>=0||i>=0&&n<=0||s>=0&&a<=0)return;t.position.x=Math.floor(X({min:0,max:e.canvas.size.width})),t.position.y=Math.floor(X({min:0,max:e.canvas.size.height}));const o=t.position.x-t.moveCenter.x,r=t.position.y-t.moveCenter.y;t.direction=Math.atan2(-r,-o),t.velocity.angle=t.direction,t.justWarped=!0}#L(e,i,s){const n=e.options.move.warp,a=i.canvas.size,o=e.getRadius(),r={bottom:a.height+o+e.offset.y,left:-o-e.offset.x,right:a.width+o+e.offset.x,top:-o-e.offset.y},l=zt(e.position,o);s===t.OutModeDirection.right&&l.left>a.width+e.offset.x?(e.position.x=r.left,e.initialPosition.x=e.position.x,n||(e.position.y=j()*a.height,e.initialPosition.y=e.position.y),e.justWarped=!0):s===t.OutModeDirection.left&&l.right<-e.offset.x&&(e.position.x=r.right,e.initialPosition.x=e.position.x,n||(e.position.y=j()*a.height,e.initialPosition.y=e.position.y),e.justWarped=!0),s===t.OutModeDirection.bottom&&l.top>a.height+e.offset.y?(n||(e.position.x=j()*a.width,e.initialPosition.x=e.position.x),e.position.y=r.top,e.initialPosition.y=e.position.y,e.justWarped=!0):s===t.OutModeDirection.top&&l.bottom<-e.offset.y&&(n||(e.position.x=j()*a.width,e.initialPosition.x=e.position.x),e.position.y=r.bottom,e.initialPosition.y=e.position.y,e.justWarped=!0)}#T(t){t.position.x=Math.floor(X({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.x,t.position.y=Math.floor(X({min:-t.moveCenter.radius,max:t.moveCenter.radius}))+t.moveCenter.y;const e=t.position.x-t.moveCenter.x,i=t.position.y-t.moveCenter.y;t.moveCenter.radius&&(t.direction=Math.atan2(i,e),t.velocity.angle=t.direction),t.justWarped=!0}}class Zi{updaters;#C;constructor(t){this.#C=t,this.updaters=new Map}init(e){this.#R(e,t.OutMode.bounce,t=>new Wi(t)),this.#R(e,t.OutMode.out,t=>new Yi(t)),this.#R(e,t.OutMode.destroy,t=>new Ki(t)),this.#R(e,t.OutMode.none,t=>new Qi(t))}isEnabled(t){return!t.destroyed&&!t.spawning}update(e,i){const s=e.options.move.outModes;e.justWarped=!1,this.#_(e,i,s.bottom??s.default,t.OutModeDirection.bottom),this.#_(e,i,s.left??s.default,t.OutModeDirection.left),this.#_(e,i,s.right??s.default,t.OutModeDirection.right),this.#_(e,i,s.top??s.default,t.OutModeDirection.top)}#R(t,e,i){const s=t.options.move.outModes;!this.updaters.has(e)&&((t,e)=>t.default===e||t.bottom===e||t.left===e||t.right===e||t.top===e)(s,e)&&this.updaters.set(e,i(this.#C))}#_(t,e,i,s){for(const n of this.updaters.values())n.update(t,s,e,i)}}async function Ji(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("outModes",t=>Promise.resolve(new Zi(t)))})}class ts{#C;#k;constructor(t,e){this.#C=e,this.#k=t}init(t){const e=this.#C,i=t.options,s=St(i.paint,t.id,i.reduceDuplicates);this.#F(s,t,e),this.#A(s,t,e)}isEnabled(t){const{fillAnimation:e,fillColor:i,strokeAnimation:s,strokeColor:n}=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=!!s&&(void 0!==n?.h.value&&n.h.enable||void 0!==n?.s.value&&n.s.enable||void 0!==n?.l.value&&n.l.enable);return!t.destroyed&&!t.spawning&&(a||o)}update(t,e){this.isEnabled(t)&&(bi(t.fillColor,e,this.#C.hdr),bi(t.strokeColor,e,this.#C.hdr))}#F(t,e,i){const s=t?.fill,n=t?.color,a=n??void 0;if(!s)return e.fillEnabled=!1,e.fillAnimation=void 0,e.fillColor=void 0,void(e.fillOpacity=1);const o=ye.create(void 0===a?void 0:ye.create(void 0,a),s.color);e.fillEnabled=s.enable,e.fillOpacity=Y(s.opacity),e.fillAnimation=o.animation;const r=ai(this.#k,o);r&&(e.fillColor=yi(r,e.fillAnimation,i.retina.reduceFactor))}#A(t,e,i){const s=t?.stroke,n=t?.color,a=n??void 0;if(!s)return e.strokeAnimation=void 0,e.strokeColor=void 0,e.strokeOpacity=1,void(e.strokeWidth=0);const o=ye.create(void 0===a?void 0:ye.create(void 0,a),s.color);e.strokeWidth=Y(s.width)*i.retina.pixelRatio,e.strokeOpacity=Y(s.opacity??1),e.strokeAnimation=o.animation;const r=ai(this.#k,o)??e.getFillColor();r&&(e.strokeColor=yi(r,e.strokeAnimation,i.retina.reduceFactor))}}async function es(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("paint",e=>Promise.resolve(new ts(t.pluginManager,e)))})}var is;!function(t){t[t.r=1]="r",t[t.g=2]="g",t[t.b=3]="b",t[t.a=5]="a"}(is||(is={}));const ss=/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 ns{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:Y(e.r),g:Y(e.g),b:Y(e.b)}}parseString(t){if(!this.accepts(t))return;const e=ss.exec(t);return e?{a:e.length>4?ht(e[is.a]):1,b:parseInt(e[is.b]??"0",10),g:parseInt(e[is.g]??"0",10),r:parseInt(e[is.r]??"0",10)}:void 0}}async function as(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addColorManager("rgb",new ns)})}class os extends pe{destroy=t.DestroyType.none;load(t){super.load(t),U(t)||ae(this,"destroy",t.destroy)}}class rs extends De{animation=new os;value=3;load(t){if(super.load(t),U(t))return;const e=t.animation;void 0!==e&&this.animation.load(e)}}class ls{#C;constructor(t){this.#C=t}init(t){const e=this.#C,i=t.options.size;if(!i)return;const s=i.animation;s.enable&&(t.size.velocity=t.retina.sizeAnimationSpeed/h*e.retina.reduceFactor,s.sync||(t.size.velocity*=j()))}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){ce(t,"size",rs,...e)}preInit(t){const e=this.#C.retina.pixelRatio,i=t.options.size;i&&(t.size=Ui(i,e),t.retina.sizeAnimationSpeed=Y(i.animation.speed)*e)}reset(t){t.size.time=0,t.size.loops=0}update(t,e){this.isEnabled(t)&&t.options.size&&Ni(t,t.size,!0,t.options.size.animation.destroy,e)}}async function cs(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("size",t=>Promise.resolve(new ls(t)))})}async function ds(t){t.checkVersion("4.6.0"),await t.pluginManager.register(async t=>{await Promise.all([ki(t),Li(t),Ai(t),as(t),Vi(t),Oi(t),es(t),qi(t),Ji(t),cs(t)])})}var hs;!function(t){t.move="move",t.line="line",t.bezier="bezier",t.quadratic="quadratic",t.arc="arc",t.ellipse="ellipse"}(hs||(hs={}));function us(t,e,i){const s=i.segments[0];if(!s)return;const n=s.values[0];if(!n)return;t.moveTo(n.x*e,n.y*e);for(const s of i.segments){const i=s.values[0];if(!i)continue;const n=s.values[1],a=s.values[2],o=s.values[3];switch(s.type){case hs.move:t.moveTo(i.x*e,i.y*e);break;case hs.line:t.lineTo(i.x*e,i.y*e);break;case hs.bezier:if(!n||!a||!o)continue;t.bezierCurveTo(n.x*e,n.y*e,a.x*e,a.y*e,o.x*e,o.y*e);break;case hs.quadratic:if(!n||!a)continue;t.quadraticCurveTo(n.x*e,n.y*e,a.x*e,a.y*e);break;case hs.arc:if(!n||!a)continue;t.arc(i.x*e,i.y*e,n.x*e,a.x,a.y);break;case hs.ellipse:if(!n||!a||!o)continue;t.ellipse(i.x*e,i.y*e,n.x*e,n.y*e,a.x,o.x,o.y)}}if(!i.half)return;for(let s=i.segments.length-1;s>=0;s--){const n=i.segments[s];if(!n)continue;const a=n.values[0],o=1,r=2,l=n.values[o],c=n.values[r];switch(n.type){case hs.line:if(!a)break;t.lineTo(a.x*-e,a.y*e);break;case hs.bezier:if(!a||!l||!c)break;t.bezierCurveTo(-c.x*e,c.y*e,-l.x*e,l.y*e,-a.x*e,a.y*e);break;case hs.quadratic:if(!l||!c)break;t.quadraticCurveTo(-l.x*e,l.y*e,-c.x*e,c.y*e);case hs.arc:case hs.ellipse:}}}var ps;!function(t){t.hearts="hearts",t.diamonds="diamonds",t.clubs="clubs",t.spades="spades"}(ps||(ps={}));const gs=u,fs=.25,ms=-gs,ys=-.25,vs=.0625,ws=.375,bs={half:!0,segments:[{type:hs.bezier,values:[{x:0,y:ms},{x:0,y:ms},{x:fs,y:ms},{x:fs,y:ys}]},{type:hs.bezier,values:[{x:fs,y:ys},{x:fs,y:ys},{x:gs,y:ys},{x:gs,y:0}]},{type:hs.bezier,values:[{x:gs,y:0},{x:gs,y:0},{x:gs,y:fs},{x:fs,y:fs}]},{type:hs.bezier,values:[{x:fs,y:fs},{x:fs,y:fs},{x:vs,y:fs},{x:vs,y:vs}]},{type:hs.bezier,values:[{x:vs,y:vs},{x:vs,y:fs},{x:fs,y:gs},{x:fs,y:gs}]},{type:hs.bezier,values:[{x:fs,y:gs},{x:fs,y:gs},{x:0,y:gs},{x:0,y:gs}]}]},Ps={half:!0,segments:[{type:hs.bezier,values:[{x:0,y:gs},{x:0,y:gs},{x:ws,y:0},{x:ws,y:0}]},{type:hs.bezier,values:[{x:ws,y:0},{x:ws,y:0},{x:0,y:ms},{x:0,y:ms}]}]},xs={half:!0,segments:[{type:hs.bezier,values:[{x:0,y:gs},{x:0,y:gs},{x:gs,y:0},{x:gs,y:ys}]},{type:hs.bezier,values:[{x:gs,y:ys},{x:gs,y:ys},{x:gs,y:ms},{x:fs,y:ms}]},{type:hs.bezier,values:[{x:fs,y:ms},{x:fs,y:ms},{x:0,y:ms},{x:0,y:ys}]}]},Ms={half:!0,segments:[{type:hs.bezier,values:[{x:0,y:ms},{x:0,y:ms},{x:gs,y:ys},{x:gs,y:0}]},{type:hs.bezier,values:[{x:gs,y:0},{x:gs,y:0},{x:gs,y:fs},{x:fs,y:fs}]},{type:hs.bezier,values:[{x:fs,y:fs},{x:fs,y:fs},{x:vs,y:fs},{x:vs,y:vs}]},{type:hs.bezier,values:[{x:vs,y:vs},{x:vs,y:fs},{x:fs,y:gs},{x:fs,y:gs}]},{type:hs.bezier,values:[{x:fs,y:gs},{x:fs,y:gs},{x:0,y:gs},{x:0,y:gs}]}]},zs={[ps.hearts]:xs,[ps.diamonds]:Ps,[ps.clubs]:bs,[ps.spades]:Ms};class Cs{draw(t){const{context:e,radius:i}=t;us(e,i,zs.clubs)}}async function ks(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["club","clubs"],()=>Promise.resolve(new Cs))})}class Ss{draw(t){const{context:e,radius:i}=t;us(e,i,zs.diamonds)}}async function Os(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["diamond","diamonds"],()=>Promise.resolve(new Ss))})}let Ds=class{draw(t){const{context:e,radius:i}=t;us(e,i,zs.hearts)}};async function Is(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["heart","hearts"],()=>Promise.resolve(new Ds))})}class Es{draw(t){const{context:e,radius:i}=t;us(e,i,zs.spades)}}async function Ts(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["spade","spades"],()=>Promise.resolve(new Es))})}async function Ls(t){t.checkVersion("4.6.0"),await Promise.all([ks(t),Os(t),Is(t),Ts(t)])}class Rs{count;delay;duration;wait=!1;load(t){U(t)||(ae(this,"count",t.count),oe(this,"delay",t.delay),oe(this,"duration",t.duration),ae(this,"wait",t.wait))}}class _s{delay=.1;quantity=1;load(t){U(t)||(oe(this,"quantity",t.quantity),oe(this,"delay",t.delay))}}class Fs{color=!1;opacity=!1;load(t){U(t)||(ae(this,"color",t.color),ae(this,"opacity",t.opacity))}}class As{options={};replace=new Fs;type="square";load(t){U(t)||(void 0!==t.options&&(this.options=Ct({},t.options??{})),this.replace.load(t.replace),ae(this,"type",t.type))}}class Bs{height=0;mode=t.PixelMode.percent;width=0;load(t){U(t)||(ae(this,"mode",t.mode),ae(this,"height",t.height),ae(this,"width",t.width))}}class Vs{fill;stroke;load(t){U(t)||(t.fill&&(this.fill??=new Me,this.fill.load(t.fill)),t.stroke&&(this.stroke??=new Re,this.stroke.load(t.stroke)))}}class Us{autoPlay=!0;direction;domId;draggable=!1;draw=!1;fill=!0;life=new Rs;name;particles;position;rate=new _s;shape=new As;size;spawn=new Vs;spawnFillColor;spawnStrokeColor;startCount=0;load(t){U(t)||(ae(this,"autoPlay",t.autoPlay),void 0!==t.size&&(this.size??=new Bs,this.size.load(t.size)),ae(this,"direction",t.direction),ae(this,"domId",t.domId),ae(this,"draggable",t.draggable),ae(this,"draw",t.draw),ae(this,"fill",t.fill),this.life.load(t.life),ae(this,"name",t.name),this.particles=kt(t.particles,t=>Ct({},t)),this.rate.load(t.rate),this.shape.load(t.shape),this.spawn.load(t.spawn),void 0!==t.position&&(this.position={},void 0!==t.position.x&&(this.position.x=tt(t.position.x)),void 0!==t.position.y&&(this.position.y=tt(t.position.y))),void 0!==t.spawnFillColor&&(this.spawnFillColor??=new ye,this.spawnFillColor.load(t.spawnFillColor)),void 0!==t.spawnStrokeColor&&(this.spawnStrokeColor??=new ye,this.spawnStrokeColor.load(t.spawnStrokeColor)),ae(this,"startCount",t.startCount))}}class Ns{id="emitters";#B;constructor(t){this.#B=t}async getPlugin(t){const{EmittersPluginInstance:e}=await Promise.resolve().then(function(){return ka});return new e(this.#B,t)}loadOptions(t,e,i){(this.needsPlugin(e)||this.needsPlugin(i))&&i?.emitters&&(e.emitters=kt(i.emitters,t=>{const e=new Us;return e.load(t),e}))}needsPlugin(t){if(!t)return!1;const e=t.emitters;return V(e)&&!!e.length||void 0!==e}}const Hs=new WeakMap;var $s;async function js(t){t.checkVersion("4.6.0"),await t.pluginManager.register(async t=>{const e=await function(t){const e=t.pluginManager;let i=Hs.get(e);return i||(i=Promise.resolve().then(function(){return Da}).then(({EmittersInstancesManager:t})=>new t(e)).catch(t=>{throw Hs.delete(e),t}),Hs.set(e,i)),i}(t);await async function(t){const{ShapeManager:e}=await Promise.resolve().then(function(){return Oa}),i=t.pluginManager;i.emitterShapeManager??=new e,i.addEmitterShapeGenerator??=(t,e)=>{i.emitterShapeManager?.addShapeGenerator(t,e)}}(t),t.pluginManager.addPlugin(new Ns(e))})}!function(t){t.emitter="emitter"}($s||($s={}));const qs=["emoji"];async function Gs(t,e){try{await yt().fonts.load(`${e??"400"} 36px '${t??"Verdana"}'`)}catch{}}const Ws='"Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif';class Ks{#V=new Map;destroy(){for(const[t,e]of this.#V)e instanceof ImageBitmap&&e.close(),this.#V.delete(t)}draw(t){const e=t.particle.emojiDataKey;if(!e)return;const i=this.#V.get(e);i&&function(t,e){const{context:i,opacity:s}=t,n=i.globalAlpha,a=e.width,o=a*u;i.globalAlpha=s,i.drawImage(e,-o,-o,a,a),i.globalAlpha=n}(t,i)}async init(t){const e=t.actualOptions.particles.shape;if(!qs.some(t=>bt(t,e.type)))return;const i=[Gs(Ws)];kt(qs.map(t=>e.options[t])[0],t=>{t.font&&i.push(Gs(t.font))}),await Promise.all(i)}particleDestroy(t){t.emojiDataKey=void 0}particleInit(t,e){const i=e.shapeData;if(!i.value)return;const s=St(i.value,e.randomIndexData);if(!s)return;const n="string"==typeof s?{font:i.font??Ws,padding:i.padding??0,value:s}:{font:Ws,padding:0,...i,...s},a=n.font,o=n.value,r=`${o}_${a}`;if(this.#V.has(r))return void(e.emojiDataKey=r);const l=2*n.padding,c=J(e.size.value),d=c+l,h=2*d,u=new OffscreenCanvas(h,h),p=u.getContext("2d",t.canvas.render.settings);if(!p)return;p.font=`400 ${(2*c).toString()}px ${a}`,p.textBaseline="middle",p.textAlign="center",p.fillText(o,d,d);const g=u instanceof HTMLCanvasElement?u:u.transferToImageBitmap();this.#V.set(r,g),e.emojiDataKey=r}}async function Qs(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(qs,()=>Promise.resolve(new Ks))})}class Xs{draw(t){!function(t){const{context:e,radius:i}=t,s=2*i,n=i*u,a=i+n,o=-i,r=-i;e.moveTo(o,r+n),e.quadraticCurveTo(o,r,o+n,r),e.quadraticCurveTo(o+i,r,o+i,r+n),e.quadraticCurveTo(o+i,r,o+a,r),e.quadraticCurveTo(o+s,r,o+s,r+n),e.quadraticCurveTo(o+s,r+i,o+a,r+a),e.lineTo(o+i,r+s),e.lineTo(o+n,r+a),e.quadraticCurveTo(o,r+i,o,r+n)}(t)}}async function Ys(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["heart"],()=>Promise.resolve(new Xs))})}const Zs=["image","images"],Js=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d.]+%?\))|currentcolor/gi;async function tn(t){return new Promise(e=>{t.loading=!0;const i=new Image;t.element=i,i.addEventListener("load",()=>{t.loading=!1,e()}),i.addEventListener("error",()=>{t.element=void 0,t.error=!0,t.loading=!1,n().error(`Error loading image: ${t.source}`),e()}),i.src=t.source})}async function en(t){if("svg"!==t.type)return void await tn(t);t.loading=!0;const e=await fetch(t.source);e.ok?t.svgData=await e.text():(n().error("Image not found"),t.error=!0),t.loading=!1}function sn(t,e,i,s,n=!1,a,o){const r=function(t,e,i,s=!1,n,a){const{svgData:o}=t;if(!o)return"";const r=gi(e,s,i,n,a);if(o.includes("fill"))return o.replaceAll(Js,()=>r);const l=o.indexOf(">");return`${o.substring(0,l)} fill="${r}"${o.substring(l)}`}(t,i,s.opacity?.value??1,n,a,o),l={color:i,data:{...t,svgData:r},loaded:!1,ratio:e.width/e.height,replaceColor:e.replaceColor,source:e.src};return new Promise(e=>{const i=new Blob([r],{type:"image/svg+xml"}),s=URL.createObjectURL(i),n=new Image;n.addEventListener("load",()=>{l.loaded=!0,l.element=n,e(l),URL.revokeObjectURL(s)});n.addEventListener("error",()=>{(async()=>{URL.revokeObjectURL(s);const i={...t,error:!1,loading:!0};await tn(i),l.loaded=!0,l.element=i.element,e(l)})()}),n.src=s})}const nn="TSP-2001",an="TSP-2002",on="TSP-2003",rn="TSP-2004";class ln{#C;#a;constructor(t,e){this.#a=t,this.#C=e}draw(t){const{context:e,radius:i,particle:s,opacity:n}=t,a=s.image,o=a?.element;if(a){if(e.globalAlpha=n,o){const t=a.ratio,s={x:-i,y:-i},n=2*i;e.drawImage(o,s.x,s.y,n,n/t)}e.globalAlpha=1}}getSidesCount(){return 12}async init(t){const e=t.actualOptions;if(!e.preload||!this.#a.loadImage)return;const i=[];for(const s of e.preload)i.push(this.#a.loadImage(t,s));await Promise.all(i)}loadShape(t){const e=this.#C;if(!t.shape||!Zs.includes(t.shape))return;const i=t.shapeData;if(!i)return;const s=this.#a.getImages?.(e),n=s?.find(t=>t.name===i.name||t.source===i.src);n||this.#U(e,i).then(()=>{this.loadShape(t)})}particleInit(t,e){if("image"!==e.shape&&"images"!==e.shape)return;const i=this.#a.getImages?.(t),s=e.shapeData;if(!s)return;const n=e.getFillColor(),a=i?.find(t=>t.name===s.name||t.source===s.src);if(!a)return;const o=s.replaceColor;a.loading?setTimeout(()=>{this.particleInit(t,e)}):(async()=>{let i;i=a.svgData&&n?await sn(a,s,n,e,t.hdr,t.peakNits,t.hdrMode):{color:n,data:a,element:a.element,loaded:!0,ratio:s.width&&s.height?s.width/s.height:a.ratio??1,replaceColor:o,source:s.src},i.ratio||(i.ratio=1);const r={image:i,close:s.close??e.shapeClose};e.image=r.image,e.shapeClose=r.close})()}#U=async(t,e)=>{if(!this.#a.loadImage)throw new Error(pt(rn));await this.#a.loadImage(t,{name:e.name,replaceColor:e.replaceColor,src:e.src})}}class cn{height;name;replaceColor;src="";width;load(t){U(t)||(ae(this,"height",t.height),ae(this,"name",t.name),ae(this,"replaceColor",t.replaceColor),ae(this,"src",t.src),ae(this,"width",t.width))}}class dn{id="image-preloader";#a;constructor(t){this.#a=t}async getPlugin(t){const{ImagePreloaderInstance:e}=await Promise.resolve().then(function(){return Ia});return new e(this.#a,t)}loadOptions(t,e,i){if(!i?.preload)return;e.preload??=[];const s=e.preload;for(const t of i.preload){const e=s.find(e=>e.name===t.name||e.src===t.src);if(e)e.load(t);else{const e=new cn;e.load(t),s.push(e)}}}needsPlugin(){return!0}}async function hn(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{!function(t){t.getImages??=e=>{t.images??=new Map;let i=t.images.get(e);return i||(i=[],t.images.set(e,i)),i},t.loadImage??=async(e,i)=>{if(!t.getImages)throw new Error(pt(nn));if(!i.name&&!i.src)throw new Error(pt(an));t.images??=new Map;const s=t.getImages(e);if(!s.some(t=>t.name===i.name||t.source===i.src))try{const n={name:i.name??i.src,source:i.src,type:i.src.substring(i.src.length-3),error:!1,loading:!0,replaceColor:i.replaceColor,ratio:i.width&&i.height?i.width/i.height:void 0};let a;s.push(n),t.images.set(e,s),a=i.replaceColor?en:tn,await a(n)}catch{throw new Error(pt(on,i.name??i.src))}}}(t),t.pluginManager.addPlugin(new dn(t)),t.pluginManager.addShape(Zs,e=>Promise.resolve(new ln(t,e)))})}class un extends Se{sync=!1;load(t){U(t)||(super.load(t),ae(this,"sync",t.sync))}}class pn extends Se{sync=!1;load(t){U(t)||(super.load(t),ae(this,"sync",t.sync))}}class gn{count=0;delay=new un;duration=new pn;load(t){U(t)||(ae(this,"count",t.count),this.delay.load(t.delay),this.duration.load(t.duration))}}class fn{#C;constructor(t){this.#C=t}init(t){const e=this.#C,i=t.options.life;if(!i)return;const s=i.delay.sync?1:j(),n=i.duration.sync?1:j();t.life={delay:e.retina.reduceFactor?Y(i.delay.value)*s/e.retina.reduceFactor*p:0,delayTime:0,duration:e.retina.reduceFactor?Y(i.duration.value)*n/e.retina.reduceFactor*p:0,time:0,count:i.count},t.life.duration<=0&&(t.life.duration=-1),t.life.count<=0&&(t.life.count=-1),t.spawning=t.life.delay>0}isEnabled(t){return!t.destroyed}loadOptions(t,...e){ce(t,"life",gn,...e)}update(t,e){this.isEnabled(t)&&t.life&&function(t,e,i){if(!t.life)return;const s=t.life;let n=!1;if(t.spawning){if(s.delayTime+=e.value,!(s.delayTime>=t.life.delay))return;n=!0,t.spawning=!1,s.delayTime=0,s.time=0}if(-1===s.duration)return;if(n?s.time=0:s.time+=e.value,s.time<s.duration)return;if(s.time=0,t.life.count>0&&t.life.count--,0===t.life.count)return void t.destroy();const a=tt(0,i.width),o=tt(0,i.height);t.position.x=X(a),t.position.y=X(o),t.spawning=!0,s.delayTime=0,s.time=0,t.reset();const r=t.options.life;r&&(s.delay=Y(r.delay.value)*p,s.duration=Y(r.duration.value)*p)}(t,e,this.#C.canvas.size)}}async function mn(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("life",t=>Promise.resolve(new fn(t)))})}class yn{factor=4;value=!0;load(t){U(t)||(ae(this,"factor",t.factor),ae(this,"value",t.value))}}class vn{disable=!0;reduce=new yn;load(t){U(t)||(ae(this,"disable",t.disable),this.reduce.load(t.reduce))}}class wn{id="motion";async getPlugin(t){const{MotionPluginInstance:e}=await Promise.resolve().then(function(){return Ea});return new e(t)}loadOptions(t,e,i){if(!this.needsPlugin())return;let s=e.motion;s?.load||(e.motion=s=new vn),s.load(i?.motion)}needsPlugin(){return!0}}async function bn(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addPlugin(new wn)})}const Pn=new Map;function xn(t,e){const{context:i,radius:s}=t,n=function(t){const e=Pn.get(t);if(e)return e;const i=v/t,s=!!(t%2),n=(-Math.PI+(s?0:i))*u,a=[];for(let e=0;e<t;e++){const t=n+e*i;a[e]={x:Math.cos(t),y:Math.sin(t)}}return Pn.set(t,a),a}(e.count.numerator/e.count.denominator);i.beginPath();for(let t=0;t<n.length;t++){const e=n[t];if(!e)continue;const a=e.x*s,o=e.y*s;t?i.lineTo(a,o):i.moveTo(a,o)}i.closePath()}class Mn{draw(t){const{particle:e,radius:i}=t;xn(t,this.getSidesData(e,i))}getSidesCount(t){const e=t.shapeData;return Math.round(Y(e?.sides??5))}}class zn extends Mn{getSidesData(t,e){const{sides:i}=t;return{count:{denominator:1,numerator:i},length:2.66*e/(i/3)}}}class Cn extends Mn{getSidesCount(){return 3}getSidesData(t,e){return{count:{denominator:1,numerator:3},length:2.66*e/1}}}async function kn(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["polygon"],()=>Promise.resolve(new zn))})}async function Sn(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["triangle"],()=>Promise.resolve(new Cn))})}async function On(t){t.checkVersion("4.6.0"),await Promise.all([kn(t),Sn(t)])}var Dn;!function(t){t.both="both",t.horizontal="horizontal",t.vertical="vertical"}(Dn||(Dn={}));class In{enable=!1;value=0;load(t){U(t)||(ae(this,"enable",t.enable),oe(this,"value",t.value))}}class En{backColor;darken=new In;enable=!1;enlighten=new In;mode=Dn.vertical;speed=25;load(t){U(t)||(void 0!==t.backColor&&(this.backColor=me.create(this.backColor,t.backColor)),this.darken.load(t.darken),ae(this,"enable",t.enable),this.enlighten.load(t.enlighten),ae(this,"mode",t.mode),oe(this,"speed",t.speed))}}class Tn{#k;constructor(t){this.#k=t}getTransformValues(t){const e=t.roll?.enable&&t.roll,i=e&&e.horizontal,s=e&&e.vertical;return{a:i?Math.cos(e.angle):void 0,d:s?Math.sin(e.angle):void 0}}init(e){!function(e,i){const s=i.options.roll;if(s?.enable)if(i.roll={enable:s.enable,horizontal:s.mode===Dn.horizontal||s.mode===Dn.both,vertical:s.mode===Dn.vertical||s.mode===Dn.both,angle:j()*v,speed:Y(s.speed)/360},s.backColor)i.backColor=ai(e,s.backColor);else if(s.darken.enable&&s.enlighten.enable){const e=j()>=u?t.AlterType.darken:t.AlterType.enlighten;i.roll.alter={type:e,value:Y(e===t.AlterType.darken?s.darken.value:s.enlighten.value)}}else s.darken.enable?i.roll.alter={type:t.AlterType.darken,value:Y(s.darken.value)}:s.enlighten.enable&&(i.roll.alter={type:t.AlterType.enlighten,value:Y(s.enlighten.value)});else i.roll={enable:!1,horizontal:!1,vertical:!1,angle:0,speed:0}}(this.#k,e)}isEnabled(t){const e=t.options.roll;return!t.destroyed&&!t.spawning&&!!e?.enable}loadOptions(t,...e){ce(t,"roll",En,...e)}update(t,e){this.isEnabled(t)&&function(t,e){const i=t.options.roll,s=t.roll;if(!s||!i?.enable)return;const n=s.speed*e.factor,a=v;s.angle+=n,s.angle>a&&(s.angle-=a)}(t,e)}}async function Ln(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("roll",()=>Promise.resolve(new Tn(t.pluginManager)))})}class Rn{decay=0;enable=!1;speed=0;sync=!1;load(t){U(t)||(ae(this,"enable",t.enable),oe(this,"speed",t.speed),oe(this,"decay",t.decay),ae(this,"sync",t.sync))}}class _n extends Se{animation=new Rn;direction=t.RotateDirection.clockwise;path=!1;load(t){U(t)||(super.load(t),ae(this,"direction",t.direction),this.animation.load(t.animation),ae(this,"path",t.path))}}class Fn{#C;constructor(t){this.#C=t}init(e){const i=e.options.rotate;if(!i)return;e.rotate={enable:i.animation.enable,value:nt(Y(i.value)),min:0,max:v},e.pathRotation=i.path;let s=i.direction;if(s===t.RotateDirection.random){s=Math.floor(2*j())>0?t.RotateDirection.counterClockwise:t.RotateDirection.clockwise}switch(s){case t.RotateDirection.counterClockwise:case"counterClockwise":e.rotate.status=t.AnimationStatus.decreasing;break;case t.RotateDirection.clockwise:e.rotate.status=t.AnimationStatus.increasing}const n=i.animation;n.enable&&(e.rotate.decay=1-Y(n.decay),e.rotate.velocity=Y(n.speed)/360*this.#C.retina.reduceFactor,n.sync||(e.rotate.velocity*=j())),e.rotation=e.rotate.value}isEnabled(t){const e=t.options.rotate;return!!e&&(!t.destroyed&&!t.spawning&&(!!e.value||e.animation.enable||e.path))}loadOptions(t,...e){ce(t,"rotate",_n,...e)}update(e,i){this.isEnabled(e)&&(e.isRotating=!!e.rotate,e.rotate&&(Ni(e,e.rotate,!1,t.DestroyType.none,i),e.rotation=e.rotate.value))}}async function An(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("rotate",t=>Promise.resolve(new Fn(t)))})}class Bn{draw(t){!function(t){const{context:e,radius:i}=t,s=i*Math.SQRT1_2,n=2*s;e.rect(-s,-s,n,n)}(t)}getSidesCount(){return 4}}async function Vn(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["edge","square"],()=>Promise.resolve(new Bn))})}const Un=0,Nn=0;class Hn{draw(t){!function(t){const{context:e,particle:i,radius:s}=t,n=i.sides,a=i.starInset??2;e.moveTo(Un,Nn-s);for(let t=0;t<n;t++)e.rotate(Math.PI/n),e.lineTo(Un,Nn-s*a),e.rotate(Math.PI/n),e.lineTo(Un,Nn-s)}(t)}getSidesCount(t){const e=t.shapeData;return Math.round(Y(e?.sides??5))}particleInit(t,e){const i=e.shapeData;e.starInset=Y(i?.inset??2)}}async function $n(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addShape(["star"],()=>Promise.resolve(new Hn))})}var jn;!function(t){t.clockwise="clockwise",t.counterClockwise="counter-clockwise",t.random="random"}(jn||(jn={}));class qn{decay=0;enable=!1;speed=0;sync=!1;load(t){U(t)||(ae(this,"enable",t.enable),oe(this,"speed",t.speed),oe(this,"decay",t.decay),ae(this,"sync",t.sync))}}class Gn extends Se{animation=new qn;direction=jn.clockwise;enable=!1;load(t){super.load(t),U(t)||(this.animation.load(t.animation),ae(this,"direction",t.direction),ae(this,"enable",t.enable))}}class Wn{#C;constructor(t){this.#C=t}getTransformValues(t){const e=t.tilt?.enable&&t.tilt;return{b:e?Math.cos(e.value)*e.cosDirection:void 0,c:e?Math.sin(e.value)*e.sinDirection:void 0}}init(e){const i=e.options.tilt;if(!i)return;e.tilt={enable:i.enable,value:nt(Y(i.value)),sinDirection:j()>=u?1:-1,cosDirection:j()>=u?1:-1,min:0,max:v};let s=i.direction;if(s===jn.random){s=Math.floor(2*j())>0?jn.counterClockwise:jn.clockwise}switch(s){case jn.counterClockwise:case"counterClockwise":e.tilt.status=t.AnimationStatus.decreasing;break;case jn.clockwise:e.tilt.status=t.AnimationStatus.increasing}const n=e.options.tilt?.animation;n?.enable&&(e.tilt.decay=1-Y(n.decay),e.tilt.velocity=Y(n.speed)/360*this.#C.retina.reduceFactor,n.sync||(e.tilt.velocity*=j()))}isEnabled(t){const e=t.options.tilt?.animation;return!t.destroyed&&!t.spawning&&!!e?.enable}loadOptions(t,...e){ce(t,"tilt",Gn,...e)}update(e,i){this.isEnabled(e)&&e.tilt&&Ni(e,e.tilt,!1,t.DestroyType.none,i)}}async function Kn(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("tilt",t=>Promise.resolve(new Wn(t)))})}class Qn{angle=50;move=10;load(t){U(t)||(oe(this,"angle",t.angle),oe(this,"move",t.move))}}class Xn{distance=5;enable=!1;speed=new Qn;load(t){if(!U(t)&&(oe(this,"distance",t.distance),ae(this,"enable",t.enable),void 0!==t.speed))if(_(t.speed))this.speed.load({angle:t.speed});else{const e=t.speed;"min"in e?this.speed.load({angle:e}):this.speed.load(t.speed)}}}class Yn{#C;constructor(t){this.#C=t}init(t){const e=t.options.wobble;t.wobble=e?.enable?{angle:j()*v,angleSpeed:Y(e.speed.angle)/360,moveSpeed:Y(e.speed.move)/10}:{angle:0,angleSpeed:0,moveSpeed:0},t.retina.wobbleDistance=Y(e?.distance??0)*this.#C.retina.pixelRatio}isEnabled(t){return!t.destroyed&&!t.spawning&&!!t.options.wobble?.enable}loadOptions(t,...e){ce(t,"wobble",Xn,...e)}update(t,e){this.isEnabled(t)&&function(t,e,i){const{wobble:s}=e.options,{wobble:n}=e;if(!s?.enable||!n)return;const a=t.retina.reduceFactor,o=n.angleSpeed*i.factor*a,r=n.moveSpeed*i.factor*a*(e.retina.wobbleDistance??0)/16.666666666666668,l=v,{position:c}=e;n.angle+=o,n.angle>l&&(n.angle-=l),c.x+=r*Math.cos(n.angle),c.y+=r*Math.abs(Math.sin(n.angle))}(this.#C,t,e)}}async function Zn(t){t.checkVersion("4.6.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("wobble",t=>Promise.resolve(new Yn(t)))})}class Jn{angle;colors;count;decay;disableForReducedMotion;drift;flat;gravity;position;scalar;shapeOptions;shapes;spread;startVelocity;ticks;zIndex;constructor(){this.angle=90,this.count=50,this.spread=45,this.startVelocity=45,this.decay=.9,this.gravity=1,this.drift=0,this.ticks=200,this.position={x:50,y:50},this.colors=["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],this.shapes=["square","circle"],this.scalar=1,this.zIndex=100,this.disableForReducedMotion=!0,this.flat=!1,this.shapeOptions={}}get origin(){return{x:this.position.x/h,y:this.position.y/h}}set origin(t){this.position.x=t.x*h,this.position.y=t.y*h}get particleCount(){return this.count}set particleCount(t){this.count=t}load(t){if(U(t))return;ae(this,"angle",t.angle);const e=t.count??t.particleCount;void 0!==e&&(this.count=e),ae(this,"spread",t.spread),ae(this,"startVelocity",t.startVelocity),ae(this,"decay",t.decay),ae(this,"flat",t.flat),ae(this,"gravity",t.gravity),ae(this,"drift",t.drift),ae(this,"ticks",t.ticks);const i=t.origin;i&&!t.position&&(t.position={x:void 0===i.x?void 0:i.x*h,y:void 0===i.y?void 0:i.y*h});const s=t.position;s&&(void 0!==s.x&&(this.position.x=s.x),void 0!==s.y&&(this.position.y=s.y)),void 0!==t.colors&&(V(t.colors)?this.colors=[...t.colors]:this.colors=t.colors);const n=t.shapeOptions;if(void 0!==n)for(const t in n){const e=n[t];e&&(this.shapeOptions[t]=Ct(this.shapeOptions[t]??{},e))}void 0!==t.shapes&&(V(t.shapes)?this.shapes=[...t.shapes]:this.shapes=t.shapes),ae(this,"scalar",t.scalar),ae(this,"zIndex",t.zIndex),ae(this,"disableForReducedMotion",t.disableForReducedMotion)}}const ta=new Map;async function ea(t,e){const i=new Jn;i.load(e.options);const s=Number.isFinite(i.ticks)&&i.ticks>0?i.ticks:void 0,n=void 0===s?0:12e3/(60*s);let a=ta.get(e.id);a instanceof Promise&&(await a,a=ta.get(e.id));const o=a;if(o&&!o.destroyed){const t=o;if("addEmitter"in t)return await async function(t,e,i){await(t.addEmitter?.({startCount:e.count,position:e.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{paint:{fill:{color:{value:e.colors},enable:!0}},shape:{type:e.shapes,options:e.shapeOptions},life:{count:1},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:i,startValue:"max",destroy:"min",count:1}},size:{value:5*e.scalar},move:{angle:{value:e.spread,offset:0},drift:{min:-e.drift,max:e.drift},gravity:{acceleration:9.81*e.gravity},speed:3*e.startVelocity,decay:1-e.decay,direction:-e.angle},rotate:{value:e.flat?0:{min:0,max:360},direction:"random",animation:{enable:!e.flat,speed:60}},tilt:{direction:"random",enable:!e.flat,value:e.flat?0:{min:0,max:360},animation:{enable:!0,speed:60}},roll:{darken:{enable:!0,value:25},enable:!e.flat,speed:{min:15,max:25}},wobble:{distance:30,enable:!e.flat,speed:{min:-15,max:15}}}}))}(t,i,n),o}const r=(async()=>{const s=function(t,e,i){return{fullScreen:{enable:!e.canvas,zIndex:t.zIndex},fpsLimit:120,particles:{number:{value:0},paint:{fill:{color:{value:t.colors},enable:!0}},shape:{type:t.shapes,options:t.shapeOptions},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:i,startValue:"max",destroy:"min",count:1}},size:{value:5*t.scalar},links:{enable:!1},life:{count:1},move:{angle:{value:t.spread,offset:0},drift:{min:-t.drift,max:t.drift},enable:!0,gravity:{enable:!0,acceleration:9.81*t.gravity},speed:3*t.startVelocity,decay:1-t.decay,direction:-t.angle,random:!0,straight:!1,outModes:{top:"none",default:"destroy"}},rotate:{value:t.flat?0:{min:0,max:360},direction:"random",animation:{enable:!t.flat,speed:60}},tilt:{direction:"random",enable:!t.flat,value:t.flat?0:{min:0,max:360},animation:{enable:!0,speed:60}},roll:{darken:{enable:!0,value:25},enable:!t.flat,speed:{min:15,max:25}},wobble:{distance:30,enable:!t.flat,speed:{min:-15,max:15}}},motion:{disable:t.disableForReducedMotion},emitters:{name:"confetti",startCount:t.count,position:t.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1}}}}(i,e,n),a=await t.load({id:e.id,element:e.canvas,options:s});return ta.set(e.id,a),a})();return ta.set(e.id,r),r}let ia=null;async function sa(t){return ia||(ia=async function(t){t.checkVersion("4.6.0"),await t.pluginManager.register(async t=>{await Promise.all([ds(t),bn(t),js(t),Ls(t),Ys(t),hn(t),On(t),Vn(t),$n(t),Qs(t),An(t),mn(t),Ln(t),Kn(t),Zn(t)])})}(t),ia)}async function na(t,e){let i,s;return await sa(xi),R(t)?(s=t,i=e??{}):(s="confetti",i=t),ea(xi,{id:s,options:i})}na.create=async(t,e={})=>{await sa(xi);const i=t?.getAttribute("id")??"confetti";return t?.setAttribute("id",i),await ea(xi,{id:i,canvas:t??void 0,options:e}),async(s,n)=>{let a,o;return R(s)?(o=s,a=n??e):(o=i,a=s),ea(xi,{id:o,canvas:t??void 0,options:a})}},na.init=async()=>{await sa(xi)},na.version="4.6.0",globalThis.confetti=na;const aa=globalThis;aa.confetti=na,aa.tsParticles=xi;function oa(t,e,i){const s=e[i];void 0!==s&&(t[i]=(t[i]??1)*s)}class ra{#N;#H;#$;#j;#q;#C;#G;#W;#K;#Q;#X;#Y;#k;#Z;#J;#tt={};#et=[void 0,void 0];#it={};constructor(t,e,i){this.#k=t,this.#C=e,this.#j=i,this.#G=null,this.#N=null,this.#H=new Set,this.#J=[],this.#Z=[],this.#$=[],this.#q=[],this.#K=[],this.#Q=[],this.#X=[],this.#Y={0:[],1:[],2:[],3:[],4:[],5:[],6:[],7:[]}}get settings(){return this.#W}canvasClear(){this.#C.actualOptions.clear&&this.draw(t=>{t.clearRect(g.x,g.y,this.#j.size.width,this.#j.size.height)})}clear(){const e=new Set;for(const t of this.#$)if(e.add(t),t.canvasClear?.())return t;for(const i of Object.values(t.DrawLayer))if("number"==typeof i)for(const t of this.#st(i))if(!e.has(t)&&(e.add(t),t.canvasClear?.()))return t;this.canvasClear()}destroy(){this.stop(),this.#N=null,this.#H.clear(),this.#J=[],this.#Z=[],this.#$=[],this.#q=[],this.#K=[],this.#Q=[],this.#X=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#Y[e]=[])}draw(t){const e=this.#G;if(e)return t(e)}drawParticle(t,e){if(t.spawning||t.destroyed)return;const i=t.getRadius();if(i<=0)return;const s=t.getFillColor(),n=t.getStrokeColor();let[a,o]=this.#nt(t);if(a??=s,o??=n,!a&&!o)return;const r=this.#C,l=t.options.zIndex,c=1-t.zIndexFactor,{fillOpacity:d,opacity:h,strokeOpacity:u}=t.getOpacity(),p=this.#it,g=this.#tt,f=a?gi(a,r.hdr,d*h,r.peakNits,r.hdrMode):void 0,m=o?gi(o,r.hdr,u*h,r.peakNits,r.hdrMode):f;p.a=p.b=p.c=p.d=void 0,g.fill=f,g.stroke=m,this.draw(s=>{for(const i of this.#X)i.drawParticleSetup?.(s,t,e);this.#at(s,t,i,h,g,p),this.#ot({container:r,context:s,particle:t,delta:e,colorStyles:g,radius:i*c**l.sizeRate,opacity:h,transform:p}),this.#rt(t);for(const i of this.#Q)i.drawParticleCleanup?.(s,t,e)})}drawParticlePlugins(t,e){this.draw(i=>{for(const s of this.#K)this.#lt(i,s,t,e)})}drawParticles(e){const{particles:i,actualOptions:s}=this.#C;this.clear(),i.update(e),this.draw(n=>{const a=this.#j.size.width,o=this.#j.size.height;if(this.#N)try{n.drawImage(this.#N,g.x,g.y,a,o)}catch{this.#ct("background-element-draw-error","Error drawing background element onto canvas")}const r=s.background;if(r.draw)try{r.draw(n,e)}catch{this.#ct("background-draw-error","Error in background.draw callback")}for(const e of this.#st(t.DrawLayer.BackgroundMask))e.canvasPaint?.();for(const i of this.#st(t.DrawLayer.CanvasSetup))i.drawSettingsSetup?.(n,e);for(const i of this.#st(t.DrawLayer.PluginContent))i.draw?.(n,e);i.drawParticles(e);for(const i of this.#st(t.DrawLayer.CanvasCleanup))i.clearDraw?.(n,e),i.drawSettingsCleanup?.(n,e)})}init(){this.initUpdaters(),this.initPlugins(),this.#dt(),this.paint()}initPlugins(){this.#$=[],this.#q=[],this.#K=[],this.#X=[],this.#Q=[];for(const e of Object.values(t.DrawLayer))"number"==typeof e&&(this.#Y[e]=[]);this.#ht()}initUpdaters(){this.#J=[],this.#Z=[];for(const t of this.#C.particleUpdaters)t.afterDraw&&this.#Z.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#J.push(t)}paint(){let e=!1;for(const i of this.#st(t.DrawLayer.BackgroundMask))if(e=i.canvasPaint?.()??!1,e)break;e||this.paintBase()}paintBase(t){this.draw(e=>{e.fillStyle=t??"rgba(0,0,0,0)",e.fillRect(g.x,g.y,this.#j.size.width,this.#j.size.height)})}paintImage(t,e){this.draw(i=>{if(!t)return;const s=i.globalAlpha;i.globalAlpha=e,i.drawImage(t,g.x,g.y,this.#j.size.width,this.#j.size.height),i.globalAlpha=s})}setContext(t){this.#G=t,this.#G&&(this.#G.globalCompositeOperation=l)}setContextSettings(t){this.#W=t}stop(){this.draw(t=>{t.clearRect(g.x,g.y,this.#j.size.width,this.#j.size.height)})}updateBackgroundElement(){this.#dt()}#rt(t){for(const e of this.#Z)e.afterDraw?.(t)}#at(t,e,i,s,n,a){for(const o of this.#J){if(o.getColorStyles){const{fill:a,stroke:r}=o.getColorStyles(e,t,i,s);a&&(n.fill=a),r&&(n.stroke=r)}if(o.getTransformValues){const t=o.getTransformValues(e);for(const e in t)oa(a,t,e)}o.beforeDraw?.(e)}}#ut(t,e){if(!t?.drawAfter)return;const{particle:i}=e;i.effect&&t.drawAfter(e)}#pt(t,e){if(!t?.drawBefore)return;const{particle:i}=e;i.effect&&t.drawBefore(e)}#ot(t){const{container:e,context:i,particle:s,delta:n,colorStyles:a,radius:o,opacity:r,transform:l}=t,{effectDrawers:c,shapeDrawers:d}=e,h=s.getPosition(),u=s.getTransformData(l),p={x:h.x,y:h.y};i.setTransform(u.a,u.b,u.c,u.d,h.x,h.y),a.fill&&(i.fillStyle=a.fill);const g=!!s.fillEnabled,f=s.strokeWidth??0;i.lineWidth=f,a.stroke&&(i.strokeStyle=a.stroke);const m={context:i,particle:s,radius:o,drawRadius:1*o,opacity:r,delta:n,pixelRatio:e.retina.pixelRatio,fill:g,stroke:f>0,transformData:u,position:{...h},drawPosition:p,drawScale:1};for(const t of e.plugins)t.drawParticleTransform?.(m);const y=s.effect?c.get(s.effect):void 0,v=s.shape?d.get(s.shape):void 0;this.#pt(y,m),this.#gt(v,m),this.#ft(v,m),this.#mt(v,m),this.#ut(y,m),i.resetTransform()}#lt(t,e,i,s){e.drawParticle&&e.drawParticle(t,i,s)}#ft(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())}#mt(t,e){if(!t?.afterDraw)return;const{particle:i}=e;i.shape&&t.afterDraw(e)}#gt(t,e){if(!t?.beforeDraw)return;const{particle:i}=e;i.shape&&t.beforeDraw(e)}#st(t){return this.#Y[t]}#nt(t){let e,i;for(const s of this.#q)if(!e&&s.particleFillColor&&(e=ai(this.#k,s.particleFillColor(t))),!i&&s.particleStrokeColor&&(i=ai(this.#k,s.particleStrokeColor(t))),e&&i)break;return this.#et[0]=e,this.#et[1]=i,this.#et}#yt(e){const i=[[t.DrawLayer.BackgroundMask,!!e.canvasPaint],[t.DrawLayer.CanvasSetup,!!e.drawSettingsSetup],[t.DrawLayer.PluginContent,!!e.draw],[t.DrawLayer.CanvasCleanup,!!(e.clearDraw??e.drawSettingsCleanup)]];for(const[t,s]of i)s&&this.#Y[t].push(e)}#ht(){for(const t of this.#C.plugins)(t.particleFillColor??t.particleStrokeColor)&&this.#q.push(t),t.drawParticle&&this.#K.push(t),t.drawParticleSetup&&this.#X.push(t),t.drawParticleCleanup&&this.#Q.push(t),t.canvasClear&&this.#$.push(t),this.#yt(t)}#vt(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas||"undefined"!=typeof HTMLVideoElement&&t instanceof HTMLVideoElement||"undefined"!=typeof HTMLImageElement&&t instanceof HTMLImageElement}#dt(){const t=this.#C.actualOptions.background;if(this.#N=null,t.element)if("string"==typeof t.element){if("undefined"!=typeof document){let e;try{e=document.querySelector(t.element)}catch{return void this.#ct("background-element-invalid-selector",`Background element selector "${t.element}" is invalid`)}e&&this.#vt(e)?this.#N=e:e?this.#ct("background-element-not-supported",`Background element "${t.element}" is not a supported drawable element (canvas, video, or img)`):this.#ct("background-element-not-found",`Background element selector "${t.element}" not found`)}}else this.#vt(t.element)&&(this.#N=t.element)}#ct(t,e){this.#H.has(t)||(this.#H.add(t),n().warning(e))}}const la=new WeakMap;function ca(t,e,i=!1){if(!e)return;const s=t.style,n=new Set;for(let t=0;t<s.length;t++){const e=s.item(t);e&&n.add(e)}for(let t=0;t<e.length;t++){const i=e.item(t);i&&n.add(i)}for(const t of n){const n=e.getPropertyValue(t);n?s.setProperty(t,n,i?"important":""):s.removeProperty(t)}}class da{domElement;render;renderCanvas;size;zoom=1;#C;#wt;#bt;#Pt;#xt;#k;#Mt;#zt;#Ct;#kt;constructor(t,e){this.#k=t,this.#C=e,this.render=new ra(t,e,this),this.#Ct={height:0,width:0};const i=e.retina.pixelRatio,s=this.#Ct;this.size={height:s.height*i,width:s.width*i},this.#wt=!1,this.#zt=[],this.#Mt="none"}get#St(){return this.#C.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this.#wt){const t=this.domElement;t?.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this.#Ot();this.render.destroy(),this.#zt=[]}getZoomCenter(){const t=this.#C.retina.pixelRatio,{width:e,height:i}=this.size;return this.#kt?this.#kt:{x:e*u/t,y:i*u/t}}init(){this.#Dt(t=>{t.disconnect()}),this.#Pt=wt(t=>{for(const e of t)"attributes"===e.type&&"style"===e.attributeName&&this.#It()}),this.resize(),this.#Et(),this.#Dt(t=>{const e=this.domElement;e&&e instanceof Node&&t.observe(e,{attributes:!0})}),this.initPlugins(),this.#Tt(),this.initBackground(),this.#Lt(),this.render.init()}initBackground(){const e=this.#C,i=e.actualOptions.background,s=this.domElement;if(!s)return;const n=s.style,a=si(this.#k,i.color);if(a){const s=e.actualOptions.hdr;n.backgroundColor=pi(a,e.hdr,i.opacity,s.peakNits,A(t.HdrMode,s.mode,t.HdrMode.standard))}else n.backgroundColor="";n.backgroundImage=i.image||"",n.backgroundPosition=i.position||"",n.backgroundRepeat=i.repeat||"",n.backgroundSize=i.size||""}initPlugins(){this.#zt=[];for(const t of this.#C.plugins)t.resize&&this.#zt.push(t)}loadCanvas(t){this.#wt&&this.domElement&&this.domElement.remove();const e=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=e,this.#wt=!!e&&"true"===e.dataset[o],this.renderCanvas=e?(t=>{const e=la.get(t);if(e)return e;if("function"!=typeof t.transferControlToOffscreen)throw new TypeError(pt(ut.offscreenCanvasUnsupported));try{const e=t.transferControlToOffscreen();return la.set(t,e),e}catch{throw new TypeError(pt(ut.offscreenCanvasTransferFailed))}})(e):t;const i=this.domElement;i&&(i.ariaHidden="true",this.#xt=Dt(i.style));const s=this.#Ct,n=this.renderCanvas;i?(s.height=i.offsetHeight,s.width=i.offsetWidth):(s.height=n.height,s.width=n.width);const a=this.#C.retina.pixelRatio,r=this.size;n.height=r.height=s.height*a,n.width=r.width=s.width*a}resize(){const t=this.domElement;if(!t)return!1;const e=this.#C,i=this.renderCanvas;if(void 0===i)return!1;const s=e.canvas.#Ct,n={width:t.offsetWidth,height:t.offsetHeight},a=e.retina.pixelRatio,o={width:n.width*a,height:n.height*a};if(n.height===s.height&&n.width===s.width&&o.height===i.height&&o.width===i.width)return!1;const r={...s};s.height=n.height,s.width=n.width;const l=this.size;return i.width=l.width=o.width,i.height=l.height=o.height,this.#C.started&&e.particles.setResizeFactor({width:s.width/r.width,height:s.height/r.height}),!0}setPointerEvents(t){this.domElement&&(this.#Mt=t,this.#It())}setZoom(t,e){this.zoom=t,this.#kt=e}stop(){this.#Dt(t=>{t.disconnect()}),this.#Pt=void 0,this.#Rt(),this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#C,e=t.updateActualOptions();t.particles.setDensity(),this.#_t(),e&&await t.refresh()}#_t(){for(const t of this.#zt)t.resize?.()}#Tt(){const e=this.#C,i=e.actualOptions.hdr.enable&&vt("(color-gamut: p3)")?.matches&&vt("(dynamic-range: high)")?.matches;e.hdrMode=A(t.HdrMode,e.actualOptions.hdr.mode,t.HdrMode.standard),e.peakNits=e.actualOptions.hdr.peakNits;const s=this.renderCanvas;if(!s)return void(e.hdr=i??!1);let n;this.render.setContextSettings({alpha:!0,desynchronized:!0,willReadFrequently:!1,...i?{colorSpace:"display-p3",colorType:"float16"}:{colorSpace:"srgb"}});try{n=s.getContext("2d",this.render.settings)}catch{n=null}if(i&&!n){const t={alpha:!0,desynchronized:!0,willReadFrequently:!1,colorSpace:"srgb"};this.render.setContextSettings(t);try{n=s.getContext("2d",t)}catch{n=null}}if(this.render.setContext(n),n){const t=(t=>{if(!t)return;const e=t;return e.getContextAttributes?.().colorSpace??void 0})(n);void 0!==t&&(e.hdr="display-p3"===t)}}#Lt(){this.#Rt();const t=vt("(color-gamut: p3)"),e=vt("(dynamic-range: high)"),i=()=>{this.#Tt(),this.initBackground()},s=[];t&&(t.addEventListener("change",i),s.push({handler:i,mql:t})),e&&(e.addEventListener("change",i),s.push({handler:i,mql:e})),this.#bt=s}#Et(){const t=this.domElement,e=this.#C.actualOptions;if(t){this.#St?this.#Ft():this.#Ot();for(const i in e.style){if(!i||!(i in e.style))continue;const s=e.style[i];s&&t.style.setProperty(i,s,"important")}}}#Rt(){if(this.#bt){for(const{handler:t,mql:e}of this.#bt)e.removeEventListener("change",t);this.#bt=void 0}}#It(){const t=this.domElement;if(!t)return;this.#Dt(t=>{t.disconnect()}),this.#Et(),this.initBackground();const e=this.#Mt;t.style.pointerEvents=e,t.style.setProperty("pointer-events",e),this.#Dt(e=>{t instanceof Node&&e.observe(t,{attributes:!0})})}#Ot(){const t=this.domElement,e=this.#xt;t&&e&&ca(t,e,!0)}#Dt(t){this.#Pt&&t(this.#Pt)}#Ft(){const t=this.domElement;t&&ca(t,Tt(this.#C.actualOptions.fullScreen.zIndex),!0)}}class ha{#C;#At;#Bt;#Vt;constructor(t){this.#C=t,this.#At={visibilityChange:()=>{this.#Ut()},resize:()=>{this.#Nt()}}}addListeners(){this.#Ht(!0)}removeListeners(){void 0!==this.#Vt&&(clearTimeout(this.#Vt),this.#Vt=void 0),this.#Ht(!1)}#Ut(){const t=this.#C;t.actualOptions.pauseOnBlur&&(yt().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))}#Nt(){this.#Vt&&(clearTimeout(this.#Vt),this.#Vt=void 0);const t=async()=>{await this.#C.canvas.windowResize()};this.#Vt=setTimeout(()=>{t()},this.#C.actualOptions.resize.delay*p)}#Ht(t){const e=this.#At;this.#$t(t),"undefined"!=typeof document&&Lt(document,d,e.visibilityChange,t,!1)}#$t(t){const e=this.#At,i=this.#C;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void Lt(globalThis,c,e.resize,t);const s=i.canvas.domElement;this.#Bt&&!t?(s&&this.#Bt.unobserve(s),this.#Bt.disconnect(),this.#Bt=void 0):!this.#Bt&&t&&s&&(this.#Bt=new ResizeObserver(t=>{t.some(t=>t.target===s)&&this.#Nt()}),this.#Bt.observe(s))}}function ua(t){if(!bt(t.outMode,t.checkModes))return;const e=2*t.radius;t.coord>t.maxCoord-e?t.setCb(-t.radius):t.coord<e&&t.setCb(t.radius)}function pa(t,e){const i=t%e;return i<0?i+e:i}function ga(t,e,i,s){const n=je(i,e,e.actualOptions.particles),a=n.reduceDuplicates;t.effect=St(n.effect.type,t.id,a),t.shape=St(n.shape.type,t.id,a);const o=n.effect,r=n.shape;if(s){if(s.effect){const e=s.effect.type;if(e&&e!==t.effect){const i=St(e,t.id,a);i&&(t.effect=i)}o.load(s.effect)}if(s.shape){const e=s.shape.type;if(e&&e!==t.shape){const i=St(e,t.id,a);i&&(t.shape=i)}r.load(s.shape)}}if(t.effect===m){const i=[...e.effectDrawers.keys()];t.effect=i[Math.floor(j()*i.length)]}if(t.shape===m){const i=[...e.shapeDrawers.keys()];t.shape=i[Math.floor(j()*i.length)]}t.effectData=t.effect?function(t,e,i,s){const n=e.options[t];return Ct({close:e.close},St(n,i,s))}(t.effect,o,t.id,a):void 0,t.shapeData=t.shape?function(t,e,i,s){const n=e.options[t];return Ct({close:e.close},St(n,i,s))}(t.shape,r,t.id,a):void 0,n.load(s);const l=t.effectData,c=t.shapeData;return l&&n.load(l.particles),c&&n.load(c.particles),t.effectClose=l?.close??n.effect.close,t.shapeClose=c?.close??n.shape.close,n}class fa{backColor;destroyed;direction;effect;effectClose;effectData;fillColor;fillEnabled;fillOpacity;group;id;ignoresResizeRatio;initialPosition;initialVelocity;isRotating;justWarped;lastPathTime;misplaced;moveCenter;offset;opacity;options;outType;pathRotation;position;randomIndexData;retina;roll;rotation;shape;shapeClose;shapeData;sides;size;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;#jt={fillOpacity:1,opacity:1,strokeOpacity:1};#qt=E.origin;#Gt={sin:0,cos:0};#Wt={a:1,b:0,c:0,d:1};#C;#Kt=[];#k;constructor(t,e){this.#k=t,this.#C=e}addModifier(t){this.#Kt.push(t),this.#Kt.sort((t,e)=>t.priority-e.priority)}clearModifiers(){this.#Kt.length=0}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.clearModifiers();const i=this.#C,s=this.shape?i.shapeDrawers.get(this.shape):void 0;s?.particleDestroy?.(this);for(const t of i.particleDestroyedPlugins)t.particleDestroyed?.(this,e);for(const t of i.particleUpdaters)t.particleDestroyed?.(this,e);this.#C.dispatchEvent(t.EventType.particleDestroyed,{particle:this})}draw(t){const e=this.#C.canvas.render;e.drawParticlePlugins(this,t),e.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:0)}getFillColor(){return this.#Qt(this.#Xt(mi(this.fillColor),t=>t.fillColor))}getMass(){return this.getRadius()**2*Math.PI*u}getModifier(t){return this.#Kt.find(e=>e.id===t)}getOpacity(){const t=this.options.zIndex,e=(1-this.zIndexFactor)**t.opacityRate,i=Y(this.opacity?.value??1),s=this.#Xt(void 0,t=>t.opacity)??i;return this.#jt.fillOpacity=this.fillOpacity??1,this.#jt.opacity=s*e,this.#jt.strokeOpacity=this.strokeOpacity??1,this.#jt}getPosition(){return this.#qt.x=this.position.x+this.offset.x,this.#qt.y=this.position.y+this.offset.y,this.#qt.z=this.position.z,this.#qt}getRadius(){return this.#Xt(this.size.value,t=>t.radius)}getRotateData(){const t=this.getAngle();return this.#Gt.sin=Math.sin(t),this.#Gt.cos=Math.cos(t),this.#Gt}getStrokeColor(){return this.#Qt(this.#Xt(mi(this.strokeColor),t=>t.strokeColor))}getTransformData(t){const e=this.getRotateData(),i=this.isRotating;return this.#Wt.a=e.cos*(t.a??f.a),this.#Wt.b=i?e.sin*(t.b??1):t.b??f.b,this.#Wt.c=i?-e.sin*(t.c??1):t.c??f.c,this.#Wt.d=e.cos*(t.d??f.d),this.#Wt}init(e,i,s,n){const a=this.#C;!function(e,i,s){e.id=i,e.group=s,e.justWarped=!1,e.effectClose=!0,e.shapeClose=!0,e.pathRotation=!1,e.lastPathTime=0,e.destroyed=!1,e.unbreakable=!1,e.isRotating=!1,e.rotation=0,e.misplaced=!1,e.retina={maxDistance:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},e.size={value:1,max:1,min:1,enable:!1},e.outType=t.ParticleOutType.normal,e.ignoresResizeRatio=!0}(this,e,n),this.options=ga(this,a,this.#k,s),a.retina.initParticle(this),function(t,e){for(const i of t)i.preInit?.(e)}(a.particleUpdaters,this),this.#Yt(i),this.initialVelocity=this.#Zt(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/a.zLayers,this.sides=24,function(t,e){let i,s;t.effect&&(i=e.effectDrawers.get(t.effect)),i?.loadEffect&&i.loadEffect(t),t.shape&&(s=e.shapeDrawers.get(t.shape)),s?.loadShape&&s.loadShape(t);const n=s?.getSidesCount;n&&(t.sides=n(t))}(this,a),this.spawning=!1,function(t,e){for(const i of t)i.init(e)}(a.particleUpdaters,this),function(t,e){const i=e.shape?t.shapeDrawers.get(e.shape):void 0,s=e.effect?t.effectDrawers.get(e.effect):void 0;s?.particleInit?.(t,e),i?.particleInit?.(t,e)}(a,this),function(t,e){for(const i of t.particleCreatedPlugins)i.particleCreated?.(e)}(a,this)}isInsideCanvas(t){return this.#Jt(t).inside}isInsideCanvasForOutMode(t,e){return this.#Jt(e,t).inside}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const e=pa(t,v);return e>=Math.PI*u&&e<3*Math.PI*u}if(this.roll.horizontal){const e=pa(t+Math.PI*u,v);return e>=Math.PI&&e<2*Math.PI}if(this.roll.vertical){const e=pa(t,v);return e>=Math.PI&&e<2*Math.PI}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}removeModifier(t){const e=this.#Kt.findIndex(e=>e.id===t);e>=0&&this.#Kt.splice(e,1)}reset(){for(const t of this.#C.particleUpdaters)t.reset?.(this)}#Xt(t,e){let i=t;for(const t of this.#Kt)if(t.enabled){const s=e(t);void 0!==s&&(i=s)}return i}#te(t,e){let i=0,s=t?E.create(t.x,t.y,e):void 0;const n=this.#C,a=n.particlePositionPlugins,o=this.options.move.outModes,r=this.getRadius(),l=n.canvas.size;for(;;){for(const t of a){const i=t.particlePosition?.(s,this);if(i)return E.create(i.x,i.y,e)}const t=dt({size:l,position:s}),c=E.create(t.x,t.y,e);this.#ee(c,r,o.left??o.default),this.#ee(c,r,o.right??o.default),this.#ie(c,r,o.top??o.default),this.#ie(c,r,o.bottom??o.default);let d=!0;for(const t of n.particles.checkParticlePositionPlugins)if(d=t.checkParticlePosition?.(this,c,i)??!0,!d)break;if(d)return c;i+=1,s=void 0}}#Zt(){const e=this.options.move,i=ot(this.direction).copy();if(e.direction===t.MoveDirection.inside||e.direction===t.MoveDirection.outside)return i;const s=nt(Y(e.angle.value)),n=nt(Y(e.angle.offset)),a={left:n-s*u,right:n+s*u};return e.straight||(i.angle+=X(tt(a.left,a.right))),e.random&&"number"==typeof e.speed&&(i.length*=j()),i}#ee(e,i,s){ua({outMode:s,checkModes:[t.OutMode.bounce],coord:e.x,maxCoord:this.#C.canvas.size.width,setCb:t=>e.x+=t,radius:i})}#ie(e,i,s){ua({outMode:s,checkModes:[t.OutMode.bounce],coord:e.y,maxCoord:this.#C.canvas.size.height,setCb:t=>e.y+=t,radius:i})}#se(e,i){const s=this.getRadius(),n=this.#C.canvas.size,a=i===t.OutMode.bounce||i===t.OutMode.split,o=a?this.getPosition():this.position;return e===t.OutModeDirection.bottom?{inside:a?o.y+s<n.height:o.y-s<n.height,reason:"default"}:e===t.OutModeDirection.left?{inside:a?o.x-s>0:o.x+s>0,reason:"default"}:e===t.OutModeDirection.right?{inside:a?o.x+s<n.width:o.x-s<n.width,reason:"default"}:e===t.OutModeDirection.top?{inside:a?o.y-s>0:o.y+s>0,reason:"default"}:{inside:o.x>=-s&&o.y>=-s&&o.y<=n.height+s&&o.x<=n.width+s,reason:"default"}}#ne(t,e){return{canvasSize:this.#C.canvas.size,direction:t,outMode:e,particle:this,radius:this.getRadius()}}#Jt(e,i){const s=this.#se(e,i),n=this.#C,a=this.shape?n.shapeDrawers.get(this.shape):void 0,o=this.effect?n.effectDrawers.get(this.effect):void 0;if(!a?.isInsideCanvas&&!o?.isInsideCanvas)return s;const r=this.#ne(e,i),l=a?.isInsideCanvas?this.#ae(a.isInsideCanvas(r),"shape"):void 0,c=o?.isInsideCanvas?this.#ae(o.isInsideCanvas(r),"effect"):void 0;if(l&&c){const e=Math.max(l.margin??0,c.margin??0);return{inside:i===t.OutMode.destroy||i===t.OutMode.out?l.inside||c.inside:l.inside&&c.inside,margin:e>0?e:void 0,reason:"combined"}}return l??c??s}#Qt(t){return t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?Pi(t,this.roll.alter.type,this.roll.alter.value):t:t}#Yt(e){const i=this.#C,s=Math.floor(Y(this.options.zIndex.value)),n=this.#te(e,K(s,0,i.zLayers));if(!n)throw new Error(pt(ut.particlePositionNotFound));this.position=n,this.initialPosition=this.position.copy();const a=i.canvas.size;switch(this.moveCenter={...Ot(this.options.move.center,a),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=at(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case t.MoveDirection.inside:this.outType=t.ParticleOutType.inside;break;case t.MoveDirection.outside:this.outType=t.ParticleOutType.outside}this.offset=T.origin}#ae(t,e){return"boolean"==typeof t?{inside:t,reason:e}:{inside:t.inside,margin:t.margin,reason:t.reason??e}}}class ma{#oe=new Map;#re;#le=[];#ce;#de;#he=[];#ue;constructor(t){this.#re=t,this.#ce=0,this.#ue=0}get cellSize(){return this.#re}set cellSize(t){this.#de=t}clear(){this.#oe.clear();const t=this.#de;t&&(this.#re=t),this.#de=void 0}insert(t){const{x:e,y:i}=t.getPosition(),s=this.#pe(e,i);this.#oe.has(s)||this.#oe.set(s,[]),this.#oe.get(s)?.push(t)}query(t,e,i=[]){const s=this.#ge(t);if(!s||!this.#oe.size)return i;const n=Math.floor(s.minX/this.#re),a=Math.floor(s.maxX/this.#re),o=Math.floor(s.minY/this.#re),r=Math.floor(s.maxY/this.#re);if(!Number.isSafeInteger(n)||!Number.isSafeInteger(a)||!Number.isSafeInteger(o)||!Number.isSafeInteger(r)||n>a||o>r)return i;if(!e&&(a-n+1)*(r-o+1)>Math.max(64,16*this.#oe.size)){const e=[];for(const t of this.#oe.keys()){const i=t.indexOf("_"),s=Number(t.slice(0,i)),l=Number(t.slice(i+1));s>=n&&s<=a&&l>=o&&l<=r&&e.push({x:s,y:l})}e.sort((t,e)=>t.x===e.x?t.y-e.y:t.x-e.x);for(const{x:s,y:n}of e)this.#fe(s,n,t,void 0,i);return i}for(let s=n;s<=a;s++)for(let n=o;n<=r;n++)this.#fe(s,n,t,e,i);return i}queryCircle(t,e,i,s=[]){const n=this.#me(t.x,t.y,e);try{return this.query(n,i,s)}finally{this.#ce--}}queryRectangle(t,e,i,s=[]){const n=this.#ye(t.x,t.y,e.width,e.height);try{return this.query(n,i,s)}finally{this.#ue--}}#me(t,e,i){const s=this.#ce++;let n=this.#le[s];return n||(n=new se(t,e,i),this.#le[s]=n),n.reset(t,e,i)}#ye(t,e,i,s){const n=this.#ue++;let a=this.#he[n];return a||(a=new ne(t,e,i,s),this.#he[n]=a),a.reset(t,e,i,s)}#pe(t,e){return`${Math.floor(t/this.#re)}_${Math.floor(e/this.#re)}`}#ge(t){if(t instanceof se){const e=t.radius,{x:i,y:s}=t.position;return{minX:i-e,maxX:i+e,minY:s-e,maxY:s+e}}if(t instanceof ne){const{x:e,y:i}=t.position,{width:s,height:n}=t.size;return{minX:e,maxX:e+s,minY:i,maxY:i+n}}return null}#fe(t,e,i,s,n){const a=this.#oe.get(`${t}_${e}`);if(a)for(const t of a)s&&!s(t)||i.contains(t.getPosition())&&n.push(t)}}class ya{checkParticlePositionPlugins;#ve;#C;#we;#be;#Pe;#xe;#Me;#ze;#Ce;#k;#ke;#Se;#Oe;#De;#Ie;#Ee;constructor(t,e){this.#k=t,this.#C=e,this.#xe=0,this.#ve=[],this.#ke=[],this.#Pe=0,this.#be=new Map,this.#Me=new Map,this.#Ee=this.#Te(this.#C.zLayers),this.#we=new ma(100),this.checkParticlePositionPlugins=[],this.#ze=[],this.#Ce=[],this.#Oe=[],this.#Se=[],this.#Ie=[]}get count(){return this.#ve.length}get grid(){return this.#we}addParticle(e,i,s,a){if(!this.#Le(s,this.count))try{const n=this.#ke.pop()??new fa(this.#k,this.#C);n.init(this.#xe,e,i,s);let o=!0;return a&&(o=a(n)),o?(this.#ve.push(n),this.#Re(n),this.#xe++,this.#C.dispatchEvent(t.EventType.particleAdded,{particle:n}),n):void this.#ke.push(n)}catch(t){n().warning(`error adding particle: ${t}`)}}clear(){this.#ve=[],this.#Me.clear(),this.#_e(this.#C.zLayers)}destroy(){this.#ve=[],this.#ke.length=0,this.#Me.clear(),this.#Ee=[],this.checkParticlePositionPlugins=[],this.#ze=[],this.#Ce=[],this.#Oe=[],this.#Se=[],this.#Ie=[]}drawParticles(t){for(let e=this.#Ee.length-1;e>=0;e--){const i=this.#Ee[e];if(i)for(const e of i)e.draw(t)}}filter(t){return this.#ve.filter(t)}find(t){return this.#ve.find(t)}get(t){return this.#ve[t]}async init(){const t=this.#C;this.checkParticlePositionPlugins=[],this.#Ie=[],this.#Ce=[],this.#Oe=[],this.#ze=[],this.#Se=[],this.#Me.clear(),this.#_e(t.zLayers),this.#we=new ma(100*t.retina.pixelRatio),this.#Fe(t.actualOptions.particles);const e=t.actualOptions.particles.groups;for(const t in e){const i=e[t];i&&this.#Fe(je(this.#k,this.#C,i),t,i)}await this.#Ae()}push(t,e,i,s){for(let n=0;n<t;n++)this.addParticle(e,i,s)}async redraw(){this.clear(),await this.init(),this.#C.canvas.render.drawParticles({value:0,factor:0})}remove(t,e,i){this.removeAt(this.#ve.indexOf(t),void 0,e,i)}removeAt(t,e=1,i,s,n=!0){if(t<0||t>this.count)return;let a=0;for(let o=t;a<e&&o<this.count;o++)this.#Be(o,i,s,n)&&(o--,a++)}removeQuantity(t,e){this.removeAt(0,t,e)}setDensity(){const t=this.#C.actualOptions,e=t.particles.groups;let i=0;for(const t of this.#C.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in e){const s=e[t];if(!s)continue;const n=je(this.#k,this.#C,s);this.#Ve(n,i,t)}this.#Ve(t.particles,i)}setResizeFactor(t){this.#De=t}update(t){this.#we.clear();for(const e of this.#Ie)e.update?.(t);const e=this.#Ue(t);for(const e of this.#Oe)e.postUpdate?.(t);if(this.#Ne(t,e),e.size)for(const t of e)this.remove(t,t.group);this.#De=void 0}#He(...t){this.#ke.push(...t)}#Ve(e,i,s,n){const a=e.number;if(!a.density.enable)return void this.#Fe(e,s,n);const o=this.#$e(a.density),r=a.value,l=a.limit.value>0?a.limit.value:r,c=Math.round(Math.min(r,l)*o+i),d=this.#je(s);void 0===s?this.#Pe=a.limit.value*o:this.#be.set(s,{limit:a.limit.value*o,mode:A(t.LimitMode,a.limit.mode,t.LimitMode.delete)}),d<c?this.push(Math.abs(c-d),void 0,e,s):d>c&&this.removeQuantity(d-c,s)}#Fe(e,i,s){if(void 0===i){this.#Pe=e.number.limit.value;const t=this.#C.actualOptions.particles.groups;for(const e of this.#be.keys())e in t||this.#be.delete(e)}else{const n=s?.number?.limit?.value??e.number.limit.value;n>0?this.#be.set(i,{limit:n,mode:A(t.LimitMode,s?.number?.limit?.mode??e.number.limit.mode,t.LimitMode.delete)}):this.#be.delete(i)}}#Le(e,i){const s=this.#Pe,n=this.#C.actualOptions.particles.number.limit.mode;if(s>0&&n===t.LimitMode.wait&&i>=s)return!0;const a=void 0===e?void 0:this.#be.get(e);if(a&&a.limit>0&&a.mode===t.LimitMode.wait){if(this.#je(e)>=a.limit)return!0}if(a&&a.limit>0&&a.mode===t.LimitMode.delete){const t=this.#je(e)+1-a.limit;t>0&&this.removeQuantity(t,e)}if(s>0&&n===t.LimitMode.delete){const t=this.count+1-s;t>0&&this.#qe(t)}return!1}#je(t){let e=0;for(const i of this.#ve)i.group===t&&e++;return e}#Te(t){const e=Math.max(Math.floor(t),1);return Array.from({length:e},()=>[])}#Ge(t){const e=this.#Ee.length-1;return e<=0?0:Math.min(Math.max(Math.floor(t),0),e)}#$e(t){const e=this.#C;if(!t.enable)return 1;const i=e.canvas.size,s=e.retina.pixelRatio;if(!Number.isFinite(i.width)||!Number.isFinite(i.height)||i.width<=0||i.height<=0||!Number.isFinite(t.width)||!Number.isFinite(t.height)||t.width<=0||t.height<=0||!Number.isFinite(s)||s<=0)return 1;const n=i.width*i.height/(t.height*t.width*s**2);return Number.isFinite(n)&&n>=0?n:1}async#We(){const t=this.#C;await t.initDrawersAndUpdaters(),t.canvas.render.initUpdaters();for(const e of t.effectDrawers.values())await(e.init?.(t));for(const e of t.shapeDrawers.values())await(e.init?.(t))}async#Ae(){await this.#Ke(),await this.#We();let t=!1;const e=this.#C;for(const i of e.plugins)if(t=i.particlesInitialization?.()??t,t)break;if(t)return;const i=e.actualOptions.particles,s=i.groups;for(const t in s){const e=s[t];if(e)for(let s=this.count,n=0;n<e.number.value&&s<i.number.value;s++,n++)this.addParticle(void 0,e,t)}for(let t=this.count;t<i.number.value;t++)this.addParticle()}async#Ke(){const t=this.#C;for(const e of t.plugins)e.redrawInit&&await e.redrawInit(),e.checkParticlePosition&&this.checkParticlePositionPlugins.push(e),e.update&&this.#Ie.push(e),e.particleUpdate&&this.#Ce.push(e),e.postUpdate&&this.#Oe.push(e),e.particleReset&&this.#ze.push(e),e.postParticleUpdate&&this.#Se.push(e)}#Re(t){const e=this.#Ge(t.position.z),i=this.#Ee[e];i&&(i.push(t),this.#Me.set(t.id,e))}#qe(t){this.removeAt(0,t,void 0,void 0,!1)}#Be(e,i,s,n=!0){const a=this.#ve[e];return!!a&&((!n||a.group===i)&&(this.#ve.splice(e,1),this.#Qe(a),a.destroy(s),this.#C.dispatchEvent(t.EventType.particleRemoved,{particle:a}),this.#He(a),!0))}#Qe(t){const e=this.#Me.get(t.id)??this.#Ge(t.position.z),i=this.#Ee[e];if(!i)return void this.#Me.delete(t.id);const s=i.findIndex(e=>e.id===t.id);s>=0&&i.splice(s,1),this.#Me.delete(t.id)}#_e(t){const e=Math.max(Math.floor(t),1);if(this.#Ee.length===e)for(const t of this.#Ee)t.length=0;else this.#Ee=this.#Te(e)}#Xe(t){const e=this.#Ge(t.position.z),i=this.#Me.get(t.id);if(void 0===i)return void this.#Re(t);if(i===e)return;const s=this.#Ee[i];if(s){const e=s.findIndex(e=>e.id===t.id);e>=0&&s.splice(e,1)}const n=this.#Ee[e];if(n){if(n.push(t),n.length>=2){const e=n[n.length-2];e&&t.id<e.id&&n.sort((t,e)=>t.id-e.id)}this.#Me.set(t.id,e)}else this.#Me.set(t.id,e)}#Ue(t){const e=new Set,i=this.#De;for(const s of this.#ve){i&&!s.ignoresResizeRatio&&(s.position.x*=i.width,s.position.y*=i.height,s.initialPosition.x*=i.width,s.initialPosition.y*=i.height),s.ignoresResizeRatio=!1;for(const t of this.#ze)t.particleReset?.(s);for(const e of this.#Ce){if(s.destroyed)break;e.particleUpdate?.(s,t)}s.destroyed?e.add(s):this.#we.insert(s)}return e}#Ne(t,e){for(const i of this.#ve)if(i.destroyed)e.add(i);else{for(const e of this.#C.particleUpdaters)e.update(i,t);if(!i.spawning)for(const e of this.#Se)e.postParticleUpdate?.(i,t);this.#Xe(i)}}}class va{pixelRatio;reduceFactor;#C;constructor(t){this.#C=t,this.pixelRatio=1,this.reduceFactor=1}init(){const t=this.#C,e=t.actualOptions;this.pixelRatio=e.detectRetina?devicePixelRatio:1,this.reduceFactor=1;const i=this.pixelRatio,s=t.canvas,n=s.domElement;n&&(s.size.width=n.offsetWidth*i,s.size.height=n.offsetHeight*i)}initParticle(t){const e=t.options,i=this.pixelRatio,s=e.move,n=s.distance,a=t.retina;a.maxSpeed=Y(s.gravity.maxSpeed)*i,a.moveDrift=Y(s.drift)*i,a.moveSpeed=Y(s.speed)*i;const o=a.maxDistance;o.horizontal=void 0===n.horizontal?void 0:n.horizontal*i,o.vertical=void 0===n.vertical?void 0:n.vertical*i}}function wa(t){return!t.destroyed}function ba(t,e,...i){const s=new qe(t,e);return he(s,...i),s}const Pa=Object.freeze([]);var xa=Object.freeze({__proto__:null,Container:class{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;hdrMode;id;pageHidden;particles;particleUpdaters;peakNits;retina;shapeDrawers;started;zLayers;#Ye;#Ze;#Je;#ti={value:0,factor:0};#ei;#ii;#si;#ni;#ai;#oi;#ri;#li;#ci;#di;#hi=Pa;#ui=Pa;#pi=Pa;#gi;#k;#p=Pa;#fi;#mi;#yi;#vi=0;#wi;constructor(e){const{dispatchCallback:i,pluginManager:s,id:n,onDestroy:a,sourceOptions:o}=e;this.#k=s,this.#ei=i,this.#ci=a,this.id=Symbol(n),this.fpsLimit=120,this.hdr=!1,this.hdrMode=t.HdrMode.standard,this.peakNits=400,this.#fi=!1,this.#Ye=0,this.#si=0,this.#li=0,this.#ai=!0,this.started=!1,this.destroyed=!1,this.#gi=!0,this.#ri=0,this.zLayers=100,this.pageHidden=!1,this.#mi=o,this.#oi=o,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new va(this),this.canvas=new da(this.#k,this),this.particles=new ya(this.#k,this),this.#di=ba(this.#k,this),this.actualOptions=ba(this.#k,this),this.#ni=new ha(this),this.dispatchEvent(t.EventType.containerBuilt)}get animationStatus(){return!this.#gi&&!this.pageHidden&&wa(this)}get options(){return this.#di}get particleCreatedPlugins(){return this.#hi}get particleDestroyedPlugins(){return this.#ui}get particlePositionPlugins(){return this.#pi}get plugins(){return this.#p}get sourceOptions(){return this.#mi}addLifeTime(t){this.#li+=t}alive(){return!this.#si||this.#li<=this.#si}destroy(e=!0){if(wa(this)){this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,t]of this.effectDrawers)t.destroy?.(this);for(const[,t]of this.shapeDrawers)t.destroy?.(this);for(const t of this.plugins)t.destroy?.();this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.#p=Pa,this.destroyed=!0,this.#ci(e),this.dispatchEvent(t.EventType.containerDestroyed)}}dispatchEvent(t,e){this.#ei(t,{container:this,data:e})}draw(t){if(!wa(this))return;if(void 0!==this.#ii){if(!t)return;W(this.#ii),this.#ii=void 0}let e=t;this.#ii=G(t=>{this.#ii=void 0,e&&(this.#ri=void 0,e=!1),this.#bi(t)})}async export(t,e={}){for(const i of this.plugins){if(!i.export)continue;const s=await i.export(t,e);if(s.supported)return s.blob}n().error(`Export plugin with type ${t} not found`)}async init(){if(!wa(this))return;const e=this.#vi,i=new Map;for(const t of this.#k.plugins){const s=await t.getPlugin(this);if(e!==this.#vi||this.destroyed)return;if(s.preInit&&(await s.preInit(),e!==this.#vi))return;i.set(t,s)}if(await this.initDrawersAndUpdaters(),e!==this.#vi)return;this.#di=ba(this.#k,this,this.#oi,this.sourceOptions),this.actualOptions=ba(this.#k,this,this.#di),this.#Ae(i),this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:s,duration:n,fpsLimit:a,smooth:o,zLayers:r}=this.actualOptions,l=this.actualOptions.hdr;this.hdrMode=A(t.HdrMode,l.mode,t.HdrMode.standard),this.peakNits=l.peakNits,this.zLayers=r,this.#si=Y(n)*p,this.#Ye=Y(s)*p,this.#li=0,this.fpsLimit=a>0?a:120,this.#fi=o;for(const t of this.plugins)if(await(t.init?.()),e!==this.#vi)return;if(await this.particles.init(),e===this.#vi){this.dispatchEvent(t.EventType.containerInit),this.particles.setDensity();for(const t of this.plugins)t.particlesSetup?.();this.dispatchEvent(t.EventType.particlesSetup)}}async initDrawersAndUpdaters(){const t=this.#k;this.effectDrawers=await _t(this,t.initializers.effects),this.shapeDrawers=await _t(this,t.initializers.shapes),this.particleUpdaters=await Rt(this,t.initializers.updaters)}pause(){if(wa(this)&&(void 0!==this.#ii&&(W(this.#ii),this.#ii=void 0),!this.#gi)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this.#gi=!0),this.dispatchEvent(t.EventType.containerPaused)}}play(e){if(!wa(this))return;const i=this.#gi||e;if(!this.#ai||this.actualOptions.autoPlay){if(this.#gi&&(this.#gi=!1),i)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(t.EventType.containerPlay),this.draw(i??!1)}else this.#ai=!1}async refresh(){if(wa(this))return this.stop(),this.start()}async reset(t){if(wa(this))return this.#oi=t,this.#mi=t,this.#di=ba(this.#k,this,this.#oi,this.sourceOptions),this.actualOptions=ba(this.#k,this,this.#di),this.refresh()}async start(){if(!wa(this)||this.started)return;if(this.#wi)return this.#wi;const e=++this.#vi;let i;const s=new Promise(t=>{i=t});return this.#yi=i,this.#wi=(async()=>{try{if(await Promise.race([this.init(),s]),e!==this.#vi)return;if(this.started=!0,await Promise.race([new Promise(t=>{this.#Ze=t,this.#Je=setTimeout(()=>{this.#Je=void 0,this.#Ze=void 0,t()},this.#Ye)}),s]),e!==this.#vi||this.destroyed)return;this.#ni.addListeners();const i=async()=>{for(const t of this.plugins){if(e!==this.#vi)return;await(t.start?.())}};if(await Promise.race([i(),s]),e!==this.#vi)return;this.dispatchEvent(t.EventType.containerStarted),this.play()}catch(t){throw e!==this.#vi||this.destroyed||this.stop(),t}finally{e===this.#vi&&(this.#wi=void 0,this.#yi=void 0)}})(),this.#wi}stop(){if(wa(this)&&(this.#vi++,this.#yi?.(),this.#yi=void 0,this.#wi=void 0,this.started)){void 0!==this.#Je&&(clearTimeout(this.#Je),this.#Je=void 0,this.#Ze?.(),this.#Ze=void 0),this.#ai=!0,this.started=!1,this.#ni.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const t of this.plugins)t.stop?.();this.#hi=Pa,this.#ui=Pa,this.#pi=Pa,this.#mi=this.#di,this.dispatchEvent(t.EventType.containerStopped)}}updateActualOptions(){let t=!1;for(const e of this.plugins)e.updateActualOptions&&(t=e.updateActualOptions()||t);return this.canvas.render.updateBackgroundElement(),t}#Ae(t){const e=[],i=[],s=[],n=[];for(const[a,o]of t)a.needsPlugin(this.actualOptions)&&(e.push(o),o.particleCreated&&i.push(o),o.particleDestroyed&&s.push(o),o.particlePosition&&n.push(o));this.#p=Object.freeze(e),this.#hi=Object.freeze(i),this.#ui=Object.freeze(s),this.#pi=Object.freeze(n)}#bi(t){try{if(!this.#fi&&void 0!==this.#ri&&t<this.#ri+p/this.fpsLimit)return void this.draw(!1);if(this.#ri??=t,function(t,e,i=60,s=!1){t.value=e,t.factor=s?60/i:60*e/p}(this.#ti,t-this.#ri,this.fpsLimit,this.#fi),this.addLifeTime(this.#ti.value),this.#ri=t,this.#ti.value>p)return void this.draw(!1);if(this.canvas.render.drawParticles(this.#ti),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){n().error("error in animation loop",t)}}}});var Ma=Object.freeze({__proto__:null,BlendPluginInstance:class{layer=t.DrawLayer.CanvasSetup;#C;#Pi;constructor(t){this.#C=t}drawParticleCleanup(t,e){e.options.blend?.enable&&(t.globalCompositeOperation=e.originalBlendMode??l,e.originalBlendMode=void 0)}drawParticleSetup(t,e){e.options.blend?.enable&&(e.originalBlendMode=t.globalCompositeOperation,t.globalCompositeOperation=e.options.blend.mode)}drawSettingsCleanup(t){this.#Pi&&(t.globalCompositeOperation=this.#Pi)}drawSettingsSetup(t){const e=t.globalCompositeOperation,i=this.#C.actualOptions.blend;this.#Pi=e,t.globalCompositeOperation=i?.enable?i.mode:e}}});function za(t,e,i,s,n,a,o){!function(t,e){const i=t.options,s=i.move.path;if(!s.enable)return;const n=t.pathDelay??0;if(t.lastPathTime<=n)return void(t.lastPathTime+=e.value);const a=t.pathGenerator?.generate(t,e);a&&t.velocity.addTo(a);s.clamp&&(t.velocity.x=K(t.velocity.x,-1,1),t.velocity.y=K(t.velocity.y,-1,1));t.lastPathTime-=n}(t,o);const r=t.gravity,l=r?.enable&&r.inverse?-1:1,c=t.velocity.x,d=t.velocity.y,h=o.factor||1,u=t.moveDecay??1,p=u<0?u:u**h,g=n&&i?n/(60*i):0,f=r?.enable&&i?l*r.acceleration/(60*i):0,m=t=>u<=0||1===u?t*h:t*(1-p)/-Math.log(u);u>0&&t.velocity.multTo(p),t.velocity.x+=m(g),t.velocity.y+=m(f),u<=0&&t.velocity.multTo(p);const y=t.velocity.mult(i);let v=!1;r?.enable&&s>0&&(!r.inverse&&y.y>=0&&y.y>=s||r.inverse&&y.y<=0&&y.y<=-s)&&(y.y=l*s,v=!0,i&&(t.velocity.y=y.y/i));const w=u>0&&u<1;if(w){const e=-Math.log(u),s=(1-p)/e,n=(h-s)/e;y.x=(c*s+g*n)*i,y.y=v?t.velocity.y*i*h:(d*s+f*n)*i}const b=t.options.zIndex,P=(1-t.zIndexFactor)**b.velocityRate;y.multTo(P),y.multTo(a),w||y.multTo(h);const{position:x}=t;x.addTo(y),e.vibrate&&(x.x+=Math.sin(x.x*Math.cos(x.y))*a,x.y+=Math.cos(x.y*Math.sin(x.x))*a)}var Ca=Object.freeze({__proto__:null,MovePluginInstance:class{availablePathGenerators;pathGenerators;#C;#k;constructor(t,e){this.#k=t,this.#C=e,this.availablePathGenerators=new Map,this.pathGenerators=new Map}destroy(){this.availablePathGenerators=new Map,this.pathGenerators=new Map}isEnabled(t){return!t.destroyed&&t.options.move.enable}particleCreated(e){const i=e.options.move,s=i.gravity,n=i.path;if(e.moveDecay=1-Y(i.decay),e.pathDelay=Y(n.delay.value)*p,n.generator){let t=this.pathGenerators.get(n.generator);t||(t=this.availablePathGenerators.get(n.generator),t&&(this.pathGenerators.set(n.generator,t),t.init())),e.pathGenerator=t}e.gravity={enable:s.enable,acceleration:Y(s.acceleration),inverse:s.inverse},function(e,i){const s=i.options.move.spin;if(!s.enable)return;const n=s.position??{x:50,y:50},a={x:.01*n.x*e.canvas.size.width,y:.01*n.y*e.canvas.size.height},o=it(i.getPosition(),a),r=Y(s.acceleration);i.retina.spinAcceleration=r*e.retina.pixelRatio,i.spin={center:a,direction:i.velocity.x>=0?t.RotateDirection.clockwise:t.RotateDirection.counterClockwise,angle:j()*v,radius:o,acceleration:i.retina.spinAcceleration}}(this.#C,e)}particleDestroyed(t){const e=t.pathGenerator;e?.reset(t)}particleUpdate(e,i){const s=e.options.move;if(!s.enable)return;const n=this.#C,a=function(t){const e=t.getModifier("slow");return e?.enabled?e.speedFactor??1:1}(e),o=n.retina.reduceFactor,r=e.retina.moveSpeed,l=e.retina.moveDrift,c=e.size.max,d=r*(s.size?e.getRadius()/c:1)*a*u,h=e.retina.maxSpeed;s.spin.enable?function(e,i,s,n){if(!i.spin)return;const a=i.spin.direction===t.RotateDirection.clockwise,o={x:a?Math.cos:Math.sin,y:a?Math.sin:Math.cos};i.position.x=i.spin.center.x+i.spin.radius*o.x(i.spin.angle)*n,i.position.y=i.spin.center.y+i.spin.radius*o.y(i.spin.angle)*n,i.spin.radius+=i.spin.acceleration*n;const r=Math.max(e.canvas.size.width,e.canvas.size.height),l=r*u;i.spin.radius>l?(i.spin.radius=l,i.spin.acceleration*=-1):i.spin.radius<0&&(i.spin.radius=0,i.spin.acceleration*=-1),i.spin.angle+=.01*s*(1-i.spin.radius/r)}(n,e,d*(i.factor||1),o):za(e,s,d,h,l,o,i),function(t){const e=t.initialPosition,i=e.x-t.position.x,s=e.y-t.position.y,n=Math.abs(i),a=Math.abs(s),{maxDistance:o}=t.retina,r=o.horizontal,l=o.vertical;if(!r&&!l)return;if((r&&n>=r||l&&a>=l)&&!t.misplaced)t.misplaced=!!r&&n>r||!!l&&a>l,r&&(t.velocity.x=t.velocity.y*u-t.velocity.x),l&&(t.velocity.y=t.velocity.x*u-t.velocity.y);else if((!r||n<r)&&(!l||a<l)&&t.misplaced)t.misplaced=!1;else if(t.misplaced){const i=t.position,s=t.velocity;r&&(i.x<e.x&&s.x<0||i.x>e.x&&s.x>0)&&(s.x*=-j()),l&&(i.y<e.y&&s.y<0||i.y>e.y&&s.y>0)&&(s.y*=-j())}}(e)}preInit(){return this.#xi()}redrawInit(){return this.#xi()}update(){for(const t of this.pathGenerators.values())t.update()}async#xi(){const t=this.#k;if(t.initializers.pathGenerators){this.availablePathGenerators=await _t(this.#C,t.initializers.pathGenerators),this.pathGenerators=new Map;for(const t of this.pathGenerators.values())t.init()}}}});var ka=Object.freeze({__proto__:null,EmittersPluginInstance:class{#C;#B;constructor(t,e){this.#B=t,this.#C=e,this.#B.initContainer(e)}draw(t,e){for(const e of this.#B.getArray(this.#C))e.draw(t)}async init(){const t=this.#C.actualOptions.emitters;if(V(t))for(const e of t)await this.#B.addEmitter(this.#C,e);else await this.#B.addEmitter(this.#C,t)}pause(){for(const t of this.#B.getArray(this.#C))t.pause()}play(){for(const t of this.#B.getArray(this.#C))t.play()}resize(){for(const t of this.#B.getArray(this.#C))t.resize()}stop(){this.#B.clear(this.#C)}update(t){this.#B.getArray(this.#C).forEach(e=>{e.update(t)})}}});const Sa=new Map;var Oa=Object.freeze({__proto__:null,ShapeManager:class{addShapeGenerator(t,e){this.getShapeGenerator(t)||Sa.set(t,e)}getShapeGenerator(t){return Sa.get(t)}getSupportedShapeGenerators(){return Sa.keys()}}});var Da=Object.freeze({__proto__:null,EmittersInstancesManager:class{#Mi;#k;constructor(t){this.#Mi=new Map,this.#k=t}async addEmitter(t,e,i){return this.addEmitters(t,[{options:e,position:i}]).then(t=>t[0])}async addEmitters(t,e){const{EmitterInstance:i}=await Promise.resolve().then(function(){return Ra}),s=[];for(const{options:n,position:a}of e){const e=new Us;e.load(n);const o=new i(this.#k,t,e=>{this.removeEmitter(t,e)},e,a);await o.init(),this.getArray(t).push(o),s.push(o)}return s}clear(t){this.initContainer(t),this.#Mi.set(t,[])}getArray(t){this.initContainer(t);let e=this.#Mi.get(t);return e||(e=[],this.#Mi.set(t,e)),e}initContainer(t){this.#Mi.has(t)||(this.#Mi.set(t,[]),t.getEmitter=e=>{const i=this.getArray(t);return void 0===e||_(e)?i[e??0]:i.find(t=>t.name===e)},t.addEmitter=async(e,i)=>this.addEmitter(t,e,i),t.addEmitters=async e=>this.addEmitters(t,e),t.removeEmitter=e=>{const i=t.getEmitter?.(e);i&&this.removeEmitter(t,i)},t.playEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPlay()},t.pauseEmitter=e=>{const i=t.getEmitter?.(e);i&&i.externalPause()})}removeEmitter(t,e){const i=this.getArray(t).indexOf(e);i>=0&&this.getArray(t).splice(i,1)}}});var Ia=Object.freeze({__proto__:null,ImagePreloaderInstance:class{#C;#a;constructor(t,e){this.#a=t,this.#C=e}destroy(){this.#a.images?.delete(this.#C)}}});var Ea=Object.freeze({__proto__:null,MotionPluginInstance:class{#C;constructor(t){this.#C=t}async init(){const t=this.#C,e=t.actualOptions.motion;if(!e||!e.disable&&!e.reduce.value)return void(t.retina.reduceFactor=1);const i=vt("(prefers-reduced-motion: reduce)");if(!i)return void(t.retina.reduceFactor=1);this.#zi(i);i.addEventListener("change",()=>{(async()=>{this.#zi(i);try{await t.refresh()}catch{}})()}),await Promise.resolve()}#zi(t){const e=this.#C,i=e.actualOptions.motion;i&&(t.matches?i.disable?e.retina.reduceFactor=0:e.retina.reduceFactor=i.reduce.value?1/i.reduce.factor:1:e.retina.reduceFactor=1)}}});function Ta(t,e,i,s){(t.paint??=new _e).fill={color:ye.create(void 0,{value:e}),enable:s,opacity:i}}function La(t,e,i,s){(t.paint??=new _e).stroke={color:ye.create(void 0,{value:e}),opacity:i,width:s}}var Ra=Object.freeze({__proto__:null,EmitterInstance:class{fill;name;options;position;size;spawnFillColor;spawnFillEnabled;spawnFillOpacity;spawnStrokeColor;spawnStrokeOpacity;spawnStrokeWidth;#C;#Ci;#ki;#Si;#si;#Oi;#Di;#Ii;#Ei;#Ti;#Pt;#Li;#gi;#k;#Ri=!1;#_i;#Bt;#Fi;#Ai;#Bi;#Vi;constructor(e,i,s,n,a){this.#k=e,this.#C=i,this.#_i=s,this.#Ci=0,this.#ki=0,this.#Si=0,this.#Ei=a,n instanceof Us?this.options=n:(this.options=new Us,this.options.load(n)),this.#Bi=i.retina.reduceFactor?Y(this.options.life.delay??0)*p/i.retina.reduceFactor:1/0,this.position=this.#Ei??this.#te(),this.name=this.options.name,this.fill=this.options.fill,this.#Di=!this.options.life.wait,this.#Vi=!1;const o=Ct({},this.options.particles);o.move??={},o.move.direction??=this.options.direction,this.options.spawn.fill?.color&&(this.spawnFillColor=ai(this.#k,this.options.spawn.fill.color)),this.options.spawn.stroke?.color&&(this.spawnStrokeColor=ai(this.#k,this.options.spawn.stroke.color));const r=this.options.spawn.fill,l=this.options.spawn.stroke;if(this.spawnFillOpacity=void 0===r?.opacity?1:Y(r.opacity),this.spawnStrokeOpacity=void 0===l?.opacity?1:Y(l.opacity),this.spawnStrokeWidth=void 0===l?.width?1:Y(l.width),this.#gi=!this.options.autoPlay,this.#Li=o,this.#Ai=this.#Ui(),this.size=this.#Ai.mode===t.PixelMode.percent?{width:this.#Ai.width/h*this.#C.canvas.size.width,height:this.#Ai.height/h*this.#C.canvas.size.height}:{width:this.#Ai.width,height:this.#Ai.height},this.#Ti=this.options.life.count??-1,this.#Ii=this.#Ti<=0,this.options.domId){const t=yt().getElementById(this.options.domId);t&&(this.#Pt=new MutationObserver(()=>{this.resize()}),this.#Bt=new ResizeObserver(()=>{this.resize()}),this.#Pt.observe(t,{attributes:!0,attributeFilter:["style","width","height"]}),this.#Bt.observe(t))}const c=this.options.shape,d=this.#k.emitterShapeManager?.getShapeGenerator(c.type);d&&(this.#Fi=d.generate(this.#C,this.position,this.size,this.fill,c.options)),this.#C.dispatchEvent("emitterCreated",{emitter:this}),this.play()}draw(t){if(!this.options.draw||!this.#Fi)return;const e=this.#C,i=this.options.spawn.fill?.enable??!0;t.save(),t.beginPath(),i&&(t.fillStyle=this.spawnFillColor?gi(this.spawnFillColor,e.hdr,this.spawnFillOpacity??1,e.peakNits,e.hdrMode):pi({r:0,g:0,b:0},e.hdr,1,e.peakNits,e.hdrMode)),this.spawnStrokeColor&&(t.strokeStyle=gi(this.spawnStrokeColor,e.hdr,this.spawnStrokeOpacity??1,e.peakNits,e.hdrMode),t.lineWidth=this.spawnStrokeWidth??1),this.#Fi.draw?.(t),i&&t.fill(),this.spawnStrokeColor&&t.stroke(),t.restore()}externalPause(){this.#gi=!0,this.pause()}externalPlay(){this.#gi=!1,this.play()}async init(){await(this.#Fi?.init())}pause(){this.#gi||(this.#Oi=void 0)}play(){if(this.#gi)return;if(!(this.#Ti>0||this.#Ii)&&this.options.life.count||!(this.#Di||this.#Si>=(this.#Bi??0)))return;const t=this.#C;if(void 0===this.#Oi){const e=Y(this.options.rate.delay);this.#Oi=t.retina.reduceFactor?e*p/t.retina.reduceFactor:1/0}(this.#Ti>0||this.#Ii)&&this.#Ni()}resize(){const e=this.#C;if(!this.#Ri){const t=this.#Ei;this.position=t&&xt(t,e.canvas.size,T.origin)?t:this.#te()}this.#Ai=this.#Ui(),this.size=this.#Ai.mode===t.PixelMode.percent?{width:this.#Ai.width/h*e.canvas.size.width,height:this.#Ai.height/h*e.canvas.size.height}:{width:this.#Ai.width,height:this.#Ai.height},this.#Fi?.resize(this.position,this.size)}setPosition(t){this.#Ri=!0,this.position={...t},this.#Fi?.resize(this.position,this.size)}update(t){if(this.#gi)return;const e=this.#C;this.#Di&&(this.#Di=!1,this.#Si=this.#Bi??0,this.#ki=this.#Oi??0),this.#Vi||(this.#Vi=!0,this.#Hi(this.options.startCount)),void 0!==this.#si&&(this.#Ci+=t.value,this.#Ci>=this.#si&&(this.pause(),void 0!==this.#Bi&&(this.#Bi=void 0),this.#Ii||this.#Ti--,this.#Ti>0||this.#Ii?(this.#Ri||(this.position=this.#te(),this.#Fi?.resize(this.position,this.size)),this.#Bi=e.retina.reduceFactor?Y(this.options.life.delay??0)*p/e.retina.reduceFactor:1/0):this.#$i(),this.#Ci-=this.#si,this.#si=void 0)),void 0!==this.#Bi&&(this.#Si+=t.value,this.#Si>=this.#Bi&&(this.#C.dispatchEvent("emitterPlay"),this.play(),this.#Si-=this.#Bi,this.#Bi=void 0)),void 0!==this.#Oi&&(this.#ki+=t.value,this.#ki>=this.#Oi&&(this.#ji(),this.#ki-=this.#Oi))}#te(){const t=this.#C;if(this.options.domId){const e=yt().getElementById(this.options.domId);if(e){const i=e.getBoundingClientRect(),s=t.retina.pixelRatio;return{x:(i.x+i.width*u)*s,y:(i.y+i.height*u)*s}}}return ct({size:t.canvas.size,position:this.options.position})}#Ui(){const e=this.#C;if(this.options.domId){const i=yt().getElementById(this.options.domId);if(i){const s=i.getBoundingClientRect();return{width:s.width*e.retina.pixelRatio,height:s.height*e.retina.pixelRatio,mode:t.PixelMode.precise}}}return this.options.size??(()=>{const e=new Bs;return e.load({height:0,mode:t.PixelMode.percent,width:0}),e})()}#$i(){this.#Pt?.disconnect(),this.#Pt=void 0,this.#Bt?.disconnect(),this.#Bt=void 0,this.#_i(this),this.#C.dispatchEvent("emitterDestroyed",{emitter:this})}#ji(){if(this.#gi)return;const t=Y(this.options.rate.quantity);this.#Hi(t)}#Hi(t){const e=St(this.#Li)??{},i=this.options.spawn.fill?.color?.animation,s=this.options.spawn.fill?.enable??!!this.options.spawn.fill?.color,n=void 0===this.options.spawn.fill?.opacity?1:Y(this.options.spawn.fill.opacity),a=this.options.spawn.stroke?.color?.animation,o=void 0===this.options.spawn.stroke?.opacity?1:Y(this.options.spawn.stroke.opacity),r=void 0===this.options.spawn.stroke?.width?1:Y(this.options.spawn.stroke.width),l=this.#C.retina.reduceFactor,c=!!i,d=!!a,h=!!this.#Fi,u=c||d,p=u||h,g=u?{h:M,s:z,l:C}:null,f=this.options.shape;for(let c=0;c<t*l;c++){const t=p?Ct({},e):e;this.spawnFillOpacity=n,this.spawnFillEnabled=s,this.spawnStrokeOpacity=o,this.spawnStrokeWidth=r,this.spawnFillColor&&(i&&g&&(this.spawnFillColor.h=this.#qi(i.h,this.spawnFillColor.h,g.h,3.6),this.spawnFillColor.s=this.#qi(i.s,this.spawnFillColor.s,g.s),this.spawnFillColor.l=this.#qi(i.l,this.spawnFillColor.l,g.l)),Ta(t,this.spawnFillColor,this.spawnFillOpacity,this.spawnFillEnabled)),this.spawnStrokeColor&&(a&&g&&(this.spawnStrokeColor.h=this.#qi(a.h,this.spawnStrokeColor.h,g.h,3.6),this.spawnStrokeColor.s=this.#qi(a.s,this.spawnStrokeColor.s,g.s),this.spawnStrokeColor.l=this.#qi(a.l,this.spawnStrokeColor.l,g.l)),La(t,this.spawnStrokeColor,this.spawnStrokeOpacity,this.spawnStrokeWidth));let l=this.position;if(this.#Fi){const e=this.#Fi.randomPosition();if(e){l=e.position;const i=f.replace;i.color&&e.color&&Ta(t,e.color,i.opacity?e.opacity??1:1,!0)}else l=null}l&&this.#C.particles.addParticle(l,t)}}#Ni(){if(this.#gi)return;const t=void 0!==this.options.life.duration?Y(this.options.life.duration):void 0;(this.#Ti>0||this.#Ii)&&void 0!==t&&t>0&&(this.#si=t*p)}#qi(t,e,i,s=1){const n=this.#C;if(!t.enable)return e;const a=X(t.offset),o=Y(this.options.rate.delay),r=n.retina.reduceFactor?o*p/n.retina.reduceFactor:1/0;return(e+Y(t.speed)*n.fpsLimit/r+a*s)%i}}});t.AnimatableColor=ye,t.AnimationOptions=ue,t.AnimationValueWithRandom=Oe,t.Background=ve,t.BaseRange=ie,t.Circle=se,t.ColorAnimation=ge,t.ErrorCodes=ut,t.Fill=Me,t.FullScreen=we,t.HDROptions=be,t.HslAnimation=fe,t.Move=Le,t.MoveAngle=ze,t.MoveCenter=Ce,t.MoveGravity=ke,t.MovePath=Ie,t.OptionLoader=de,t.Options=qe,t.OptionsColor=me,t.OutModes=Ee,t.Paint=_e,t.ParticlesBounce=Ae,t.ParticlesBounceFactor=Fe,t.ParticlesDensity=Be,t.ParticlesNumber=Ue,t.ParticlesNumberLimit=Ve,t.ParticlesOptions=$e,t.RangedAnimationOptions=pe,t.RangedAnimationValueWithRandom=De,t.Rectangle=ne,t.ResizeEvent=Pe,t.Shape=Ne,t.Spin=Te,t.Stroke=Re,t.ValueWithRandom=Se,t.Vector=T,t.Vector3d=E,t.ZIndex=He,t.addErrorMessages=function(t){},t.alterHsl=Pi,t.animate=G,t.areBoundsInside=Mt,t.calcExactPositionOrRandomFromSize=dt,t.calcPositionFromSize=function(t){return void 0!==t.position?.x&&void 0!==t.position.y?{x:t.position.x*t.size.width/h,y:t.position.y*t.size.height/h}:void 0},t.calcPositionOrRandomFromSize=lt,t.calcPositionOrRandomFromSizeRanged=ct,t.calculateBounds=zt,t.cancelAnimation=W,t.canvasFirstIndex=0,t.canvasTag=P,t.checkDistance=st,t.circleBounce=function(t,e){const{x:i,y:s}=t.velocity.sub(e.velocity),[n,a]=[t.position,e.position],o=a.x-n.x,r=a.y-n.y;if(i*o+s*r<0)return;const l=-Math.atan2(r,o),c=t.mass,d=e.mass,h=t.velocity.rotate(l),u=e.velocity.rotate(l),p=rt(h,u,c,d),g=rt(u,h,c,d),f=p.rotate(-l),m=g.rotate(-l);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},t.circleBounceDataFromParticle=function(t){return{position:t.getPosition(),radius:t.getRadius(),mass:t.getMass(),velocity:t.velocity,factor:T.create(Y(t.options.bounce.horizontal.value),Y(t.options.bounce.vertical.value))}},t.clamp=K,t.cloneStyle=Dt,t.collisionVelocity=rt,t.colorMix=fi,t.colorToRgb=ni,t.confetti=na,t.countOffset=1,t.decayOffset=1,t.deepExtend=Ct,t.defaultAlpha=1,t.defaultAngle=0,t.defaultCompositeValue=l,t.defaultDensityFactor=1,t.defaultFps=60,t.defaultFpsLimit=120,t.defaultLoops=0,t.defaultOpacity=1,t.defaultRatio=1,t.defaultReduceFactor=1,t.defaultRemoveQuantity=1,t.defaultRetryCount=0,t.defaultRgbMin=0,t.defaultTime=0,t.defaultTransform=f,t.defaultTransformValue=1,t.defaultVelocity=0,t.defaultZoom=1,t.degToRad=nt,t.deleteCount=1,t.double=2,t.doublePI=v,t.empty=0,t.executeOnSingleOrMultiple=kt,t.fullPercent=r,t.generatedAttribute=o,t.generatedFalse=b,t.generatedTrue=w,t.getCanvasFromContainer=At,t.getDataFromUrl=Ft,t.getDistance=it,t.getDistanceSq=et,t.getDistances=function(t,e){const i=t.x-e.x,s=t.y-e.y;return{dx:i,dy:s,distance:Math.hypot(i,s)}},t.getDomContainer=Bt,t.getErrorMessage=pt,t.getFullScreenStyle=Tt,t.getHslAnimationFromHsl=yi,t.getHslFromAnimation=mi,t.getItemMapFromInitializer=_t,t.getItemsFromInitializer=Rt,t.getLinkColor=function(t,e,i,s){if(i===m)return ui();if(i!==y)return i;{const i=t.getFillColor()??t.getStrokeColor(),n=e?.getFillColor()??e?.getStrokeColor();if(i&&n&&e)return fi(i,n,t.getRadius(),e.getRadius(),s);{const t=i??n;if(t)return ci(t)}}},t.getLinkRandomColor=function(t,e,i,s){const n=R(e)?e:e.value;return n===m?s?si(t,{value:n}):i?m:y:n===y?y:si(t,{value:n})},t.getLogger=n,t.getParticleBaseVelocity=ot,t.getParticleDirectionAngle=at,t.getPosition=Ot,t.getRandom=j,t.getRandomFn=function(){return H},t.getRandomInRange=q,t.getRandomRgbColor=ui,t.getRangeMax=J,t.getRangeMin=Z,t.getRangeValue=Y,t.getStyleFromHsl=gi,t.getStyleFromRgb=pi,t.hMax=M,t.hMin=0,t.hPhase=60,t.half=u,t.hslToRgb=ci,t.hslToRgbFloat=di,t.hslaToRgba=hi,t.hypot=function(t,e){return Math.sqrt(t*t+e*e)},t.identity=1,t.inverseFactorNumerator=1,t.isArray=V,t.isBoolean=L,t.isEnumValue=F,t.isFunction=function(t){return"function"==typeof t},t.isInArray=bt,t.isNull=U,t.isNumber=_,t.isObject=B,t.isPointInside=xt,t.isString=R,t.itemFromArray=Pt,t.itemFromSingleOrMultiple=St,t.lFactor=1,t.lMax=C,t.lMin=0,t.lengthOffset=1,t.loadExtendProperty=function(t,e,i){if(void 0!==i){const s=e;if("__proto__"===s||"constructor"===s||"prototype"===s)return;const n=t,a=Object.hasOwn(n,s)?n[s]:{};n[s]=Ct(a,i)}},t.loadLazyProperty=le,t.loadMinIndex=0,t.loadNestedProperty=re,t.loadOptionProperty=ce,t.loadOptions=he,t.loadParticlesOptions=je,t.loadProperty=ae,t.loadRandomFactor=O,t.loadRangeProperty=oe,t.manageListener=Lt,t.maxNits=D,t.midColorValue=y,t.millisecondsToSeconds=p,t.minCount=0,t.minDistance=0,t.minFpsLimit=0,t.minIndex=0,t.minLimit=0,t.minRadius=0,t.minStrokeWidth=0,t.minVelocity=0,t.minZ=0,t.minimumSize=0,t.mix=Q,t.none=0,t.one=1,t.originPoint=g,t.parseAlpha=ht,t.percentDenominator=h,t.phaseNumerator=1,t.quarter=k,t.randomColorValue=m,t.randomInRangeValue=X,t.rangeColorToHsl=ai,t.rangeColorToRgb=si,t.removeDeleteCount=1,t.removeMinIndex=0,t.resizeEvent=c,t.rgbMax=x,t.rgbToHsl=oi,t.sMax=z,t.sMin=0,t.sNormalizedOffset=1,t.safeDocument=yt,t.safeMatchMedia=vt,t.safeMutationObserver=wt,t.setAnimationFunctions=function(t,e){$.nextFrame=t,$.cancel=e},t.setLogger=function(t){t.debug&&(s.debug=i(t.debug)),t.error&&(s.error=i(t.error)),t.info&&(s.info=i(t.info)),t.log&&(s.log=i(t.log)),t.trace&&(s.trace=i(t.trace)),t.verbose&&(s.verbose=i(t.verbose)),t.warning&&(s.warning=i(t.warning))},t.setRandom=function(t=Math.random){H=t},t.setRangeValue=tt,t.sextuple=6,t.spatialHashGridCellSize=100,t.squareExp=2,t.stringToAlpha=function(t,e){return ii(t,e)?.a},t.stringToRgb=ri,t.threeQuarter=S,t.toEnumValue=A,t.triple=3,t.tryCountIncrement=1,t.tsParticles=xi,t.updateColor=bi,t.updateColorValue=wi,t.visibilityChangeEvent=d,t.zIndexFactorOffset=1}(t.__tsParticlesInternals.bundles.confetti=t.__tsParticlesInternals.bundles.confetti||{})}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:self),Object.assign(globalThis.window||globalThis,{confetti:(globalThis.__tsParticlesInternals.bundles.confetti||{}).confetti});