(()=>{function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},r(t)}function t(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=Array(t);e<t;e++)n[e]=r[e];return n}function e(r,t){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(r,t).enumerable}))),e.push.apply(e,n)}return e}function n(r){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?e(Object(n),!0).forEach((function(t){s(r,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(n)):e(Object(n)).forEach((function(t){Object.defineProperty(r,t,Object.getOwnPropertyDescriptor(n,t))}))}return r}function s(t,e,n){return(e=function(t){var e=function(t){if("object"!=r(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==r(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}!function(){"use strict";window.AdvGBPresetData={presets:"undefined"!=typeof advgb_block_controls_vars&&advgb_block_controls_vars.presets?advgb_block_controls_vars.presets:[],subscribers:[],subscribe:function(r){this.subscribers.push(r)},unsubscribe:function(r){this.subscribers=this.subscribers.filter((function(t){return t!==r}))},notifySubscribers:function(){var r=this;this.subscribers.forEach((function(t){try{t(r.presets)}catch(r){console.error("Error in preset data subscriber:",r)}}))},updatePresets:function(r){this.presets=Array.isArray(r)?r:[],"undefined"!=typeof advgb_block_controls_vars&&(advgb_block_controls_vars.presets=this.presets),this.notifySubscribers()},addPreset:function(r){r&&r.id&&(this.presets.push(r),this.updateGlobalVar(),this.notifySubscribers())},updatePreset:function(r,t){var e=this.presets.findIndex((function(t){return t.id===r}));-1!==e&&(this.presets[e]=n(n({},this.presets[e]),t),this.updateGlobalVar(),this.notifySubscribers())},removePreset:function(r){this.presets=this.presets.filter((function(t){return t.id!==r})),this.updateGlobalVar(),this.notifySubscribers()},getPreset:function(r){return this.presets.find((function(t){return t.id===r}))},getAllPresets:function(){return function(r){if(Array.isArray(r))return t(r)}(r=this.presets)||function(r){if("undefined"!=typeof Symbol&&null!=r[Symbol.iterator]||null!=r["@@iterator"])return Array.from(r)}(r)||function(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}();var r},updateGlobalVar:function(){"undefined"!=typeof advgb_block_controls_vars&&(advgb_block_controls_vars.presets=this.presets)}},"undefined"!=typeof advgb_block_controls_vars&&advgb_block_controls_vars.presets&&(window.AdvGBPresetData.presets=Array.isArray(advgb_block_controls_vars.presets)?advgb_block_controls_vars.presets:[])}()})();
//# sourceMappingURL=preset-data-manager.js.map