1!function(e){"use strict";if(viwcaio_sc_checkout_params.WC_Gateway_Twocheckout)if(viwcaio_sc_checkout_params.WC_Gateway_Twocheckout.not_twocheckoutIsCheckout)var c=viwcaio_sc_checkout_params.WC_Gateway_Twocheckout.twocheckoutIsCheckout;else void 0!==c&&(c=viwcaio_sc_checkout_params.WC_Gateway_Twocheckout.twocheckoutIsCheckout);viwcaio_sc_checkout_params.country_locale&&"undefined"!=typeof wc_address_i18n_params&&(wc_address_i18n_params.locale=viwcaio_sc_checkout_params.country_locale),viwcaio_sc_checkout_params?.easy_checkout_address_3rd&&("undefined"==typeof address_book_base_country&&(window.address_book_base_country=viwcaio_sc_checkout_params.easy_checkout_address_3rd?.address_book_base_country),"undefined"==typeof address_book_label_json&&viwcaio_sc_checkout_params.easy_checkout_address_3rd?.address_book_label_json&&(window.address_book_label_json=JSON.parse(viwcaio_sc_checkout_params.easy_checkout_address_3rd?.address_book_label_json))),e(window).on("load",function(){e("div").on("click",".apply_coupons_credits",function(c){c.preventDefault(),c.stopPropagation();let o=e(this).data("coupon_code");return e(".vi-wcaio-coupon-code").val(o),e(".vi-wcaio-sidebar-cart-wrap .vi-wcaio-bt-coupon-code").trigger("click"),!1}),function(){let c=o;"undefined"!=typeof viwcaio_sc_params&&(c.wc_ajax_url=viwcaio_sc_params.wc_ajax_url||"",c.nonce=viwcaio_sc_params.nonce||"",c.language=viwcaio_sc_params.language||"");c.WC_Gateway_Twocheckout_Inline=viwcaio_sc_checkout_params.WC_Gateway_Twocheckout_Inline||"",c.invalid_text=viwcaio_sc_checkout_params.invalid_text||"",c.unavailable_checkout_text=viwcaio_sc_checkout_params.unavailable_checkout_text||"Checkout is not available whilst your cart is empty.",c.$wrap=e(".vi-wcaio-sidebar-cart-content-wrap-checkout"),c.$checkout_form=e(".vi-wcaio-sidebar-cart-content-wrap-checkout form.checkout"),"undefined"!=typeof PayPalCommerceGateway&&e("#ppc-button, .ppc-button-wrapper").each(function(c,o){e(o).closest(".vi-wcaio-sidebar-cart-content-wrap-checkout").length?e(o).css("display","block"):e(o).remove()});"undefined"!=typeof wc_stripe_payment_request_params&&e("#wc-stripe-payment-request-wrapper").each(function(c,o){e(o).closest(".vi-wcaio-sidebar-cart-content-wrap-checkout").length?e(o).css("display","block"):e(o).remove()});c.init()}()});var o={wc_ajax_url:"",nonce:"",language:"",invalid_text:"",unavailable_checkout_text:"",$wrap:e(".vi-wcaio-sidebar-cart-content-wrap-checkout"),$checkout_form:e(".vi-wcaio-sidebar-cart-content-wrap-checkout form.checkout"),is_paysoncheckout_default:"",init:function(){let c=this;c.$wrap.find(".vi-wcaio-checkout-nav-step-wrap").each(function(){let o=e(this).find(".vi-wcaio-checkout-nav-step").length;e(this).css({gridTemplateColumns:"repeat("+o+",1fr)",top:c.$wrap.find(".vi-wcaio-sidebar-cart-header-wrap").outerHeight()+"px"})}),c.$wrap.on("init_checkout",c.init_checkout),c.$wrap.on("init_checkout_form",function(e,o,t){c.init_checkout_form(o,t)}),c.$wrap.on("click",".vi-wcaio-sidebar-cart-bt-checkout-cancel",c.close_checkout),c.$wrap.on("click",".vi-wcaio-sidebar-cart-bt-nav-checkout",c.open_checkout),c.$wrap.on("click",".vi-wcaio-checkout-nav-step, .vi-wcaio-sidebar-cart-bt-checkout-next, .vi-wcaio-sidebar-cart-bt-checkout-back",c.may_be_switch_step),c.$checkout_form.on("change","#ship-to-different-address input",c.country_select_select2),c.$checkout_form.on("click","a.woocommerce-terms-and-conditions-link",c.toggle_terms),c.$wrap.on("set_navs_button_text",function(e,o,t){c.set_navs_button_text(o,t)}),c.$wrap.on("keydown",function(e){if(13===e.which)return e.preventDefault(),e.stopPropagation(),!1}),c.$checkout_form.on("submit",function(c){e.inArray(e('[name="payment_method"]').filter(":checked").eq(0).val(),["stripe","woocommerce_payments"])>-1&&e(".wc-upe-form").length&&e(this).addClass("processing")}),c.$wrap.on("click",".vi-wcaio-sidebar-cart-bt-checkout-place_order",function(){if(e(".woocommerce-NoticeGroup-checkout, .woocommerce-error, .woocommerce-message").remove(),e(".vi-wcaio-sidebar-cart-overlay, .vi-wcaio-sidebar-cart-close-wrap").addClass("vi-wcaio-not-hidden"),c.WC_Gateway_Twoc
1heckout_Inline||c.$checkout_form.find("#payment_method_twocheckout_inline").length||"undefined"!=typeof wc_stripe&&e("#wc-stripe-wc-stripe-js").length||e('input[name="payment_method"]').length&&e('input[name="payment_method"]').val().indexOf("klarna_payments")>-1){c.$checkout_form.find("#place_order").trigger("click");let t=setInterval(function(){if(o.$checkout_form.hasClass("processing")&&c.start_loading(),e(".vi-wcaio-warning-wrap-open").length)return e(".vi-wcaio-sidebar-cart-overlay, .vi-wcaio-sidebar-cart-close-wrap").removeClass("vi-wcaio-not-hidden"),clearInterval(t),void o.end_loading();let a=e(".woocommerce-error, .woocommerce-message, .woocommerce-NoticeGroup-checkout");a.length&&(e(".vi-wcaio-sidebar-cart-overlay, .vi-wcaio-sidebar-cart-close-wrap").removeClass("vi-wcaio-not-hidden"),vi_wcaio_show_message(a.html()),e("html, body").stop(),clearInterval(t),o.end_loading())},100);return}if(c.start_loading(),!1===c.$checkout_form.triggerHandler("submit")&&!o.$checkout_form.hasClass("processing")){let c=setInterval(function(){if(clearInterval(c),e(".vi-wcaio-warning-wrap-open").length)return;let o=e(".woocommerce-error, .woocommerce-message, .woocommerce-NoticeGroup-checkout");o.length&&vi_wcaio_show_message(o.html()),e("html, body").stop()},1e3)}}),e(document).on("keydown",function(e){if(c.$wrap.find(".vi-wcaio-sidebar-cart-checkout-wrap:not(.vi-wcaio-disabled)").data("use_keyboard")){let o=e.which;37===o?c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-back").trigger("click"):39===o&&c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-next").trigger("click")}}),c.woo_checkout();"checkout"===new URLSearchParams(window.location.search).get("viwcaio_cart_sidebar_open")&&e(".vi-wcaio-sidebar-cart-bt-nav-checkout").trigger("click"),e(document.body).on("kp_auth_failed",function(){c.end_loading()}),"undefined"!=typeof pco_wc_params&&(c.is_paysoncheckout_default=e('input[name="payment_method"]#payment_method_paysoncheckout').prop("checked"),c.$wrap.on("click",".paysoncheckout-select-other-wrapper, #paysoncheckout-select-other ",function(c){c.preventDefault(),c.stopPropagation(),e.ajax({type:"POST",dataType:"json",data:{pco:!1,order_id:pco_wc_params.order_id,nonce:pco_wc_params.change_payment_method_nonce,vicaio_nonce:o.nonce},url:pco_wc_params.change_payment_method_url,beforeSend:function(){o.start_loading()},complete:function(e){let c={viwcaio_get_checkout:1,viwcaio_language:o.language,is_paysoncheckout:0,vicaio_nonce:o.nonce};o.$wrap.trigger("init_checkout_form",[c,o.wc_ajax_url.toString().replace("%%endpoint%%","viwcaio_get_checkout_form")])}})}),c.$wrap.on("click",".payment_method_paysoncheckout",function(c){("paysoncheckout"===e(this).val()||e(this).hasClass("payment_method_paysoncheckout")||e(this).closest("payment_method_paysoncheckout").length)&&(c.preventDefault(),c.stopPropagation(),e.ajax({type:"POST",dataType:"json",data:{pco:!0,order_id:pco_wc_params.order_id,nonce:pco_wc_params.change_payment_method_nonce,vicaio_nonce:o.nonce},url:pco_wc_params.change_payment_method_url,beforeSend:function(){o.start_loading()},complete:function(e){let c={viwcaio_get_checkout:1,viwcaio_language:o.language,is_paysoncheckout:1,vicaio_nonce:o.nonce};o.$wrap.trigger("init_checkout_form",[c,o.wc_ajax_url.toString().replace("%%endpoint%%","viwcaio_get_checkout_form")])}}))}))},woo_checkout:function(){let c=o,t=c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").data("place_order_text")||c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").attr("data-place_order_text");t=t?t.toString():"",c.$checkout_form.find("#place_order").length?c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").removeClass("vi-wcaio-bt-disabled").html(t.replace(/{order_button_text}/g,c.$checkout_form.find("#place_order").html()||c.$checkout_form.find("#place_order").val()||c.$checkout_form.find("#place_order").data("value"))):c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").addClass("vi-wcaio-bt-disabled"),(e('input[name="payment_method"]#payment_method_ppcp-gateway').prop("checked")||e('input[name="payment_method"]#payment_method_ppcp-card-button-gateway').prop("checked")||e('input[name="payment_method"]#payment_method_ppcp').prop("checked"))&&c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").addClass("vi-wcaio-bt-disabled"),c.$wrap.hasClass("vi-wcaio-sidebar-cart-content-wrap-customize")?e(document.body).on("payment_method_selected",function(){c.$checkout_form.find("#place_order").length?(t=c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").data("place_order_text")||c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").attr("data-place_order_text"),c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").removeClass("vi-wcaio-bt-disabled").html(t.replace(/{order_button_text}/g,c.$checkout_form.find("#place_order").html()||c.$checkout_form.find("#place_order").val()||c.$checkout_form.find("#place_order").data("value")))):c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").addClass("vi-wcaio-bt-disabled"),(e('input[name="payment_method"]#payment_method_ppcp-gateway').prop("checked")||e('input[name="payment_method"]#payment_method_ppcp-card-button-gateway').prop("checked")||e('input[name="payment_method"]#payment_method_ppcp').prop("checked"))&&c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").addClass("vi-wcaio-bt-disabled")}):-1!==t.indexOf("{order_button_text}")&&e(document.body).on("payment_method_selected",function(){c.$checkout_form.find("#place_order").length?c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").removeClass("vi-wcaio-bt-disabled").html(t.replace(/{order_button_text}/g,c.$checkout_form.find("#place_order").html()||c.$checkout_form.find("#place_order").val()||c.$checkout_form.find("#place_order").data("value"))):c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").addClass("vi-wcaio-bt-disabled"),(e('input[name="payment_method"]#payment_method_ppcp-gateway').prop("checked")||e('input[name="payment_method"]#payment_method_ppcp-card-button-gateway').prop("checked")||e('input[name="payment_method"]#payment_method_ppcp').prop("checked"))&&c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").addClass("vi-wcaio-bt-disabled")}),"undefined"==typeof PayPalCommerceGateway||c.$checkout_form.find(PayPalCommerceGateway.button.wrapper).length||c.$checkout_form.find("#payment").after('<div id="'+PayPalCommerceGateway.button.wrapper.replace("#","")+'"></div>'),e(document.body).on("payment_method_selected",function(){c.$checkout_form.find("#place_order").length?c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").removeClass("vi-wcaio-bt-disabled").html(t.replace(/{order_button_text}/g,c.$checkout_form.find("#place_order").html()||c.$checkout_form.find("#place_order").val()||c.$checkout_form.find("#place_order").data("value"))):c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").addClass("vi-wcaio-bt-disabled"),(e('input[name="payment_method"]#payment_method_ppcp-gateway').prop("checked")||e('input[name="payment_method"]#payment_method_ppcp-card-button-gateway').prop("checked")||e('input[name="payment_method"]#payment_method_ppcp').prop("checked"))&&c.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").addClass("vi-wcaio-bt-disabled"),e.inArray(e('[name="payment_method"]').filter(":checked").eq(0).val(),["stripe","woocommerce_payments"])>-1&&e(".wc-upe-form").length&&e(".wc-upe-form").parent().find(".woocommerce-SavedPaymentMethods-new").length&&e(".wc-upe-form").parent().find(".woocommerce-SavedPaymentMethods-new").remove()}),e(document).on("ajaxSend",function(e,o,t){t&&t.url&&(t.url.includes("wc-ajax=update_order_review")||t.url.includes("wc-ajax=checkout"))&&c.start_loading()}),e(document.body).on("updated_checkout",function(o,t){if(c.$checkout_form.find(".vi-wcaio-checkout-shipping-replace").length&&c.$checkout_form.find("#ship-to-different-address input").length)return c.$checkout_form.find(".vi-wcaio-checkout-shipping-replace").removeClass("vi-wcaio-checkout-shipping-replace"),c.$checkout_form.find("#ship-to-different-address input").trigger("change"),!1;if(t&&t.fragments){let o=[".vi-wcaio-sidebar-cart-footer-cart_total1",".vi-wcaio-sidebar-cart-footer-coupons"];!c.$checkout_form.find(".woocommerce-shipping-totals").length&&void 0!==t.fragments[".woocommerce-checkout-review-order-table"]&&t.fragments[".woocommerce-checkout-review-order-table"].indexOf("woocommerce-shipping-totals")>-1&&o.push(".woocommerce-checkout-review-order-table"),e.each(t.fragments,function(c,t){o.includes(c)&&(e(c).replaceWith(t),e(c).unblock())})}c.$wrap.find(".vi-wcaio-sidebar-cart-checkout-wrap:not(.vi-wcaio-disabled)")&&c.end_loading(),e.inArray(e('[name="payment_method"]').filter(":checked").eq(0).val(),["stripe","woocommerce_payments"])>-1&&e(".wc-upe-form").length&&e(".wc-upe-form").parent().find(".woocommerce-SavedPaymentMethods-new").length&&e(".wc-upe-form").parent().find(".woocommerce-SavedPaymentMethods-new").remove()}),e(document.body).on("removed_coupon_in_checkout",function(){vi_wcaio_show_message(c.$wrap.find(".woocommerce-message").html())}),e(document.body).on("stripeError",function(o,t){e(".vi-wcaio-sidebar-cart-overlay, .vi-wcaio-sidebar-cart-close-wrap").removeClass("vi-wcaio-not-hidden"),e("html, body").stop(),c.end_loading(),t.error.message?vi_wcaio_show_message(t.error.message):c.$checkout_form.find(".woocommerce_error").length&&vi_wcaio_show_message(c.$checkout_form.find(".woocommerce_error").html())}),e(document.body).on("checkout_error",function(o,t){e(".vi-wcaio-sidebar-cart-overlay, .vi-wcaio-sidebar-cart-close-wrap").removeClass("vi-wcaio-not-hidden"),e("html, body").stop(),c.end_loading(),t?vi_wcaio_show_message(t):c.$checkout_form.find(".woocommerce-NoticeGroup-checkout").length&&vi_wcaio_show_message(c.$checkout_form.find(".woocommerce-NoticeGroup-checkout").html())})},init_checkout:function(){o.$wrap.find(".vi-wcaio-checkout-nav-step-wrap:not(.vi-wcaio-disabled)").length&&o.$wrap.addClass("vi-wcaio-sidebar-cart-content-wrap-checkout-navs"),viwcaio_sc_checkout_params?.easy_checkout_address_3rd&&(o.$wrap.find("#address-book-checkout-billing-address-current").length&&o.$wrap.find(".woocommerce-billing-fields__field-wrapper").hide(),o.$wrap.find("#address-book-checkout-shipping-address-current").length&&o.$wrap.find(".woocommerce-shipping-fields__field-wrapper").hide()),o.switch_step(0,o.$wrap),e(document.body).trigger("timeslots_refreshed"),e(document.body).trigger("timeslots_loaded"),"undefined"==typeof wc_stripe_upe_params||wc_stripe_upe_params.isPaymentNeeded||(wc_stripe_upe_params.isPaymentNeeded="1")},get_checkout_form:async function(c,t){let a;if(await new Promise(function(i){e.ajax({url:t,type:"POST",data:c,beforeSend:function(){o.start_loading()},success:function(t){if(t?.wc_stripe_upe_params&&viwcaio_sc_checkout_js?.injects&&void 0!==viwcaio_sc_checkout_js.injects["wc-stripe-upe-classic"]&&(viwcaio_sc_checkout_js.injects["wc-stripe-upe-classic"].extra.data=t.wc_stripe_upe_params),t&&"success"===t.status&&t.html&&t.html.indexOf("vi-wcaio-checkout-step")>0){a=!0,wc_checkout_params.update_order_review_nonce=t.update_order_review_nonce;let i=e(t.html);i.find(".vi-wcaio-checkout-login-notice").length&&(o.$wrap.find(".vi-wcaio-checkout-login-notice").length||o.$wrap.find(".vi-wcaio-checkout-step-wrap").prepend('<div class="vi-wcaio-checkout-login-notice"></div>'),o.$wrap.find(".vi-wcaio-checkout-login-notice").replaceWith(i.find(".vi-wcaio-checkout-login-notice"))),i.find(".vi-wcaio-checkout-step-login").length&&(o.$wrap.find(".vi-wcaio-checkout-step-login").length||o.$wrap.find(".vi-wcaio-checkout-step-wrap").prepend('<div class="vi-wcaio-checkout-step-login"></div>'),o.$wrap.find(".vi-wcaio-checkout-step-login").replaceWith(i.find(".vi-wcaio-checkout-step-login"))),i.find(".vi-wcaio-checkout-nav-step-wrap").length&&(o.$wrap.find(".vi-wcaio-checkout-nav-step-wrap").length||o.$wrap.find(".vi-wcaio-checkout-step-wrap").prepend('<div class="vi-wcaio-checkout-nav-step-wrap"></div>'),o.$wrap.find(".vi-wcaio-checkout-nav-step-wrap").replaceWith(i.find(".vi-wcaio-checkout-nav-step-wrap"))),e.each([".vi-wcaio-checkout-before-checkout-form",".vi-wcaio-checkout-after-checkout-form"],function(e,c){o.$wrap.find(c).replaceWith(i.find(c))}),o.$wrap.find(".vi-wcaio-sidebar-cart-checkout-wrap").addClass("vi-wcaio-sidebar-cart-checkout-wrap-refresh"),o.$checkout_form.length&&o.$wrap.find("form.woocommerce-checkout").length?o.$checkout_form.html(i.find("form.woocommerce-checkout").html()):(o.$wrap.find(".woocommerce-error").remove(),o.$wrap.find(".vi-wcaio-checkout-before-checkout-form").after(i.find("form.woocommerce-checkout")),o.$checkout_form=o.$wrap.find("form.woocommerce-checkout")),o.$checkout_form.addClass("vi-wcaio-checkout-refreshed"),e("#ppc-button, .ppc-button-wrapper, #wc-stripe-payment-request-wrapper").each(function(c,o){e(o).closest(".vi-wcaio-sidebar-cart-content-wrap-checkout").length?e(o).css("display","block"):e(o).remove()}),"undefined"==typeof PayPalCommerceGateway||o.$checkout_form.find(PayPalCommerceGateway.button.wrapper).length||(o.$checkout_form.find("#payment").after('<div id="'+PayPalCommerceGateway.button.wrapper.replace("#","")+'"></div>'),o.$checkout_form.find(PayPalCommerceGateway.button.wrapper).css("display","block").parent().css("display","block")),o.$wrap.find(".vi-wcaio-checkout-nav-step-wrap").each(function(){let c=e(this).find(".vi-wcaio-checkout-nav-step").length;e(this).css({gridTemplateColumns:"repeat("+c+",1fr)",top:o.$wrap.find(".vi-wcaio-sidebar-cart-header-wrap").outerHeight()+"px"})});let r=o.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order"),n=o.$checkout_form.find("#place_order");if(r.hasClass("vi-wcaio-bt-disabled")&&n.length){let e=r.data("place_order_text")||r.attr("data-place_order_text");e=e?e.toString():"",r.removeClass("vi-wcaio-bt-disabled").html(e.replace(/{order_button_text}/g,n.html()||n.val()||n.data("value")))}if("undefined"!=typeof pco_wc_params){e(document).on("payment_method_selected",function(){1!==c.is_paysoncheckout&&e('input[name="payment_method"]#payment_method_paysoncheckout').prop("checked")&&e('input[name="payment_method"]:not(#payment_method_paysoncheckout)').eq(0).trigger("click")});
1try{o.$checkout_form.find(".woocommerce-additional-fields").appendTo("#pco-extra-checkout-fields");let c=o.$checkout_form.find("input, select, textarea");for(let t=0;t<c.length;t++){let a=c[t].name;o.$checkout_form.find("table.woocommerce-checkout-review-order-table").find(c[t]).length||-1===e.inArray(a,pco_wc_params.standard_woo_checkout_fields)&&(0<e("p#"+a+"_field").length?e("p#"+a+"_field").appendTo("#pco-extra-checkout-fields"):e('input[name="'+a+'"]').closest("p").appendTo("#pco-extra-checkout-fields"))}}catch(e){console.log("Failed to move order comments: ",e)}}}else console.log(t);i(a)},complete:function(){o.end_loading()},error:function(e){i(a)}})}),!a)return"Can not get form checkout, please reload page to try again";if(e("#pco_wc-js").length&&await e.getScript(e("#pco_wc-js").attr("src")),void 0!==window.wc_square_credit_card_payment_form_handler&&void 0!==window.viwcaio_wc_square_credit_card_payment_form_handler&&window.wc_square_credit_card_payment_form_handler.constructor(window.viwcaio_wc_square_credit_card_payment_form_handler),"undefined"!=typeof viwcaio_sc_checkout_js){if(viwcaio_sc_checkout_js?.refreshes&&viwcaio_sc_checkout_js.refreshes.length)for(let c of viwcaio_sc_checkout_js.refreshes)e(`#${c}-js`).length&&await e.getScript(e(`#${c}-js`).attr("src"));viwcaio_sc_checkout_js?.injects&&Object.keys(viwcaio_sc_checkout_js.injects).length&&await o.injects(Object.values(viwcaio_sc_checkout_js.injects))}return e("#mollie-in3-classic-handles-js").length&&o.$wrap.find(".vi-wcaio-sidebar-cart-checkout-wrap-refresh").removeClass("vi-wcaio-sidebar-cart-checkout-wrap-refresh"),""},init_checkout_form:function(e,c){o.get_checkout_form(e,c).then(function(e){e?vi_wcaio_show_message(e):o.$wrap.find(".vi-wcaio-sidebar-cart-bt-nav-checkout").length?o.$wrap.find(".vi-wcaio-sidebar-cart-bt-nav-checkout").trigger("click"):(o.$wrap.trigger("init_checkout"),o.$checkout_form.removeClass("vi-wcaio-checkout-refreshed"),o.$wrap.find(".vi-wcaio-sidebar-cart-checkout-wrap-empty").removeClass("vi-wcaio-sidebar-cart-checkout-wrap-empty"))})},injectScript:function(c){if(!e(`#${c.handle}-js-extra`).length&&void 0!==c.extra&&void 0!==c.extra.data&&c.extra.data&&e("body").append(`<script type="text/javascript" id="${c.handle}-js-extra">${c.extra.data}<\/script>`),!e(`#${c.handle}-js`).length){let o=document.createElement("script");o.id=`${c.handle}-js`,o.setAttribute("type","text/javascript"),o.setAttribute("src",c.src),e("body").append(o)}},injects:async function(e){if(e.length)for(let c of e)await o.injectScript(c)},open_checkout:function(e=null){if(e&&(e.preventDefault(),e.stopPropagation()),!o.$wrap.hasClass("vi-wcaio-sidebar-cart-content-wrap-customize")&&o.$wrap.find(".vi-wcaio-sidebar-cart-pd-empty").length)vi_wcaio_show_message(o.unavailable_checkout_text);else if(o.$wrap.find(".vi-wcaio-checkout-login-notice-warning").length)vi_wcaio_show_message(o.$wrap.find(".vi-wcaio-checkout-login-notice-warning").html());else if(o.wc_ajax_url&&o.$wrap.find(".vi-wcaio-sidebar-cart-checkout-wrap-refresh").length&&!o.$checkout_form.hasClass("vi-wcaio-checkout-refreshed")){let e={viwcaio_get_checkout:1,viwcaio_language:o.language,vicaio_nonce:o.nonce};o.$wrap.trigger("init_checkout_form",[e,o.wc_ajax_url.toString().replace("%%endpoint%%","viwcaio_get_checkout_form")])}else if(!o.wc_ajax_url||o.$wrap.find(".vi-wcaio-checkout-step").length&&(o.$checkout_form.length||o.$wrap.find(".vi-wcaio-checkout-login-notice").length))vi_wcaio_sc_toggle("show-checkout"),o.$wrap.trigger("init_checkout"),o.$checkout_form.removeClass("vi-wcaio-checkout-refreshed");else{let e={viwcaio_get_checkout:1,viwcaio_language:o.language,vicaio_nonce:o.nonce};o.$wrap.trigger("init_checkout_form",[e,o.wc_ajax_url.toString().replace("%%endpoint%%","viwcaio_get_checkout_form")])}},close_checkout:function(){vi_wcaio_sc_toggle("show")},toggle_terms:function(e){e.preventDefault(),e.stopPropagation();let c=o;if(c.$checkout_form.find(".woocommerce-terms-and-conditions").length)return c.$checkout_form.find(".woocommerce-terms-and-conditions").slideToggle(function(){var e=c.$checkout_form.find(".woocommerce-terms-and-conditions-link");c.$checkout_form.find(".woocommerce-terms-and-conditions").is(":visible")?(e.addClass("woocommerce-terms-and-conditions-link--open"),e.removeClass("woocommerce-terms-and-conditions-link--closed")):(e.removeClass("woocommerce-terms-and-conditions-link--open"),e.addClass("woocommerce-terms-and-conditions-link--closed"))}),!1},may_be_switch_step:function(){let c=o.$wrap.find(".vi-wcaio-checkout-step").index(o.$wrap.find(".vi-wcaio-checkout-step.vi-wcaio-checkout-step-current"));if(e(this).hasClass("vi-wcaio-sidebar-cart-bt-checkout-next")){let e=o.$wrap.find(".vi-wcaio-checkout-step").length;if(c===e-1&&e>1)return!1;o.validate()&&o.switch_step(c+1,o.$wrap)}else if(e(this).hasClass("vi-wcaio-sidebar-cart-bt-checkout-back")){if(0===c)return!1;o.switch_step(c-1,o.$wrap)}else{let t=o.$wrap.find(".vi-wcaio-checkout-nav-step").index(e(this));t<c||e(this).hasClass("vi-wcaio-checkout-step-selected")?o.switch_step(t,o.$wrap):o.validate()&&o.switch_step(c+1,o.$wrap)}},switch_step:function(c,t){if(c<0)return!1;if((t=e(t)).find(".wc-backward").length)return t.find(".wc-backward").closest(".is-error").length?t.find(".wc-backward").closest(".is-error").remove():t.find(".wc-backward").remove(),o.$wrap.addClass(".vi-wcaio-sidebar-cart-checkout-wrap-refresh"),o.$checkout_form.removeClass("vi-wcaio-checkout-refreshed"),void o.open_checkout();if(t.find(".vi-wcaio-checkout-step-wrap").removeClass("vi-wcaio-disabled"),e(".vi-wcaio-sidebar-cart-content-wrap1.vi-wcaio-sidebar-cart-checkout-wrap").length){t.find(".vi-wcaio-checkout-step").removeClass("vi-wcaio-checkout-step-current").addClass("vi-wcaio-disabled"),t.find(".vi-wcaio-checkout-step").eq(c).removeClass("vi-wcaio-disabled").addClass("vi-wcaio-checkout-step-current"),t.find(".vi-wcaio-checkout-nav-step.vi-wcaio-checkout-step-current").addClass("vi-wcaio-checkout-step-selected").removeClass("vi-wcaio-checkout-step-current"),t.find(".vi-wcaio-checkout-nav-step").eq(c).addClass("vi-wcaio-checkout-step-current"),t.find(".vi-wcaio-checkout-step").eq(c).find(".viwcuf-checkout-funnel-container").length&&"undefined"!=typeof viwcuf_upsell_funnel&&viwcuf_upsell_funnel.design(!0);let e=t.find(".vi-wcaio-checkout-step").length;e-c>1?(t.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").addClass("vi-wcaio-disabled"),t.find(".vi-wcaio-checkout-after-checkout-form").addClass("vi-wcaio-disabled"),t.find(".vi-wcaio-sidebar-cart-bt-checkout-next").removeClass("vi-wcaio-disabled")):(1===e&&0!==c||(t.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").removeClass("vi-wcaio-disabled"),t.find(".vi-wcaio-checkout-after-checkout-form").removeClass("vi-wcaio-disabled")),t.find(".vi-wcaio-sidebar-cart-bt-checkout-next").addClass("vi-wcaio-disabled")),c>0?(t.find(".vi-wcaio-sidebar-cart-bt-checkout-back").removeClass("vi-wcaio-disabled"),t.find(".vi-wcaio-checkout-step-login").length&&1===c?t.find(".vi-wcaio-checkout-before-checkout-form").removeClass("vi-wcaio-disabled"):t.find(".vi-wcaio-checkout-before-checkout-form").addClass("vi-wcaio-disabled")):(t.find(".vi-wcaio-checkout-step-current").hasClass("vi-wcaio-checkout-step-login")?t.find(".vi-wcaio-checkout-before-checkout-form").addClass("vi-wcaio-disabled"):t.find(".vi-wcaio-checkout-before-checkout-form").removeClass("vi-wcaio-disabled"),t.find(".vi-wcaio-sidebar-cart-bt-checkout-back").addClass("vi-wcaio-disabled")),t.find(".vi-wcaio-sidebar-cart-content-wrap1").scrollTop(0),o.$wrap.trigger("set_navs_button_text",[c,t])}else{t.find(".viwcuf-checkout-funnel-container").length&&"undefined"!=typeof viwcuf_upsell_funnel&&viwcuf_upsell_funnel.design(!0),e(".ship-to-different-address-checkbox").prop("selected")||t.find(".shipping_address").hide(),t.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").removeClass("vi-wcaio-disabled");let c=o.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").data("place_order_text")||o.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").attr("data-place_order_text");c=c?c.toString():"",o.$checkout_form.find("#place_order").length?o.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").removeClass("vi-wcaio-bt-disabled").html(c.replace(/{order_button_text}/g,o.$checkout_form.find("#place_order").html()||viwcaio_checkoutviwcaio_checkout.$checkout_form.find("#place_order").val()||o.$checkout_form.find("#place_order").data("value"))):o.$wrap.find(".vi-wcaio-sidebar-cart-bt-checkout-place_order").addClass("vi-wcaio-bt-disabled"),t.find(".vi-wcaio-checkout-before-checkout-form, .vi-wcaio-checkout-after-checkout-form").removeClass("vi-wcaio-disabled"),t.find(".vi-wcaio-sidebar-cart-content-wrap1").scrollTop(0)}o.country_select_select2()}
1,set_navs_button_text:function(c,o){let t="",a="",i=(o=e(o)).find(".vi-wcaio-sidebar-cart-bt-checkout-back").data("pre_text"),r=o.find(".vi-wcaio-sidebar-cart-bt-checkout-next").data("next_text");i||(i=o.find(".vi-wcaio-sidebar-cart-bt-checkout-back").attr("data-pre_text")),i=i?i.toString():"",r||(r=o.find(".vi-wcaio-sidebar-cart-bt-checkout-next").attr("data-next_text")),r=r?r.toString():"",-1!==r.indexOf("{next_title}")&&(t=0===c&&o.find(".vi-wcaio-checkout-step").eq(c).data("next_title")?o.find(".vi-wcaio-checkout-step").eq(c).data("next_title"):o.find(".vi-wcaio-checkout-step").eq(c+1).data("step_title"),o.find(".vi-wcaio-sidebar-cart-bt-checkout-next").html(r.replace(/{next_title}/g,t))),-1!==i.indexOf("{pre_title}")&&(a=c>0?o.find(".vi-wcaio-checkout-step").eq(c-1).data("step_title"):"",o.find(".vi-wcaio-sidebar-cart-bt-checkout-back").html(i.replace(/{pre_title}/g,a)))},country_select_select2:function(){o.$wrap.find("select:visible:not(.select2-hidden-accessible)").length&&e(document.body).trigger("country_to_state_changed")},validate:function(){if(!o.$wrap.hasClass("vi-wcaio-sidebar-cart-content-wrap-customize")){o.$wrap.find(".form-row").removeClass("woocommerce-invalid woocommerce-invalid-required-field woocommerce-invalid-email woocommerce-validated"),o.$wrap.find(".vi-wcaio-not-validate").removeClass("vi-wcaio-not-validate");let c=o.$checkout_form.find(".vi-wcaio-checkout-step.vi-wcaio-checkout-step-current #ship-to-different-address input"),t=o.$checkout_form.find("#coderockz_woo_delivery_pickup_date_section"),a=o.$checkout_form.find("#coderockz_woo_delivery_pickup_time_section"),i=o.$checkout_form.find(".vi-wcaio-checkout-step.vi-wcaio-checkout-step-current input#createaccount");if(t.length&&!t.is(":visible")&&t.find(".input-text, select, input:checkbox").addClass("vi-wcaio-not-validate"),a.length&&!a.is(":visible")&&a.find(".input-text, select, input:checkbox").addClass("vi-wcaio-not-validate"),c.length&&!c.is(":checked")&&c.closest(".woocommerce-shipping-fields").find(".input-text, select, input:checkbox").addClass("vi-wcaio-not-validate"),i.length&&!i.is(":checked")&&o.$checkout_form.find(".vi-wcaio-checkout-step.vi-wcaio-checkout-step-current .create-account").find(".input-text, select, input:checkbox").addClass("vi-wcaio-not-validate"),o.$checkout_form.find(".vi-wcaio-checkout-step.vi-wcaio-checkout-step-current .awcfe_cl_hidden ").length&&o.$checkout_form.find(".vi-wcaio-checkout-step.vi-wcaio-checkout-step-current .awcfe_cl_hidden").find(".input-text, select, input:checkbox").addClass("vi-wcaio-not-validate"),o.$wrap.find(".vi-wcaio-checkout-step.vi-wcaio-checkout-step-current").find(".input-text:not(.vi-wcaio-not-validate), select:not(.vi-wcaio-not-validate), input:checkbox:not(.vi-wcaio-not-validate)").trigger("validate"),o.$wrap.find(".vi-wcaio-checkout-step.vi-wcaio-checkout-step-current .woocommerce-invalid").length){let c=o.$wrap.find(".vi-wcaio-checkout-step.vi-wcaio-checkout-step-current .woocommerce-invalid");if(o.$wrap.find(".vi-wcaio-checkout-step.vi-wcaio-checkout-step-current .woocommerce-invalid").each(function(o,t){e(t).css("display").indexOf("none")>-1&&(e(t).removeClass("woocommerce-invalid"),c--)}),c)return vi_wcaio_show_message(o.invalid_text),!1}}return!0},start_loading:function(){e(" .vi-wcaio-sidebar-cart-loading-wrap").removeClass("vi-wcaio-disabled")},end_loading:function(){e(" .vi-wcaio-sidebar-cart-loading-wrap").addClass("vi-wcaio-disabled")}};window.viwcaio_checkout=o}(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.