@tsparticles/confetti 4.1.2 → 4.2.0
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.
- package/browser/ConfettiOptions.js +12 -34
- package/browser/confetti.js +2 -2
- package/browser/confetti.lazy.js +2 -2
- package/browser/utils.js +3 -3
- package/cjs/ConfettiOptions.js +12 -34
- package/cjs/confetti.js +2 -2
- package/cjs/confetti.lazy.js +2 -2
- package/cjs/utils.js +3 -3
- package/esm/ConfettiOptions.js +12 -34
- package/esm/confetti.js +2 -2
- package/esm/confetti.lazy.js +2 -2
- package/esm/utils.js +3 -3
- package/package.json +18 -18
- package/report.html +1 -1
- package/tsparticles.confetti.bundle.js +1133 -1894
- package/tsparticles.confetti.bundle.min.js +1 -1
- package/tsparticles.confetti.js +16 -38
- package/tsparticles.confetti.min.js +1 -1
package/tsparticles.confetti.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
|
|
2
|
-
/* tsParticles v4.
|
|
2
|
+
/* tsParticles v4.2.0 */
|
|
3
3
|
(function (global, factory) {
|
|
4
4
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine'), require('@tsparticles/basic'), require('@tsparticles/shape-cards/suits'), require('@tsparticles/plugin-emitters/plugin'), require('@tsparticles/shape-emoji'), require('@tsparticles/shape-heart'), require('@tsparticles/shape-image'), require('@tsparticles/updater-life'), require('@tsparticles/plugin-motion'), require('@tsparticles/shape-polygon'), require('@tsparticles/updater-roll'), require('@tsparticles/updater-rotate'), require('@tsparticles/shape-square'), require('@tsparticles/shape-star'), require('@tsparticles/updater-tilt'), require('@tsparticles/updater-wobble')) :
|
|
5
5
|
typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine', '@tsparticles/basic', '@tsparticles/shape-cards/suits', '@tsparticles/plugin-emitters/plugin', '@tsparticles/shape-emoji', '@tsparticles/shape-heart', '@tsparticles/shape-image', '@tsparticles/updater-life', '@tsparticles/plugin-motion', '@tsparticles/shape-polygon', '@tsparticles/updater-roll', '@tsparticles/updater-rotate', '@tsparticles/shape-square', '@tsparticles/shape-star', '@tsparticles/updater-tilt', '@tsparticles/updater-wobble'], factory) :
|
|
@@ -64,34 +64,18 @@
|
|
|
64
64
|
if (engine.isNull(data)) {
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
|
-
|
|
68
|
-
this.angle = data.angle;
|
|
69
|
-
}
|
|
67
|
+
engine.loadProperty(this, "angle", data.angle);
|
|
70
68
|
const count = data.count ?? data.particleCount;
|
|
71
69
|
if (count !== undefined) {
|
|
72
70
|
this.count = count;
|
|
73
71
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
this.decay = data.decay;
|
|
82
|
-
}
|
|
83
|
-
if (data.flat !== undefined) {
|
|
84
|
-
this.flat = data.flat;
|
|
85
|
-
}
|
|
86
|
-
if (data.gravity !== undefined) {
|
|
87
|
-
this.gravity = data.gravity;
|
|
88
|
-
}
|
|
89
|
-
if (data.drift !== undefined) {
|
|
90
|
-
this.drift = data.drift;
|
|
91
|
-
}
|
|
92
|
-
if (data.ticks !== undefined) {
|
|
93
|
-
this.ticks = data.ticks;
|
|
94
|
-
}
|
|
72
|
+
engine.loadProperty(this, "spread", data.spread);
|
|
73
|
+
engine.loadProperty(this, "startVelocity", data.startVelocity);
|
|
74
|
+
engine.loadProperty(this, "decay", data.decay);
|
|
75
|
+
engine.loadProperty(this, "flat", data.flat);
|
|
76
|
+
engine.loadProperty(this, "gravity", data.gravity);
|
|
77
|
+
engine.loadProperty(this, "drift", data.drift);
|
|
78
|
+
engine.loadProperty(this, "ticks", data.ticks);
|
|
95
79
|
const origin = data.origin;
|
|
96
80
|
if (origin && !data.position) {
|
|
97
81
|
data.position = {
|
|
@@ -133,19 +117,13 @@
|
|
|
133
117
|
this.shapes = data.shapes;
|
|
134
118
|
}
|
|
135
119
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
if (data.zIndex !== undefined) {
|
|
140
|
-
this.zIndex = data.zIndex;
|
|
141
|
-
}
|
|
142
|
-
if (data.disableForReducedMotion !== undefined) {
|
|
143
|
-
this.disableForReducedMotion = data.disableForReducedMotion;
|
|
144
|
-
}
|
|
120
|
+
engine.loadProperty(this, "scalar", data.scalar);
|
|
121
|
+
engine.loadProperty(this, "zIndex", data.zIndex);
|
|
122
|
+
engine.loadProperty(this, "disableForReducedMotion", data.disableForReducedMotion);
|
|
145
123
|
}
|
|
146
124
|
}
|
|
147
125
|
|
|
148
|
-
const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0, ids = new Map();
|
|
126
|
+
const defaultGravity = 9.81, sizeFactor = 5, speedFactor = 3, decayOffset = 1, disableRotate = 0, disableTilt = 0, noOpacityChange = 0, ids = new Map(), minTicks = 0;
|
|
149
127
|
async function addEmitter(container, actualOptions, opacitySpeed) {
|
|
150
128
|
await container.addEmitter?.({
|
|
151
129
|
startCount: actualOptions.count,
|
|
@@ -396,7 +374,7 @@
|
|
|
396
374
|
async function setConfetti(engine$1, params) {
|
|
397
375
|
const actualOptions = new ConfettiOptions();
|
|
398
376
|
actualOptions.load(params.options);
|
|
399
|
-
const fpsLimit = 120,
|
|
377
|
+
const fpsLimit = 120, safeTicks = Number.isFinite(actualOptions.ticks) && actualOptions.ticks > minTicks ? actualOptions.ticks : undefined, opacitySpeed = safeTicks === undefined ? noOpacityChange : (fpsLimit * engine.percentDenominator) / (engine.defaultFps * safeTicks);
|
|
400
378
|
let containerOrPromise = ids.get(params.id);
|
|
401
379
|
if (containerOrPromise instanceof Promise) {
|
|
402
380
|
await containerOrPromise;
|
|
@@ -425,7 +403,7 @@
|
|
|
425
403
|
|
|
426
404
|
let initPromise = null;
|
|
427
405
|
async function doInitPlugins(engine) {
|
|
428
|
-
engine.checkVersion("4.
|
|
406
|
+
engine.checkVersion("4.2.0");
|
|
429
407
|
await engine.pluginManager.register(async (e) => {
|
|
430
408
|
await Promise.all([
|
|
431
409
|
basic.loadBasic(e),
|
|
@@ -498,7 +476,7 @@
|
|
|
498
476
|
confetti.init = async () => {
|
|
499
477
|
await initPlugins(engine.tsParticles);
|
|
500
478
|
};
|
|
501
|
-
confetti.version = "4.
|
|
479
|
+
confetti.version = "4.2.0";
|
|
502
480
|
globalThis.confetti = confetti;
|
|
503
481
|
|
|
504
482
|
const globalObject = globalThis;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!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 s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,s){"object"==typeof exports&&"undefined"!=typeof module?s(exports,require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/shape-cards/suits"),require("@tsparticles/plugin-emitters/plugin"),require("@tsparticles/shape-emoji"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-image"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-polygon"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-rotate"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine","@tsparticles/basic","@tsparticles/shape-cards/suits","@tsparticles/plugin-emitters/plugin","@tsparticles/shape-emoji","@tsparticles/shape-heart","@tsparticles/shape-image","@tsparticles/updater-life","@tsparticles/plugin-motion","@tsparticles/shape-polygon","@tsparticles/updater-roll","@tsparticles/updater-rotate","@tsparticles/shape-square","@tsparticles/shape-star","@tsparticles/updater-tilt","@tsparticles/updater-wobble"],s):s(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.bundles.confetti=t.__tsParticlesInternals.bundles.confetti||{}),t.__tsParticlesInternals.engine,t.__tsParticlesInternals.bundles.basic,t.__tsParticlesInternals.shapes["cards/suits"],t.__tsParticlesInternals.plugins["emitters/plugin"],t.__tsParticlesInternals.shapes.emoji,t.__tsParticlesInternals.shapes.heart,t.__tsParticlesInternals.shapes.image,t.__tsParticlesInternals.updaters.life,t.__tsParticlesInternals.plugins.motion,t.__tsParticlesInternals.shapes.polygon,t.__tsParticlesInternals.updaters.roll,t.__tsParticlesInternals.updaters.rotate,t.__tsParticlesInternals.shapes.square,t.__tsParticlesInternals.shapes.star,t.__tsParticlesInternals.updaters.tilt,t.__tsParticlesInternals.updaters.wobble)}(this,function(t,s,e,a,i,n,r,l,o,c,p,d,_,u,h,f,P){"use strict";class I{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/s.percentDenominator,y:this.position.y/s.percentDenominator}}set origin(t){this.position.x=t.x*s.percentDenominator,this.position.y=t.y*s.percentDenominator}get particleCount(){return this.count}set particleCount(t){this.count=t}load(t){if(s.isNull(t))return;void 0!==t.angle&&(this.angle=t.angle);const e=t.count??t.particleCount;void 0!==e&&(this.count=e),void 0!==t.spread&&(this.spread=t.spread),void 0!==t.startVelocity&&(this.startVelocity=t.startVelocity),void 0!==t.decay&&(this.decay=t.decay),void 0!==t.flat&&(this.flat=t.flat),void 0!==t.gravity&&(this.gravity=t.gravity),void 0!==t.drift&&(this.drift=t.drift),void 0!==t.ticks&&(this.ticks=t.ticks);const a=t.origin;a&&!t.position&&(t.position={x:void 0===a.x?void 0:a.x*s.percentDenominator,y:void 0===a.y?void 0:a.y*s.percentDenominator});const i=t.position;i&&(void 0!==i.x&&(this.position.x=i.x),void 0!==i.y&&(this.position.y=i.y)),void 0!==t.colors&&(s.isArray(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]=s.deepExtend(this.shapeOptions[t]??{},e))}void 0!==t.shapes&&(s.isArray(t.shapes)?this.shapes=[...t.shapes]:this.shapes=t.shapes),void 0!==t.scalar&&(this.scalar=t.scalar),void 0!==t.zIndex&&(this.zIndex=t.zIndex),void 0!==t.disableForReducedMotion&&(this.disableForReducedMotion=t.disableForReducedMotion)}}const g=new Map;async function m(t,e){const a=new I;a.load(e.options);const i=432*s.millisecondsToSeconds/(a.ticks*s.millisecondsToSeconds);let n=g.get(e.id);n instanceof Promise&&(await n,n=g.get(e.id));const r=n;if(r&&!r.destroyed){const t=r;if("addEmitter"in t)return await async function(t,s,e){await(t.addEmitter?.({startCount:s.count,position:s.position,size:{width:0,height:0},rate:{delay:0,quantity:0},life:{duration:.1,count:1},particles:{paint:{fill:{color:{value:s.colors},enable:!0}},shape:{type:s.shapes,options:s.shapeOptions},life:{count:1},opacity:{value:{min:0,max:1},animation:{enable:!0,sync:!0,speed:e,startValue:"max",destroy:"min",count:1}},size:{value:5*s.scalar},move:{angle:{value:s.spread,offset:0},drift:{min:-s.drift,max:s.drift},gravity:{acceleration:9.81*s.gravity},speed:3*s.startVelocity,decay:1-s.decay,direction:-s.angle},rotate:{value:s.flat?0:{min:0,max:360},direction:"random",animation:{enable:!s.flat,speed:60}},tilt:{direction:"random",enable:!s.flat,value:s.flat?0:{min:0,max:360},animation:{enable:!0,speed:60}},roll:{darken:{enable:!0,value:25},enable:!s.flat,speed:{min:15,max:25}},wobble:{distance:30,enable:!s.flat,speed:{min:-15,max:15}}}}))}(t,a,i),r}const l=(async()=>{const s=function(t,s,e){return{fullScreen:{enable:!s.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:e,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}}}}(a,e,i),n=await t.load({id:e.id,element:e.canvas,options:s});return g.set(e.id,n),n})();return g.set(e.id,l),l}let y=null;async function b(t){return y||(y=async function(t){t.checkVersion("4.1.2"),await t.pluginManager.register(async t=>{await Promise.all([e.loadBasic(t),c.loadMotionPlugin(t),i.loadEmittersPluginSimple(t),a.loadCardSuitsShape(t),r.loadHeartShape(t),l.loadImageShape(t),p.loadPolygonShape(t),u.loadSquareShape(t),h.loadStarShape(t),n.loadEmojiShape(t),_.loadRotateUpdater(t),o.loadLifeUpdater(t),d.loadRollUpdater(t),f.loadTiltUpdater(t),P.loadWobbleUpdater(t)])})}(t),y)}async function v(t,e){let a,i;return await b(s.tsParticles),s.isString(t)?(i=t,a=e??{}):(i="confetti",a=t),m(s.tsParticles,{id:i,options:a})}v.create=async(t,e={})=>{await b(s.tsParticles);const a=t?.getAttribute("id")??"confetti";return t?.setAttribute("id",a),await m(s.tsParticles,{id:a,canvas:t??void 0,options:e}),async(i,n)=>{let r,l;return s.isString(i)?(l=i,r=n??e):(l=a,r=i),m(s.tsParticles,{id:l,canvas:t??void 0,options:r})}},v.init=async()=>{await b(s.tsParticles)},v.version="4.1.2",globalThis.confetti=v;const x=globalThis;x.__tsParticlesInternals=x.__tsParticlesInternals??{},x.confetti=v,t.confetti=v}),Object.assign(globalThis.window||globalThis,{confetti:(globalThis.__tsParticlesInternals.bundles.confetti||{}).confetti}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|
|
1
|
+
!function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine"),require("@tsparticles/basic"),require("@tsparticles/shape-cards/suits"),require("@tsparticles/plugin-emitters/plugin"),require("@tsparticles/shape-emoji"),require("@tsparticles/shape-heart"),require("@tsparticles/shape-image"),require("@tsparticles/updater-life"),require("@tsparticles/plugin-motion"),require("@tsparticles/shape-polygon"),require("@tsparticles/updater-roll"),require("@tsparticles/updater-rotate"),require("@tsparticles/shape-square"),require("@tsparticles/shape-star"),require("@tsparticles/updater-tilt"),require("@tsparticles/updater-wobble")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine","@tsparticles/basic","@tsparticles/shape-cards/suits","@tsparticles/plugin-emitters/plugin","@tsparticles/shape-emoji","@tsparticles/shape-heart","@tsparticles/shape-image","@tsparticles/updater-life","@tsparticles/plugin-motion","@tsparticles/shape-polygon","@tsparticles/updater-roll","@tsparticles/updater-rotate","@tsparticles/shape-square","@tsparticles/shape-star","@tsparticles/updater-tilt","@tsparticles/updater-wobble"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.bundles.confetti=t.__tsParticlesInternals.bundles.confetti||{}),t.__tsParticlesInternals.engine,t.__tsParticlesInternals.bundles.basic,t.__tsParticlesInternals.shapes["cards/suits"],t.__tsParticlesInternals.plugins["emitters/plugin"],t.__tsParticlesInternals.shapes.emoji,t.__tsParticlesInternals.shapes.heart,t.__tsParticlesInternals.shapes.image,t.__tsParticlesInternals.updaters.life,t.__tsParticlesInternals.plugins.motion,t.__tsParticlesInternals.shapes.polygon,t.__tsParticlesInternals.updaters.roll,t.__tsParticlesInternals.updaters.rotate,t.__tsParticlesInternals.shapes.square,t.__tsParticlesInternals.shapes.star,t.__tsParticlesInternals.updaters.tilt,t.__tsParticlesInternals.updaters.wobble)}(this,function(t,e,s,a,i,n,r,l,o,c,p,d,_,u,h,P,f){"use strict";class I{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/e.percentDenominator,y:this.position.y/e.percentDenominator}}set origin(t){this.position.x=t.x*e.percentDenominator,this.position.y=t.y*e.percentDenominator}get particleCount(){return this.count}set particleCount(t){this.count=t}load(t){if(e.isNull(t))return;e.loadProperty(this,"angle",t.angle);const s=t.count??t.particleCount;void 0!==s&&(this.count=s),e.loadProperty(this,"spread",t.spread),e.loadProperty(this,"startVelocity",t.startVelocity),e.loadProperty(this,"decay",t.decay),e.loadProperty(this,"flat",t.flat),e.loadProperty(this,"gravity",t.gravity),e.loadProperty(this,"drift",t.drift),e.loadProperty(this,"ticks",t.ticks);const a=t.origin;a&&!t.position&&(t.position={x:void 0===a.x?void 0:a.x*e.percentDenominator,y:void 0===a.y?void 0:a.y*e.percentDenominator});const i=t.position;i&&(void 0!==i.x&&(this.position.x=i.x),void 0!==i.y&&(this.position.y=i.y)),void 0!==t.colors&&(e.isArray(t.colors)?this.colors=[...t.colors]:this.colors=t.colors);const n=t.shapeOptions;if(void 0!==n)for(const t in n){const s=n[t];s&&(this.shapeOptions[t]=e.deepExtend(this.shapeOptions[t]??{},s))}void 0!==t.shapes&&(e.isArray(t.shapes)?this.shapes=[...t.shapes]:this.shapes=t.shapes),e.loadProperty(this,"scalar",t.scalar),e.loadProperty(this,"zIndex",t.zIndex),e.loadProperty(this,"disableForReducedMotion",t.disableForReducedMotion)}}const y=new Map;async function m(t,s){const a=new I;a.load(s.options);const i=Number.isFinite(a.ticks)&&a.ticks>0?a.ticks:void 0,n=void 0===i?0:120*e.percentDenominator/(e.defaultFps*i);let r=y.get(s.id);r instanceof Promise&&(await r,r=y.get(s.id));const l=r;if(l&&!l.destroyed){const t=l;if("addEmitter"in t)return await async function(t,e,s){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:s,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,a,n),l}const o=(async()=>{const e=function(t,e,s){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:s,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}}}}(a,s,n),i=await t.load({id:s.id,element:s.canvas,options:e});return y.set(s.id,i),i})();return y.set(s.id,o),o}let g=null;async function b(t){return g||(g=async function(t){t.checkVersion("4.2.0"),await t.pluginManager.register(async t=>{await Promise.all([s.loadBasic(t),c.loadMotionPlugin(t),i.loadEmittersPluginSimple(t),a.loadCardSuitsShape(t),r.loadHeartShape(t),l.loadImageShape(t),p.loadPolygonShape(t),u.loadSquareShape(t),h.loadStarShape(t),n.loadEmojiShape(t),_.loadRotateUpdater(t),o.loadLifeUpdater(t),d.loadRollUpdater(t),P.loadTiltUpdater(t),f.loadWobbleUpdater(t)])})}(t),g)}async function v(t,s){let a,i;return await b(e.tsParticles),e.isString(t)?(i=t,a=s??{}):(i="confetti",a=t),m(e.tsParticles,{id:i,options:a})}v.create=async(t,s={})=>{await b(e.tsParticles);const a=t?.getAttribute("id")??"confetti";return t?.setAttribute("id",a),await m(e.tsParticles,{id:a,canvas:t??void 0,options:s}),async(i,n)=>{let r,l;return e.isString(i)?(l=i,r=n??s):(l=a,r=i),m(e.tsParticles,{id:l,canvas:t??void 0,options:r})}},v.init=async()=>{await b(e.tsParticles)},v.version="4.2.0",globalThis.confetti=v;const x=globalThis;x.__tsParticlesInternals=x.__tsParticlesInternals??{},x.confetti=v,t.confetti=v}),Object.assign(globalThis.window||globalThis,{confetti:(globalThis.__tsParticlesInternals.bundles.confetti||{}).confetti}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
|