!function(e){var t={};function r(s){if(t[s])return t[s].exports;var p=t[s]={i:s,l:!1,exports:{}};return e[s].call(p.exports,p,p.exports,r),p.l=!0,p.exports}r.m=e,r.c=t,r.d=function(e,t,s){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(r.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var p in e)r.d(s,p,function(t){return e[t]}.bind(null,p));return s},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=3)}([function(e,t,r){"use strict";t.a=function(e){e("#ppw_subscribe_form").submit(function(t){t.preventDefault();const r=e("#ppw_email_subscribe").val().trim();/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(r)?(e("#ppw_subscribe_button").val("Saving..."),function(e,t,r){var s={action:"ppw_free_subscribe_request",settings:t,security_check:e("#ppw_subscribe_form_nonce").val()};!function(e,t,r){let s=!1;window.ppw_general_data?s=ppw_general_data.ajax_url:window.ppw_entire_site_data&&(s=ppw_entire_site_data.ajax_url),s&&e.ajax({url:s,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}(e,s,r)}(e,{ppw_email:r},function(t,r){t?(e("#ppw_subscribe_form").hide(),e("#ppw_subscribe_form_success").show()):r&&(400===r.status?(e(".ppw_subscribe_error").text(r.responseJSON.message),e(".ppw_subscribe_error").show("slow")):(e(".ppw_subscribe_error").text("Oops! Something went wrong. Please reload the page and try again."),e(".ppw_subscribe_error").show("slow"))),e("#ppw_subscribe_button").val("Get Lucky")})):(e(".ppw_subscribe_error").show("slow"),e("#ppw_email_subscribe").focus(),e("#ppw_subscribe_button").val("Get Lucky"))})}},,,function(e,t,r){"use strict";r.r(t);var s=r(0);!function(e){e(function(){e(".ppwp_select2").select2({width:"100%"}),e("#wpp_free_whitelist_roles").change(function(){"custom_roles"===e(this).val()?e("#wpp_free_roles_access").show():e("#wpp_free_roles_access").hide()}),e("#wpp_free_whitelist_roles").trigger("change"),e("#ppwp_free_apply_password_for_pages_posts").change(function(){e(this).prop("checked")?e(".ppwp-free-pages-posts-set-password").show():e(".ppwp-free-pages-posts-set-password").hide()}),e("#ppwp_free_apply_password_for_pages_posts").trigger("change"),e("#wpp_password_cookie_units").change(function(){!function(t){switch(t){case"days":e("#wpp_password_cookie_times").attr({max:365});break;case"hours":e("#wpp_password_cookie_times").attr({max:8760});break;case"minutes":e("#wpp_password_cookie_times").attr({max:525600});break;case"seconds":e("#wpp_password_cookie_times").attr({max:31536e3})}}(e(this).val())}),e("#ppw_select_custom_post_type_edit").change(function(){e(".ppw_hide_protect_content").hide();const t=e(this).val();if("page_post"===t){const t=["post","page"];t.forEach(function(t){!function(t){e(".ppw_wrap_"+t).show(),e("#ppw_hide_protected_"+t).change(function(){this.checked?function(t,r){e(t).show(),e(r).prop("required",!0)}("#ppw_wrap_hide_selected_"+t,"#ppw_hide_selected_"+t):function(t,r){e(t).hide(),e(r).prop("required",!1)}("#ppw_wrap_hide_selected_"+t,"#ppw_hide_selected_"+t)})}(t)})}}),e("#ppw_select_custom_post_type_edit").trigger("change"),Object(s.a)(e),e("#wp_protect_password_general_form").submit(function(t){t.preventDefault(),function(t,r){var s={action:"ppw_free_update_general_settings",settings:t,security_check:e("#ppw_general_form_nonce").val()};e("#submit").prop("disabled",!0),function(t,r){e.ajax({url:ppw_general_data.ajax_url,type:"POST",data:t,timeout:5e3,success:function(e){r(e,null)},error:function(e){r(null,e)}})}(s,r)}(function(){let t={wpp_password_cookie_expired:e("#wpp_password_cookie_times").val()+" "+e("#wpp_password_cookie_units").val(),wpp_remove_data:e("#wpp_remove_data").prop("checked")};return["post","page"].map(function(t){return{["ppw_hide_protected_"+t]:e("#ppw_hide_protected_"+t).prop("checked"),["ppw_hide_selected_"+t]:e("#ppw_hide_selected_"+t).val()}}).forEach(function(e){Object.keys(e).forEach(function(r){t[r]=e[r]})}),t}(),function(t,r){t&&(toastr.success("Great! Your settings have been updated successfully.","PPWP Lite"),location.reload(!0)),r&&(400===r.status?toastr.error(r.responseJSON.message,"PPWP Lite"):toastr.error("Oops! Something went wrong. Please try again.","PPWP Lite"),console.log("Data error",r),e("#submit").prop("disabled",!1))})})})}(jQuery)}]);