(function(q){function C(a){return(a+"").replace(R,"")}function w(a,b,c){for(var d=a.length;d<b;d++)a=c?"0"+a:a+"0";return a}function I(a,b,c){c=q.findClosestCulture(c);b=c.numberFormat;var d=E(a,b,b.pattern[0]);c=d[0];d=d[1];""===c&&"-n"!==b.pattern[0]&&(d=E(a,b,"-n"),c=d[0],d=d[1]);c=c||"+";var f;a=d.indexOf("e");0>a&&(a=d.indexOf("E"));0>a?(f=d,a=null):(f=d.substr(0,a),a=d.substr(a+1));var m=b["."],h=f.indexOf(m);0>h?(d=f,f=null):(d=f.substr(0,h),f=f.substr(h+m.length));m=b[","];d=d.split(m).join("");
h=m.replace(/\u00A0/g," ");m!==h&&(d=d.split(h).join(""));c=""!==d||null!==f?c+d:"";null!==f&&(c+="."+f);null!==a&&(b=E(a,b,"-n"),c+="e"+(b[0]||"+")+b[1]);return c}function E(a,b,c){var d=b["-"];b=b["+"];var f;switch(c){case "n -":d=" "+d,b=" "+b;case "n-":a.substr(a.length-d.length)===d?f=["-",a.substr(0,a.length-d.length)]:a.substr(a.length-b.length)===b&&(f=["+",a.substr(0,a.length-b.length)]);break;case "- n":d+=" ",b+=" ";case "-n":0===a.indexOf(d)?f=["-",a.substr(d.length)]:0===a.indexOf(b)&&
(f=["+",a.substr(b.length)]);break;case "(n)":0===a.indexOf("(")&&")"===a.substr(a.length-1)&&(f=["-",a.substr(1,a.length-2)])}return f||["",a]}function J(a,b,c){for(var d=/n|\$|-|%/g,f="";;){var m=d.lastIndex,h=d.exec(b),f=f+b.slice(m,h?h.index:b.length);if(!h)break;switch(h[0]){case "n":f+=a;break;case "$":f+=c.currency.symbol;break;case "-":/[1-9]/.test(a)&&(f+=c["-"]);break;case "%":f+=c.percent.symbol}}return f}function D(a,b){if(!b)return 0;for(var c,d=a.getTime(),f=0,m=b.length;f<m;f++)if(c=
b[f].start,null===c||d>=c)return f;return 0}function F(a){return a.split("\u00a0").join(" ").toUpperCase()}function y(a){return q.map(a,function(a){return F(a)})}function G(a,b,c,d){a=a.getFullYear();!d&&b.eras&&(a-=b.eras[c].offset);return a}function H(a,b){for(var c=0,d=!1,f=0,m=a.length;f<m;f++){var h=a.charAt(f);switch(h){case "'":d?b.push("'"):c++;d=!1;break;case "\\":d&&b.push("\\");d=!d;break;default:b.push(h),d=!1}}return c}function K(a,b){b=b||"F";var c;c=a.patterns;var d=b.length;1===d?
((c=c[b])||q.error("Invalid date format string '"+b+"'."),b=c):2===d&&"%"===b.charAt(0)&&(b=b.charAt(1));return b}function L(){return/\/|dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|y|hh|h|HH|H|mm|m|ss|s|tt|t|fff|ff|f|zzz|zz|z|gg|g/g}function M(a,b,c){a=C(a);c=c.calendar;a:{var d=c._parseRegExp;if(d){var f=d[b];if(f){b=f;break a}}else c._parseRegExp=d={};for(var f=K(c,b).replace(/([\^\$\.\*\+\?\|\[\]\(\)\{\}])/g,"\\\\$1"),m=["^"],h=[],e=0,g=0,k=L(),l;null!==(l=k.exec(f));){var z=f.slice(e,l.index),e=k.lastIndex,
g=g+H(z,m);if(g%2)m.push(l[0]);else{var z=l[0],t=z.length,u;switch(z){case "dddd":case "ddd":case "MMMM":case "MMM":case "gg":case "g":u="(\\D+)";break;case "tt":case "t":u="(\\D*)";break;case "yyyy":case "fff":case "ff":case "f":u="(\\d{"+t+"})";break;case "dd":case "d":case "MM":case "M":case "yy":case "y":case "HH":case "H":case "hh":case "h":case "mm":case "m":case "ss":case "s":u="(\\d\\d?)";break;case "zzz":u="([+-]?\\d\\d?:\\d{2})";break;case "zz":case "z":u="([+-]?\\d\\d?)";break;case "/":u=
"(\\"+c["/"]+")";break;default:q.error("Invalid date format pattern '"+z+"'.")}u&&m.push(u);h.push(l[0])}}H(f.slice(e),m);m.push("$");u={regExp:m.join("").replace(/\s+/g,"\\s+"),groups:h};b=d[b]=u}e=RegExp(b.regExp).exec(a);if(null===e)return null;var g=b.groups,v=a=null,s=null,t=b=null,m=f=u=d=0,k=null,h=!1;l=0;for(z=g.length;l<z;l++){var p=e[l+1];if(p){var x=g[l],n=x.length,r=parseInt(p,10);switch(x){case "dd":case "d":b=r;if(1>b||31<b)return null;break;case "MMM":case "MMMM":var s=c,n=3===n,x=
s.months,N=s.monthsGenitive||s.months,w=s._upperMonths,r=s._upperMonthsGen;w||(s._upperMonths=w=[y(x.names),y(x.namesAbbr)],s._upperMonthsGen=r=[y(N.names),y(N.namesAbbr)]);p=F(p);s=q.inArray(p,n?w[1]:w[0]);0>s&&(s=q.inArray(p,n?r[1]:r[0]));if(0>s||11<s)return null;break;case "M":case "MM":s=r-1;if(0>s||11<s)return null;break;case "y":case "yy":case "yyyy":4>n?(v=c,p=r,r=new Date,x=D(r),100>p&&(n=v.twoDigitYearMax,n="string"===typeof n?(new Date).getFullYear()%100+parseInt(n,10):n,v=G(r,v,x),p+=v-
v%100,p>n&&(p-=100)),v=p):v=r;if(0>v||9999<v)return null;break;case "h":case "hh":d=r;12===d&&(d=0);if(0>d||11<d)return null;break;case "H":case "HH":d=r;if(0>d||23<d)return null;break;case "m":case "mm":u=r;if(0>u||59<u)return null;break;case "s":case "ss":f=r;if(0>f||59<f)return null;break;case "tt":case "t":h=c.PM&&(p===c.PM[0]||p===c.PM[1]||p===c.PM[2]);if(!h&&(!c.AM||p!==c.AM[0]&&p!==c.AM[1]&&p!==c.AM[2]))return null;break;case "f":case "ff":case "fff":m=r*Math.pow(10,3-n);if(0>m||999<m)return null;
break;case "ddd":case "dddd":t=p;p=3===n;r=void 0;r=c.days;n=c._upperDays;n||(c._upperDays=n=[y(r.names),y(r.namesAbbr),y(r.namesShort)]);t=F(t);p?(r=q.inArray(t,n[1]),-1===r&&(r=q.inArray(t,n[2]))):r=q.inArray(t,n[0]);t=r;if(0>t||6<t)return null;break;case "zzz":n=p.split(/:/);if(2!==n.length)return null;k=parseInt(n[0],10);if(-12>k||13<k)return null;n=parseInt(n[1],10);if(0>n||59<n)return null;k=60*k+(0===p.indexOf("-")?-n:n);break;case "z":case "zz":k=r;if(-12>k||13<k)return null;k*=60;break;case "g":case "gg":if(!p||
!c.eras)return null;p=C(p.toLowerCase());n=0;for(r=c.eras.length;n<r;n++)if(p===c.eras[n].name.toLowerCase()){a=n;break}if(null===a)return null}}}e=new Date;g=(l=c.convert)?l.fromGregorian(e)[0]:e.getFullYear();null===v?v=g:c.eras&&(v+=c.eras[a||0].offset);null===s&&(s=0);null===b&&(b=1);if(l){if(e=l.toGregorian(v,s,b),null===e)return null}else if(e.setFullYear(v,s,b),e.getDate()!==b||null!==t&&e.getDay()!==t)return null;h&&12>d&&(d+=12);e.setHours(d,u,f,m);null!==k&&(c=e.getMinutes()-(k+e.getTimezoneOffset()),
e.setHours(e.getHours()+parseInt(c/60,10),c%60));return e}function O(a,b,c){function d(a,b){var c;c=a+"";return 1<b&&c.length<b?(c=w[b-2]+c,c.substr(c.length-b,b)):c}function f(){if(t||u)return t;t=v.test(b);u=!0;return t}function m(a,b){if(x)return x[b];switch(b){case 0:return a.getFullYear();case 1:return a.getMonth();case 2:return a.getDate()}}var h=c.calendar,e=h.convert;if(!b||!b.length||"i"===b){if(c&&c.name.length)if(e)c=O(a,h.patterns.F,c);else{c=new Date(a.getTime());var g=D(a,h.eras);c.setFullYear(G(a,
h,g));c=c.toLocaleString()}else c=a.toString();return c}var g=h.eras,k="s"===b;b=K(h,b);c=[];var l,w=["0","00","000"],t,u,v=/([^d]|^)(d|dd)([^d]|$)/g,s=0,p=L(),x;for(!k&&e&&(x=e.fromGregorian(a));;){l=p.lastIndex;e=p.exec(b);l=b.slice(l,e?e.index:b.length);s+=H(l,c);if(!e)break;if(s%2)c.push(e[0]);else switch(l=e[0],e=l.length,l){case "ddd":case "dddd":names=3===e?h.days.namesAbbr:h.days.names;c.push(names[a.getDay()]);break;case "d":case "dd":t=!0;c.push(d(m(a,2),e));break;case "MMM":case "MMMM":l=
m(a,1);c.push(h.monthsGenitive&&f()?h.monthsGenitive[3===e?"namesAbbr":"names"][l]:h.months[3===e?"namesAbbr":"names"][l]);break;case "M":case "MM":c.push(d(m(a,1)+1,e));break;case "y":case "yy":case "yyyy":l=x?x[0]:G(a,h,D(a,g),k);4>e&&(l%=100);c.push(d(l,e));break;case "h":case "hh":l=a.getHours()%12;0===l&&(l=12);c.push(d(l,e));break;case "H":case "HH":c.push(d(a.getHours(),e));break;case "m":case "mm":c.push(d(a.getMinutes(),e));break;case "s":case "ss":c.push(d(a.getSeconds(),e));break;case "t":case "tt":l=
12>a.getHours()?h.AM?h.AM[0]:" ":h.PM?h.PM[0]:" ";c.push(1===e?l.charAt(0):l);break;case "f":case "ff":case "fff":c.push(d(a.getMilliseconds(),3).substr(0,e));break;case "z":case "zz":l=a.getTimezoneOffset()/60;c.push((0>=l?"+":"-")+d(Math.floor(Math.abs(l)),e));break;case "zzz":l=a.getTimezoneOffset()/60;c.push((0>=l?"+":"-")+d(Math.floor(Math.abs(l)),2)+":"+d(Math.abs(a.getTimezoneOffset()%60),2));break;case "g":case "gg":h.eras&&c.push(h.eras[D(a,g)].name);break;case "/":c.push(h["/"]);break;default:q.error("Invalid date format pattern '"+
l+"'.")}}return c.join("")}var B={en:{}};B["default"]=B.en;q.extend({findClosestCulture:function(a){var b;if(a)if(q.isPlainObject(a))b=a;else{var c=q.cultures,d=q.isArray(a)?a:[a],f,m=d.length;for(f=0;f<m;f++)if(a=d[f],b=c[a])return b;for(f=0;f<m;f++){a=d[f];do{var h=a.lastIndexOf("-");if(-1===h)break;a=a.substr(0,h);if(b=c[a])return b}while(1)}}else b=q.culture||q.cultures["default"];return b||null},preferCulture:function(a){q.culture=q.findClosestCulture(a)||q.cultures["default"]},localize:function(a,
b,c){"string"===typeof b&&(b=b||"default",b=q.cultures[b]||{name:b});var d=B[b.name];3===arguments.length?(d||(d=B[b.name]={}),d[a]=c):(d&&(c=d[a]),"undefined"===typeof c&&((d=B[b.language])&&(c=d[a]),"undefined"===typeof c&&(c=B["default"][a])));return"undefined"===typeof c?null:c},format:function(a,b,c){c=q.findClosestCulture(c);if("number"===typeof a){var d=a,f=c;if(b&&"i"!==b){b=b||"D";f=f.numberFormat;a=Math.abs(d);c=-1;var m;1<b.length&&(c=parseInt(b.slice(1),10));b=b.charAt(0).toUpperCase();
var h;switch(b){case "D":m="n";-1!==c&&(a=w(""+a.toString(),c,!0));0>d&&(a=-a);break;case "N":h=f;case "C":h=h||f.currency;case "P":h=h||f.percent;m=0>d?h.pattern[0]:h.pattern[1]||"n";-1===c&&(c=h.decimals);b:{var e=a*("P"===b?100:1);b=c;a=h;h=a.groupSizes;d=h[0];c=1;var g=Math.pow(10,b),g=Math.round(e*g)/g;isFinite(g)||(g=e);var e=g+"",g="",g=e.split(/e/i),k=1<g.length?parseInt(g[1],10):0,e=g[0],g=e.split("."),e=g[0],g=1<g.length?g[1]:"";0<k?(g=w(g,k,!1),e+=g.slice(0,k),g=g.substr(k)):0>k&&(k=-k,
e=w(e,k+1),g=e.slice(-k,e.length)+g,e=e.slice(0,-k));g=0<b?a["."]+(g.length>b?g.slice(0,b):w(g,b)):"";b=e.length-1;a=a[","];for(k="";0<=b;){if(0===d||d>b){a=e.slice(0,b+1)+(k.length?a+k+g:g);break b}k=e.slice(b-d+1,b+1)+(k.length?a+k:"");b-=d;c<h.length&&(d=h[c],c++)}a=e.slice(0,b+1)+a+k+g}break;default:q.error("Bad number format specifier: "+b)}a=J(a.toString(),m,f)}else a=f.name.length?d.toLocaleString():d.toString()}else if(a instanceof Date)a=O(a,b,c);else if(a instanceof BigDecimal)if(h=a,b&&
"i"!==b){b=b||"D";m=c.numberFormat;a=h.abs();c=-1;1<b.length&&(c=parseInt(b.slice(1),10));b=b.charAt(0).toUpperCase();switch(b){case "D":f="n";h.isLessThan(BigDecimal.ZERO)&&(a=a.negate());break;case "N":d=m;case "C":d=d||m.currency;case "P":d=d||m.percent;f=h.isLessThan(BigDecimal.ZERO)?d.pattern[0]:d.pattern[1]||"n";-1===c&&(c=d.decimals);b:{e=a.multiply("P"===b?BigDecimal.HUNDRED:BigDecimal.ONE);b=c;a=d;h=a.groupSizes;d=h[0];c=1;g=new BigDecimal(b.toString());g=BigDecimal.TEN.pow(g);e.isZero()||
(e=e.multiply(g),k=e.mant.length-Math.abs(e.exp),e.round(k+b,BigDecimal.ROUND_HALF_UP),e=e.divide(g,b,BigDecimal.ROUND_HALF_UP));e=e.toString()+"";g="";g=e.split(/e/i);k=1<g.length?parseInt(g[1],10):0;e=g[0];g=e.split(".");e=g[0];g=1<g.length?g[1]:"";0<k?(g=w(g,k,!1),e+=g.slice(0,k),g=g.substr(k)):0>k&&(k=-k,e=w(e,k+1),g=e.slice(-k,e.length)+g,e=e.slice(0,-k));g=0<b?a["."]+(g.length>b?g.slice(0,b):w(g,b)):"";b=e.length-1;a=a[","];for(k="";0<=b;){if(0===d||d>b){a=e.slice(0,b+1)+(k.length?a+k+g:g);
break b}k=e.slice(b-d+1,b+1)+(k.length?a+k:"");b-=d;c<h.length&&(d=h[c],c++)}a=e.slice(0,b+1)+a+k+g}break;default:q.error("Bad number format specifier: "+b)}a=J(a.toString(),f,m)}else a=h.toString();return a},parseInt:function(a,b,c){return Math.floor(q.parseFloat(a,b,c))},parseFloat:function(a,b,c){var d=NaN;a=C(a);P.test(a)?d=parseFloat(a,b):!b&&S.test(a)?d=parseInt(a,16):(a=I(a,c),Q.test(a)&&(d=parseFloat(a)));return d},parseBigDecimal:function(a,b,c){var d=NaN;a=C(a);if(P.test(a))throw"parseBigDecimal: Infinity not supported.";
a=I(a,c);""!==a&&Q.test(a)&&(d=new BigDecimal(a));isNaN(d)&&b&&(d=b);return d},parseDate:function(a,b,c){c=q.findClosestCulture(c);var d;if(b){if("string"===typeof b&&(b=[b]),b.length)for(var f=0,m=b.length;f<m;f++){var h=b[f];if(h&&(d=M(a,h,c)))break}}else q.each(c.calendar.patterns,function(b,f){if(d=M(a,f,c))return!1});return d||null}});var A=q.cultures=q.cultures||{},A=A["default"]=A.en=q.extend(!0,{name:"en",englishName:"English",nativeName:"English",isRTL:!1,language:"en",numberFormat:{pattern:["-n"],
decimals:2,",":",",".":".",groupSizes:[3],"+":"+","-":"-",percent:{pattern:["-n %","n %"],decimals:2,groupSizes:[3],",":",",".":".",symbol:"%"},currency:{pattern:["($n)","$n"],decimals:2,groupSizes:[3],",":",",".":".",symbol:"$"}},calendars:{standard:{name:"Gregorian_USEnglish","/":"/",":":":",firstDay:0,days:{names:"Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),namesAbbr:"Sun Mon Tue Wed Thu Fri Sat".split(" "),namesShort:"Su Mo Tu We Th Fr Sa".split(" ")},months:{names:"January February March April May June July August September October November December ".split(" "),
namesAbbr:"Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec ".split(" ")},AM:["AM","am","AM"],PM:["PM","pm","PM"],eras:[{name:"A.D.",start:null,offset:0}],twoDigitYearMax:2029,patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",t:"h:mm tt",T:"h:mm:ss tt",f:"dddd, MMMM dd, yyyy h:mm tt",F:"dddd, MMMM dd, yyyy h:mm:ss tt",M:"MMMM dd",Y:"yyyy MMMM",S:"yyyy'-'MM'-'dd'T'HH':'mm':'ss"}}}},A.en);A.calendar=A.calendar||A.calendars.standard;var R=/^\s+|\s+$/g,P=/^[+-]?infinity$/i,S=/^0x[a-f0-9]+$/i,Q=/^[+-]?\d*\.?\d*(e[+-]?\d+)?$/})(jQuery);
