(()=>{var e;(e=jQuery)(function(){if(document.querySelector(".pr_greetings_template"))try{!function(){var t=e(".pr_greetings_template select").find(":selected").val();function _(){e(".is_opt_in").is(":checked")?e(".pr_opt_in ").show(200):e(".pr_opt_in ").hide(200)}"no"==t||""==t?e(".g_content_collapsible").hide():e(".g_content_collapsible").show(),"greetings-1"==t&&(e(".ctc_greetings_settings.ctc_g_1").show(),e(".pr_ht_ctc_greetings_1").show(),e(".pr_ht_ctc_greetings_settings").show(),e(".ctc_greetings_notes").show(),_()),"greetings-2"==t&&(e(".ctc_greetings_settings.ctc_g_2").show(),e(".pr_ht_ctc_greetings_2").show(),e(".pr_ht_ctc_greetings_settings").show(),e(".ctc_greetings_notes").show(),_()),e(".pr_greetings_template select").on("change",function(t){var n=t.target.value;"no"==n?(e(".g_content_collapsible").hide(100),e(" .ctc_greetings_settings").hide()):(e(".g_content_collapsible").show(),"greetings-2"!=n&&"greetings-1"!=n||e(" .ctc_greetings_settings").hide(),e(".ctc_greetings_notes").show(),"greetings-1"==n&&(e(".ctc_greetings_settings.ctc_g_1").show(100),e(".pr_ht_ctc_greetings_1").show(100),_()),"greetings-2"==n&&(e(".ctc_greetings_settings.ctc_g_2").show(100),e(".pr_ht_ctc_greetings_2").show(100),_()),e(".pr_ht_ctc_greetings_settings").show())}),e(".is_opt_in").on("change",function(e){_()})}()}catch(e){}if(document.querySelector(".ctc-admin-greetings-page")||document.querySelector(".ctc-admin-woo-page"))try{!function(){var e=1,t=1e3,_=28;function n(){if(document.getElementById("header_content_ifr"))try{i()}catch(e){}else++e<_&&setTimeout(n,t)}function i(){try{for(var e=0;e<tinyMCE.editors.length;e++){var t=tinyMCE.editors[e];t.dom.setStyle(t.getBody(),"backgroundColor","#26a69a")}}catch(e){}}n()}()}catch(e){}!function(){var t;function _(){""==e(".g_header_image").val()?(e(".row_g_header_online_status").hide(),e(".row_g_header_online_status_color").hide()):(e(".row_g_header_online_status").show(),e(".g_header_online_status").is(":checked")?e(".row_g_header_online_status_color").show():e(".row_g_header_online_status_color").hide())}e(".ctc_add_image_wp").on("click",function(n){n.preventDefault(),t||(t=wp.media.frames.file_frame=wp.media({title:"Select Header Image",button:{text:"Select"},multiple:!1})).on("select",function(){if(attachment=t.state().get("selection").first().toJSON(),"undefined"==typeof attachment)return!0;image_url=attachment.url,e(".g_header_image").val(image_url),e(".g_header_image_preview").attr("src",image_url),e(".g_header_image_preview").show(),e(".ctc_remove_image_wp").show(),_(),document.dispatchEvent(new CustomEvent("ht_ctc_event_greetings_header_image",{detail:image_url}))}),t.open()}),e(".ctc_remove_image_wp").on("click",function(t){t.preventDefault(),e(".g_header_image").val(""),e(".g_header_image_preview").hide(),e(".ctc_remove_image_wp").hide(),_()}),_(),e(".g_header_online_status").on("change",function(){e(".g_header_online_status").is(":checked")?e(".row_g_header_online_status_color").show():e(".row_g_header_online_status_color").hide()})}()})})();