@tsparticles/stencil 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +73 -0
  3. package/dist/cjs/Container-DFed5jPA.js +3556 -0
  4. package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
  5. package/dist/cjs/index-BY5-j3YK.js +1143 -0
  6. package/dist/cjs/index-Dwz1YgEM.js +1229 -0
  7. package/dist/cjs/index.cjs.js +9 -0
  8. package/dist/cjs/loader.cjs.js +13 -0
  9. package/dist/cjs/stencil-particles.cjs.entry.js +76 -0
  10. package/dist/cjs/tsparticlesstencil.cjs.js +25 -0
  11. package/dist/collection/collection-manifest.json +13 -0
  12. package/dist/collection/components/stencil-particles/stencil-particles.js +144 -0
  13. package/dist/collection/index.js +1 -0
  14. package/dist/collection/initParticlesEngine.js +38 -0
  15. package/dist/esm/Container-Di-pVL5B.js +3554 -0
  16. package/dist/esm/app-globals-DQuL1Twl.js +3 -0
  17. package/dist/esm/index-BzK79uqU.js +1223 -0
  18. package/dist/esm/index-CPcFDf6d.js +1052 -0
  19. package/dist/esm/index.js +1 -0
  20. package/dist/esm/loader.js +11 -0
  21. package/dist/esm/stencil-particles.entry.js +74 -0
  22. package/dist/esm/tsparticlesstencil.js +21 -0
  23. package/dist/index.cjs.js +1 -0
  24. package/dist/index.js +1 -0
  25. package/dist/tsparticlesstencil/index.esm.js +1 -0
  26. package/dist/tsparticlesstencil/p-2a10755a.entry.js +1 -0
  27. package/dist/tsparticlesstencil/p-BzK79uqU.js +2 -0
  28. package/dist/tsparticlesstencil/p-C6McIuSD.js +1 -0
  29. package/dist/tsparticlesstencil/p-DQuL1Twl.js +1 -0
  30. package/dist/tsparticlesstencil/p-x9G6hxBi.js +1 -0
  31. package/dist/tsparticlesstencil/tsparticlesstencil.esm.js +1 -0
  32. package/dist/types/components/stencil-particles/stencil-particles.d.ts +16 -0
  33. package/dist/types/components.d.ts +52 -0
  34. package/dist/types/index.d.ts +2 -0
  35. package/dist/types/initParticlesEngine.d.ts +5 -0
  36. package/dist/types/stencil-public-runtime.d.ts +1860 -0
  37. package/loader/cdn.js +1 -0
  38. package/loader/index.cjs.js +1 -0
  39. package/loader/index.d.ts +24 -0
  40. package/loader/index.es2017.js +1 -0
  41. package/loader/index.js +2 -0
  42. package/package.json +64 -0
@@ -0,0 +1 @@
1
+ export { i as initParticlesEngine, aH as isParticlesEngineInitialized, aI as waitForParticlesEngineInitialization } from './index-CPcFDf6d.js';
@@ -0,0 +1,11 @@
1
+ import { b as bootstrapLazy } from './index-BzK79uqU.js';
2
+ export { s as setNonce } from './index-BzK79uqU.js';
3
+ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
+
5
+ const defineCustomElements = async (win, options) => {
6
+ if (typeof window === 'undefined') return undefined;
7
+ await globalScripts();
8
+ return bootstrapLazy([["stencil-particles",[[0,"stencil-particles",{"options":[16],"url":[1],"init":[16]},null,{"options":[{"onPropsChange":0}],"url":[{"onPropsChange":0}],"init":[{"onPropsChange":0}]}]]]], options);
9
+ };
10
+
11
+ export { defineCustomElements };
@@ -0,0 +1,74 @@
1
+ import { r as registerInstance, h } from './index-BzK79uqU.js';
2
+ import { i as initParticlesEngine, t as tsParticles } from './index-CPcFDf6d.js';
3
+
4
+ const StencilParticles = class {
5
+ constructor(hostRef) {
6
+ registerInstance(this, hostRef);
7
+ this.renderId = 0;
8
+ }
9
+ async componentDidLoad() {
10
+ await this.loadParticles(++this.renderId);
11
+ }
12
+ disconnectedCallback() {
13
+ var _a;
14
+ this.renderId++; // Invalidate any pending load promises
15
+ (_a = this.container) === null || _a === void 0 ? void 0 : _a.destroy();
16
+ this.container = undefined;
17
+ }
18
+ async onPropsChange() {
19
+ await this.loadParticles(++this.renderId);
20
+ }
21
+ async loadParticles(currentRenderId) {
22
+ var _a;
23
+ (_a = this.container) === null || _a === void 0 ? void 0 : _a.destroy();
24
+ if (!this.containerElement) {
25
+ console.warn("[stencil-particles] container element not available yet");
26
+ return;
27
+ }
28
+ let container;
29
+ try {
30
+ // Use the shared initialization logic to ensure consistent plugin registration
31
+ // and avoid duplicate initialization when multiple instances mount concurrently.
32
+ // initParticlesEngine handles promise de-duplication and enforces a stable init callback.
33
+ if (this.init) {
34
+ await initParticlesEngine(this.init);
35
+ }
36
+ if (!this.options && !this.url) {
37
+ console.warn("[stencil-particles] neither options nor url provided");
38
+ return;
39
+ }
40
+ // Load particles directly onto the DOM element.
41
+ // tsParticles will auto-generate a unique internal ID, preventing collisions.
42
+ const loadParams = Object.assign({ element: this.containerElement }, (this.options ? { options: this.options } : { url: this.url }));
43
+ container = await tsParticles.load(loadParams);
44
+ }
45
+ catch (error) {
46
+ console.error("[stencil-particles] load failed", error);
47
+ return;
48
+ }
49
+ // Race condition guard: discard result if props changed during async load
50
+ if (currentRenderId !== this.renderId) {
51
+ container === null || container === void 0 ? void 0 : container.destroy();
52
+ return;
53
+ }
54
+ this.container = container;
55
+ }
56
+ render() {
57
+ return (h("div", { key: '870e2cc222aed94f8bbfa274dc3c047392ed8b1a', ref: el => {
58
+ this.containerElement = el;
59
+ }, style: { width: "100%", height: "100%" } }));
60
+ }
61
+ static get watchers() { return {
62
+ "options": [{
63
+ "onPropsChange": 0
64
+ }],
65
+ "url": [{
66
+ "onPropsChange": 0
67
+ }],
68
+ "init": [{
69
+ "onPropsChange": 0
70
+ }]
71
+ }; }
72
+ };
73
+
74
+ export { StencilParticles as stencil_particles };
@@ -0,0 +1,21 @@
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-BzK79uqU.js';
2
+ export { s as setNonce } from './index-BzK79uqU.js';
3
+ import { g as globalScripts } from './app-globals-DQuL1Twl.js';
4
+
5
+ /*
6
+ Stencil Client Patch Browser v4.43.4 | MIT Licensed | https://stenciljs.com
7
+ */
8
+
9
+ var patchBrowser = () => {
10
+ const importMeta = import.meta.url;
11
+ const opts = {};
12
+ if (importMeta !== "") {
13
+ opts.resourcesUrl = new URL(".", importMeta).href;
14
+ }
15
+ return promiseResolve(opts);
16
+ };
17
+
18
+ patchBrowser().then(async (options) => {
19
+ await globalScripts();
20
+ return bootstrapLazy([["stencil-particles",[[0,"stencil-particles",{"options":[16],"url":[1],"init":[16]},null,{"options":[{"onPropsChange":0}],"url":[{"onPropsChange":0}],"init":[{"onPropsChange":0}]}]]]], options);
21
+ });
@@ -0,0 +1 @@
1
+ module.exports = require('./cjs/index.cjs.js');
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from './esm/index.js';
@@ -0,0 +1 @@
1
+ export{i as initParticlesEngine,aH as isParticlesEngineInitialized,aI as waitForParticlesEngineInitialization}from"./p-C6McIuSD.js";
@@ -0,0 +1 @@
1
+ import{r as t,h as i}from"./p-BzK79uqU.js";import{i as s,t as e}from"./p-C6McIuSD.js";const n=class{constructor(i){t(this,i),this.renderId=0}async componentDidLoad(){await this.loadParticles(++this.renderId)}disconnectedCallback(){var t;this.renderId++,null===(t=this.container)||void 0===t||t.destroy(),this.container=void 0}async onPropsChange(){await this.loadParticles(++this.renderId)}async loadParticles(t){var i;if(null===(i=this.container)||void 0===i||i.destroy(),!this.containerElement)return void console.warn("[stencil-particles] container element not available yet");let n;try{if(this.init&&await s(this.init),!this.options&&!this.url)return void console.warn("[stencil-particles] neither options nor url provided");const t=Object.assign({element:this.containerElement},this.options?{options:this.options}:{url:this.url});n=await e.load(t)}catch(t){return void console.error("[stencil-particles] load failed",t)}t===this.renderId?this.container=n:null==n||n.destroy()}render(){return i("div",{key:"870e2cc222aed94f8bbfa274dc3c047392ed8b1a",ref:t=>{this.containerElement=t},style:{width:"100%",height:"100%"}})}static get watchers(){return{options:[{onPropsChange:0}],url:[{onPropsChange:0}],init:[{onPropsChange:0}]}}};export{n as stencil_particles}
@@ -0,0 +1,2 @@
1
+ function t(t,n,e){const o="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==o;){const o=Object.getOwnPropertyDescriptor(t,n);if(o&&(!e||o.get))return o;t=Object.getPrototypeOf(t)}}var n,e=(n,e)=>{var o;Object.entries(null!=(o=e.o.t)?o:{}).map((([o,[i]])=>{if(31&i||32&i){const i=n[o],l=t(Object.getPrototypeOf(n),o,!0)||Object.getOwnPropertyDescriptor(n,o);l&&Object.defineProperty(n,o,{get(){return l.get.call(this)},set(t){l.set.call(this,t)},configurable:!0,enumerable:!0}),e.i.has(o)?n[o]=e.i.get(o):void 0!==i&&(n[o]=i)}}))},o=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},i=(t,n)=>{n&&(t.__stencil__getHostRef=()=>n,n.l=t,512&n.o.u&&e(t,n))},l=(t,n)=>(0,console.error)(t,n),s=new Map,r="undefined"!=typeof window?window:{},c={u:0,h:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,n,e,o)=>t.addEventListener(n,e,o),rel:(t,n,e,o)=>t.removeEventListener(n,e,o),ce:(t,n)=>new CustomEvent(t,n)},u=t=>Promise.resolve(t),a=!1,f=[],d=[],h=(t,n)=>e=>{t.push(e),a||(a=!0,n&&4&c.u?v(p):c.raf(p))},m=t=>{for(let n=0;n<t.length;n++)try{t[n](performance.now())}catch(t){l(t)}t.length=0},p=()=>{m(f),m(d),(a=f.length>0)&&c.raf(p)},v=t=>u().then(t),b=h(d,!0),$=new WeakMap,y=t=>"object"==(t=typeof t)||"function"===t,j=(t,n,...e)=>{let o=null,i=null,l=!1,s=!1;const r=[],c=n=>{for(let e=0;e<n.length;e++)o=n[e],Array.isArray(o)?c(o):null!=o&&"boolean"!=typeof o&&((l="function"!=typeof t&&!y(o))&&(o+=""),l&&s?r[r.length-1].m+=o:r.push(l?w(null,o):o),s=l)};c(e),n&&n.key&&(i=n.key);const u=w(t,null);return u.p=n,r.length>0&&(u.v=r),u.$=i,u},w=(t,n)=>({u:0,j:t,m:null!=n?n:null,O:null,v:null,p:null,$:null}),g={},O=t=>{if(!t)return;const n=Object.keys(t);if(0===n.length)return;let e=!1;for(const o of n){if(e)break;for(const n of t[o])if("string"==typeof n){e=!0;break}}if(!e)return t;const o={};for(const e of n)o[e]=t[e].map((t=>"string"==typeof t?{[t]:0}:t));return o},k=(t,n)=>null==t||y(t)?t:1&n?t+"":t,M=(t,n,e,o)=>{if(e!==o)if(n.toLowerCase(),"style"===n){for(const n in e)o&&null!=o[n]||(n.includes("-")?t.style.removeProperty(n):t.style[n]="");for(const n in o)e&&o[n]===e[n]||(n.includes("-")?t.style.setProperty(n,o[n]):t.style[n]=o[n])}else"key"===n||"ref"===n&&o&&H(o,t)},E=(t,n)=>{const e=11===n.O.nodeType&&n.O.host?n.O.host:n.O,o=t&&t.p||{},i=n.p||{};for(const t of S(Object.keys(o)))t in i||M(e,t,o[t],void 0);for(const t of S(Object.keys(i)))M(e,t,o[t],i[t])};function S(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var C=[],L=[],P=(t,e,o)=>{const i=e.v[o];let l,s,c=0;if(!r.document)throw Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(l=i.O=r.document.createElement(i.j),E(null,i),i.v){const n="template"===i.j?l.content:l;for(c=0;c<i.v.length;++c)s=P(t,i,c),s&&n.appendChild(s)}return l["s-hn"]=n,l},R=(t,n,e,o,i,l)=>{let s,r=t;for("template"===e.j&&(r=r.content);i<=l;++i)o[i]&&(s=P(null,e,i),s&&(o[i].O=s,U(r,s,n)))},T=(t,n,e)=>{for(let o=n;o<=e;++o){const n=t[o];if(n){const t=n.O;N(n),t&&t.remove()}}},x=(t,n,e=!1)=>t.j===n.j&&(e?(e&&!t.$&&n.$&&(t.$=n.$),!0):t.$===n.$),D=(t,n,e=!1)=>{const o=n.O=t.O,i=t.v,l=n.v;E(t,n),null!==i&&null!==l?((t,n,e,o,i=!1)=>{let l,s,r=0,c=0,u=0,a=0,f=n.length-1,d=n[0],h=n[f],m=o.length-1,p=o[0],v=o[m];const b="template"===e.j?t.content:t;for(;r<=f&&c<=m;)if(null==d)d=n[++r];else if(null==h)h=n[--f];else if(null==p)p=o[++c];else if(null==v)v=o[--m];else if(x(d,p,i))D(d,p,i),d=n[++r],p=o[++c];else if(x(h,v,i))D(h,v,i),h=n[--f],v=o[--m];else if(x(d,v,i))D(d,v,i),U(b,d.O,h.O.nextSibling),d=n[++r],v=o[--m];else if(x(h,p,i))D(h,p,i),U(b,h.O,d.O),h=n[--f],p=o[++c];else{for(u=-1,a=r;a<=f;++a)if(n[a]&&null!==n[a].$&&n[a].$===p.$){u=a;break}u>=0?(s=n[u],s.j!==p.j?l=P(n&&n[c],e,u):(D(s,p,i),n[u]=void 0,l=s.O),p=o[++c]):(l=P(n&&n[c],e,c),p=o[++c]),l&&U(d.O.parentNode,l,d.O)}r>f?R(t,null==o[m+1]?null:o[m+1].O,e,o,c,m):c>m&&T(n,r,f)})(o,i,n,l,e):null!==l?R(o,null,n,l,0,l.length-1):!e&&null!==i&&T(i,0,i.length-1)},N=t=>{t.p&&t.p.ref&&C.push((()=>t.p.ref(null))),t.v&&t.v.map(N)},H=(t,n)=>{L.push((()=>t(n)))},U=(t,n,e)=>t.__insertBefore?t.__insertBefore(n,e):null==t?void 0:t.insertBefore(n,e),W=(t,n)=>{if(n&&!t.k&&n["s-p"]){const e=n["s-p"].push(new Promise((o=>t.k=()=>{n["s-p"].splice(e-1,1),o()})))}},A=(t,n)=>{if(t.u|=16,4&t.u)return void(t.u|=512);W(t,t.M);const e=()=>q(t,n);if(!n)return b(e);queueMicrotask((()=>{e()}))},q=(t,n)=>{const e=t.$hostElement$,o=t.l;if(!o)throw Error(`Can't render component <${e.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let i;return n?(t.S.length&&t.S.forEach((t=>t(e))),i=B(o,"componentWillLoad",void 0,e)):i=B(o,"componentWillUpdate",void 0,e),i=z(i,(()=>B(o,"componentWillRender",void 0,e))),z(i,(()=>V(t,o,n)))},z=(t,n)=>F(t)?t.then(n).catch((t=>{console.error(t),n()})):n(),F=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,V=async(t,n,e)=>{var o;const i=t.$hostElement$,l=i["s-rc"];G(t,n,i,e),l&&(l.map((t=>t())),i["s-rc"]=void 0);{const n=null!=(o=i["s-p"])?o:[],e=()=>Y(t);0===n.length?e():(Promise.all(n).then(e).catch(e),t.u|=4,n.length=0)}},G=(t,e,o,i)=>{try{e=e.render(),t.u&=-17,t.u|=2,((t,e,o=!1)=>{const i=t.$hostElement$,l=t.C||w(null,null),s=(t=>t&&t.j===g)(e)?e:j(null,null,e);if(n=i.tagName,o&&s.p)for(const t of Object.keys(s.p))i.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(s.p[t]=i[t]);s.j=null,s.u|=4,t.C=s,s.O=l.O=i,D(l,s,o),C.forEach((t=>t())),C.length=0,L.forEach((t=>t())),L.length=0})(t,e,i)}catch(n){l(n,t.$hostElement$)}return null},Y=t=>{const n=t.$hostElement$,e=t.l,o=t.M;B(e,"componentDidRender",void 0,n),64&t.u?B(e,"componentDidUpdate",void 0,n):(t.u|=64,I(n),B(e,"componentDidLoad",void 0,n),t.L(n),o||_()),t.k&&(t.k(),t.k=void 0),512&t.u&&v((()=>A(t,!1))),t.u&=-517},_=()=>{v((()=>(t=>{const n=c.ce("appload",{detail:{namespace:"tsparticlesstencil"}});return t.dispatchEvent(n),n})(r)))},B=(t,n,e,o)=>{if(t&&t[n])try{return t[n](e)}catch(t){l(t,o)}},I=t=>t.classList.add("hydrated"),J=(t,n,e,i)=>{const s=o(t);if(!s)return;if(!s)throw Error(`Couldn't find host element for "${i.P}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`);const r=s.$hostElement$,c=s.i.get(n),u=s.u,a=s.l;if(e=k(e,i.t[n][0]),!(8&u&&void 0!==c||e===c||Number.isNaN(c)&&Number.isNaN(e))){if(s.i.set(n,e),i.R){const t=i.R[n];t&&t.map((t=>{try{const[[o,i]]=Object.entries(t);(128&u||1&i)&&(a?a[o](e,c,n):s.S.push((()=>{s.l[o](e,c,n)})))}catch(t){l(t,r)}}))}if(2&u){if(a.componentShouldUpdate&&!1===a.componentShouldUpdate(e,c,n)&&!(16&u))return;16&u||A(s,!1)}}},K=(n,e,i)=>{var l,s;const r=n.prototype;{n.watchers&&!e.R&&(e.R=O(n.watchers)),n.deserializers&&!e.T&&(e.T=n.deserializers),n.serializers&&!e.D&&(e.D=n.serializers);const u=Object.entries(null!=(l=e.t)?l:{});if(u.map((([n,[l]])=>{if(31&l||2&i&&32&l){const{get:s,set:c}=t(r,n)||{};s&&(e.t[n][0]|=2048),c&&(e.t[n][0]|=4096),(1&i||!s)&&Object.defineProperty(r,n,{get(){{if(!(2048&e.t[n][0]))return((t,n)=>o(this).i.get(n))(0,n);const t=o(this),i=t?t.l:r;if(!i)return;return i[n]}},configurable:!0,enumerable:!0}),Object.defineProperty(r,n,{set(t){const s=o(this);if(s){if(c)return void 0===(32&l?this[n]:s.$hostElement$[n])&&s.i.get(n)&&(t=s.i.get(n)),c.call(this,k(t,l)),void J(this,n,t=32&l?this[n]:s.$hostElement$[n],e);{if(!(1&i&&4096&e.t[n][0]))return J(this,n,t,e),void(1&i&&!s.l&&s.S.push((()=>{4096&e.t[n][0]&&s.l[n]!==s.i.get(n)&&(s.l[n]=t)})));const o=()=>{const o=s.l[n];!s.i.get(n)&&o&&s.i.set(n,o),s.l[n]=k(t,l),J(this,n,s.l[n],e)};s.l?o():s.S.push((()=>{o()}))}}}})}})),1&i){const t=new Map;r.attributeChangedCallback=function(n,i,l){c.jmp((()=>{var s;const c=t.get(n),a=o(this);if(this.hasOwnProperty(c)&&(l=this[c],delete this[c]),r.hasOwnProperty(c)&&"number"==typeof this[c]&&this[c]==l)return;if(null==c){const t=null==a?void 0:a.u;if(a&&t&&!(8&t)&&l!==i){const o=a.l,r=null==(s=e.R)?void 0:s[n];null==r||r.forEach((e=>{const[[s,r]]=Object.entries(e);null!=o[s]&&(128&t||1&r)&&o[s].call(o,l,i,n)}))}return}const f=u.find((([t])=>t===c)),d=f&&4&f[1][0],h=d&&null===l&&void 0===this[c];d&&(l=null!==l&&"false"!==l);const m=Object.getOwnPropertyDescriptor(r,c);h||l==this[c]||m.get&&!m.set||(this[c]=l)}))},n.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=e.R)?s:{}),...u.filter((([t,n])=>31&n[0])).map((([n,e])=>{const o=e[1]||n;return t.set(o,n),o}))]))}}return n},Q=(t,n)=>{B(t,"connectedCallback",void 0,n)},X=(t,n)=>{B(t,"disconnectedCallback",void 0,n||t)},Z=(t,n={})=>{var e;if(!r.document)return void console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");const i=[],u=n.exclude||[],a=r.customElements,f=r.document.head,d=f.querySelector("meta[charset]"),h=r.document.createElement("style"),m=[];let p,v=!0;if(Object.assign(c,n),c.h=new URL(n.resourcesUrl||"./",r.document.baseURI).href,t.map((t=>{t[1].map((n=>{var e,r;const f={u:n[0],P:n[1],t:n[2],N:n[3]};f.t=n[2],f.R=O(n[4]),f.D=null!=(e=n[5])?e:{},f.T=null!=(r=n[6])?r:{};const d=f.P,h=class extends HTMLElement{"s-p";"s-rc";hasRegisteredEventListeners=!1;constructor(t){super(t),((t,n)=>{const e={u:0,$hostElement$:t,o:n,i:new Map,H:new Map};e.U=new Promise((t=>e.L=t)),t["s-p"]=[],t["s-rc"]=[],e.S=[];const o=e;t.__stencil__getHostRef=()=>o})(t=this,f)}connectedCallback(){o(this)&&(this.hasRegisteredEventListeners||(this.hasRegisteredEventListeners=!0),p&&(clearTimeout(p),p=null),v?m.push(this):c.jmp((()=>(t=>{if(!(1&c.u)){const n=o(t);if(!n)return;const e=n.o,i=()=>{};if(1&n.u)(null==n?void 0:n.l)?Q(n.l,t):(null==n?void 0:n.U)&&n.U.then((()=>Q(n.l,t)));else{n.u|=1;{let e=t;for(;e=e.parentNode||e.host;)if(e["s-p"]){W(n,n.M=e);break}}e.t&&Object.entries(e.t).map((([n,[e]])=>{if(31&e&&Object.prototype.hasOwnProperty.call(t,n)){const e=t[n];delete t[n],t[n]=e}})),(async(t,n,e)=>{let o;try{if(!(32&n.u))if(n.u|=32,e.W){const i=((t,n)=>{const e=t.P.replace(/-/g,"_"),o=t.W;if(!o)return;const i=s.get(o);return i?i[e]:import(`./${o}.entry.js`).then((t=>(s.set(o,t),t[e])),(t=>{l(t,n.$hostElement$)}))
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/})(e,n);if(i&&"then"in i){const t=()=>{};o=await i,t()}else o=i;if(!o)throw Error(`Constructor for "${e.P}#${n.A}" was not found`);o.isProxied||(e.R=O(o.watchers),e.D=o.serializers,e.T=o.deserializers,K(o,e,2),o.isProxied=!0);const r=()=>{};n.u|=8;try{new o(n)}catch(n){l(n,t)}n.u&=-9,n.u|=128,r(),Q(n.l,t)}else o=t.constructor,customElements.whenDefined(t.localName).then((()=>n.u|=128));const i=n.M,r=()=>A(n,!0);i&&i["s-rc"]?i["s-rc"].push(r):r()}catch(e){l(e,t),n.k&&(n.k(),n.k=void 0),n.L&&n.L(t)}})(t,n,e)}i()}})(this))))}disconnectedCallback(){c.jmp((()=>(async t=>{if(!(1&c.u)){const n=o(t);(null==n?void 0:n.l)?X(n.l,t):(null==n?void 0:n.U)&&n.U.then((()=>X(n.l,t)))}$.has(t)&&$.delete(t),t.shadowRoot&&$.has(t.shadowRoot)&&$.delete(t.shadowRoot)})(this))),c.raf((()=>{var t;const n=o(this);if(!n)return;const e=m.findIndex((t=>t===this));e>-1&&m.splice(e,1),(null==(t=null==n?void 0:n.C)?void 0:t.O)instanceof Node&&!n.C.O.isConnected&&delete n.C.O}))}componentOnReady(){var t;return null==(t=o(this))?void 0:t.U}};f.W=t[0],u.includes(d)||a.get(d)||(i.push(d),a.define(d,K(h,f,1)))}))})),i.length>0&&(h.textContent+=i.sort()+"{visibility:hidden}.hydrated{visibility:inherit}",h.innerHTML.length)){h.setAttribute("data-styles","");const t=null!=(e=c.q)?e:function(){var t,n,e;return null!=(e=null==(n=null==(t=r.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:n.getAttribute("content"))?e:void 0}();null!=t&&h.setAttribute("nonce",t),f.insertBefore(h,d?d.nextSibling:f.firstChild)}v=!1,m.length?m.map((t=>t.connectedCallback())):c.jmp((()=>p=setTimeout(_,30)))},tt=t=>c.q=t;export{Z as b,j as h,u as p,i as r,tt as s}
@@ -0,0 +1 @@
1
+ const t="generated",e="source-over",n="resize",s="visibilitychange",i=100,a=.5,r=1e3,o={x:0,y:0,z:0},c={a:1,b:0,c:0,d:1},u="random",h=2,f=2*Math.PI,l=60,d="true",p="false",g="canvas",w=0,m=2,y=100,v=1,M=1,b=1,x=255,E=360,P=100,S=100,A=0,L=0,k=60,q=0,z=1,D=0,O=1,C=1,T=120,$=0,F=1,j=1,H=0,_=0,B=1,I=0,N=0,R=1,G=1,J=0,U=1,W=0,V=1,K=0,Q=3,X=6,Y=1,Z=1,tt=0,et=1;var nt;function st(t){return"z"in t?t.z:o.z}!function(t){t.bottom="bottom",t.bottomLeft="bottom-left",t.bottomRight="bottom-right",t.left="left",t.none="none",t.right="right",t.top="top",t.topLeft="top-left",t.topRight="top-right",t.outside="outside",t.inside="inside"}(nt||(nt={}));class it{x;y;z;constructor(t=o.x,e=o.y,n=o.z){this.x=t,this.y=e,this.z=n}static get origin(){return it.create(o.x,o.y,o.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 it.create(t.x,t.y,st(t))}static create(t,e,n){return"number"==typeof t?new it(t,e??o.y,n??o.z):new it(t.x,t.y,st(t))}add(t){return it.create(this.x+t.x,this.y+t.y,this.z+st(t))}addTo(t){this.x+=t.x,this.y+=t.y,this.z+=st(t)}copy(){return it.clone(this)}div(t){return it.create(this.x/t,this.y/t,this.z/t)}divTo(t){this.x/=t,this.y/=t,this.z/=t}getLengthSq(){return this.x**2+this.y**2}mult(t){return it.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 it.create(this.x*Math.cos(t)-this.y*Math.sin(t),this.x*Math.sin(t)+this.y*Math.cos(t),o.z)}setTo(t){this.x=t.x,this.y=t.y,this.z=st(t)}sub(t){return it.create(this.x-t.x,this.y-t.y,this.z-st(t))}subFrom(t){this.x-=t.x,this.y-=t.y,this.z-=st(t)}#t(t,e){this.x=Math.cos(t)*e,this.y=Math.sin(t)*e}}class at extends it{constructor(t=o.x,e=o.y){super(t,e,o.z)}static get origin(){return at.create(o.x,o.y)}static clone(t){return at.create(t.x,t.y)}static create(t,e){return"number"==typeof t?new at(t,e??o.y):new at(t.x,t.y)}}function rt(t){return"boolean"==typeof t}function ot(t){return"string"==typeof t}function ct(t){return"number"==typeof t}function ut(t){return"object"==typeof t&&null!==t}function ht(t){return Array.isArray(t)}function ft(t){return null==t}const lt=Math.PI/180;let dt=Math.random;function pt(){return yt(dt(),0,1-Number.EPSILON)}function gt(t,e){return pt()*(e-t)+t}function wt(t){return requestAnimationFrame(t)}function mt(t){cancelAnimationFrame(t)}function yt(t,e,n){return Math.min(Math.max(t,e),n)}function vt(t){const e=xt(t);let n=bt(t);return e===n&&(n=0),gt(n,e)}function Mt(t){return ct(t)?t:vt(t)}function bt(t){return ct(t)?t:t.min}function xt(t){return ct(t)?t:t.max}function Et(t,e){if(t===e||void 0===e&&ct(t))return t;const n=bt(t),s=xt(t);return void 0!==e?{min:Math.min(n,e),max:Math.max(s,e)}:Et(n,s)}function Pt(t,e,n){return function(t,e){const n=t.x-e.x,s=t.y-e.y;return n*n+s*s}(t,e)<=n*n}function St(t){return t*lt}function At(t,e,n){if(ct(t))return St(t);switch(t){case nt.top:return.5*-Math.PI;case nt.topRight:return.25*-Math.PI;case nt.right:return 0;case nt.bottomRight:return.25*Math.PI;case nt.bottom:return.5*Math.PI;case nt.bottomLeft:return.75*Math.PI;case nt.left:return Math.PI;case nt.topLeft:return.75*-Math.PI;case nt.inside:return Math.atan2(n.y-e.y,n.x-e.x);case nt.outside:return Math.atan2(e.y-n.y,e.x-n.x);default:return pt()*f}}function Lt(t){const e=at.origin;return e.length=1,e.angle=t,e}function kt(t){const{position:e,size:n}=t;return{x:e?.x??pt()*n.width,y:e?.y??pt()*n.height}}var qt,zt,Dt,Ot,Ct,Tt;function $t(){return globalThis.document}function Ft(t){if("undefined"!=typeof matchMedia)return matchMedia(t)}function jt(t){if("undefined"!=typeof MutationObserver)return new MutationObserver(t)}function Ht(t,e){return t===e||ht(e)&&e.includes(t)}function _t(t,e,n=!0){return t[void 0!==e&&n?e%t.length:function(t){return Math.floor(pt()*t.length)}(t)]}function Bt(t,...e){for(const n of e){if(ft(n))continue;if(!ut(n)){t=n;continue}Array.isArray(n)?Array.isArray(t)||(t=[]):ut(t)&&!Array.isArray(t)||(t={});const e=Object.keys(n),s=new Set(["__proto__","constructor","prototype"]);if(e.some((t=>{const e=n[t];return ut(e)||Array.isArray(e)})))for(const i of e){if(s.has(i))continue;const e=t,a=n[i];e[i]=Array.isArray(a)?a.map((t=>Bt(void 0,t))):Bt(e[i],a)}else{const i=n,a=t;for(const t of e)if(!s.has(t)&&t in i){const e=i[t];void 0!==e&&(a[t]=e)}}}return t}function It(t,e){return ht(t)?t.map(((t,n)=>e(t,n))):e(t,0)}function Nt(t,e,n){return ht(t)?_t(t,e,n):t}function Rt(t,e){return function(t,e){if(t.mode!==Ct.percent){const{mode:e,...n}=t;return n}return"x"in t?{x:t.x/i*e.width,y:t.y/i*e.height}:{width:t.width/i*e.width,height:t.height/i*e.height}}(t,e)}function Gt(t){const e=$t().createElement("div").style;for(const n in t){const s=t[n];if(!(n in t)||ft(s))continue;const i=t.getPropertyValue?.(s);if(!i)continue;const a=t.getPropertyPriority?.(s);a?e.setProperty(s,i,a):e.setProperty(s,i)}return e}!function(t){t.auto="auto",t.increase="increase",t.decrease="decrease",t.random="random"}(qt||(qt={})),function(t){t.increasing="increasing",t.decreasing="decreasing"}(zt||(zt={})),function(t){t.none="none",t.max="max",t.min="min"}(Dt||(Dt={})),function(t){t.bottom="bottom",t.left="left",t.right="right",t.top="top"}(Ot||(Ot={})),function(t){t.precise="precise",t.percent="percent"}(Ct||(Ct={})),function(t){t.max="max",t.min="min",t.random="random"}(Tt||(Tt={}));const Jt=function(){const t=new Map,e=undefined,n=(t,e=new WeakSet)=>{if(null===t)return"null";const s=typeof t;if("undefined"===s)return"undefined";if("number"===s||"boolean"===s||"string"===s)return JSON.stringify(t);if("function"===s)try{return t.toString()}catch{return'"[Function]"'}if("symbol"===s)try{return t.toString()}catch{return'"[Symbol]"'}return Array.isArray(t)?`[${t.map((t=>n(t,e))).join(",")}]`:e.has(t)?'"[Circular]"':(e.add(t),`{${Object.keys(t).sort().map((s=>`${JSON.stringify(s)}:${n(t[s],e)}`)).join(",")}}`)};return(...s)=>{const i=(t=>e?e(t):(t=>n(t))(t))(s),a=Date.now(),r=t.get(i);if(void 0!==r)return t.delete(i),t.set(i,{value:r.value,ts:r.ts}),r.value;const o=function(t){const e=$t().createElement("div").style,n={width:"100%",height:"100%",margin:"0",padding:"0",borderWidth:"0",position:"fixed",zIndex:t.toString(10),"z-index":t.toString(10),top:"0",left:"0","pointer-events":"none"};for(const t in n){const s=n[t];void 0!==s&&e.setProperty(t,s)}return e}(...s);return t.set(i,{value:o,ts:a}),o}}();function Ut(t,e,n,s,i){if(s){let s={passive:!0};rt(i)?s.capture=i:void 0!==i&&(s=i),t.addEventListener(e,n,s)}else t.removeEventListener(e,n,i)}async function Wt(t,e,n,s=!1){let i=e.get(t);if(!i||s){const s=await Promise.all([...n.entries()].map((([e,n])=>n(t).then((t=>[e,t])))));i=new Map(s),e.set(t,i)}return i}class Vt{#e;constructor(){this.#e=new Map}addEventListener(t,e){this.removeEventListener(t,e);let n=this.#e.get(t);n||(n=[],this.#e.set(t,n)),n.push(e)}dispatchEvent(t,e){const n=this.#e.get(t);n?.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 n=this.#e.get(t);if(!n)return;const s=n.length,i=n.indexOf(e);i<0||(1===s?this.#e.delete(t):n.splice(i,1))}}var Kt;!function(t){t.configAdded="configAdded",t.containerInit="containerInit",t.particlesSetup="particlesSetup",t.containerStarted="containerStarted",t.containerStopped="containerStopped",t.containerDestroyed="containerDestroyed",t.containerPaused="containerPaused",t.containerPlay="containerPlay",t.containerBuilt="containerBuilt",t.particleAdded="particleAdded",t.particleDestroyed="particleDestroyed",t.particleRemoved="particleRemoved"}(Kt||(Kt={}));class Qt{colorManagers=new Map;easingFunctions=new Map;effectDrawers=new Map;initializers={effects:new Map,shapes:new Map,updaters:new Map};palettes=new Map;plugins=[];presets=new Map;shapeDrawers=new Map;updaters=new Map;#n=new Set;#s=new Map;#i;#a=new Set;#r=!1;#o=!1;#c=new Set;constructor(t){this.#i=t}get configs(){const t={};for(const[e,n]of this.#s)t[e]=n;return t}addColorManager(t,e){this.colorManagers.set(t,e)}addConfig(t){const e=t.key??t.name??"default";this.#s.set(e,t),this.#i.dispatchEvent(Kt.configAdded,{data:{name:e,config:t}})}addEasing(t,e){this.easingFunctions.get(t)||this.easingFunctions.set(t,e)}addEffect(t,e){this.initializers.effects.set(t,e)}addPalette(t,e){this.palettes.set(t,e)}addParticleUpdater(t,e){this.initializers.updaters.set(t,e)}addPlugin(t){this.getPlugin(t.id)||this.plugins.push(t)}addPreset(t,e,n=!1){!n&&this.getPreset(t)||this.presets.set(t,e)}addShape(t,e){for(const n of t)this.initializers.shapes.set(n,e)}clearPlugins(t){this.effectDrawers.delete(t),this.shapeDrawers.delete(t),this.updaters.delete(t)}getEasing(t){return this.easingFunctions.get(t)??(t=>t)}getEffectDrawers(t,e=!1){return Wt(t,this.effectDrawers,this.initializers.effects,e)}getPalette(t){return this.palettes.get(t)}getPlugin(t){return this.plugins.find((e=>e.id===t))}getPreset(t){return this.presets.get(t)}async getShapeDrawers(t,e=!1){return Wt(t,this.shapeDrawers,this.initializers.shapes,e)}async getUpdaters(t,e=!1){return async function(t,e,n,s=!1){let i=e.get(t);return i&&!s||(i=await Promise.all([...n.values()].map((e=>e(t)))),e.set(t,i)),i}(t,this.updaters,this.initializers.updaters,e)}async init(){if(!this.#r&&!this.#o){this.#o=!0,this.#a=new Set,this.#n=new Set(this.#c);try{for(const t of this.#n)await this.#u(t,this.#a,this.#n)}finally{this.#c.clear(),this.#o=!1,this.#r=!0}}}loadParticlesOptions(t,e,...n){const s=this.updaters.get(t);s&&s.forEach((t=>t.loadOptions?.(e,...n)))}async register(...t){if(this.#r)throw new Error("Register plugins can only be done before calling tsParticles.load()");for(const e of t)this.#o?await this.#u(e,this.#a,this.#n):this.#c.add(e)}async#u(t,e,n){e.has(t)||(e.add(t),n.add(t),await t(this.#i))}}const Xt=t=>(...e)=>{t(...e)},Yt={debug:Xt(console.debug),error:(t,...e)=>{console.error(`tsParticles - Error - ${t}`,...e)},info:Xt(console.info),log:Xt(console.log),trace:Xt(console.trace),verbose:Xt(console.log),warning:Xt(console.warn)};function Zt(){return Yt}const te="100%";var ee,ne,se,ie,ae,re,oe,ce;!function(t){t.circle="circle",t.rectangle="rectangle"}(ee||(ee={})),function(t){t.clockwise="clockwise",t.counterClockwise="counter-clockwise",t.random="random"}(ne||(ne={})),function(t){t.delete="delete",t.wait="wait"}(se||(se={})),function(t){t.bounce="bounce",t.none="none",t.out="out",t.destroy="destroy",t.split="split"}(ie||(ie={})),function(t){t.darken="darken",t.enlighten="enlighten"}(ae||(ae={})),function(t){t.linear="linear",t.radial="radial",t.random="random"}(re||(re={})),function(t){t.normal="normal",t.inside="inside",t.outside="outside"}(oe||(oe={})),function(t){t.easeInBack="ease-in-back",t.easeInBounce="ease-in-bounce",t.easeInCirc="ease-in-circ",t.easeInCubic="ease-in-cubic",t.easeInElastic="ease-in-elastic",t.easeInExpo="ease-in-expo",t.easeInGaussian="ease-in-gaussian",t.easeInLinear="ease-in-linear",t.easeInQuad="ease-in-quad",t.easeInQuart="ease-in-quart",t.easeInQuint="ease-in-quint",t.easeInSigmoid="ease-in-sigmoid",t.easeInSine="ease-in-sine",t.easeInSmoothstep="ease-in-smoothstep",t.easeOutBack="ease-out-back",t.easeOutBounce="ease-out-bounce",t.easeOutCirc="ease-out-circ",t.easeOutCubic="ease-out-cubic",t.easeOutElastic="ease-out-elastic",t.easeOutExpo="ease-out-expo",t.easeOutGaussian="ease-out-gaussian",t.easeOutLinear="ease-out-linear",t.easeOutQuad="ease-out-quad",t.easeOutQuart="ease-out-quart",t.easeOutQuint="ease-out-quint",t.easeOutSigmoid="ease-out-sigmoid",t.easeOutSine="ease-out-sine",t.easeOutSmoothstep="ease-out-smoothstep",t.easeInOutBack="ease-in-out-back",t.easeInOutBounce="ease-in-out-bounce",t.easeInOutCirc="ease-in-out-circ",t.easeInOutCubic="ease-in-out-cubic",t.easeInOutElastic="ease-in-out-elastic",t.easeInOutExpo="ease-in-out-expo",t.easeInOutGaussian="ease-in-out-gaussian",t.easeInOutLinear="ease-in-out-linear",t.easeInOutQuad="ease-in-out-quad",t.easeInOutQuart="ease-in-out-quart",t.easeInOutQuint="ease-in-out-quint",t.easeInOutSigmoid="ease-in-out-sigmoid",t.easeInOutSine="ease-in-out-sine",t.easeInOutSmoothstep="ease-in-out-smoothstep"}(ce||(ce={}));const ue=new class{pluginManager=new Qt(this);#h=[];#f=new Vt;#r=!1;get items(){return this.#h}get version(){return"4.0.5"}addEventListener(t,e){this.#f.addEventListener(t,e)}checkVersion(t){if(this.version!==t)throw new Error(`The tsParticles version is different from the loaded plugins version. Engine version: ${this.version}. Plugin version: ${t}`)}dispatchEvent(t,e){this.#f.dispatchEvent(t,e)}async init(){this.#r||(await this.pluginManager.init(),this.#r=!0)}item(t){const e=this.items,n=e[t];if(!n?.destroyed)return n;e.splice(t,1)}async load(e){let n;await this.init(),"undefined"!=typeof HTMLElement&&e.element instanceof HTMLElement&&(n=e.element);const{Container:s}=await import("./p-x9G6hxBi.js"),i=e.id??n?.id??`tsparticles${Math.floor(1e4*pt()).toString()}`,{index:a,url:r}=e,o=r?await async function(t){const e=Nt(t.url,t.index);if(!e)return t.fallback;const n=await fetch(e);return n.ok?await n.json():(Zt().error(`${n.status.toString()} while retrieving config file`),t.fallback)}({fallback:e.options,url:r,index:a}):e.options,c=Nt(o,a),{items:u}=this,h=u.findIndex((t=>t.id.description===i)),f=new s({dispatchCallback:(t,e)=>{this.dispatchEvent(t,e)},id:i,onDestroy:t=>{if(!t)return;const e=this.items,n=e.indexOf(f);n>=0&&e.splice(n,1)},pluginManager:this.pluginManager,sourceOptions:c});if(h>=0){const t=this.item(h),e=t?1:0;t&&!t.destroyed&&t.destroy(!1),u.splice(h,e,f)}else u.push(f);const l="undefined"!=typeof OffscreenCanvas&&e.element instanceof OffscreenCanvas?e.element:(e=>{const n=$t();let s;if(e instanceof HTMLCanvasElement||e.tagName.toLowerCase()===g)s=e,s.dataset[t]??=p,s.dataset[t]===d&&(s.style.width||=te,s.style.height||=te,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none"));else{const i=e.getElementsByTagName(g).item(0);i?(s=i,s.dataset[t]=p):(s=n.createElement(g),s.dataset[t]=d,e.appendChild(s)),s.style.width||=te,s.style.height||=te,s.style.pointerEvents="none",s.style.setProperty("pointer-events","none")}return s})(((e,n)=>{const s=$t();let i=n??s.getElementById(e);return i||(i=s.createElement("canvas"),i.id=e,i.dataset[t]=d,s.body.append(i),i)})(i,n));return f.canvas.loadCanvas(l),await f.start(),f}async refresh(t=!0){t&&await Promise.all(this.items.map((t=>t.refresh())))}removeEventListener(t,e){this.#f.removeEventListener(t,e)}};let he,fe,le=!1;async function de(t){if(!le)if(he){if(fe!==t)throw new Error("initParticlesEngine callback must be stable across the app lifecycle.");await he}else fe=t,he=(async()=>{t&&await t(ue),"function"==typeof ue.init&&await ue.init(),le=!0})().catch((t=>{throw he=void 0,fe=void 0,le=!1,t})),await he}function pe(){return le}async function ge(){await(null!=he?he:Promise.resolve())}export{r as $,ae as A,V as B,h as C,k as D,x as E,gt as F,U as G,tt as H,X as I,Q as J,Z as K,se as L,nt as M,Y as N,ie as O,Ct as P,D as Q,ee as R,e as S,z as T,O as U,jt as V,t as W,Gt as X,Ft as Y,Jt as Z,$t as _,ft as a,Ut as a0,s as a1,n as a2,it as a3,Kt as a4,J as a5,c as a6,oe as a7,Nt as a8,pt as a9,M as aA,b as aB,wt as aC,T as aD,$ as aE,mt as aF,l as aG,pe as aH,ge as aI,w as aa,j as ab,Lt as ac,vt as ad,Ot as ae,yt as af,H as ag,Rt as ah,At as ai,at as aj,Mt as ak,f as al,kt as am,Ht as an,St as ao,y as ap,_ as aq,I as ar,Zt as as,N as at,v as au,R as av,q as aw,G as ax,B as ay,F as az,Et as b,Pt as c,E as d,S as e,L as f,P as g,A as h,de as i,ot as j,ht as k,K as l,Bt as m,ct as n,ut as o,It as p,rt as q,o as r,m as s,ue as t,W as u,et as v,_t as w,C as x,u as y,a as z}
@@ -0,0 +1 @@
1
+ const o=()=>{};export{o as g}
@@ -0,0 +1 @@
1
+ import{R as t,c as s,s as i,a as h,b as o,h as e,d as n,l as r,e as a,f as c,g as l,j as d,k as u,m as f,P as p,O as v,M as w,n as g,o as y,L as m,p as M,q as b,r as P,u as x,v as C,w as z,x as k,y as S,z as R,A as D,B as $,C as O,D as T,E as I,F,G as B,H as L,I as E,J as U,K as A,N as q,Q as V,S as j,T as H,U as W,V as X,W as Y,X as N,Y as _,Z,_ as G,$ as K,a0 as Q,a1 as J,a2 as tt,a3 as st,a4 as it,a5 as ht,a6 as ot,a7 as et,a8 as nt,a9 as rt,aa as at,ab as ct,ac as lt,ad as dt,ae as ut,af as ft,ag as pt,ah as vt,ai as wt,aj as gt,ak as yt,al as mt,am as Mt,an as bt,ao as Pt,ap as xt,aq as Ct,ar as zt,as as kt,at as St,au as Rt,av as Dt,aw as $t,ax as Ot,ay as Tt,az as It,aA as Ft,aB as Bt,aC as Lt,aD as Et,aE as Ut,aF as At,aG as qt}from"./p-C6McIuSD.js";class Vt{position;type;constructor(t,s,i){this.position={x:t,y:s},this.type=i}_resetPosition(t,s){this.position.x=t,this.position.y=s}}class jt extends Vt{radius;constructor(s,i,h){super(s,i,t.circle),this.radius=h}contains(t){return s(t,this.position,this.radius)}intersects(s){const h=this.position,o=s.position,e=this.radius,n=Math.abs(o.x-h.x),r=Math.abs(o.y-h.y);if(s instanceof jt||s.type===t.circle)return e+s.radius>Math.hypot(n,r);if(s instanceof Ht||s.type===t.rectangle){const t=s,{width:h,height:o}=t.size;return Math.pow(n-h,i)+Math.pow(r-o,i)<=e**i||n<=e+h&&r<=e+o||n<=h||r<=o}return!1}reset(t,s,i){return this._resetPosition(t,s),this.radius=i,this}}class Ht extends Vt{size;constructor(s,i,h,o){super(s,i,t.rectangle),this.size={height:o,width:h}}contains(t){const s=this.position;return t.x>=s.x&&t.x<=s.x+this.size.width&&t.y>=s.y&&t.y<=s.y+this.size.height}intersects(t){if(t instanceof jt)return t.intersects(this);if(!(t instanceof Ht))return!1;const s=this.position,i=t.position,h=t.size;return i.x<s.x+this.size.width&&i.x+h.width>s.x&&i.y<s.y+this.size.height&&i.y+h.height>s.y}reset(t,s,i,h){return this._resetPosition(t,s),this.size.width=i,this.size.height=h,this}}class Wt{count;decay;delay;enable;speed;sync;constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(t){h(t)||(void 0!==t.count&&(this.count=o(t.count)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=o(t.speed)),void 0!==t.decay&&(this.decay=o(t.decay)),void 0!==t.delay&&(this.delay=o(t.delay)),void 0!==t.sync&&(this.sync=t.sync))}}class Xt extends Wt{max;min;offset;constructor(t,s){super(),this.min=t,this.max=s,this.offset=0,this.sync=!0}load(t){super.load(t),h(t)||(void 0!==t.max&&(this.max=t.max),void 0!==t.min&&(this.min=t.min),void 0!==t.offset&&(this.offset=o(t.offset)))}}class Yt{h=new Xt(e,n);l=new Xt(r,a);s=new Xt(c,l);load(t){h(t)||(this.h.load(t.h),this.s.load(t.s),this.l.load(t.l))}}class Nt{value;constructor(){this.value=""}static create(t,s){const i=new Nt;return i.load(t),void 0!==s&&(d(s)||u(s)?i.load({value:s}):i.load(s)),i}load(t){h(t)||h(t.value)||(this.value=t.value)}}class _t extends Nt{animation;constructor(){super(),this.animation=new Yt}static create(t,s){const i=new _t;return i.load(t),void 0!==s&&(d(s)||u(s)?i.load({value:s}):i.load(s)),i}load(t){if(super.load(t),h(t))return;const s=t.animation;void 0!==s&&(void 0===s.enable?this.animation.load(t.animation):this.animation.h.load(s))}}class Zt{color;image;opacity;position;repeat;size;constructor(){this.color=new Nt,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(t){h(t)||(void 0!==t.color&&(this.color=Nt.create(this.color,t.color)),void 0!==t.image&&(this.image=t.image),void 0!==t.position&&(this.position=t.position),void 0!==t.repeat&&(this.repeat=t.repeat),void 0!==t.size&&(this.size=t.size),void 0!==t.opacity&&(this.opacity=t.opacity))}}class Gt{enable;zIndex;constructor(){this.enable=!0,this.zIndex=0}load(t){h(t)||(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.zIndex&&(this.zIndex=t.zIndex))}}class Kt{delay;enable;constructor(){this.delay=.5,this.enable=!0}load(t){h(t)||(void 0!==t.delay&&(this.delay=t.delay),void 0!==t.enable&&(this.enable=t.enable))}}class Qt{close;options;type;constructor(){this.close=!0,this.options={},this.type=[]}load(t){if(h(t))return;const s=t.options;if(void 0!==s)for(const t in s){const i=s[t];i&&(this.options[t]=f(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class Jt{color;enable;opacity;constructor(){this.enable=!0,this.opacity=1}load(t){h(t)||(void 0!==t.color&&(this.color=_t.create(this.color,t.color)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.opacity&&(this.opacity=o(t.opacity)))}}class ts{offset;value;constructor(){this.offset=0,this.value=90}load(t){h(t)||(void 0!==t.offset&&(this.offset=o(t.offset)),void 0!==t.value&&(this.value=o(t.value)))}}class ss{mode;radius;x;y;constructor(){this.x=50,this.y=50,this.mode=p.percent,this.radius=0}load(t){h(t)||(void 0!==t.x&&(this.x=t.x),void 0!==t.y&&(this.y=t.y),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.radius&&(this.radius=t.radius))}}class is{acceleration;enable;inverse;maxSpeed;constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(t){h(t)||(void 0!==t.acceleration&&(this.acceleration=o(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),void 0!==t.inverse&&(this.inverse=t.inverse),void 0!==t.maxSpeed&&(this.maxSpeed=o(t.maxSpeed)))}}class hs{value;constructor(){this.value=0}load(t){h(t)||h(t.value)||(this.value=o(t.value))}}class os{clamp;delay;enable;generator;options;constructor(){this.clamp=!0,this.delay=new hs,this.enable=!1,this.options={}}load(t){h(t)||(void 0!==t.clamp&&(this.clamp=t.clamp),this.delay.load(t.delay),void 0!==t.enable&&(this.enable=t.enable),this.generator=t.generator,t.options&&(this.options=f(this.options,t.options)))}}class es{bottom;default;left;right;top;constructor(){this.default=v.out}load(t){h(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 ns{acceleration;enable;position;constructor(){this.acceleration=0,this.enable=!1}load(t){h(t)||(void 0!==t.acceleration&&(this.acceleration=o(t.acceleration)),void 0!==t.enable&&(this.enable=t.enable),t.position&&(this.position=f({},t.position)))}}class rs{angle;center;decay;direction;distance;drift;enable;gravity;outModes;path;random;size;speed;spin;straight;vibrate;warp;constructor(){this.angle=new ts,this.center=new ss,this.decay=0,this.distance={},this.direction=w.none,this.drift=0,this.enable=!1,this.gravity=new is,this.path=new os,this.outModes=new es,this.random=!1,this.size=!1,this.speed=2,this.spin=new ns,this.straight=!1,this.vibrate=!1,this.warp=!1}load(t){if(h(t))return;this.angle.load(g(t.angle)?{value:t.angle}:t.angle),this.center.load(t.center),void 0!==t.decay&&(this.decay=o(t.decay)),void 0!==t.direction&&(this.direction=t.direction),void 0!==t.distance&&(this.distance=g(t.distance)?{horizontal:t.distance,vertical:t.distance}:{...t.distance}),void 0!==t.drift&&(this.drift=o(t.drift)),void 0!==t.enable&&(this.enable=t.enable),this.gravity.load(t.gravity);const s=t.outModes;void 0!==s&&(y(s)?this.outModes.load(s):this.outModes.load({default:s})),this.path.load(t.path),void 0!==t.random&&(this.random=t.random),void 0!==t.size&&(this.size=t.size),void 0!==t.speed&&(this.speed=o(t.speed)),this.spin.load(t.spin),void 0!==t.straight&&(this.straight=t.straight),void 0!==t.vibrate&&(this.vibrate=t.vibrate),void 0!==t.warp&&(this.warp=t.warp)}}class as{color;opacity;width;constructor(){this.width=0}load(t){h(t)||(void 0!==t.color&&(this.color=_t.create(this.color,t.color)),void 0!==t.width&&(this.width=o(t.width)),void 0!==t.opacity&&(this.opacity=o(t.opacity)))}}class cs{color;fill;stroke;load(t){h(t)||(void 0!==t.color&&(this.color=_t.create(this.color,t.color)),void 0!==t.fill&&(this.fill??=new Jt,this.fill.load(t.fill)),void 0!==t.stroke&&(this.stroke??=new as,this.stroke.load(t.stroke)))}}class ls extends hs{constructor(){super(),this.value=1}}class ds{horizontal;vertical;constructor(){this.horizontal=new ls,this.vertical=new ls}load(t){h(t)||(this.horizontal.load(t.horizontal),this.vertical.load(t.vertical))}}class us{enable;height;width;constructor(){this.enable=!1,this.width=1920,this.height=1080}load(t){if(h(t))return;void 0!==t.enable&&(this.enable=t.enable);const s=t.width;void 0!==s&&(this.width=s);const i=t.height;void 0!==i&&(this.height=i)}}class fs{mode;value;constructor(){this.mode=m.delete,this.value=0}load(t){h(t)||(void 0!==t.mode&&(this.mode=t.mode),void 0!==t.value&&(this.value=t.value))}}class ps{density;limit;value;constructor(){this.density=new us,this.limit=new fs,this.value=0}load(t){h(t)||(this.density.load(t.density),this.limit.load(t.limit),void 0!==t.value&&(this.value=t.value))}}class vs{close;options;type;constructor(){this.close=!0,this.options={},this.type="circle"}load(t){if(h(t))return;const s=t.options;if(void 0!==s)for(const t in s){const i=s[t];i&&(this.options[t]=f(this.options[t]??{},i))}void 0!==t.close&&(this.close=t.close),void 0!==t.type&&(this.type=t.type)}}class ws extends hs{opacityRate;sizeRate;velocityRate;constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(t){super.load(t),h(t)||(void 0!==t.opacityRate&&(this.opacityRate=t.opacityRate),void 0!==t.sizeRate&&(this.sizeRate=t.sizeRate),void 0!==t.velocityRate&&(this.velocityRate=t.velocityRate))}}class gs{bounce;effect;groups;move;number;paint;palette;reduceDuplicates;shape;zIndex;#t;#s;constructor(t,s){this.#s=t,this.#t=s,this.bounce=new ds,this.effect=new Qt,this.groups={},this.move=new rs,this.number=new ps,this.paint=new cs,this.paint.color=new _t,this.paint.color.value="#fff",this.paint.fill=new Jt,this.paint.fill.enable=!0,this.reduceDuplicates=!1,this.shape=new vs,this.zIndex=new ws}load(t){if(h(t))return;if(t.palette&&(this.palette=t.palette,this.#i(this.palette)),void 0!==t.groups)for(const s of Object.keys(t.groups)){if(!(s in t.groups))continue;const i=t.groups[s];void 0!==i&&(this.groups[s]=f(this.groups[s]??{},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 s=t.paint;if(s&&(u(s)?this.paint=M(s,(t=>{const s=new cs;return s.load(t),s})):u(this.paint)?(this.paint=new cs,this.paint.load(s)):this.paint.load(s)),this.shape.load(t.shape),this.zIndex.load(t.zIndex),this.#t){for(const s of this.#s.plugins)s.loadParticlesOptions&&s.loadParticlesOptions(this.#t,this,t);const s=this.#s.updaters.get(this.#t);if(s)for(const i of s)i.loadOptions&&i.loadOptions(this,t)}}#i=t=>{const s=this.#s.getPalette(t);if(!s)return;const i=s.colors,h=(u(i)?i:[i]).flatMap((t=>{const s=t.fill,i=t.stroke,h=s?{color:{value:s.value},enable:s.enable,opacity:s.opacity}:void 0;return i?[{fill:h,stroke:{color:{value:i.value},opacity:i.opacity,width:i.width||0}}]:[{fill:h}]}));this.load({paint:h.length>1?h:h[0]??{},blend:{enable:!0,mode:s.blendMode}})}}function ys(t,...s){for(const i of s)t.load(i)}function ms(t,s,...i){const h=new gs(t,s);return ys(h,...i),h}class Ms{autoPlay;background;clear;defaultThemes;delay;detectRetina;duration;fpsLimit;fullScreen;hdr;key;name;palette;particles;pauseOnBlur;pauseOnOutsideViewport;preset;resize;smooth;style;zLayers;#t;#s;constructor(t,s){this.#s=t,this.#t=s,this.autoPlay=!0,this.background=new Zt,this.clear=!0,this.defaultThemes={},this.delay=0,this.fullScreen=new Gt,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.hdr=!0,this.particles=ms(this.#s,this.#t),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.resize=new Kt,this.smooth=!1,this.style={},this.zLayers=100}load(t){if(h(t))return;void 0!==t.preset&&(this.preset=t.preset,M(this.preset,(t=>{this.#h(t)}))),void 0!==t.palette&&(this.palette=t.palette,this.#i(this.palette)),void 0!==t.autoPlay&&(this.autoPlay=t.autoPlay),void 0!==t.clear&&(this.clear=t.clear),void 0!==t.key&&(this.key=t.key),void 0!==t.name&&(this.name=t.name),void 0!==t.delay&&(this.delay=o(t.delay));const s=t.detectRetina;void 0!==s&&(this.detectRetina=s),void 0!==t.duration&&(this.duration=o(t.duration));const i=t.fpsLimit;void 0!==i&&(this.fpsLimit=i),void 0!==t.hdr&&(this.hdr=t.hdr),void 0!==t.pauseOnBlur&&(this.pauseOnBlur=t.pauseOnBlur),void 0!==t.pauseOnOutsideViewport&&(this.pauseOnOutsideViewport=t.pauseOnOutsideViewport),void 0!==t.zLayers&&(this.zLayers=t.zLayers),this.background.load(t.background);const e=t.fullScreen;b(e)?this.fullScreen.enable=e:this.fullScreen.load(e),this.particles.load(t.particles),this.resize.load(t.resize),this.style=f(this.style,t.style),void 0!==t.smooth&&(this.smooth=t.smooth),this.#s.plugins.forEach((s=>{s.loadOptions(this.#t,this,t)}))}#i=t=>{const s=this.#s.getPalette(t);s&&this.load({background:{color:s.background},blend:{enable:!0,mode:s.blendMode},particles:{palette:t}})};#h=t=>{this.load(this.#s.getPreset(t))}}function bs(t,s){t.clearRect(P.x,P.y,s.width,s.height)}function Ps(t,s,i,h){s.drawParticle&&s.drawParticle(t,i,h)}const xs=new Map;function Cs(t,s){let i=xs.get(t);return i||(i=s(),xs.size>=1e3&&[...xs.keys()].slice(0,1e3*R).forEach((t=>xs.delete(t))),xs.set(t,i)),i}function zs(t,s,i,h=!0){if(!s)return;const o=d(s)?{value:s}:s;if(d(o.value))return ks(t,o.value,i,h);if(u(o.value)){const s=z(o.value,i,h);if(!s)return;return zs(t,{value:s})}for(const s of t.colorManagers.values()){const t=s.handleRangeColor(o);if(t)return t}}function ks(t,s,i,h=!0){if(!s)return;const o=d(s)?{value:s}:s;if(d(o.value))return o.value===S?function(){const t=L,s=I+B,i=()=>Math.floor(F(t,s));return{b:i(),g:i(),r:i()}}():function(t,s){return function(t,s){if(s)for(const i of t.colorManagers.values())if(i.accepts(s))return i.parseString(s)}(t,s)}(t,o.value);if(u(o.value)){const s=z(o.value,i,h);if(!s)return;return ks(t,{value:s})}for(const s of t.colorManagers.values()){const t=s.handleColor(o);if(t)return t}}function Ss(t,s,i,h=!0){const o=zs(t,s,i,h);return o?function(t){const s=t.r/I,i=t.g/I,h=t.b/I,o=Math.max(s,i,h),r=Math.min(s,i,h),d={h:e,l:(o+r)*R,s:c};return o!==r&&(d.s=d.l<R?(o-r)/(o+r):(o-r)/(O-o-r),d.h=s===o?(i-h)/(o-r):i===o?O+(h-s)/(o-r):O*O+(s-i)/(o-r)),d.l*=a,d.s*=l,d.h*=T,d.h<e&&(d.h+=n),d.h>=n&&(d.h-=n),d}(o):void 0}function Rs(t,s){return`color(display-p3 ${(t.r/I).toString()} ${(t.g/I).toString()} ${(t.b/I).toString()} / ${(s??k).toString()})`}function Ds(t,s,i){const h=i??k;return Cs(`hsl-${t.h.toFixed(2)}-${t.s.toFixed(2)}-${t.l.toFixed(2)}-${s?"hdr":"sdr"}-${h.toString()}`,(()=>s?function(t,s){return Rs(function(t){const s=(t.h%n+n)%n,i=Math.max(c,Math.min(l,t.s)),h=Math.max(r,Math.min(a,t.l)),o=s/n,e=i/l,d=h/a;if(i===c){const t=Math.round(d*I);return{r:t,g:t,b:t}}const u=(t,s,i)=>(i<0&&i++,i>1&&i--,i*E<1?t+(s-t)*E*i:i*O<1?s:i*U<1*O?t+(s-t)*(O/U-i)*E:t),f=d<R?d*(q+e):d+e-d*e,p=O*d-f,v=A/U,w=Math.min(I,I*u(p,f,o+v)),g=Math.min(I,I*u(p,f,o)),y=Math.min(I,I*u(p,f,o-v));return{r:Math.round(w),g:Math.round(g),b:Math.round(y)}}(t),s)}(t,i):function(t,s){return`hsla(${t.h.toString()}, ${t.s.toString()}%, ${t.l.toString()}%, ${(s??k).toString()})`}(t,i)))}function $s(t){return void 0===t?void 0:{h:t.h.value,s:t.s.value,l:t.l.value}}function Os(t,s,i){const h=s[i];void 0!==h&&(t[i]=(t[i]??H)*h)}class Ts{#o;#e;#n;#r;#a;#t;#c;#l;#d;#u;#f;#p;#v;#w;#s;#g;#y;#m={};#M=[void 0,void 0];#b={};constructor(t,s,i){this.#s=t,this.#t=s,this.#e=i,this.#c=null,this.#y=[],this.#g=[],this.#a=[],this.#o=[],this.#n=[],this.#r=[],this.#d=[],this.#u=[],this.#f=[],this.#p=[],this.#w=[],this.#v=[]}get settings(){return this.#l}canvasClear(){this.#t.actualOptions.clear&&this.draw((t=>{bs(t,this.#e.size)}))}clear(){let t=!1;for(const s of this.#o)if(t=s.canvasClear?.()??!1,t)break;t||this.canvasClear()}destroy(){this.stop(),this.#y=[],this.#g=[],this.#a=[],this.#o=[],this.#n=[],this.#r=[],this.#d=[],this.#u=[],this.#f=[],this.#p=[],this.#w=[],this.#v=[]}draw(t){const s=this.#c;if(s)return t(s)}drawParticle(t,s){if(t.spawning||t.destroyed)return;const i=t.getRadius();if(i<=V)return;const h=t.getFillColor(),o=t.getStrokeColor();let[e,n]=this.#P(t);if(e??=h,n??=o,!e&&!n)return;const r=this.#t,a=t.options.zIndex,c=W-t.zIndexFactor,{fillOpacity:l,opacity:d,strokeOpacity:u}=t.getOpacity(),f=this.#b,p=this.#m,v=e?Ds(e,r.hdr,l*d):void 0,w=n?Ds(n,r.hdr,u*d):v;f.a=f.b=f.c=f.d=void 0,p.fill=v,p.stroke=w,this.draw((h=>{for(const i of this.#f)i.drawParticleSetup?.(h,t,s);this.#x(h,t,i,d,p,f),function(t){const{container:s,context:i,particle:h,delta:o,colorStyles:e,radius:n,opacity:r,transform:a}=t,{effectDrawers:c,shapeDrawers:l}=s,d=h.getPosition(),u=h.getTransformData(a),f=C,p={x:d.x,y:d.y};i.setTransform(u.a,u.b,u.c,u.d,d.x,d.y),e.fill&&(i.fillStyle=e.fill);const v=!!h.fillEnabled,w=h.strokeWidth??x;i.lineWidth=w,e.stroke&&(i.strokeStyle=e.stroke);const g={context:i,particle:h,radius:n,drawRadius:n*f,opacity:r,delta:o,pixelRatio:s.retina.pixelRatio,fill:v,stroke:w>x,transformData:u,position:{...d},drawPosition:p,drawScale:f};for(const t of s.plugins)t.drawParticleTransform?.(g);const y=h.effect?c.get(h.effect):void 0,m=h.shape?l.get(h.shape):void 0;!function(t,s){if(!t?.drawBefore)return;const{particle:i}=s;i.effect&&t.drawBefore(s)}(y,g),function(t,s){if(!t?.beforeDraw)return;const{particle:i}=s;i.shape&&t.beforeDraw(s)}(m,g),function(t,s){if(!t)return;const{context:i,fill:h,particle:o,stroke:e}=s;o.shape&&(i.beginPath(),t.draw(s),o.shapeClose&&i.closePath(),h&&i.fill(),e&&i.stroke())}(m,g),function(t,s){if(!t?.afterDraw)return;const{particle:i}=s;i.shape&&t.afterDraw(s)}(m,g),function(t,s){if(!t?.drawAfter)return;const{particle:i}=s;i.effect&&t.drawAfter(s)}(y,g),i.resetTransform()}({container:r,context:h,particle:t,delta:s,colorStyles:p,radius:i*c**a.sizeRate,opacity:d,transform:f}),this.#C(t);for(const i of this.#u)i.drawParticleCleanup?.(h,t,s)}))}drawParticlePlugins(t,s){this.draw((i=>{for(const h of this.#d)Ps(i,h,t,s)}))}drawParticles(t){const{particles:s}=this.#t;this.clear(),s.update(t),this.draw((i=>{for(const s of this.#w)s.drawSettingsSetup?.(i,t);for(const s of this.#p)s.draw?.(i,t);s.drawParticles(t);for(const s of this.#r)s.clearDraw?.(i,t);for(const s of this.#v)s.drawSettingsCleanup?.(i,t)}))}init(){this.initUpdaters(),this.initPlugins(),this.paint()}initPlugins(){this.#a=[],this.#o=[],this.#n=[],this.#r=[],this.#d=[],this.#f=[],this.#u=[],this.#p=[],this.#w=[],this.#v=[];for(const t of this.#t.plugins)(t.particleFillColor??t.particleStrokeColor)&&this.#a.push(t),t.canvasClear&&this.#o.push(t),t.canvasPaint&&this.#n.push(t),t.drawParticle&&this.#d.push(t),t.drawParticleSetup&&this.#f.push(t),t.drawParticleCleanup&&this.#u.push(t),t.draw&&this.#p.push(t),t.drawSettingsSetup&&this.#w.push(t),t.drawSettingsCleanup&&this.#v.push(t),t.clearDraw&&this.#r.push(t)}initUpdaters(){this.#y=[],this.#g=[];for(const t of this.#t.particleUpdaters)t.afterDraw&&this.#g.push(t),(t.getColorStyles??t.getTransformValues??t.beforeDraw)&&this.#y.push(t)}paint(){let t=!1;for(const s of this.#n)if(t=s.canvasPaint?.()??!1,t)break;t||this.paintBase()}paintBase(t){this.draw((s=>{!function(t,s,i){t.fillStyle=i??"rgba(0,0,0,0)",t.fillRect(P.x,P.y,s.width,s.height)}(s,this.#e.size,t)}))}paintImage(t,s){this.draw((i=>{!function(t,s,i,h){if(!i)return;const o=t.globalAlpha;t.globalAlpha=h,t.drawImage(i,P.x,P.y,s.width,s.height),t.globalAlpha=o}(i,this.#e.size,t,s)}))}setContext(t){this.#c=t,this.#c&&(this.#c.globalCompositeOperation=j)}setContextSettings(t){this.#l=t}stop(){this.draw((t=>{bs(t,this.#e.size)}))}#C=t=>{for(const s of this.#g)s.afterDraw?.(t)};#x=(t,s,i,h,o,e)=>{for(const n of this.#y){if(n.getColorStyles){const{fill:e,stroke:r}=n.getColorStyles(s,t,i,h);e&&(o.fill=e),r&&(o.stroke=r)}if(n.getTransformValues){const t=n.getTransformValues(s);for(const s in t)Os(e,t,s)}n.beforeDraw?.(s)}};#P=t=>{let s,i;for(const h of this.#a)if(!s&&h.particleFillColor&&(s=Ss(this.#s,h.particleFillColor(t))),!i&&h.particleStrokeColor&&(i=Ss(this.#s,h.particleStrokeColor(t))),s&&i)break;return this.#M[0]=s,this.#M[1]=i,this.#M}}const Is=new WeakMap;function Fs(t,s,i=!1){if(!s)return;const h=t.style,o=new Set;for(let t=0;t<h.length;t++){const s=h.item(t);s&&o.add(s)}for(let t=0;t<s.length;t++){const i=s.item(t);i&&o.add(i)}for(const t of o){const o=s.getPropertyValue(t);o?h.setProperty(t,o,i?"important":""):h.removeProperty(t)}}class Bs{domElement;render;renderCanvas;size;zoom=C;#t;#z;#k;#S;#s;#R;#D;#$;#O;constructor(t,s){this.#s=t,this.#t=s,this.render=new Ts(t,s,this),this.#$={height:0,width:0};const i=s.retina.pixelRatio,h=this.#$;this.size={height:h.height*i,width:h.width*i},this.#z=!1,this.#D=[],this.#R="none"}get#T(){return this.#t.actualOptions.fullScreen.enable}destroy(){if(this.stop(),this.#z){const t=this.domElement;t?.remove(),this.domElement=void 0,this.renderCanvas=void 0}else this.#I();this.render.destroy(),this.#D=[]}getZoomCenter(){const t=this.#t.retina.pixelRatio,{width:s,height:i}=this.size;return this.#O?this.#O:{x:s*R/t,y:i*R/t}}init(){this.#F((t=>{t.disconnect()})),this.#k=X((t=>{for(const s of t)"attributes"===s.type&&"style"===s.attributeName&&this.#B()})),this.resize(),this.#L(),this.initBackground(),this.#F((t=>{const s=this.domElement;s&&s instanceof Node&&t.observe(s,{attributes:!0})})),this.initPlugins(),this.render.init()}initBackground(){const t=this.#t,s=t.actualOptions.background,i=this.domElement;if(!i)return;const h=i.style,o=zs(this.#s,s.color);h.backgroundColor=o?function(t,s,i){const h=i??k;return Cs(`rgb-${t.r.toFixed(2)}-${t.g.toFixed(2)}-${t.b.toFixed(2)}-${s?"hdr":"sdr"}-${h.toString()}`,(()=>s?Rs(t,i):function(t,s){return`rgba(${t.r.toString()}, ${t.g.toString()}, ${t.b.toString()}, ${(s??k).toString()})`}(t,i)))}(o,t.hdr,s.opacity):"",h.backgroundImage=s.image||"",h.backgroundPosition=s.position||"",h.backgroundRepeat=s.repeat||"",h.backgroundSize=s.size||""}initPlugins(){this.#D=[];for(const t of this.#t.plugins)t.resize&&this.#D.push(t)}loadCanvas(t){this.#z&&this.domElement&&this.domElement.remove();const s=this.#t,i=(t=>"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement)(t)?t:void 0;this.domElement=i,this.#z=!!i&&"true"===i.dataset[Y],this.renderCanvas=i?(t=>{const s=Is.get(t);if(s)return s;if("function"!=typeof t.transferControlToOffscreen)throw new TypeError("OffscreenCanvas is required but not supported by this browser");try{const s=t.transferControlToOffscreen();return Is.set(t,s),s}catch{throw new TypeError("OffscreenCanvas transfer failed")}})(i):t;const h=this.domElement;h&&(h.ariaHidden="true",this.#S=N(h.style));const o=this.#$,e=this.renderCanvas;h?(o.height=h.offsetHeight,o.width=h.offsetWidth):(o.height=e.height,o.width=e.width);const n=this.#t.retina.pixelRatio,r=this.size;e.height=r.height=o.height*n,e.width=r.width=o.width*n;const a=_("(color-gamut: p3)");this.render.setContextSettings({alpha:!0,colorSpace:a?.matches&&s.hdr?"display-p3":"srgb",desynchronized:!0,willReadFrequently:!1}),this.render.setContext(e.getContext("2d",this.render.settings)),this.#F((t=>{t.disconnect()})),s.retina.init(),this.initBackground(),this.#F((t=>{const s=this.domElement;s&&s instanceof Node&&t.observe(s,{attributes:!0})}))}resize(){const t=this.domElement;if(!t)return!1;const s=this.#t,i=this.renderCanvas;if(void 0===i)return!1;const h=s.canvas.#$,o={width:t.offsetWidth,height:t.offsetHeight},e=s.retina.pixelRatio,n={width:o.width*e,height:o.height*e};if(o.height===h.height&&o.width===h.width&&n.height===i.height&&n.width===i.width)return!1;const r={...h};h.height=o.height,h.width=o.width;const a=this.size;return i.width=a.width=n.width,i.height=a.height=n.height,this.#t.started&&s.particles.setResizeFactor({width:h.width/r.width,height:h.height/r.height}),!0}setPointerEvents(t){this.domElement&&(this.#R=t,this.#B())}setZoom(t,s){this.zoom=t,this.#O=s}stop(){this.#F((t=>{t.disconnect()})),this.#k=void 0,this.render.stop()}async windowResize(){if(!this.domElement||!this.resize())return;const t=this.#t,s=t.updateActualOptions();t.particles.setDensity(),this.#E(),s&&await t.refresh()}#E=()=>{for(const t of this.#D)t.resize?.()};#L=()=>{const t=this.domElement,s=this.#t.actualOptions;if(t){this.#T?this.#U():this.#I();for(const i in s.style){if(!i||!(i in s.style))continue;const h=s.style[i];h&&t.style.setProperty(i,h,"important")}}};#B=()=>{const t=this.domElement;if(!t)return;this.#F((t=>{t.disconnect()})),this.#L(),this.initBackground();const s=this.#R;t.style.pointerEvents=s,t.style.setProperty("pointer-events",s),this.#F((s=>{t instanceof Node&&s.observe(t,{attributes:!0})}))};#I=()=>{const t=this.domElement,s=this.#S;t&&s&&Fs(t,s,!0)};#F=t=>{this.#k&&t(this.#k)};#U=()=>{const t=this.domElement;t&&Fs(t,Z(this.#t.actualOptions.fullScreen.zIndex),!0)}}class Ls{#t;#A;#q;#V;constructor(t){this.#t=t,this.#A={visibilityChange:()=>{this.#j()},resize:()=>{this.#H()}}}addListeners(){this.#W(!0)}removeListeners(){this.#W(!1)}#j=()=>{const t=this.#t;t.actualOptions.pauseOnBlur&&(G().hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.animationStatus?t.play(!0):t.draw(!0)))};#H=()=>{this.#V&&(clearTimeout(this.#V),this.#V=void 0);const t=async()=>{const t=this.#t.canvas;await t.windowResize()};this.#V=setTimeout((()=>{t()}),this.#t.actualOptions.resize.delay*K)};#W=t=>{const s=this.#A;this.#X(t),Q(document,J,s.visibilityChange,t,!1)};#X=t=>{const s=this.#A,i=this.#t;if(!i.actualOptions.resize.enable)return;if("undefined"==typeof ResizeObserver)return void Q(globalThis,tt,s.resize,t);const h=i.canvas.domElement;this.#q&&!t?(h&&this.#q.unobserve(h),this.#q.disconnect(),this.#q=void 0):!this.#q&&t&&h&&(this.#q=new ResizeObserver((t=>{t.find((t=>t.target===h))&&this.#H()})),this.#q.observe(h))}}function Es(t){if(!bt(t.outMode,t.checkModes))return;const s=t.radius*O;t.coord>t.maxCoord-s?t.setCb(-t.radius):t.coord<s&&t.setCb(t.radius)}class Us{backColor;bubble;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;slow;spawning;strokeColor;strokeOpacity;strokeWidth;unbreakable;velocity;zIndexFactor;#Y={fillOpacity:k,opacity:k,strokeOpacity:k};#N=st.origin;#_={sin:0,cos:0};#Z={a:1,b:0,c:0,d:1};#t;#s;constructor(t,s){this.#s=t,this.#t=s}destroy(t){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const s=this.#t,i=this.shape?s.shapeDrawers.get(this.shape):void 0;i?.particleDestroy?.(this);for(const i of s.particleDestroyedPlugins)i.particleDestroyed?.(this,t);for(const i of s.particleUpdaters)i.particleDestroyed?.(this,t);this.#t.dispatchEvent(it.particleDestroyed,{particle:this})}draw(t){const s=this.#t.canvas.render;s.drawParticlePlugins(this,t),s.drawParticle(this,t)}getAngle(){return this.rotation+(this.pathRotation?this.velocity.angle:ht)}getFillColor(){return this.#G(this.bubble.color??$s(this.fillColor))}getMass(){return this.getRadius()**i*Math.PI*R}getOpacity(){const t=(W-this.zIndexFactor)**this.options.zIndex.opacityRate,s=this.bubble.opacity??yt(this.opacity?.value??k),i=this.strokeOpacity??k;return this.#Y.fillOpacity=s*(this.fillOpacity??k)*t,this.#Y.opacity=s*t,this.#Y.strokeOpacity=s*i*t,this.#Y}getPosition(){return this.#N.x=this.position.x+this.offset.x,this.#N.y=this.position.y+this.offset.y,this.#N.z=this.position.z,this.#N}getRadius(){return this.bubble.radius??this.size.value}getRotateData(){const t=this.getAngle();return this.#_.sin=Math.sin(t),this.#_.cos=Math.cos(t),this.#_}getStrokeColor(){return this.#G(this.bubble.color??$s(this.strokeColor))}getTransformData(t){const s=this.getRotateData(),i=this.isRotating;return this.#Z.a=s.cos*(t.a??ot.a),this.#Z.b=i?s.sin*(t.b??B):t.b??ot.b,this.#Z.c=i?-s.sin*(t.c??B):t.c??ot.c,this.#Z.d=s.cos*(t.d??ot.d),this.#Z}init(t,s,i,h){const o=this.#t;this.id=t,this.group=h,this.justWarped=!1,this.effectClose=!0,this.shapeClose=!0,this.pathRotation=!1,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.isRotating=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{},maxSpeed:0,moveDrift:0,moveSpeed:0,sizeAnimationSpeed:0},this.size={value:1,max:1,min:1,enable:!1},this.outType=et.normal,this.ignoresResizeRatio=!0;const e=ms(this.#s,o,o.actualOptions.particles),n=e.reduceDuplicates,r=e.shape.type;this.effect=nt(e.effect.type,this.id,n),this.shape=nt(r,this.id,n);const a=e.effect,c=e.shape;if(i){if(i.effect?.type&&i.effect.type!==this.effect){const t=nt(i.effect.type,this.id,n);t&&(this.effect=t,a.load(i.effect))}if(i.shape?.type&&i.shape.type!==this.shape){const t=nt(i.shape.type,this.id,n);t&&(this.shape=t,c.load(i.shape))}}if(this.effect===S){const t=[...this.#t.effectDrawers.keys()];this.effect=t[Math.floor(rt()*t.length)]}if(this.shape===S){const t=[...this.#t.shapeDrawers.keys()];this.shape=t[Math.floor(rt()*t.length)]}this.effectData=this.effect?function(t,s,i,h){return f({close:s.close},nt(s.options[t],i,h))}(this.effect,a,this.id,n):void 0,this.shapeData=this.shape?function(t,s,i,h){return f({close:s.close},nt(s.options[t],i,h))}(this.shape,c,this.id,n):void 0,e.load(i);const l=this.effectData,d=this.shapeData;l&&e.load(l.particles),d&&e.load(d.particles),this.effectClose=l?.close??e.effect.close,this.shapeClose=d?.close??e.shape.close,this.options=e,o.retina.initParticle(this);for(const t of o.particleUpdaters)t.preInit?.(this);let u,p;this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this.#K(s),this.initialVelocity=this.#Q(),this.velocity=this.initialVelocity.copy(),this.zIndexFactor=this.position.z/o.zLayers,this.sides=24,this.effect&&(u=o.effectDrawers.get(this.effect)),u?.loadEffect&&u.loadEffect(this),this.shape&&(p=o.shapeDrawers.get(this.shape)),p?.loadShape&&p.loadShape(this);const v=p?.getSidesCount;v&&(this.sides=v(this)),this.spawning=!1;for(const t of o.particleUpdaters)t.init(this);u?.particleInit?.(o,this),p?.particleInit?.(o,this);for(const t of o.particleCreatedPlugins)t.particleCreated?.(this)}isInsideCanvas(t){return this.#J({direction:t}).inside}isInsideCanvasForOutMode(t,s){return this.#J({direction:s,outMode:t}).inside}isShowingBack(){if(!this.roll)return!1;const t=this.roll.angle;if(this.roll.horizontal&&this.roll.vertical){const s=t%mt,i=s<ht?s+mt:s;return i>=Math.PI*R&&i<Math.PI*U*R}if(this.roll.horizontal){const s=(t+Math.PI*R)%(Math.PI*O),i=s<ht?s+Math.PI*O:s;return i>=Math.PI&&i<Math.PI*O}if(this.roll.vertical){const s=t%(Math.PI*O),i=s<ht?s+Math.PI*O:s;return i>=Math.PI&&i<Math.PI*O}return!1}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){for(const t of this.#t.particleUpdaters)t.reset?.(this)}#tt=(t,s)=>{let i=at,h=t?st.create(t.x,t.y,s):void 0;const o=this.#t,e=o.particlePositionPlugins,n=this.options.move.outModes,r=this.getRadius(),a=o.canvas.size,c=new AbortController,{signal:l}=c;for(;!l.aborted;){for(const t of e){const i=t.particlePosition?.(h,this);if(i)return st.create(i.x,i.y,s)}const t=Mt({size:a,position:h}),c=st.create(t.x,t.y,s);this.#st(c,r,n.left??n.default),this.#st(c,r,n.right??n.default),this.#it(c,r,n.top??n.default),this.#it(c,r,n.bottom??n.default);let l=!0;for(const t of o.particles.checkParticlePositionPlugins)if(l=t.checkParticlePosition?.(this,c,i)??!0,!l)break;if(l)return c;i+=ct,h=void 0}return h};#Q=()=>{const t=this.options.move,s=lt(this.direction).copy();if(t.direction===w.inside||t.direction===w.outside)return s;const i=Pt(yt(t.angle.value)),h=Pt(yt(t.angle.offset)),e={left:h-i*R,right:h+i*R};return t.straight||(s.angle+=dt(o(e.left,e.right))),t.random&&"number"==typeof t.speed&&(s.length*=rt()),s};#st=(t,s,i)=>{Es({outMode:i,checkModes:[v.bounce],coord:t.x,maxCoord:this.#t.canvas.size.width,setCb:s=>t.x+=s,radius:s})};#it=(t,s,i)=>{Es({outMode:i,checkModes:[v.bounce],coord:t.y,maxCoord:this.#t.canvas.size.height,setCb:s=>t.y+=s,radius:s})};#ht=(t,s)=>{const i=this.getRadius(),h=this.#t.canvas.size,o=this.position,e=s===v.bounce;return t===ut.bottom?{inside:e?o.y+i<h.height:o.y-i<h.height,reason:"default"}:t===ut.left?{inside:e?o.x-i>ht:o.x+i>ht,reason:"default"}:t===ut.right?{inside:e?o.x+i<h.width:o.x-i<h.width,reason:"default"}:t===ut.top?{inside:e?o.y-i>ht:o.y+i>ht,reason:"default"}:{inside:o.x>=-i&&o.y>=-i&&o.y<=h.height+i&&o.x<=h.width+i,reason:"default"}};#ot=(t,s)=>({canvasSize:this.#t.canvas.size,direction:t,outMode:s,particle:this,radius:this.getRadius()});#J=t=>{const s=this.#ht(t.direction,t.outMode),i=this.#t,h=this.shape?i.shapeDrawers.get(this.shape):void 0,o=this.effect?i.effectDrawers.get(this.effect):void 0,e=h?.isInsideCanvas,n=o?.isInsideCanvas;if(!e&&!n)return s;const r=this.#ot(t.direction,t.outMode),a=e?this.#et(e(r),"shape"):void 0,c=n?this.#et(n(r),"effect"):void 0;if(a&&c){const t=Math.max(a.margin??ht,c.margin??ht);return{inside:a.inside&&c.inside,margin:t>ht?t:void 0,reason:"combined"}}return a??c??s};#G=t=>t&&this.roll&&(this.backColor||this.roll.alter)&&this.isShowingBack()?this.backColor?this.backColor:this.roll.alter?function(t,s,i){return{h:t.h,s:t.s,l:t.l+(s===D.darken?-$:$)*i}}(t,this.roll.alter.type,this.roll.alter.value):t:t;#K=t=>{const s=this.#t,i=Math.floor(yt(this.options.zIndex.value)),h=this.#tt(t,ft(i,pt,s.zLayers));if(!h)throw new Error("a valid position cannot be found for particle");switch(this.position=h,this.initialPosition=this.position.copy(),this.moveCenter={...vt(this.options.move.center,s.canvas.size),radius:this.options.move.center.radius,mode:this.options.move.center.mode},this.direction=wt(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case w.inside:this.outType=et.inside;break;case w.outside:this.outType=et.outside}this.offset=gt.origin};#et=(t,s)=>"boolean"==typeof t?{inside:t,reason:s}:{inside:t.inside,margin:t.margin,reason:t.reason??s}}class As{#nt;#rt=new Map;#at=[];#ct;#lt;#dt=[];#ut;constructor(t){this.#nt=t,this.#ct=0,this.#ut=0}clear(){this.#rt.clear();const t=this.#lt;t&&(this.#nt=t),this.#lt=void 0}insert(t){const{x:s,y:i}=t.getPosition(),h=this.#ft(s,i);this.#rt.has(h)||this.#rt.set(h,[]),this.#rt.get(h)?.push(t)}query(t,s,i=[]){const h=this.#pt(t);if(!h)return i;const o=Math.floor(h.minX/this.#nt),e=Math.floor(h.maxX/this.#nt),n=Math.floor(h.minY/this.#nt),r=Math.floor(h.maxY/this.#nt);for(let h=o;h<=e;h++)for(let o=n;o<=r;o++){const e=this.#rt.get(`${h}_${o}`);if(e)for(const h of e)s&&!s(h)||t.contains(h.getPosition())&&i.push(h)}return i}queryCircle(t,s,i,h=[]){const o=this.#vt(t.x,t.y,s),e=this.query(o,i,h);return this.#wt(),e}queryRectangle(t,s,i,h=[]){const o=this.#gt(t.x,t.y,s.width,s.height),e=this.query(o,i,h);return this.#wt(),e}setCellSize(t){this.#lt=t}#vt(t,s,i){return(this.#at[this.#ct++]??=new jt(t,s,i)).reset(t,s,i)}#gt(t,s,i,h){return(this.#dt[this.#ut++]??=new Ht(t,s,i,h)).reset(t,s,i,h)}#ft(t,s){return`${Math.floor(t/this.#nt)}_${Math.floor(s/this.#nt)}`}#pt(t){if(t instanceof jt){const s=t.radius,{x:i,y:h}=t.position;return{minX:i-s,maxX:i+s,minY:h-s,maxY:h+s}}if(t instanceof Ht){const{x:s,y:i}=t.position,{width:h,height:o}=t.size;return{minX:s,maxX:s+h,minY:i,maxY:i+o}}return null}#wt(){this.#ct=0,this.#ut=0}}class qs{checkParticlePositionPlugins;grid;#yt;#t;#mt;#Mt;#bt;#Pt;#xt;#Ct;#s;#zt;#kt;#St;#Rt;#Dt;#$t;constructor(t,s){this.#s=t,this.#t=s,this.#bt=0,this.#yt=[],this.#zt=[],this.#Mt=0,this.#mt=new Map,this.#Pt=new Map,this.#$t=this.#Ot(this.#t.zLayers),this.grid=new As(xt),this.checkParticlePositionPlugins=[],this.#xt=[],this.#Ct=[],this.#St=[],this.#kt=[],this.#Dt=[]}get count(){return this.#yt.length}addParticle(t,s,i,h){const o=this.#t.actualOptions.particles.number.limit.mode,e=void 0===i?this.#Mt:this.#mt.get(i)??this.#Mt,n=this.count;if(e>Ct)switch(o){case m.delete:{const t=n+Tt-e;t>zt&&this.removeQuantity(t);break}case m.wait:if(n>=e)return}try{const o=this.#zt.pop()??new Us(this.#s,this.#t);o.init(this.#bt,t,s,i);let e=!0;return h&&(e=h(o)),e?(this.#yt.push(o),this.#Tt(o),this.#bt++,this.#t.dispatchEvent(it.particleAdded,{particle:o}),o):void this.#zt.push(o)}catch(t){kt().warning(`error adding particle: ${t}`)}}clear(){this.#yt=[],this.#Pt.clear(),this.#It(this.#t.zLayers)}destroy(){this.#yt=[],this.#zt.length=0,this.#Pt.clear(),this.#$t=[],this.checkParticlePositionPlugins=[],this.#xt=[],this.#Ct=[],this.#St=[],this.#kt=[],this.#Dt=[]}drawParticles(t){for(let s=this.#$t.length-It;s>=St;s--){const i=this.#$t[s];if(i)for(const s of i)s.draw(t)}}filter(t){return this.#yt.filter(t)}find(t){return this.#yt.find(t)}get(t){return this.#yt[t]}async init(){const t=this.#t,s=t.actualOptions;this.checkParticlePositionPlugins=[],this.#Dt=[],this.#Ct=[],this.#St=[],this.#xt=[],this.#kt=[],this.#Pt.clear(),this.#It(t.zLayers),this.grid=new As(xt*t.retina.pixelRatio);for(const s of t.plugins)s.redrawInit&&await s.redrawInit(),s.checkParticlePosition&&this.checkParticlePositionPlugins.push(s),s.update&&this.#Dt.push(s),s.particleUpdate&&this.#Ct.push(s),s.postUpdate&&this.#St.push(s),s.particleReset&&this.#xt.push(s),s.postParticleUpdate&&this.#kt.push(s);await this.#t.initDrawersAndUpdaters();for(const s of this.#t.effectDrawers.values())await(s.init?.(t));for(const s of this.#t.shapeDrawers.values())await(s.init?.(t));let i=!1;for(const s of t.plugins)if(i=s.particlesInitialization?.()??i,i)break;if(!i){const t=s.particles,i=t.groups;for(const s in i){const h=i[s];if(h)for(let i=this.count,o=0;o<h.number.value&&i<t.number.value;i++,o++)this.addParticle(void 0,h,s)}for(let s=this.count;s<t.number.value;s++)this.addParticle()}}push(t,s,i,h){for(let o=0;o<t;o++)this.addParticle(s,i,h)}async redraw(){this.clear(),await this.init(),this.#t.canvas.render.drawParticles({value:0,factor:0})}remove(t,s,i){this.removeAt(this.#yt.indexOf(t),void 0,s,i)}removeAt(t,s=Rt,i,h){if(t<St||t>this.count)return;let o=0;for(let e=t;o<s&&e<this.count;e++)this.#Ft(e,i,h)&&(e--,o++)}removeQuantity(t,s){this.removeAt(St,t,s)}setDensity(){const t=this.#t.actualOptions,s=t.particles.groups;let i=0;for(const t of this.#t.plugins)t.particlesDensityCount&&(i+=t.particlesDensityCount());for(const t in s){const h=s[t];if(!h)continue;const o=ms(this.#s,this.#t,h);this.#Bt(o,i,t)}this.#Bt(t.particles,i)}setResizeFactor(t){this.#Rt=t}update(t){this.grid.clear();for(const s of this.#Dt)s.update?.(t);const s=this.#Lt(t);for(const s of this.#St)s.postUpdate?.(t);if(this.#Et(t,s),s.size)for(const t of s)this.remove(t);this.#Rt=void 0}#Ut=(...t)=>{this.#zt.push(...t)};#Bt=(t,s,i,h)=>{const o=t.number;if(!o.density.enable)return void(void 0===i?this.#Mt=o.limit.value:(h?.number.limit.value??o.limit.value)&&this.#mt.set(i,h?.number.limit.value??o.limit.value));const e=this.#At(o.density),n=o.value,r=Math.min(n,o.limit.value>Ct?o.limit.value:n)*e+s,a=Math.min(this.count,this.filter((t=>t.group===i)).length);void 0===i?this.#Mt=o.limit.value*e:this.#mt.set(i,o.limit.value*e),a<r?this.push(Math.abs(r-a),void 0,t,i):a>r&&this.removeQuantity(a-r,i)};#Ot=t=>{const s=Math.max(Math.floor(t),It);return Array.from({length:s},(()=>[]))};#qt=t=>{const s=this.#$t.length-It;return s<=St?St:Math.min(Math.max(Math.floor(t),St),s)};#Vt=(t,s)=>{let i=St,h=t.length;for(;i<h;){const o=Math.floor((i+h)/O),e=t[o];e&&e.id<s?i=o+It:h=o}return i};#At=t=>{const s=this.#t;if(!t.enable)return Dt;const h=s.canvas.size;return h.width&&h.height?h.width*h.height/(t.height*t.width*s.retina.pixelRatio**i):Dt};#Tt=t=>{const s=this.#qt(t.position.z),i=this.#$t[s];i&&(i.splice(this.#Vt(i,t.id),$t,t),this.#Pt.set(t.id,s))};#Ft=(t,s,i)=>{const h=this.#yt[t];return!!h&&h.group===s&&(this.#yt.splice(t,Ot),this.#jt(h),h.destroy(i),this.#t.dispatchEvent(it.particleRemoved,{particle:h}),this.#Ut(h),!0)};#jt=t=>{const s=this.#Pt.get(t.id)??this.#qt(t.position.z),i=this.#$t[s];if(!i)return void this.#Pt.delete(t.id);const h=this.#Vt(i,t.id);i[h]?.id===t.id?(i.splice(h,Ot),this.#Pt.delete(t.id)):this.#Pt.delete(t.id)};#It=t=>{const s=Math.max(Math.floor(t),It);if(this.#$t.length===s)for(const t of this.#$t)t.length=St;else this.#$t=this.#Ot(s)};#Ht=t=>{const s=this.#qt(t.position.z),i=this.#Pt.get(t.id);if(void 0===i)return void this.#Tt(t);if(i===s)return;const h=this.#$t[i];if(h){const s=this.#Vt(h,t.id);h[s]?.id===t.id&&h.splice(s,Ot)}const o=this.#$t[s];o?(o.splice(this.#Vt(o,t.id),$t,t),this.#Pt.set(t.id,s)):this.#Pt.set(t.id,s)};#Lt=t=>{const s=new Set,i=this.#Rt;for(const h of this.#yt){i&&!h.ignoresResizeRatio&&(h.position.x*=i.width,h.position.y*=i.height,h.initialPosition.x*=i.width,h.initialPosition.y*=i.height),h.ignoresResizeRatio=!1;for(const t of this.#xt)t.particleReset?.(h);for(const s of this.#Ct){if(h.destroyed)break;s.particleUpdate?.(h,t)}h.destroyed?s.add(h):this.grid.insert(h)}return s};#Et=(t,s)=>{for(const i of this.#yt)if(i.destroyed)s.add(i);else{for(const s of this.#t.particleUpdaters)s.update(i,t);if(!i.spawning)for(const s of this.#kt)s.postParticleUpdate?.(i,t);this.#Ht(i)}}}class Vs{pixelRatio;reduceFactor;#t;constructor(t){this.#t=t,this.pixelRatio=Ft,this.reduceFactor=Bt}init(){const t=this.#t;this.pixelRatio=t.actualOptions.detectRetina?devicePixelRatio:Ft,this.reduceFactor=Bt;const s=this.pixelRatio,i=t.canvas,h=i.domElement;h&&(i.size.width=h.offsetWidth*s,i.size.height=h.offsetHeight*s)}initParticle(t){const s=this.pixelRatio,i=t.options.move,h=i.distance,o=t.retina;o.maxSpeed=yt(i.gravity.maxSpeed)*s,o.moveDrift=yt(i.drift)*s,o.moveSpeed=yt(i.speed)*s;const e=o.maxDistance;e.horizontal=void 0===h.horizontal?void 0:h.horizontal*s,e.vertical=void 0===h.vertical?void 0:h.vertical*s}}function js(t){return!t.destroyed}function Hs(t,s,...i){const h=new Ms(t,s);return ys(h,...i),h}class Ws{actualOptions;canvas;destroyed;effectDrawers;fpsLimit;hdr;id;pageHidden;particleCreatedPlugins;particleDestroyedPlugins;particlePositionPlugins;particleUpdaters;particles;plugins;retina;shapeDrawers;started;zLayers;#Wt;#Xt;#Yt={value:0,factor:0};#Nt;#_t;#Zt;#Gt;#Kt;#Qt;#Jt;#ts;#ss;#is;#hs;#s;#os;#es;constructor(t){const{dispatchCallback:s,pluginManager:i,id:h,onDestroy:o,sourceOptions:e}=t;this.#s=i,this.#Nt=s,this.#ss=o,this.id=Symbol(h),this.fpsLimit=120,this.hdr=!1,this.#os=!1,this.#Wt=0,this.#Zt=0,this.#ts=0,this.#Kt=!0,this.started=!1,this.destroyed=!1,this.#hs=!0,this.#Jt=0,this.zLayers=100,this.pageHidden=!1,this.#es=e,this.#Qt=e,this.effectDrawers=new Map,this.shapeDrawers=new Map,this.particleUpdaters=[],this.retina=new Vs(this),this.canvas=new Bs(this.#s,this),this.particles=new qs(this.#s,this),this.plugins=[],this.particleDestroyedPlugins=[],this.particleCreatedPlugins=[],this.particlePositionPlugins=[],this.#is=Hs(this.#s,this),this.actualOptions=Hs(this.#s,this),this.#Gt=new Ls(this),this.dispatchEvent(it.containerBuilt)}get animationStatus(){return!this.#hs&&!this.pageHidden&&js(this)}get options(){return this.#is}get sourceOptions(){return this.#es}addLifeTime(t){this.#ts+=t}alive(){return!this.#Zt||this.#ts<=this.#Zt}destroy(t=!0){if(js(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.plugins.length=0,this.#s.clearPlugins(this),this.destroyed=!0,this.#ss(t),this.dispatchEvent(it.containerDestroyed)}}dispatchEvent(t,s){this.#Nt(t,{container:this,data:s})}draw(t){if(!js(this))return;let s=t;this.#_t=Lt((t=>{s&&(this.#Jt=void 0,s=!1),this.#ns(t)}))}async export(t,s={}){for(const i of this.plugins){if(!i.export)continue;const h=await i.export(t,s);if(h.supported)return h.blob}kt().error(`Export plugin with type ${t} not found`)}async init(){if(!js(this))return;const t=new Map;for(const s of this.#s.plugins){const i=await s.getPlugin(this);i.preInit&&await i.preInit(),t.set(s,i)}await this.initDrawersAndUpdaters(),this.#is=Hs(this.#s,this,this.#Qt,this.sourceOptions),this.actualOptions=Hs(this.#s,this,this.#is),this.plugins.length=0,this.particleDestroyedPlugins.length=0,this.particleCreatedPlugins.length=0,this.particlePositionPlugins.length=0;for(const[s,i]of t)s.needsPlugin(this.actualOptions)&&(this.plugins.push(i),i.particleCreated&&this.particleCreatedPlugins.push(i),i.particleDestroyed&&this.particleDestroyedPlugins.push(i),i.particlePosition&&this.particlePositionPlugins.push(i));this.retina.init(),this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize();const{delay:s,duration:i,fpsLimit:h,hdr:o,smooth:e,zLayers:n}=this.actualOptions;this.hdr=o,this.zLayers=n,this.#Zt=yt(i)*K,this.#Wt=yt(s)*K,this.#ts=0,this.fpsLimit=h>Ut?h:Et,this.#os=e;for(const t of this.plugins)await(t.init?.());await this.particles.init(),this.dispatchEvent(it.containerInit),this.particles.setDensity();for(const t of this.plugins)t.particlesSetup?.();this.dispatchEvent(it.particlesSetup)}async initDrawersAndUpdaters(){const t=this.#s;this.effectDrawers=await t.getEffectDrawers(this,!0),this.shapeDrawers=await t.getShapeDrawers(this,!0),this.particleUpdaters=await t.getUpdaters(this,!0)}pause(){if(js(this)&&(void 0!==this.#_t&&(At(this.#_t),this.#_t=void 0),!this.#hs)){for(const t of this.plugins)t.pause?.();this.pageHidden||(this.#hs=!0),this.dispatchEvent(it.containerPaused)}}play(t){if(!js(this))return;const s=this.#hs||t;if(!this.#Kt||this.actualOptions.autoPlay){if(this.#hs&&(this.#hs=!1),s)for(const t of this.plugins)t.play&&t.play();this.dispatchEvent(it.containerPlay),this.draw(s??!1)}else this.#Kt=!1}async refresh(){if(js(this))return this.stop(),this.start()}async reset(t){if(js(this))return this.#Qt=t,this.#es=t,this.#is=Hs(this.#s,this,this.#Qt,this.sourceOptions),this.actualOptions=Hs(this.#s,this,this.#is),this.refresh()}async start(){js(this)&&!this.started&&(await this.init(),this.started=!0,await new Promise((t=>{const s=async()=>{this.#Gt.addListeners();for(const t of this.plugins)await(t.start?.());this.dispatchEvent(it.containerStarted),this.play(),t()};this.#Xt=setTimeout((()=>{s()}),this.#Wt)})))}stop(){if(js(this)&&this.started){this.#Xt&&(clearTimeout(this.#Xt),this.#Xt=void 0),this.#Kt=!0,this.started=!1,this.#Gt.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop();for(const t of this.plugins)t.stop?.();this.particleCreatedPlugins.length=0,this.particleDestroyedPlugins.length=0,this.particlePositionPlugins.length=0,this.#es=this.#is,this.dispatchEvent(it.containerStopped)}}updateActualOptions(){let t=!1;for(const s of this.plugins)s.updateActualOptions&&(t=s.updateActualOptions()||t);return t}#ns=t=>{try{if(!this.#os&&void 0!==this.#Jt&&t<this.#Jt+K/this.fpsLimit)return void this.draw(!1);if(this.#Jt??=t,function(t,s,i=qt,h=!1){t.value=s,t.factor=h?qt/i:qt*s/K}(this.#Yt,t-this.#Jt,this.fpsLimit,this.#os),this.addLifeTime(this.#Yt.value),this.#Jt=t,this.#Yt.value>K)return void this.draw(!1);if(this.canvas.render.drawParticles(this.#Yt),!this.alive())return void this.destroy();this.animationStatus&&this.draw(!1)}catch(t){kt().error("error in animation loop",t)}}}export{Ws as Container}
@@ -0,0 +1 @@
1
+ import{p as o,b as n}from"./p-BzK79uqU.js";export{s as setNonce}from"./p-BzK79uqU.js";import{g as p}from"./p-DQuL1Twl.js";(()=>{const s=import.meta.url,n={};return""!==s&&(n.resourcesUrl=new URL(".",s).href),o(n)})().then((async o=>(await p(),n([["p-2a10755a",[[0,"stencil-particles",{options:[16],url:[1],init:[16]},null,{options:[{onPropsChange:0}],url:[{onPropsChange:0}],init:[{onPropsChange:0}]}]]]],o))));
@@ -0,0 +1,16 @@
1
+ import { type JSX } from "../../stencil-public-runtime";
2
+ import { type ISourceOptions } from "@tsparticles/engine";
3
+ import type { ParticlesPluginRegistrar } from "../../initParticlesEngine";
4
+ export declare class StencilParticles {
5
+ private containerElement?;
6
+ options?: ISourceOptions;
7
+ url?: string;
8
+ init?: ParticlesPluginRegistrar;
9
+ private container?;
10
+ private renderId;
11
+ componentDidLoad(): Promise<void>;
12
+ disconnectedCallback(): void;
13
+ protected onPropsChange(): Promise<void>;
14
+ private loadParticles;
15
+ render(): JSX.Element;
16
+ }
@@ -0,0 +1,52 @@
1
+ /* eslint-disable */
2
+ /* tslint:disable */
3
+ /**
4
+ * This is an autogenerated file created by the Stencil compiler.
5
+ * It contains typing information for all components that exist in this project.
6
+ */
7
+ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { ISourceOptions } from "@tsparticles/engine";
9
+ import { ParticlesPluginRegistrar } from "./initParticlesEngine";
10
+ export { ISourceOptions } from "@tsparticles/engine";
11
+ export { ParticlesPluginRegistrar } from "./initParticlesEngine";
12
+ export namespace Components {
13
+ interface StencilParticles {
14
+ "init"?: ParticlesPluginRegistrar;
15
+ "options"?: ISourceOptions;
16
+ "url"?: string;
17
+ }
18
+ }
19
+ declare global {
20
+ interface HTMLStencilParticlesElement extends Components.StencilParticles, HTMLStencilElement {
21
+ }
22
+ var HTMLStencilParticlesElement: {
23
+ prototype: HTMLStencilParticlesElement;
24
+ new (): HTMLStencilParticlesElement;
25
+ };
26
+ interface HTMLElementTagNameMap {
27
+ "stencil-particles": HTMLStencilParticlesElement;
28
+ }
29
+ }
30
+ declare namespace LocalJSX {
31
+ interface StencilParticles {
32
+ "init"?: ParticlesPluginRegistrar;
33
+ "options"?: ISourceOptions;
34
+ "url"?: string;
35
+ }
36
+
37
+ interface StencilParticlesAttributes {
38
+ "url": string;
39
+ }
40
+
41
+ interface IntrinsicElements {
42
+ "stencil-particles": Omit<StencilParticles, keyof StencilParticlesAttributes> & { [K in keyof StencilParticles & keyof StencilParticlesAttributes]?: StencilParticles[K] } & { [K in keyof StencilParticles & keyof StencilParticlesAttributes as `attr:${K}`]?: StencilParticlesAttributes[K] } & { [K in keyof StencilParticles & keyof StencilParticlesAttributes as `prop:${K}`]?: StencilParticles[K] };
43
+ }
44
+ }
45
+ export { LocalJSX as JSX };
46
+ declare module "@stencil/core" {
47
+ export namespace JSX {
48
+ interface IntrinsicElements {
49
+ "stencil-particles": LocalJSX.IntrinsicElements["stencil-particles"] & JSXBase.HTMLAttributes<HTMLStencilParticlesElement>;
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,2 @@
1
+ export type { ParticlesPluginRegistrar } from "./initParticlesEngine";
2
+ export { initParticlesEngine, isParticlesEngineInitialized, waitForParticlesEngineInitialization } from "./initParticlesEngine";
@@ -0,0 +1,5 @@
1
+ import { Engine } from "@tsparticles/engine";
2
+ export type ParticlesPluginRegistrar = (engine: Engine) => Promise<void> | void;
3
+ export declare function initParticlesEngine(init?: ParticlesPluginRegistrar): Promise<void>;
4
+ export declare function isParticlesEngineInitialized(): boolean;
5
+ export declare function waitForParticlesEngineInitialization(): Promise<void>;