Nic=window.Nic||{},Nic.CustomScripts=Nic.CustomScripts||{},Nic.CustomScripts.cardValidator=Nic.CustomScripts.cardValidator||{},Nic.CustomScripts.cardValidator=function(){function t(n){var t,h,r,e,i,u,c,l,o,s,f;try{for(t=[],h=n.length,r=h-2;r>=0;r=r-2)t.push(Number(n[r])*2);for(e=0,i=0;i<=t.length-1;i++){if(u=0,Number(t[i])>9)for(c=t[i].toString(),l=c.length,o=0;o<l;o++)u=u+Number(c.charAt(o));else u=t[i];e=e+u}for(s=0,f=h-1;f>=0;f=f-2)s=s+Number(n[f]);return(s+e)%10==0}catch(a){return!1}}var n=function(){};return n.prototype.isValidCreditCard=function(n,i){var r=null,u;switch(n){case"VISA":r="^4[0-9]{3}[0-9]{4}[0-9]{4}[0-9]{4}$";break;case"MAST":r="(^5[1-5]|^2[2-7])[0-9]{2}-?[0-9]{4}-?[0-9]{4}-?[0-9]{4}$";break;case"DISC":r="^6011-?[0-9]{4}-?[0-9]{4}-?[0-9]{4}$";break;case"DCUP":r="(^6221-?(2[6-9]|[3-9][0-9])\\d{2}-?\\d{4}-?\\d{4}$)|(^622[2-8]-?\\d{4}-?\\d{4}-?\\d{4}$)|(^6229-?([0-1][0-9]|2[0-5])\\d{2}-?\\d{4}-?\\d{4}$)|(^62[4-6][0-9]-?\\d{4}-?\\d{4}-?\\d{4}$)|(^628[2-8]-?\\d{4}-?\\d{4}-?\\d{4}$)";break;case"DJCB":r="^(352[89]|35[3-8][0-9])-?\\d{4}-?\\d{4}-?\\d{4}$";break;case"AMEX":r="^3[4,7][0-9]{13}$"}return(u=new RegExp(r),r===null||i.match(u)===null)?!1:t(i)},n.prototype.getCardBrand=function(n){var i,t;if(n!==null&&n!==undefined&&n.length>3){i=n.substring(0,2);switch(i){case"34":case"37":return"AMEX";case"22":case"23":case"24":case"25":case"26":case"27":case"51":case"52":case"53":case"54":case"55":return"MAST";case"65":return"DISC"}if(n.substring(0,4)==="6011")return"DISC";if(t=n.substring(0,8),t>=62212600&&t<=62292599||t>=624e5&&t<=62699999||t>=6282e4&&t<=62889999)return"DCUP";if(t>=3528e4&&t<=35899999)return"DJCB";if(n.substring(0,1)==="4")return"VISA"}return"UNKNOWN"},n.prototype.getCardBrandDisplayName=function(n){switch(n){case"AMEX":return"American Express";case"DISC":return"Discover";case"MAST":return"Mastercard";case"VISA":return"Visa";case"DJCB":return"JCB";case"DCUP":return"UnionPay"}},n.prototype.isExpirationDateInTheFuture=function(n,t){var u=Number(n),i=Number(t)+2e3,r=(new Date).getFullYear(),f=(new Date).getMonth()+1;return i>r?!0:i===r?u>=f:!1},n.prototype.isValidNumber=t,new n}()