"use strict";function xs_show_hide_dashboard_multiple(e,s){var t=document.querySelectorAll(e);if(t)for(var a=0;a<t.length;a++)t[a].classList.remove("xs-donate-visible");var n=document.querySelectorAll(s);if(n)for(var i=0;i<n.length;i++)n[i].classList.add("xs-donate-visible")}function wfp_show_hide(e){var s=document.querySelectorAll(e);if(s)for(var t=0;t<s.length;t++)s[t].classList.toggle("xs-donate-visible")}function xs_show_hide_parents_elements_dash(e){if(e){jQuery(e).find("span.toggle-indicator").toggleClass("active");var s=jQuery(e).parents(".xs-pledge-row").find(".xs-row-body");s&&s.toggleClass("xs-donate-visible")}}function xs_modify_lebel_name_dash(e){if(jQuery("#"+e.id)){var s=jQuery(e).parents(".xs-repeater-field-wrap").find(".level_donate_multi");s&&s.html(jQuery(e).val())}}function wfp_choose_image(e){if(e){var s=document.querySelector("#wfp-file_list");if(s)for(var t=e.files.length,a=0;a<t;a++){var n="",i=e.files[a],r=i.name,o=wfP_format_file_size(i.size,2),l=URL.createObjectURL(i),d=r.replace(/ /g,"_");if(!i.type.match("image.*"))return;if(d.length>4){n='<span class="wfpf wfpf-close-outline remove-icon" onclick="wfp_reviwe_image(this.parentElement)"></span><img class="imageThumb" src="'+l+'" title="'+r+'"/><input type="hidden" value="'+d+'" name="wfp_uploaded[]" id="image-set-'+a+'"/><span class="sizefiles">'+o+"</span>";var u=document.createElement("li");u.setAttribute("id","wfp-upload-set-id__"+a),u.setAttribute("class","preview_image"),u.innerHTML=n,s.append(u)}}}}function wfP_format_file_size(e,s){if(0==e)return"0 Bytes";var t=s||2,a=Math.floor(Math.log(e)/Math.log(1e3));return parseFloat((e/Math.pow(1e3,a)).toFixed(t))+" "+["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][a]}function wfp_reviwe_image(e){e&&e.remove(e)}jQuery(document).ready((function(){jQuery(".wfp-main-menu > .wfp-menu-item").on("click",(function(e){jQuery(".wfp-menu-item").removeClass("opend"),jQuery(this).addClass("opend")}))})),jQuery(document).ready((function(e){jQuery("#wfp_regForm_profile_content").submit((function(e){e.preventDefault();var s=jQuery(this).serialize();document.getElementsByTagName("body")[0].classList.add("wfp-disabled"),jQuery.ajax({data:s,type:"post",url:window.xs_donate_url.resturl+"xs-profile-form/billing-submit/12",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",xs_donate_url.nonce)},success:function(e){document.getElementsByTagName("body")[0].classList.remove("wfp-disabled");var s=jQuery(".message-campaign-status");s&&s.addClass("xs-alert xs-alert-success").html(e.success).hide().fadeIn()}})}))})),jQuery(document).ready((function(e){jQuery("#wfp_regForm_password_content").submit((function(e){e.preventDefault();var s=jQuery(this).serialize();document.getElementsByTagName("body")[0].classList.add("wfp-disabled"),jQuery.ajax({data:s,type:"post",url:window.xs_donate_url.resturl+"xs-password-form/password-submit/11",beforeSend:function(e){e.setRequestHeader("X-WP-Nonce",xs_donate_url.nonce)},success:function(e){document.getElementsByTagName("body")[0].classList.remove("wfp-disabled");var s=jQuery(".message-password-status");if(s){if(e.error.length>0)return void s.removeClass("xs-alert-success").addClass("xs-alert xs-alert-danger").html(e.error).hide().fadeIn();if(e.success.length>0)return void s.removeClass("xs-alert-danger").addClass("xs-alert xs-alert-success").html(e.success).hide().fadeIn()}}})}))})),function(e){e((function(){e(".wfp-mobile-nav--icon").on("click",(function(){e(this).closest(".wfp-dashboard").find(".dashboard-left-section").toggleClass("opened")})),e(".wfp-mobile-close-btn").on("click",".wfp-mobile-close-btn--icon",(function(){e(".wfp-mobile-nav--icon").trigger("click")}))}))}(jQuery);