"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[2032],{2032(e,t,s){s.d(t,{loadThemesPlugin:()=>d});var n,a=s(3199);!function(e){e.any="any",e.dark="dark",e.light="light"}(n||(n={}));class i{auto=!1;mode=n.any;value=!1;load(e){(0,a.kZJ)(e)||((0,a.kBH)(this,"auto",e.auto),(0,a.kBH)(this,"mode",e.mode),(0,a.kBH)(this,"value",e.value))}}class l{default=new i;name="";options;load(e){(0,a.kZJ)(e)||((0,a.kBH)(this,"name",e.name),this.default.load(e.default),void 0!==e.options&&(this.options=(0,a.zwS)({},e.options)))}}class o{id="theme";async getPlugin(e){const{ThemesPluginInstance:t}=await s.e(3862).then(s.bind(s,3862));return new t(e)}loadOptions(e,t,s){if(!this.needsPlugin(t)&&!this.needsPlugin(s))return;const i=e=>{if(t.themes)return t.themes.find(t=>t.default.value&&t.default.mode===e)??t.themes.find(e=>e.default.value&&e.default.mode===n.any)};if(t.findDefaultTheme=i,t.setTheme=e=>{if(t.themes)if(e){const s=t.themes.find(t=>t.name===e);s&&t.load(s.options)}else{const e=(0,a.lVH)("(prefers-color-scheme: dark)"),s=e?.matches,l=i(s?n.dark:n.light);l&&t.load(l.options)}},t.themes??=[],void 0!==s?.themes)for(const e of s.themes){if(!e)continue;const s=t.themes.find(t=>t.name===e.name);if(s)s.load(e);else{const s=new l;s.load(e),t.themes.push(s)}}t.defaultThemes.dark=i(n.dark)?.name,t.defaultThemes.light=i(n.light)?.name}needsPlugin(e){return!!e?.themes?.length}}async function d(e){e.checkVersion("4.1.3"),await e.pluginManager.register(e=>{e.pluginManager.addPlugin(new o)})}}}]);