diff --git a/assets/js/stripe-payment-request.min.js b/assets/js/stripe-payment-request.min.js index cb7796a3a..9439610ea 100644 --- a/assets/js/stripe-payment-request.min.js +++ b/assets/js/stripe-payment-request.min.js @@ -1 +1 @@ -jQuery(function(a){"use strict";var b=Stripe(wc_stripe_payment_request_params.stripe.key),c={getAjaxURL:function(a){return wc_stripe_payment_request_params.ajax_url.toString().replace("%%endpoint%%","wc_stripe_"+a)},getCartDetails:function(b){var d={security:wc_stripe_payment_request_params.nonce.payment};a.ajax({type:"POST",data:d,url:c.getAjaxURL("get_cart_details"),success:function(a){b.update({total:a.order_data.total})}})},getAttributes:function(){var b=a(".variations_form").find(".variations select"),c={},d=0,e=0;return b.each(function(){var b=a(this).data("attribute_name")||a(this).attr("name"),f=a(this).val()||"";f.length>0&&e++,d++,c[b]=f}),{count:d,chosenCount:e,data:c}},processSource:function(b,d){var e=c.getOrderData(b,d);return a.ajax({type:"POST",data:e,dataType:"json",url:c.getAjaxURL("create_order")})},getOrderData:function(a,b){var c=a.source,d=c.owner.email,e=c.owner.phone,f=c.owner.address,g=c.owner.name,h=a.shippingAddress,i={_wpnonce:wc_stripe_payment_request_params.nonce.checkout,billing_first_name:null!==g?g.split(" ").slice(0,1).join(" "):"",billing_last_name:null!==g?g.split(" ").slice(1).join(" "):"",billing_company:"",billing_email:null!==d?d:a.payerEmail,billing_phone:null!==e?e:a.payerPhone.replace("/[() -]/g",""),billing_country:null!==f?f.country:"",billing_address_1:null!==f?f.line1:"",billing_address_2:null!==f?f.line2:"",billing_city:null!==f?f.city:"",billing_state:null!==f?f.state:"",billing_postcode:null!==f?f.postal_code:"",shipping_first_name:"",shipping_last_name:"",shipping_company:"",shipping_country:"",shipping_address_1:"",shipping_address_2:"",shipping_city:"",shipping_state:"",shipping_postcode:"",shipping_method:[null===a.shippingOption?null:a.shippingOption.id],order_comments:"",payment_method:"stripe",ship_to_different_address:1,terms:1,stripe_source:JSON.stringify(c),payment_request_type:b};return h&&(i.shipping_first_name=h.recipient.split(" ").slice(0,1).join(" "),i.shipping_last_name=h.recipient.split(" ").slice(1).join(" "),i.shipping_company=h.organization,i.shipping_country=h.country,i.shipping_address_1=void 0===h.addressLine[0]?"":h.addressLine[0],i.shipping_address_2=void 0===h.addressLine[1]?"":h.addressLine[1],i.shipping_city=h.city,i.shipping_state=h.region,i.shipping_postcode=h.postalCode),i},getErrorMessageHTML:function(b){return a('
').text(b)},abortPayment:function(b,c){if(b.complete("fail"),a(".woocommerce-error").remove(),wc_stripe_payment_request_params.is_product_page){var d=a(".product");d.before(c),a("html, body").animate({scrollTop:d.prev(".woocommerce-error").offset().top},600)}else{var e=a(".shop_table.cart").closest("form");e.before(c),a("html, body").animate({scrollTop:e.prev(".woocommerce-error").offset().top},600)}},completePayment:function(a,b){c.block(),a.complete("success"),window.location=b},block:function(){a.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},updateShippingOptions:function(b,d){var e={security:wc_stripe_payment_request_params.nonce.shipping,country:d.country,state:d.region,postcode:d.postalCode,city:d.city,address:void 0===d.addressLine[0]?"":d.addressLine[0],address_2:void 0===d.addressLine[1]?"":d.addressLine[1]};return a.ajax({type:"POST",data:e,url:c.getAjaxURL("get_shipping_options")})},updateShippingDetails:function(b,d){var e={security:wc_stripe_payment_request_params.nonce.update_shipping,shipping_method:[d.id]};return a.ajax({type:"POST",data:e,url:c.getAjaxURL("update_shipping_method")})},addToCart:function(){var b=a(".single_add_to_cart_button").val();a(".single_variation_wrap").length&&(b=a(".single_variation_wrap").find('input[name="product_id"]').val());var d={security:wc_stripe_payment_request_params.nonce.add_to_cart,product_id:b,qty:a(".quantity .qty").val(),attributes:a(".variations_form").length?c.getAttributes().data:[]};return a.ajax({type:"POST",data:d,url:c.getAjaxURL("add_to_cart")})},clearCart:function(){var b={security:wc_stripe_payment_request_params.nonce.clear_cart};return a.ajax({type:"POST",data:b,url:c.getAjaxURL("clear_cart"),success:function(a){}})},getRequestOptionsFromLocal:function(){return{total:wc_stripe_payment_request_params.product.total,currency:wc_stripe_payment_request_params.checkout.currency_code,country:wc_stripe_payment_request_params.checkout.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:wc_stripe_payment_request_params.product.requestShipping,displayItems:wc_stripe_payment_request_params.product.displayItems}},startPaymentRequest:function(d){var e,f;wc_stripe_payment_request_params.is_product_page?(f=c.getRequestOptionsFromLocal(),e=f):(f={total:d.order_data.total,currency:d.order_data.currency,country:d.order_data.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:!!d.shipping_required,displayItems:d.order_data.displayItems},e=d.order_data);var g=b.paymentRequest(f),h="",i=b.elements({locale:wc_stripe_payment_request_params.button.locale}),j=i.create("paymentRequestButton",{paymentRequest:g,style:{paymentRequestButton:{type:wc_stripe_payment_request_params.button.type,theme:wc_stripe_payment_request_params.button.theme,height:wc_stripe_payment_request_params.button.height+"px"}}});g.canMakePayment().then(function(b){if(b){if(h=b.applePay?"apple_pay":"payment_request_api",wc_stripe_payment_request_params.is_product_page){var d=a(".single_add_to_cart_button");j.on("click",function(a){d.is(".disabled")?(a.preventDefault(),d.is(".wc-variation-is-unavailable")?window.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):d.is(".wc-variation-selection-needed")&&window.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text)):c.addToCart()}),a(document.body).on("woocommerce_variation_has_changed",function(){a("#wc-stripe-payment-request-button").block({message:null}),a.when(c.getSelectedProductData()).then(function(b){a.when(g.update({total:b.total,displayItems:b.displayItems})).then(function(){a("#wc-stripe-payment-request-button").unblock()})})}),a(".quantity").on("change",".qty",function(){a("#wc-stripe-payment-request-button").block({message:null}),a.when(c.getSelectedProductData()).then(function(b){a.when(g.update({total:b.total,displayItems:b.displayItems})).then(function(){a("#wc-stripe-payment-request-button").unblock()})})})}a("#wc-stripe-payment-request-button").length&&(j.mount("#wc-stripe-payment-request-button"),a("#wc-stripe-payment-request-button-separator").show())}else a("#wc-stripe-payment-request-button").hide(),a("#wc-stripe-payment-request-button-separator").hide()}),g.on("shippingaddresschange",function(b){a.when(c.updateShippingOptions(e,b.shippingAddress)).then(function(a){b.updateWith({status:a.result,shippingOptions:a.shipping_options,total:a.total,displayItems:a.displayItems})})}),g.on("shippingoptionchange",function(b){a.when(c.updateShippingDetails(e,b.shippingOption)).then(function(a){"success"===a.result&&b.updateWith({status:"success",total:a.total,displayItems:a.displayItems}),"fail"===a.result&&b.updateWith({status:"fail"})})}),g.on("source",function(b){"no"===wc_stripe_payment_request_params.stripe.allow_prepaid_card&&"prepaid"===b.source.card.funding?c.abortPayment(b,c.getErrorMessageHTML(wc_stripe_payment_request_params.i18n.no_prepaid_card)):a.when(c.processSource(b,h)).then(function(a){"success"===a.result?c.completePayment(b,a.redirect):c.abortPayment(b,a.messages)})})},getSelectedProductData:function(){var b=a(".single_add_to_cart_button").val();a(".single_variation_wrap").length&&(b=a(".single_variation_wrap").find('input[name="product_id"]').val());var d={security:wc_stripe_payment_request_params.nonce.get_selected_product_data,product_id:b,qty:a(".quantity .qty").val(),attributes:a(".variations_form").length?c.getAttributes().data:[]};return a.ajax({type:"POST",data:d,url:c.getAjaxURL("get_selected_product_data")})},init:function(){var b={security:wc_stripe_payment_request_params.nonce.payment};a.ajax({type:"POST",data:b,url:c.getAjaxURL("get_cart_details"),success:function(a){c.startPaymentRequest(a)}})}};c.init(),a(document.body).on("updated_cart_totals",function(){c.init()}),a(document.body).on("updated_checkout",function(){c.init()})}); \ No newline at end of file +jQuery(function(a){"use strict";var b=Stripe(wc_stripe_payment_request_params.stripe.key),c={getAjaxURL:function(a){return wc_stripe_payment_request_params.ajax_url.toString().replace("%%endpoint%%","wc_stripe_"+a)},getCartDetails:function(b){var d={security:wc_stripe_payment_request_params.nonce.payment};a.ajax({type:"POST",data:d,url:c.getAjaxURL("get_cart_details"),success:function(a){b.update({total:a.order_data.total})}})},getAttributes:function(){var b=a(".variations_form").find(".variations select"),c={},d=0,e=0;return b.each(function(){var b=a(this).data("attribute_name")||a(this).attr("name"),f=a(this).val()||"";f.length>0&&e++,d++,c[b]=f}),{count:d,chosenCount:e,data:c}},processSource:function(b,d){var e=c.getOrderData(b,d);return a.ajax({type:"POST",data:e,dataType:"json",url:c.getAjaxURL("create_order")})},getOrderData:function(a,b){var c=a.source,d=c.owner.email,e=c.owner.phone,f=c.owner.address,g=c.owner.name,h=a.shippingAddress,i={_wpnonce:wc_stripe_payment_request_params.nonce.checkout,billing_first_name:null!==g?g.split(" ").slice(0,1).join(" "):"",billing_last_name:null!==g?g.split(" ").slice(1).join(" "):"",billing_company:"",billing_email:null!==d?d:a.payerEmail,billing_phone:null!==e?e:a.payerPhone.replace("/[() -]/g",""),billing_country:null!==f?f.country:"",billing_address_1:null!==f?f.line1:"",billing_address_2:null!==f?f.line2:"",billing_city:null!==f?f.city:"",billing_state:null!==f?f.state:"",billing_postcode:null!==f?f.postal_code:"",shipping_first_name:"",shipping_last_name:"",shipping_company:"",shipping_country:"",shipping_address_1:"",shipping_address_2:"",shipping_city:"",shipping_state:"",shipping_postcode:"",shipping_method:[null===a.shippingOption?null:a.shippingOption.id],order_comments:"",payment_method:"stripe",ship_to_different_address:1,terms:1,stripe_source:JSON.stringify(c),payment_request_type:b};return h&&(i.shipping_first_name=h.recipient.split(" ").slice(0,1).join(" "),i.shipping_last_name=h.recipient.split(" ").slice(1).join(" "),i.shipping_company=h.organization,i.shipping_country=h.country,i.shipping_address_1="undefined"==typeof h.addressLine[0]?"":h.addressLine[0],i.shipping_address_2="undefined"==typeof h.addressLine[1]?"":h.addressLine[1],i.shipping_city=h.city,i.shipping_state=h.region,i.shipping_postcode=h.postalCode),i},getErrorMessageHTML:function(b){return a('').text(b)},abortPayment:function(b,c){if(b.complete("fail"),a(".woocommerce-error").remove(),wc_stripe_payment_request_params.is_product_page){var d=a(".product");d.before(c),a("html, body").animate({scrollTop:d.prev(".woocommerce-error").offset().top},600)}else{var e=a(".shop_table.cart").closest("form");e.before(c),a("html, body").animate({scrollTop:e.prev(".woocommerce-error").offset().top},600)}},completePayment:function(a,b){c.block(),a.complete("success"),window.location=b},block:function(){a.blockUI({message:null,overlayCSS:{background:"#fff",opacity:.6}})},updateShippingOptions:function(b,d){var e={security:wc_stripe_payment_request_params.nonce.shipping,country:d.country,state:d.region,postcode:d.postalCode,city:d.city,address:"undefined"==typeof d.addressLine[0]?"":d.addressLine[0],address_2:"undefined"==typeof d.addressLine[1]?"":d.addressLine[1]};return a.ajax({type:"POST",data:e,url:c.getAjaxURL("get_shipping_options")})},updateShippingDetails:function(b,d){var e={security:wc_stripe_payment_request_params.nonce.update_shipping,shipping_method:[d.id]};return a.ajax({type:"POST",data:e,url:c.getAjaxURL("update_shipping_method")})},addToCart:function(){var b=a(".single_add_to_cart_button").val();a(".single_variation_wrap").length&&(b=a(".single_variation_wrap").find('input[name="product_id"]').val());var d={security:wc_stripe_payment_request_params.nonce.add_to_cart,product_id:b,qty:a(".quantity .qty").val(),attributes:a(".variations_form").length?c.getAttributes().data:[]};return a.ajax({type:"POST",data:d,url:c.getAjaxURL("add_to_cart")})},clearCart:function(){var b={security:wc_stripe_payment_request_params.nonce.clear_cart};return a.ajax({type:"POST",data:b,url:c.getAjaxURL("clear_cart"),success:function(a){}})},getRequestOptionsFromLocal:function(){return{total:wc_stripe_payment_request_params.product.total,currency:wc_stripe_payment_request_params.checkout.currency_code,country:wc_stripe_payment_request_params.checkout.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:wc_stripe_payment_request_params.product.requestShipping,displayItems:wc_stripe_payment_request_params.product.displayItems}},startPaymentRequest:function(d){var e,f;wc_stripe_payment_request_params.is_product_page?(f=c.getRequestOptionsFromLocal(),e=f):(f={total:d.order_data.total,currency:d.order_data.currency,country:d.order_data.country_code,requestPayerName:!0,requestPayerEmail:!0,requestPayerPhone:!0,requestShipping:d.shipping_required?!0:!1,displayItems:d.order_data.displayItems},e=d.order_data);var g=b.paymentRequest(f),h="",i=b.elements({locale:wc_stripe_payment_request_params.button.locale}),j=i.create("paymentRequestButton",{paymentRequest:g,style:{paymentRequestButton:{type:wc_stripe_payment_request_params.button.type,theme:wc_stripe_payment_request_params.button.theme,height:wc_stripe_payment_request_params.button.height+"px"}}});g.canMakePayment().then(function(b){if(b){if(h=b.applePay?"apple_pay":"payment_request_api",wc_stripe_payment_request_params.is_product_page){var d=a(".single_add_to_cart_button");j.on("click",function(a){d.is(".disabled")?(a.preventDefault(),d.is(".wc-variation-is-unavailable")?window.alert(wc_add_to_cart_variation_params.i18n_unavailable_text):d.is(".wc-variation-selection-needed")&&window.alert(wc_add_to_cart_variation_params.i18n_make_a_selection_text)):c.addToCart()}),a(document.body).on("woocommerce_variation_has_changed",function(){a("#wc-stripe-payment-request-button").block({message:null}),a.when(c.getSelectedProductData()).then(function(b){a.when(g.update({total:b.total,displayItems:b.displayItems})).then(function(){a("#wc-stripe-payment-request-button").unblock()})})}),a(".quantity").on("change",".qty",function(){a("#wc-stripe-payment-request-button").block({message:null}),a.when(c.getSelectedProductData()).then(function(b){a.when(g.update({total:b.total,displayItems:b.displayItems})).then(function(){a("#wc-stripe-payment-request-button").unblock()})})})}a("#wc-stripe-payment-request-button").length&&(j.mount("#wc-stripe-payment-request-button"),a("#wc-stripe-payment-request-button-separator").show())}else a("#wc-stripe-payment-request-button").hide(),a("#wc-stripe-payment-request-button-separator").hide()}),g.on("shippingaddresschange",function(b){a.when(c.updateShippingOptions(e,b.shippingAddress)).then(function(a){b.updateWith({status:a.result,shippingOptions:a.shipping_options,total:a.total,displayItems:a.displayItems})})}),g.on("shippingoptionchange",function(b){a.when(c.updateShippingDetails(e,b.shippingOption)).then(function(a){"success"===a.result&&b.updateWith({status:"success",total:a.total,displayItems:a.displayItems}),"fail"===a.result&&b.updateWith({status:"fail"})})}),g.on("source",function(b){"no"===wc_stripe_payment_request_params.stripe.allow_prepaid_card&&"prepaid"===b.source.card.funding?c.abortPayment(b,c.getErrorMessageHTML(wc_stripe_payment_request_params.i18n.no_prepaid_card)):a.when(c.processSource(b,h)).then(function(a){"success"===a.result?c.completePayment(b,a.redirect):c.abortPayment(b,a.messages)})})},getSelectedProductData:function(){var b=a(".single_add_to_cart_button").val();a(".single_variation_wrap").length&&(b=a(".single_variation_wrap").find('input[name="product_id"]').val());var d={security:wc_stripe_payment_request_params.nonce.get_selected_product_data,product_id:b,qty:a(".quantity .qty").val(),attributes:a(".variations_form").length?c.getAttributes().data:[]};return a.ajax({type:"POST",data:d,url:c.getAjaxURL("get_selected_product_data")})},init:function(){var b={security:wc_stripe_payment_request_params.nonce.payment};a.ajax({type:"POST",data:b,url:c.getAjaxURL("get_cart_details"),success:function(a){c.startPaymentRequest(a)}})}};c.init(),a(document.body).on("updated_cart_totals",function(){c.init()}),a(document.body).on("updated_checkout",function(){c.init()})}); \ No newline at end of file diff --git a/assets/js/stripe.min.js b/assets/js/stripe.min.js index 1f1af4a7b..c1cc28bc9 100644 --- a/assets/js/stripe.min.js +++ b/assets/js/stripe.min.js @@ -1 +1 @@ -jQuery(function(a){"use strict";var b=Stripe(wc_stripe_params.key);if("yes"===wc_stripe_params.use_elements)var c,d,e,f=b.elements();var g={getAjaxURL:function(a){return wc_stripe_params.ajaxurl.toString().replace("%%endpoint%%","wc_stripe_"+a)},init:function(){"yes"===wc_stripe_params.is_change_payment_page&&a(document.body).trigger("wc-credit-card-form-init"),this.stripe_checkout_submit=!1,a("form.woocommerce-checkout").length&&(this.form=a("form.woocommerce-checkout")),a("form.woocommerce-checkout").on("checkout_place_order_stripe checkout_place_order_stripe_bancontact checkout_place_order_stripe_sofort checkout_place_order_stripe_giropay checkout_place_order_stripe_ideal checkout_place_order_stripe_alipay checkout_place_order_stripe_sepa checkout_place_order_stripe_bitcoin",this.onSubmit),a("form#order_review").length&&(this.form=a("form#order_review")),a("form#order_review").on("submit",this.onSubmit),a("form#add_payment_method").length&&(this.form=a("form#add_payment_method")),a("form#add_payment_method").on("submit",this.onSubmit),a("form.woocommerce-checkout").on("change","#stripe-bank-country",this.reset),a(document).on("stripeError",this.onError).on("checkout_error",this.reset);var b={base:{iconColor:"#666EE8",color:"#31325F",fontSize:"15px","::placeholder":{color:"#CFD7E0"}}},h={focus:"focused",empty:"empty",invalid:"invalid"};"yes"===wc_stripe_params.use_elements&&a("#stripe-card-element").length&&(b=wc_stripe_params.elements_styling?wc_stripe_params.elements_styling:b,h=wc_stripe_params.elements_classes?wc_stripe_params.elements_classes:h,"yes"===wc_stripe_params.inline_cc_form?(c=f.create("card",{style:b,hidePostalCode:!0}),c.addEventListener("change",function(b){g.onCCFormChange(),b.error&&a(document.body).trigger("stripeError",b)})):(c=f.create("cardNumber",{style:b,classes:h}),d=f.create("cardExpiry",{style:b,classes:h}),e=f.create("cardCvc",{style:b,classes:h}),c.addEventListener("change",function(b){g.onCCFormChange(),b.error&&a(document.body).trigger("stripeError",b)}),d.addEventListener("change",function(b){g.onCCFormChange(),b.error&&a(document.body).trigger("stripeError",b)}),e.addEventListener("change",function(b){g.onCCFormChange(),b.error&&a(document.body).trigger("stripeError",b)})),wc_stripe_params.is_checkout?a(document.body).on("updated_checkout",function(){c&&("yes"===wc_stripe_params.inline_cc_form?c.unmount("#stripe-card-element"):(c.unmount("#stripe-card-element"),d.unmount("#stripe-exp-element"),e.unmount("#stripe-cvc-element"))),"yes"===wc_stripe_params.inline_cc_form?c.mount("#stripe-card-element"):(c.mount("#stripe-card-element"),d.mount("#stripe-exp-element"),e.mount("#stripe-cvc-element"))}):(a("form#add_payment_method").length||a("form#order_review").length)&&("yes"===wc_stripe_params.inline_cc_form?c.mount("#stripe-card-element"):(c.mount("#stripe-card-element"),d.mount("#stripe-exp-element"),e.mount("#stripe-cvc-element"))))},isStripeChosen:function(){return a("#payment_method_stripe, #payment_method_stripe_bancontact, #payment_method_stripe_sofort, #payment_method_stripe_giropay, #payment_method_stripe_ideal, #payment_method_stripe_alipay, #payment_method_stripe_sepa, #payment_method_stripe_bitcoin").is(":checked")||"new"===a('input[name="wc-stripe-payment-token"]:checked').val()},isStripeSaveCardChosen:function(){return a("#payment_method_stripe").is(":checked")&&a('input[name="wc-stripe-payment-token"]').is(":checked")&&"new"!==a('input[name="wc-stripe-payment-token"]:checked').val()||a("#payment_method_stripe_sepa").is(":checked")&&a('input[name="wc-stripe_sepa-payment-token"]').is(":checked")&&"new"!==a('input[name="wc-stripe_sepa-payment-token"]:checked').val()},isStripeCardChosen:function(){return a("#payment_method_stripe").is(":checked")},isBancontactChosen:function(){return a("#payment_method_stripe_bancontact").is(":checked")},isGiropayChosen:function(){return a("#payment_method_stripe_giropay").is(":checked")},isIdealChosen:function(){return a("#payment_method_stripe_ideal").is(":checked")},isSofortChosen:function(){return a("#payment_method_stripe_sofort").is(":checked")},isAlipayChosen:function(){return a("#payment_method_stripe_alipay").is(":checked")},isSepaChosen:function(){return a("#payment_method_stripe_sepa").is(":checked")},isBitcoinChosen:function(){return a("#payment_method_stripe_bitcoin").is(":checked")},hasSource:function(){return 0'),b.append(""),g.stripe_submit=!0,a("form#add_payment_method").length&&a(g.form).off("submit",g.form.onSubmit),b.submit()};StripeCheckout.open({key:wc_stripe_params.key,billingAddress:"yes"===wc_stripe_params.stripe_checkout_require_billing_address,amount:c.data("amount"),name:c.data("name"),description:c.data("description"),currency:c.data("currency"),image:c.data("image"),bitcoin:c.data("bitcoin"),locale:c.data("locale"),email:a("#billing_email").val()||c.data("email"),panelLabel:c.data("panel-label"),allowRememberMe:c.data("allow-remember-me"),token:d,closed:g.onClose()})},resetModal:function(){g.reset(),g.stripe_checkout_submit=!1},onClose:function(){g.unblock()},onError:function(b,c){var d=c.error.message,e=g.getSelectedPaymentElement().parent(".wc_payment_method, .woocommerce-PaymentMethod").find(".stripe-source-errors");"invalid_request_error"!==c.error.type&&"api_connection_error"!==c.error.type&&"api_error"!==c.error.type&&"authentication_error"!==c.error.type&&"rate_limit_error"!==c.error.type||(d=wc_stripe_params.invalid_request_error),"card_error"===c.error.type&&wc_stripe_params.hasOwnProperty(c.error.code)&&(d=wc_stripe_params[c.error.code]),g.reset(),console.log(c.error.message),a(e).html('