System.register(["../../common/index-legacy.6e3fc819.js"],function(c,o){"use strict";return{setters:[null],execute:function(){var c=document.createElement("style");c.textContent='.acfw-checkout-ui-block{margin-bottom:2.5em}.acfw-checkout-ui-block .acfw-accordion{border-bottom:1px solid #ebebeb}.acfw-checkout-ui-block .acfw-accordion:last-child{border-bottom:0}.acfw-checkout-ui-block .acfw-accordion h3{padding:.7em 1.2em;margin:0;background:#f5f5f5;font-size:1em;font-weight:400;cursor:pointer}.acfw-checkout-ui-block .acfw-accordion h3 .caret{position:relative;top:-2px;margin-left:5px}.acfw-checkout-ui-block .acfw-accordion h3 .caret img{display:inline-block;transition:transform .5s ease;transform:rotate(-90deg)}.acfw-checkout-ui-block .acfw-accordion .acfw-accordion-inner{overflow:hidden;background:#fcfcfc;max-height:0;transition:max-height .5s ease}.acfw-checkout-ui-block .acfw-accordion .acfw-accordion-inner .acfw-accordion-content{padding:1em 1.2em}.acfw-checkout-ui-block .acfw-accordion.show h3 .caret img{transform:rotate(0)}.acfw-checkout-ui-block .acfw-accordion .acfw-accordion-content{font-size:.9em}.acfw-checkout-ui-block .acfw-accordion .acfw-accordion-content p{margin-bottom:.5em}.acfw-checkout-ui-block .acfw-accordion .acfw-accordion-content p.acfw-store-credit-instructions{margin-bottom:.2em}.acfw-checkout-form-button-field{margin:0}.acfw-checkout-form-button-field:after{content:"";display:table;clear:both}.acfw-checkout-form-button-field .form-row-last label{display:none}.acfw-checkout-form-button-field .form-row-last .button{width:100%}body #wfacp-e-form .wfacp_main_form.woocommerce .wfacp-form-control-wrapper.acfw-store-credits-redeem-form-field .woocommerce-info{padding-bottom:0!important}body #wfacp-e-form .wfacp_main_form.woocommerce .wfacp-form-control-wrapper.acfw-store-credits-redeem-form-field .acfw-checkout-form-button-field{padding-top:1em}\n',document.head.appendChild(c);const o=jQuery;function e(){const c=o(this).parent(),e=c.closest(".acfw-checkout-ui-block").find(".acfw-accordion"),a=c.hasClass("show");e.removeClass("show"),a?c.removeClass("show"):c.addClass("show"),t.call(this)}function t(){o(".acfw-checkout-ui-block").find(".acfw-accordion").each(function(){var c,e;const t=o(this),a=t.find(".acfw-accordion-content"),r=t.find(".acfw-accordion-inner"),n=2*parseInt(getComputedStyle(a[0]).fontSize)+10;let i=null!==(c=a.height())&&void 0!==c?c:0;i=(null!==(e=r.height())&&void 0!==e?e:0)-n>0?0:i+n,t.hasClass("show")||(i=0),r.css({maxHeight:i})})}const a=jQuery;function r(){a(".woocommerce form.woocommerce-checkout").addClass("processing").block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}function n(){a(".woocommerce-error, .woocommerce-message").remove(),a(".woocommerce form.woocommerce-checkout").removeClass("processing").unblock()}const i=jQuery;function f(){i(document.body).off("click",".acfw-redeem-store-credit-form-field .button",d),i(document.body).off("click",".acfw-remove-store-credits",m),i(document.body).on("click",".acfw-redeem-store-credit-form-field .button",d),i(document.body).on("click",".acfw-remove-store-credits",m)}function d(){const c=i(this).closest(".acfw-redeem-store-credit-form-field"),o=c.find("input.input-text"),e=(t=o.val())?parseFloat(t.replace(acfwfCheckout.thousand_separator,"").replace(acfwfCheckout.decimal_separator,".")):0;var t;c.find("p.invalid-message").remove(),i(".woocommerce-NoticeGroup-updateOrderReview").remove(),function(c){c=c.toString();const o=new RegExp("[^-0-9%\\.]+","gi"),e=new RegExp('[^\\.}"]',"gi");let t=c.replace(o,"");return 1<t.replace(e,"").length&&(t=t.replace(e,"")),parseFloat(c)===parseFloat(t)}(e)?(r(),i.post(wc_checkout_params.ajax_url,{action:"acfwf_redeem_store_credits",amount:e,wpnonce:acfwfCheckout.redeem_nonce},function(c){n(),o.val(""),i(document.body).trigger("update_checkout",{update_shipping_method:!1})})):c.append(`<p class='invalid-message'>${acfwfCheckout.enter_valid_price}</p>`)}function m(){i(".acfw-redeem-store-credit-form-field input").val(""),d()}jQuery(function(c){a(document.body).on("acfw-blockCheckout",r),a(document.body).on("acfw-unblockCheckout",n),o(document.body).off("click acfw_toggle_accordion",".acfw-checkout-ui-block .acfw-accordion > h3",e),o(document.body).on("click acfw_toggle_accordion",".acfw-checkout-ui-block .acfw-accordion > h3",e),"yes"===acfwfCheckout.auto_display_store_credits_redeem_form&&o(".acfw-checkout-ui-block .acfw-accordion.acfw-store-credits-checkout-ui > h3").trigger("acfw_toggle_accordion"),f()})}}});
