"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[5419],{5419:(e,t,i)=>{i.d(t,{loadMotionPlugin:()=>c});class n{constructor(){this.factor=4,this.value=!0}load(e){e&&(void 0!==e.factor&&(this.factor=e.factor),void 0!==e.value&&(this.value=e.value))}}class a{constructor(){this.disable=!1,this.reduce=new n}load(e){e&&(void 0!==e.disable&&(this.disable=e.disable),this.reduce.load(e.reduce))}}var s=i(9201);class o{constructor(e,t){this._handleMotionChange=e=>{const t=this._container,i=t.actualOptions.motion;i&&(t.retina.reduceFactor=e.matches?i.disable?0:i.reduce.value?1/i.reduce.factor:1:1)},this._container=e,this._engine=t}async init(){const e=this._container,t=e.actualOptions.motion;if(!t||!t.disable&&!t.reduce.value)return void(e.retina.reduceFactor=1);const i=(0,s.HY)("(prefers-reduced-motion: reduce)");if(!i)return void(e.retina.reduceFactor=1);this._handleMotionChange(i);const n=async()=>{this._handleMotionChange(i);try{await e.refresh()}catch{}};void 0!==i.addEventListener?i.addEventListener("change",n):void 0!==i.addListener&&i.addListener(n)}}class r{constructor(e){this.id="motion",this._engine=e}getPlugin(e){return new o(e,this._engine)}loadOptions(e,t){if(!this.needsPlugin())return;let i=e.motion;i?.load||(e.motion=i=new a),i.load(t?.motion)}needsPlugin(){return!0}}async function c(e,t=!0){await e.addPlugin(new r(e),t)}}}]);