UNPKG

@tsparticles/editor

Version:

tsParticles Configuration Editor

2 lines 62.7 kB
/*! tsParticles Editor v3.1.1 by Matteo Bruni */ !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"),require("object-gui"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine","object-gui"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine"),require("object-gui")):t(e.window,e.window);for(var i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(this,((e,t)=>(()=>{"use strict";var r={869:t=>{t.exports=e},443:e=>{e.exports=t}},i={};function s(e){var t=i[e];if(void 0!==t)return t.exports;var o=i[e]={exports:{}};return r[e](o,o.exports,s),o.exports}s.d=(e,t)=>{for(var r in t)s.o(t,r)&&!s.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};s.r(o),s.d(o,{showEditor:()=>ue});var a=s(869),d=s(443);const n="editorChanged";class p{constructor(e){this.particles=e}notifyEditorChanged(){a.tsParticles.dispatchEvent(n,{container:this.particles()})}}class h extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("backgroundMask","Background Mask"),this.options=this.group.data,this.addCover(),this.addProperties()}addCover(){const e=this.group.addGroup("cover","Cover"),t=e.data,r=t().color,i="string"==typeof r?r:r?.value;e.addProperty("color","Color",d.EditorType.color,i,!1).change((e=>{t().color="string"==typeof e?e:{value:e},this.particles().refresh()})),e.addProperty("image","Image",d.EditorType.string).change((()=>{this.particles().refresh()})),e.addProperty("opacity","Opacity",d.EditorType.number).change((()=>{this.particles().refresh()})).step(.01).min(0).max(1)}addProperties(){this.group.addProperty("composite","Composite",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:"source-over"},{value:"source-in"},{value:"source-out"},{value:"source-atop"},{value:"destination-over"},{value:"destination-in"},{value:"destination-out"},{value:"destination-atop"},{value:"lighter"},{value:"copy"},{value:"xor"},{value:"multiply"},{value:"screen"},{value:"overlay"},{value:"darken"},{value:"lighten"},{value:"color-dodge"},{value:"color-burn"},{value:"hard-light"},{value:"soft-light"},{value:"difference"},{value:"exclusion"},{value:"hue"},{value:"saturation"},{value:"color"},{value:"luminosity"}]),this.group.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()}))}}class l extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("background","Background"),this.options=this.group.data,this.addColor(),this.addProperties()}addColor(){const e=this.options().color;this.group.addProperty("color","Color",d.EditorType.color,e.value,!1).change((e=>{const t=this.options().color;"string"==typeof e&&(t.value=e),this.notifyEditorChanged()}))}addProperties(){this.group.addProperty("image","Image",d.EditorType.string).change((()=>{this.particles().refresh()})),this.group.addProperty("opacity","Opacity",d.EditorType.number).change((()=>{this.particles().refresh()})).step(.01).min(0).max(1),this.group.addProperty("position","Position",d.EditorType.string).change((()=>{this.particles().refresh()})),this.group.addProperty("repeat","Repeat",d.EditorType.string).change((()=>{this.particles().refresh()})),this.group.addProperty("size","Size",d.EditorType.string).change((()=>{this.particles().refresh()}))}}class c extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("fullScreen","Full Screen"),this.options=this.group.data,this.addProperties()}addProperties(){this.group.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("zIndex","zIndex",d.EditorType.number).change((()=>{this.particles().refresh()}))}}class u extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("infection","Infection"),this.options=this.group.data,this.addStages(),this.addProperties()}addProperties(){this.group.addProperty("cure","Cure",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("delay","Delay",d.EditorType.number).change((()=>{this.particles().refresh()})),this.group.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("infections","Infections",d.EditorType.number).change((()=>{this.particles().refresh()}))}addStage(e,t,r){const i=e.addGroup(r().toString(10),`Stage ${r()}`,!0,t),s=i.data;i.addProperty("color","Color",d.EditorType.color,s().color,!1).change((e=>{"string"==typeof e&&("string"==typeof s().color?s().color=e:s().color={value:e}),this.particles().refresh()})),i.addProperty("duration","Duration",d.EditorType.number).change((()=>{this.particles().refresh()})),i.addProperty("infectedStage","Infected Stage",d.EditorType.number).change((()=>{this.particles().refresh()})),i.addProperty("radius","Radius",d.EditorType.number).change((()=>{this.particles().refresh()})),i.addProperty("rate","Rate",d.EditorType.number).change((()=>{this.particles().refresh()}))}addStages(){const e=this.options(),t=this.group.addGroup("stages","Stages");if(e&&!e.stages&&(e.stages=[]),e)for(let r=0;r<e.stages.length;r++)this.addStage(t,(()=>e.stages),(()=>r+1));t.addButton("addStage","Add Stage",!1).click((()=>{this.addStage(t,(()=>this.options().stages),(()=>this.options().stages.length)),this.particles().refresh()}))}}class y{constructor(){this.radius=0,this.mass=0}load(e){(0,a.isNull)(e)||(void 0!==e.mass&&(this.mass=e.mass),void 0!==e.radius&&(this.radius=e.radius))}}class g extends a.ValueWithRandom{constructor(){super(),this.density=5,this.value=50,this.limit=new y}load(e){(0,a.isNull)(e)||(super.load(e),void 0!==e.density&&(this.density=e.density),(0,a.isNumber)(e.limit)?this.limit.radius=e.limit:this.limit.load(e.limit))}}class m{constructor(){this.color=new a.OptionsColor,this.color.value="#000000",this.draggable=!1,this.opacity=1,this.destroy=!0,this.orbits=!1,this.size=new g}load(e){(0,a.isNull)(e)||(void 0!==e.color&&(this.color=a.OptionsColor.create(this.color,e.color)),void 0!==e.draggable&&(this.draggable=e.draggable),this.name=e.name,void 0!==e.opacity&&(this.opacity=e.opacity),void 0!==e.position&&(this.position={},void 0!==e.position.x&&(this.position.x=(0,a.setRangeValue)(e.position.x)),void 0!==e.position.y&&(this.position.y=(0,a.setRangeValue)(e.position.y))),void 0!==e.size&&this.size.load(e.size),void 0!==e.destroy&&(this.destroy=e.destroy),void 0!==e.orbits&&(this.orbits=e.orbits))}}var b;!function(e){e.absorber="absorber"}(b||(b={}));const f=0,v=0,P=2*Math.PI;class T{constructor(e,t,r,i,s){this._calcPosition=()=>{const e=(0,a.calcPositionOrRandomFromSizeRanged)({size:this._container.canvas.size,position:this.options.position});return a.Vector.create(e.x,e.y)},this._updateParticlePosition=(e,t)=>{if(e.destroyed)return;const r=this._container,i=r.canvas.size;if(e.needsNewPosition){const t=(0,a.calcPositionOrRandomFromSize)({size:i});e.position.setTo(t),e.velocity.setTo(e.initialVelocity),e.absorberOrbit=void 0,e.needsNewPosition=!1}if(this.options.orbits){if(void 0===e.absorberOrbit&&(e.absorberOrbit=a.Vector.origin,e.absorberOrbit.length=(0,a.getDistance)(e.getPosition(),this.position),e.absorberOrbit.angle=(0,a.getRandom)()*P),e.absorberOrbit.length<=this.size&&!this.options.destroy){const t=Math.min(i.width,i.height),r=1,s=.1,o=.2;e.absorberOrbit.length=t*(r+((0,a.getRandom)()*o-s))}void 0===e.absorberOrbitDirection&&(e.absorberOrbitDirection=e.velocity.x>=0?a.RotateDirection.clockwise:a.RotateDirection.counterClockwise);const s=e.absorberOrbit.length,o=e.absorberOrbit.angle,d=e.absorberOrbitDirection;e.velocity.setTo(a.Vector.origin);const n={x:d===a.RotateDirection.clockwise?Math.cos:Math.sin,y:d===a.RotateDirection.clockwise?Math.sin:Math.cos};e.position.x=this.position.x+s*n.x(o),e.position.y=this.position.y+s*n.y(o),e.absorberOrbit.length-=t.length,e.absorberOrbit.angle+=(e.retina.moveSpeed??0)*r.retina.pixelRatio/a.percentDenominator*r.retina.reduceFactor}else{const r=a.Vector.origin;r.length=t.length,r.angle=t.angle,e.velocity.addTo(r)}},this._absorbers=e,this._container=t,this._engine=r,this.initialPosition=s?a.Vector.create(s.x,s.y):void 0,i instanceof m?this.options=i:(this.options=new m,this.options.load(i)),this.dragging=!1,this.name=this.options.name,this.opacity=this.options.opacity,this.size=(0,a.getRangeValue)(this.options.size.value)*t.retina.pixelRatio,this.mass=this.size*this.options.size.density*t.retina.reduceFactor;const o=this.options.size.limit;this.limit={radius:o.radius*t.retina.pixelRatio*t.retina.reduceFactor,mass:o.mass},this.color=(0,a.rangeColorToRgb)(this._engine,this.options.color)??{b:0,g:0,r:0},this.position=this.initialPosition?.copy()??this._calcPosition()}attract(e){const t=this._container,r=this.options;if(r.draggable){const e=t.interactivity.mouse;if(e.clicking&&e.downPosition){(0,a.getDistance)(this.position,e.downPosition)<=this.size&&(this.dragging=!0)}else this.dragging=!1;this.dragging&&e.position&&(this.position.x=e.position.x,this.position.y=e.position.y)}const i=e.getPosition(),{dx:s,dy:o,distance:d}=(0,a.getDistances)(this.position,i),n=a.Vector.create(s,o);if(n.length=this.mass/Math.pow(d,2)*t.retina.reduceFactor,d<this.size+e.getRadius()){const i=.033*e.getRadius()*t.retina.pixelRatio;this.size>e.getRadius()&&d<this.size-e.getRadius()||void 0!==e.absorberOrbit&&e.absorberOrbit.length<0?r.destroy?e.destroy():(e.needsNewPosition=!0,this._updateParticlePosition(e,n)):(r.destroy&&(e.size.value-=i),this._updateParticlePosition(e,n)),(this.limit.radius<=0||this.size<this.limit.radius)&&(this.size+=i),(this.limit.mass<=0||this.mass<this.limit.mass)&&(this.mass+=i*this.options.size.density*t.retina.reduceFactor)}else this._updateParticlePosition(e,n)}draw(e){e.translate(this.position.x,this.position.y),e.beginPath(),e.arc(f,v,this.size,0,P,!1),e.closePath(),e.fillStyle=(0,a.getStyleFromRgb)(this.color,this.opacity),e.fill()}resize(){const e=this.initialPosition;this.position=e&&(0,a.isPointInside)(e,this._container.canvas.size,a.Vector.origin)?e:this._calcPosition()}}class E{constructor(e,t){this._container=e,this._engine=t,this.array=[],this.absorbers=[],this.interactivityAbsorbers=[],e.getAbsorber=e=>void 0===e||(0,a.isNumber)(e)?this.array[e??0]:this.array.find((t=>t.name===e)),e.addAbsorber=async(e,t)=>this.addAbsorber(e,t)}async addAbsorber(e,t){const r=new T(this,this._container,this._engine,e,t);return this.array.push(r),Promise.resolve(r)}draw(e){for(const t of this.array)t.draw(e)}handleClickMode(e){const t=this.absorbers,r=this.interactivityAbsorbers;if(e===b.absorber){const e=(0,a.itemFromSingleOrMultiple)(r)??(0,a.itemFromSingleOrMultiple)(t),i=this._container.interactivity.mouse.clickPosition;this.addAbsorber(e,i)}}async init(){this.absorbers=this._container.actualOptions.absorbers,this.interactivityAbsorbers=this._container.actualOptions.interactivity.modes.absorbers;const e=(0,a.executeOnSingleOrMultiple)(this.absorbers,(async e=>{await this.addAbsorber(e)}));e instanceof Array?await Promise.all(e):await e}particleUpdate(e){for(const t of this.array)if(t.attract(e),e.destroyed)break}removeAbsorber(e){const t=this.array.indexOf(e);t>=0&&this.array.splice(t,1)}resize(){for(const e of this.array)e.resize()}stop(){this.array=[]}}class w{constructor(e){this.id="absorbers",this._engine=e}async getPlugin(e){return Promise.resolve(new E(e,this._engine))}loadOptions(e,t){(this.needsPlugin(e)||this.needsPlugin(t))&&(t?.absorbers&&(e.absorbers=(0,a.executeOnSingleOrMultiple)(t.absorbers,(e=>{const t=new m;return t.load(e),t}))),e.interactivity.modes.absorbers=(0,a.executeOnSingleOrMultiple)(t?.interactivity?.modes?.absorbers,(e=>{const t=new m;return t.load(e),t})))}needsPlugin(e){if(!e)return!1;const t=e.absorbers;return(0,a.isArray)(t)?!!t.length:!!t||!(!e.interactivity?.events?.onClick?.mode||!(0,a.isInArray)(b.absorber,e.interactivity.events.onClick.mode))}}async function G(e,t=!0){(0,a.assertValidVersion)(e,"3.7.1"),await e.addPlugin(new w(e),t)}class S{constructor(){this.wait=!1}load(e){(0,a.isNull)(e)||(void 0!==e.count&&(this.count=e.count),void 0!==e.delay&&(this.delay=(0,a.setRangeValue)(e.delay)),void 0!==e.duration&&(this.duration=(0,a.setRangeValue)(e.duration)),void 0!==e.wait&&(this.wait=e.wait))}}class _{constructor(){this.quantity=1,this.delay=.1}load(e){(0,a.isNull)(e)||(void 0!==e.quantity&&(this.quantity=(0,a.setRangeValue)(e.quantity)),void 0!==e.delay&&(this.delay=(0,a.setRangeValue)(e.delay)))}}class x{constructor(){this.color=!1,this.opacity=!1}load(e){(0,a.isNull)(e)||(void 0!==e.color&&(this.color=e.color),void 0!==e.opacity&&(this.opacity=e.opacity))}}class D{constructor(){this.options={},this.replace=new x,this.type="square"}load(e){(0,a.isNull)(e)||(void 0!==e.options&&(this.options=(0,a.deepExtend)({},e.options??{})),this.replace.load(e.replace),void 0!==e.type&&(this.type=e.type))}}class C{constructor(){this.mode=a.PixelMode.percent,this.height=0,this.width=0}load(e){(0,a.isNull)(e)||(void 0!==e.mode&&(this.mode=e.mode),void 0!==e.height&&(this.height=e.height),void 0!==e.width&&(this.width=e.width))}}class O{constructor(){this.autoPlay=!0,this.fill=!0,this.life=new S,this.rate=new _,this.shape=new D,this.startCount=0}load(e){(0,a.isNull)(e)||(void 0!==e.autoPlay&&(this.autoPlay=e.autoPlay),void 0!==e.size&&(this.size||(this.size=new C),this.size.load(e.size)),void 0!==e.direction&&(this.direction=e.direction),this.domId=e.domId,void 0!==e.fill&&(this.fill=e.fill),this.life.load(e.life),this.name=e.name,this.particles=(0,a.executeOnSingleOrMultiple)(e.particles,(e=>(0,a.deepExtend)({},e))),this.rate.load(e.rate),this.shape.load(e.shape),void 0!==e.position&&(this.position={},void 0!==e.position.x&&(this.position.x=(0,a.setRangeValue)(e.position.x)),void 0!==e.position.y&&(this.position.y=(0,a.setRangeValue)(e.position.y))),void 0!==e.spawnColor&&(void 0===this.spawnColor&&(this.spawnColor=new a.AnimatableColor),this.spawnColor.load(e.spawnColor)),void 0!==e.startCount&&(this.startCount=e.startCount))}}var R;!function(e){e.emitter="emitter"}(R||(R={}));function k(e,t){e.color?e.color.value=t:e.color={value:t}}class z{constructor(e,t,r,i,s){this.emitters=t,this.container=r,this._destroy=()=>{this._mutationObserver?.disconnect(),this._mutationObserver=void 0,this._resizeObserver?.disconnect(),this._resizeObserver=void 0,this.emitters.removeEmitter(this),this._engine.dispatchEvent("emitterDestroyed",{container:this.container,data:{emitter:this}})},this._prepareToDie=()=>{if(this._paused)return;const e=void 0!==this.options.life?.duration?(0,a.getRangeValue)(this.options.life.duration):void 0;this.container.retina.reduceFactor&&(this._lifeCount>0||this._immortal)&&void 0!==e&&e>0&&(this._duration=e*a.millisecondsToSeconds)},this._setColorAnimation=(e,t,r,i=1)=>{const s=this.container;if(!e.enable)return t;const o=(0,a.randomInRange)(e.offset),d=(0,a.getRangeValue)(this.options.rate.delay)*a.millisecondsToSeconds/s.retina.reduceFactor;return(t+(0,a.getRangeValue)(e.speed??0)*s.fpsLimit/d+o*i)%r},this._engine=e,this._currentDuration=0,this._currentEmitDelay=0,this._currentSpawnDelay=0,this._initialPosition=s,i instanceof O?this.options=i:(this.options=new O,this.options.load(i)),this._spawnDelay=(0,a.getRangeValue)(this.options.life.delay??0)*a.millisecondsToSeconds/this.container.retina.reduceFactor,this.position=this._initialPosition??this._calcPosition(),this.name=this.options.name,this.fill=this.options.fill,this._firstSpawn=!this.options.life.wait,this._startParticlesAdded=!1;let o=(0,a.deepExtend)({},this.options.particles);if(o??={},o.move??={},o.move.direction??=this.options.direction,this.options.spawnColor&&(this.spawnColor=(0,a.rangeColorToHsl)(this._engine,this.options.spawnColor)),this._paused=!this.options.autoPlay,this._particlesOptions=o,this._size=this._calcSize(),this.size=(0,a.getSize)(this._size,this.container.canvas.size),this._lifeCount=this.options.life.count??-1,this._immortal=this._lifeCount<=0,this.options.domId){const e=document.getElementById(this.options.domId);e&&(this._mutationObserver=new MutationObserver((()=>{this.resize()})),this._resizeObserver=new ResizeObserver((()=>{this.resize()})),this._mutationObserver.observe(e,{attributes:!0,attributeFilter:["style","width","height"]}),this._resizeObserver.observe(e))}const d=this.options.shape,n=this._engine.emitterShapeManager?.getShapeGenerator(d.type);n&&(this._shape=n.generate(this.position,this.size,this.fill,d.options)),this._engine.dispatchEvent("emitterCreated",{container:r,data:{emitter:this}}),this.play()}externalPause(){this._paused=!0,this.pause()}externalPlay(){this._paused=!1,this.play()}async init(){await(this._shape?.init())}pause(){this._paused||delete this._emitDelay}play(){if(!this._paused&&this.container.retina.reduceFactor&&(this._lifeCount>0||this._immortal||!this.options.life.count)&&(this._firstSpawn||this._currentSpawnDelay>=(this._spawnDelay??0))){if(void 0===this._emitDelay){const e=(0,a.getRangeValue)(this.options.rate.delay);this._emitDelay=e*a.millisecondsToSeconds/this.container.retina.reduceFactor}(this._lifeCount>0||this._immortal)&&this._prepareToDie()}}resize(){const e=this._initialPosition;this.position=e&&(0,a.isPointInside)(e,this.container.canvas.size,a.Vector.origin)?e:this._calcPosition(),this._size=this._calcSize(),this.size=(0,a.getSize)(this._size,this.container.canvas.size),this._shape?.resize(this.position,this.size)}update(e){this._paused||(this._firstSpawn&&(this._firstSpawn=!1,this._currentSpawnDelay=this._spawnDelay??0,this._currentEmitDelay=this._emitDelay??0),this._startParticlesAdded||(this._startParticlesAdded=!0,this._emitParticles(this.options.startCount)),void 0!==this._duration&&(this._currentDuration+=e.value,this._currentDuration>=this._duration&&(this.pause(),void 0!==this._spawnDelay&&delete this._spawnDelay,this._immortal||this._lifeCount--,this._lifeCount>0||this._immortal?(this.position=this._calcPosition(),this._shape?.resize(this.position,this.size),this._spawnDelay=(0,a.getRangeValue)(this.options.life.delay??0)*a.millisecondsToSeconds/this.container.retina.reduceFactor):this._destroy(),this._currentDuration-=this._duration,delete this._duration)),void 0!==this._spawnDelay&&(this._currentSpawnDelay+=e.value,this._currentSpawnDelay>=this._spawnDelay&&(this._engine.dispatchEvent("emitterPlay",{container:this.container}),this.play(),this._currentSpawnDelay-=this._currentSpawnDelay,delete this._spawnDelay)),void 0!==this._emitDelay&&(this._currentEmitDelay+=e.value,this._currentEmitDelay>=this._emitDelay&&(this._emit(),this._currentEmitDelay-=this._emitDelay)))}_calcPosition(){if(this.options.domId){const e=document.getElementById(this.options.domId);if(e){const t=e.getBoundingClientRect(),r=this.container.retina.pixelRatio;return{x:(t.x+.5*t.width)*r,y:(t.y+.5*t.height)*r}}}return(0,a.calcPositionOrRandomFromSizeRanged)({size:this.container.canvas.size,position:this.options.position})}_calcSize(){const e=this.container;if(this.options.domId){const t=document.getElementById(this.options.domId);if(t){const r=t.getBoundingClientRect();return{width:r.width*e.retina.pixelRatio,height:r.height*e.retina.pixelRatio,mode:a.PixelMode.precise}}}return this.options.size??(()=>{const e=new C;return e.load({height:0,mode:a.PixelMode.percent,width:0}),e})()}_emit(){if(this._paused)return;const e=(0,a.getRangeValue)(this.options.rate.quantity);this._emitParticles(e)}_emitParticles(e){const t=(0,a.itemFromSingleOrMultiple)(this._particlesOptions);for(let r=0;r<e;r++){const e=(0,a.deepExtend)({},t);if(this.spawnColor){const t=this.options.spawnColor?.animation;if(t){const e={h:360,s:100,l:100},r=3.6;this.spawnColor.h=this._setColorAnimation(t.h,this.spawnColor.h,e.h,r),this.spawnColor.s=this._setColorAnimation(t.s,this.spawnColor.s,e.s),this.spawnColor.l=this._setColorAnimation(t.l,this.spawnColor.l,e.l)}k(e,this.spawnColor)}const r=this.options.shape;let i=this.position;if(this._shape){const t=this._shape.randomPosition();if(t){i=t.position;const s=r.replace;s.color&&t.color&&k(e,t.color),s.opacity&&(e.opacity?e.opacity.value=t.opacity:e.opacity={value:t.opacity})}else i=null}i&&this.container.particles.addParticle(i,e)}}}class V{constructor(e,t){this.container=t,this._engine=e,this.array=[],this.emitters=[],this.interactivityEmitters={random:{count:1,enable:!1},value:[]};t.getEmitter=e=>void 0===e||(0,a.isNumber)(e)?this.array[e??0]:this.array.find((t=>t.name===e)),t.addEmitter=async(e,t)=>this.addEmitter(e,t),t.removeEmitter=e=>{const r=t.getEmitter(e);r&&this.removeEmitter(r)},t.playEmitter=e=>{const r=t.getEmitter(e);r&&r.externalPlay()},t.pauseEmitter=e=>{const r=t.getEmitter(e);r&&r.externalPause()}}async addEmitter(e,t){const r=new O;r.load(e);const i=new z(this._engine,this,this.container,r,t);return await i.init(),this.array.push(i),i}handleClickMode(e){const t=this.emitters,r=this.interactivityEmitters;if(e!==R.emitter)return;let i;if(r&&(0,a.isArray)(r.value)){const e=0;if(r.value.length>e&&r.random.enable){i=[];const e=[];for(let t=0;t<r.random.count;t++){const s=(0,a.arrayRandomIndex)(r.value);e.includes(s)&&e.length<r.value.length?t--:(e.push(s),i.push((0,a.itemFromArray)(r.value,s)))}}else i=r.value}else i=r?.value;const s=i??t,o=this.container.interactivity.mouse.clickPosition;(0,a.executeOnSingleOrMultiple)(s,(async e=>{await this.addEmitter(e,o)}))}async init(){if(this.emitters=this.container.actualOptions.emitters,this.interactivityEmitters=this.container.actualOptions.interactivity.modes.emitters,this.emitters)if((0,a.isArray)(this.emitters))for(const e of this.emitters)await this.addEmitter(e);else await this.addEmitter(this.emitters)}pause(){for(const e of this.array)e.pause()}play(){for(const e of this.array)e.play()}removeEmitter(e){const t=this.array.indexOf(e);t>=0&&this.array.splice(t,1)}resize(){for(const e of this.array)e.resize()}stop(){this.array=[]}update(e){for(const t of this.array)t.update(e)}}class M{constructor(e){this._engine=e,this.id="emitters"}getPlugin(e){return Promise.resolve(new V(this._engine,e))}loadOptions(e,t){if(!this.needsPlugin(e)&&!this.needsPlugin(t))return;t?.emitters&&(e.emitters=(0,a.executeOnSingleOrMultiple)(t.emitters,(e=>{const t=new O;return t.load(e),t})));const r=t?.interactivity?.modes?.emitters;if(r)if((0,a.isArray)(r))e.interactivity.modes.emitters={random:{count:1,enable:!0},value:r.map((e=>{const t=new O;return t.load(e),t}))};else{const t=r;if(void 0!==t.value){const r=1;if((0,a.isArray)(t.value))e.interactivity.modes.emitters={random:{count:t.random.count??r,enable:t.random.enable??!1},value:t.value.map((e=>{const t=new O;return t.load(e),t}))};else{const i=new O;i.load(t.value),e.interactivity.modes.emitters={random:{count:t.random.count??r,enable:t.random.enable??!1},value:i}}}else{(e.interactivity.modes.emitters={random:{count:1,enable:!1},value:new O}).value.load(r)}}}needsPlugin(e){if(!e)return!1;const t=e.emitters;return(0,a.isArray)(t)&&!!t.length||void 0!==t||!!e.interactivity?.events?.onClick?.mode&&(0,a.isInArray)(R.emitter,e.interactivity.events.onClick.mode)}}const A=new Map;class I{constructor(e){this._engine=e}addShapeGenerator(e,t){this.getShapeGenerator(e)||A.set(e,t)}getShapeGenerator(e){return A.get(e)}getSupportedShapeGenerators(){return A.keys()}}async function B(e,t=!0){(0,a.assertValidVersion)(e,"3.7.1"),e.emitterShapeManager||(e.emitterShapeManager=new I(e)),e.addEmitterShapeGenerator||(e.addEmitterShapeGenerator=(t,r)=>{e.emitterShapeManager?.addShapeGenerator(t,r)});const r=new M(e);await e.addPlugin(r,t)}class F extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("onClick","Click Events"),this.options=this.group.data,this.addProperties()}addProperties(){this.group.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()}));const e=this.group.addProperty("mode","Mode",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:"attract"},{value:"bubble"},{value:"pause"},{value:"push"},{value:"remove"},{value:"repulse"},{value:"trail"}]);if(void 0!==G){const t="Absorbers";e.addItemGroup(t),e.addItem("absorber",void 0,t)}if(void 0!==B){const t="Emitters";e.addItemGroup(t),e.addItem("emitter",void 0,t)}}}class L extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("onDiv","Divs Events"),this.options=this.group.data,this.addDivs(),this.options()instanceof Array&&this.group.addButton("addDiv","Add Div",!1).click((()=>{const e=this.options(),t=this.group.addGroup(e.length.toString(10),`Div ${e.length+1}`,!0,this.options);this.addDiv(t),this.particles().refresh()}))}addDiv(e){const t=e.data;if(t().selectors instanceof Array){const r=e.addGroup("selectors","Selectors");r.addButton("addSelector","Add Selector",!1).click((()=>{const e=t().selectors;r.addProperty(e.length.toString(10),`Selector ${e.length+1}`,d.EditorType.string).change((()=>{this.particles().refresh()})),this.particles().refresh()}))}else e.addProperty("selectors","Selectors",d.EditorType.string).change((()=>{this.particles().refresh()}));e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})).step(.01).min(0).max(1),this.group.addProperty("mode","Mode",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:"bounce"},{value:"bubble"},{value:"repulse"}]),e.addProperty("type","Type",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:a.DivType.circle},{value:a.DivType.rectangle}])}addDivs(){const e=this.options;if(e()instanceof Array)for(let t=0;t<e.length;t++){const r=this.group.addGroup(t.toString(10),`Div_${t+1}`,!0,e);this.addDiv(r)}else this.addDiv(this.group)}}class j extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("onHover","Hover Events"),this.options=this.group.data,this.addParallax(),this.addProperties()}addParallax(){const e=this.group.addGroup("parallax","Parallax");e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("force","Force",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("smooth","Smooth",d.EditorType.number).change((()=>{this.particles().refresh()}))}addProperties(){this.group.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("mode","Mode",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:"attract"},{value:"bubble"},{value:"connect"},{value:"grab"},{value:"light"},{value:"repulse"},{value:"slow"},{value:"trail"}])}}class q extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("events","Events"),this.options=this.group.data,this.addClick(),this.addDivs(),this.addHover(),this.addProperties()}addClick(){new F(this.particles).addToGroup(this.group)}addDivs(){new L(this.particles).addToGroup(this.group)}addHover(){new j(this.particles).addToGroup(this.group)}addProperties(){this.group.addProperty("resize","Resize",d.EditorType.boolean).change((()=>{this.particles().refresh()}))}}class N extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("bounce","Bounce"),this.options=this.group.data,this.addFactors()}addFactor(e,t){const r=this.group.addGroup(e,t),i=r.addGroup("random","Random");i.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),i.addProperty("minimumValue","Minimum Value",d.EditorType.number).change((()=>{this.particles().refresh()})),r.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}addFactors(){this.addFactor("horizontal","Horizontal"),this.addFactor("vertical","Vertical")}}class H extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("collisions","Collisions"),this.options=this.group.data,this.addBounce(),this.addOverlap(),this.addProperties()}addBounce(){const e=this.group.addGroup("bounce","Bounce");this.addBounceFactor(e,"horizontal","Horizontal"),this.addBounceFactor(e,"vertical","Vertical")}addBounceFactor(e,t,r){const i=e.addGroup(t,r),s=i.addGroup("random","Random");s.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),s.addProperty("minimumValue","Minimum Value",d.EditorType.number).change((()=>{this.particles().refresh()})),i.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}addOverlap(){const e=this.group.addGroup("overlap","Overlap");e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("retries","Retries",d.EditorType.number).change((()=>{this.particles().refresh()}))}addProperties(){this.group.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("mode","Mode",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:a.CollisionMode.absorb},{value:a.CollisionMode.bounce},{value:a.CollisionMode.destroy}])}}class W extends p{constructor(e){super(e)}addToGroup(e,t){this.group=e.addGroup("color","Color",!0,t),this.options=this.group.data,this.addAnimation(),this.addProperties()}addAnimation(){const e=this.group.addGroup("animation","Animation");e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("speed","Speed",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("sync","Sync",d.EditorType.boolean).change((()=>{this.particles().refresh()}))}addProperties(){this.group.addProperty("value","Value",d.EditorType.color).change((()=>{this.particles().refresh()}))}}class Q extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("destroy","Destroy"),this.options=this.group.data,this.addSplit(),this.addProperties()}addProperties(){this.group.addProperty("mode","Mode",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:"none"},{value:"split"}])}addSplit(){const e=this.group.addGroup("split","Split"),t=e.addGroup("factor","Factor"),r=t.addGroup("random","Random");r.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),r.addProperty("minimumValue","Minimum Value",d.EditorType.number).change((()=>{this.particles().refresh()})),t.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}));const i=e.addGroup("rate","Rate"),s=i.addGroup("random","Random");s.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),s.addProperty("minimumValue","Minimum Value",d.EditorType.number).change((()=>{this.particles().refresh()})),i.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("count","Count",d.EditorType.number).change((()=>{this.particles().refresh()}))}}class $ extends p{constructor(e){super(e)}addToGroup(e,t){this.group=e.addGroup("life","Life",!0,t),this.options=this.group.data,this.addDelay(),this.addDuration(),this.addProperties()}addDelay(){const e=this.group.addGroup("delay","Delay"),t=e.addGroup("random","Random");t.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),t.addProperty("minimumValue","MinimumValue",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("sync","Sync",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}addDuration(){const e=this.group.addGroup("duration","Duration"),t=e.addGroup("random","Random");t.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),t.addProperty("minimumValue","MinimumValue",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("sync","Sync",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}addProperties(){this.group.addProperty("count","Count",d.EditorType.number).change((()=>{this.particles().refresh()}))}}class K extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("links","Links"),this.options=this.group.data,this.addShadow(),this.addTriangles(),this.addProperties()}addProperties(){const e=()=>this.options(),t=e(),r="string"==typeof t.color?t.color:t.color?.value;this.group.addProperty("blink","Blink",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("color","Color",d.EditorType.color,r,!1).change((t=>{const r=e();"string"==typeof t&&("string"==typeof r.color?r.color=t:r.color.value=t,this.particles().refresh())})),this.group.addProperty("consent","Consent",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("distance","Distance",d.EditorType.number).change((()=>{this.particles().refresh()})),this.group.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("frequency","Frequency",d.EditorType.number).min(0).max(1).step(.01).change((()=>{this.particles().refresh()})),this.group.addProperty("id","Id",d.EditorType.string).change((()=>{this.particles().refresh()})),this.group.addProperty("opacity","Opacity",d.EditorType.number).change((()=>{this.particles().refresh()})).step(.01).min(0).max(1),this.group.addProperty("warp","Warp",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("width","Width",d.EditorType.number).change((()=>{this.particles().refresh()}))}addShadow(){const e=this.group.addGroup("shadow","Shadow"),t=e.data,r=t(),i="string"==typeof r.color?r.color:r.color?.value;e.addProperty("blur","Blur",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("color","Color",d.EditorType.color,i,!1).change((e=>{const r=t();"string"==typeof e&&("string"==typeof r.color?r.color=e:void 0===r.color?r.color={value:e}:r.color.value=e),this.particles().refresh()})),e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()}))}addTriangles(){const e=this.group.addGroup("triangles","Triangles"),t=()=>this.options().triangles,r=t(),i="string"==typeof r?.color?r.color:r?.color?.value;e.addProperty("color","Color",d.EditorType.color,i,!1).change((e=>{const r=t();"string"==typeof e&&("string"==typeof r.color?r.color=e:void 0===r.color?r.color={value:e}:r.color.value=e),this.particles().refresh()})),e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("frequency","Frequency",d.EditorType.number).min(0).max(1).step(.01).change((()=>{this.particles().refresh()})),e.addProperty("opacity","Opacity",d.EditorType.number).change((()=>{this.particles().refresh()})).step(.01).min(0).max(1)}}class U extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("move","Move"),this.options=this.group.data,this.addAngle(),this.addAttract(),this.addDistance(),this.addGravity(),this.addOutModes(),this.addPath(),this.addTrail(),this.addProperties()}addAngle(){const e=this.group.addGroup("angle","Angle");e.addProperty("offset","Offset",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}addAttract(){const e=this.group.addGroup("attract","Attract"),t=e.addGroup("rotate","Rotate",!1);t.addProperty("x","X",d.EditorType.number).change((()=>{this.particles().refresh()})),t.addProperty("y","Y",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()}))}addDistance(){const e=this.group.addGroup("distance","Distance");e.addProperty("horizontal","Horizontal",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("vertical","Vertical",d.EditorType.number).change((()=>{this.particles().refresh()}))}addGravity(){const e=this.group.addGroup("gravity","Gravity");e.addProperty("acceleration","Acceleration",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("maxSpeed","Max Speed",d.EditorType.number).change((()=>{this.particles().refresh()}))}addOutModes(){const e=this.group.addGroup("outModes","Out Modes"),t=[{value:a.OutMode.bounce},{value:a.OutMode.destroy},{value:a.OutMode.none},{value:a.OutMode.split},{value:a.OutMode.out}];e.addProperty("bottom","Bottom",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems(t),e.addProperty("default","Default",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems(t),e.addProperty("left","Left",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems(t),e.addProperty("right","Right",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems(t),e.addProperty("top","Top",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems(t)}addPath(){const e=this.group.addGroup("path","Path"),t=e.addGroup("delay","Delay");t.addProperty("value","value",d.EditorType.number).change((()=>{this.particles().refresh()}));const r=t.addGroup("random","Random");r.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),r.addProperty("minimumValue","Minimum Value",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("clamp","Clamp",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("generator","Generator",d.EditorType.string).change((()=>{this.particles().refresh()}))}addProperties(){const e=this.group;e.addProperty("direction","Direction",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:a.MoveDirection.bottom},{value:a.MoveDirection.bottomLeft},{value:a.MoveDirection.bottomRight},{value:a.MoveDirection.left},{value:a.MoveDirection.none},{value:a.MoveDirection.right},{value:a.MoveDirection.top},{value:a.MoveDirection.topLeft},{value:a.MoveDirection.topRight}]),e.addProperty("drift","Drift",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("random","Random",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("size","Size",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("speed","Speed",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("straight","Straight",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("vibrate","Vibrate",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("warp","Warp",d.EditorType.boolean).change((()=>{this.particles().refresh()}))}addTrail(){const e=this.group.addGroup("trail","Trail"),t=e.data,r=t(),i="string"==typeof r.fill?.color?r.fill.color:r.fill?.color?.value;e.addGroup("fill","Fill").addProperty("color","Color",d.EditorType.color,i,!1).change((e=>{const r=t();"string"==typeof e&&("string"==typeof r.fill.color?r.fill.color=e:void 0===r.fill.color?r.fill.color={value:e}:r.fill.color.value=e),this.particles().refresh()})),e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("length","Length",d.EditorType.number).change((()=>{this.particles().refresh()}))}}class X extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("number","Number"),this.options=this.group.data,this.addDensity(),this.addProperties()}addDensity(){const e=this.group.addGroup("density","Density");e.addProperty("area","Area",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("factor","Factor",d.EditorType.number).change((()=>{this.particles().refresh()}))}addProperties(){this.group.addProperty("limit","Limit",d.EditorType.number).change((()=>{this.particles().refresh()})),this.group.addProperty("max","Max",d.EditorType.number).change((()=>{this.particles().refresh()})),this.group.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}}class Y extends p{constructor(e){super(e)}addToGroup(e,t){this.group=e.addGroup("opacity","Opacity",!0,t),this.options=this.group.data,this.addAnimation(),this.addRandom(),this.addProperties()}addAnimation(){const e=this.group.addGroup("animation","Animation");e.addProperty("destroy","Destroy",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:a.DestroyType.max},{value:a.DestroyType.min},{value:a.DestroyType.none}]),e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("minimumValue","Minimum Value",d.EditorType.number).change((()=>{this.particles().refresh()})).min(0).max(0).step(.01),e.addProperty("speed","Speed",d.EditorType.number).change((()=>{this.particles().refresh()})).step(.01),e.addProperty("startValue","Start Value",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:a.StartValueType.max},{value:a.StartValueType.min},{value:a.StartValueType.random}]),e.addProperty("sync","Sync",d.EditorType.boolean).change((()=>{this.particles().refresh()}))}addProperties(){this.group.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()})).min(0).max(1).step(.01)}addRandom(){const e=this.group.addGroup("random","Random");e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("minimumValue","Minimum Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}}class J extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("roll","Roll"),this.options=this.group.data,this.addDarken(),this.addEnlighten(),this.addProperties()}addDarken(){const e=this.group.addGroup("darken","Darken");e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}addEnlighten(){const e=this.group.addGroup("enlighten","Enlighten");e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}addProperties(){const e=this.options,t=e(),r="string"==typeof t.backColor?t.backColor:t.backColor instanceof Array?t.backColor[0]:t.backColor?.value;this.group.addProperty("backColor","Back Color",d.EditorType.color,r,!1).change((t=>{const r=e();"string"==typeof t&&("string"==typeof r.backColor?r.backColor=t:void 0===r.backColor||r.backColor instanceof Array?r.backColor={value:t}:r.backColor.value=t),this.particles().refresh()})),this.group.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("speed","Speed",d.EditorType.number).change((()=>{this.particles().refresh()}))}}class Z extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("rotate","Rotate"),this.options=this.group.data,this.addAnimation(),this.addProperties()}addAnimation(){const e=this.group.addGroup("animation","Animation");e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("speed","Speed",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("sync","Sync",d.EditorType.boolean).change((()=>{this.particles().refresh()}))}addProperties(){this.group.addProperty("direction","Direction",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:a.RotateDirection.clockwise},{value:a.RotateDirection.counterClockwise},{value:a.RotateDirection.random}]),this.group.addProperty("path","Path",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("random","Random",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}}class ee extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("shadow","Shadow"),this.options=this.group.data,this.addOffset(),this.addProperties()}addOffset(){const e=this.group.addGroup("offset","Offset");e.addProperty("x","X",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("y","Y",d.EditorType.number).change((()=>{this.particles().refresh()}))}addProperties(){const e=(()=>this.options())(),t="string"==typeof e.color?e.color:e.color?.value;this.group.addProperty("blur","Blur",d.EditorType.number).change((()=>{this.particles().refresh()})),this.group.addProperty("color","Color",d.EditorType.color,t,!1).change((t=>{"string"==typeof t&&("string"==typeof e.color?e.color=t:e.color.value=t),this.particles().refresh()})),this.group.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()}))}}class te extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("shape","Shape"),this.options=this.group.data,this.addProperties()}addProperties(){const e=this.group.addProperty("type","Type",d.EditorType.select).change((()=>{this.particles().refresh()}));for(const t of this.particles().shapeDrawers.keys())e.addItem(t)}}class re extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("size","Size"),this.options=this.group.data,this.addAnimation(),this.addRandom(),this.addProperties()}addAnimation(){const e=this.group.addGroup("animation","Animation");e.addProperty("destroy","Destroy",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:a.DestroyType.max},{value:a.DestroyType.min},{value:a.DestroyType.none}]),e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("minimumValue","Minimum Value",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("speed","Speed",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("startValue","Start Value",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:a.StartValueType.max},{value:a.StartValueType.min},{value:a.StartValueType.random}]),e.addProperty("sync","Sync",d.EditorType.boolean).change((()=>{this.particles().refresh()}))}addProperties(){this.group.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}addRandom(){const e=this.group.addGroup("random","Random");e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("minimumValue","Minimum Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}}class ie extends p{constructor(e){super(e)}addToGroup(e){if(this.group=e.addGroup("stroke","Stroke"),this.options=this.group.data,this.options()instanceof Array)for(let e=0;e<this.options.length;e++){const t=this.group.addGroup(e.toString(10),`Stroke_${e+1}`,!0,this.options);this.addStroke(t)}else this.addStroke(this.group)}addStroke(e){const t=e.data,r=t();void 0===r.color&&(r.color={value:"",animation:{count:0,enable:!1,offset:{max:0,min:0},speed:0,decay:0,sync:!1}});new W(this.particles).addToGroup(e,t),e.addProperty("opacity","Opacity",d.EditorType.number).change((()=>{this.particles().refresh()})).step(.01).min(0).max(1),e.addProperty("width","Width",d.EditorType.number).change((()=>{this.particles().refresh()}))}}class se extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("tilt","Tilt"),this.options=this.group.data,this.addAnimation(),this.addProperties()}addAnimation(){const e=this.group.addGroup("animation","Animation");e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("speed","Speed",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("sync","Sync",d.EditorType.boolean).change((()=>{this.particles().refresh()}))}addProperties(){this.group.addProperty("direction","Direction",d.EditorType.select).change((()=>{this.particles().refresh()})).addItems([{value:"clockwise"},{value:"counterClockwise"},{value:"random"}]),this.group.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("random","Random",d.EditorType.boolean).change((()=>{this.particles().refresh()})),this.group.addProperty("value","Value",d.EditorType.number).change((()=>{this.particles().refresh()}))}}class oe extends p{constructor(e){super(e)}addToGroup(e,t){this.group=e.addGroup("twinkle","Twinkle",!0,t),this.options=this.group.data,this.addTwinkle()}addTwinkle(){this.addTwinkleValues(this.group.addGroup("lines","Lines")),this.addTwinkleValues(this.group.addGroup("particles","Particles"))}addTwinkleValues(e){const t=()=>e.data(),r=t(),i="string"==typeof r.color?r.color:r.color?.value;e.addProperty("color","Color",d.EditorType.color,i,!1).change((e=>{const r=t();"string"==typeof e&&("string"==typeof r.color?r.color=e:r.color={value:e}),this.particles().refresh()})),e.addProperty("enable","Enable",d.EditorType.boolean).change((()=>{this.particles().refresh()})),e.addProperty("frequency","Frequency",d.EditorType.number).change((()=>{this.particles().refresh()})),e.addProperty("opacity","Opacity",d.EditorType.number).change((()=>{this.particles().refresh()})).step(.01).min(0).max(1)}}class ae extends p{constructor(e){super(e)}addToGroup(e){this.group=e.addGroup("wobble","Wobble"),this.options=this.group.data,this.addProperties()}addProperties(){this.group.addProperty("distance","Dis