(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}!function(){if(function(){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(e){}return e}()){var t=EventTarget.prototype.addEventListener;EventTarget.prototype.addEventListener=function(o,n,r){"touchstart"!==o&&"touchmove"!==o||("object"===e(r)?r.passive=!0:r={passive:!0}),t.call(this,o,n,r)}}}(),document.addEventListener("DOMContentLoaded",(function(){!function(e){function t(){var t=e(".noahs_page_builder_codemirror"),o=t.closest("form").find('input[name="wid"]').val();t.each((function(){var e=CodeMirror.fromTextArea(this,{mode:"css",lineNumbers:!0,theme:"material-darker",extraKeys:{"Ctrl-Space":"autocomplete"}});o&&e.on("change",(function(e){var n=e.getValue();t.val(n),modificarEstilo(t,o),modificarJson(t,o)}))}))}new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){1===e.nodeType&&e.classList.contains("noahs_page_builder-modal")&&setTimeout((function(){t()}),50)}))}))})).observe(document.body,{childList:!0,subtree:!0}),e(window).on("load",(function(){setTimeout((function(){t()}),50)}))}(jQuery,Drupal,drupalSettings),function(e,t,o,n){var r=(null==o||null===(n=o.noahs_page_builder)||void 0===n?void 0:n.pallete_color)||[];function a(t){e(document).on("touchstart",".form-control-color",(function(e){e.passive=!0})),document.querySelectorAll(".form-control-color").forEach((function(o){o.dataset.colorFieldSpectrum||(o.dataset.colorFieldSpectrum=!0,e(o).spectrum({type:"component",preferredFormat:"hex",showInput:!0,showInitial:!0,showAlpha:!0,hideAfterPaletteSelect:!0,showPalette:!0,showSelectionPalette:!0,palette:r,appendTo:o.parentElement,allowEmpty:!0,localStorageKey:"spectrum.default",move:function(n){e(o).closest("#noahs_page_builder_edit_widget_form").length&&(modificarEstilo(o,t),modificarJson(o,t)),e(o).closest("#noahs_page_builder_sttings_page_form").length&&modifyPageStyles(),e(o).closest("#noahs_settings_form").length&&modifyNoahsSettingstyles(o)}}))})),document.querySelectorAll(".form-control-color-alpha").forEach((function(o){o.dataset.colorFieldSpectrum||(o.dataset.colorFieldSpectrum=!0,e(o).spectrum({type:"component",preferredFormat:"hex",showInput:!0,showInitial:!0,showAlpha:!0,showPalette:!0,showSelectionPalette:!0,palette:r,appendTo:o.parentElement,localStorageKey:"spectrum.overlay",move:function(e){modificarEstilo(o,t)}}))}))}new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){1===e.nodeType&&e.classList.contains("noahs_page_builder-modal")&&setTimeout((function(){a(document.querySelector('input[name="wid"]').value)}),50)}))}))})).observe(document.body,{childList:!0,subtree:!0}),e(document).ready((function(){a()}))}(jQuery,Drupal,drupalSettings)}))})();