HEX
Server: Apache
System: Linux WWW 6.1.0-40-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.153-1 (2025-09-20) x86_64
User: web11 (1011)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: /var/www/epamokos.kaunokolegija.lt/wp-content/plugins/lifterlms/assets/js/llms-form-checkout.min.js
!function(l){window.llms=window.llms||{},window.llms.checkout=new function(){var s=[],o=[];return this.$checkout_form=l("#llms-product-purchase-form"),this.$confirm_form=l("#llms-product-purchase-confirm-form"),this.$form_sections=!1,this.form_action=!1,this.init=function(){var e=this;l(".llms-checkout-wrapper").length&&this.bind_login(),this.$checkout_form.length?(this.form_action="checkout",this.$form_sections=this.$checkout_form.find(".llms-checkout-section"),this.$checkout_form.on("submit",this,this.submit),document.querySelector("html").style.scrollBehavior="auto",l(".llms-password-strength-meter").length&&this.add_before_submit_event({data:LLMS.PasswordStrength,handler:LLMS.PasswordStrength.checkout}),this.bind_coupon(),this.bind_gateways(),l(document).trigger("llms-checkout-refreshed")):this.$confirm_form.length&&(this.form_action="confirm",this.$form_sections=this.$confirm_form.find(".llms-checkout-section"),this.$confirm_form.on("submit",function(){e.processing("start")}))},this.add_before_submit_event=function(e){e.handler&&"function"==typeof e.handler&&(e.data||(e.data=null),s.push(e))},this.add_error=function(e,t){var o="llms-checkout-errors";($err=l("#"+o)).length||($err=l('<ul class="llms-notice llms-error" id="'+o+'" />'),l(".llms-checkout-wrapper").prepend($err)),$err.append("<li>"+e+"</li>"),t&&console.error(t)},this.add_gateway=function(e){o.push(e)},this.bind_coupon=function(){var t=this;l('a[href="#llms-coupon-toggle"]').on("click",function(e){e.preventDefault(),l(".llms-coupon-entry").slideToggle(400)}),l("#llms-apply-coupon").on("click",function(e){e.preventDefault(),t.coupon_apply(l(this))}),l("#llms-remove-coupon").on("click",function(e){e.preventDefault(),t.coupon_remove(l(this))})},this.bind_gateways=function(){this.load_gateways(),l('input[name="llms_payment_gateway"]').length||l("#llms_create_pending_order").removeAttr("disabled"),l('input[name="llms_payment_gateway"]').on("change",function(){l('input[name="llms_payment_gateway"]').each(function(){var e=l(this),t=e.closest(".llms-payment-gateway"),o=t.find(".llms-gateway-fields").find("input, textarea, select"),s=e.is(":checked");t[s?"addClass":"removeClass"]("is-selected"),s?(o.removeAttr("disabled"),l(".llms-payment-gateways").trigger("llms-gateway-selected",{id:e.val(),$selector:t})):o.attr("disabled","disabled")})}),l(".llms-payment-gateways").on("llms-gateway-selected",function(e,t){var o=l("#llms_create_pending_order");t.$selector&&t.$selector.find(".llms-gateway-fields .invalid").length?o.attr("disabled","disabled"):o.removeAttr("disabled")})},this.bind_login=function(){l('a[href="#llms-show-login"]').on("click",function(e){e.preventDefault(),l(this).closest(".llms-info,.llms-notice").slideUp(400),l("form.llms-login").slideDown(400)})},this.clear_errors=function(){l("#llms-checkout-errors").remove()},this.coupon_apply=function(e){var o=this,t=l("#llms_coupon_code").val(),s=l(".llms-coupon-messages"),n=s.find(".llms-error"),r=l("form.llms-checkout");LLMS.Spinner.start(r),window.LLMS.Ajax.call({data:{action:"validate_coupon_code",code:t,plan_id:l("#llms-plan-id").val()},beforeSend:function(){n.hide()},success:function(e){var t;LLMS.Spinner.stop(r),"error"===e.code?(t=l("<li>"+e.message+"</li>"),n.length?n.empty():(n=l('<ul class="llms-notice llms-error" />'),s.append(n)),t.appendTo(n),n.show()):e.success&&(l(".llms-coupon-wrapper").replaceWith(e.data.coupon_html),o.bind_coupon(),l(".llms-payment-gateways").replaceWith(e.data.gateways_html),o.bind_gateways(),l(".llms-order-summary").replaceWith(e.data.summary_html),l(document).trigger("llms-checkout-refreshed"))}})},this.coupon_remove=function(e){var t=this,o=l("form.llms-checkout");LLMS.Spinner.start(o),window.LLMS.Ajax.call({data:{action:"remove_coupon_code",plan_id:l("#llms-plan-id").val()},success:function(e){LLMS.Spinner.stop(o),e.success&&(l(".llms-coupon-wrapper").replaceWith(e.data.coupon_html),t.bind_coupon(),l(".llms-order-summary").replaceWith(e.data.summary_html),l(".llms-payment-gateways").replaceWith(e.data.gateways_html),t.bind_gateways(),l(document).trigger("llms-checkout-refreshed"))}})},this.focus_errors=function(){l("html, body").animate({scrollTop:l("#llms-checkout-errors").offset().top-50},200)},this.load_gateways=function(){for(var e=0;e<=o.length;e++){var t=o[e];"object"==typeof t&&null!==t&&void 0!==t.bind&&"function"==typeof t.bind&&t.bind()}},this.processing=function(e){var t,o="stop"===e?"removeClass":"addClass";"checkout"===this.form_action?t=this.$checkout_form:"confirm"===this.form_action&&(t=this.$confirm_form),t[o]("llms-is-processing"),LLMS.Spinner[e](this.$form_sections)},this.submit=async function(e){var t=e.data;e.preventDefault(),t.processing("start"),t.clear_errors();try{for(const o of s)await function({handler:e,data:n}){return new Promise((t,o)=>{const s=setTimeout(()=>{o(new Error(LLMS.l10n.translate("Operation timed out, please try again")))},6e4);e(n,e=>{clearTimeout(s),!0===e?t():o("string"==typeof e?new Error(e):new Error(LLMS.l10n.translate("Unknown response")))})})}(o);t.$checkout_form.off("submit",t.submit),t.$checkout_form.trigger("submit"),t.processing("stop")}catch(e){t.add_error(e.message),t.focus_errors(),t.processing("stop")}},this.init(),this}}(jQuery);
//# sourceMappingURL=../maps/js/llms-form-checkout.min.js.map