!function(n,t,i,r){"use strict";function f(t,i){u=this;this.element=n(t);this.options=n.extend({},o,i);this._defaults=o;this._name=e;this.init()}var e="ripples",u=null,o={};f.prototype.init=function(){var i=this.element;i.on("mousedown touchstart",function(r){var h,f;if(!u.isTouch()||"mousedown"!==r.type){i.find(".ripple-wrapper").length||i.append('<div class="ripple-wrapper"><\/div>');var e=i.children(".ripple-wrapper"),o=u.getRelY(e,r),s=u.getRelX(e,r);(o||s)&&(h=u.getRipplesColor(i),f=n("<div><\/div>"),f.addClass("ripple").css({left:s,top:o,"background-color":h}),e.append(f),function(){return t.getComputedStyle(f[0]).opacity}(),u.rippleOn(i,f),setTimeout(function(){u.rippleEnd(f)},500),i.on("mouseup mouseleave touchend",function(){f.data("mousedown","off");"off"===f.data("animating")&&u.rippleOut(f)}))}})};f.prototype.getNewSize=function(n,t){return Math.max(n.outerWidth(),n.outerHeight())/t.outerWidth()*2.5};f.prototype.getRelX=function(n,t){var i=n.offset();return u.isTouch()?(t=t.originalEvent,1===t.touches.length?t.touches[0].pageX-i.left:!1):t.pageX-i.left};f.prototype.getRelY=function(n,t){var i=n.offset();return u.isTouch()?(t=t.originalEvent,1===t.touches.length?t.touches[0].pageY-i.top:!1):t.pageY-i.top};f.prototype.getRipplesColor=function(n){return n.data("ripple-color")?n.data("ripple-color"):t.getComputedStyle(n[0]).color};f.prototype.hasTransitionSupport=function(){var t=i.body||i.documentElement,n=t.style;return n.transition!==r||n.WebkitTransition!==r||n.MozTransition!==r||n.MsTransition!==r||n.OTransition!==r};f.prototype.isTouch=function(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)};f.prototype.rippleEnd=function(n){n.data("animating","off");"off"===n.data("mousedown")&&u.rippleOut(n)};f.prototype.rippleOut=function(n){n.off();u.hasTransitionSupport()?n.addClass("ripple-out"):n.animate({opacity:0},100,function(){n.trigger("transitionend")});n.on("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){n.remove()})};f.prototype.rippleOn=function(n,t){var i=u.getNewSize(n,t);u.hasTransitionSupport()?t.css({"-ms-transform":"scale("+i+")","-moz-transform":"scale("+i+")","-webkit-transform":"scale("+i+")",transform:"scale("+i+")"}).addClass("ripple-on").data("animating","on").data("mousedown","on"):t.animate({width:2*Math.max(n.outerWidth(),n.outerHeight()),height:2*Math.max(n.outerWidth(),n.outerHeight()),"margin-left":-1*Math.max(n.outerWidth(),n.outerHeight()),"margin-top":-1*Math.max(n.outerWidth(),n.outerHeight()),opacity:.2},500,function(){t.trigger("transitionend")})};n.fn.ripples=function(t){return this.each(function(){n.data(this,"plugin_"+e)||n.data(this,"plugin_"+e,new f(this,t))})}}(jQuery,window,document);!function(n){function t(n){return"undefined"==typeof n.which?!0:"number"==typeof n.which&&n.which>0?!n.ctrlKey&&!n.metaKey&&!n.altKey&&8!=n.which&&9!=n.which:!1}n.expr[":"].notmdproc=function(t){return n(t).data("mdproc")?!1:!0};n.material={options:{input:!0,ripples:!0,checkbox:!0,togglebutton:!0,radio:!0,arrive:!0,autofill:!1,withRipples:".btn:not(.btn-link),.card-image,.navbar a:not(.withoutripple),.dropdown-menu a,.nav-tabs a:not(.withoutripple),.withripple,.pagination li:not(.active):not(.disabled) a:not(.withoutripple)",inputElements:"input.form-control, textarea.form-control, select.form-control",checkboxElements:".checkbox > label > input[type=checkbox]",togglebuttonElements:".togglebutton > label > input[type=checkbox]",radioElements:".radio > label > input[type=radio]"},checkbox:function(t){n(t?t:this.options.checkboxElements).filter(":notmdproc").data("mdproc",!0).after("<span class=checkbox-material><span class=check><\/span><\/span>")},togglebutton:function(t){n(t?t:this.options.togglebuttonElements).filter(":notmdproc").data("mdproc",!0).after("<span class=toggle><\/span>")},radio:function(t){n(t?t:this.options.radioElements).filter(":notmdproc").data("mdproc",!0).after("<span class=circle><\/span><span class=check><\/span>")},input:function(t){n(t?t:this.options.inputElements).filter(":notmdproc").data("mdproc",!0).each(function(){var t=n(this),i,r;(t.attr("data-hint")||t.hasClass("floating-label"))&&((t.wrap("<div class=form-control-wrapper><\/div>"),t.after("<span class=material-input><\/span>"),t.hasClass("floating-label"))&&(i=t.attr("placeholder"),t.attr("placeholder",null).removeClass("floating-label"),t.after("<div class=floating-label>"+i+"<\/div>")),(t.attr("data-hint")&&t.after("<div class=hint>"+t.attr("data-hint")+"<\/div>"),(null===t.val()||"undefined"==t.val()||""===t.val())&&t.addClass("empty"),t.parent().next().is("[type=file]"))&&(t.parent().addClass("fileinput"),r=t.parent().next().detach(),t.after(r)))})},attachInputEventHandlers:function(){n(document).on("change",".checkbox input[type=checkbox]",function(){n(this).blur()}).on("keydown paste",".form-control",function(i){t(i)&&n(this).removeClass("empty")}).on("keyup change",".form-control",function(){var t=n(this);""!==t.val()||"undefined"!=typeof t[0].checkValidity&&!t[0].checkValidity()?t.removeClass("empty"):t.addClass("empty")}).on("focus",".form-control-wrapper.fileinput",function(){n(this).find("input").addClass("focus")}).on("blur",".form-control-wrapper.fileinput",function(){n(this).find("input").removeClass("focus")}).on("change",".form-control-wrapper.fileinput [type=file]",function(){var i=n(this),t="";n.each(this.files,function(n,i){t+=i.name+", "});t=t.substring(0,t.length-2);t?i.prev().removeClass("empty"):i.prev().addClass("empty");i.prev().val(t)})},ripples:function(t){n(t?t:this.options.withRipples).ripples()},autofill:function(){var t=setInterval(function(){n("input[type!=checkbox]").each(function(){var t=n(this);t.val()&&t.val()!==t.attr("value")&&t.trigger("change")})},100);setTimeout(function(){clearInterval(t)},1e4)},attachAutofillEventHandlers:function(){var t;n(document).on("focus","input",function(){var i=n(this).parents("form").find("input").not("[type=file]");t=setInterval(function(){i.each(function(){var t=n(this);t.val()!==t.attr("value")&&t.trigger("change")})},100)}).on("blur","input",function(){clearInterval(t)})},init:function(){var t=n(document);n.fn.ripples&&this.options.ripples&&this.ripples();this.options.input&&(this.input(),this.attachInputEventHandlers());this.options.checkbox&&this.checkbox();this.options.togglebutton&&this.togglebutton();this.options.radio&&this.radio();this.options.autofill&&(this.autofill(),this.attachAutofillEventHandlers());document.arrive&&this.options.arrive&&(n.fn.ripples&&this.options.ripples&&t.arrive(this.options.withRipples,function(){n.material.ripples(n(this))}),this.options.input&&t.arrive(this.options.inputElements,function(){n.material.input(n(this))}),this.options.checkbox&&t.arrive(this.options.checkboxElements,function(){n.material.checkbox(n(this))}),this.options.radio&&t.arrive(this.options.radioElements,function(){n.material.radio(n(this))}),this.options.togglebutton&&t.arrive(this.options.togglebuttonElements,function(){n.material.togglebutton(n(this))}))}}}(jQuery);!function(){var n,u,f,r,i,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot,st,ht,ct,lt,at,vt,yt,pt,wt,bt,kt,dt,gt,ni,ti,ii,ri,ui,t,fi,e,o,s,h,ei,c,oi,si,hi,ci,li,ai,vi,yi,pi,wi,bi,ki,di,gi,nr,ir=[].slice,tr=[].indexOf||function(n){for(var t=0,i=this.length;t<i;t++)if(t in this&&this[t]===n)return t;return-1};n=jQuery;n.formance={};n.formance.fn={};n.fn.formance=function(){var t,i;return i=arguments[0],t=2<=arguments.length?ir.call(arguments,1):[],n.formance.fn[i].apply(this,t)};vi=function(t){var r,i;return(r=n(t.target),t.metaKey||t.ctrlKey)?!0:t.which===32?!1:t.which===0?!0:t.which<33?!0:(i=String.fromCharCode(t.which),!!/[\d\s]/.test(i))};oi=function(t){var r,i;return(r=n(t.target),t.metaKey||t.ctrlKey)?!0:t.which===32?!1:t.which===0?!0:t.which<33?!0:(i=String.fromCharCode(t.which),!!/[\d\sA-Za-z]/.test(i))};t=function(n){var t;return n.prop("selectionStart")!=null&&n.prop("selectionStart")!==n.prop("selectionEnd")?!0:(typeof document!="undefined"&&document!==null?(t=document.selection)!=null?typeof t.createRange=="function"?t.createRange().text:void 0:void 0:void 0)?!0:!1};n.formance.fn.restrictNumeric=function(){this.on("keypress",vi);return this};n.formance.fn.restrictAlphaNumeric=function(){this.on("keypress",oi);return this};n.formance.fn.hasTextSelected=t;n=jQuery;t=n.formance.fn.hasTextSelected;i=/(\d{1,4})/g;r=[{type:"maestro",pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,format:i,length:[12,13,14,15,16,17,18,19],cvcLength:[3],luhn:!0},{type:"dinersclub",pattern:/^(36|38|30[0-5])/,format:i,length:[14,15,16,17,18,19],cvcLength:[3],luhn:!0},{type:"laser",pattern:/^(6706|6771|6709)/,format:i,length:[16,17,18,19],cvcLength:[3],luhn:!0},{type:"jcb",pattern:/^35/,format:i,length:[16,17,18,19],cvcLength:[3],luhn:!0},{type:"unionpay",pattern:/^62/,format:i,length:[16,17,18,19],cvcLength:[3],luhn:!1},{type:"discover",pattern:/^(6011|65|64[4-9]|622)/,format:i,length:[16,17,18,19],cvcLength:[3],luhn:!0},{type:"mastercard",pattern:/^5[1-5]/,format:i,length:[16],cvcLength:[3],luhn:!0},{type:"amex",pattern:/^3[47]/,format:/(\d{1,4})(\d{1,6})?(\d{1,5})?/,length:[15],cvcLength:[3,4],luhn:!0},{type:"visa",pattern:/^4/,format:i,length:[13,14,15,16,17,18,19],cvcLength:[3],luhn:!0}];u=function(n){var i,t,u;for(n=(n+"").replace(/\D/g,""),t=0,u=r.length;t<u;t++)if(i=r[t],i.pattern.test(n))return i};f=function(n){for(var i,t=0,u=r.length;t<u;t++)if(i=r[t],i.type===n)return i};si=function(t){var r,i,u;if(r=n(t.currentTarget),i=String.fromCharCode(t.which),/^\d+$/.test(i))return u=r.val()+i,u.length<=4};n.formance.fn.format_credit_card_cvc=function(){this.formance("restrictNumeric");this.on("keypress",si);return this};n.formance.fn.validate_credit_card_cvc=function(){var t,i,r,u;return(i=n(this).data("credit_card_type"),t=n(this).val(),t=n.trim(t),!/^\d+$/.test(t))?!1:i?(r=t.length,tr.call((u=f(i))!=null?u.cvcLength:void 0,r)>=0):t.length>=3&&t.length<=4};n=jQuery;t=n.formance.fn.hasTextSelected;ai=function(i){var u,f,r;if(u=n(i.currentTarget),f=String.fromCharCode(i.which),/^\d+$/.test(f))return t(u)?void 0:(r=u.val()+f,r=r.replace(/\D/g,""),r.length>6?!1:void 0)};ut=function(t){var r,u,i;if(u=String.fromCharCode(t.which),/^\d+$/.test(u))return(r=n(t.currentTarget),i=r.val()+u,/^\d$/.test(i)&&i!=="0"&&i!=="1")?(t.preventDefault(),r.val("0"+i+" / ")):/^\d\d$/.test(i)?(t.preventDefault(),r.val(""+i+" / ")):void 0};ot=function(t){var i,u,r;if(u=String.fromCharCode(t.which),/^\d+$/.test(u))return i=n(t.currentTarget),r=i.val(),/^\d\d$/.test(r)?i.val(""+r+" / "):void 0};ct=function(t){var r,u,i;if(u=String.fromCharCode(t.which),u==="/")return r=n(t.currentTarget),i=r.val(),/^\d$/.test(i)&&i!=="0"?r.val("0"+i+" / "):void 0};y=function(t){var i,r;if(!t.meta)return(i=n(t.currentTarget),r=i.val(),t.which!==8)?void 0:i.prop("selectionStart")!=null&&i.prop("selectionStart")!==r.length?void 0:/\d(\s|\/)+$/.test(r)?(t.preventDefault(),i.val(r.replace(/\d(\s|\/)*$/,""))):/\s\/\s?\d?$/.test(r)?(t.preventDefault(),i.val(r.replace(/\s\/\s?\d?$/,""))):void 0};n.formance.fn.format_credit_card_expiry=function(){this.formance("restrictNumeric");this.on("keypress",ai);this.on("keypress",ut);this.on("keypress",ct);this.on("keypress",ot);this.on("keydown",y);return this};e=function(n){var i,r,f,t,u;return f=n.replace(/\s/g,""),u=f.split("/",2),i=u[0],t=u[1],(t!=null?t.length:void 0)===2&&/^\d+$/.test(t)&&(r=(new Date).getFullYear(),r=r.toString().slice(0,2),t=r+t),i=parseInt(i,10),t=parseInt(t,10),{month:i,year:t}};n.formance.fn.val_credit_card_expiry=function(){var n;return(n=e(this.val()),n.month==null||isNaN(n.month))?!1:n.year==null||isNaN(n.year)?!1:new Date(n.year,n.month-1)};n.formance.fn.validate_credit_card_expiry=function(){var s,r,f,t,u,i,o;return(f=e(this.val()),t=f.month,i=f.year,typeof t=="object"&&"month"in t&&(o=t,t=o.month,i=o.year),!(t&&i))?!1:(t=n.trim(t),i=n.trim(i),!/^\d+$/.test(t))?!1:/^\d+$/.test(i)?(parseInt(t,10)<=12)?(i.length===2&&(u=(new Date).getFullYear(),u=u.toString().slice(0,2),i=u+i),r=new Date(i,t),s=new Date,r.setMonth(r.getMonth()-1),r.setMonth(r.getMonth()+1,1),r>s):!1:!1};n=jQuery;t=n.formance.fn.hasTextSelected;i=/(\d{1,4})/g;r=[{type:"maestro",pattern:/^(5018|5020|5038|6304|6759|676[1-3])/,format:i,length:[12,13,14,15,16,17,18,19],cvcLength:[3],luhn:!0},{type:"dinersclub",pattern:/^(36|38|30[0-5])/,format:i,length:[14,15,16,17,18,19],cvcLength:[3],luhn:!0},{type:"laser",pattern:/^(6706|6771|6709)/,format:i,length:[16,17,18,19],cvcLength:[3],luhn:!0},{type:"jcb",pattern:/^35/,format:i,length:[16,17,18,19],cvcLength:[3],luhn:!0},{type:"unionpay",pattern:/^62/,format:i,length:[16,17,18,19],cvcLength:[3],luhn:!1},{type:"discover",pattern:/^(6011|65|64[4-9]|622)/,format:i,length:[16,17,18,19],cvcLength:[3],luhn:!0},{type:"mastercard",pattern:/^5[1-5]/,format:i,length:[16],cvcLength:[3],luhn:!0},{type:"amex",pattern:/^3[47]/,format:/(\d{1,4})(\d{1,6})?(\d{1,5})?/,length:[15],cvcLength:[3,4],luhn:!0},{type:"visa",pattern:/^4/,format:i,length:[13,14,15,16,17,18,19],cvcLength:[3],luhn:!0}];u=function(n){var i,t,u;for(n=(n+"").replace(/\D/g,""),t=0,u=r.length;t<u;t++)if(i=r[t],i.pattern.test(n))return i};f=function(n){for(var i,t=0,u=r.length;t<u;t++)if(i=r[t],i.type===n)return i};fi=function(n){var t,r,u,f,i,e;for(u=!0,f=0,r=(n+"").split("").reverse(),i=0,e=r.length;i<e;i++)t=r[i],t=parseInt(t,10),(u=!u)&&(t*=2),t>9&&(t-=9),f+=t;return f%10==0};hi=function(i){var e,r,o,f;if(e=n(i.currentTarget),o=String.fromCharCode(i.which),/^\d+$/.test(o))return t(e)?void 0:(f=(e.val()+o).replace(/\D/g,""),r=u(f),r?f.length<=r.length[r.length.length-1]:f.length<=16)};ei=function(t){var i=this;return setTimeout(function(){var r,i;return r=n(t.currentTarget),i=r.val(),i=n.formance.formatCardNumber(i),r.val(i)})};tt=function(t){var f,e,r,h,o,s,i;if(r=String.fromCharCode(t.which),/^\d+$/.test(r))return(f=n(t.currentTarget),i=f.val(),e=u(i+r),h=(i.replace(/\D/g,"")+r).length,s=16,e&&(s=e.length[e.length.length-1]),h>=s)?void 0:f.prop("selectionStart")!=null&&f.prop("selectionStart")!==i.length?void 0:(o=e&&e.type==="amex"?/^(\d{4}|\d{4}\s\d{6})$/:/(?:^|\s)(\d{4})$/,o.test(i))?(t.preventDefault(),f.val(i+" "+r)):o.test(i+r)?(t.preventDefault(),f.val(i+r+" ")):void 0};l=function(t){var i,r;if(i=n(t.currentTarget),r=i.val(),!t.meta)return t.which!==8?void 0:i.prop("selectionStart")!=null&&i.prop("selectionStart")!==r.length?void 0:/\d\s$/.test(r)?(t.preventDefault(),i.val(r.replace(/\d\s$/,""))):/\s\d?$/.test(r)?(t.preventDefault(),i.val(r.replace(/\s\d?$/,""))):void 0};nr=function(t){var i,f,e,u,o;return i=n(t.currentTarget),o=i.val(),u=n.formance.creditCardType(o)||"unknown",i.hasClass(u)?void 0:(f=function(){var n,i,t;for(t=[],n=0,i=r.length;n<i;n++)e=r[n],t.push(e.type);return t}(),i.removeClass("unknown"),i.removeClass(f.join(" ")),i.addClass(u),i.toggleClass("identified",u!=="unknown"),i.trigger("payment.cardType",u))};n.formance.creditCardType=function(n){var t;return n?((t=u(n))!=null?t.type:void 0)||null:null};n.formance.formatCreditCardNumber=function(n){var t,i,r,f;return(t=u(n),!t)?n:(r=t.length[t.length.length-1],n=n.replace(/\D/g,""),n=n.slice(0,+r+1||9e9),t.format.global?(f=n.match(t.format))!=null?f.join(" "):void 0:(i=t.format.exec(n),i!=null&&i.shift(),i!=null?i.join(" "):void 0))};n.formance.fn.format_credit_card_number=function(){this.formance("restrictNumeric");this.on("keypress",hi);this.on("keypress",tt);this.on("keydown",l);this.on("keyup",nr);this.on("paste",ei);return this};n.formance.fn.validate_credit_card_number=function(){var i,t,r;return(t=n(this).val(),t=(t+"").replace(/\s+|-/g,""),!/^\d+$/.test(t))?!1:(i=u(t),!i)?!1:(r=t.length,tr.call(i.length,r)>=0)&&(i.luhn===!1||fi(t))};n=jQuery;t=n.formance.fn.hasTextSelected;ci=function(i){var u,f,r;if(u=n(i.currentTarget),f=String.fromCharCode(i.which),/^\d+$/.test(f))return t(u)?void 0:(r=u.val()+f,r=r.replace(/\D/g,""),r.length>8?!1:void 0)};it=function(t){var u,i,f,r;if(i=String.fromCharCode(t.which),/^\d+$/.test(i))return(u=n(t.currentTarget),f=u.val(),r=f+i,/^\d$/.test(r)&&i!=="0"&&i!=="1"&&i!=="2"&&i!=="3")?(t.preventDefault(),u.val("0"+r+" / ")):/^\d{2}$/.test(r)?(t.preventDefault(),u.val(""+r+" / ")):/^\d{2}\s\/\s\d$/.test(r)&&i!=="0"&&i!=="1"?(t.preventDefault(),u.val(""+f+"0"+i+" / ")):/^\d{2}\s\/\s\d{2}$/.test(r)?(t.preventDefault(),u.val(""+r+" / ")):void 0};ft=function(t){var r,u,i;if(u=String.fromCharCode(t.which),/^\d+$/.test(u))return r=n(t.currentTarget),i=r.val(),/^\d{2}$/.test(i)||/^\d{2}\s\/\s\d{2}$/.test(i)?r.val(""+i+" / "):void 0};st=function(t){var r,c,o,f,s,e,h,i,u;if(h=String.fromCharCode(t.which),h==="/")return(r=n(t.currentTarget),i=r.val(),s=/^(\d)$/,e=/^(\d{2})\s\/\s(\d)$/,s.test(i)&&i!=="0")?r.val("0"+i+" / "):e.test(i)&&(u=i.match(e),c=u[0],o=u[1],f=u[2],f!=="0")?r.val(""+o+" / 0"+f+" / "):void 0};a=function(t){var i,r;if(!t.meta)return(i=n(t.currentTarget),r=i.val(),t.which!==8)?void 0:i.prop("selectionStart")!=null&&i.prop("selectionStart")!==r.length?void 0:/\d(\s|\/)+$/.test(r)?(t.preventDefault(),i.val(r.replace(/\d(\s|\/)*$/,""))):/\s\/\s?\d?$/.test(r)?(t.preventDefault(),i.val(r.replace(/\s\/\s?\d?$/,""))):void 0};n.formance.fn.format_dd_mm_yyyy=function(){this.formance("restrictNumeric");this.on("keypress",ci);this.on("keypress",it);this.on("keypress",st);this.on("keypress",ft);this.on("keydown",a);return this};o=function(n){var i,r,t,u;return u=n!=null?n.replace(/\s/g,"").split("/",3):[NaN,NaN,NaN],i=u[0],r=u[1],t=u[2],t!=null&&t.length===4||(t=NaN),i=parseInt(i,10),r=parseInt(r,10),t=parseInt(t,10),{day:i,month:r,year:t}};n.formance.fn.val_dd_mm_yyyy=function(){var n;return(n=o(this.val()),n.day==null||isNaN(n.day))?!1:n.month==null||isNaN(n.month)?!1:n.year==null||isNaN(n.year)?!1:new Date(n.year,n.month-1,n.day)};n.formance.fn.validate_dd_mm_yyyy=function(){var n,t;return(t=o(this.val()),n=this.formance("val_dd_mm_yyyy"),!(n!=null&&n instanceof Date))?!1:n.getDate()!==t.day?!1:n.getMonth()+1!==t.month?!1:n.getFullYear()!==t.year?!1:!0};n=jQuery;t=n.formance.fn.hasTextSelected;n.formance.fn.format_email=function(){return this};n.formance.fn.validate_email=function(){var u,t,i,r;return(t={simple:/^\S+@\S+$/,complex:/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\ ".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA -Z\-0-9]+\.)+[a-zA-Z]{2,}))$/},u=n(this),i=u.val(),i==null)?!1:(r=u.data("formance_algorithm"),r!=null&&r in t)?t[r].test(i):t.simple.test(i)};n=jQuery;n.formance.fn.format_number=function(){var t;return t=n(this).data("formance_length"),t!=null&&n(this).attr("maxLength",t),this.formance("restrictNumeric"),this};n.formance.fn.validate_number=function(){var r,t,i;return(r=n(this),i=r.val(),t=r.data("formance_length"),t!=null&&typeof t=="number"&&i.length!==t)?!1:t!=null&&typeof t=="string"&&t!==""&&(isNaN(parseInt(t,10))||i.length!==parseInt(t,10))?!1:/^\d+$/.test(i)};n=jQuery;t=n.formance.fn.hasTextSelected;yi=function(i){var u,f,r;if(u=n(i.currentTarget),f=String.fromCharCode(i.which),/^[a-zA-Z\d]+$/.test(f))return t(u)?void 0:(r=u.val()+f,r=r.replace(/[^a-zA-Z\d]/g,""),r.length>15?!1:void 0)};yt=function(t){var r,f,u,i;if(f=String.fromCharCode(t.which),/^[a-zA-Z\d]+$/.test(f))if(r=n(t.currentTarget),u=r.val(),i=u+f.toUpperCase(),u===""){if(t.preventDefault(),/^[A-Za-z]$/.test(i))return r.val(i)}else if(/^[A-Za-z]\d{0,3}$/.test(u)){if(t.preventDefault(),/^[A-Za-z]\d{4}$/.test(i)&&(i=""+i+" - "),/^[A-Za-z]\d{0,4}[\s|\-]*$/.test(i))return r.val(i)}else if(/^[A-Za-z]\d{4}[\s|\-]*\d{0,4}$/.test(u)&&(t.preventDefault(),/^[A-Za-z]\d{4}[\s|\-]*\d{5}$/.test(i)&&(i=""+i+" - "),/^[A-Za-z]\d{4}[\s|\-]*\d{0,5}[\s|\-]*$/.test(i)))return r.val(i)};p=function(t){var i,r;if(!t.meta)return(i=n(t.currentTarget),r=i.val(),t.which!==8)?void 0:i.prop("selectionStart")!=null&&i.prop("selectionStart")!==r.length?void 0:/\d(\s|\-)+$/.test(r)?(t.preventDefault(),i.val(r.replace(/\d(\s|\-)+$/,""))):void 0};bt=function(t){var i=this;return setTimeout(function(){var r,u,s,f,e,o,i;return r=n(t.currentTarget),o=r.val(),i=o.match(/^([A-Za-z\d]{5})[\s|\-]*(\d{5})[\s|\-]*(\d{5})$/),s=i[0],u=i[1],e=i[2],f=i[3],r.val(""+u+" - "+e+" - "+f)})};n.formance.fn.format_ontario_drivers_license_number=function(){this.formance("restrictAlphaNumeric");this.on("keypress",yi);this.on("keypress",yt);this.on("keydown",p);this.on("paste",bt);return this};n.formance.fn.validate_ontario_drivers_license_number=function(){var i,t;return(t=n(this).val(),t==null)?!1:(t=t.replace(/[\s|\-]/g,""),!/^[a-zA-Z\d]+$/.test())?!1:(i=/^[A-Za-z]\d{4}[\s|\-]*\d{5}[\s|\-]*\d{5}$/,i.test(t))};n=jQuery;t=n.formance.fn.hasTextSelected;pi=function(i){var u,f,r;if(u=n(i.currentTarget),f=String.fromCharCode(i.which),/^\d+$/.test(f))return t(u)?void 0:(r=u.val()+f,r=r.replace(/\D/g,""),r.length>15?!1:void 0)};pt=function(t){var r,u,f,i;if(u=String.fromCharCode(t.which),/^\d+$/.test(u))return(r=n(t.currentTarget),f=r.val(),i=r.val()+u,f==="")?(t.preventDefault(),i=/^7$/.test(i)?"708158 ":"708158 "+i,r.val(i)):/^\d{5}$/.test(f)&&(t.preventDefault(),/^\d{6}$/.test(i)&&(i=""+i+" "),/^\d{6}\s*$/.test(i))?target.val(i):void 0};w=function(t){var i,r;if(!t.meta)return(i=n(t.currentTarget),r=i.val(),t.which!==8)?void 0:i.prop("selectionStart")!=null&&i.prop("selectionStart")!==r.length?void 0:/708158\s+$/.test(r)?(t.preventDefault(),i.val(r.replace(/708158\s+$/,""))):void 0};kt=function(t){var i=this;return setTimeout(function(){var r,u,o,f,e,i;return r=n(t.currentTarget),e=r.val(),i=e.match(/^(\d{6})\s*(\d{9})$/),o=i[0],u=i[1],f=i[2],r.val(""+u+" "+f)})};n.formance.fn.format_ontario_outdoors_card_number=function(){this.formance("restrictNumeric");this.on("keypress",pi);this.on("keypress",pt);this.on("keydown",w);this.on("paste",kt);return this};n.formance.fn.validate_ontario_outdoors_card_number=function(){var i,t;return(t=n(this).val(),t==null)?!1:(t=t.replace(/\s/g,""),!/^\d+$/.test(t))?!1:(i=/^708158\s*\d{9}$/,i.test(t))};n=jQuery;t=n.formance.fn.hasTextSelected;wi=function(i){var u,f,r;if(u=n(i.currentTarget),f=String.fromCharCode(i.which),/^[a-zA-Z\d]+$/.test(f))return t(u)?void 0:(r=u.val()+f,r=r.replace(/[^a-zA-Z\d]/g,""),r.length>12?!1:void 0)};wt=function(t){var r,f,u,i;if(f=String.fromCharCode(t.which),/^[a-zA-Z\d]+$/.test(f))if(r=n(t.currentTarget),u=r.val(),i=u+f.toUpperCase(),/^\d{0,3}$/.test(u)){if(t.preventDefault(),/^\d{4}$/.test(i)&&(i=""+i+" - "),/^\d{0,4}[\s|\-]*$/.test(i))return r.val(i)}else if(/^\d{4}[\s|\-]*\d{0,2}$/.test(u)){if(t.preventDefault(),/^\d{4}[\s|\-]*\d{3}$/.test(i)&&(i=""+i+" - "),/^\d{4}[\s|\-]*\d{0,3}[\s|\-]*$/.test(i))return r.val(i)}else if(/^\d{4}[\s|\-]*\d{3}[\s|\-]*\d{0,2}$/.test(u)){if(t.preventDefault(),/^\d{4}[\s|\-]*\d{3}[\s|\-]*\d{3}$/.test(i)&&(i=""+i+" - "),/^\d{4}[\s|\-]*\d{3}[\s|\-]*\d{0,3}[\s|\-]*$/.test(i))return r.val(i)}else if(/^\d{4}[\s|\-]*\d{3}[\s|\-]*\d{3}[\s|\-]*[A-Za-z]{0,1}$/.test(u)&&(t.preventDefault(),/^\d{4}[\s|\-]*\d{3}[\s|\-]*\d{3}[\s|\-]*[A-Za-z]{0,2}$/.test(i)))return r.val(i)};b=function(t){var i,r;if(!t.meta)return(i=n(t.currentTarget),r=i.val(),t.which!==8)?void 0:i.prop("selectionStart")!=null&&i.prop("selectionStart")!==r.length?void 0:/\d(\s|\-)+$/.test(r)?(t.preventDefault(),i.val(r.replace(/\d(\s|\-)+$/,""))):void 0};dt=function(t){var i=this;return setTimeout(function(){var r,u,h,f,e,o,s,i;return r=n(t.currentTarget),s=r.val(),i=s.match(/^(\d{4})[\s|\-]*(\d{3})[\s|\-]*(\d{3})[\s|\-]*([A-Za-z]{2})$/),h=i[0],u=i[1],e=i[2],o=i[3],f=i[4],r.val(""+u+" - "+e+" - "+o+" - "+f)})};n.formance.fn.format_ontario_photo_health_card_number=function(){this.formance("restrictAlphaNumeric");this.on("keypress",wi);this.on("keypress",wt);this.on("keydown",b);this.on("paste",dt);return this};n.formance.fn.validate_ontario_photo_health_card_number=function(){var i,t;return(t=n(this).val(),t==null)?!1:(t=t.replace(/[\s|\-]/g,""),!/^[a-zA-Z\d]+$/.test())?!1:(i=/^\d{4}[\s|\-]*\d{3}[\s|\-]*\d{3}[\s|\-]*[A-Za-z]{2}$/,i.test(t))};n=jQuery;t=n.formance.fn.hasTextSelected;c=function(n){var i,r,f,e,t,u;return e=n.replace(/\D/g,"").match(/^(\d{0,3})?(\d{0,3})?(\d{0,4})?$/),u=e,e=u[0],i=u[1],r=u[2],f=u[3],t="",i!=null&&(t+="("+i),(i!=null?i.length:void 0)===3&&(t+=") "),r!=null&&(t+=""+r),(r!=null?r.length:void 0)===3&&(t+=" - "),f!=null&&(t+=""+f),t};bi=function(i){var u,f,r;if(u=n(i.currentTarget),f=String.fromCharCode(i.which),/^\d+$/.test(f))return t(u)?void 0:(r=u.val()+f,r=r.replace(/\D/g,""),r.length>10?!1:void 0)};ti=function(t){var i,r,u,f;if(r=String.fromCharCode(t.which),/^\d+$/.test(r))return i=n(t.currentTarget),f=i.val()+r,u=c(f),t.preventDefault(),i.val(u)};k=function(t){var i,r;if(!t.meta)return(i=n(t.currentTarget),r=i.val(),t.which!==8)?void 0:i.prop("selectionStart")!=null&&i.prop("selectionStart")!==r.length?void 0:/\(\d$/.test(r)?(t.preventDefault(),i.val("")):/\d\)(\s)+$/.test(r)?(t.preventDefault(),i.val(r.replace(/\d\)(\s)*$/,""))):/\d(\s|\-)+$/.test(r)?(t.preventDefault(),i.val(r.replace(/\d(\s|\-)+$/,""))):void 0};gt=function(t){var i=this;return setTimeout(function(){var i,r,u;return i=n(t.currentTarget),u=i.val(),r=c(u),i.val(r)})};n.formance.fn.format_phone_number=function(){this.formance("restrictNumeric");this.on("keypress",bi);this.on("keypress",ti);this.on("keydown",k);this.on("paste",gt);return this};n.formance.fn.validate_phone_number=function(){var t;return(t=n(this).val(),t==null)?!1:(t=t.replace(/\(|\)|\s+|-/g,""),!/^\d+$/.test(t))?!1:t.replace(/\D/g,"").length===10};n=jQuery;t=n.formance.fn.hasTextSelected;ki=function(i){var u,f,r;if(u=n(i.currentTarget),f=String.fromCharCode(i.which),/^[a-zA-Z\d]+$/.test(f))return t(u)?void 0:(r=u.val()+f,r=r.replace(/[^a-zA-Z\d]/g,""),r.length>6?!1:void 0)};ii=function(t){var r,f,u,i;if(f=String.fromCharCode(t.which),/^[a-zA-Z\d]+$/.test(f))if(r=n(t.currentTarget),u=r.val(),i=u+f.toUpperCase(),u===""){if(t.preventDefault(),/^[ABCEFGHJKLMNPRSTVXY]$/.test(i))return r.val(i)}else if(/^[ABCEFGHJKLMNPRSTVXY]$/.test(u)){if(t.preventDefault(),/^[ABCEFGHJKLMNPRSTVXY][0-9]$/.test(i))return r.val(i)}else if(/^[ABCEFGHJKLMNPRSTVXY][0-9]$/.test(u)){if(t.preventDefault(),/^[ABCEFGHJKLMNPRSTVXY][0-9][ABCEFGHJKLMNPRSTVWXYZ]$/.test(i))return r.val(""+i+" ")}else if(/^[ABCEFGHJKLMNPRSTVXY][0-9][ABCEFGHJKLMNPRSTVWXYZ]\s$/.test(u)){if(t.preventDefault(),/^[ABCEFGHJKLMNPRSTVXY][0-9][ABCEFGHJKLMNPRSTVWXYZ]\s?[0-9]$/.test(i))return r.val(i)}else if(/^[ABCEFGHJKLMNPRSTVXY][0-9][ABCEFGHJKLMNPRSTVWXYZ]\s?[0-9]$/.test(u)){if(t.preventDefault(),/^[ABCEFGHJKLMNPRSTVXY][0-9][ABCEFGHJKLMNPRSTVWXYZ]\s?[0-9][ABCEFGHJKLMNPRSTVWXYZ]$/.test(i))return r.val(i)}else if(/^[ABCEFGHJKLMNPRSTVXY][0-9][ABCEFGHJKLMNPRSTVWXYZ]\s?[0-9][ABCEFGHJKLMNPRSTVWXYZ]$/.test(u)&&(t.preventDefault(),/^[ABCEFGHJKLMNPRSTVXY][0-9][ABCEFGHJKLMNPRSTVWXYZ]\s?[0-9][ABCEFGHJKLMNPRSTVWXYZ][0-9]$/.test(i)))return r.val(i)};d=function(t){var i,r;if(!t.meta)return(i=n(t.currentTarget),r=i.val(),t.which!==8)?void 0:i.prop("selectionStart")!=null&&i.prop("selectionStart")!==r.length?void 0:/[ABCEFGHJKLMNPRSTVWXYZ](\s)+$/.test(r)?(t.preventDefault(),i.val(r.replace(/[ABCEFGHJKLMNPRSTVWXYZ](\s)*$/,""))):void 0};ni=function(t){var i=this;return setTimeout(function(){var r,u,o,f,e,i;return r=n(t.currentTarget),e=r.val(),i=e.match(/^([ABCEFGHJKLMNPRSTVXY][0-9][ABCEFGHJKLMNPRSTVWXYZ])\s?([0-9][ABCEFGHJKLMNPRSTVWXYZ][0-9])$/),o=i[0],u=i[1],f=i[2],r.val(""+u+" "+f)})};n.formance.fn.format_postal_code=function(){this.formance("restrictAlphaNumeric");this.on("keypress",ki);this.on("keypress",ii);this.on("keydown",d);this.on("paste",ni);return this};n.formance.fn.validate_postal_code=function(){var t;return(t=n(this).val(),t==null)?!1:(t=t.replace(/\s+/g,""),!/^[a-zA-Z\d]+$/.test(t))?!1:(t=t.replace(/[^a-zA-Z\d]/g,""),/^[ABCEFGHJKLMNPRSTVXY][0-9][ABCEFGHJKLMNPRSTVWXYZ]\s?[0-9][ABCEFGHJKLMNPRSTVWXYZ][0-9]$/.test(t.toUpperCase()))};n=jQuery;t=n.formance.fn.hasTextSelected;di=function(i){var u,f,r;if(u=n(i.currentTarget),f=String.fromCharCode(i.which),/^\d+$/.test(f))return t(u)?void 0:(r=u.val()+f,r=r.replace(/\D/g,""),r.length>4?!1:void 0)};ri=function(t){var r,i,f,u;if(i=String.fromCharCode(t.which),/^\d+$/.test(i))return(r=n(t.currentTarget),f=r.val(),u=f+i,/^\d{2}$/.test(u))?(t.preventDefault(),r.val(""+u+" / ")):/^\d{2}\s\/\s\d{1}$/.test(u)&&i!=="0"&&i!=="1"?(t.preventDefault(),r.val(""+f+"0"+i)):void 0};at=function(t){var i,u,r;if(u=String.fromCharCode(t.which),/^\d+$/.test(u))return i=n(t.currentTarget),r=i.val(),/^\d{2}$/.test(r)?i.val(""+r+" / "):void 0};lt=function(t){var r,u,f,i;if(f=String.fromCharCode(t.which),f==="/")return r=n(t.currentTarget),i=r.val(),u=/^(\d)$/,u.test(i)&&i.length===2||i.length===1?r.val("0"+i+" / "):void 0};g=function(t){var i,r;if(!t.meta)return(i=n(t.currentTarget),r=i.val(),t.which!==8)?void 0:i.prop("selectionStart")!=null&&i.prop("selectionStart")!==r.length?void 0:/\d(\s|\/)+$/.test(r)?(t.preventDefault(),i.val(r.replace(/\d(\s|\/)*$/,""))):/\s\/\s?\d?$/.test(r)?(t.preventDefault(),i.val(r.replace(/\s\/\s?\d?$/,""))):void 0};n.formance.fn.format_time_yy_mm=function(){this.formance("restrictNumeric");this.on("keypress",di);this.on("keypress",ri);this.on("keypress",at);this.on("keypress",lt);this.on("keydown",g);return this};s=function(n){var t,i,r;return r=n!=null?n.replace(/\s/g,"").split("/",2):[NaN,NaN],i=r[0],t=r[1],t=parseInt(t,10),i=parseInt(i,10),{years:i,months:t}};n.formance.fn.val_time_yy_mm=function(){var n;return(n=s(this.val()),n.years==null||isNaN(n.years))?!1:n.months==null||isNaN(n.months)?!1:n};n.formance.fn.validate_time_yy_mm=function(){var t,i,r;return(i=s(this.val()),t=this.formance("val_time_yy_mm"),r=n(this).val(),t.months!==i.months)?!1:t.years!==i.years?!1:/^(\d{1}[\d{1}]*)[\s\/]*(\d{1}[\d{1}]*)[\s\/]*$/.test(r)?!0:!1};n=jQuery;t=n.formance.fn.hasTextSelected;gi=function(i){var u,f,r;if(u=n(i.currentTarget),f=String.fromCharCode(i.which),/^\d+$/.test(f))return t(u)?void 0:(r=u.val()+f,r=r.replace(/\D/g,""),r.length>6?!1:void 0)};vt=function(t){var r,u,i;if(u=String.fromCharCode(t.which),/^\d+$/.test(u))return r=n(t.currentTarget),i=r.val(),/^\d{2}$/.test(i)||/^\d{2}\s\-\s\d{2}$/.test(i)?r.val(""+i+" - "):void 0};nt=function(t){var i,r;if(!t.meta)return(i=n(t.currentTarget),r=i.val(),t.which!==8)?void 0:i.prop("selectionStart")!=null&&i.prop("selectionStart")!==r.length?void 0:/\d(\s|\-)+$/.test(r)?(t.preventDefault(),i.val(r.replace(/\d(\s|\-)+$/,""))):/\s\-\s?\d?$/.test(r)?(t.preventDefault(),i.val(r.replace(/\s\-\s?\d?$/,""))):void 0};ui=function(t){var r,u,f,i;if(u=String.fromCharCode(t.which),/^\d+$/.test(u))return(r=n(t.currentTarget),f=r.val(),i=f+u,/^\d{2}$/.test(i))?(t.preventDefault(),r.val(""+i+" - ")):/^\d{2}\s\-\s\d{2}$/.test(i)?(t.preventDefault(),r.val(""+i+" - ")):void 0};n.formance.fn.format_uk_sort_code=function(){this.formance("restrictNumeric");this.on("keypress",gi);this.on("keypress",ui);this.on("keypress",vt);this.on("keydown",nt);return this};n.formance.fn.validate_uk_sort_code=function(){var t;return(t=n(this).val(),/^(\d{2})[\s\-]*(\d{2})[\s\-]*(\d{2})[\s]*$/.test(t))?!0:!1};n=jQuery;t=n.formance.fn.hasTextSelected;li=function(i){var u,f,r;if(u=n(i.currentTarget),f=String.fromCharCode(i.which),/^\d+$/.test(f))return t(u)?void 0:(r=u.val()+f,r=r.replace(/\D/g,""),r.length>8?!1:void 0)};rt=function(t){var u,i,f,r;if(i=String.fromCharCode(t.which),/^\d+$/.test(i))return(u=n(t.currentTarget),f=u.val(),r=f+i,/^\d{4}$/.test(r))?(t.preventDefault(),u.val(""+r+" / ")):/^\d{4}\s\/\s\d$/.test(r)&&i!=="0"&&i!=="1"?(t.preventDefault(),u.val(""+f+"0"+i+" / ")):/^\d{4}\s\/\s\d{2}$/.test(r)?(t.preventDefault(),u.val(""+r+" / ")):/^\d{4}\s\/\s\d{2}\s\/\s\d$/.test(r)&&i!=="0"&&i!=="1"&&i!=="2"&&i!=="3"?(t.preventDefault(),u.val(""+f+"0"+i)):void 0};et=function(t){var r,u,i;if(u=String.fromCharCode(t.which),/^\d+$/.test(u))return r=n(t.currentTarget),i=r.val(),/^\d{4}$/.test(i)||/^\d{4}\s\/\s\d{2}$/.test(i)?r.val(""+i+" / "):void 0};ht=function(t){var r,h,u,f,o,e,s,i;if(o=String.fromCharCode(t.which),o==="/")return r=n(t.currentTarget),e=r.val(),f=/^(\d{4})\s\/\s(\d)$/,f.test(e)&&(i=e.match(f),h=i[0],s=i[1],u=i[2],u!=="0")?r.val(""+s+" / 0"+u+" / "):void 0};v=function(t){var i,r;if(!t.meta)return(i=n(t.currentTarget),r=i.val(),t.which!==8)?void 0:i.prop("selectionStart")!=null&&i.prop("selectionStart")!==r.length?void 0:/\d(\s|\/)+$/.test(r)?(t.preventDefault(),i.val(r.replace(/\d(\s|\/)*$/,""))):/\s\/\s?\d?$/.test(r)?(t.preventDefault(),i.val(r.replace(/\s\/\s?\d?$/,""))):void 0};n.formance.fn.format_yyyy_mm_dd=function(){this.formance("restrictNumeric");this.on("keypress",li);this.on("keypress",rt);this.on("keypress",ht);this.on("keypress",et);this.on("keydown",v);return this};h=function(n){var i,r,t,u;return u=n!=null?n.replace(/\s/g,"").split("/",3):[NaN,NaN,NaN],t=u[0],r=u[1],i=u[2],t!=null&&t.length===4||(t=NaN),i=parseInt(i,10),r=parseInt(r,10),t=parseInt(t,10),{day:i,month:r,year:t}};n.formance.fn.val_yyyy_mm_dd=function(){var n;return(n=h(this.val()),n.day==null||isNaN(n.day))?!1:n.month==null||isNaN(n.month)?!1:n.year==null||isNaN(n.year)?!1:new Date(n.year,n.month-1,n.day)};n.formance.fn.validate_yyyy_mm_dd=function(){var n,t;return(t=h(this.val()),n=this.formance("val_yyyy_mm_dd"),!(n!=null&&n instanceof Date))?!1:n.getDate()!==t.day?!1:n.getMonth()+1!==t.month?!1:n.getFullYear()!==t.year?!1:!0}}.call(this),function(){var n,r,v,i,t,y,p,w,b,k,d,o,g,s,h,l,c,u,nt,tt,it,f,e,a,ut=[].slice,rt=[].indexOf||function(n){for(var t=0,i=this.length;i>t;t++)if(t in this&&this[t]===n)return t;return-1};n=window.jQuery||window.Zepto||window.$;n.payment={};n.payment.fn={};n.fn.payment=function(){var t,i;return i=arguments[0],t=2<=arguments.length?ut.call(arguments,1):[],n.payment.fn[i].apply(this,t)};t=/(\d{1,4})/g;n.payment.cards=i=[{type:"visaelectron",patterns:[4026,417500,4405,4508,4844,4913,4917],format:t,length:[16],cvcLength:[3],luhn:!0},{type:"maestro",patterns:[5018,502,503,56,58,639,6220,67],format:t,length:[12,13,14,15,16,17,18,19],cvcLength:[3],luhn:!0},{type:"forbrugsforeningen",patterns:[600],format:t,length:[16],cvcLength:[3],luhn:!0},{type:"dankort",patterns:[5019],format:t,length:[16],cvcLength:[3],luhn:!0},{type:"visa",patterns:[4],format:t,length:[13,16,19],cvcLength:[3],luhn:!0},{type:"mastercard",patterns:[51,52,53,54,55,22,23,24,25,26,27],format:t,length:[16],cvcLength:[3],luhn:!0},{type:"amex",patterns:[34,37],format:/(\d{1,4})(\d{1,6})?(\d{1,5})?/,length:[15],cvcLength:[3,4],luhn:!0},{type:"dinersclub",patterns:[30,36,38,39],format:/(\d{1,4})(\d{1,6})?(\d{1,4})?/,length:[14,15,16,17,18,19],cvcLength:[3],luhn:!0},{type:"discover",patterns:[60,64,65,622],format:t,length:[16,17,18,19],cvcLength:[3],luhn:!0},{type:"unionpay",patterns:[62,88],format:t,length:[16,17,18,19],cvcLength:[3],luhn:!1},{type:"jcb",patterns:[35],format:t,length:[16,17,18,19],cvcLength:[3],luhn:!0}];r=function(n){var u,f,o,t,r,s,h,e;for(n=(n+"").replace(/\D/g,""),t=0,s=i.length;s>t;t++)for(u=i[t],e=u.patterns,r=0,h=e.length;h>r;r++)if(o=e[r],f=o+"",n.substr(0,f.length)===f)return u};v=function(n){for(var r,t=0,u=i.length;u>t;t++)if(r=i[t],r.type===n)return r};g=function(n){var t,r,u,f,i,e;for(u=!0,f=0,r=(n+"").split("").reverse(),i=0,e=r.length;e>i;i++)t=r[i],t=parseInt(t,10),(u=!u)&&(t*=2),t>9&&(t-=9),f+=t;return f%10==0};o=function(n){var t;return null!=n.prop("selectionStart")&&n.prop("selectionStart")!==n.prop("selectionEnd")?!0:null!=("undefined"!=typeof document&&null!==document&&null!=(t=document.selection)?t.createRange:void 0)&&document.selection.createRange().text?!0:!1};e=function(n,t){var i,u,r;try{i=t.prop("selectionStart")}catch(f){u=f;i=null}return r=t.val(),t.val(n),null!==i&&t.is(":focus")?(i===r.length&&(i=n.length),t.prop("selectionStart",i),t.prop("selectionEnd",i)):void 0};u=function(n){var r,t,e,o,u,f,i,s;for(null==n&&(n=""),e="０１２３４５６７８９",o="0123456789",f="",r=n.split(""),i=0,s=r.length;s>i;i++)t=r[i],u=e.indexOf(t),u>-1&&(t=o[u]),f+=t;return f};c=function(t){var i;return i=n(t.currentTarget),setTimeout(function(){var n;return n=i.val(),n=u(n),n=n.replace(/\D/g,""),e(n,i)})};h=function(t){var i;return i=n(t.currentTarget),setTimeout(function(){var t;return t=i.val(),t=u(t),t=n.payment.formatCardNumber(t),e(t,i)})};w=function(t){var f,e,u,h,o,s,i;return u=String.fromCharCode(t.which),!/^\d+$/.test(u)||(f=n(t.currentTarget),i=f.val(),e=r(i+u),h=(i.replace(/\D/g,"")+u).length,s=16,e&&(s=e.length[e.length.length-1]),h>=s||null!=f.prop("selectionStart")&&f.prop("selectionStart")!==i.length)?void 0:(o=e&&"amex"===e.type?/^(\d{4}|\d{4}\s\d{6})$/:/(?:^|\s)(\d{4})$/,o.test(i)?(t.preventDefault(),setTimeout(function(){return f.val(i+" "+u)})):o.test(i+u)?(t.preventDefault(),setTimeout(function(){return f.val(i+u+" ")})):void 0)};y=function(t){var i,r;return i=n(t.currentTarget),r=i.val(),8!==t.which||null!=i.prop("selectionStart")&&i.prop("selectionStart")!==r.length?void 0:/\d\s$/.test(r)?(t.preventDefault(),setTimeout(function(){return i.val(r.replace(/\d\s$/,""))})):/\s\d?$/.test(r)?(t.preventDefault(),setTimeout(function(){return i.val(r.replace(/\d$/,""))})):void 0};l=function(t){var i;return i=n(t.currentTarget),setTimeout(function(){var t;return t=i.val(),t=u(t),t=n.payment.formatExpiry(t),e(t,i)})};b=function(t){var r,u,i;return u=String.fromCharCode(t.which),/^\d+$/.test(u)?(r=n(t.currentTarget),i=r.val()+u,/^\d$/.test(i)&&"0"!==i&&"1"!==i?(t.preventDefault(),setTimeout(function(){return r.val("0"+i+" / ")})):/^\d\d$/.test(i)?(t.preventDefault(),setTimeout(function(){var n,t;return n=parseInt(i[0],10),t=parseInt(i[1],10),t>2&&0!==n?r.val("0"+n+" / "+t):r.val(""+i+" / ")})):void 0):void 0};k=function(t){var i,u,r;return u=String.fromCharCode(t.which),/^\d+$/.test(u)?(i=n(t.currentTarget),r=i.val(),/^\d\d$/.test(r)?i.val(""+r+" / "):void 0):void 0};d=function(t){var r,i,u;return u=String.fromCharCode(t.which),"/"===u||" "===u?(r=n(t.currentTarget),i=r.val(),/^\d$/.test(i)&&"0"!==i?r.val("0"+i+" / "):void 0):void 0};p=function(t){var i,r;return i=n(t.currentTarget),r=i.val(),8!==t.which||null!=i.prop("selectionStart")&&i.prop("selectionStart")!==r.length?void 0:/\d\s\/\s$/.test(r)?(t.preventDefault(),setTimeout(function(){return i.val(r.replace(/\d\s\/\s$/,""))})):void 0};s=function(t){var i;return i=n(t.currentTarget),setTimeout(function(){var n;return n=i.val(),n=u(n),n=n.replace(/\D/g,"").slice(0,4),e(n,i)})};f=function(n){var t;return n.metaKey||n.ctrlKey?!0:32===n.which?!1:0===n.which?!0:n.which<33?!0:(t=String.fromCharCode(n.which),!!/[\d\s]/.test(t))};tt=function(t){var f,i,e,u;return f=n(t.currentTarget),e=String.fromCharCode(t.which),/^\d+$/.test(e)&&!o(f)?(u=(f.val()+e).replace(/\D/g,""),i=r(u),i?u.length<=i.length[i.length.length-1]:u.length<=16):void 0};it=function(t){var r,u,i;return r=n(t.currentTarget),u=String.fromCharCode(t.which),/^\d+$/.test(u)&&!o(r)?(i=r.val()+u,i=i.replace(/\D/g,""),i.length>6?!1:void 0):void 0};nt=function(t){var i,r,u;return i=n(t.currentTarget),r=String.fromCharCode(t.which),/^\d+$/.test(r)&&!o(i)?(u=i.val()+r,u.length<=4):void 0};a=function(t){var r,f,e,u,o;return r=n(t.currentTarget),o=r.val(),u=n.payment.cardType(o)||"unknown",r.hasClass(u)?void 0:(f=function(){var n,r,t;for(t=[],n=0,r=i.length;r>n;n++)e=i[n],t.push(e.type);return t}(),r.removeClass("unknown"),r.removeClass(f.join(" ")),r.addClass(u),r.toggleClass("identified","unknown"!==u),r.trigger("payment.cardType",u))};n.payment.fn.formatCardCVC=function(){return this.on("keypress",f),this.on("keypress",nt),this.on("paste",s),this.on("change",s),this.on("input",s),this};n.payment.fn.formatCardExpiry=function(){return this.on("keypress",f),this.on("keypress",it),this.on("keypress",b),this.on("keypress",d),this.on("keypress",k),this.on("keydown",p),this.on("change",l),this.on("input",l),this};n.payment.fn.formatCardNumber=function(){return this.on("keypress",f),this.on("keypress",tt),this.on("keypress",w),this.on("keydown",y),this.on("keyup",a),this.on("paste",h),this.on("change",h),this.on("input",h),this.on("input",a),this};n.payment.fn.restrictNumeric=function(){return this.on("keypress",f),this.on("paste",c),this.on("change",c),this.on("input",c),this};n.payment.fn.cardExpiryVal=function(){return n.payment.cardExpiryVal(n(this).val())};n.payment.cardExpiryVal=function(n){var i,r,t,u;return u=n.split(/[\s\/]+/,2),i=u[0],t=u[1],2===(null!=t?t.length:void 0)&&/^\d+$/.test(t)&&(r=(new Date).getFullYear(),r=r.toString().slice(0,2),t=r+t),i=parseInt(i,10),t=parseInt(t,10),{month:i,year:t}};n.payment.validateCardNumber=function(n){var t,i;return n=(n+"").replace(/\s+|-/g,""),/^\d+$/.test(n)?(t=r(n),t?(i=n.length,rt.call(t.length,i)>=0&&(t.luhn===!1||g(n))):!1):!1};n.payment.validateCardExpiry=function(t,i){var f,r,u;return"object"==typeof t&&"month"in t&&(u=t,t=u.month,i=u.year),t&&i?(t=n.trim(t),i=n.trim(i),/^\d+$/.test(t)&&/^\d+$/.test(i)&&t>=1&&12>=t?(2===i.length&&(i=70>i?"20"+i:"19"+i),4!==i.length?!1:(r=new Date(i,t),f=new Date,r.setMonth(r.getMonth()-1),r.setMonth(r.getMonth()+1,1),r>f)):!1):!1};n.payment.validateCardCVC=function(t,i){var r,u;return t=n.trim(t),/^\d+$/.test(t)?(r=v(i),null!=r?(u=t.length,rt.call(r.cvcLength,u)>=0):t.length>=3&&t.length<=4):!1};n.payment.cardType=function(n){var t;return n?(null!=(t=r(n))?t.type:void 0)||null:null};n.payment.formatCardNumber=function(t){var i,u,f,e;return t=t.replace(/\D/g,""),(i=r(t))?(f=i.length[i.length.length-1],t=t.slice(0,f),i.format.global?null!=(e=t.match(i.format))?e.join(" "):void 0:(u=i.format.exec(t),null!=u?(u.shift(),u=n.grep(u,function(n){return n}),u.join(" ")):void 0)):t};n.payment.formatExpiry=function(n){var t,r,i,u;return(r=n.match(/^\D*(\d{1,2})(\D+)?(\d{1,4})?/))?(t=r[1]||"",i=r[2]||"",u=r[3]||"",u.length>0?i=" / ":" /"===i?(t=t.substring(0,1),i=""):2===t.length||i.length>0?i=" / ":1===t.length&&"0"!==t&&"1"!==t&&(t="0"+t,i=" / "),t+i+u):""}}.call(this)