HEX
Server: Apache/2.4.54 (Debian)
System: Linux a5825d2beacc 4.15.0-197-generic #208-Ubuntu SMP Tue Nov 1 17:23:37 UTC 2022 x86_64
User: root (0)
PHP: 8.1.14
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/complianz-gdpr/assets/js/admin.min.js
jQuery(document).ready(function(m){"use strict";function i(t,c){let i=0,a=c.getAttribute("data-cmplz_loadmore_count");c.querySelectorAll(".cmplz-checkbox-container").forEach(e=>{i++,t?(c.querySelector(".cmplz_load_more .cmplz-load-less").style.display="block",c.querySelector(".cmplz_load_more .cmplz-load-more").style.display="none",e.style.display="block"):i>a&&(c.querySelector(".cmplz_load_more .cmplz-load-more").style.display="block",c.querySelector(".cmplz_load_more .cmplz-load-less").style.display="none",e.style.display="none")})}document.querySelector(".cmplz-multicheckbox-loadmore")&&(document.querySelectorAll(".cmplz-multicheckbox-loadmore").forEach(e=>{e.setAttribute("data-loadmore-state","hidden"),i(!1,e)}),document.addEventListener("click",t=>{if(t.target.closest(".cmplz_load_more")){t.preventDefault();let e=t.target;var t="hidden"===(e=e.closest(".cmplz-multicheckbox-loadmore")).getAttribute("data-loadmore-state"),c=t?"visible":"hidden";e.setAttribute("data-loadmore-state",c),i(t,e)}})),m(document).on("click",".cmplz-install-burst",function(){var c=m("button.cmplz-install-burst");c.html('<div class="cmplz-loader"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>'),c.attr("disabled","disabled"),m.ajax({type:"GET",url:complianz_admin.admin_url,dataType:"json",data:{step:"download",action:"cmplz_install_plugin"},success:function(e){m.ajax({type:"GET",url:complianz_admin.admin_url,dataType:"json",data:{step:"activate",action:"cmplz_install_plugin"},success:function(e){var t=m(".cmplz-completed-text").html();c.html(t)}})}})}),m(document).on("click",".regions .cmplz-checkbox-container input",function(){e()});m(".regions .cmplz-checkbox-container input");function e(){m("select[name=cmplz_other_region_behaviour]").length&&m(".regions .cmplz-field").find(":checkbox").each(function(e){var t=m(this).attr("name").replace("]","").replace("cmplz_regions[",""),t=m("select[name=cmplz_other_region_behaviour] option[value="+t+"]");m(this).is(":checked")?t.removeAttr("disabled"):t.attr("disabled","disabled")})}e(),m(document).on("click",".cmplz-copy-shortcode",function(){let c=m(this),t;var e=m(this).children(".cmplz-copy-shortcode-text"),i=(m(this).addClass("cmplz-click-animation"),m("<input>"));m("body").append(i),i.val(e.text()).select();try{t=document.execCommand("copy")}catch(e){t=!1}if(i.remove(),t){let e=m(this).children(".cmplz-tooltip"),t=e.attr("cmplz-tooltip");e.attr("cmplz-tooltip",complianz_admin.copy_text),setTimeout(function(){c.removeClass("cmplz-click-animation"),e.attr("cmplz-tooltip",t)},2e3)}});var t=m(".cmplz_save_localstorage");function c(){m(".multiple-field").each(function(){var e=!0,t=(m(this).find("input[type=text]").each(function(){""===m(this).val()&&(e=!1)}),m(this).find("textarea").each(function(){""===m(this).val()&&(e=!1)}),m(this).closest(".cmplz-panel").find(".cmplz-multiple-field-validation i"));e?(t.removeClass("fa-times"),t.addClass("fa-check")):(t.addClass("fa-times"),t.removeClass("fa-check"))})}function a(){m(".cmplz-validate-multicheckbox").each(function(e){var t=[],c=!0,i=(m(this).find(":checkbox").each(function(e){t.push(m(this)),m(this).is(":checked")&&(c=!1)}),m(this).closest(".field-group").find(".cmplz-label"));c?(i.removeClass("valid-multicheckbox"),i.addClass("invalid-multicheckbox"),m.each(t,function(e,t){t.prop("required",!0),t.addClass("is-required")})):(i.removeClass("invalid-multicheckbox"),i.addClass("valid-multicheckbox"),m.each(t,function(e,t){t.prop("required",!1),t.removeClass("is-required")}))}),l()}function l(){var d,r=!0;m(".condition-check-1").each(function(e){for(var t=1;t<4;t++){var c="cmplz_"+m(this).data("condition-question-"+t);if("cmplz_undefined"==c)return;var i=m(this).data("condition-answer-"+t),a=m(this).find("input[type=checkbox]"),l=((a=(a=(a=a.length?a:m(this).find("input")).length?a:m(this).find("textarea")).length?a:m(this).find("select")).length&&a[0].hasAttribute("required")&&a.addClass("is-required"),r=-1===(i+="").indexOf("NOT ")||(i=i.replace("NOT ",""),!1),[]),l=-1!==i.indexOf(" OR ")?i.split(" OR "):[i],n=m(this),s=m(this).data("fieldname"),o=!1;if(l.forEach(function(e){d=function(e){{var t;return"text"==m('input[name="'+e+'"]').attr("type")?m("input[name^="+e+"]").val():(t=[],m('input[name="'+e+'"]:checked').each(function(){t[t.length]=m(this).val()}),t)}}(c),m('select[name="'+c+'"]').length&&(d=Array(m("select[name="+c+"]").val())),m("input[name='"+c+"["+e+"]']").length&&(d=(o=!!m("input[name='"+c+"["+e+"]']").is(":checked"),[])),r?o||-1!=d.indexOf(e)||d==e?(n.removeClass("cmplz-hidden"),m("."+s).removeClass("cmplz-hidden"),a.hasClass("is-required")&&a.prop("required",!0),o=!0):(n.addClass("cmplz-hidden"),m("."+s).addClass("cmplz-hidden"),a.hasClass("is-required")&&a.prop("required",!1)):o||-1!=d.indexOf(e)||d==e?(n.addClass("cmplz-hidden"),m("."+s).addClass("cmplz-hidden"),a.hasClass("is-required")&&a.prop("required",!1)):(n.removeClass("cmplz-hidden"),m("."+s).removeClass("cmplz-hidden"),a.hasClass("is-required")&&a.prop("required",!0),o=!0)}),!o)break}})}t.length&&t.each(function(){var e=m(this).attr("name"),t=window.localStorage.getItem(e),c=m(this).val();null==t||0<!m(this).find("option[value="+t+"]").length?(t=c,window.localStorage.setItem(e,t),m(this).val(t).change()):null!=t&&t!==c&&m(this).val(t).change()}),m(document).on("change",".cmplz_save_localstorage",function(){var e=m(this).attr("name"),t=m(this).find(":selected").val();window.localStorage.setItem(e,t)}),m(document).on("change",".cmplz-download-document-selector",function(){var e=m(this);0!=e.find(":selected").val().length?(e.closest(".cmplz-document").find("button").attr("disabled",!1),document.querySelector(".cmplz-dataleak-btn-href").href=e.find(":selected").val()):e.closest(".cmplz-document").find("button").attr("disabled",!0)}),m(document).on("click",".cmplz-download-document",function(){var t=m(this),c=t.html(),e=m(this).closest(".cmplz-document").find("select").val(),i=m(this).closest(".cmplz-document").find("select option:selected").text(),a=(t.html('<div class="cmplz-loader"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>'),t.attr("disabled","disabled"),new XMLHttpRequest);a.responseType="blob",a.open("get",e,!0),a.send(),a.onreadystatechange=function(){var e,t;4==this.readyState&&200==this.status&&(e=window.URL.createObjectURL(this.response),(t=document.createElement("a")).setAttribute("href",e),t.setAttribute("download",i),document.body.appendChild(t),t.click(),setTimeout(function(){window.URL.revokeObjectURL(e)},6e4))},a.onprogress=function(e){t.html(c),t.removeAttr("disabled")}}),m(document).on("change",".cmplz-grid-selector",function(){var e=m(this).val(),t=m(this).attr("id"),c=window.location.href,i=function(e,t){if(void 0!==e){e=e.split("?");if(1!=e.length){var c,i,a=e[1].split("&");for(i=0;i<a.length;i++)if((c=a[i].split("="))[0]===t)return void 0===c[1]||decodeURIComponent(c[1])}}return!1}(c,t);!1!==i&&(c=c.replace("&"+t+"="+i,"")),c+="&"+t+"="+e,window.location.replace(c)}),m(document).on("click",".cmplz-tablinks",function(){m(".cmplz-tablinks").removeClass("active"),m(this).addClass("active"),m(".cmplz-tabcontent").removeClass("active"),m("#"+m(this).data("tab")).addClass("active"),m("input[name=cmplz_active_tab]").val(m(this).data("tab"))}),window.setTimeout(function(){m(".cmplz-hide").fadeTo(500,0).slideUp(500,function(){m(this).remove()})},2e3),m(document).on("click",".cmplz-help-modal span",function(e){m(this).closest(".cmplz-help-modal").fadeOut()}),m(".cmplz-radio-container").keypress(function(e){"13"==(e.keyCode||e.which)&&m(e.target).find(":radio").click()}),m(".cmplz-switch, .cmplz-checkbox-container").keypress(function(e){"13"==(e.keyCode||e.which)&&m(e.target).find(":checkbox").click()}),c(),m(document).on("keyup",".multiple-field input[type=text]",function(){c()}),m(document).on("keyup",".multiple-field textarea",function(){c()}),a(),m(":checkbox").change(a),m(document).on("change","input",function(e){l()}),m(document).on("change","select",function(e){l()}),m(document).on("change","textarea",function(e){l()}),m(document).on("cmplzRenderConditions",l);var n=1e4,s=complianz_admin.progress,o=m(".cmplz-progress-bar"),d=m(".detected-cookies");m("#cmplz-scan-progress").length&&(n=3e3),m("#cmplz_cookie_scan_frame").length&&function c(){var e=document.getElementById("cmplz_cookie_scan_frame");e.contentDocument||e.contentWindow.document;d.find(".cmplz-loader").length,e.onload=function(){100<=s||m.get(complianz_admin.admin_url,{action:"cmplz_get_scan_progress"},function(e){var t;e&&(t=(e=jQuery.parseJSON(e)).cookies,m(".detected-cookies .cmplz-cookies-table").html(t.join("<br>")),m(".cmplz-scan-count").html(t.length),s=parseInt(e.progress),t=e.next_page,100<=s?(s=100,o.css({width:s+"%"})):(o.css({width:s+"%"}),m("#cmplz_cookie_scan_frame").attr("src",t),window.setTimeout(c,n)))})},window.setTimeout(c,n)}(),o.css({width:s+"%"});var r=0,p=m(".cmplz-sync-progress-bar"),h=m(".cmplz-sync-status span"),u=m(".cmplz-resync");function v(e){e=void 0!==e&&e,m.get(complianz_admin.admin_url,{action:"cmplz_run_sync",restart:e},function(e){e&&(e=jQuery.parseJSON(e),r=parseInt(e.progress),void 0!==(e=e.message)&&0<e.length&&(m("#cmplz_action_error").removeClass("cmplz-hidden"),m("#cmplz_action_error .cmplz-panel").html(e)),100<=r?(r=100,m("#cmplz-sync-loader").html(""),h.hide(),u.removeAttr("disabled"),y(),p.css({width:r+"%"})):(p.css({width:r+"%"}),window.setTimeout(v,500)))})}h.hide(),m("#cmplz-sync-progress").length?(r=complianz_admin.syncProgress)<100&&(u.attr("disabled","disabled"),h.show(),p.css({width:r+"%"}),v()):m(".cmplz-list-container").length&&y(),m(document).on("click",".cmplz-resync",function(){u.attr("disabled","disabled"),p.css({width:"0%"}),h.show(),v(!0)}),m(document).on("change","input[name=cmplz_show_deleted]",function(){y()}),m(document).on("click",".cmplz-add-to-policy",function(){var e=m(this).closest(".cmplz-slide-panel").find(".cmplz-title").html(),t=m(this).closest(".cmplz-slide-panel").find(".cmplz-panel-content").html(),e=function(e,t){void 0===e&&(e=wpActiveEditor);void 0===t&&(t=e);return jQuery("#wp-"+e+"-wrap").hasClass("tmce-active")&&tinyMCE.get(e)?tinyMCE.get(e).getContent():jQuery("#"+t).val()}("cmplz_custom_privacy_policy_text")+"<h3>"+e+"</h3>"+t,t="cmplz_custom_privacy_policy_text",c=void 0;void 0===t&&(t=wpActiveEditor),void 0===c&&(c=t),jQuery("#wp-"+t+"-wrap").hasClass("tmce-active")&&tinyMCE.get(t)?tinyMCE.get(t).setContent(e):jQuery("#"+c).val(e),m(this).remove()});var z="#bar_pct_all_container";function f(e){var t=e.closest(".cmplz-field");e.is(":checked")?t.find(".cmplz_collectedPersonalData").parent().show():t.find(".cmplz_collectedPersonalData").parent().hide()}function _(e){var t=e.closest(".cmplz-field");e.is(":checked")?t.find(".cmplz_privacyStatementURL").parent().show():t.find(".cmplz_privacyStatementURL").parent().hide()}function g(e){var t,c=!0,e=e.closest(".cmplz-panel");e.find(":input:not(.cmplz_cookieFunction)").each(function(){m(this).is(":checkbox")||m(this).is(":hidden")||"button"===m(this).prop("type")||"SELECT"!==m(this).prop("nodeName")&&0<m(this).val().length||"SELECT"===m(this).prop("nodeName")&&0!=m(this).val()||(c=!1)}),c?((t=e.find(".fa.fa-times")).removeClass("cmplz-error"),t.addClass("cmplz-success"),t.addClass("fa-check"),t.removeClass("fa-times")):((t=e.find(".fa.fa-check")).addClass("cmplz-error"),t.removeClass("cmplz-success"),t.addClass("fa-times"),t.removeClass("fa-check"))}function b(){m(".cmplz-select2").select2({tags:!0,width:"400px"}),m(".cmplz-select2-no-additions").select2({width:"400px"})}function y(){var e=m("#cmplz_language").val(),t=m("input[name=cmplz_show_deleted]").is(":checked"),c=(m(".cmplz-list-container").html('<div class="cmplz-skeleton"></div>'),m("#cmplz_language").data("type"));m.ajax({type:"GET",url:complianz_admin.admin_url,dataType:"json",data:{language:e,action:"cmplz_get_list",deleted:t,type:c},success:function(e){e.success&&(m(".cmplz-list-container").html(e.html),m(".cmplz_isPersonalData").each(function(){f(m(this))}),m(".cmplz_thirdParty").each(function(){_(m(this))}),k(),b())}})}function k(){m(".cmplz-panel").each(function(){m(this).hasClass("cmplz-deleted")?(m(this).find('button[data-action="restore"]').show(),m(this).find('button[data-action="delete"]').hide()):(m(this).find('button[data-action="restore"]').hide(),m(this).find('button[data-action="delete"]').show())})}m(z).show(),m(document).on("change","select[name=cmplz_region]",function(){m(z).hide();var e=m("select[name=cmplz_region]").val(),t=m("select[name=stats_type]").val();m(z="#bar_"+t+"_"+e+"_container").fadeIn()}),m(document).on("change","select[name=stats_type]",function(){m(z).hide();var e="eu",t=(m("select[name=cmplz_region]").length&&(e=m("select[name=cmplz_region]").val()),m("select[name=stats_type]").val());m(z="#bar_"+t+"_"+e+"_container").fadeIn()}),m(document).on("change",".cmplz_isPersonalData",function(){f(m(this))}),m(document).on("change",".cmplz_thirdParty",function(){_(m(this))}),m(document).on("change",".cmplz_sync",function(){var e=m(this).closest(".cmplz-field"),t=m(this),c=!1;t.is(":checked")&&(c=!0),e.find(":input").each(function(){"cmplz_remove_item"!==m(this).attr("name")&&"cmplz-save-item"!==m(this).attr("name")&&"cmplz_restore_item"!==m(this).attr("name")&&"cmplz_showOnPolicy"!==m(this).attr("name")&&"cmplz_sync"!==m(this).attr("name")&&(m(this).prop("disabled",c),c?(m(this).closest(".cmplz-service-field div, .cmplz-cookie-field div").addClass("cmplz-disabled"),m(this).closest("label").addClass("cmplz-disabled")):(m(this).closest(".cmplz-service-field div, .cmplz-cookie-field div").removeClass("cmplz-disabled"),m(this).closest("label").removeClass("cmplz-disabled")))})}),m(document).on("change",".cmplz_use_cdb_api",function(){var t="no"===m(this).val();m(".cmplz-list-container").find(":input[name=cmplz_sync]").each(function(){var e=m(this).closest("label");t?(e.find(":checkbox").prop("checked",!1).change(),e.addClass("cmplz-disabled")):(e.removeClass("cmplz-disabled"),e.find(":checkbox").prop("checked",!0).change())})}),m(document).on("change",".cmplz_sync",function(){var e=m(this).closest(".cmplz-panel");m(this).is(":checked")?e.find(".fa-sync-alt").removeClass("cmplz-disabled"):e.find(".fa-sync-alt").addClass("cmplz-disabled")}),m(document).on("change",".cmplz_showOnPolicy",function(){var e=m(this).closest(".cmplz-panel");m(this).is(":checked")?e.find(".fa-file").removeClass("cmplz-error"):e.find(".fa-file").addClass("cmplz-error")}),m(document).on("keyup",".cmplz-panel input",function(){g(m(this))}),m(document).on("change",".cmplz-panel select",function(){g(m(this))}),m("#cmplz_language").length&&(100==(r=complianz_admin.syncProgress)&&y(),m(document).on("change","#cmplz_language",function(){m(".cmplz-list-container").html('<div class="cmplz-skeleton"></div>'),y()})),m(".cmplz-select2").length&&b(),m(document).on("click",".cmplz-edit-item",function(){var a=m(this).data("action"),l=m(this),e=l.data("type"),n=m(this).closest(".cmplz-"+e+"-field"),s=m(this).closest(".cmplz-panel.cmplz-slide-panel"),t=m("#cmplz_language").val(),o=l.html(),c=(l.html('<div class="cmplz-loader"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>'),n.data(e+"_id")),i={};n.find(":input").each(function(){"button"!==m(this).attr("type")&&("checkbox"===m(this).attr("type")?i[m(this).attr("name")]=m(this).is(":checked"):i[m(this).attr("name")]=m(this).val())}),"delete"===a&&s.addClass("cmplz-deleted"),m.ajax({type:"POST",url:complianz_admin.admin_url,dataType:"json",data:{item_id:c,type:e,data:JSON.stringify(i),cmplz_action:a,language:t,action:"cmplz_edit_item"},success:function(e){var t,c,i;e.success&&("delete"===a&&s.remove(),"restore"===a&&(s.removeClass("cmplz-deleted"),n.find("input").each(function(){m(this).removeAttr("disabled")}),n.find("select").each(function(){m(this).removeAttr("disabled")}),n.children("div").removeClass("cmplz-disabled"),n.children("label").removeClass("cmplz-disabled"),n.find('button[name="cmplz-save-item"]').removeAttr("disabled"),n.find(".cmplz_sync").change()),k(),"add"===a&&(t=e.html,i=l.closest(".cmplz-field"),c=m(".cmplz-service-divider.no-service"),e.divider?((c.length?c.closest(".cmplz-service-cookie-list"):(t='<div class="cmplz-service-cookie-list">'+e.divider+t+"<div>",i.find(".cmplz-list-container"))).append(t),c=m(".cmplz-service-divider.no-service"),"no"==m(".cmplz_use_cdb_api:checked").val()&&c.siblings(":last").find(".cmplz_sync").closest("label").addClass("cmplz-disabled")):i.find(".cmplz-list-container").append(t)),"save"===a&&(e=s.find(".cmplz-title"),c=n.find(".cmplz_name").val(),i=e.text().replace(/\".*\"/,'"'+c+'"'),e.text(i)),l.html(o),b())}})}),m(document).on("click",".cmplz_script_add",function(){var t=m(this),c=t.html(),e=t.data("type");t.html('<div class="cmplz-loader"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>'),m.ajax({type:"POST",url:complianz_admin.admin_url,data:{action:"cmplz_script_add",type:e},success:function(e){e.success&&(t.before(e.html),t.html(c))}})}),m(document).on("click",".cmplz_add_url",function(){var e=m(this).closest("div"),t=m(".cmplz-url-template").get(0).innerHTML;e.append(t)}),m(document).on("click",".cmplz_remove_url",function(){m(this).closest("div").remove()}),m(document).on("click",".cmplz_script_save",function(){var t=m(this),c=t.html(),i=t.closest(".cmplz-panel"),e=t.data("type"),a=t.data("action"),l=t.data("id");"save"!=a&&"remove"!=a||t.html('<div class="cmplz-loader"><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>');var n={};i.find(":input").each(function(){if("button"!==m(this).attr("type")&&void 0!==m(this).attr("name")&&m(this).data("name"))if("checkbox"===m(this).attr("type"))n[m(this).data("name")]=m(this).is(":checked");else if("radio"===m(this).attr("type"))m(this).is(":checked")&&(n[m(this).data("name")]=m(this).val());else if("urls"===m(this).data("name")){let e=n[m(this).data("name")];(e=void 0===e?[]:e).push(m(this).val()),n[m(this).data("name")]=e}else if("dependency"===m(this).data("name")){let e=n[m(this).data("name")];(e=void 0===e?[]:e).push(m(this).data("url")+"|:|"+m(this).val()),n[m(this).data("name")]=e}else n[m(this).data("name")]=m(this).val()}),m.ajax({type:"POST",url:complianz_admin.admin_url,data:{action:"cmplz_script_save","cmplz-save":!0,type:e,button_action:a,id:l,data:JSON.stringify(n)},success:function(e){e.success&&("save"===a&&t.html(c),"remove"===a&&(i.remove(),t.html(c)))}})}),function(){if(m("#cmplz_anonymous_window_warning").length){var e=window.RequestFileSystem||window.webkitRequestFileSystem;if(!e)return;e(window.TEMPORARY,100,function(e){},function(e){m("#cmplz_anonymous_window_warning").show()})}m("#cmplz_adblock_warning").length&&void 0===window.canRunAds&&m("#cmplz_adblock_warning").show()}(),m(document).on("change",".cmplz-document-input",function(){m(".cmplz-document-field").length&&m(".cmplz-document-field").each(function(){var e=m(this).data("fieldname"),e=m("input[name="+e+"]:checked").val(),t=m(this).find(".cmplz-document-custom-url"),c=m(this).find(".cmplz-document-custom-page");"custom"===e?(c.show(),c.prop("required",!0)):(c.hide(),c.prop("required",!1)),"url"===e?(t.show(),t.prop("required",!0)):(t.hide(),t.prop("required",!1))})}),m(document).on("click","#cmplz-create_pages",function(){var t=m("#cmplz-create_pages"),c=(t.attr("disabled","disabled"),t.html()),i=(t.html('<div class="cmplz-loader "><div class="rect1"></div><div class="rect2"></div><div class="rect3"></div><div class="rect4"></div><div class="rect5"></div></div>'),{});m(".cmplz-create-page-title").each(function(){var e=i.hasOwnProperty(m(this).data("region"))?i[m(this).data("region")]:{};e[m(this).attr("name")]=m(this).val(),i[m(this).data("region")]=e}),m.ajax({type:"POST",url:complianz_admin.admin_url,dataType:"json",data:{pages:JSON.stringify(i),action:"cmplz_create_pages"},success:function(e){e.success?(m(".cmplz-panel.cmplz-notification.cmplz-success.cmplz-hidden").removeClass("cmplz-hidden"),m(".cmplz-create-page-title").each(function(){m(this).removeClass("cmplz-deleted-page").addClass("cmplz-valid-page"),m(this).parent().find(".cmplz-icon").replaceWith(e.icon)}),t.html(e.new_button_text),t.removeAttr("disabled")):(t.html(c),m(".cmplz-page-created").removeClass("fa-times").addClass("fa-check"),m(".cmplz-create-page-title").removeClass("cmplz-deleted-page"))}})}),m(document).on("change",".cmplz-region-select",function(){var e=m(".cmplz-document-button").attr("href").slice(0,-2);m(".cmplz-document-button").attr("href",e+m(this).val())});var w=0,C=m(".cmplz_export_roc_to_csv");function x(e,t){setTimeout(function(){(t+=10)<100?(C.html(t+" %"),x(e,t)):C.replaceWith(e)},100)}function q(e){var t=window.location.href.split("?");if(1!=t.length)for(var c,i=t[1].split("&"),a=0;a<i.length;a++)if((c=i[a].split("="))[0]===e)return void 0===c[1]?"":decodeURIComponent(c[1]);return!1}m(document).on("click",".cmplz_export_roc_to_csv",function(e){e.preventDefault(),C.html(w+" %"),C.prop("disabled",!0),function t(){var c=m(".cmplz_export_roc_to_csv");m.ajax({type:"GET",url:complianz_admin.admin_url,dataType:"json",data:{action:"cmplz_export_roc_to_csv",order:q("order"),cmplz_month_select:q("cmplz_month_select"),cmplz_year_select:q("cmplz_year_select"),orderby:q("orderby"),s:q("s")},success:function(e){e.success&&(e.progress<100?(w=e.progress,c.html(w+" %"),t()):x(e.link,w))}})}()}),m(document).on("change",".cmplz-region-select",function(){var e=m(".cmplz-document-button").attr("href").slice(0,-2);m(".cmplz-document-button").attr("href",e+m(this).val())}),m(document).on("click",".upload_button",function(e){e.preventDefault(),m("input[type=file]").click()}),m(document).on("change",':input[name="cmplz-upload-file"]',function(){m(".cmplz-file-chosen").text(m(this).val().split("\\").pop())}),m(document).on("click",".cmplz-image-uploader, .cmplz-logo-preview.cmplz-clickable",function(){var e=m(this),l=e.closest(".cmplz-field"),n=e.closest(".field-group").data("fieldname"),s=wp.media({frame:"post",state:"insert",multiple:!1});s.on("insert",function(){for(var e=s.state().get("selection").length,t=s.state().get("selection").models,c=0;c<e;c++){var i=t[c].id,a=!1;(a=(a=(a=(a=t[c].attributes.sizes.cmplz_banner_image)||t[c].attributes.sizes.medium)||t[c].attributes.sizes.thumbnail)||t[c].attributes.sizes.full)&&(a=a.url,l.find(".cmplz-logo-preview img").attr("src",a),m("input[name=cmplz_"+n+"]").val(i),m(".cmplz-cookiebanner .cmplz-logo").html("<img>"),m(".cmplz-cookiebanner .cmplz-logo img").attr("src",a))}}),s.open()})});