(function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof module=="object"&&module.exports?module.exports=n(require("jquery")):n(window.jQuery)})(function(n){"use strict";function k(n){var t={},i;return n.selectionStart===undefined?(n.focus(),i=document.selection.createRange(),t.length=i.text.length,i.moveStart("character",-n.value.length),t.end=i.text.length,t.start=t.end-t.length):(t.start=n.selectionStart,t.end=n.selectionEnd,t.length=t.end-t.start),t}function o(n,t,i){if(n.selectionStart===undefined){n.focus();var r=n.createTextRange();r.collapse(!0);r.moveEnd("character",i);r.moveStart("character",t);r.select()}else n.selectionStart=t,n.selectionEnd=i}function d(t,i){n.each(i,function(n,r){typeof r=="function"?i[n]=r(t,i,n):typeof t.autoNumeric[r]=="function"&&(i[n]=t.autoNumeric[r](t,i,n))})}function u(n,t){typeof n[t]=="string"&&(n[t]*=1)}function v(n,t){var i,r,e,o,f,s;return d(n,t),t.tagList=["b","caption","cite","code","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","ins","kdb","label","li","output","p","q","s","sample","span","strong","td","th","u","var"],i=t.vMax.toString().split("."),r=!t.vMin&&t.vMin!==0?[]:t.vMin.toString().split("."),u(t,"vMax"),u(t,"vMin"),u(t,"mDec"),t.mDec=t.mRound==="CHF"?"2":t.mDec,t.allowLeading=!0,t.aNeg=t.vMin<0?"-":"",i[0]=i[0].replace("-",""),r[0]=r[0].replace("-",""),t.mInt=Math.max(i[0].length,r[0].length,1),t.mDec===null&&(e=0,o=0,i[1]&&(e=i[1].length),r[1]&&(o=r[1].length),t.mDec=Math.max(e,o)),t.altDec===null&&t.mDec>0&&(t.aDec==="."&&t.aSep!==","?t.altDec=",":t.aDec===","&&t.aSep!=="."&&(t.altDec=".")),f=t.aNeg?"([-\\"+t.aNeg+"]?)":"(-?)",t.aNegRegAutoStrip=f,t.skipFirstAutoStrip=new RegExp(f+"[^-"+(t.aNeg?"\\"+t.aNeg:"")+"\\"+t.aDec+"\\d].*?(\\d|\\"+t.aDec+"\\d)"),t.skipLastAutoStrip=new RegExp("(\\d\\"+t.aDec+"?)[^\\"+t.aDec+"\\d]\\D*$"),s="-"+t.aNum+"\\"+t.aDec,t.allowedAutoStrip=new RegExp("[^"+s+"]","gi"),t.numRegAutoStrip=new RegExp(f+"(?:\\"+t.aDec+"?(\\d+\\"+t.aDec+"\\d+)|(\\d*(?:\\"+t.aDec+"\\d*)?))"),t}function t(n,t,i){var u,r,e,f;if(t.aSign)while(n.indexOf(t.aSign)>-1)n=n.replace(t.aSign,"");return n=n.replace(t.skipFirstAutoStrip,"$1$2"),n=n.replace(t.skipLastAutoStrip,"$1"),n=n.replace(t.allowedAutoStrip,""),t.altDec&&(n=n.replace(t.altDec,t.aDec)),u=n.match(t.numRegAutoStrip),n=u?[u[1],u[2],u[3]].join(""):"",(t.lZero==="allow"||t.lZero==="keep")&&i!=="strip"&&(r=[],e="",r=n.split(t.aDec),r[0].indexOf("-")!==-1&&(e="-",r[0]=r[0].replace("-","")),r[0].length>t.mInt&&r[0].charAt(0)==="0"&&(r[0]=r[0].slice(1)),n=e+r.join(t.aDec)),(i&&t.lZero==="deny"||i&&t.lZero==="allow"&&t.allowLeading===!1)&&(f="^"+t.aNegRegAutoStrip+"0*(\\d"+(i==="leading"?")":"|$)"),f=new RegExp(f),n=n.replace(f,"$1$2")),n}function s(n,t){if(t.pSign==="p"){var i=t.nBracket.split(",");t.hasFocus||t.removeBrackets?(t.hasFocus&&n.charAt(0)===i[0]||t.removeBrackets&&n.charAt(0)===i[0])&&(n=n.replace(i[0],t.aNeg),n=n.replace(i[1],"")):(n=n.replace(t.aNeg,""),n=i[0]+n+i[1])}return n}function y(n,t){var r,i;return n&&(r=+n,r<1e-6&&r>-1?(n=+n,n<1e-6&&n>0&&(n=(n+10).toString(),n=n.substring(1)),n<0&&n>-1&&(n=(n-10).toString(),n="-"+n.substring(2)),n=n.toString()):(i=n.split("."),i[1]!==undefined&&(+i[1]==0?n=i[0]:(i[1]=i[1].replace(/0*$/,""),n=i.join("."))))),t.lZero==="keep"?n:n.replace(/^0*(\d)/,"$1")}function h(n,t,i){return t&&t!=="."&&(n=n.replace(t,".")),i&&i!=="-"&&(n=n.replace(i,"-")),n.match(/\d/)||(n+="0"),n}function p(n,t,i){return i&&i!=="-"&&(n=n.replace("-",i)),t&&t!=="."&&(n=n.replace(".",t)),n}function f(n,t,i){return n===""||n===t.aNeg?t.wEmpty==="zero"?n+"0":t.wEmpty==="sign"||i?n+t.aSign:n:null}function c(n,i){var h,o,e,r,u,c;if(n=t(n,i),h=n.replace(",","."),o=f(n,i,!0),o!==null)return o;if(e="",e=i.dGroup===2?/(\d)((\d)(\d{2}?)+)$/:i.dGroup===4?/(\d)((\d{4}?)+)$/:/(\d)((\d{3}?)+)$/,r=n.split(i.aDec),i.altDec&&r.length===1&&(r=n.split(i.altDec)),u=r[0],i.aSep)while(e.test(u))u=u.replace(e,"$1"+i.aSep+"$2");return i.mDec!==0&&r.length>1?(r[1].length>i.mDec&&(r[1]=r[1].substring(0,i.mDec)),n=u+i.aDec+r[1]):n=u,i.aSign&&(c=n.indexOf(i.aNeg)!==-1,n=n.replace(i.aNeg,""),n=i.pSign==="p"?i.aSign+n:n+i.aSign,c&&(n=i.aNeg+n)),h<0&&i.nBracket!==null&&(n=s(n,i)),n}function e(n,t){var v;n=n===""?"0":n.toString();u(t,"mDec");t.mRound==="CHF"&&(n=(Math.round(n*20)/20).toString());var i="",r=0,e="",s=typeof t.aPad=="boolean"||t.aPad===null?t.aPad?t.mDec:0:+t.aPad,p=function(n){var t=s===0?/(\.(?:\d*[1-9])?)0*$/:s===1?/(\.\d(?:\d*[1-9])?)0*$/:new RegExp("(\\.\\d{"+s+"}(?:\\d*[1-9])?)0*$");return n=n.replace(t,"$1"),s===0&&(n=n.replace(/\.$/,"")),n};n.charAt(0)==="-"&&(e="-",n=n.replace("-",""));n.match(/^\d/)||(n="0"+n);e==="-"&&+n==0&&(e="");(+n>0&&t.lZero!=="keep"||n.length>0&&t.lZero==="allow")&&(n=n.replace(/^0*(\d)/,"$1"));var a=n.lastIndexOf("."),w=a===-1?n.length-1:a,h=n.length-1-w;if(h<=t.mDec){if(i=n,h<s)for(a===-1&&(i+=t.aDec),v="000000";h<s;)v=v.substring(0,s-h),i+=v,h+=v.length;else h>s?i=p(i):h===0&&s===0&&(i=i.replace(/\.$/,""));if(t.mRound!=="CHF")return+i==0?i:e+i;t.mRound==="CHF"&&(a=i.lastIndexOf("."),n=i)}var c=a+t.mDec,o=+n.charAt(c+1),f=n.substring(0,c+1).split(""),y=n.charAt(c)==="."?n.charAt(c-1)%2:n.charAt(c)%2,l=!0;if(y!==1&&(y=y===0&&n.substring(c+2,n.length)>0?1:0),o>4&&t.mRound==="S"||o>4&&t.mRound==="A"&&e===""||o>5&&t.mRound==="A"&&e==="-"||o>5&&t.mRound==="s"||o>5&&t.mRound==="a"&&e===""||o>4&&t.mRound==="a"&&e==="-"||o>5&&t.mRound==="B"||o===5&&t.mRound==="B"&&y===1||o>0&&t.mRound==="C"&&e===""||o>0&&t.mRound==="F"&&e==="-"||o>0&&t.mRound==="U"||t.mRound==="CHF")for(r=f.length-1;r>=0;r-=1)if(f[r]!=="."){if(t.mRound==="CHF"&&f[r]<=2&&l){f[r]=0;l=!1;break}if(t.mRound==="CHF"&&f[r]<=7&&l){f[r]=5;l=!1;break}if(t.mRound==="CHF"&&l?(f[r]=10,l=!1):f[r]=+f[r]+1,f[r]<10)break;r>0&&(f[r]="0")}return f=f.slice(0,c+1),i=p(f.join("")),+i==0?i:e+i}function w(n,t,i){var f=t.aDec,u=t.mDec,r;return n=i==="paste"?e(n,t):n,f&&u&&(r=n.split(f),r[1]&&r[1].length>u&&(u>0?(r[1]=r[1].substring(0,u),n=r.join(f)):n=r[0])),n}function l(n,i){n=t(n,i);n=w(n,i);n=h(n,i.aDec,i.aNeg);var r=+n;return r>=i.vMin&&r<=i.vMax}function b(t,i){this.settings=i;this.that=t;this.$that=n(t);this.formatted=!1;this.settingsClone=v(this.$that,this.settings);this.value=t.value}function r(t){return typeof t=="string"&&(t=t.replace(/\[/g,"\\[").replace(/\]/g,"\\]"),t="#"+t.replace(/(:|\.)/g,"\\$1")),n(t)}function i(n,t,i){var r=n.data("autoNumeric"),u;return r||(r={},n.data("autoNumeric",r)),u=r.holder,(u===undefined&&t||i)&&(u=new b(n.get(0),t),r.holder=u),u}b.prototype={init:function(n){this.value=this.that.value;this.settingsClone=v(this.$that,this.settings);this.ctrlKey=n.ctrlKey;this.cmdKey=n.metaKey;this.shiftKey=n.shiftKey;this.selection=k(this.that);(n.type==="keydown"||n.type==="keyup")&&(this.kdCode=n.keyCode);this.which=n.which;this.processed=!1;this.formatted=!1},setSelection:function(n,t,i){n=Math.max(n,0);t=Math.min(t,this.that.value.length);this.selection={start:n,end:t,length:t-n};(i===undefined||i)&&o(this.that,n,t)},setPosition:function(n,t){this.setSelection(n,n,t)},getBeforeAfter:function(){var n=this.value,t=n.substring(0,this.selection.start),i=n.substring(this.selection.end,n.length);return[t,i]},getBeforeAfterStriped:function(){var n=this.getBeforeAfter();return n[0]=t(n[0],this.settingsClone),n[1]=t(n[1],this.settingsClone),n},normalizeParts:function(n,i){var r=this.settingsClone,e,u,f;return i=t(i,r),e=i.match(/^\d/)?!0:"leading",n=t(n,r,e),(n===""||n===r.aNeg)&&r.lZero==="deny"&&i>""&&(i=i.replace(/^0*(\d)/,"$1")),u=n+i,r.aDec&&(f=u.match(new RegExp("^"+r.aNegRegAutoStrip+"\\"+r.aDec)),f&&(n=n.replace(f[1],f[1]+"0"),u=n+i)),r.wEmpty==="zero"&&(u===r.aNeg||u==="")&&(n+="0"),[n,i]},setValueParts:function(n,t,i){var f=this.settingsClone,e=this.normalizeParts(n,t),r=e.join(""),u=e[0].length;return l(r,f)?(r=w(r,f,i),u>r.length&&(u=r.length),this.value=r,this.setPosition(u,!1),!0):!1},signPosition:function(){var n=this.settingsClone,u=n.aSign,i=this.that,t,f,r;return u?(t=u.length,n.pSign==="p")?(f=n.aNeg&&i.value&&i.value.charAt(0)===n.aNeg,f?[1,t+1]:[0,t]):(r=i.value.length,[r-t,r]):[1e3,-1]},expandSelectionOnSign:function(n){var t=this.signPosition(),i=this.selection;i.start<t[1]&&i.end>t[0]&&((i.start<t[0]||i.end>t[1])&&this.value.substring(Math.max(i.start,t[0]),Math.min(i.end,t[1])).match(/^\s*$/)?i.start<t[0]?this.setSelection(i.start,t[0],n):this.setSelection(t[1],i.end,n):this.setSelection(Math.min(i.start,t[0]),Math.max(i.end,t[1]),n))},checkPaste:function(){if(this.valuePartsBeforePaste!==undefined){var n=this.getBeforeAfter(),i=this.valuePartsBeforePaste;delete this.valuePartsBeforePaste;n[0]=n[0].substr(0,i[0].length)+t(n[0].substr(i[0].length),this.settingsClone);this.setValueParts(n[0],n[1],"paste")||(this.value=i.join(""),this.setPosition(i[0].length,!1))}},skipAllways:function(n){var t=this.kdCode,e=this.which,i=this.ctrlKey,r=this.cmdKey,s=this.shiftKey;if((i||r)&&n.type==="keyup"&&this.valuePartsBeforePaste!==undefined||s&&t===45)return this.checkPaste(),!1;if(t>=112&&t<=123||t>=91&&t<=93||t>=9&&t<=31||t<8&&(e===0||e===t)||t===144||t===145||t===45||t===224||(i||r)&&t===65)return!0;if((i||r)&&(t===67||t===86||t===88))return n.type==="keydown"&&this.expandSelectionOnSign(),(t===86||t===45)&&(n.type==="keydown"||n.type==="keypress"?this.valuePartsBeforePaste===undefined&&(this.valuePartsBeforePaste=this.getBeforeAfter()):this.checkPaste()),n.type==="keydown"||n.type==="keypress"||t===67;if(i||r)return!0;if(t===37||t===39){var f=this.settingsClone.aSep,u=this.selection.start,o=this.that.value;return n.type==="keydown"&&f&&!this.shiftKey&&(t===37&&o.charAt(u-2)===f?this.setPosition(u-1):t===39&&o.charAt(u+1)===f&&this.setPosition(u+1)),!0}return t>=34&&t<=40?!0:!1},processAllways:function(){var n;return this.kdCode===8||this.kdCode===46?(this.selection.length?(this.expandSelectionOnSign(!1),n=this.getBeforeAfterStriped(),this.setValueParts(n[0],n[1])):(n=this.getBeforeAfterStriped(),this.kdCode===8?n[0]=n[0].substring(0,n[0].length-1):n[1]=n[1].substring(1,n[1].length),this.setValueParts(n[0],n[1])),!0):!1},processKeypress:function(){var n=this.settingsClone,r=String.fromCharCode(this.which),u=this.getBeforeAfterStriped(),t=u[0],i=u[1];return r===n.aDec||n.altDec&&r===n.altDec||(r==="."||r===",")&&this.kdCode===110?!n.mDec||!n.aDec?!0:n.aNeg&&i.indexOf(n.aNeg)>-1?!0:t.indexOf(n.aDec)>-1?!0:i.indexOf(n.aDec)>0?!0:(i.indexOf(n.aDec)===0&&(i=i.substr(1)),this.setValueParts(t+n.aDec,i),!0):r==="-"||r==="+"?n.aNeg?(t===""&&i.indexOf(n.aNeg)>-1&&(t=n.aNeg,i=i.substring(1,i.length)),t=t.charAt(0)===n.aNeg?t.substring(1,t.length):r==="-"?n.aNeg+t:t,this.setValueParts(t,i),!0):!0:r>="0"&&r<="9"?(n.aNeg&&t===""&&i.indexOf(n.aNeg)>-1&&(t=n.aNeg,i=i.substring(1,i.length)),n.vMax<=0&&n.vMin<n.vMax&&this.value.indexOf(n.aNeg)===-1&&r!=="0"&&(t=n.aNeg+t),this.setValueParts(t+r,i),!0):!0},formatQuick:function(){var n=this.settingsClone,t=this.getBeforeAfterStriped(),o=this.value,f,s,i,r,e,u,l,h;if((n.aSep===""||n.aSep!==""&&o.indexOf(n.aSep)===-1)&&(n.aSign===""||n.aSign!==""&&o.indexOf(n.aSign)===-1)&&(f=[],s="",f=o.split(n.aDec),f[0].indexOf("-")>-1&&(s="-",f[0]=f[0].replace("-",""),t[0]=t[0].replace("-","")),f[0].length>n.mInt&&t[0].charAt(0)==="0"&&(t[0]=t[0].slice(1)),t[0]=s+t[0]),i=c(this.value,this.settingsClone),r=i.length,i){for(e=t[0].split(""),u=0,u;u<e.length;u+=1)e[u].match("\\d")||(e[u]="\\"+e[u]);l=new RegExp("^.*?"+e.join(".*?"));h=i.match(l);h?(r=h[0].length,(r===0&&i.charAt(0)!==n.aNeg||r===1&&i.charAt(0)===n.aNeg)&&n.aSign&&n.pSign==="p"&&(r=this.settingsClone.aSign.length+(i.charAt(0)==="-"?1:0))):n.aSign&&n.pSign==="s"&&(r-=n.aSign.length)}this.that.value=i;this.setPosition(r);this.formatted=!0}};var a={init:function(r){return this.each(function(){var u=n(this),v=u.data("autoNumeric"),b=u.data(),w=u.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])"),a,y;if(typeof v!="object")v=n.extend({},n.fn.autoNumeric.defaults,b,r,{aNum:"0123456789",hasFocus:!1,removeBrackets:!1,runOnce:!1,tagList:["b","caption","cite","code","dd","del","div","dfn","dt","em","h1","h2","h3","h4","h5","h6","ins","kdb","label","li","output","p","q","s","sample","span","strong","td","th","u","var"]}),v.aDec===v.aSep&&n.error("autoNumeric will not function properly when the decimal character aDec: '"+v.aDec+"' and thousand separator aSep: '"+v.aSep+"' are the same character"),u.data("autoNumeric",v);else return this;if(a=i(u,v),w||u.prop("tagName").toLowerCase()!=="input"||n.error('The input type "'+u.prop("type")+'" is not supported by autoNumeric()'),n.inArray(u.prop("tagName").toLowerCase(),v.tagList)===-1&&u.prop("tagName").toLowerCase()!=="input"&&n.error("The <"+u.prop("tagName").toLowerCase()+"> is not supported by autoNumeric()"),v.runOnce===!1&&v.aForm&&(w&&(y=!0,u[0].value===""&&v.wEmpty==="empty"&&(u[0].value="",y=!1),u[0].value===""&&v.wEmpty==="sign"&&(u[0].value=v.aSign,y=!1),y&&u.val()!==""&&(v.anDefault===null&&u[0].value===u.prop("defaultValue")||v.anDefault!==null&&v.anDefault.toString()===u.val())&&u.autoNumeric("set",u.val())),n.inArray(u.prop("tagName").toLowerCase(),v.tagList)!==-1&&u.text()!==""&&u.autoNumeric("set",u.text())),v.runOnce=!0,u.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])")){u.on("keydown.autoNumeric",function(t){return(a=i(u),a.settings.aDec===a.settings.aSep&&n.error("autoNumeric will not function properly when the decimal character aDec: '"+a.settings.aDec+"' and thousand separator aSep: '"+a.settings.aSep+"' are the same character"),a.that.readOnly)?(a.processed=!0,!0):(a.init(t),a.skipAllways(t))?(a.processed=!0,!0):a.processAllways()?(a.processed=!0,a.formatQuick(),t.preventDefault(),!1):(a.formatted=!1,!0)});u.on("keypress.autoNumeric",function(n){a=i(u);var t=a.processed;if(a.init(n),a.skipAllways(n))return!0;if(t)return n.preventDefault(),!1;if(a.processAllways()||a.processKeypress())return a.formatQuick(),n.preventDefault(),!1;a.formatted=!1});u.on("keyup.autoNumeric",function(n){a=i(u);a.init(n);var t=a.skipAllways(n);if((a.kdCode=0,delete a.valuePartsBeforePaste,u[0].value===a.settings.aSign&&(a.settings.pSign==="s"?o(this,0,0):o(this,a.settings.aSign.length,a.settings.aSign.length)),t)||this.value==="")return!0;a.formatted||a.formatQuick()});u.on("focusin.autoNumeric",function(){var n,r,t;a=i(u);n=a.settingsClone;n.hasFocus=!0;n.nBracket!==null&&(r=u.val(),u.val(s(r,n)));a.inVal=u.val();t=f(a.inVal,n,!0);t!==null&&t!==""&&u.val(t)});u.on("focusout.autoNumeric",function(){var s,o;a=i(u);var r=a.settingsClone,n=u.val(),v=n;r.hasFocus=!1;s="";r.lZero==="allow"&&(r.allowLeading=!1,s="leading");n!==""&&(n=t(n,r,s),f(n,r)===null&&l(n,r,u[0])?(n=h(n,r.aDec,r.aNeg),n=e(n,r),n=p(n,r.aDec,r.aNeg)):n="");o=f(n,r,!1);o===null&&(o=c(n,r));(o!==a.inVal||o!==v)&&(u.val(o),u.change(),delete a.inVal)})}})},destroy:function(){return n(this).each(function(){var t=n(this);t.off(".autoNumeric");t.removeData("autoNumeric")})},update:function(t){return n(this).each(function(){var f=r(n(this)),u=f.data("autoNumeric"),e;if(typeof u!="object"&&n.error("You must initialize autoNumeric('init', {options}) prior to calling the 'update' method"),e=f.autoNumeric("get"),u=n.extend(u,t),i(f,u,!0),u.aDec===u.aSep&&n.error("autoNumeric will not function properly when the decimal character aDec: '"+u.aDec+"' and thousand separator aSep: '"+u.aSep+"' are the same character"),f.data("autoNumeric",u),f.val()!==""||f.text()!=="")return f.autoNumeric("set",e)})},set:function(t){if(t!==null)return n(this).each(function(){var f=r(n(this)),u=f.data("autoNumeric"),i=t.toString(),o=t.toString(),s=f.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])");return(typeof u!="object"&&n.error("You must initialize autoNumeric('init', {options}) prior to calling the 'set' method"),(o===f.attr("value")||o===f.text())&&u.runOnce===!1&&(i=i.replace(",",".")),n.isNumeric(+i)||n.error("The value ("+i+") being 'set' is not numeric and has caused a error to be thrown"),i=y(i,u),u.setEvent=!0,i.toString(),i!==""&&(i=e(i,u)),i=p(i,u.aDec,u.aNeg),l(i,u)||(i=e("",u)),i=c(i,u),s)?f.val(i):n.inArray(f.prop("tagName").toLowerCase(),u.tagList)!==-1?f.text(i):!1})},get:function(){var f=r(n(this)),i=f.data("autoNumeric"),u;return(typeof i!="object"&&n.error("You must initialize autoNumeric('init', {options}) prior to calling the 'get' method"),u="",f.is("input[type=text], input[type=hidden], input[type=tel], input:not([type])")?u=f.eq(0).val():n.inArray(f.prop("tagName").toLowerCase(),i.tagList)!==-1?u=f.eq(0).text():n.error("The <"+f.prop("tagName").toLowerCase()+"> is not supported by autoNumeric()"),u===""&&i.wEmpty==="empty"||u===i.aSign&&(i.wEmpty==="sign"||i.wEmpty==="empty"))?"":(u!==""&&i.nBracket!==null&&(i.removeBrackets=!0,u=s(u,i),i.removeBrackets=!1),(i.runOnce||i.aForm===!1)&&(u=t(u,i)),u=h(u,i.aDec,i.aNeg),+u==0&&i.lZero!=="keep"&&(u="0"),i.lZero==="keep")?u:y(u,i)},getString:function(){var o=!1,s=r(n(this)),c=s.serialize(),u=c.split("&"),f=n("form").index(s),h=n("form:eq("+f+")"),i=[],e=[],l=/^(?:submit|button|image|reset|file)$/i,a=/^(?:input|select|textarea|keygen)/i,v=/^(?:checkbox|radio)$/i,y=/^(?:button|checkbox|color|date|datetime|datetime-local|email|file|image|month|number|password|radio|range|reset|search|submit|time|url|week)/i,t=0;return n.each(h[0],function(n,i){i.name===""||!a.test(i.localName)||l.test(i.type)||i.disabled||!i.checked&&v.test(i.type)?e.push(-1):(e.push(t),t=t+1)}),t=0,n.each(h[0],function(n,r){r.localName==="input"&&(r.type===""||r.type==="text"||r.type==="hidden"||r.type==="tel")?(i.push(t),t=t+1):(i.push(-1),r.localName==="input"&&y.test(r.type)&&(t=t+1))}),n.each(u,function(t,r){var s,h,c;r=u[t].split("=");s=n.inArray(t,e);s>-1&&i[s]>-1&&(h=n("form:eq("+f+") input:eq("+i[s]+")"),c=h.data("autoNumeric"),typeof c=="object"&&r[1]!==null&&(r[1]=n("form:eq("+f+") input:eq("+i[s]+")").autoNumeric("get").toString(),u[t]=r.join("="),o=!0))}),o||n.error("You must initialize autoNumeric('init', {options}) prior to calling the 'getString' method"),u.join("&")},getArray:function(){var e=!1,o=r(n(this)),s=o.serializeArray(),u=n("form").index(o),h=n("form:eq("+u+")"),i=[],f=[],c=/^(?:submit|button|image|reset|file)$/i,l=/^(?:input|select|textarea|keygen)/i,a=/^(?:checkbox|radio)$/i,v=/^(?:button|checkbox|color|date|datetime|datetime-local|email|file|image|month|number|password|radio|range|reset|search|submit|time|url|week)/i,t=0;return n.each(h[0],function(n,i){i.name===""||!l.test(i.localName)||c.test(i.type)||i.disabled||!i.checked&&a.test(i.type)?f.push(-1):(f.push(t),t=t+1)}),t=0,n.each(h[0],function(n,r){r.localName==="input"&&(r.type===""||r.type==="text"||r.type==="hidden"||r.type==="tel")?(i.push(t),t=t+1):(i.push(-1),r.localName==="input"&&v.test(r.type)&&(t=t+1))}),n.each(s,function(t,r){var o=n.inArray(t,f),s,h;o>-1&&i[o]>-1&&(s=n("form:eq("+u+") input:eq("+i[o]+")"),h=s.data("autoNumeric"),typeof h=="object"&&(r.value=n("form:eq("+u+") input:eq("+i[o]+")").autoNumeric("get").toString(),e=!0))}),e||n.error("None of the successful form inputs are initialized by autoNumeric."),s},getSettings:function(){var t=r(n(this));return t.eq(0).data("autoNumeric")}};n.fn.autoNumeric=function(t){if(a[t])return a[t].apply(this,Array.prototype.slice.call(arguments,1));if(typeof t=="object"||!t)return a.init.apply(this,arguments);n.error('Method "'+t+'" is not supported by autoNumeric()')};n.fn.autoNumeric.defaults={aSep:",",dGroup:"3",aDec:".",altDec:null,aSign:"",pSign:"p",vMax:"9999999999999.99",vMin:"-9999999999999.99",mDec:null,mRound:"S",aPad:!0,nBracket:null,wEmpty:"empty",lZero:"allow",sNumber:!0,aForm:!0,anDefault:null}});var Resources=function(){function n(){this.Titles=new ResourceContainer;this.Labels=new ResourceContainer;this.Buttons=new ResourceContainer;this.Messages=new ResourceContainer}return n}(),ResourceContainer=function(){function n(){this.storage={}}return n.prototype.Add=function(n){for(var t in n){if(typeof n[t]!="string")throw new Error("Value must be a string");if(this.storage[t]==undefined)this.storage[t]=n[t];else throw new Error('Resource key "{0}" already exists'.format(t));}},n.prototype.Update=function(n,t){if(this.storage[n]!=undefined)this.storage[n]=t;else throw new Error('Resource key "{0}" not found'.format(n));},n.prototype.Get=function(n){if(this.storage[n]!=undefined)return this.storage[n];throw new Error('Resource key "{0}" not found'.format(n));},n.prototype.Delete=function(n){this.storage[n]!=undefined&&delete this.storage[n]},n}(),Culture=function(){function n(){}return n}(),App=function(){function n(){}return n.InitAnonymous=function(){n.InitAutoNumericSettings();n.InitValidationSummary();n.InitLanguageSelector();n.InitPreventDoubleSubmit()},n.Init=function(t){n.GlobalOptions=t;n.InitAutoNumericSettings();n.InitDefaults();n.InitValidationSummary();n.InitPreventDoubleSubmit();n.InitNotificationsWidget();n.InitContractSelector();n.InitAccountNavigation()},n.InitDefaults=function(){var t=this;$.ajaxSettings.beforeSend=function(n,i){i.url.indexOf("/signalr/")==-1&&(t.AjaxRequestsCount++,t.LoadingTimeout==null&&(t.LoadingTimeout=setTimeout(function(){t.LoadingStartTime=(new Date).getTime();$("#Overlay").removeAttr("hidden")},t.LoadingThresholdTime)))};$.ajaxSettings.complete=function(i){if(i.status==403&&window.location.replace("{0}/Account/Logout".format(n.BaseUrl)),--t.AjaxRequestsCount==0){t.LoadingTimeout!=null&&(clearTimeout(t.LoadingTimeout),t.LoadingTimeout=null);var r=(new Date).getTime()-t.LoadingStartTime;r>=t.LoadingMinVisibleTime?$("#Overlay").attr("hidden","hidden"):setTimeout(function(){$("#Overlay").attr("hidden","hidden")},t.LoadingMinVisibleTime-r)}};$.fn.selectpicker.Constructor.DEFAULTS.windowPadding=60;n.InitDatePickers();$(document).on("change","input[type=file]",function(t){var f=$("label[for='"+$(t.currentTarget).attr("name")+"'].filename"),r,u,i;if(t.currentTarget.files.length){for(r="",u=t.currentTarget.files.length,i=0;i<u;i++)r+=t.currentTarget.files[i].name+(i!==u-1?"; ":"");f.text(r)}else f.text(n.Resources.Labels.Get("NoFileSelected"))})},n.InitDatePickers=function(t){var i=[n.Resources.Labels.Get("Day_Sunday"),n.Resources.Labels.Get("Day_Moday"),n.Resources.Labels.Get("Day_Tuesday"),n.Resources.Labels.Get("Day_Wednesday"),n.Resources.Labels.Get("Day_Thursday"),n.Resources.Labels.Get("Day_Friday"),n.Resources.Labels.Get("Day_Saturday")],r=[n.Resources.Labels.Get("Month_1"),n.Resources.Labels.Get("Month_2"),n.Resources.Labels.Get("Month_3"),n.Resources.Labels.Get("Month_4"),n.Resources.Labels.Get("Month_5"),n.Resources.Labels.Get("Month_6"),n.Resources.Labels.Get("Month_7"),n.Resources.Labels.Get("Month_8"),n.Resources.Labels.Get("Month_9"),n.Resources.Labels.Get("Month_10"),n.Resources.Labels.Get("Month_11"),n.Resources.Labels.Get("Month_12")];$('input[data-provide="daterangepicker"]',t).daterangepicker({autoApply:!0,maxDate:moment(),startDate:moment().subtract(1,"year"),endDate:moment(),opens:"left",locale:{daysOfWeek:i,monthNames:r,format:n.Culture.shortDateFormat.toUpperCase()}}).keypress(function(n){(n.which>=48&&n.which<=57||n.which>=96&&n.which<=105)&&$(n.target).data("was-manualy-changed",!0);n.which==13&&$(n.target).trigger("blur")}).blur(function(n){$(n.target).data("was-manualy-changed")==!0&&($(n.target).data("was-manualy-changed",!1),$(n.target).trigger("apply.daterangepicker"))});$('input[data-provide="datepicker"]',t).daterangepicker({autoApply:!0,autoUpdateInput:!1,singleDatePicker:!0,minDate:moment(),opens:"left",locale:{daysOfWeek:i,monthNames:r,format:n.Culture.shortDateFormat.toUpperCase()}}).keypress(function(n){(n.which>=48&&n.which<=57||n.which>=96&&n.which<=105)&&$(n.target).data("was-manualy-changed",!0);n.which==13&&$(n.target).trigger("blur")}).blur(function(n){$(n.target).data("was-manualy-changed")==!0&&($(n.target).data("was-manualy-changed",!1),$(n.target).trigger("apply.daterangepicker"))}).on("apply.daterangepicker",function(t,i){$(this).val(i.startDate.format(n.Culture.shortDateFormat.toUpperCase()))});$('input[data-provide="datepickerweekfromnow"]',t).daterangepicker({autoApply:!0,startDate:moment().add(5,"day"),autoUpdateInput:!1,singleDatePicker:!0,minDate:moment().add(5,"day"),opens:"left",isInvalidDate:function(n){return moment(n).toDate().getDay()==0||moment(n).toDate().getDay()==6},locale:{daysOfWeek:i,monthNames:r,format:n.Culture.shortDateFormat.toUpperCase()}}).keypress(function(n){(n.which>=48&&n.which<=57||n.which>=96&&n.which<=105)&&$(n.target).data("was-manualy-changed",!0);n.which==13&&$(n.target).trigger("blur")}).blur(function(n){$(n.target).data("was-manualy-changed")==!0&&($(n.target).data("was-manualy-changed",!1),$(n.target).trigger("apply.daterangepicker"))}).on("apply.daterangepicker",function(t,i){$(this).val(i.startDate.format(n.Culture.shortDateFormat.toUpperCase()))});$('input[data-provide="datepicker"]',t).each(function(t,i){var r=$(i).val();r!=""&&$(i).val(moment(r).format(n.Culture.shortDateFormat.toUpperCase()))});$(".datepicker-wrapper > i.icon").click(function(n){$(n.currentTarget).prev("input").focus()})},n.InitValidationSummary=function(){var n=".validation-summary-errors,.validation-summary-success,.validation-summary-info";$(document).on("click",".validation-summary-errors button.close-button,.validation-summary-success button.close-button,.validation-summary-info button.close-button",function(t){var i=$(t.target).parents(n);i.css("opacity","0");setTimeout(function(){i.remove()},500)})},n.InitLanguageSelector=function(){$("#languageSelector").change(function(t){window.location.replace("{0}/{1}?cultureName={2}&returnUrl={3}".format(n.BaseUrl,"Account/ChangeLanguage",$(t.target).val().toString(),n.GlobalOptions.CurrentPageUrl))})},n.InitNotificationsWidget=function(){$(".notifications-widget button.dismiss-notifications").click(function(t){t.preventDefault();$.ajax({url:"{0}/{1}".format(n.BaseUrl,"Account/HideNotifications"),success:function(n){n&&$(".notifications-widget").slideUp(250,function(){$(".notifications-widget").remove()})}})});$("#notificationsCollapse").on("show.bs.collapse",function(){$("#notificationsCollapse > ul > li").length==0&&$.ajax({url:"{0}/{1}".format(n.BaseUrl,"Account/GetWidgetNotifications"),success:function(n){$(".notifications-widget > header > span").text(n.TotalRows);var t=$("#notificationsCollapse > ul");$.each(n.Rows,function(n,i){i.Message.length>250&&(i.Message="{0}&hellip;".format(i.Message.substr(0,247)));t.append($("<li />").html(i.Message))})}})})},n.InitContractSelector=function(){$("#userContractSelector").change(function(t){window.location.replace("{0}/{1}?contractId={2}&returnUrl={3}".format(n.BaseUrl,"Account/ChangeContract",$(t.target).val().toString(),n.GlobalOptions.CurrentPageUrl))})},n.InitAccountNavigation=function(){$("#accountPageSelector").on("change",function(n){window.location.href=$(n.currentTarget).val()})},n.InitQuickStart=function(){var t=function(){n.LoadModal("body",n.GlobalOptions.QuickStartUrl,null,function(){var n=$("#quickStartGallery").carousel(),t=$("#quickStartGalleryDetails").carousel();n.on("slide.bs.carousel",function(n){var i=$(n.relatedTarget).index();t.carousel(i)})})};n.GlobalOptions.LoadQuickStart&&$(document).ready(t);$(n.GlobalOptions.QuickStartLink).on("click",t)},n.InitPreventDoubleSubmit=function(){$("form").preventDoubleSubmission()},n.InitAutoNumericSettings=function(){this.AutoNumericSettings={decimal:{mDec:2,mNum:9,aNeg:"",aSep:n.Culture.decimalGroupSeparator,aDec:n.Culture.decimalSeparator},percentage:{mDec:2,mNum:2,aNeg:"",aSign:n.Culture.percentageSymbol,pSign:"s",aSep:n.Culture.decimalGroupSeparator,aDec:n.Culture.decimalSeparator},number:{mDec:0,aSep:"",aNeg:""},currency:{pSign:"p",aSign:n.Culture.currencySymbol,aNeg:"",mDec:2,aSep:n.Culture.decimalGroupSeparator,aDec:n.Culture.decimalSeparator},noDecimalCurrency:{pSign:"p",aSign:n.Culture.currencySymbol,aNeg:"",mDec:0,aSep:n.Culture.decimalGroupSeparator}};this.InitAutoNumeric()},n.InitAutoNumeric=function(t){typeof t=="undefined"&&(t=$("body"));$(".decimal").autoNumeric(n.AutoNumericSettings.decimal);$(".percentage").autoNumeric(n.AutoNumericSettings.number);$(".number").autoNumeric(n.AutoNumericSettings.number);$(".currency, .no-decimal-currency").each(function(t,i){$(i).val($(i).val().replace("{2}nbsp;",n.Culture.currencySymbol+" "))});$(".currency").autoNumeric(n.AutoNumericSettings.currency);$(".no-decimal-currency").autoNumeric(n.AutoNumericSettings.noDecimalCurrency);$.validator.methods.range=function(n,t,i){var r=parseFloat(n);return this.optional(t)||r>=i[0]&&r<=i[1]};$.validator.methods.number=function(n,t){return this.optional(t)||/^-?[€,$]?(?:\d+|\d{1,3}(?:[\s\.,]\d{3})+)(?:[\.,]\d+)?[%]?$/.test(n)}},n.prototype.RenderTable=function(t){var f=this,r,i;t.gridActions&&t.columnModel.push({data:"Actions",name:"Actions",className:"actions-column",orderable:!1,searchable:!1,responsivePriority:1,createdCell:function(n,i,r){var u=[];$.each(t.gridActions,function(i){var action=t.gridActions[i].replace(/\{(.*?)\}/g,function(n){if(r[n.substr(1,n.length-2)]!=undefined)return r[n.substr(1,n.length-2)];throw new Error("Element not found in rowData");}),regMatch;action&&action.length>0&&(regMatch=action.match(/^(\[\[)(.*)(\]\])/g),regMatch?eval(regMatch[0].replace("[[","").replace("]]",""))===!0?u.push(action.replace(regMatch.join(""),"")):u.push($(action.replace(regMatch.join(""),"")).addClass("disabled").removeAttr("href").get(0).outerHTML):u.push(action))});$(n).html(u.join("\n"))}});$(t.selector).on("preXhr.dt",function(t,i,r){r.__RequestVerificationToken=n.GetToken()});if($.fn.dataTable.ext.errMode="none",r=$(t.selector).DataTable({serverSide:!0,processing:!0,ajax:{url:t.url,type:"POST",data:t.postData},columns:t.columnModel,responsive:!0,paging:t.paging===undefined||t.paging,dom:"tp",pageLength:t.pageLength||5,autoWidth:!1,error:function(){return!1},order:t.order?t.order:[[0,"desc"]],ordering:t.ordering,drawCallback:function(){if(t.groupHeaderFormat!=null&&t.groupingColumnIndex!=null){var n=this.api(),i=n.rows({page:"all"}).nodes(),r=null;i.each(function(n,u){var o=$($(n).children()[t.groupingColumnIndex]).html(),e;if(r!==o){var f=$(i).eq(u),s='<tr class="group"><td class="hidden-element"><\/td><td colspan="'+f.children().length+'">'+t.groupHeaderFormat+"<\/td><\/tr>",h=s.replace(/\{(.*?)\}/g,function(t){if($($(n).children()[t.substr(1,t.length-2)])!=undefined)return $($(n).children()[t.substr(1,t.length-2)]).html();throw new Error("Element not found at position");});f.before(h);e=f.parents("table").find("thead tr").clone().addClass("group-header");e.find("th").css({border:"",lineHeight:"",padding:"",visibility:""});f.before(e);r=o}});i.length>0?$(n.table().header()).find("th:not(.hidden)").css({border:"none",lineHeight:"1px",paddingTop:"0",paddingBottom:"0",visibility:"hidden"}):$(n.table().header()).find("th:not(.hidden)").css({border:"",lineHeight:"",paddingTop:"",paddingBottom:"",visibility:""});t.callBack!=null&&t.callBack.drawCallback!=null&&t.callBack.drawCallback&&typeof t.callBack.drawCallback=="function"&&t.callBack.drawCallback($(t.selector))}},createdRow:function(n,i,r){t.callBack!=null&&t.callBack.createdRow!=null&&t.callBack.createdRow&&typeof t.callBack.createdRow=="function"&&t.callBack.createdRow(n,i,r)},language:{zeroRecords:n.Resources.Messages.Get("DataTableZeroRecords"),paginate:{next:"&raquo;",previous:"&laquo;",first:"&laquo;",last:"&raquo;"}}}),t.cardView!=undefined&&t.cardView.enable==!0){var u=$("script#dataTableCardViewWrapperTPL").html(),e=$("script#dataTableCardTPL").html(),o=$("script#dataTableGroupCardTPL").html(),s=$("script#dataTableCardNoResultsTPL").html();if(u==undefined)throw new Error("Card Wrapper Template not found");if(e==undefined)throw new Error("Card Template not found");t.cardView.responsiveCard==!0?$(t.selector).addClass("hidden-xs").after($(u).addClass("visible-xs")):$(t.selector).after($(u).hide());i=r.tables().nodes().to$().attr("id")+"_cardView";(t.cardView.onlyCardView==undefined||t.cardView.onlyCardView==!1)&&t.cardView.showGridToggle!=!1&&$(t.selector).before($('<span class="dataTable-toggles" />').append($('<span class="dataTable-cardViewToggle"><i class="fa fa-th"><\/i><\/span>'),$('<span class="dataTable-listViewToggle"><i class="fa fa-list"><\/i><\/span>')));$(t.selector+"_wrapper .dataTable-cards-wrapper").attr("id",i);t.cardView.startAsCard==!0||t.cardView.onlyCardView==!0?($(t.selector).hide(),$(t.selector+"_wrapper > .dataTable-cards-container").show(),$(t.selector+"_wrapper span.dataTable-cardViewToggle").addClass("selected")):$(t.selector+"_wrapper span.dataTable-listViewToggle").addClass("selected");$(t.selector+"_wrapper > .dataTable-toggles > span").on("click",function(n){$(t.selector+"_wrapper > .dataTable-toggles > span").removeClass("selected");$(n.currentTarget).hasClass("dataTable-listViewToggle")&&($(t.selector).show(),$(t.selector+"_wrapper > .dataTable-cards-container").hide(),$(t.selector).DataTable().columns.adjust());$(n.currentTarget).hasClass("dataTable-cardViewToggle")&&($(t.selector).hide(),$(t.selector+"_wrapper > .dataTable-cards-container").show());$(n.currentTarget).addClass("selected")});r.on("draw.dt",function(){$("#"+i).empty();$(".cards-noresults").remove();var u=r.rows().data(),h=null;u.length==0&&(s?$("#"+i).before($('<div class="cards-noresults">').append(s)):$("#"+i).before("<div class='cards-noresults'>"+n.Resources.Messages.Get("NoResults")+"<\/div>"));$.each(u,function(n,u){var a,c,s,l;t.groupHeaderFormat!=null&&t.groupingColumnIndex!=null&&o&&(a=u[t.columnModel[t.groupingColumnIndex].name],a!=h&&(c=o,l=c.match(/{{\s*[\w\.]+\s*}}/g),l&&l.forEach(function(n){var t=n.match(/[\w\.]+/)[0];if(typeof u[t]=="undefined")throw new Error("Key {0} not found".format(t));c=c.replace(n,u[t]||"")}),c=f.ParseDataTableCardsCode(c,u),$("#"+i).append(c),h=a));s=e;l=s.match(/{{\s*[\w\.]+\s*}}/g);l&&l.forEach(function(t){var i=t.match(/[\w\.]+/)[0],e=/^DT_CELL_CLASS_(\d+)$/,o,f;if(e.test(i))o=i.match(e)[1],f=r.cell(n,o),f.length==1&&(s=s.replace(t,$(f.node()).attr("class")));else{if(typeof u[i]=="undefined")throw new Error("Key {0} not found".format(i));s=s.replace(t,u[i])}});s=f.ParseDataTableCardsCode(s,u);$("#"+i).append(s)})})}return r},n.prototype.ParseDataTableCardsCode=function(card){for(var regex=/(\[\[(.*)\]\])((.|\s)*?)(\[\[endcode\]\])/g,match,replaces=[],i;(match=regex.exec(card))!==null;){match.index===regex.lastIndex&&regex.lastIndex++;try{eval(match[2])===!0?replaces.push([match[0],match[3]]):replaces.push([match[0],""])}catch(e){replaces.push([match[0],""])}}for(i=0;i<replaces.length;i++)card=card.replace(replaces[i][0],replaces[i][1]);return card},n.GetToken=function(){return $('input[name="__RequestVerificationToken"]').val()},n.PopulateComboBox=function(t,i,r,u){(n.AddComboBoxItem(t,"",n.Resources.Labels.Get("ComboBoxSelectOption")),i.length!=0)&&$.each(i,function(i,f){n.AddComboBoxItem(t,f[r],f[u])})},n.AddComboBoxItem=function(n,t,i){typeof n!="string"||n.match("^#")?$("<option>").attr("value",t).text(i).appendTo(n):$("<option>").attr("value",t).text(i).appendTo("#"+n)},n.ClearComboBox=function(n){n.match("^#")?$(n+" >option").remove():$("#"+n+" >option").remove()},n.GetErrorTemplate=function(){return $("<div class='validation-summary-errors'><button type='button' class='close-button'><i class='icon ion-md-close' aria-label='close'><\/i><\/button><\/div>")},n.GetSuccessTemplate=function(){return $("<div class='validation-summary-success'><button type='button' class='close-button'><i class='icon ion-md-close' aria-label='close'><\/i><\/button><\/div>")},n.prototype.FormAjax=function(t,i,r){var f=$(".validation-summary-container",t).empty(),u=n.GetErrorTemplate();return $.ajax({url:t.prop("action"),method:t.prop("method"),data:new FormData(t.get(0)),cache:!1,processData:!1,contentType:!1,success:function(t){t?i&&i(t):(u.prepend($("<span/>").text(n.Resources.Messages.Get("SystemError"))),f.append(u),r&&r(null,t))},error:function(i){var c=!1,e=i.responseJSON,s,h,o;if(e){s={};h=$("<ul/>");for(o in e)o!=""?s[o]=e[o]:h.append("<li>"+e[o]+"<\/li>");Object.keys(s).length>0&&t.validate().showErrors(s);h.children().length>0&&(u.prepend(h),c=!0)}else u.prepend($("<span/>").text(n.Resources.Messages.Get("SystemError")));c&&f.append(u);r&&r(i,e)}})},n.LoadModal=function(t,i,r,u,f){var e=$("<div class='modalContainer'/>").appendTo(t);e.load(i,r,function(t,i,r){var h,o,c,l,s;if(i==="error"){if(h=n.GetErrorTemplate(),r.status!==901&&r.status!==403){o=null;try{o=r.responseJSON}catch(a){}if(o&&o.length){c=$("<ul/>");for(l in o)c.append("<li>"+o[l]+"<\/li>");h.prepend(c);f&&f(o,r)}else h.prepend($("<span/>").text(n.Resources.Messages.Get("SystemError"))),f&&f(o,null)}}else s=$(".modal",e),$(".selectpicker").selectpicker("refresh"),$.validator.unobtrusive.parse(s),$(s).on("hidden.bs.modal",function(){e.remove()}).modal(),u&&u(s,t,r)})},n.ConfirmModal=function(n,t){var i=$($("#confirmModalTemplate")[0].innerHTML).addClass(t.Class).appendTo(n);typeof t.ModalSize=="undefined"?$(".modal-dialog",i).addClass("modal-sm"):t.ModalSize!=""&&$(".modal-dialog",i).addClass("modal-"+t.ModalSize);t.Title?$(".modal-title",i).html(t.Title):$(".modal-title",i).remove();t.Message?$(".modal-body",i).html(t.Message):$(".modal-body",i).remove();t.Actions&&t.Actions.length?t.Actions.map(function(n){var t=$("<button/>").addClass(n.Class).html(n.Label).appendTo($(".modal-footer",i));if(n.DismissModal!=!1&&t.attr("data-dismiss","modal"),n.Callback)t.on("click",n.Callback)}):$(".modal-footer",i).remove();i.on("hidden.bs.modal",function(n){$(n.currentTarget).remove()}).modal()},n.Resources=new Resources,n.Culture=new Culture,n.AutoNumericSettings={decimal:{},percentage:{},number:{},currency:{},noDecimalCurrency:{}},n.AjaxRequestsCount=0,n.LoadingMinVisibleTime=500,n.LoadingThresholdTime=250,n}();String.prototype.format=function(){var n=arguments;return this.replace(/{(\d+)}/g,function(t,i){return typeof n[i]!="undefined"?n[i].toString():t})};jQuery.fn.preventDoubleSubmission=function(){var n=function(n){var t=$(this);t.valid()&&(t.data("submitted")===!0?n.preventDefault():(t.data("submitted",!0),$(n.target).find(":submit").attr("disabled","disabled").addClass("loading")))};$(this).on("submit",n);return this}