/* empty css                         */function y(){import.meta.url,import("_").catch(()=>1);async function*o(){}}const r=jQuery;function w(){r(document.body).off("click acfw_toggle_accordion",".acfw-checkout-ui-block .acfw-accordion > h3",l),r(document.body).on("click acfw_toggle_accordion",".acfw-checkout-ui-block .acfw-accordion > h3",l),acfwfCheckout.auto_display_store_credits_redeem_form==="yes"&&r(".acfw-checkout-ui-block .acfw-accordion.acfw-store-credits-checkout-ui > h3").trigger("acfw_toggle_accordion")}function l(){const o=r(this).parent(),t=o.closest(".acfw-checkout-ui-block").find(".acfw-accordion"),c=o.hasClass("show");t.removeClass("show"),c?o.removeClass("show"):o.addClass("show"),k.call(this)}function k(){r(".acfw-checkout-ui-block").find(".acfw-accordion").each(function(){var f,u;const e=r(this),t=e.find(".acfw-accordion-content"),c=e.find(".acfw-accordion-inner"),s=2*parseInt(getComputedStyle(t[0]).fontSize)+10;let a=(f=t.height())!=null?f:0;a=((u=c.height())!=null?u:0)-s>0?0:a+s,e.hasClass("show")||(a=0),c.css({maxHeight:a})})}const i=jQuery;function g(){i(document.body).on("acfw-blockCheckout",h),i(document.body).on("acfw-unblockCheckout",p)}function h(){i(".woocommerce form.woocommerce-checkout").addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function p(){i(".woocommerce-error, .woocommerce-message").remove(),i(".woocommerce form.woocommerce-checkout").removeClass("processing").unblock()}const n=jQuery;function b(){n(document.body).off("click",".acfw-redeem-store-credit-form-field .button",d),n(document.body).off("click",".acfw-remove-store-credits",m),n(document.body).on("click",".acfw-redeem-store-credit-form-field .button",d),n(document.body).on("click",".acfw-remove-store-credits",m)}function d(){const e=n(this).closest(".acfw-redeem-store-credit-form-field"),t=e.find("input.input-text"),c=_(t.val());if(e.find("p.invalid-message").remove(),n(".woocommerce-NoticeGroup-updateOrderReview").remove(),!C(c)){e.append("<p class='invalid-message'>".concat(acfwfCheckout.enter_valid_price,"</p>"));return}h(),n.post(wc_checkout_params.ajax_url,{action:"acfwf_redeem_store_credits",amount:c,wpnonce:acfwfCheckout.redeem_nonce},function(s){p(),t.val(""),n(document.body).trigger("update_checkout",{update_shipping_method:!1})})}function _(o){return o?parseFloat(o.replace(acfwfCheckout.thousand_separator,"").replace(acfwfCheckout.decimal_separator,".")):0}function C(o){o=o.toString();const e=new RegExp("[^-0-9%\\.]+","gi"),t=new RegExp('[^\\.}"]',"gi");let c=o.replace(e,"");return 1<c.replace(t,"").length&&(c=c.replace(t,"")),parseFloat(o)===parseFloat(c)}function m(){n(".acfw-redeem-store-credit-form-field input").val(""),d()}jQuery(function(o){g(),w(),b()});export{y as __vite_legacy_guard};
