(function(n){n.extend(n.fn,{validate:function(t){if(!this.length){t&&t.debug&&window.console&&console.warn("nothing selected, can't validate, returning nothing");return}var i=n.data(this[0],"validator");return i?i:(this.attr("novalidate","novalidate"),i=new n.validator(t,this[0]),n.data(this[0],"validator",i),i.settings.onsubmit&&(this.validateDelegate(":submit","click",function(t){i.settings.submitHandler&&(i.submitButton=t.target);n(t.target).hasClass("cancel")&&(i.cancelSubmit=!0)}),this.submit(function(t){function r(){var r;return i.settings.submitHandler?(i.submitButton&&(r=n("<input type='hidden'/>").attr("name",i.submitButton.name).val(i.submitButton.value).appendTo(i.currentForm)),i.settings.submitHandler.call(i,i.currentForm,t),i.submitButton&&r.remove(),!1):!0}return i.settings.debug&&t.preventDefault(),i.cancelSubmit?(i.cancelSubmit=!1,r()):i.form()?i.pendingRequest?(i.formSubmitted=!0,!1):r():(i.focusInvalid(),!1)})),i)},valid:function(){if(n(this[0]).is("form"))return this.validate().form();var t=!0,i=n(this[0].form).validate();return this.each(function(){t&=i.element(this)}),t},removeAttrs:function(t){var i={},r=this;return n.each(t.split(/\s/),function(n,t){i[t]=r.attr(t);r.removeAttr(t)}),i},rules:function(t,i){var r=this[0],o,u,h;if(t){var e=n.data(r.form,"validator").settings,s=e.rules,f=n.validator.staticRules(r);switch(t){case"add":n.extend(f,n.validator.normalizeRule(i));s[r.name]=f;i.messages&&(e.messages[r.name]=n.extend(e.messages[r.name],i.messages));break;case"remove":return i?(o={},n.each(i.split(/\s/),function(n,t){o[t]=f[t];delete f[t]}),o):(delete s[r.name],f)}}return u=n.validator.normalizeRules(n.extend({},n.validator.metadataRules(r),n.validator.classRules(r),n.validator.attributeRules(r),n.validator.staticRules(r)),r),u.required&&(h=u.required,delete u.required,u=n.extend({required:h},u)),u}});n.extend(n.expr[":"],{blank:function(t){return!n.trim(""+t.value)},filled:function(t){return!!n.trim(""+t.value)},unchecked:function(n){return!n.checked}});n.validator=function(t,i){this.settings=n.extend(!0,{},n.validator.defaults,t);this.currentForm=i;this.init()};n.validator.format=function(t,i){return arguments.length===1?function(){var i=n.makeArray(arguments);return i.unshift(t),n.validator.format.apply(this,i)}:(arguments.length>2&&i.constructor!==Array&&(i=n.makeArray(arguments).slice(1)),i.constructor!==Array&&(i=[i]),n.each(i,function(n,i){t=t.replace(new RegExp("\\{"+n+"\\}","g"),i)}),t)};n.extend(n.validator,{defaults:{messages:{},groups:{},rules:{},errorClass:"error",validClass:"valid",errorElement:"label",focusInvalid:!0,errorContainer:n([]),errorLabelContainer:n([]),onsubmit:!0,ignore:":hidden",ignoreTitle:!1,onfocusin:function(n){this.lastActive=n;this.settings.focusCleanup&&!this.blockFocusCleanup&&(this.settings.unhighlight&&this.settings.unhighlight.call(this,n,this.settings.errorClass,this.settings.validClass),this.addWrapper(this.errorsFor(n)).hide())},onfocusout:function(n){!this.checkable(n)&&(n.name in this.submitted||!this.optional(n))&&this.element(n)},onkeyup:function(n,t){(t.which!==9||this.elementValue(n)!=="")&&(n.name in this.submitted||n===this.lastActive)&&this.element(n)},onclick:function(n){n.name in this.submitted?this.element(n):n.parentNode.name in this.submitted&&this.element(n.parentNode)},highlight:function(t,i,r){t.type==="radio"?this.findByName(t.name).addClass(i).removeClass(r):n(t).addClass(i).removeClass(r)},unhighlight:function(t,i,r){t.type==="radio"?this.findByName(t.name).removeClass(i).addClass(r):n(t).removeClass(i).addClass(r)}},setDefaults:function(t){n.extend(n.validator.defaults,t)},messages:{required:"This field is required.",remote:"Please fix this field.",email:"Please enter a valid email address.",url:"Please enter a valid URL.",date:"Please enter a valid date.",dateISO:"Please enter a valid date (ISO).",number:"Please enter a valid number.",digits:"Please enter only digits.",creditcard:"Please enter a valid credit card number.",equalTo:"Please enter the same value again.",maxlength:n.validator.format("Please enter no more than {0} characters."),minlength:n.validator.format("Please enter at least {0} characters."),rangelength:n.validator.format("Please enter a value between {0} and {1} characters long."),range:n.validator.format("Please enter a value between {0} and {1}."),max:n.validator.format("Please enter a value less than or equal to {0}."),min:n.validator.format("Please enter a value greater than or equal to {0}.")},autoCreateRanges:!1,prototype:{init:function(){function i(t){var i=n.data(this[0].form,"validator"),r="on"+t.type.replace(/^validate/,"");i.settings[r]&&i.settings[r].call(i,this[0],t)}var r,t;this.labelContainer=n(this.settings.errorLabelContainer);this.errorContext=this.labelContainer.length&&this.labelContainer||n(this.currentForm);this.containers=n(this.settings.errorContainer).add(this.settings.errorLabelContainer);this.submitted={};this.valueCache={};this.pendingRequest=0;this.pending={};this.invalid={};this.reset();r=this.groups={};n.each(this.settings.groups,function(t,i){n.each(i.split(/\s/),function(n,i){r[i]=t})});t=this.settings.rules;n.each(t,function(i,r){t[i]=n.validator.normalizeRule(r)});n(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ","focusin focusout keyup",i).validateDelegate("[type='radio'], [type='checkbox'], select, option","click",i);this.settings.invalidHandler&&n(this.currentForm).bind("invalid-form.validate",this.settings.invalidHandler)},form:function(){return this.checkForm(),n.extend(this.submitted,this.errorMap),this.invalid=n.extend({},this.errorMap),this.valid()||n(this.currentForm).triggerHandler("invalid-form",[this]),this.showErrors(),this.valid()},checkForm:function(){this.prepareForm();for(var n=0,t=this.currentElements=this.elements();t[n];n++)this.check(t[n]);return this.valid()},element:function(t){t=this.validationTargetFor(this.clean(t));this.lastElement=t;this.prepareElement(t);this.currentElements=n(t);var i=this.check(t)!==!1;return i?delete this.invalid[t.name]:this.invalid[t.name]=!0,this.numberOfInvalids()||(this.toHide=this.toHide.add(this.containers)),this.showErrors(),i},showErrors:function(t){if(t){n.extend(this.errorMap,t);this.errorList=[];for(var i in t)this.errorList.push({message:t[i],element:this.findByName(i)[0]});this.successList=n.grep(this.successList,function(n){return!(n.name in t)})}this.settings.showErrors?this.settings.showErrors.call(this,this.errorMap,this.errorList):this.defaultShowErrors()},resetForm:function(){n.fn.resetForm&&n(this.currentForm).resetForm();this.submitted={};this.lastElement=null;this.prepareForm();this.hideErrors();this.elements().removeClass(this.settings.errorClass).removeData("previousValue")},numberOfInvalids:function(){return this.objectLength(this.invalid)},objectLength:function(n){var t=0,i;for(i in n)t++;return t},hideErrors:function(){this.addWrapper(this.toHide).hide()},valid:function(){return this.size()===0},size:function(){return this.errorList.length},focusInvalid:function(){if(this.settings.focusInvalid)try{n(this.findLastActive()||this.errorList.length&&this.errorList[0].element||[]).filter(":visible").focus().trigger("focusin")}catch(t){}},findLastActive:function(){var t=this.lastActive;return t&&n.grep(this.errorList,function(n){return n.element.name===t.name}).length===1&&t},elements:function(){var t=this,i={};return n(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function(){return!this.name&&t.settings.debug&&window.console&&console.error("%o has no name assigned",this),this.name in i||!t.objectLength(n(this).rules())?!1:(i[this.name]=!0,!0)})},clean:function(t){return n(t)[0]},errors:function(){var t=this.settings.errorClass.replace(" ",".");return n(this.settings.errorElement+"."+t,this.errorContext)},reset:function(){this.successList=[];this.errorList=[];this.errorMap={};this.toShow=n([]);this.toHide=n([]);this.currentElements=n([])},prepareForm:function(){this.reset();this.toHide=this.errors().add(this.containers)},prepareElement:function(n){this.reset();this.toHide=this.errorsFor(n)},elementValue:function(t){var r=n(t).attr("type"),i=n(t).val();return r==="radio"||r==="checkbox"?n('input[name="'+n(t).attr("name")+'"]:checked').val():typeof i=="string"?i.replace(/\r/g,""):i},check:function(t){var r,u;t=this.validationTargetFor(this.clean(t));var f=n(t).rules(),e=!1,s=this.elementValue(t),i;for(r in f){u={method:r,parameters:f[r]};try{if(i=n.validator.methods[r].call(this,s,t,u.parameters),i==="dependency-mismatch"){e=!0;continue}if(e=!1,i==="pending"){this.toHide=this.toHide.not(this.errorsFor(t));return}if(!i)return this.formatAndAdd(t,u),!1}catch(o){throw this.settings.debug&&window.console&&console.log("exception occured when checking element "+t.id+", check the '"+u.method+"' method",o),o;}}if(!e)return this.objectLength(f)&&this.successList.push(t),!0},customMetaMessage:function(t,i){if(n.metadata){var r=this.settings.meta?n(t).metadata()[this.settings.meta]:n(t).metadata();return r&&r.messages&&r.messages[i]}},customDataMessage:function(t,i){return n(t).data("msg-"+i.toLowerCase())||t.attributes&&n(t).attr("data-msg-"+i.toLowerCase())},customMessage:function(n,t){var i=this.settings.messages[n];return i&&(i.constructor===String?i:i[t])},findDefined:function(){for(var n=0;n<arguments.length;n++)if(arguments[n]!==undefined)return arguments[n];return undefined},defaultMessage:function(t,i){return this.findDefined(this.customMessage(t.name,i),this.customDataMessage(t,i),this.customMetaMessage(t,i),!this.settings.ignoreTitle&&t.title||undefined,n.validator.messages[i],"<strong>Warning: No message defined for "+t.name+"<\/strong>")},formatAndAdd:function(t,i){var r=this.defaultMessage(t,i.method),u=/\$?\{(\d+)\}/g;typeof r=="function"?r=r.call(this,i.parameters,t):u.test(r)&&(r=n.validator.format(r.replace(u,"{$1}"),i.parameters));this.errorList.push({message:r,element:t});this.errorMap[t.name]=r;this.submitted[t.name]=r},addWrapper:function(n){return this.settings.wrapper&&(n=n.add(n.parent(this.settings.wrapper))),n},defaultShowErrors:function(){for(var i,t,n=0;this.errorList[n];n++)t=this.errorList[n],this.settings.highlight&&this.settings.highlight.call(this,t.element,this.settings.errorClass,this.settings.validClass),this.showLabel(t.element,t.message);if(this.errorList.length&&(this.toShow=this.toShow.add(this.containers)),this.settings.success)for(n=0;this.successList[n];n++)this.showLabel(this.successList[n]);if(this.settings.unhighlight)for(n=0,i=this.validElements();i[n];n++)this.settings.unhighlight.call(this,i[n],this.settings.errorClass,this.settings.validClass);this.toHide=this.toHide.not(this.toShow);this.hideErrors();this.addWrapper(this.toShow).show()},validElements:function(){return this.currentElements.not(this.invalidElements())},invalidElements:function(){return n(this.errorList).map(function(){return this.element})},showLabel:function(t,i){var r=this.errorsFor(t);r.length?(r.removeClass(this.settings.validClass).addClass(this.settings.errorClass),r.attr("generated")&&r.html(i)):(r=n("<"+this.settings.errorElement+"/>").attr({"for":this.idOrName(t),generated:!0}).addClass(this.settings.errorClass).html(i||""),this.settings.wrapper&&(r=r.hide().show().wrap("<"+this.settings.wrapper+"/>").parent()),this.labelContainer.append(r).length||(this.settings.errorPlacement?this.settings.errorPlacement(r,n(t)):r.insertAfter(t)));!i&&this.settings.success&&(r.text(""),typeof this.settings.success=="string"?r.addClass(this.settings.success):this.settings.success(r,t));this.toShow=this.toShow.add(r)},errorsFor:function(t){var i=this.idOrName(t);return this.errors().filter(function(){return n(this).attr("for")===i})},idOrName:function(n){return this.groups[n.name]||(this.checkable(n)?n.name:n.id||n.name)},validationTargetFor:function(n){return this.checkable(n)&&(n=this.findByName(n.name).not(this.settings.ignore)[0]),n},checkable:function(n){return/radio|checkbox/i.test(n.type)},findByName:function(t){return n(this.currentForm).find('[name="'+t+'"]')},getLength:function(t,i){switch(i.nodeName.toLowerCase()){case"select":return n("option:selected",i).length;case"input":if(this.checkable(i))return this.findByName(i.name).filter(":checked").length}return t.length},depend:function(n,t){return this.dependTypes[typeof n]?this.dependTypes[typeof n](n,t):!0},dependTypes:{boolean:function(n){return n},string:function(t,i){return!!n(t,i.form).length},"function":function(n,t){return n(t)}},optional:function(t){var i=this.elementValue(t);return!n.validator.methods.required.call(this,i,t)&&"dependency-mismatch"},startRequest:function(n){this.pending[n.name]||(this.pendingRequest++,this.pending[n.name]=!0)},stopRequest:function(t,i){this.pendingRequest--;this.pendingRequest<0&&(this.pendingRequest=0);delete this.pending[t.name];i&&this.pendingRequest===0&&this.formSubmitted&&this.form()?(n(this.currentForm).submit(),this.formSubmitted=!1):!i&&this.pendingRequest===0&&this.formSubmitted&&(n(this.currentForm).triggerHandler("invalid-form",[this]),this.formSubmitted=!1)},previousValue:function(t){return n.data(t,"previousValue")||n.data(t,"previousValue",{old:null,valid:!0,message:this.defaultMessage(t,"remote")})}},classRuleSettings:{required:{required:!0},email:{email:!0},url:{url:!0},date:{date:!0},dateISO:{dateISO:!0},number:{number:!0},digits:{digits:!0},creditcard:{creditcard:!0}},addClassRules:function(t,i){t.constructor===String?this.classRuleSettings[t]=i:n.extend(this.classRuleSettings,t)},classRules:function(t){var i={},r=n(t).attr("class");return r&&n.each(r.split(" "),function(){this in n.validator.classRuleSettings&&n.extend(i,n.validator.classRuleSettings[this])}),i},attributeRules:function(t){var u={},f=n(t),r,i;for(r in n.validator.methods)r==="required"?(i=f.get(0).getAttribute(r),i===""&&(i=!0),i=!!i):i=f.attr(r),i?u[r]=i:f[0].getAttribute("type")===r&&(u[r]=!0);return u.maxlength&&/-1|2147483647|524288/.test(u.maxlength)&&delete u.maxlength,u},metadataRules:function(t){if(!n.metadata)return{};var i=n.data(t.form,"validator").settings.meta;return i?n(t).metadata()[i]:n(t).metadata()},staticRules:function(t){var i={},r=n.data(t.form,"validator");return r.settings.rules&&(i=n.validator.normalizeRule(r.settings.rules[t.name])||{}),i},normalizeRules:function(t,i){return n.each(t,function(r,u){if(u===!1){delete t[r];return}if(u.param||u.depends){var f=!0;switch(typeof u.depends){case"string":f=!!n(u.depends,i.form).length;break;case"function":f=u.depends.call(i,i)}f?t[r]=u.param!==undefined?u.param:!0:delete t[r]}}),n.each(t,function(r,u){t[r]=n.isFunction(u)?u(i):u}),n.each(["minlength","maxlength","min","max"],function(){t[this]&&(t[this]=Number(t[this]))}),n.each(["rangelength","range"],function(){t[this]&&(t[this]=[Number(t[this][0]),Number(t[this][1])])}),n.validator.autoCreateRanges&&(t.min&&t.max&&(t.range=[t.min,t.max],delete t.min,delete t.max),t.minlength&&t.maxlength&&(t.rangelength=[t.minlength,t.maxlength],delete t.minlength,delete t.maxlength)),t.messages&&delete t.messages,t},normalizeRule:function(t){if(typeof t=="string"){var i={};n.each(t.split(/\s/),function(){i[this]=!0});t=i}return t},addMethod:function(t,i,r){n.validator.methods[t]=i;n.validator.messages[t]=r!==undefined?r:n.validator.messages[t];i.length<3&&n.validator.addClassRules(t,n.validator.normalizeRule(t))},methods:{required:function(t,i,r){if(!this.depend(r,i))return"dependency-mismatch";if(i.nodeName.toLowerCase()==="select"){var u=n(i).val();return u&&u.length>0}return this.checkable(i)?this.getLength(t,i)>0:n.trim(t).length>0},remote:function(t,i,r){var f,u,e;return this.optional(i)?"dependency-mismatch":(f=this.previousValue(i),this.settings.messages[i.name]||(this.settings.messages[i.name]={}),f.originalMessage=this.settings.messages[i.name].remote,this.settings.messages[i.name].remote=f.message,r=typeof r=="string"&&{url:r}||r,this.pending[i.name])?"pending":f.old===t?f.valid:(f.old=t,u=this,this.startRequest(i),e={},e[i.name]=t,n.ajax(n.extend(!0,{url:r,mode:"abort",port:"validate"+i.name,dataType:"json",data:e,success:function(r){var e,h,s,o;u.settings.messages[i.name].remote=f.originalMessage;e=r===!0||r==="true";e?(h=u.formSubmitted,u.prepareElement(i),u.formSubmitted=h,u.successList.push(i),delete u.invalid[i.name],u.showErrors()):(s={},o=r||u.defaultMessage(i,"remote"),s[i.name]=f.message=n.isFunction(o)?o(t):o,u.invalid[i.name]=!0,u.showErrors(s));f.valid=e;u.stopRequest(i,e)}},r)),"pending")},minlength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(n.trim(t),i);return this.optional(i)||u>=r},maxlength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(n.trim(t),i);return this.optional(i)||u<=r},rangelength:function(t,i,r){var u=n.isArray(t)?t.length:this.getLength(n.trim(t),i);return this.optional(i)||u>=r[0]&&u<=r[1]},min:function(n,t,i){return this.optional(t)||n>=i},max:function(n,t,i){return this.optional(t)||n<=i},range:function(n,t,i){return this.optional(t)||n>=i[0]&&n<=i[1]},email:function(n,t){return this.optional(t)||/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(n)},url:function(n,t){return this.optional(t)||/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(n)},date:function(n,t){return this.optional(t)||!/Invalid|NaN/.test(new Date(n))},dateISO:function(n,t){return this.optional(t)||/^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(n)},number:function(n,t){return this.optional(t)||/^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(n)},digits:function(n,t){return this.optional(t)||/^\d+$/.test(n)},creditcard:function(n,t){var r,e;if(this.optional(t))return"dependency-mismatch";if(/[^0-9 \-]+/.test(n))return!1;var f=0,i=0,u=!1;for(n=n.replace(/\D/g,""),r=n.length-1;r>=0;r--)e=n.charAt(r),i=parseInt(e,10),u&&(i*=2)>9&&(i-=9),f+=i,u=!u;return f%10==0},equalTo:function(t,i,r){var u=n(r);return this.settings.onfocusout&&u.unbind(".validate-equalTo").bind("blur.validate-equalTo",function(){n(i).valid()}),t===u.val()}}});n.format=n.validator.format})(jQuery),function(n){var t={},i;n.ajaxPrefilter?n.ajaxPrefilter(function(n,i,r){var u=n.port;n.mode==="abort"&&(t[u]&&t[u].abort(),t[u]=r)}):(i=n.ajax,n.ajax=function(r){var f=("mode"in r?r:n.ajaxSettings).mode,u=("port"in r?r:n.ajaxSettings).port;return f==="abort"?(t[u]&&t[u].abort(),t[u]=i.apply(this,arguments)):i.apply(this,arguments)})}(jQuery),function(n){jQuery.event.special.focusin||jQuery.event.special.focusout||!document.addEventListener||n.each({focus:"focusin",blur:"focusout"},function(t,i){function r(t){return t=n.event.fix(t),t.type=i,n.event.handle.call(this,t)}n.event.special[i]={setup:function(){this.addEventListener(t,r,!0)},teardown:function(){this.removeEventListener(t,r,!0)},handler:function(t){var r=arguments;return r[0]=n.event.fix(t),r[0].type=i,n.event.handle.apply(this,r)}}});n.extend(n.fn,{validateDelegate:function(t,i,r){return this.bind(i,function(i){var u=n(i.target);if(u.is(t))return r.apply(u,arguments)})}})}(jQuery),function(n){function i(n,t,i){n.rules[t]=i;n.message&&(n.messages[t]=n.message)}function h(n){return n.replace(/^\s+|\s+$/g,"").split(/\s*,\s*/g)}function f(n){return n.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g,"\\$1")}function e(n){return n.substr(0,n.lastIndexOf(".")+1)}function o(n,t){return n.indexOf("*.")===0&&(n=n.replace("*.",t)),n}function c(t,i){var r=n(this).find("[data-valmsg-for='"+f(i[0].name)+"']"),u=n.parseJSON(r.attr("data-valmsg-replace"))!==!1;r.removeClass("field-validation-valid").addClass("field-validation-error");t.data("unobtrusiveContainer",r);u?(r.empty(),t.removeClass("input-validation-error").appendTo(r)):t.hide()}function l(t,i){var u=n(this).find("[data-valmsg-summary=true]"),r=u.find("ul");r&&r.length&&i.errorList.length&&(r.empty(),u.addClass("validation-summary-errors").removeClass("validation-summary-valid"),n.each(i.errorList,function(){n("<li />").html(this.message).appendTo(r)}))}function a(t){var i=t.data("unobtrusiveContainer"),r=n.parseJSON(i.attr("data-valmsg-replace"));i&&(i.addClass("field-validation-valid").removeClass("field-validation-error"),t.removeData("unobtrusiveContainer"),r&&i.empty())}function v(){var t=n(this);t.data("validator").resetForm();t.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");t.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")}function s(t){var i=n(t),r=i.data(u),f=n.proxy(v,t);return r||(r={options:{errorClass:"input-validation-error",errorElement:"span",errorPlacement:n.proxy(c,t),invalidHandler:n.proxy(l,t),messages:{},rules:{},success:n.proxy(a,t)},attachValidation:function(){i.unbind("reset."+u,f).bind("reset."+u,f).validate(this.options)},validate:function(){return i.validate(),i.valid()}},i.data(u,r)),r}var r=n.validator,t,u="unobtrusiveValidation";r.unobtrusive={adapters:[],parseElement:function(t,i){var u=n(t),f=u.parents("form")[0],r,e,o;f&&(r=s(f),r.options.rules[t.name]=e={},r.options.messages[t.name]=o={},n.each(this.adapters,function(){var i="data-val-"+this.name,r=u.attr(i),s={};r!==undefined&&(i+="-",n.each(this.params,function(){s[this]=u.attr(i+this)}),this.adapt({element:t,form:f,message:r,params:s,rules:e,messages:o}))}),n.extend(e,{__dummy__:!0}),i||r.attachValidation())},parse:function(t){var i=n(t).parents("form").andSelf().add(n(t).find("form")).filter("form");n(t).find(":input[data-val=true]").each(function(){r.unobtrusive.parseElement(this,!0)});i.each(function(){var n=s(this);n&&n.attachValidation()})}};t=r.unobtrusive.adapters;t.add=function(n,t,i){return i||(i=t,t=[]),this.push({name:n,params:t,adapt:i}),this};t.addBool=function(n,t){return this.add(n,function(r){i(r,t||n,!0)})};t.addMinMax=function(n,t,r,u,f,e){return this.add(n,[f||"min",e||"max"],function(n){var f=n.params.min,e=n.params.max;f&&e?i(n,u,[f,e]):f?i(n,t,f):e&&i(n,r,e)})};t.addSingleVal=function(n,t,r){return this.add(n,[t||"val"],function(u){i(u,r||n,u.params[t])})};r.addMethod("__dummy__",function(){return!0});r.addMethod("regex",function(n,t,i){var r;return this.optional(t)?!0:(r=new RegExp(i).exec(n),r&&r.index===0&&r[0].length===n.length)});r.addMethod("nonalphamin",function(n,t,i){var r;return i&&(r=n.match(/\W/g),r=r&&r.length>=i),r});t.addSingleVal("accept","exts").addSingleVal("regex","pattern");t.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");t.addMinMax("length","minlength","maxlength","rangelength").addMinMax("range","min","max","range");t.add("equalto",["other"],function(t){var r=e(t.element.name),u=t.params.other,s=o(u,r),h=n(t.form).find(":input[name='"+f(s)+"']")[0];i(t,"equalTo",h)});t.add("required",function(n){(n.element.tagName.toUpperCase()!=="INPUT"||n.element.type.toUpperCase()!=="CHECKBOX")&&i(n,"required",!0)});t.add("remote",["url","type","additionalfields"],function(t){var r={url:t.params.url,type:t.params.type||"GET",data:{}},u=e(t.element.name);n.each(h(t.params.additionalfields||t.element.name),function(i,e){var s=o(e,u);r.data[s]=function(){return n(t.form).find(":input[name='"+f(s)+"']").val()}});i(t,"remote",r)});t.add("password",["min","nonalphamin","regex"],function(n){n.params.min&&i(n,"minlength",n.params.min);n.params.nonalphamin&&i(n,"nonalphamin",n.params.nonalphamin);n.params.regex&&i(n,"regex",n.params.regex)});n(function(){r.unobtrusive.parse(document)})}(jQuery),function(){function u(n){throw n;}function s(n){return function(){return n}}function h(h){function gt(n,i,u,f,e){var o=[],n=l.j(function(){var n=i(u,e)||[];0<o.length&&(l.a.Xa(k(o),n),f&&l.r.K(f,t,[u,n,e]));o.splice(0,o.length);l.a.P(o,n)},t,{W:n,Ja:function(){return 0==o.length||!l.a.X(o[0])}});return{M:o,j:n.oa()?n:r}}function k(n){for(;n.length&&!l.a.X(n[0]);)n.splice(0,1);if(1<n.length){for(var t=n[0],r=n[n.length-1],i=[t];t!==r;){if(t=t.nextSibling,!t)return;i.push(t)}Array.prototype.splice.apply(n,[0,n.length].concat(i))}return n}function ut(n,t,i,r,u){for(var o=Math.min,l=Math.max,s=[],a=n.length,f,h=t.length,c=h-a||1,w=a+h+1,v,p,b,n,y,t,e=0;e<=a;e++)for(p=v,s.push(v=[]),b=o(h,e+c),f=l(0,e-1);f<=b;f++)v[f]=f?e?n[e-1]===t[f-1]?p[f-1]:o(p[f]||w,v[f-1]||w)+1:f+1:e+1;for(o=[],l=[],c=[],e=a,f=h;e||f;)h=s[e][f]-1,f&&h===s[e][f-1]?l.push(o[o.length]={status:i,value:t[--f],index:f}):e&&h===s[e-1][f]?c.push(o[o.length]={status:r,value:n[--e],index:e}):(o.push({status:"retained",value:t[--f]}),--e);if(l.length&&c.length)for(n=10*a,t=i=0;(u||t<n)&&(y=l[i]);i++){for(r=0;s=c[r];r++)if(y.value===s.value){y.moved=s.index;s.moved=y.index;c.splice(r,1);t=r=0;break}t+=r}return o.reverse()}function ft(r,f,e,o,s){var s=s||{},h=r&&d(r),h=h&&h.ownerDocument,c=s.templateEngine||rt;l.ya.ub(e,c,h);e=c.renderTemplate(e,o,s,h);("number"!=typeof e.length||0<e.length&&"number"!=typeof e[0].nodeType)&&u(Error("Template engine must return an array of DOM nodes"));h=i;switch(f){case"replaceChildren":l.e.N(r,e);h=n;break;case"replaceNode":l.a.Xa(r,e);h=n;break;case"ignoreTargetNode":break;default:u(Error("Unknown renderMode: "+f))}return h&&(et(e,o),s.afterRender&&l.r.K(s.afterRender,t,[e,o.$data])),e}function d(n){return n.nodeType?n:0<n.length?n[0]:t}function et(n,t){if(n.length){var i=n[0],r=n[n.length-1];ot(i,r,function(n){l.Ca(t,n)});ot(i,r,function(n){l.s.hb(n,[t])})}}function ot(n,t,i){for(var r,t=l.e.nextSibling(t);n&&(r=n)!==t;)n=l.e.nextSibling(r),(1===r.nodeType||8===r.nodeType)&&i(r)}function st(n,t,i){for(var r,e,n=l.g.aa(n),o=l.g.Q,f=0;f<n.length;f++)r=n[f].key,o.hasOwnProperty(r)&&(e=o[r],"function"==typeof e?(r=e(n[f].value))&&u(Error(r)):e||u(Error("This template engine does not support the '"+r+"' binding within its templates")));return n="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+l.g.ba(n)+" } })()})",i.createJavaScriptEvaluatorBlock(n)+t}function ht(n,i,f,e){function c(n){return function(){return o[n]}}function a(){return o}var s=0,o,h;return l.j(function(){var y=f&&f instanceof l.z?f:new l.z(l.a.d(f)),p=y.$data,t,v;if(e&&l.cb(n,y),o=("function"==typeof i?i(y,n):i)||l.J.instance.getBindings(n,y)){if(0===s){s=1;for(t in o)v=l.c[t],v&&8===n.nodeType&&!l.e.I[t]&&u(Error("The binding '"+t+"' cannot be used with virtual elements")),v&&"function"==typeof v.init&&(v=v.init(n,c(t),a,p,y))&&v.controlsDescendantBindings&&(h!==r&&u(Error("Multiple bindings ("+h+" and "+t+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.")),h=t);s=2}if(2===s)for(t in o)(v=l.c[t])&&"function"==typeof v.update&&v.update(n,c(t),a,p,y)}},t,{W:n}),{Mb:h===r}}function ct(i,r,u){var e=n,f=1===r.nodeType;f&&l.e.Sa(r);(f&&u||l.J.instance.nodeHasBindings(r))&&(e=ht(r,t,i,u).Mb);e&&lt(i,r,!f)}function lt(n,t,i){for(var r=l.e.firstChild(t);t=r;)r=l.e.nextSibling(t),ct(n,t,i)}function at(n,i){var r=vt(n,i);return r?0<r.length?r[r.length-1].nextSibling:n.nextSibling:t}function vt(n,i){for(var r=n,f=1,e=[];r=r.nextSibling;){if(p(r)&&(f--,0===f))return e;e.push(r);a(r)&&f++}return i||u(Error("Cannot find closing comment tag to match: "+n.nodeValue)),t}function p(n){return 8==n.nodeType&&(b?n.text:n.nodeValue).match(fi)}function a(n){return 8==n.nodeType&&(b?n.text:n.nodeValue).match(ui)}function g(n,i){for(var r=t;n!=r;)r=n,n=n.replace(ti,function(n,t){return i[t]});return n}function ni(){var n=[],t=[];this.save=function(i,r){var u=l.a.i(n,i);0<=u?t[u]=r:(n.push(i),t.push(r))};this.get=function(i){return i=l.a.i(n,i),0<=i?t[i]:r}}function yt(n,i,u){function s(t){var f=i(n[t]),o;switch(typeof f){case"boolean":case"number":case"string":case"function":e[t]=f;break;case"object":case"undefined":o=u.get(f);e[t]=o!==r?o:yt(f,i,u)}}var e,o,f;if(u=u||new ni,n=i(n),!("object"==typeof n&&n!==t&&n!==r&&!(n instanceof Date)))return n;if(e=n instanceof Array?[]:{},u.save(n,e),o=n,o instanceof Array){for(f=0;f<o.length;f++)s(f);"function"==typeof o.toJSON&&s("toJSON")}else for(f in o)s(f);return e}function pt(n,i){var r;if(n)if(8==n.nodeType)r=l.s.Ta(n.nodeValue),r!=t&&i.push({rb:n,Eb:r});else if(1==n.nodeType)for(var r=0,u=n.childNodes,f=u.length;r<f;r++)pt(u[r],i)}function nt(t,r,u,f){l.c[t]={init:function(t){return l.a.f.set(t,it,{}),{controlsDescendantBindings:n}},update:function(t,i,e,o,s){var e=l.a.f.get(t,it),i=l.a.d(i()),o=!u!=!i,h=!e.Ya;(h||r||o!==e.pb)&&(h&&(e.Ya=l.a.Ha(l.e.childNodes(t),n)),o?(h||l.e.N(t,l.a.Ha(e.Ya)),l.Da(f?f(s,i):s,t)):l.e.Y(t),e.pb=o)}};l.g.Q[t]=i;l.e.I[t]=n}function wt(n,i,r){r&&i!==l.k.q(n)&&l.k.T(n,i);i!==l.k.q(n)&&l.r.K(l.a.Aa,t,[n,"change"])}var l="undefined"!=typeof h?h:{},w,v,bt,y,tt,it,kt,dt,rt;l.b=function(n,t){for(var i=n.split("."),r=l,u=0;u<i.length-1;u++)r=r[i[u]];r[i[i.length-1]]=t};l.p=function(n,t,i){n[t]=i};l.version="2.2.0";l.b("version",l.version);l.a=new function(){function p(n,t){if("input"!==l.a.u(n)||!n.type||"click"!=t.toLowerCase())return i;var r=n.type;return"checkbox"==r||"radio"==r}var d=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,s={},w={},a,v,y,b,k,h;s[/Firefox\/2/i.test(c.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"];s.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" ");for(a in s)if(v=s[a],v.length)for(y=0,b=v.length;y<b;y++)w[v[y]]=a;for(k={propertychange:n},s=3,a=e.createElement("div"),v=a.getElementsByTagName("i");a.innerHTML="<!--[if gt IE "+ ++s+"]><i><\/i><![endif]-->",v[0];);return h=4<s?s:r,{Ma:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],o:function(n,t){for(var i=0,r=n.length;i<r;i++)t(n[i])},i:function(n,t){if("function"==typeof Array.prototype.indexOf)return Array.prototype.indexOf.call(n,t);for(var i=0,r=n.length;i<r;i++)if(n[i]===t)return i;return-1},kb:function(n,i,r){for(var u=0,f=n.length;u<f;u++)if(i.call(r,n[u]))return n[u];return t},ga:function(n,t){var i=l.a.i(n,t);0<=i&&n.splice(i,1)},Fa:function(n){for(var n=n||[],i=[],t=0,r=n.length;t<r;t++)0>l.a.i(i,n[t])&&i.push(n[t]);return i},V:function(n,t){for(var n=n||[],r=[],i=0,u=n.length;i<u;i++)r.push(t(n[i]));return r},fa:function(n,t){for(var n=n||[],r=[],i=0,u=n.length;i<u;i++)t(n[i])&&r.push(n[i]);return r},P:function(n,t){if(t instanceof Array)n.push.apply(n,t);else for(var i=0,r=t.length;i<r;i++)n.push(t[i]);return n},extend:function(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n},ka:function(n){for(;n.firstChild;)l.removeNode(n.firstChild)},Gb:function(n){for(var n=l.a.L(n),i=e.createElement("div"),t=0,r=n.length;t<r;t++)i.appendChild(l.A(n[t]));return i},Ha:function(t,i){for(var u,r=0,e=t.length,f=[];r<e;r++)u=t[r].cloneNode(n),f.push(i?l.A(u):u);return f},N:function(n,t){if(l.a.ka(n),t)for(var i=0,r=t.length;i<r;i++)n.appendChild(t[i])},Xa:function(n,t){var r=n.nodeType?[n]:n;if(0<r.length){for(var f=r[0],e=f.parentNode,i=0,u=t.length;i<u;i++)e.insertBefore(t[i],f);for(i=0,u=r.length;i<u;i++)l.removeNode(r[i])}},ab:function(n,t){7>h?n.setAttribute("selected",t):n.selected=t},D:function(n){return(n||"").replace(d,"")},Qb:function(n,t){for(var r,u=[],f=(n||"").split(t),i=0,e=f.length;i<e;i++)r=l.a.D(f[i]),""!==r&&u.push(r);return u},Nb:function(n,t){return n=n||"",t.length>n.length?i:n.substring(0,t.length)===t},sb:function(r,u){if(u.compareDocumentPosition)return 16==(u.compareDocumentPosition(r)&16);for(;r!=t;){if(r==u)return n;r=r.parentNode}return i},X:function(n){return l.a.sb(n,n.ownerDocument)},u:function(n){return n&&n.tagName&&n.tagName.toLowerCase()},n:function(t,r,e){var o=h&&k[r],s,e;o||"undefined"==typeof f?!o&&"function"==typeof t.addEventListener?t.addEventListener(r,e,i):"undefined"!=typeof t.attachEvent?t.attachEvent("on"+r,function(n){e.call(t,n)}):u(Error("Browser doesn't support addEventListener or attachEvent")):(p(t,r)&&(s=e,e=function(t,i){var r=this.checked;i&&(this.checked=i.mb!==n);s.call(this,t);this.checked=r}),f(t).bind(r,e))},Aa:function(t,r){if(t&&t.nodeType||u(Error("element must be a DOM node when calling triggerEvent")),"undefined"!=typeof f){var s=[];p(t,r)&&s.push({mb:t.checked});f(t).trigger(r,s)}else"function"==typeof e.createEvent?"function"==typeof t.dispatchEvent?(s=e.createEvent(w[r]||"HTMLEvents"),s.initEvent(r,n,n,o,0,0,0,0,0,i,i,i,i,0,t),t.dispatchEvent(s)):u(Error("The supplied element doesn't support dispatchEvent")):"undefined"!=typeof t.fireEvent?(p(t,r)&&(t.checked=t.checked!==n),t.fireEvent("on"+r)):u(Error("Browser doesn't support triggering events"))},d:function(n){return l.$(n)?n():n},ta:function(n){return l.$(n)?n.t():n},da:function(n,t,i){if(t){var u=/[\w-]+/g,r=n.className.match(u)||[];l.a.o(t.match(u),function(n){var t=l.a.i(r,n);0<=t?i||r.splice(t,1):i&&r.push(n)});n.className=r.join(" ")}},bb:function(n,i){var u=l.a.d(i),f;(u===t||u===r)&&(u="");3===n.nodeType?n.data=u:(f=l.e.firstChild(n),!f||3!=f.nodeType||l.e.nextSibling(f)?l.e.N(n,[e.createTextNode(u)]):f.data=u,l.a.vb(n))},$a:function(n,t){if(n.name=t,7>=h)try{n.mergeAttributes(e.createElement("<input name='"+n.name+"'/>"),i)}catch(r){}},vb:function(n){9<=h&&(n=1==n.nodeType?n:n.parentNode,n.style&&(n.style.zoom=n.style.zoom))},tb:function(n){if(9<=h){var t=n.style.width;n.style.width=0;n.style.width=t}},Kb:function(n,t){for(var n=l.a.d(n),t=l.a.d(t),r=[],i=n;i<=t;i++)r.push(i);return r},L:function(n){for(var i=[],t=0,r=n.length;t<r;t++)i.push(n[t]);return i},Ob:6===h,Pb:7===h,Z:h,Na:function(n,t){for(var r=l.a.L(n.getElementsByTagName("input")).concat(l.a.L(n.getElementsByTagName("textarea"))),f="string"==typeof t?function(n){return n.name===t}:function(n){return t.test(n.name)},u=[],i=r.length-1;0<=i;i--)f(r[i])&&u.push(r[i]);return u},Hb:function(n){return"string"==typeof n&&(n=l.a.D(n))?o.JSON&&o.JSON.parse?o.JSON.parse(n):new Function("return "+n)():t},wa:function(n,t,i){return("undefined"==typeof JSON||"undefined"==typeof JSON.stringify)&&u(Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js")),JSON.stringify(l.a.d(n),t,i)},Ib:function(n,t,i){var i=i||{},h=i.params||{},a=i.includeFields||this.Ma,c=n,o,s,f,t,r,u;if("object"==typeof n&&"form"===l.a.u(n))for(c=n.action,o=a.length-1;0<=o;o--)for(s=l.a.Na(n,a[o]),f=s.length-1;0<=f;f--)h[s[f].name]=s[f].value;t=l.a.d(t);r=e.createElement("form");r.style.display="none";r.action=c;r.method="post";for(u in t)n=e.createElement("input"),n.name=u,n.value=l.a.wa(l.a.d(t[u])),r.appendChild(n);for(u in h)n=e.createElement("input"),n.name=u,n.value=h[u],r.appendChild(n);e.body.appendChild(r);i.submitter?i.submitter(r):r.submit();setTimeout(function(){r.parentNode.removeChild(r)},0)}}};l.b("utils",l.a);l.b("utils.arrayForEach",l.a.o);l.b("utils.arrayFirst",l.a.kb);l.b("utils.arrayFilter",l.a.fa);l.b("utils.arrayGetDistinctValues",l.a.Fa);l.b("utils.arrayIndexOf",l.a.i);l.b("utils.arrayMap",l.a.V);l.b("utils.arrayPushAll",l.a.P);l.b("utils.arrayRemoveItem",l.a.ga);l.b("utils.extend",l.a.extend);l.b("utils.fieldsIncludedWithJsonPost",l.a.Ma);l.b("utils.getFormFields",l.a.Na);l.b("utils.peekObservable",l.a.ta);l.b("utils.postJson",l.a.Ib);l.b("utils.parseJson",l.a.Hb);l.b("utils.registerEventHandler",l.a.n);l.b("utils.stringifyJson",l.a.wa);l.b("utils.range",l.a.Kb);l.b("utils.toggleDomNodeCssClass",l.a.da);l.b("utils.triggerEvent",l.a.Aa);l.b("utils.unwrapObservable",l.a.d);Function.prototype.bind||(Function.prototype.bind=function(n){var i=this,t=Array.prototype.slice.call(arguments),n=t.shift();return function(){return i.apply(n,t.concat(Array.prototype.slice.call(arguments)))}});l.a.f=new function(){var e=0,u="__ko__"+(new Date).getTime(),f={};return{get:function(n,t){var u=l.a.f.getAll(n,i);return u===r?r:u[t]},set:function(t,u,f){f===r&&l.a.f.getAll(t,i)===r||(l.a.f.getAll(t,n)[u]=f)},getAll:function(n,t){var i=n[u];if(!i||!("null"!==i&&f[i])){if(!t)return r;i=n[u]="ko"+e++;f[i]={}}return f[i]},clear:function(r){var e=r[u];return e?(delete f[e],r[u]=t,n):i}}};l.b("utils.domData",l.a.f);l.b("utils.domData.clear",l.a.f.clear);l.a.F=new function(){function t(n,t){var i=l.a.f.get(n,o);return i===r&&t&&(i=[],l.a.f.set(n,o,i)),i}function e(n){var r=t(n,i),u;if(r)for(r=r.slice(0),u=0;u<r.length;u++)r[u](n);if(l.a.f.clear(n),"function"==typeof f&&"function"==typeof f.cleanData&&f.cleanData([n]),s[n.nodeType])for(r=n.firstChild;n=r;)r=n.nextSibling,8===n.nodeType&&e(n)}var o="__ko_domNodeDisposal__"+(new Date).getTime(),h={1:n,8:n,9:n},s={1:n,9:n};return{Ba:function(i,r){"function"!=typeof r&&u(Error("Callback must be a function"));t(i,n).push(r)},Wa:function(n,u){var f=t(n,i);f&&(l.a.ga(f,u),0==f.length&&l.a.f.set(n,o,r))},A:function(n){var t,i,r;if(h[n.nodeType]&&(e(n),s[n.nodeType]))for(t=[],l.a.P(t,n.getElementsByTagName("*")),i=0,r=t.length;i<r;i++)e(t[i]);return n},removeNode:function(n){l.A(n);n.parentNode&&n.parentNode.removeChild(n)}}};l.A=l.a.F.A;l.removeNode=l.a.F.removeNode;l.b("cleanNode",l.A);l.b("removeNode",l.removeNode);l.b("utils.domNodeDisposal",l.a.F);l.b("utils.domNodeDisposal.addDisposeCallback",l.a.F.Ba);l.b("utils.domNodeDisposal.removeDisposeCallback",l.a.F.Wa);l.a.sa=function(n){var t,i;if("undefined"!=typeof f){if((t=f.clean([n]))&&t[0]){for(n=t[0];n.parentNode&&11!==n.parentNode.nodeType;)n=n.parentNode;n.parentNode&&n.parentNode.removeChild(n)}}else{for(i=l.a.D(n).toLowerCase(),t=e.createElement("div"),i=i.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","<\/table>"]||!i.indexOf("<tr")&&[2,"<table><tbody>","<\/tbody><\/table>"]||(!i.indexOf("<td")||!i.indexOf("<th"))&&[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"]||[0,"",""],n="ignored<div>"+i[1]+n+i[2]+"<\/div>","function"==typeof o.innerShiv?t.appendChild(o.innerShiv(n)):t.innerHTML=n;i[0]--;)t=t.lastChild;t=l.a.L(t.lastChild.childNodes)}return t};l.a.ca=function(n,i){if(l.a.ka(n),i=l.a.d(i),i!==t&&i!==r)if("string"!=typeof i&&(i=i.toString()),"undefined"!=typeof f)f(n).html(i);else for(var e=l.a.sa(i),u=0;u<e.length;u++)n.appendChild(e[u])};l.b("utils.parseHtmlFragment",l.a.sa);l.b("utils.setHtml",l.a.ca);w={};l.s={qa:function(n){"function"!=typeof n&&u(Error("You can only pass a function to ko.memoization.memoize()"));var t=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return w[t]=n,"<!--[ko_memo:"+t+"]-->"},gb:function(i,f){var e=w[i];e===r&&u(Error("Couldn't find any memo with ID "+i+". Perhaps it's already been unmemoized."));try{return e.apply(t,f||[]),n}finally{delete w[i]}},hb:function(n,t){var u=[],r,e,i,f;for(pt(n,u),r=0,e=u.length;r<e;r++)i=u[r].rb,f=[i],t&&l.a.P(f,t),l.s.gb(u[r].Eb,f),i.nodeValue="",i.parentNode&&i.parentNode.removeChild(i)},Ta:function(n){return(n=n.match(/^\[ko_memo\:(.*?)\]$/))?n[1]:t}};l.b("memoization",l.s);l.b("memoization.memoize",l.s.qa);l.b("memoization.unmemoize",l.s.gb);l.b("memoization.parseMemoText",l.s.Ta);l.b("memoization.unmemoizeDomNodeAndDescendants",l.s.hb);l.La={throttle:function(n,i){n.throttleEvaluation=i;var r=t;return l.j({read:n,write:function(t){clearTimeout(r);r=setTimeout(function(){n(t)},i)}})},notify:function(n,t){return n.equalityComparer="always"==t?s(i):l.m.fn.equalityComparer,n}};l.b("extenders",l.La);l.eb=function(n,t,i){this.target=n;this.ha=t;this.qb=i;l.p(this,"dispose",this.B)};l.eb.prototype.B=function(){this.Bb=n;this.qb()};l.S=function(){this.w={};l.a.extend(this,l.S.fn);l.p(this,"subscribe",this.xa);l.p(this,"extend",this.extend);l.p(this,"getSubscriptionsCount",this.xb)};l.S.fn={xa:function(n,t,i){var i=i||"change",n=t?n.bind(t):n,r=new l.eb(this,n,function(){l.a.ga(this.w[i],r)}.bind(this));return this.w[i]||(this.w[i]=[]),this.w[i].push(r),r},notifySubscribers:function(t,i){i=i||"change";this.w[i]&&l.r.K(function(){l.a.o(this.w[i].slice(0),function(i){i&&i.Bb!==n&&i.ha(t)})},this)},xb:function(){var t=0,n;for(n in this.w)this.w.hasOwnProperty(n)&&(t+=this.w[n].length);return t},extend:function(n){var t=this,i,r;if(n)for(i in n)r=l.La[i],"function"==typeof r&&(t=r(t,n[i]));return t}};l.Pa=function(n){return"function"==typeof n.xa&&"function"==typeof n.notifySubscribers};l.b("subscribable",l.S);l.b("isSubscribable",l.Pa);v=[];l.r={lb:function(n){v.push({ha:n,Ka:[]})},end:function(){v.pop()},Va:function(n){if(l.Pa(n)||u(Error("Only subscribable things can act as dependencies")),0<v.length){var t=v[v.length-1];!t||0<=l.a.i(t.Ka,n)||(t.Ka.push(n),t.ha(n))}},K:function(n,i,r){try{return v.push(t),n.apply(i,r||[])}finally{v.pop()}}};bt={undefined:n,boolean:n,number:n,string:n};l.m=function(n){function t(){return 0<arguments.length?(t.equalityComparer&&t.equalityComparer(i,arguments[0])||(t.H(),i=arguments[0],t.G()),this):(l.r.Va(t),i)}var i=n;return l.S.call(t),t.t=function(){return i},t.G=function(){t.notifySubscribers(i)},t.H=function(){t.notifySubscribers(i,"beforeChange")},l.a.extend(t,l.m.fn),l.p(t,"peek",t.t),l.p(t,"valueHasMutated",t.G),l.p(t,"valueWillMutate",t.H),t};l.m.fn={equalityComparer:function(n,r){return n===t||typeof n in bt?n===r:i}};y=l.m.Jb="__ko_proto__";l.m.fn[y]=l.m;l.la=function(u,f){return u===t||u===r||u[y]===r?i:u[y]===f?n:l.la(u[y],f)};l.$=function(n){return l.la(n,l.m)};l.Qa=function(t){return"function"==typeof t&&t[y]===l.m||"function"==typeof t&&t[y]===l.j&&t.yb?n:i};l.b("observable",l.m);l.b("isObservable",l.$);l.b("isWriteableObservable",l.Qa);l.R=function(n){0==arguments.length&&(n=[]);n===t||n===r||"length"in n||u(Error("The argument passed when initializing an observable array must be an array, or null, or undefined."));var i=l.m(n);return l.a.extend(i,l.R.fn),i};l.R.fn={remove:function(n){for(var u,r=this.t(),i=[],f="function"==typeof n?n:function(t){return t===n},t=0;t<r.length;t++)u=r[t],f(u)&&(0===i.length&&this.H(),i.push(u),r.splice(t,1),t--);return i.length&&this.G(),i},removeAll:function(n){if(n===r){var t=this.t(),i=t.slice(0);return this.H(),t.splice(0,t.length),this.G(),i}return n?this.remove(function(t){return 0<=l.a.i(n,t)}):[]},destroy:function(t){var r=this.t(),u="function"==typeof t?t:function(n){return n===t},i;for(this.H(),i=r.length-1;0<=i;i--)u(r[i])&&(r[i]._destroy=n);this.G()},destroyAll:function(t){return t===r?this.destroy(s(n)):t?this.destroy(function(n){return 0<=l.a.i(t,n)}):[]},indexOf:function(n){var t=this();return l.a.i(t,n)},replace:function(n,t){var i=this.indexOf(n);0<=i&&(this.H(),this.t()[i]=t,this.G())}};l.a.o("pop push reverse shift sort splice unshift".split(" "),function(n){l.R.fn[n]=function(){var t=this.t();return this.H(),t=t[n].apply(t,arguments),this.G(),t}});l.a.o(["slice"],function(n){l.R.fn[n]=function(){var t=this();return t[n].apply(t,arguments)}});l.b("observableArray",l.R);l.j=function(f,e,o){function g(){l.a.o(a,function(n){n.B()});a=[]}function ut(){var n=h.throttleEvaluation;n&&0<=n?(clearTimeout(it),it=setTimeout(v,n)):v()}function v(){var t,f,u;if(!d)if(p&&k())w();else{d=n;try{for(t=l.a.V(a,function(n){return n.target}),l.r.lb(function(n){var i;0<=(i=l.a.i(t,n))?t[i]=r:a.push(n.xa(ut))}),f=c.call(e),u=t.length-1;0<=u;u--)t[u]&&a.splice(u,1)[0].B();p=n;h.notifySubscribers(y,"beforeChange");y=f}finally{l.r.end()}h.notifySubscribers(y);d=i;a.length||w()}}function h(){return 0<arguments.length?("function"==typeof tt?tt.apply(e,arguments):u(Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.")),this):(p||v(),l.r.Va(h),y)}function nt(){return!p||0<a.length}var y,p=i,d=i,c=f,rt,k;c&&"object"==typeof c?(o=c,c=o.read):(o=o||{},c||(c=o.read));"function"!=typeof c&&u(Error("Pass a function that returns the value of the ko.computed"));var tt=o.write,b=o.disposeWhenNodeIsRemoved||o.W||t,k=o.disposeWhen||o.Ja||s(i),w=g,a=[],it=t;return e||(e=o.owner),h.t=function(){return p||v(),y},h.wb=function(){return a.length},h.yb="function"==typeof o.write,h.B=function(){w()},h.oa=nt,l.S.call(h),l.a.extend(h,l.j.fn),l.p(h,"peek",h.t),l.p(h,"dispose",h.B),l.p(h,"isActive",h.oa),l.p(h,"getDependenciesCount",h.wb),o.deferEvaluation!==n&&v(),b&&nt()&&(w=function(){l.a.F.Wa(b,arguments.callee);g()},l.a.F.Ba(b,w),rt=k,k=function(){return!l.a.X(b)||rt()}),h};l.Ab=function(n){return l.la(n,l.j)};h=l.m.Jb;l.j[h]=l.m;l.j.fn={};l.j.fn[h]=l.j;l.b("dependentObservable",l.j);l.b("computed",l.j);l.b("isComputed",l.Ab);l.fb=function(n){return 0==arguments.length&&u(Error("When calling ko.toJS, pass the object you want to convert.")),yt(n,function(n){for(var t=0;l.$(n)&&10>t;t++)n=n();return n})};l.toJSON=function(n,t,i){return n=l.fb(n),l.a.wa(n,t,i)};l.b("toJS",l.fb);l.b("toJSON",l.toJSON);l.k={q:function(t){switch(l.a.u(t)){case"option":return t.__ko__hasDomDataOptionValue__===n?l.a.f.get(t,l.c.options.ra):7>=l.a.Z?t.getAttributeNode("value").specified?t.value:t.text:t.value;case"select":return 0<=t.selectedIndex?l.k.q(t.options[t.selectedIndex]):r;default:return t.value}},T:function(i,u){switch(l.a.u(i)){case"option":switch(typeof u){case"string":l.a.f.set(i,l.c.options.ra,r);"__ko__hasDomDataOptionValue__"in i&&delete i.__ko__hasDomDataOptionValue__;i.value=u;break;default:l.a.f.set(i,l.c.options.ra,u);i.__ko__hasDomDataOptionValue__=n;i.value="number"==typeof u?u:""}break;case"select":for(var f=i.options.length-1;0<=f;f--)if(l.k.q(i.options[f])==u){i.selectedIndex=f;break}break;default:(u===t||u===r)&&(u="");i.value=u}}};l.b("selectExtensions",l.k);l.b("selectExtensions.readValue",l.k.q);l.b("selectExtensions.writeValue",l.k.T);var ti=/\@ko_token_(\d+)\@/g,ii=["true","false"],ri=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i;l.g={Q:[],aa:function(n){var i=l.a.D(n),u;if(3>i.length)return[];"{"===i.charAt(0)&&(i=i.substring(1,i.length-1));for(var n=[],f=t,e,r=0;r<i.length;r++)if(u=i.charAt(r),f===t)switch(u){case'"':case"'":case"/":f=r;e=u}else if(u==e&&"\\"!==i.charAt(r-1)){u=i.substring(f,r+1);n.push(u);var h="@ko_token_"+(n.length-1)+"@",i=i.substring(0,f)+h+i.substring(r+1),r=r-(u.length-h.length),f=t}e=f=t;for(var o=0,s=t,r=0;r<i.length;r++){if(u=i.charAt(r),f===t)switch(u){case"{":f=r;s=u;e="}";break;case"(":f=r;s=u;e=")";break;case"[":f=r;s=u;e="]"}u===s?o++:u===e&&(o--,0===o&&(u=i.substring(f,r+1),n.push(u),h="@ko_token_"+(n.length-1)+"@",i=i.substring(0,f)+h+i.substring(r+1),r-=u.length-h.length,f=t))}for(e=[],i=i.split(","),f=0,r=i.length;f<r;f++)o=i[f],s=o.indexOf(":"),0<s&&s<o.length-1?(u=o.substring(s+1),e.push({key:g(o.substring(0,s),n),value:g(u,n)})):e.push({unknown:g(o,n)});return e},ba:function(n){for(var o,u,e="string"==typeof n?l.g.aa(n):n,f=[],n=[],r,s=0;r=e[s];s++)if(0<f.length&&f.push(","),r.key){n:{o=r.key;u=l.a.D(o);switch(u.length&&u.charAt(0)){case"'":case'"':break n;default:o="'"+u+"'"}}r=r.value;f.push(o);f.push(":");f.push(r);r=l.a.D(r);0<=l.a.i(ii,l.a.D(r).toLowerCase())?r=i:(u=r.match(ri),r=u===t?i:u[1]?"Object("+u[1]+")"+u[2]:r);r&&(0<n.length&&n.push(", "),n.push(o+" : function(__ko_value) { "+r+" = __ko_value; }"))}else r.unknown&&f.push(r.unknown);return e=f.join(""),0<n.length&&(e=e+", '_ko_property_writers' : { "+n.join("")+" } "),e},Db:function(t,r){for(var u=0;u<t.length;u++)if(l.a.D(t[u].key)==r)return n;return i},ea:function(n,t,i,r,u){n&&l.Qa(n)?u&&n.t()===r||n(r):(n=t()._ko_property_writers)&&n[i]&&n[i](r)}};l.b("expressionRewriting",l.g);l.b("expressionRewriting.bindingRewriteValidators",l.g.Q);l.b("expressionRewriting.parseObjectLiteral",l.g.aa);l.b("expressionRewriting.preProcessBindings",l.g.ba);l.b("jsonExpressionRewriting",l.g);l.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",l.g.ba);var b="<!--test-->"===e.createComment("test").text,ui=b?/^<\!--\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*--\>$/:/^\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*$/,fi=b?/^<\!--\s*\/ko\s*--\>$/:/^\s*\/ko\s*$/,ei={ul:n,ol:n};l.e={I:{},childNodes:function(n){return a(n)?vt(n):n.childNodes},Y:function(n){if(a(n))for(var n=l.e.childNodes(n),t=0,i=n.length;t<i;t++)l.removeNode(n[t]);else l.a.ka(n)},N:function(n,t){if(a(n)){l.e.Y(n);for(var r=n.nextSibling,i=0,u=t.length;i<u;i++)r.parentNode.insertBefore(t[i],r)}else l.a.N(n,t)},Ua:function(n,t){a(n)?n.parentNode.insertBefore(t,n.nextSibling):n.firstChild?n.insertBefore(t,n.firstChild):n.appendChild(t)},Oa:function(n,t,i){i?a(n)?n.parentNode.insertBefore(t,i.nextSibling):i.nextSibling?n.insertBefore(t,i.nextSibling):n.appendChild(t):l.e.Ua(n,t)},firstChild:function(n){return a(n)?!n.nextSibling||p(n.nextSibling)?t:n.nextSibling:n.firstChild},nextSibling:function(n){return a(n)&&(n=at(n)),n.nextSibling&&p(n.nextSibling)?t:n.nextSibling},ib:function(n){return(n=a(n))?n[1]:t},Sa:function(i){var e,r,u,f;if(ei[l.a.u(i)]&&(e=i.firstChild,e))do if(1===e.nodeType){if(r=e.firstChild,u=t,r)do u?u.push(r):a(r)?(f=at(r,n),f?r=f:u=[r]):p(r)&&(u=[r]);while(r=r.nextSibling);if(r=u)for(u=e.nextSibling,f=0;f<r.length;f++)u?i.insertBefore(r[f],u):i.appendChild(r[f])}while(e=e.nextSibling)}};l.b("virtualElements",l.e);l.b("virtualElements.allowedBindings",l.e.I);l.b("virtualElements.emptyNode",l.e.Y);l.b("virtualElements.insertAfter",l.e.Oa);l.b("virtualElements.prepend",l.e.Ua);l.b("virtualElements.setDomNodeChildren",l.e.N);l.J=function(){this.Ga={}};l.a.extend(l.J.prototype,{nodeHasBindings:function(n){switch(n.nodeType){case 1:return n.getAttribute("data-bind")!=t;case 8:return l.e.ib(n)!=t;default:return i}},getBindings:function(n,i){var r=this.getBindingsString(n,i);return r?this.parseBindingsString(r,i,n):t},getBindingsString:function(n){switch(n.nodeType){case 1:return n.getAttribute("data-bind");case 8:return l.e.ib(n);default:return t}},parseBindingsString:function(n,t,i){var r,f,e;try{return(r=this.Ga[n])||(f=this.Ga,e="with($context){with($data||{}){return{"+l.g.ba(n)+"}}}",r=f[n]=new Function("$context","$element",e)),r(t,i)}catch(o){u(Error("Unable to parse bindings.\nMessage: "+o+";\nBindings value: "+n))}}});l.J.instance=new l.J;l.b("bindingProvider",l.J);l.c={};l.z=function(n,t,i){t?(l.a.extend(this,t),this.$parentContext=t,this.$parent=t.$data,this.$parents=(t.$parents||[]).slice(0),this.$parents.unshift(this.$parent)):(this.$parents=[],this.$root=n,this.ko=l);this.$data=n;i&&(this[i]=n)};l.z.prototype.createChildContext=function(n,t){return new l.z(n,this,t)};l.z.prototype.extend=function(n){var t=l.a.extend(new l.z,this);return l.a.extend(t,n)};l.cb=function(n,t){if(2==arguments.length)l.a.f.set(n,"__ko_bindingContext__",t);else return l.a.f.get(n,"__ko_bindingContext__")};l.Ea=function(t,i,r){return 1===t.nodeType&&l.e.Sa(t),ht(t,i,r,n)};l.Da=function(t,i){(1===i.nodeType||8===i.nodeType)&&lt(t,i,n)};l.Ca=function(t,i){i&&1!==i.nodeType&&8!==i.nodeType&&u(Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node"));i=i||o.document.body;ct(t,i,n)};l.ja=function(n){switch(n.nodeType){case 1:case 8:var t=l.cb(n);if(t)return t;if(n.parentNode)return l.ja(n.parentNode)}return r};l.ob=function(n){return(n=l.ja(n))?n.$data:r};l.b("bindingHandlers",l.c);l.b("applyBindings",l.Ca);l.b("applyBindingsToDescendants",l.Da);l.b("applyBindingsToNode",l.Ea);l.b("contextFor",l.ja);l.b("dataFor",l.ob);tt={"class":"className","for":"htmlFor"};l.c.attr={update:function(n,u){var s=l.a.d(u())||{},f,e,o;for(f in s)"string"==typeof f&&(e=l.a.d(s[f]),o=e===i||e===t||e===r,o&&n.removeAttribute(f),8>=l.a.Z&&f in tt?(f=tt[f],o?n.removeAttribute(f):n[f]=e):o||n.setAttribute(f,e.toString()),"name"===f&&l.a.$a(n,o?"":e.toString()))}};l.c.checked={init:function(t,i,r){l.a.n(t,"click",function(){var u,f,e;if("checkbox"==t.type)u=t.checked;else if("radio"==t.type&&t.checked)u=t.value;else return;f=i();e=l.a.d(f);"checkbox"==t.type&&e instanceof Array?(u=l.a.i(e,t.value),t.checked&&0>u?f.push(t.value):!t.checked&&0<=u&&f.splice(u,1)):l.g.ea(f,r,"checked",u,n)});"radio"!=t.type||t.name||l.c.uniqueName.init(t,s(n))},update:function(n,t){var i=l.a.d(t());"checkbox"==n.type?n.checked=i instanceof Array?0<=l.a.i(i,n.value):i:"radio"==n.type&&(n.checked=n.value==i)}};l.c.css={update:function(t,r){var u=l.a.d(r()),f,e;if("object"==typeof u)for(f in u)e=l.a.d(u[f]),l.a.da(t,f,e);else u=String(u||""),l.a.da(t,t.__ko__cssValue,i),t.__ko__cssValue=u,l.a.da(t,u,n)}};l.c.enable={update:function(t,i){var r=l.a.d(i());r&&t.disabled?t.removeAttribute("disabled"):!r&&!t.disabled&&(t.disabled=n)}};l.c.disable={update:function(n,t){l.c.enable.update(n,function(){return!l.a.d(t())})}};l.c.event={init:function(t,r,u,f){var o=r()||{},e;for(e in o)(function(){var o=e;"string"==typeof o&&l.a.n(t,o,function(t){var s,h=r()[o],c,e;if(h){c=u();try{e=l.a.L(arguments);e.unshift(f);s=h.apply(f,e)}finally{s!==n&&(t.preventDefault?t.preventDefault():t.returnValue=i)}c[o+"Bubble"]===i&&(t.cancelBubble=n,t.stopPropagation&&t.stopPropagation())}})})()}};l.c.foreach={Ra:function(n){return function(){var i=n(),t=l.a.ta(i);return!t||"number"==typeof t.length?{foreach:i,templateEngine:l.C.na}:(l.a.d(i),{foreach:t.data,as:t.as,includeDestroyed:t.includeDestroyed,afterAdd:t.afterAdd,beforeRemove:t.beforeRemove,afterRender:t.afterRender,beforeMove:t.beforeMove,afterMove:t.afterMove,templateEngine:l.C.na})}},init:function(n,t){return l.c.template.init(n,l.c.foreach.Ra(t))},update:function(n,t,i,r,u){return l.c.template.update(n,l.c.foreach.Ra(t),i,r,u)}};l.g.Q.foreach=i;l.e.I.foreach=n;l.c.hasfocus={init:function(r,u,f){function e(t){r.__ko_hasfocusUpdating=n;var e=r.ownerDocument;"activeElement"in e&&(t=e.activeElement===r);e=u();l.g.ea(e,f,"hasfocus",t,n);r.__ko_hasfocusUpdating=i}var o=e.bind(t,n),s=e.bind(t,i);l.a.n(r,"focus",o);l.a.n(r,"focusin",o);l.a.n(r,"blur",s);l.a.n(r,"focusout",s)},update:function(n,i){var r=l.a.d(i());n.__ko_hasfocusUpdating||(r?n.focus():n.blur(),l.r.K(l.a.Aa,t,[n,r?"focusin":"focusout"]))}};l.c.html={init:function(){return{controlsDescendantBindings:n}},update:function(n,t){l.a.ca(n,t())}};it="__ko_withIfBindingData";nt("if");nt("ifnot",i,n);nt("with",n,i,function(n,t){return n.createChildContext(t)});l.c.options={update:function(t,i,f){var f,c,s,i,a,h;"select"!==l.a.u(t)&&u(Error("options binding applies only to SELECT elements"));for(var p=0==t.length,w=l.a.V(l.a.fa(t.childNodes,function(n){return n.tagName&&"option"===l.a.u(n)&&n.selected}),function(n){return l.k.q(n)||n.innerText||n.textContent}),b=t.scrollTop,o=l.a.d(i());0<t.length;)l.A(t.options[0]),t.remove(0);if(o){for(f=f(),c=f.optionsIncludeDestroyed,"number"!=typeof o.length&&(o=[o]),f.optionsCaption&&(s=e.createElement("option"),l.a.ca(s,f.optionsCaption),l.k.T(s,r),t.appendChild(s)),i=0,a=o.length;i<a;i++)if(h=o[i],!h||!h._destroy||c){var s=e.createElement("option"),v=function(n,t,i){var r=typeof t;return"function"==r?t(n):"string"==r?n[t]:i},y=v(h,f.optionsValue,h);l.k.T(s,l.a.d(y));h=v(h,f.optionsText,y);l.a.bb(s,h);t.appendChild(s)}for(o=t.getElementsByTagName("option"),i=c=0,a=o.length;i<a;i++)0<=l.a.i(w,l.k.q(o[i]))&&(l.a.ab(o[i],n),c++);t.scrollTop=b;p&&"value"in f&&wt(t,l.a.ta(f.value),n);l.a.tb(t)}}};l.c.options.ra="__ko.optionValueDomData__";l.c.selectedOptions={init:function(n,t,i){l.a.n(n,"change",function(){var u=t(),r=[];l.a.o(n.getElementsByTagName("option"),function(n){n.selected&&r.push(l.k.q(n))});l.g.ea(u,i,"value",r)})},update:function(n,t){"select"!=l.a.u(n)&&u(Error("values binding applies only to SELECT elements"));var i=l.a.d(t());i&&"number"==typeof i.length&&l.a.o(n.getElementsByTagName("option"),function(n){var t=0<=l.a.i(i,l.k.q(n));l.a.ab(n,t)})}};l.c.style={update:function(n,t){var r=l.a.d(t()||{}),i,u;for(i in r)"string"==typeof i&&(u=l.a.d(r[i]),n.style[i]=u||"")}};l.c.submit={init:function(t,r,f,e){"function"!=typeof r()&&u(Error("The value for a submit binding must be a function"));l.a.n(t,"submit",function(u){var f,o=r();try{f=o.call(e,t)}finally{f!==n&&(u.preventDefault?u.preventDefault():u.returnValue=i)}})}};l.c.text={update:function(n,t){l.a.bb(n,t())}};l.e.I.text=n;l.c.uniqueName={init:function(n,t){if(t()){var i="ko_unique_"+ ++l.c.uniqueName.nb;l.a.$a(n,i)}}};l.c.uniqueName.nb=0;l.c.value={init:function(t,r,u){function o(){s=i;var n=r(),f=l.k.q(t);l.g.ea(n,u,"value",f)}var f=["change"],e=u().valueUpdate,s=i;e&&("string"==typeof e&&(e=[e]),l.a.P(f,e),f=l.a.Fa(f));l.a.Z&&"input"==t.tagName.toLowerCase()&&"text"==t.type&&"off"!=t.autocomplete&&(!t.form||"off"!=t.form.autocomplete)&&-1==l.a.i(f,"propertychange")&&(l.a.n(t,"propertychange",function(){s=n}),l.a.n(t,"blur",function(){s&&o()}));l.a.o(f,function(n){var i=o;l.a.Nb(n,"after")&&(i=function(){setTimeout(o,0)},n=n.substring(5));l.a.n(t,n,i)})},update:function(t,r){var e="select"===l.a.u(t),f=l.a.d(r()),u=l.k.q(t),o=f!=u;0===f&&0!==u&&"0"!==u&&(o=n);o&&(u=function(){l.k.T(t,f)},u(),e&&setTimeout(u,0));e&&0<t.length&&wt(t,f,i)}};l.c.visible={update:function(n,t){var i=l.a.d(t()),r="none"!=n.style.display;i&&!r?n.style.display="":!i&&r&&(n.style.display="none")}};l.c.click={init:function(n,t,i,r){return l.c.event.init.call(this,n,function(){var n={};return n.click=t(),n},i,r)}};l.v=function(){};l.v.prototype.renderTemplateSource=function(){u(Error("Override renderTemplateSource"))};l.v.prototype.createJavaScriptEvaluatorBlock=function(){u(Error("Override createJavaScriptEvaluatorBlock"))};l.v.prototype.makeTemplateSource=function(n,t){if("string"==typeof n){var t=t||e,i=t.getElementById(n);return i||u(Error("Cannot find template with ID "+n)),new l.l.h(i)}if(1==n.nodeType||8==n.nodeType)return new l.l.O(n);u(Error("Unknown template type: "+n))};l.v.prototype.renderTemplate=function(n,t,i,r){return n=this.makeTemplateSource(n,r),this.renderTemplateSource(n,t,i)};l.v.prototype.isTemplateRewritten=function(t,r){return this.allowTemplateRewriting===i?n:this.makeTemplateSource(t,r).data("isRewritten")};l.v.prototype.rewriteTemplate=function(t,i,r){t=this.makeTemplateSource(t,r);i=i(t.text());t.text(i);t.data("isRewritten",n)};l.b("templateEngine",l.v);kt=/(<[a-z]+\d*(\s+(?!data-bind=)[a-z0-9\-]+(=(\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind=(["'])([\s\S]*?)\5/gi;dt=/<\!--\s*ko\b\s*([\s\S]*?)\s*--\>/g;l.ya={ub:function(n,t,i){t.isTemplateRewritten(n,i)||t.rewriteTemplate(n,function(n){return l.ya.Fb(n,t)},i)},Fb:function(n,t){return n.replace(kt,function(n,i,r,u,f,e,o){return st(o,i,t)}).replace(dt,function(n,i){return st(i,"<!-- ko -->",t)})},jb:function(n){return l.s.qa(function(t,i){t.nextSibling&&l.Ea(t.nextSibling,n,i)})}};l.b("__tr_ambtns",l.ya.jb);l.l={};l.l.h=function(n){this.h=n};l.l.h.prototype.text=function(){var n=l.a.u(this.h),n="script"===n?"text":"textarea"===n?"value":"innerHTML",t;if(0==arguments.length)return this.h[n];t=arguments[0];"innerHTML"===n?l.a.ca(this.h,t):this.h[n]=t};l.l.h.prototype.data=function(n){if(1===arguments.length)return l.a.f.get(this.h,"templateSourceData_"+n);l.a.f.set(this.h,"templateSourceData_"+n,arguments[1])};l.l.O=function(n){this.h=n};l.l.O.prototype=new l.l.h;l.l.O.prototype.text=function(){if(0==arguments.length){var n=l.a.f.get(this.h,"__ko_anon_template__")||{};return n.za===r&&n.ia&&(n.za=n.ia.innerHTML),n.za}l.a.f.set(this.h,"__ko_anon_template__",{za:arguments[0]})};l.l.h.prototype.nodes=function(){if(0==arguments.length)return(l.a.f.get(this.h,"__ko_anon_template__")||{}).ia;l.a.f.set(this.h,"__ko_anon_template__",{ia:arguments[0]})};l.b("templateSources",l.l);l.b("templateSources.domElement",l.l.h);l.b("templateSources.anonymousTemplate",l.l.O);l.va=function(n){n==r||n instanceof l.v||u(Error("templateEngine must inherit from ko.templateEngine"));rt=n};l.ua=function(n,i,f,e,o){if(f=f||{},(f.templateEngine||rt)==r&&u(Error("Set a template engine before calling renderTemplate")),o=o||"replaceChildren",e){var s=d(e);return l.j(function(){var t=i&&i instanceof l.z?i:new l.z(l.a.d(i)),r="function"==typeof n?n(t.$data,t):n,t=ft(e,o,r,t,f);"replaceNode"==o&&(e=t,s=d(e))},t,{Ja:function(){return!s||!l.a.X(s)},W:s&&"replaceNode"==o?s.parentNode:s})}return l.s.qa(function(t){l.ua(n,i,f,t,"replaceNode")})};l.Lb=function(n,i,u,f,e){function s(n,t){et(t,o);u.afterRender&&u.afterRender(t,n)}function h(i,r){o=e.createChildContext(l.a.d(i),u.as);o.$index=r;var f="function"==typeof n?n(i,o):n;return ft(t,"ignoreTargetNode",f,o,u)}var o;return l.j(function(){var n=l.a.d(i)||[];"undefined"==typeof n.length&&(n=[n]);n=l.a.fa(n,function(n){return u.includeDestroyed||n===r||n===t||!l.a.d(n._destroy)});l.r.K(l.a.Za,t,[f,n,h,u,s])},t,{W:f})};l.c.template={init:function(t,i){var r=l.a.d(i());return"string"==typeof r||r.name||1!=t.nodeType&&8!=t.nodeType||(r=1==t.nodeType?t.childNodes:l.e.childNodes(t),r=l.a.Gb(r),new l.l.O(t).nodes(r)),{controlsDescendantBindings:n}},update:function(i,u,f,e,o){var u=l.a.d(u()),f={},e=n,s,h=t;"string"!=typeof u&&(f=u,u=f.name,"if"in f&&(e=l.a.d(f["if"])),e&&"ifnot"in f&&(e=!l.a.d(f.ifnot)),s=l.a.d(f.data));"foreach"in f?h=l.Lb(u||i,e&&f.foreach||[],f,i,o):e?(o="data"in f?o.createChildContext(s,f.as):o,h=l.ua(u||i,o,f,i)):l.e.Y(i);o=h;(s=l.a.f.get(i,"__ko__templateComputedDomDataKey__"))&&"function"==typeof s.B&&s.B();l.a.f.set(i,"__ko__templateComputedDomDataKey__",o&&o.oa()?o:r)}};l.g.Q.template=function(n){return n=l.g.aa(n),1==n.length&&n[0].unknown||l.g.Db(n,"name")?t:"This template engine does not support anonymous templates nested within its templates"};l.e.I.template=n;l.b("setTemplateEngine",l.va);l.b("renderTemplate",l.ua);l.a.Ia=function(n,t,i){return n=n||[],t=t||[],n.length<=t.length?ut(n,t,"added","deleted",i):ut(t,n,"deleted","added",i)};l.b("utils.compareArrays",l.a.Ia);l.a.Za=function(t,i,u,f,e){function rt(n,t){o=d[t];nt!==t&&(it[n]=o);o.ma(nt++);k(o.M);g.push(o);p.push(o)}function v(n,t){if(n)for(var i=0,r=t.length;i<r;i++)t[i]&&l.a.o(t[i].M,function(r){n(r,i,t[i].U)})}for(var ut,i=i||[],f=f||{},a=l.a.f.get(t,"setDomNodeChildrenFromArrayMapping_lastMappingResult")===r,d=l.a.f.get(t,"setDomNodeChildrenFromArrayMapping_lastMappingResult")||[],y=l.a.V(d,function(n){return n.U}),h=l.a.Ia(y,i),g=[],c=0,nt=0,tt=[],p=[],i=[],it=[],y=[],o,s=0,w,b;w=h[s];s++)switch(b=w.moved,w.status){case"deleted":b===r&&(o=d[c],o.j&&o.j.B(),tt.push.apply(tt,k(o.M)),f.beforeRemove&&(i[s]=o,p.push(o)));c++;break;case"retained":rt(s,c++);break;case"added":b!==r?rt(s,b):(o={U:w.value,ma:l.m(nt++)},g.push(o),p.push(o),a||(y[s]=o))}for(v(f.beforeMove,it),l.a.o(tt,f.beforeRemove?l.A:l.removeNode),s=0,a=l.e.firstChild(t);o=p[s];s++){for(o.M||l.a.extend(o,gt(t,u,o.U,e,o.ma)),c=0;h=o.M[c];a=h.nextSibling,ut=h,c++)h!==a&&l.e.Oa(t,h,ut);!o.zb&&e&&(e(o.U,o.M,o.ma),o.zb=n)}v(f.beforeRemove,i);v(f.afterMove,it);v(f.afterAdd,y);l.a.f.set(t,"setDomNodeChildrenFromArrayMapping_lastMappingResult",g)};l.b("utils.setDomNodeChildrenFromArrayMapping",l.a.Za);l.C=function(){this.allowTemplateRewriting=i};l.C.prototype=new l.v;l.C.prototype.renderTemplateSource=function(i){var r=!(9>l.a.Z)&&i.nodes?i.nodes():t;return r?l.a.L(r.cloneNode(n).childNodes):(i=i.text(),l.a.sa(i))};l.C.na=new l.C;l.va(l.C.na);l.b("nativeTemplateEngine",l.C);l.pa=function(){var n=this.Cb=function(){if("undefined"==typeof f||!f.tmpl)return 0;try{if(0<=f.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(n){}return 1}();this.renderTemplateSource=function(i,r,o){o=o||{};2>n&&u(Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."));var s=i.data("precompiled");return s||(s=i.text()||"",s=f.template(t,"{{ko_with $item.koBindingContext}}"+s+"{{/ko_with}}"),i.data("precompiled",s)),i=[r.$data],r=f.extend({koBindingContext:r},o.templateOptions),r=f.tmpl(s,i,r),r.appendTo(e.createElement("div")),f.fragments={},r};this.createJavaScriptEvaluatorBlock=function(n){return"{{ko_code ((function() { return "+n+" })()) }}"};this.addTemplate=function(n,t){e.write("<script type='text/html' id='"+n+"'>"+t+"<\/script>")};0<n&&(f.tmpl.tag.ko_code={open:"__.push($1 || '');"},f.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};l.pa.prototype=new l.v;h=new l.pa;0<h.Cb&&l.va(h);l.b("jqueryTmplTemplateEngine",l.pa)}var n=!0,t=null,i=!1,o=window,e=document,c=navigator,f=window.jQuery,r=void 0;"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?h(module.exports||exports):"function"==typeof define&&define.amd?define(["exports"],h):h(o.ko={});n}();Date.CultureInfo={name:"en-IE",englishName:"English (Ireland)",nativeName:"English (Eire)",dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbreviatedDayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],shortestDayNames:["Su","Mo","Tu","We","Th","Fr","Sa"],firstLetterDayNames:["S","M","T","W","T","F","S"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],abbreviatedMonthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],amDesignator:"",pmDesignator:"",firstDayOfWeek:1,twoDigitYearMax:2029,dateElementOrder:"dmy",formatPatterns:{shortDate:"dd/MM/yyyy",longDate:"dd MMMM yyyy",shortTime:"HH:mm",longTime:"HH:mm:ss",fullDateTime:"dd MMMM yyyy HH:mm:ss",sortableDateTime:"yyyy-MM-ddTHH:mm:ss",universalSortableDateTime:"yyyy-MM-dd HH:mm:ssZ",rfc1123:"ddd, dd MMM yyyy HH:mm:ss GMT",monthDay:"dd MMMM",yearMonth:"MMMM yyyy"},regexPatterns:{jan:/^jan(uary)?/i,feb:/^feb(ruary)?/i,mar:/^mar(ch)?/i,apr:/^apr(il)?/i,may:/^may/i,jun:/^jun(e)?/i,jul:/^jul(y)?/i,aug:/^aug(ust)?/i,sep:/^sep(t(ember)?)?/i,oct:/^oct(ober)?/i,nov:/^nov(ember)?/i,dec:/^dec(ember)?/i,sun:/^su(n(day)?)?/i,mon:/^mo(n(day)?)?/i,tue:/^tu(e(s(day)?)?)?/i,wed:/^we(d(nesday)?)?/i,thu:/^th(u(r(s(day)?)?)?)?/i,fri:/^fr(i(day)?)?/i,sat:/^sa(t(urday)?)?/i,future:/^next/i,past:/^last|past|prev(ious)?/i,add:/^(\+|after|from)/i,subtract:/^(\-|before|ago)/i,yesterday:/^yesterday/i,today:/^t(oday)?/i,tomorrow:/^tomorrow/i,now:/^n(ow)?/i,millisecond:/^ms|milli(second)?s?/i,second:/^sec(ond)?s?/i,minute:/^min(ute)?s?/i,hour:/^h(ou)?rs?/i,week:/^w(ee)?k/i,month:/^m(o(nth)?s?)?/i,day:/^d(ays?)?/i,year:/^y((ea)?rs?)?/i,shortMeridian:/^(a|p)/i,longMeridian:/^(a\.?m?\.?|p\.?m?\.?)/i,timezone:/^((e(s|d)t|c(s|d)t|m(s|d)t|p(s|d)t)|((gmt)?\s*(\+|\-)\s*\d\d\d\d?)|gmt)/i,ordinalSuffix:/^\s*(st|nd|rd|th)/i,timeContext:/^\s*(\:|a|p)/i},abbreviatedTimeZoneStandard:{GMT:"-000",EST:"-0400",CST:"-0500",MST:"-0600",PST:"-0700"},abbreviatedTimeZoneDST:{GMT:"-000",EDT:"-0500",CDT:"-0600",MDT:"-0700",PDT:"-0800"}};Date.getMonthNumberFromName=function(n){for(var i=Date.CultureInfo.monthNames,u=Date.CultureInfo.abbreviatedMonthNames,r=n.toLowerCase(),t=0;t<i.length;t++)if(i[t].toLowerCase()==r||u[t].toLowerCase()==r)return t;return-1};Date.getDayNumberFromName=function(n){for(var i=Date.CultureInfo.dayNames,u=Date.CultureInfo.abbreviatedDayNames,f=Date.CultureInfo.shortestDayNames,r=n.toLowerCase(),t=0;t<i.length;t++)if(i[t].toLowerCase()==r||u[t].toLowerCase()==r)return t;return-1};Date.isLeapYear=function(n){return n%4==0&&n%100!=0||n%400==0};Date.getDaysInMonth=function(n,t){return[31,Date.isLeapYear(n)?29:28,31,30,31,30,31,31,30,31,30,31][t]};Date.getTimezoneOffset=function(n,t){return t||!1?Date.CultureInfo.abbreviatedTimeZoneDST[n.toUpperCase()]:Date.CultureInfo.abbreviatedTimeZoneStandard[n.toUpperCase()]};Date.getTimezoneAbbreviation=function(n,t){var r=t||!1?Date.CultureInfo.abbreviatedTimeZoneDST:Date.CultureInfo.abbreviatedTimeZoneStandard,i;for(i in r)if(r[i]===n)return i;return null};Date.prototype.clone=function(){return new Date(this.getTime())};Date.prototype.compareTo=function(n){if(isNaN(this))throw new Error(this);if(n instanceof Date&&!isNaN(n))return this>n?1:this<n?-1:0;throw new TypeError(n);};Date.prototype.equals=function(n){return this.compareTo(n)===0};Date.prototype.between=function(n,t){var i=this.getTime();return i>=n.getTime()&&i<=t.getTime()};Date.prototype.addMilliseconds=function(n){return this.setMilliseconds(this.getMilliseconds()+n),this};Date.prototype.addSeconds=function(n){return this.addMilliseconds(n*1e3)};Date.prototype.addMinutes=function(n){return this.addMilliseconds(n*6e4)};Date.prototype.addHours=function(n){return this.addMilliseconds(n*36e5)};Date.prototype.addDays=function(n){return this.addMilliseconds(n*864e5)};Date.prototype.addWeeks=function(n){return this.addMilliseconds(n*6048e5)};Date.prototype.addMonths=function(n){var t=this.getDate();return this.setDate(1),this.setMonth(this.getMonth()+n),this.setDate(Math.min(t,this.getDaysInMonth())),this};Date.prototype.addYears=function(n){return this.addMonths(n*12)};Date.prototype.add=function(n){if(typeof n=="number")return this._orient=n,this;var t=n;return(t.millisecond||t.milliseconds)&&this.addMilliseconds(t.millisecond||t.milliseconds),(t.second||t.seconds)&&this.addSeconds(t.second||t.seconds),(t.minute||t.minutes)&&this.addMinutes(t.minute||t.minutes),(t.hour||t.hours)&&this.addHours(t.hour||t.hours),(t.month||t.months)&&this.addMonths(t.month||t.months),(t.year||t.years)&&this.addYears(t.year||t.years),(t.day||t.days)&&this.addDays(t.day||t.days),this};Date._validate=function(n,t,i,r){if(typeof n!="number")throw new TypeError(n+" is not a Number.");else if(n<t||n>i)throw new RangeError(n+" is not a valid value for "+r+".");return!0};Date.validateMillisecond=function(n){return Date._validate(n,0,999,"milliseconds")};Date.validateSecond=function(n){return Date._validate(n,0,59,"seconds")};Date.validateMinute=function(n){return Date._validate(n,0,59,"minutes")};Date.validateHour=function(n){return Date._validate(n,0,23,"hours")};Date.validateDay=function(n,t,i){return Date._validate(n,1,Date.getDaysInMonth(t,i),"days")};Date.validateMonth=function(n){return Date._validate(n,0,11,"months")};Date.validateYear=function(n){return Date._validate(n,1,9999,"seconds")};Date.prototype.set=function(n){var t=n;return t.millisecond||t.millisecond===0||(t.millisecond=-1),t.second||t.second===0||(t.second=-1),t.minute||t.minute===0||(t.minute=-1),t.hour||t.hour===0||(t.hour=-1),t.day||t.day===0||(t.day=-1),t.month||t.month===0||(t.month=-1),t.year||t.year===0||(t.year=-1),t.millisecond!=-1&&Date.validateMillisecond(t.millisecond)&&this.addMilliseconds(t.millisecond-this.getMilliseconds()),t.second!=-1&&Date.validateSecond(t.second)&&this.addSeconds(t.second-this.getSeconds()),t.minute!=-1&&Date.validateMinute(t.minute)&&this.addMinutes(t.minute-this.getMinutes()),t.hour!=-1&&Date.validateHour(t.hour)&&this.addHours(t.hour-this.getHours()),t.month!==-1&&Date.validateMonth(t.month)&&this.addMonths(t.month-this.getMonth()),t.year!=-1&&Date.validateYear(t.year)&&this.addYears(t.year-this.getFullYear()),t.day!=-1&&Date.validateDay(t.day,this.getFullYear(),this.getMonth())&&this.addDays(t.day-this.getDate()),t.timezone&&this.setTimezone(t.timezone),t.timezoneOffset&&this.setTimezoneOffset(t.timezoneOffset),this};Date.prototype.clearTime=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this};Date.prototype.isLeapYear=function(){var n=this.getFullYear();return n%4==0&&n%100!=0||n%400==0};Date.prototype.isWeekday=function(){return!(this.is().sat()||this.is().sun())};Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())};Date.prototype.moveToFirstDayOfMonth=function(){return this.set({day:1})};Date.prototype.moveToLastDayOfMonth=function(){return this.set({day:this.getDaysInMonth()})};Date.prototype.moveToDayOfWeek=function(n,t){var i=(n-this.getDay()+7*(t||1))%7;return this.addDays(i===0?i+=7*(t||1):i)};Date.prototype.moveToMonth=function(n,t){var i=(n-this.getMonth()+12*(t||1))%12;return this.addMonths(i===0?i+=12*(t||1):i)};Date.prototype.getDayOfYear=function(){return Math.floor((this-new Date(this.getFullYear(),0,1))/864e5)};Date.prototype.getWeekOfYear=function(n){var t=this.getFullYear(),e=this.getMonth(),o=this.getDate(),s=n||Date.CultureInfo.firstDayOfWeek,r=8-new Date(t,0,1).getDay(),f,i,u;return r==8&&(r=1),f=(Date.UTC(t,e,o,0,0,0)-Date.UTC(t,0,1,0,0,0))/864e5+1,i=Math.floor((f-r+7)/7),i===s&&(t--,u=8-new Date(t,0,1).getDay(),i=u==2||u==8?53:52),i};Date.prototype.isDST=function(){return console.log("isDST"),this.toString().match(/(E|C|M|P)(S|D)T/)[2]=="D"};Date.prototype.getTimezone=function(){return Date.getTimezoneAbbreviation(this.getUTCOffset,this.isDST())};Date.prototype.setTimezoneOffset=function(n){var t=this.getTimezoneOffset(),i=Number(n)*-6/10;return this.addMinutes(i-t),this};Date.prototype.setTimezone=function(n){return this.setTimezoneOffset(Date.getTimezoneOffset(n))};Date.prototype.getUTCOffset=function(){var t=this.getTimezoneOffset()*-10/6,n;return t<0?(n=(t-1e4).toString(),n[0]+n.substr(2)):(n=(t+1e4).toString(),"+"+n.substr(1))};Date.prototype.getDayName=function(n){return n?Date.CultureInfo.abbreviatedDayNames[this.getDay()]:Date.CultureInfo.dayNames[this.getDay()]};Date.prototype.getMonthName=function(n){return n?Date.CultureInfo.abbreviatedMonthNames[this.getMonth()]:Date.CultureInfo.monthNames[this.getMonth()]};Date.prototype._toString=Date.prototype.toString;Date.prototype.toString=function(n){var t=this,i=function(n){return n.toString().length==1?"0"+n:n};return n?n.replace(/dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?/g,function(n){switch(n){case"hh":return i(t.getHours()<13?t.getHours():t.getHours()-12);case"h":return t.getHours()<13?t.getHours():t.getHours()-12;case"HH":return i(t.getHours());case"H":return t.getHours();case"mm":return i(t.getMinutes());case"m":return t.getMinutes();case"ss":return i(t.getSeconds());case"s":return t.getSeconds();case"yyyy":return t.getFullYear();case"yy":return t.getFullYear().toString().substring(2,4);case"dddd":return t.getDayName();case"ddd":return t.getDayName(!0);case"dd":return i(t.getDate());case"d":return t.getDate().toString();case"MMMM":return t.getMonthName();case"MMM":return t.getMonthName(!0);case"MM":return i(t.getMonth()+1);case"M":return t.getMonth()+1;case"t":return t.getHours()<12?Date.CultureInfo.amDesignator.substring(0,1):Date.CultureInfo.pmDesignator.substring(0,1);case"tt":return t.getHours()<12?Date.CultureInfo.amDesignator:Date.CultureInfo.pmDesignator;case"zzz":case"zz":case"z":return""}}):this._toString()};Date.now=function(){return new Date};Date.today=function(){return Date.now().clearTime()};Date.prototype._orient=1;Date.prototype.next=function(){return this._orient=1,this};Date.prototype.last=Date.prototype.prev=Date.prototype.previous=function(){return this._orient=-1,this};Date.prototype._is=!1;Date.prototype.is=function(){return this._is=!0,this};Number.prototype._dateElement="day";Number.prototype.fromNow=function(){var n={};return n[this._dateElement]=this,Date.now().add(n)};Number.prototype.ago=function(){var n={};return n[this._dateElement]=this*-1,Date.now().add(n)},function(){for(var n=Date.prototype,s=Number.prototype,f="sunday monday tuesday wednesday thursday friday saturday".split(/\s/),e="january february march april may june july august september october november december".split(/\s/),o="Millisecond Second Minute Hour Day Week Month Year".split(/\s/),t,a=function(n){return function(){return this._is?(this._is=!1,this.getDay()==n):this.moveToDayOfWeek(n,this._orient)}},h,r,c,l,u,i=0;i<f.length;i++)n[f[i]]=n[f[i].substring(0,3)]=a(i);for(h=function(n){return function(){return this._is?(this._is=!1,this.getMonth()===n):this.moveToMonth(n,this._orient)}},r=0;r<e.length;r++)n[e[r]]=n[e[r].substring(0,3)]=h(r);for(c=function(n){return function(){return n.substring(n.length-1)!="s"&&(n+="s"),this["add"+n](this._orient)}},l=function(n){return function(){return this._dateElement=n,this}},u=0;u<o.length;u++)t=o[u].toLowerCase(),n[t]=n[t+"s"]=c(o[u]),s[t]=s[t+"s"]=l(t)}();Date.prototype.toJSONString=function(){return this.toString("yyyy-MM-ddThh:mm:ssZ")};Date.prototype.toShortDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortDatePattern)};Date.prototype.toLongDateString=function(){return this.toString(Date.CultureInfo.formatPatterns.longDatePattern)};Date.prototype.toShortTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.shortTimePattern)};Date.prototype.toLongTimeString=function(){return this.toString(Date.CultureInfo.formatPatterns.longTimePattern)};Date.prototype.getOrdinal=function(){switch(this.getDate()){case 1:case 21:case 31:return"st";case 2:case 22:return"nd";case 3:case 23:return"rd";default:return"th"}},function(){var i,o,f,u;Date.Parsing={Exception:function(n){this.message="Parse error at '"+n.substring(0,10)+" ...'"}};var t=Date.Parsing,n=t.Operators={rtoken:function(n){return function(i){var r=i.match(n);if(r)return[r[0],i.substring(r[0].length)];throw new t.Exception(i);}},token:function(){return function(t){return n.rtoken(new RegExp("^s*"+t+"s*"))(t)}},stoken:function(t){return n.rtoken(new RegExp("^"+t))},until:function(n){return function(t){for(var r=[],i=null;t.length;){try{i=n.call(this,t)}catch(u){r.push(i[0]);t=i[1];continue}break}return[r,t]}},many:function(n){return function(t){for(var i=[],r=null;t.length;){try{r=n.call(this,t)}catch(u){return[i,t]}i.push(r[0]);t=r[1]}return[i,t]}},optional:function(n){return function(t){var i=null;try{i=n.call(this,t)}catch(r){return[null,t]}return[i[0],i[1]]}},not:function(n){return function(i){try{n.call(this,i)}catch(r){return[null,i]}throw new t.Exception(i);}},ignore:function(n){return n?function(t){var i=null;return i=n.call(this,t),[null,i[1]]}:null},product:function(){for(var i=arguments[0],u=Array.prototype.slice.call(arguments,1),r=[],t=0;t<i.length;t++)r.push(n.each(i[t],u));return r},cache:function(n){var r={},i=null;return function(u){try{i=r[u]=r[u]||n.call(this,u)}catch(f){i=r[u]=f}if(i instanceof t.Exception)throw i;else return i}},any:function(){var n=arguments;return function(i){for(var u=null,r=0;r<n.length;r++)if(n[r]!=null){try{u=n[r].call(this,i)}catch(f){u=null}if(u)return u}throw new t.Exception(i);}},each:function(){var n=arguments;return function(i){for(var f=[],u=null,r=0;r<n.length;r++)if(n[r]!=null){try{u=n[r].call(this,i)}catch(e){throw new t.Exception(i);}f.push(u[0]);i=u[1]}return[f,i]}},all:function(){var t=arguments,n=n;return n.each(n.optional(t))},sequence:function(i,r,u){return(r=r||n.rtoken(/^\s*/),u=u||null,i.length==1)?i[0]:function(n){for(var f=null,e=null,s=[],o=0;o<i.length;o++){try{f=i[o].call(this,n)}catch(h){break}s.push(f[0]);try{e=r.call(this,f[1])}catch(c){e=null;break}n=e[1]}if(!f)throw new t.Exception(n);if(e)throw new t.Exception(e[1]);if(u)try{f=u.call(this,f[1])}catch(l){throw new t.Exception(f[1]);}return[s,f?f[1]:n]}},between:function(t,i,u){u=u||t;var f=n.each(n.ignore(t),i,n.ignore(u));return function(n){var t=f.call(this,n);return[[t[0][0],r[0][2]],t[1]]}},list:function(t,i,r){return i=i||n.rtoken(/^\s*/),r=r||null,t instanceof Array?n.each(n.product(t.slice(0,-1),n.ignore(i)),t.slice(-1),n.ignore(r)):n.each(n.many(n.each(t,n.ignore(i))),px,n.ignore(r))},set:function(i,r,u){return r=r||n.rtoken(/^\s*/),u=u||null,function(f){for(var s=null,l=null,h=null,c=null,e=[[],f],o=!1,y,v,a=0;a<i.length;a++){h=null;l=null;s=null;o=i.length==1;try{s=i[a].call(this,f)}catch(p){continue}if(c=[[s[0]],s[1]],s[1].length>0&&!o)try{h=r.call(this,s[1])}catch(w){o=!0}else o=!0;if(o||h[1].length!==0||(o=!0),!o){for(y=[],v=0;v<i.length;v++)a!=v&&y.push(i[v]);l=n.set(y,r).call(this,h[1]);l[0].length>0&&(c[0]=c[0].concat(l[0]),c[1]=l[1])}if(c[1].length<e[1].length&&(e=c),e[1].length===0)break}if(e[0].length===0)return e;if(u){try{h=u.call(this,e[1])}catch(b){throw new t.Exception(e[1]);}e[1]=h[1]}return e}},forward:function(n,t){return function(i){return n[t].call(this,i)}},replace:function(n,t){return function(i){var r=n.call(this,i);return[t,r[1]]}},process:function(n,t){return function(i){var r=n.call(this,i);return[t.call(this,r[0]),r[1]]}},min:function(n,i){return function(r){var u=i.call(this,r);if(u[0].length<n)throw new t.Exception(r);return u}}},s=function(n){return function(){var t=null,u=[],i,r;if(arguments.length>1?t=Array.prototype.slice.call(arguments):arguments[0]instanceof Array&&(t=arguments[0]),t)for(i=0,r=t.shift();i<r.length;i++)return t.unshift(r[i]),u.push(n.apply(null,t)),t.shift(),u;else return n.apply(null,arguments)}},e="optional not ignore cache".split(/\s/);for(i=0;i<e.length;i++)n[e[i]]=s(n[e[i]]);for(o=function(n){return function(){return arguments[0]instanceof Array?n.apply(null,arguments[0]):n.apply(null,arguments)}},f="each any all".split(/\s/),u=0;u<f.length;u++)n[f[u]]=o(n[f[u]])}(),function(){var o=function(n){for(var i=[],t=0;t<n.length;t++)n[t]instanceof Array?i=i.concat(o(n[t])):n[t]&&i.push(n[t]);return i},u,f,e;Date.Grammar={};Date.Translator={hour:function(n){return function(){this.hour=Number(n)}},minute:function(n){return function(){this.minute=Number(n)}},second:function(n){return function(){this.second=Number(n)}},meridian:function(n){return function(){this.meridian=n.slice(0,1).toLowerCase()}},timezone:function(n){return function(){var t=n.replace(/[^\d\+\-]/g,"");t.length?this.timezoneOffset=Number(t):this.timezone=n.toLowerCase()}},day:function(n){var t=n[0];return function(){this.day=Number(t.match(/\d+/)[0])}},month:function(n){return function(){this.month=n.length==3?Date.getMonthNumberFromName(n):Number(n)-1}},year:function(n){return function(){var t=Number(n);this.year=n.length>2?t:t+(t+2e3<Date.CultureInfo.twoDigitYearMax?2e3:1900)}},rday:function(n){return function(){switch(n){case"yesterday":this.days=-1;break;case"tomorrow":this.days=1;break;case"today":this.days=0;break;case"now":this.days=0;this.now=!0}}},finishExact:function(n){var r,t,i;for(n=n instanceof Array?n:[n],r=new Date,this.year=r.getFullYear(),this.month=r.getMonth(),this.day=1,this.hour=0,this.minute=0,this.second=0,t=0;t<n.length;t++)n[t]&&n[t].call(this);if(this.hour=this.meridian=="p"&&this.hour<13?this.hour+12:this.hour,this.day>Date.getDaysInMonth(this.year,this.month))throw new RangeError(this.day+" is not a valid value for days.");return i=new Date(this.year,this.month,this.day,this.hour,this.minute,this.second),this.timezone?i.set({timezone:this.timezone}):this.timezoneOffset&&i.set({timezoneOffset:this.timezoneOffset}),i},finish:function(n){var f,r,t,u;if(n=n instanceof Array?o(n):[n],n.length===0)return null;for(f=0;f<n.length;f++)typeof n[f]=="function"&&n[f].call(this);if(this.now)return new Date;var i=Date.today(),e=!!(this.days!=null||this.orient||this.operator);return e?(u=this.orient=="past"||this.operator=="subtract"?-1:1,this.weekday&&(this.unit="day",r=Date.getDayNumberFromName(this.weekday)-i.getDay(),t=7,this.days=r?(r+u*t)%t:u*t),this.month&&(this.unit="month",r=this.month-i.getMonth(),t=12,this.months=r?(r+u*t)%t:u*t,this.month=null),this.unit||(this.unit="day"),(this[this.unit+"s"]==null||this.operator!=null)&&(this.value||(this.value=1),this.unit=="week"&&(this.unit="day",this.value=this.value*7),this[this.unit+"s"]=this.value*u),i.add(this)):(this.meridian&&this.hour&&(this.hour=this.hour<13&&this.meridian=="p"?this.hour+12:this.hour),this.weekday&&!this.day&&(this.day=i.addDays(Date.getDayNumberFromName(this.weekday)-i.getDay()).getDate()),this.month&&!this.day&&(this.day=1),i.set(this))}};var t=Date.Parsing.Operators,n=Date.Grammar,i=Date.Translator,r;n.datePartDelimiter=t.rtoken(/^([\s\-\.\,\/\x27]+)/);n.timePartDelimiter=t.stoken(":");n.whiteSpace=t.rtoken(/^\s*/);n.generalDelimiter=t.rtoken(/^(([\s\,]|at|on)+)/);u={};n.ctoken=function(n){var r=u[n],i;if(!r){var o=Date.CultureInfo.regexPatterns,f=n.split(/\s+/),e=[];for(i=0;i<f.length;i++)e.push(t.replace(t.rtoken(o[f[i]]),f[i]));r=u[n]=t.any.apply(null,e)}return r};n.ctoken2=function(n){return t.rtoken(Date.CultureInfo.regexPatterns[n])};n.h=t.cache(t.process(t.rtoken(/^(0[0-9]|1[0-2]|[1-9])/),i.hour));n.hh=t.cache(t.process(t.rtoken(/^(0[0-9]|1[0-2])/),i.hour));n.H=t.cache(t.process(t.rtoken(/^([0-1][0-9]|2[0-3]|[0-9])/),i.hour));n.HH=t.cache(t.process(t.rtoken(/^([0-1][0-9]|2[0-3])/),i.hour));n.m=t.cache(t.process(t.rtoken(/^([0-5][0-9]|[0-9])/),i.minute));n.mm=t.cache(t.process(t.rtoken(/^[0-5][0-9]/),i.minute));n.s=t.cache(t.process(t.rtoken(/^([0-5][0-9]|[0-9])/),i.second));n.ss=t.cache(t.process(t.rtoken(/^[0-5][0-9]/),i.second));n.hms=t.cache(t.sequence([n.H,n.mm,n.ss],n.timePartDelimiter));n.t=t.cache(t.process(n.ctoken2("shortMeridian"),i.meridian));n.tt=t.cache(t.process(n.ctoken2("longMeridian"),i.meridian));n.z=t.cache(t.process(t.rtoken(/^(\+|\-)?\s*\d\d\d\d?/),i.timezone));n.zz=t.cache(t.process(t.rtoken(/^(\+|\-)\s*\d\d\d\d/),i.timezone));n.zzz=t.cache(t.process(n.ctoken2("timezone"),i.timezone));n.timeSuffix=t.each(t.ignore(n.whiteSpace),t.set([n.tt,n.zzz]));n.time=t.each(t.optional(t.ignore(t.stoken("T"))),n.hms,n.timeSuffix);n.d=t.cache(t.process(t.each(t.rtoken(/^([0-2]\d|3[0-1]|\d)/),t.optional(n.ctoken2("ordinalSuffix"))),i.day));n.dd=t.cache(t.process(t.each(t.rtoken(/^([0-2]\d|3[0-1])/),t.optional(n.ctoken2("ordinalSuffix"))),i.day));n.ddd=n.dddd=t.cache(t.process(n.ctoken("sun mon tue wed thu fri sat"),function(n){return function(){this.weekday=n}}));n.M=t.cache(t.process(t.rtoken(/^(1[0-2]|0\d|\d)/),i.month));n.MM=t.cache(t.process(t.rtoken(/^(1[0-2]|0\d)/),i.month));n.MMM=n.MMMM=t.cache(t.process(n.ctoken("jan feb mar apr may jun jul aug sep oct nov dec"),i.month));n.y=t.cache(t.process(t.rtoken(/^(\d\d?)/),i.year));n.yy=t.cache(t.process(t.rtoken(/^(\d\d)/),i.year));n.yyy=t.cache(t.process(t.rtoken(/^(\d\d?\d?\d?)/),i.year));n.yyyy=t.cache(t.process(t.rtoken(/^(\d\d\d\d)/),i.year));r=function(){return t.each(t.any.apply(null,arguments),t.not(n.ctoken2("timeContext")))};n.day=r(n.d,n.dd);n.month=r(n.M,n.MMM);n.year=r(n.yyyy,n.yy);n.orientation=t.process(n.ctoken("past future"),function(n){return function(){this.orient=n}});n.operator=t.process(n.ctoken("add subtract"),function(n){return function(){this.operator=n}});n.rday=t.process(n.ctoken("yesterday tomorrow today now"),i.rday);n.unit=t.process(n.ctoken("minute hour day week month year"),function(n){return function(){this.unit=n}});n.value=t.process(t.rtoken(/^\d\d?(st|nd|rd|th)?/),function(n){return function(){this.value=n.replace(/\D/g,"")}});n.expression=t.set([n.rday,n.operator,n.value,n.unit,n.orientation,n.ddd,n.MMM]);r=function(){return t.set(arguments,n.datePartDelimiter)};n.mdy=r(n.ddd,n.month,n.day,n.year);n.ymd=r(n.ddd,n.year,n.month,n.day);n.dmy=r(n.ddd,n.day,n.month,n.year);n.date=function(t){return(n[Date.CultureInfo.dateElementOrder]||n.mdy).call(this,t)};n.format=t.process(t.many(t.any(t.process(t.rtoken(/^(dd?d?d?|MM?M?M?|yy?y?y?|hh?|HH?|mm?|ss?|tt?|zz?z?)/),function(t){if(n[t])return n[t];throw Date.Parsing.Exception(t);}),t.process(t.rtoken(/^[^dMyhHmstz]+/),function(n){return t.ignore(t.stoken(n))}))),function(n){return t.process(t.each.apply(null,n),i.finishExact)});f={};e=function(t){return f[t]=f[t]||n.format(t)[0]};n.formats=function(n){var r,i;if(n instanceof Array){for(r=[],i=0;i<n.length;i++)r.push(e(n[i]));return t.any.apply(null,r)}return e(n)};n._formats=n.formats(["yyyy-MM-ddTHH:mm:ss","ddd, MMM dd, yyyy H:mm:ss tt","ddd MMM d yyyy HH:mm:ss zzz","d"]);n._start=t.process(t.set([n.date,n.time,n.expression],n.generalDelimiter,n.whiteSpace),i.finish);n.start=function(t){try{var i=n._formats.call({},t);if(i[1].length===0)return i}catch(r){}return n._start.call({},t)}}();Date._parse=Date.parse;Date.parse=function(n){var t=null;if(!n)return null;try{t=Date.Grammar.start.call({},n)}catch(i){return null}return t[1].length===0?t[0]:null};Date.getParseFunction=function(n){var t=Date.Grammar.formats(n);return function(n){var i=null;try{i=t.call({},n)}catch(r){return null}return i[1].length===0?i[0]:null}};Date.parseExact=function(n,t){return Date.getParseFunction(t)(n)}