vendor/assets/javascripts/webshims/minified/shims/combos/6.js in webshims-rails-0.4.4 vs vendor/assets/javascripts/webshims/minified/shims/combos/6.js in webshims-rails-0.4.5
- old
+ new
@@ -1,33 +2 @@
-jQuery.webshims.register("form-number-date-api",function(d,e){var j,p,u,h;if(!e.getStep)e.getStep=function(a,c){var b=d.attr(a,"step");if("any"===b)return b;c=c||l(a);if(!f[c]||!f[c].step)return b;b=j.asNumber(b);return(!isNaN(b)&&0<b?b:f[c].step)*f[c].stepScaleFactor};if(!e.addMinMaxNumberToCache)e.addMinMaxNumberToCache=function(a,c,b){a+"AsNumber"in b||(b[a+"AsNumber"]=f[b.type].asNumber(c.attr(a)),isNaN(b[a+"AsNumber"])&&a+"Default"in f[b.type]&&(b[a+"AsNumber"]=f[b.type][a+"Default"]))};var m=
-parseInt("NaN",10),f=e.inputTypes,o=function(a){return"number"==typeof a||a&&a==1*a},n=function(a){return d('<input type="'+a+'" />').prop("type")===a},l=function(a){return(a.getAttribute("type")||"").toLowerCase()},i=e.addMinMaxNumberToCache,q=function(a,c){for(var a=""+a,c=c-a.length,b=0;b<c;b++)a="0"+a;return a},r=e.bugs.bustedValidity;e.addValidityRule("stepMismatch",function(a,c,b,d){if(""===c)return!1;if(!("type"in b))b.type=l(a[0]);if("date"==b.type)return!1;d=(d||{}).stepMismatch;if(f[b.type]&&
-f[b.type].step){if(!("step"in b))b.step=e.getStep(a[0],b.type);if("any"==b.step)return!1;if(!("valueAsNumber"in b))b.valueAsNumber=f[b.type].asNumber(c);if(isNaN(b.valueAsNumber))return!1;i("min",a,b);a=b.minAsNumber;isNaN(a)&&(a=f[b.type].stepBase||0);d=Math.abs((b.valueAsNumber-a)%b.step);d=!(1.0E-7>=d||1.0E-7>=Math.abs(d-b.step))}return d});[{name:"rangeOverflow",attr:"max",factor:1},{name:"rangeUnderflow",attr:"min",factor:-1}].forEach(function(a){e.addValidityRule(a.name,function(c,b,d,e){e=
-(e||{})[a.name]||!1;if(""===b)return e;if(!("type"in d))d.type=l(c[0]);if(f[d.type]&&f[d.type].asNumber){if(!("valueAsNumber"in d))d.valueAsNumber=f[d.type].asNumber(b);if(isNaN(d.valueAsNumber))return!1;i(a.attr,c,d);if(isNaN(d[a.attr+"AsNumber"]))return e;e=d[a.attr+"AsNumber"]*a.factor<d.valueAsNumber*a.factor-1.0E-7}return e})});e.reflectProperties(["input"],["max","min","step"]);var s=e.defineNodeNameProperty("input","valueAsNumber",{prop:{get:function(){var a=l(this),a=f[a]&&f[a].asNumber?f[a].asNumber(d.prop(this,
-"value")):s.prop._supget&&s.prop._supget.apply(this,arguments);null==a&&(a=m);return a},set:function(a){var c=l(this);f[c]&&f[c].numberToString?isNaN(a)?d.prop(this,"value",""):(c=f[c].numberToString(a),!1!==c?d.prop(this,"value",c):e.warn("INVALID_STATE_ERR: DOM Exception 11")):s.prop._supset&&s.prop._supset.apply(this,arguments)}}}),t=e.defineNodeNameProperty("input","valueAsDate",{prop:{get:function(){var a=l(this);return f[a]&&f[a].asDate&&!f[a].noAsDate?f[a].asDate(d.prop(this,"value")):t.prop._supget&&
-t.prop._supget.call(this)||null},set:function(a){var c=l(this);if(f[c]&&f[c].dateToString&&!f[c].noAsDate){if(null===a)return d.prop(this,"value",""),"";c=f[c].dateToString(a);if(!1!==c)return d.prop(this,"value",c),c;e.warn("INVALID_STATE_ERR: DOM Exception 11")}else return t.prop._supset&&t.prop._supset.apply(this,arguments)||null}}});j={mismatch:function(a){return!o(a)},step:1,stepScaleFactor:1,asNumber:function(a){return o(a)?1*a:m},numberToString:function(a){return o(a)?a:!1}};p={minDefault:0,
-maxDefault:100};u={mismatch:function(a){if(!a||!a.split||!/\d$/.test(a))return!0;var c=a.split(/\u002D/);if(3!==c.length)return!0;var b=!1;d.each(c,function(a,c){if(!(o(c)||c&&c=="0"+1*c))return b=!0,!1});if(b)return b;if(4!==c[0].length||2!=c[1].length||12<c[1]||2!=c[2].length||33<c[2])b=!0;return a!==this.dateToString(this.asDate(a,!0))},step:1,stepScaleFactor:864E5,asDate:function(a,c){return!c&&this.mismatch(a)?null:new Date(this.asNumber(a,!0))},asNumber:function(a,c){var b=m;if(c||!this.mismatch(a))a=
-a.split(/\u002D/),b=Date.UTC(a[0],a[1]-1,a[2]);return b},numberToString:function(a){return o(a)?this.dateToString(new Date(1*a)):!1},dateToString:function(a){return a&&a.getFullYear?a.getUTCFullYear()+"-"+q(a.getUTCMonth()+1,2)+"-"+q(a.getUTCDate(),2):!1}};h={mismatch:function(a,c){if(!a||!a.split||!/\d$/.test(a))return!0;a=a.split(/\u003A/);if(2>a.length||3<a.length)return!0;var b=!1,k;a[2]&&(a[2]=a[2].split(/\u002E/),k=parseInt(a[2][1],10),a[2]=a[2][0]);d.each(a,function(a,c){if(!(o(c)||c&&c=="0"+
-1*c)||2!==c.length)return b=!0,!1});if(b||23<a[0]||0>a[0]||59<a[1]||0>a[1]||a[2]&&(59<a[2]||0>a[2])||k&&isNaN(k))return!0;k&&(100>k?k*=100:10>k&&(k*=10));return!0===c?[a,k]:!1},step:60,stepBase:0,stepScaleFactor:1E3,asDate:function(a){a=new Date(this.asNumber(a));return isNaN(a)?null:a},asNumber:function(a){var c=m,a=this.mismatch(a,!0);!0!==a&&(c=Date.UTC("1970",0,1,a[0][0],a[0][1],a[0][2]||0),a[1]&&(c+=a[1]));return c},dateToString:function(a){if(a&&a.getUTCHours){var c=q(a.getUTCHours(),2)+":"+
-q(a.getUTCMinutes(),2),b=a.getSeconds();"0"!=b&&(c+=":"+q(b,2));b=a.getUTCMilliseconds();"0"!=b&&(c+="."+q(b,3));return c}return!1}};if(r||!n("range")||!n("time"))p=d.extend({},j,p),h=d.extend({},u,h);(r||!n("number"))&&e.addInputType("number",j);(r||!n("range"))&&e.addInputType("range",p);(r||!n("date"))&&e.addInputType("date",u);(r||!n("time"))&&e.addInputType("time",h)});
-jQuery.webshims.register("form-number-date-ui",function(d,e,j,p,u,h){var m=e.triggerInlineForm,j=Modernizr.inputtypes,f=function(){var a={"padding-box":"innerWidth","border-box":"outerWidth","content-box":"width"},c=Modernizr.prefixed&&Modernizr.prefixed("boxSizing");d.browser.msie&&8>e.browserVersion&&(c=!1);return function(b,d){var e,f,h;f="width";c&&(f=a[b.css(c)]||f);e=b[f]();f="width"==f;if(e){var i=parseInt(d.css("marginLeft"),10)||0,v=d.outerWidth();(h=parseInt(b.css("marginRight"),10)||0)&&
-b.css("marginRight",0);i<=-1*v?(d.css("marginRight",Math.floor(Math.abs(v+i-0.1)+h)),b.css("paddingRight",(parseInt(b.css("paddingRight"),10)||0)+Math.abs(i)),f&&b.css("width",Math.floor(e+i))):(d.css("marginRight",h),b.css("width",Math.floor(e-i-v-0.2)))}}}(),o={},n=d([]),l,i=function(a,c){d("input",a).add(c.filter("input")).each(function(){var a=d.prop(this,"type");if(i[a]&&!e.data(this,"shadowData"))i[a](d(this))})},q=function(a,c){if(h.lazyDate){var b=d.data(a[0],"setDateLazyTimer");b&&clearTimeout(b);
-d.data(a[0],"setDateLazyTimer",setTimeout(function(){a.datepicker("setDate",c);d.removeData(a[0],"setDateLazyTimer");a=null},0))}else a.datepicker("setDate",c)},r={tabindex:1,tabIndex:1,title:1,"aria-required":1,"aria-invalid":1};if(!h.copyAttrs)h.copyAttrs={};e.extendUNDEFProp(h.copyAttrs,r);var s=function(a){return h.calculateWidth?{css:{marginRight:a.css("marginRight"),marginLeft:a.css("marginLeft")},outerWidth:a.outerWidth()}:{}};i.common=function(a,c,b){if(Modernizr.formvalidation)a.on("firstinvalid",
-function(b){if(e.fromSubmit||!l)a.off("invalid.replacedwidgetbubble").on("invalid.replacedwidgetbubble",function(c){!b.isInvalidUIPrevented()&&!c.isDefaultPrevented()&&(e.validityAlert.showFor(b.target),b.preventDefault(),c.preventDefault());a.off("invalid.replacedwidgetbubble")})});var k,f,i=d("input, span.ui-slider-handle",c),j=a[0].attributes;for(k in h.copyAttrs)if((f=j[k])&&f.specified)r[k]&&i[0]?i.attr(k,f.nodeValue):c[0].setAttribute(k,f.nodeValue);k=(k=a.attr("id"))?d('label[for="'+k+'"]',
-a[0].form):n;c.addClass(a[0].className);e.addShadowDom(a,c,{data:b||{},shadowFocusElement:d("input.input-datetime-local-date, span.ui-slider-handle",c)[0],shadowChilds:i});a.after(c);if(a[0].form)d(a[0].form).on("reset",function(b){b.originalEvent&&!b.isDefaultPrevented()&&setTimeout(function(){a.prop("value",a.prop("value"))},0)});k[0]&&(c.getShadowFocusElement().attr("aria-labelledby",e.getID(k)),k.on("click",function(){a.getShadowFocusElement().focus();return!1}))};Modernizr.formvalidation&&["input",
-"form"].forEach(function(a){var c=e.defineNodeNameProperty(a,"checkValidity",{prop:{value:function(){l=!0;var a=c.prop._supvalue.apply(this,arguments);l=!1;return a}}})});if(!j.date||h.replaceUI){var t=function(a,c,b,k){var f,i,j=function(){l.dpDiv.unbind("mousedown.webshimsmousedownhandler");i=f=!1},l=c.on({focusin:function(){j();l.dpDiv.unbind("mousedown.webshimsmousedownhandler").bind("mousedown.webshimsmousedownhandler",function(){f=!0})},"focusout blur":function(a){f&&(i=!0,a.stopImmediatePropagation())}}).datepicker(d.extend({onClose:function(){i&&
-c.not(":focus")?(j(),c.trigger("focusout"),c.triggerHandler("blur")):j()}},o,h.datepicker,a.data("datepicker"))).on("change",b).data("datepicker");l.dpDiv.addClass("input-date-datepicker-control");k&&e.triggerDomUpdate(k[0]);"disabled,min,max,value,step,data-placeholder".split(",").forEach(function(b){var c=a.attr(b);c&&a.attr(b,c)});return l};i.date=function(a){if(d.fn.datepicker){var c=d('<input class="input-date" type="text" />'),b;this.common(a,c,i.date.attrs);b=t(a,c,function(b){i.date.blockAttr=
-!0;var e;if(h.lazyDate){var f=d.data(c[0],"setDateLazyTimer");f&&(clearTimeout(f),d.removeData(c[0],"setDateLazyTimer"))}try{e=(e=d.datepicker.parseDate(c.datepicker("option","dateFormat"),c.prop("value")))?d.datepicker.formatDate("yy-mm-dd",e):c.prop("value")}catch(j){e=c.prop("value")}a.prop("value",e);i.date.blockAttr=!1;b.stopImmediatePropagation();m(a[0],"input");m(a[0],"change")});d(a).on("updateshadowdom",function(){if(b.trigger[0]&&(a.css({display:""}),a[0].offsetWidth||a[0].offsetHeight)){var d=
-s(a);d.css&&(c.css(d.css),d.outerWidth&&c.outerWidth(d.outerWidth),f(c,b.trigger))}a.css({display:"none"})}).triggerHandler("updateshadowdom");b.trigger[0]&&setTimeout(function(){e.ready("WINDOWLOAD",function(){d(a).triggerHandler("updateshadowdom")})},9)}};i.date.attrs={disabled:function(a,c,b){d.prop(c,"disabled",!!b)},min:function(a,c,b){try{b=d.datepicker.parseDate("yy-mm-dd",b)}catch(e){b=!1}b&&d(c).datepicker("option","minDate",b)},max:function(a,c,b){try{b=d.datepicker.parseDate("yy-mm-dd",
-b)}catch(e){b=!1}b&&d(c).datepicker("option","maxDate",b)},"data-placeholder":function(a,c,b){a=(b||"").split("-");3==a.length&&(b=d(c).datepicker("option","dateFormat").replace("yy",a[0]).replace("mm",a[1]).replace("dd",a[2]));d.prop(c,"placeholder",b)},value:function(a,c,b){if(!i.date.blockAttr){try{var e=d.datepicker.parseDate("yy-mm-dd",b)}catch(f){e=!1}e?q(d(c),e):d.prop(c,"value",b)}}}}if(!j.range||h.replaceUI)i.range=function(a){if(d.fn.slider){var c=d('<span class="input-range"><span class="ui-slider-handle" role="slider" tabindex="0" /></span>');
-this.common(a,c,i.range.attrs);a.on("updateshadowdom",function(){a.css({display:""});if(a[0].offsetWidth||a[0].offsetHeight){var b=s(a);b.css&&(c.css(b.css),b.outerWidth&&c.outerWidth(b.outerWidth))}a.css({display:"none"})}).triggerHandler("updateshadowdom");c.slider(d.extend(!0,{},h.slider,a.data("slider"))).on({slide:function(b,c){if(b.originalEvent)i.range.blockAttr=!0,a.prop("value",c.value),i.range.blockAttr=!1,m(a[0],"input")},slidechange:function(b){b.originalEvent&&m(a[0],"change")}});["disabled",
-"min","max","step","value"].forEach(function(b){var c=a.prop(b),e;"value"==b&&!c&&(e=a.getShadowElement())&&(c=(d(e).slider("option","max")-d(e).slider("option","min"))/2);null!=c&&a.prop(b,c)})}},i.range.attrs={disabled:function(a,c,b){b=!!b;d(c).slider("option","disabled",b);d("span",c).attr({"aria-disabled":b+"",tabindex:b?"-1":"0"})},min:function(a,c,b){b=b?1*b||0:0;d(c).slider("option","min",b);d("span",c).attr({"aria-valuemin":b})},max:function(a,c,b){b=b||0===b?1*b||100:100;d(c).slider("option",
-"max",b);d("span",c).attr({"aria-valuemax":b})},value:function(a,c,b){b=d(a).prop("valueAsNumber");isNaN(b)||(i.range.blockAttr||d(c).slider("option","value",b),d("span",c).attr({"aria-valuenow":b,"aria-valuetext":b}))},step:function(a,c,b){b=b&&d.trim(b)?1*b||1:1;d(c).slider("option","step",b)}};if(h.replaceUI||!Modernizr.inputtypes.date||!Modernizr.inputtypes.range)j=function(){e.data(this,"hasShadow")&&d.prop(this,"value",d.prop(this,"value"))},e.onNodeNamesPropertyModify("input","valueAsNumber",
-j),e.onNodeNamesPropertyModify("input","valueAsDate",j);d.each("disabled,min,max,value,step,data-placeholder".split(","),function(a,c){e.onNodeNamesPropertyModify("input",c,function(a){var d=e.data(this,"shadowData");if(d&&d.data&&d.data[c]&&d.nativeElement===this)d.data[c](this,d.shadowElement,a)})});if(!h.availabeLangs)h.availabeLangs="af ar ar-DZ az bg bs ca cs da de el en-AU en-GB en-NZ eo es et eu fa fi fo fr fr-CH gl he hr hu hy id is it ja ko kz lt lv ml ms nl no pl pt-BR rm ro ru sk sl sq sr sr-SR sv ta th tr uk vi zh-CN zh-HK zh-TW".split(" ");
-j=function(){d.datepicker&&(e.activeLang({langObj:d.datepicker.regional,module:"form-number-date-ui",callback:function(a){a=d.extend({},o,a,h.datepicker);a.dateFormat&&h.datepicker.dateFormat!=a.dateFormat&&d("input.hasDatepicker").filter(".input-date, .input-datetime-local-date").datepicker("option","dateFormat",a.dateFormat).getNativeElement().filter("[data-placeholder]").attr("data-placeholder",function(a,b){return b});d.datepicker.setDefaults(a)}}),d(p).unbind("jquery-uiReady.langchange input-widgetsReady.langchange"))};
-d(p).on("jquery-uiReady.langchange input-widgetsReady.langchange",j);j();(function(){var a=function(){var a={};return function(b){return b in a?a[b]:a[b]=d('<input type="'+b+'" />')[0].type===b}}();if(!a("number")||!a("time")){var c=e.cfg["forms-ext"],b=e.inputTypes,i={number:"0123456789.",time:"0123456789:."},h=function(a,c,g){g=g||{};if(!("type"in g))g.type=d.prop(a,"type");if(!("step"in g))g.step=e.getStep(a,g.type);if(!("valueAsNumber"in g))g.valueAsNumber=b[g.type].asNumber(d.prop(a,"value"));
-var f="any"==g.step?b[g.type].step*b[g.type].stepScaleFactor:g.step;e.addMinMaxNumberToCache("min",d(a),g);e.addMinMaxNumberToCache("max",d(a),g);if(isNaN(g.valueAsNumber))g.valueAsNumber=b[g.type].stepBase||0;if("any"!==g.step&&(a=Math.round(1E7*((g.valueAsNumber-(g.minAsnumber||0))%g.step))/1E7)&&Math.abs(a)!=g.step)g.valueAsNumber-=a;a=g.valueAsNumber+f*c;return a=!isNaN(g.minAsNumber)&&a<g.minAsNumber?g.valueAsNumber*c<g.minAsNumber?g.minAsNumber:isNaN(g.maxAsNumber)?g.valueAsNumber:g.maxAsNumber:
-!isNaN(g.maxAsNumber)&&a>g.maxAsNumber?g.valueAsNumber*c>g.maxAsNumber?g.maxAsNumber:isNaN(g.minAsNumber)?g.valueAsNumber:g.minAsNumber:Math.round(1E7*a)/1E7};e.modules["form-number-date-ui"].getNextStep=h;if(c.stepArrows){var j={set:function(){var a=e.data(this,"step-controls");if(a)a[this.disabled||this.readonly?"addClass":"removeClass"]("disabled-step-control")}};e.onNodeNamesPropertyModify("input","disabled",j);e.onNodeNamesPropertyModify("input","readonly",d.extend({},j))}var l={38:1,40:-1},
-o=function(a,c){function e(){var b=d.prop(a,"value");b==i&&b!=k&&"string"==typeof b&&m(a,"change");k=b}var f=!1,i,k;(function(){k=d(a).on({"change.stepcontrol focus.stepcontrol":function(b){if(!f||"focus"!=b.type)k=d.prop(a,"value")},"blur.stepcontrol":function(){f||setTimeout(function(){!f&&!d(a).is(":focus")&&e();i=!1},9)}}).prop("value")})();return{triggerChange:e,step:function(e){!d.prop(a,"disabled")&&!a.readOnly&&e&&(i=b[c].numberToString(h(a,e,{type:c})),d.prop(a,"value",i),m(a,"input"))},
-setFocus:function(){f=!0;setTimeout(function(){f=!1},18);setTimeout(function(){if(!d(a).is(":focus"))try{a.focus()}catch(b){}},1)}}};e.addReady(function(h,j){c.stepArrows&&d("input",h).add(j.filter("input")).each(function(){var g=d.prop(this,"type");if(b[g]&&b[g].asNumber&&c.stepArrows&&!(!0!==c.stepArrows&&!c.stepArrows[g]||a(g)||d(h).hasClass("has-step-controls"))){var h=this,j=o(h,g),m=d('<span class="step-controls" unselectable="on"><span class="step-up" /><span class="step-down" /></span>').insertAfter(h).on({"selectstart dragstart":function(){return!1},
-"mousedown mousepress":function(a){d(a.target).hasClass("step-controls")||j.step(d(a.target).hasClass("step-up")?1:-1);j.setFocus();return!1},"mousepressstart mousepressend":function(a){"mousepressend"==a.type&&j.triggerChange();d(a.target)["mousepressstart"==a.type?"addClass":"removeClass"]("mousepress-ui")}}),p=function(a,b){if(b)return j.step(b),!1},n=d(h).addClass("has-step-controls").attr({readonly:h.readOnly,disabled:h.disabled,autocomplete:"off",role:"spinbutton"}).on("keyup",function(a){(a=
-l[a.keyCode])&&j.triggerChange(a)}).on(d.browser.msie?"keydown":"keypress",function(a){if(a=l[a.keyCode])return j.step(a),!1});if(i[g])n.on("keypress",function(){var a=i[g];return function(b){var c=String.fromCharCode(null==b.charCode?b.keyCode:b.charCode);return b.ctrlKey||b.metaKey||" ">c||-1<a.indexOf(c)}}());n.on({focus:function(){n.add(m).off(".mwhellwebshims").on("mousewheel.mwhellwebshims",p)},blur:function(){d(h).add(m).off(".mwhellwebshims")}});e.data(h,"step-controls",m);if(c.calculateWidth){var q;
-n.on("updateshadowdom",function(){if(!q&&(h.offsetWidth||h.offsetHeight))q=!0,f(n,m),m.css("marginTop",(n.outerHeight()-m.outerHeight())/2)}).triggerHandler("updateshadowdom")}}})})}})();e.addReady(function(a,c){d(p).on("jquery-uiReady.initinputui input-widgetsReady.initinputui",function(){if(d.datepicker||d.fn.slider){if(d.datepicker&&!o.dateFormat)o.dateFormat=d.datepicker._defaults.dateFormat;i(a,c)}d.datepicker&&d.fn.slider?d(p).unbind(".initinputui"):e.modules["input-widgets"].src||e.warn('jQuery UI Widget factory is already included, but not datepicker or slider. configure src of $.webshims.modules["input-widgets"].src')})})});
+jQuery.webshims.register("form-number-date-api",function(e,t,n,r,i){"use strict";t.getStep||(t.getStep=function(t,n){var r=e.attr(t,"step");return r==="any"?r:(n=n||l(t),!u[n]||!u[n].step?r:(r=y.number.asNumber(r),(!isNaN(r)&&r>0?r:u[n].step)*u[n].stepScaleFactor))}),t.addMinMaxNumberToCache||(t.addMinMaxNumberToCache=function(e,t,n){e+"AsNumber"in n||(n[e+"AsNumber"]=u[n.type].asNumber(t.attr(e)),isNaN(n[e+"AsNumber"])&&e+"Default"in u[n.type]&&(n[e+"AsNumber"]=u[n.type][e+"Default"]))});var s=parseInt("NaN",10),o=r,u=t.inputTypes,a=function(e){return typeof e=="number"||e&&e==e*1},f=function(t){return e('<input type="'+t+'" />').prop("type")===t},l=function(e){return(e.getAttribute("type")||"").toLowerCase()},c=function(e){return a(e)||e&&e=="0"+e*1},h=t.addMinMaxNumberToCache,p=function(e,t){e=""+e,t-=e.length;for(var n=0;n<t;n++)e="0"+e;return e},d=1e-7,v=t.bugs.bustedValidity;t.addValidityRule("stepMismatch",function(e,n,r,i){if(n==="")return!1;"type"in r||(r.type=l(e[0]));if(r.type=="date")return!1;var s=(i||{}).stepMismatch,o;if(u[r.type]&&u[r.type].step){"step"in r||(r.step=t.getStep(e[0],r.type));if(r.step=="any")return!1;"valueAsNumber"in r||(r.valueAsNumber=u[r.type].asNumber(n));if(isNaN(r.valueAsNumber))return!1;h("min",e,r),o=r.minAsNumber,isNaN(o)&&(o=u[r.type].stepBase||0),s=Math.abs((r.valueAsNumber-o)%r.step),s=!(s<=d||Math.abs(s-r.step)<=d)}return s}),[{name:"rangeOverflow",attr:"max",factor:1},{name:"rangeUnderflow",attr:"min",factor:-1}].forEach(function(e,n){t.addValidityRule(e.name,function(t,n,r,i){var s=(i||{})[e.name]||!1;if(n==="")return s;"type"in r||(r.type=l(t[0]));if(u[r.type]&&u[r.type].asNumber){"valueAsNumber"in r||(r.valueAsNumber=u[r.type].asNumber(n));if(isNaN(r.valueAsNumber))return!1;h(e.attr,t,r);if(isNaN(r[e.attr+"AsNumber"]))return s;s=r[e.attr+"AsNumber"]*e.factor<r.valueAsNumber*e.factor-d}return s})}),t.reflectProperties(["input"],["max","min","step"]);var m=t.defineNodeNameProperty("input","valueAsNumber",{prop:{get:function(){var t=this,n=l(t),r=u[n]&&u[n].asNumber?u[n].asNumber(e.prop(t,"value")):m.prop._supget&&m.prop._supget.apply(t,arguments);return r==null&&(r=s),r},set:function(n){var r=this,i=l(r);if(u[i]&&u[i].numberToString){if(isNaN(n)){e.prop(r,"value","");return}var s=u[i].numberToString(n);s!==!1?e.prop(r,"value",s):t.warn("INVALID_STATE_ERR: DOM Exception 11")}else m.prop._supset&&m.prop._supset.apply(r,arguments)}}}),g=t.defineNodeNameProperty("input","valueAsDate",{prop:{get:function(){var t=this,n=l(t);return u[n]&&u[n].asDate&&!u[n].noAsDate?u[n].asDate(e.prop(t,"value")):g.prop._supget&&g.prop._supget.call(t)||null},set:function(n){var r=this,i=l(r);if(!(u[i]&&u[i].dateToString&&!u[i].noAsDate))return g.prop._supset&&g.prop._supset.apply(r,arguments)||null;if(n===null)return e.prop(r,"value",""),"";var s=u[i].dateToString(n);if(s!==!1)return e.prop(r,"value",s),s;t.warn("INVALID_STATE_ERR: DOM Exception 11")}}}),y={number:{mismatch:function(e){return!a(e)},step:1,stepScaleFactor:1,asNumber:function(e){return a(e)?e*1:s},numberToString:function(e){return a(e)?e:!1}},range:{minDefault:0,maxDefault:100},date:{mismatch:function(t){if(!t||!t.split||!/\d$/.test(t))return!0;var n=t.split(/\u002D/);if(n.length!==3)return!0;var r=!1;e.each(n,function(e,t){if(!c(t))return r=!0,!1});if(r)return r;if(n[0].length!==4||n[1].length!=2||n[1]>12||n[2].length!=2||n[2]>33)r=!0;return t!==this.dateToString(this.asDate(t,!0))},step:1,stepScaleFactor:864e5,asDate:function(e,t){return!t&&this.mismatch(e)?null:new Date(this.asNumber(e,!0))},asNumber:function(e,t){var n=s;if(t||!this.mismatch(e))e=e.split(/\u002D/),n=Date.UTC(e[0],e[1]-1,e[2]);return n},numberToString:function(e){return a(e)?this.dateToString(new Date(e*1)):!1},dateToString:function(e){return e&&e.getFullYear?e.getUTCFullYear()+"-"+p(e.getUTCMonth()+1,2)+"-"+p(e.getUTCDate(),2):!1}},time:{mismatch:function(t,n){if(!t||!t.split||!/\d$/.test(t))return!0;t=t.split(/\u003A/);if(t.length<2||t.length>3)return!0;var r=!1,i;return t[2]&&(t[2]=t[2].split(/\u002E/),i=parseInt(t[2][1],10),t[2]=t[2][0]),e.each(t,function(e,t){if(!c(t)||t.length!==2)return r=!0,!1}),r?!0:t[0]>23||t[0]<0||t[1]>59||t[1]<0?!0:t[2]&&(t[2]>59||t[2]<0)?!0:i&&isNaN(i)?!0:(i&&(i<100?i*=100:i<10&&(i*=10)),n===!0?[t,i]:!1)},step:60,stepBase:0,stepScaleFactor:1e3,asDate:function(e){return e=new Date(this.asNumber(e)),isNaN(e)?null:e},asNumber:function(e){var t=s;return e=this.mismatch(e,!0),e!==!0&&(t=Date.UTC("1970",0,1,e[0][0],e[0][1],e[0][2]||0),e[1]&&(t+=e[1])),t},dateToString:function(e){if(e&&e.getUTCHours){var t=p(e.getUTCHours(),2)+":"+p(e.getUTCMinutes(),2),n=e.getSeconds();return n!="0"&&(t+=":"+p(n,2)),n=e.getUTCMilliseconds(),n!="0"&&(t+="."+p(n,3)),t}return!1}}};if(v||!f("range")||!f("time"))y.range=e.extend({},y.number,y.range),y.time=e.extend({},y.date,y.time);(v||!f("number"))&&t.addInputType("number",y.number),(v||!f("range"))&&t.addInputType("range",y.range),(v||!f("date"))&&t.addInputType("date",y.date),(v||!f("time"))&&t.addInputType("time",y.time)}),jQuery.webshims.register("form-number-date-ui",function(e,t,n,r,i,s){"use strict";var o=t.triggerInlineForm,u=Modernizr.inputtypes,a=function(){var n={"padding-box":"innerWidth","border-box":"outerWidth","content-box":"width"},r=Modernizr.prefixed&&Modernizr.prefixed("boxSizing");e.browser.msie&&t.browserVersion<8&&(r=!1);var i=function(e){var t="width";return r&&(t=n[e.css(r)]||t),{w:e[t](),add:t=="width"}};return function(e,t){var n=i(e);if(!n.w)return;var s={mL:parseInt(t.css("marginLeft"),10)||0,w:t.outerWidth()};n.mR=parseInt(e.css("marginRight"),10)||0,n.mR&&e.css("marginRight",0),s.mL<=s.w*-1?(t.css("marginRight",Math.floor(Math.abs(s.w+s.mL-.1)+n.mR)),e.css("paddingRight",(parseInt(e.css("paddingRight"),10)||0)+Math.abs(s.mL)),n.add&&e.css("width",Math.floor(n.w+s.mL-(r?.1:.6)))):(t.css("marginRight",n.mR),e.css("width",Math.floor(n.w-s.mL-s.w-(r?.2:.6))))}}(),f={},l=0,c=e([]),h,p=function(n,r){e("input",n).add(r.filter("input")).each(function(){var n=e.prop(this,"type");p[n]&&!t.data(this,"shadowData")&&p[n](e(this))})},d=function(t,n){if(!s.lazyDate){t.datepicker("setDate",n);return}var r=e.data(t[0],"setDateLazyTimer");r&&clearTimeout(r),e.data(t[0],"setDateLazyTimer",setTimeout(function(){t.datepicker("setDate",n),e.removeData(t[0],"setDateLazyTimer"),t=null},0))},v={tabindex:1,tabIndex:1,title:1,"aria-required":1,"aria-invalid":1};s.copyAttrs||(s.copyAttrs={}),t.extendUNDEFProp(s.copyAttrs,v);var m=function(e){return s.calculateWidth?{css:{marginRight:e.css("marginRight"),marginLeft:e.css("marginLeft")},outerWidth:e.outerWidth()}:{}},g=v;p.common=function(n,r,i){Modernizr.formvalidation&&n.on("firstinvalid",function(e){if(!t.fromSubmit&&h)return;n.off("invalid.replacedwidgetbubble").on("invalid.replacedwidgetbubble",function(r){!e.isInvalidUIPrevented()&&!r.isDefaultPrevented()&&(t.validityAlert.showFor(e.target),e.preventDefault(),r.preventDefault()),n.off("invalid.replacedwidgetbubble")})});var o,u,a=e("input, span.ui-slider-handle",r),f=n[0].attributes;for(o in s.copyAttrs)(u=f[o])&&u.specified&&(g[o]&&a[0]?a.attr(o,u.nodeValue):r[0].setAttribute(o,u.nodeValue));var l=n.attr("id"),p=l?e('label[for="'+l+'"]',n[0].form):c;r.addClass(n[0].className),t.addShadowDom(n,r,{data:i||{},shadowFocusElement:e("input.input-datetime-local-date, span.ui-slider-handle",r)[0],shadowChilds:a}),n.after(r),n[0].form&&e(n[0].form).on("reset",function(e){e.originalEvent&&!e.isDefaultPrevented()&&setTimeout(function(){n.prop("value",n.prop("value"))},0)}),p[0]&&(r.getShadowFocusElement().attr("aria-labelledby",t.getID(p)),p.on("click",function(){return n.getShadowFocusElement().focus(),!1}))},Modernizr.formvalidation&&["input","form"].forEach(function(e){var n=t.defineNodeNameProperty(e,"checkValidity",{prop:{value:function(){h=!0;var e=n.prop._supvalue.apply(this,arguments);return h=!1,e}}})});if(!u.date||s.replaceUI){var y={trigger:[.595,.395],normal:[.565,.425]},b=!e.browser.msie||t.browserVersion>6?0:.45,w=function(n,r,i,o){var u,a,l=function(){c.dpDiv.unbind("mousedown.webshimsmousedownhandler"),u=!1,a=!1},c=r.on({focusin:function(){l(),c.dpDiv.unbind("mousedown.webshimsmousedownhandler").bind("mousedown.webshimsmousedownhandler",function(){u=!0})},"focusout blur":function(e){u&&(a=!0,e.stopImmediatePropagation())}}).datepicker(e.extend({onClose:function(){a&&r.not(":focus")?(l(),r.trigger("focusout"),r.triggerHandler("blur")):l()}},f,s.datepicker,n.data("datepicker"))).on("change",i).data("datepicker");return c.dpDiv.addClass("input-date-datepicker-control"),o&&t.triggerDomUpdate(o[0]),["disabled","min","max","value","step","data-placeholder"].forEach(function(e){var t="attr",r=n[t](e);r&&n[t](e,r)}),c};p.date=function(n){if(!e.fn.datepicker)return;var r=e('<input class="input-date" type="text" />'),i=function(t){p.date.blockAttr=!0;var i;if(s.lazyDate){var u=e.data(r[0],"setDateLazyTimer");u&&(clearTimeout(u),e.removeData(r[0],"setDateLazyTimer"))}try{i=e.datepicker.parseDate(r.datepicker("option","dateFormat"),r.prop("value")),i=i?e.datepicker.formatDate("yy-mm-dd",i):r.prop("value")}catch(t){i=r.prop("value")}n.prop("value",i),p.date.blockAttr=!1,t.stopImmediatePropagation(),o(n[0],"input"),o(n[0],"change")},u;this.common(n,r,p.date.attrs),u=w(n,r,i),e(n).on("updateshadowdom",function(){if(u.trigger[0]){n.css({display:""});if(n[0].offsetWidth||n[0].offsetHeight){var e=m(n);e.css&&(r.css(e.css),e.outerWidth&&r.outerWidth(e.outerWidth),a(r,u.trigger))}}n.css({display:"none"})}).triggerHandler("updateshadowdom"),u.trigger[0]&&setTimeout(function(){t.ready("WINDOWLOAD",function(){e(n).triggerHandler("updateshadowdom")})},9)},p.date.attrs={disabled:function(t,n,r){e.prop(n,"disabled",!!r)},min:function(t,n,r){try{r=e.datepicker.parseDate("yy-mm-dd",r)}catch(i){r=!1}r&&e(n).datepicker("option","minDate",r)},max:function(t,n,r){try{r=e.datepicker.parseDate("yy-mm-dd",r)}catch(i){r=!1}r&&e(n).datepicker("option","maxDate",r)},"data-placeholder":function(t,n,r){var i=(r||"").split("-"),s;i.length==3&&(r=e(n).datepicker("option","dateFormat").replace("yy",i[0]).replace("mm",i[1]).replace("dd",i[2])),e.prop(n,"placeholder",r)},value:function(t,n,r){if(!p.date.blockAttr){try{var i=e.datepicker.parseDate("yy-mm-dd",r)}catch(s){var i=!1}i?d(e(n),i):e.prop(n,"value",r)}}}}if(!u.range||s.replaceUI)p.range=function(t){if(!e.fn.slider)return;var n=e('<span class="input-range"><span class="ui-slider-handle" role="slider" tabindex="0" /></span>'),r=function(e,n){e.originalEvent&&(p.range.blockAttr=!0,t.prop("value",n.value),p.range.blockAttr=!1,o(t[0],"input"))};this.common(t,n,p.range.attrs),t.on("updateshadowdom",function(){t.css({display:""});if(t[0].offsetWidth||t[0].offsetHeight){var e=m(t);e.css&&(n.css(e.css),e.outerWidth&&n.outerWidth(e.outerWidth))}t.css({display:"none"})}).triggerHandler("updateshadowdom"),n.slider(e.extend(!0,{},s.slider,t.data("slider"))).on({slide:r,slidechange:function(e){e.originalEvent&&o(t[0],"change")}}),["disabled","min","max","step","value"].forEach(function(n){var r=t.prop(n),i;n=="value"&&!r&&(i=t.getShadowElement(),i&&(r=(e(i).slider("option","max")-e(i).slider("option","min"))/2)),r!=null&&t.prop(n,r)})},p.range.attrs={disabled:function(t,n,r){r=!!r,e(n).slider("option","disabled",r),e("span",n).attr({"aria-disabled":r+"",tabindex:r?"-1":"0"})},min:function(t,n,r){r=r?r*1||0:0,e(n).slider("option","min",r),e("span",n).attr({"aria-valuemin":r})},max:function(t,n,r){r=r||r===0?r*1||100:100,e(n).slider("option","max",r),e("span",n).attr({"aria-valuemax":r})},value:function(t,n,r){r=e(t).prop("valueAsNumber"),isNaN(r)||(p.range.blockAttr||e(n).slider("option","value",r),e("span",n).attr({"aria-valuenow":r,"aria-valuetext":r}))},step:function(t,n,r){r=r&&e.trim(r)?r*1||1:1,e(n).slider("option","step",r)}};if(s.replaceUI||!Modernizr.inputtypes.date||!Modernizr.inputtypes.range){var E=function(n){t.data(this,"hasShadow")&&e.prop(this,"value",e.prop(this,"value"))};t.onNodeNamesPropertyModify("input","valueAsNumber",E),t.onNodeNamesPropertyModify("input","valueAsDate",E)}e.each(["disabled","min","max","value","step","data-placeholder"],function(e,n){t.onNodeNamesPropertyModify("input",n,function(e){var r=t.data(this,"shadowData");r&&r.data&&r.data[n]&&r.nativeElement===this&&r.data[n](this,r.shadowElement,e)})}),s.availabeLangs||(s.availabeLangs="af ar ar-DZ az bg bs ca cs da de el en-AU en-GB en-NZ eo es et eu fa fi fo fr fr-CH gl he hr hu hy id is it ja ko kz lt lv ml ms nl no pl pt-BR rm ro ru sk sl sq sr sr-SR sv ta th tr uk vi zh-CN zh-HK zh-TW".split(" "));var S=function(){if(!e.datepicker)return;t.activeLang({langObj:e.datepicker.regional,module:"form-number-date-ui",callback:function(t){var n=e.extend({},f,t,s.datepicker);n.dateFormat&&s.datepicker.dateFormat!=n.dateFormat&&e("input.hasDatepicker").filter(".input-date, .input-datetime-local-date").datepicker("option","dateFormat",n.dateFormat).getNativeElement().filter("[data-placeholder]").attr("data-placeholder",function(e,t){return t}),e.datepicker.setDefaults(n)}}),e(r).unbind("jquery-uiReady.langchange input-widgetsReady.langchange")};e(r).on("jquery-uiReady.langchange input-widgetsReady.langchange",S),S(),function(){var n=function(){var t={};return function(n){return n in t?t[n]:t[n]=e('<input type="'+n+'" />')[0].type===n}}();if(n("number")&&n("time"))return;var i=r,s=t.cfg["forms-ext"],u=t.inputTypes,f={number:"0123456789.",time:"0123456789:."},l=function(n,r,i){i=i||{},"type"in i||(i.type=e.prop(n,"type")),"step"in i||(i.step=t.getStep(n,i.type)),"valueAsNumber"in i||(i.valueAsNumber=u[i.type].asNumber(e.prop(n,"value")));var s=i.step=="any"?u[i.type].step*u[i.type].stepScaleFactor:i.step,o;return t.addMinMaxNumberToCache("min",e(n),i),t.addMinMaxNumberToCache("max",e(n),i),isNaN(i.valueAsNumber)&&(i.valueAsNumber=u[i.type].stepBase||0),i.step!=="any"&&(o=Math.round((i.valueAsNumber-(i.minAsnumber||0))%i.step*1e7)/1e7,o&&Math.abs(o)!=i.step&&(i.valueAsNumber=i.valueAsNumber-o)),o=i.valueAsNumber+s*r,!isNaN(i.minAsNumber)&&o<i.minAsNumber?o=i.valueAsNumber*r<i.minAsNumber?i.minAsNumber:isNaN(i.maxAsNumber)?i.valueAsNumber:i.maxAsNumber:!isNaN(i.maxAsNumber)&&o>i.maxAsNumber?o=i.valueAsNumber*r>i.maxAsNumber?i.maxAsNumber:isNaN(i.minAsNumber)?i.valueAsNumber:i.minAsNumber:o=Math.round(o*1e7)/1e7,o};t.modules["form-number-date-ui"].getNextStep=l;if(s.stepArrows){var c={set:function(e){var n=t.data(this,"step-controls");n&&n[this.disabled||this.readonly?"addClass":"removeClass"]("disabled-step-control")}};t.onNodeNamesPropertyModify("input","disabled",c),t.onNodeNamesPropertyModify("input","readonly",e.extend({},c))}var h={38:1,40:-1},p=function(t,n){function f(r){if(e.prop(t,"disabled")||t.readOnly||!r)return;s=u[n].numberToString(l(t,r,{type:n})),e.prop(t,"value",s),o(t,"input")}function c(){r=!0,setTimeout(function(){r=!1},i+9),setTimeout(function(){if(!e(t).is(":focus"))try{t.focus()}catch(n){}},1)}function h(){var n=e.prop(t,"value");n==s&&n!=a&&typeof n=="string"&&o(t,"change"),a=n}function p(){a=e(t).on({"change.stepcontrol focus.stepcontrol":function(n){if(!r||n.type!="focus")a=e.prop(t,"value")},"blur.stepcontrol":function(){r||setTimeout(function(){!r&&!e(t).is(":focus")&&h(),s=!1},i)}}).prop("value")}var r=!1,i=9,s,a;return p(),{triggerChange:h,step:f,setFocus:c}};t.addReady(function(r,i){s.stepArrows&&e("input",r).add(i.filter("input")).each(function(){var r=e.prop(this,"type");if(!u[r]||!u[r].asNumber||!s.stepArrows||s.stepArrows!==!0&&!s.stepArrows[r]||n(r)||e(i).hasClass("has-step-controls"))return;var i=this,o=p(i,r),l=e('<span class="step-controls" unselectable="on"><span class="step-up" /><span class="step-down" /></span>').insertAfter(i).on({"selectstart dragstart":function(){return!1},"mousedown mousepress":function(t){return e(t.target).hasClass("step-controls")||o.step(e(t.target).hasClass("step-up")?1:-1),o.setFocus(),!1},"mousepressstart mousepressend":function(t){t.type=="mousepressend"&&o.triggerChange(),e(t.target)[t.type=="mousepressstart"?"addClass":"removeClass"]("mousepress-ui")}}),c=function(e,t){if(t)return o.step(t),!1},d=e(i).addClass("has-step-controls").attr({readonly:i.readOnly,disabled:i.disabled,autocomplete:"off",role:"spinbutton"}).on("keyup",function(e){var t=h[e.keyCode];t&&o.triggerChange(t)}).on(e.browser.msie?"keydown":"keypress",function(e){var t=h[e.keyCode];if(t)return o.step(t),!1});f[r]&&d.on("keypress",function(){var e=f[r];return function(t){var n=String.fromCharCode(t.charCode==null?t.keyCode:t.charCode);return t.ctrlKey||t.metaKey||n<" "||e.indexOf(n)>-1}}()),d.on({focus:function(){d.add(l).off(".mwhellwebshims").on("mousewheel.mwhellwebshims",c)},blur:function(){e(i).add(l).off(".mwhellwebshims")}}),t.data(i,"step-controls",l);if(s.calculateWidth){var v;d.on("updateshadowdom",function(){!v&&(i.offsetWidth||i.offsetHeight)&&(v=!0,a(d,l),l.css("marginTop",(d.outerHeight()-l.outerHeight())/2))}).triggerHandler("updateshadowdom")}})})}(),t.addReady(function(n,i){e(r).on("jquery-uiReady.initinputui input-widgetsReady.initinputui",function(s){if(e.datepicker||e.fn.slider)e.datepicker&&!f.dateFormat&&(f.dateFormat=e.datepicker._defaults.dateFormat),p(n,i);e.datepicker&&e.fn.slider?e(r).unbind(".initinputui"):t.modules["input-widgets"].src||t.warn('jQuery UI Widget factory is already included, but not datepicker or slider. configure src of $.webshims.modules["input-widgets"].src')})})});
\ No newline at end of file