PageSourceSearch

https://teachingamericanhistory.org/wp-content/plugins/woocommerce…-payment-gateway-payment-form.js?ver=5.10.4

js teachingamericanhistory.org collected 2026-09-24 08:44:43 UTC 9,208 bytes, 4 lines download raw bytes

1parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"JA8d":[function(require,module,exports) {
2function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e,t){for(var a=0;a<t.length;a++){var n=t[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function a(e,a,n){return a&&t(e.prototype,a),n&&t(e,n),e}(function(){var t=[].indexOf;jQuery(function(n){"use strict";return window.SV_WC_Payment_Form_Handler_v5_10_4=function(){function r(t){var a=this;if(e(this,r),this.id=t.id,this.id_dasherized=t.id_dasherized,this.plugin_id=t.plugin_id,this.type=t.type,this.csc_required=t.csc_required,this.csc_required_for_tokens=t.csc_required_for_tokens,this.enabled_card_types=t.enabled_card_types,n("form.checkout").length)this.form=n("form.checkout"),this.handle_checkout_page();else if(n("form#order_review").length)this.form=n("form#order_review"),this.handle_pay_page();else{if(!n("form#add_payment_method").length)return void console.log("No payment form found!");this.form=n("form#add_payment_method"),this.handle_add_payment_method_page()}this.params=window.sv_wc_payment_gateway_payment_form_params,"echeck"===this.type&&this.form.on("click",".js-sv-wc-payment-gateway-echeck-form-check-hint, .js-sv-wc-payment-gateway-echeck-form-sample-check",function(){return a.handle_sample_check_hint()}),n(document).trigger("sv_wc_payment_form_handler_init",{id:this.id,instance:this})}return a(r,[{key:"handle_checkout_page",value:function(){var e=this;return"credit-card"===this.type&&n(document.body).on("updated_checkout",function(){return e.format_credit_card_inputs()}),n(document.body).on("updated_checkout",function(){return e.set_payment_fields()}),n(document.body).on("updated_checkout",function(){return e.handle_saved_payment_methods()}),this.form.on("checkout_place_order_".concat(this.id),function(){return e.validate_payment_data()})}},{key:"handle_pay_page",value:function(){var e=this;return this.set_payment_fields(),"credit-card"===this.type&&this.format_credit_card_inputs(),this.handle_saved_payment_methods(),this.form.submit(function(){if(n("#order_review input[name=payment_method]:checked").val()===e.id)return e.validate_payment_data()})}},{key:"handle_add_payment_method_page",value:function(){var e=this;return this.set_payment_fields(),"credit-card"===this.type&&this.format_credit_card_inputs(),this.form.submit(function(){if(n("#add_payment_method input[name=payment_method]:checked").val()===e.id)return e.validate_payment_data()})}},{key:"set_payment_fields",value:function(){return this.payment_fields=n(".payment_method_".concat(this.id)),this.payment_fields.find(".validate-required .input-text").each(function(e,t){return!n(t).val()&&n(t).trigger("input")})}},{key:"validate_payment_data",value:function(){var e,t;return!this.form.is(".processing")&&(this.saved_payment_method_selected=this.payment_fields.find(".js-sv-wc-payment-gateway-payment-token:checked").val(),t="credit-card"===this.type?this.validate_card_data():this.validate_account_data(),e=!1!==n(document.body).triggerHandler("sv_wc_payment_form_valid_payment_data",{payment_form:this,passed_validation:t}),t&&e)}},{key:"format_credit_card_inputs",value:function(){var e,t,a,r=this;return e=n(".js-sv-wc-payment-gateway-credit-card-form-account-number").payment("formatCardNumber"),a=n(".js-sv-wc-payment-gateway-credit-card-form-expiry").payment("formatCardExpiry"),t=n(".js-sv-wc-payment-gateway-credit-card-form-csc").payment("formatCardCVC"),e.val()&&e.val().length>0&&e.trigger("change"),a.val()&&a.val().length>0&&a.trigger("change"),t.val()&&t.val().length>0&&t.trigger("change"),n(".js-sv-wc-payment-gateway-credit-card-form-input").on("change paste keyup",function(){return r.do_inline_credit_card_validation()})}},{key:"do_inline_credit_card_validation",value:function(){var e,a,r,i;return e=n(".js-sv-wc-payment-gateway-credit-card-form-account-number"),i=n(".js-sv-wc-payment-gateway-credit-card-form-expiry"),r=n(".js-sv-wc-payment-gateway-credit-card-form-csc"),a=n.payment.cardType(e.val()),t.call(this.enabled_card_types,a)<0?e.addClass("invalid-card-type"):e.removeClass("invalid-card-type"),n.payment.validateCardExpiry(i.payment("cardExpiryVal"))?i.addClass("identified"):i.removeClass("identified"),n.payment.validateCardCVC(r.val())?r.addClass("identified"):r.removeClass("identified")}},{key:"validate_card_data",value:function(){var e,t,a,r;return a=[],null!=(t=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-csc").val())&&(t?(/\D/.test(t)&&a.push(this.params.cvv_digits_invalid),(t.length<3||t.length>
24)&&a.push(this.params.cvv_length_invalid)):this.csc_required&&(this.saved_payment_method_selected&&!this.csc_required_for_tokens||a.push(this.params.cvv_missing))),this.saved_payment_method_selected||(e=this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(),r=n.payment.cardExpiryVal(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").val()),(e=e.replace(/-|\s/g,""))?((e.length<12||e.length>19)&&a.push(this.params.card_number_length_invalid),/\D/.test(e)&&a.push(this.params.card_number_digits_invalid),n.payment.validateCardNumber(e)||a.push(this.params.card_number_invalid)):a.push(this.params.card_number_missing),n.payment.validateCardExpiry(r)||a.push(this.params.card_exp_date_invalid)),a.length>0?(this.render_errors(a),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-credit-card-form-account-number").val(e),!0)}},{key:"validate_account_data",value:function(){var e,t,a;return!!this.saved_payment_method_selected||(t=[],a=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-routing-number").val(),e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(),a?(9!==a.length&&t.push(this.params.routing_number_length_invalid),/\D/.test(a)&&t.push(this.params.routing_number_digits_invalid)):t.push(this.params.routing_number_missing),e?((e.length<3||e.length>17)&&t.push(this.params.account_number_length_invalid),/\D/.test(e)&&t.push(this.params.account_number_invalid)):t.push(this.params.account_number_missing),t.length>0?(this.render_errors(t),!1):(this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-account-number").val(e),!0))}},{key:"render_errors",value:function(e){return n(".woocommerce-error, .woocommerce-message").remove(),this.form.prepend('<ul class="woocommerce-error"><li>'+e.join("</li><li>")+"</li></ul>"),this.form.removeClass("processing").unblock(),this.form.find(".input-text, select").blur(),n("html, body").animate({scrollTop:this.form.offset().top-100},1e3)}},{key:"handle_saved_payment_methods",value:function(){var e,t,a,r;if(r=this.id_dasherized,this.csc_required,a=this.csc_required_for_tokens,t=n("div.js-wc-".concat(r,"-new-payment-method-form")),e=t.find(".js-sv-wc-payment-gateway-credit-card-form-csc").closest(".form-row"),n("input.js-wc-".concat(this.id_dasherized,"-payment-token")).change(function(){if(n("input.js-wc-".concat(r,"-payment-token:checked")).val()){if(t.slideUp(200),a)return e.removeClass("form-row-last").addClass("form-row-first"),t.after(e)}else if(t.slideDown(200),a)return e.removeClass("form-row-first").addClass("form-row-last"),t.find(".js-sv-wc-payment-gateway-credit-card-form-expiry").closest(".form-row").after(e)}).change(),n("input#createaccount").change(function(){var e;return e=n("input.js-wc-".concat(r,"-tokenize-payment-method")).closest("p.form-row"),n(this).is(":checked")?(e.slideDown(),e.next().show()):(e.hide(),e.next().hide())}),!n("input#createaccount").is(":checked"))return n("input#createaccount").change()}},{key:"handle_sample_check_hint",value:function(){var e;return(e=this.payment_fields.find(".js-sv-wc-payment-gateway-echeck-form-sample-check")).is(":visible")?e.slideUp():e.slideDown()}},{key:"block_ui",value:function(){return this.form.block({message:null,overlayCSS:{background:"#fff",opacity:.6}})}},{key:"unblock_ui",value:function(){return this.form.unblock()}}]),r}(),n(document.body).trigger("sv_wc_payment_form_handler_v5_10_4_loaded")})}).call(this);
3},{}]},{},["JA8d"], null)
4//# sourceMappingURL=../frontend/sv-wc-payment-gateway-payment-form.js.map

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.