function TestFinances(n){var t=this,i=n.finances,r=n.roles,f=i.isPaid,e=i.hostPaidAirfare,o=i.hostPaidHousing,s=i.hostPaidMisc,h=i.sprFeesAreWaived,u;t.financeType=i.financeType;t.testId=ko.observable();t.memberId=ko.observable();t.airfare=ko.observable();t.housing=ko.observable();t.numberOfMiles=ko.observable();t.perDiem=ko.observable();t.misc=ko.observable();t.totalFeesCollected=ko.observable();t.totalSptFees=ko.observable();t.totalSprFees=ko.observable();t.totalExpenses=ko.observable();t.totalAdjudicatorFees=ko.observable();t.balanceAfterExpenses=ko.observable();t.adjudicatorMinimum=ko.observable();t.totalDueToAdjudicator=ko.observable();t.totalDueToSafd=ko.observable();t.testIsPaid=ko.observable(f);t.hostPaidAirfare=ko.observable(e);t.hostPaidHousing=ko.observable(o);t.hostPaidMisc=ko.observable(s);t.sprFeesAreWaived=ko.observable(h);t.paidByCheck=ko.observable(i.paidByCheck);u=!1;t.testIsPaid()?u=!0:t.paidByCheck()&&(u=!0);t.isReadOnly=ko.observable(u);t.canEditHost=ko.computed(function(){return r.Admin=!1,r.CertifiedTeacher=!0,t.isReadOnly()&&(r.Admin||r.CertifiedTeacher||r.Staff||r.Adjudicator)},t);t.testIsPaid.subscribe(function(n){t.paidByCheck()||t.isReadOnly(n)});t.paidByCheck.subscribe(function(n){t.testIsPaid()||t.isReadOnly(n)});t.calculating=ko.observable(!1);ko.computed(function(){if(!isNaN(t.testId())){var n={TestId:t.testId(),Airfare:t.airfare(),Housing:t.housing(),NumberOfMiles:t.numberOfMiles(),PerDiem:t.perDiem(),Misc:t.misc(),TestIsPaid:t.testIsPaid(),HostPaidAirfare:t.hostPaidAirfare(),HostPaidHousing:t.hostPaidHousing(),HostPaidMisc:t.hostPaidMisc(),SprFeesAreWaived:t.sprFeesAreWaived()};t.calculating(!0);$.post("/Test/CalculateFinances",n).success(function(n){t.financeType=="SprOnly"||(t.financeType=="SptOnly"?(t.totalAdjudicatorFees(accounting.formatMoney(n.TotalAdjudicatorFees)),t.totalExpenses(accounting.formatMoney(n.TotalAdjudicatorExpenses)),t.balanceAfterExpenses(accounting.formatMoney(n.BalanceAfterFeesAndExpenses)),t.adjudicatorMinimum(accounting.formatMoney(n.AdjudicatorMinimum))):t.financeType=="SptAndSpr"&&(t.totalAdjudicatorFees(accounting.formatMoney(n.TotalAdjudicatorFees)),t.totalSptFees(accounting.formatMoney(n.SptFeesCollected)),t.totalSprFees(accounting.formatMoney(n.SprFeesCollected)),t.totalExpenses(accounting.formatMoney(n.TotalAdjudicatorExpenses)),t.balanceAfterExpenses(accounting.formatMoney(n.BalanceAfterFeesAndExpenses)),t.adjudicatorMinimum(accounting.formatMoney(n.AdjudicatorMinimum))));t.totalFeesCollected(accounting.formatMoney(n.TotalFeesCollected));t.totalDueToAdjudicator(accounting.toFixed(n.TotalDueToAdjudicator,2));t.totalDueToSafd(accounting.toFixed(n.TotalDueToSafd,2))}).error(function(){}).complete(function(){t.calculating(!1)})}}).extend({throttle:1});t.save=function(){}}(function(){function n(n){return function(){return n}}(function(t){var u=this||eval("this"),r=u.document,e=u.navigator,i=u.jQuery,f=u.JSON;(function(n){"function"==typeof require&&"object"==typeof exports&&"object"==typeof module?n(module.exports||exports):"function"==typeof define&&define.amd?define(["exports"],n):n(u.ko={})})(function(o){function c(n,t,i,r){s.d[n]={init:function(n){return s.a.f.set(n,a,{}),{controlsDescendantBindings:!0}},update:function(n,u,f,e,o){f=s.a.f.get(n,a);u=s.a.c(u());e=!i!=!u;var h=!f.fb;(h||t||e!==f.vb)&&(h&&(f.fb=s.a.Oa(s.e.childNodes(n),!0)),e?(h||s.e.P(n,s.a.Oa(f.fb)),s.Ja(r?r(o,u):o,n)):s.e.ba(n),f.vb=e)}};s.g.S[n]=!1;s.e.L[n]=!0}function v(n,t,i){i&&t!==s.h.n(n)&&s.h.W(n,t);t!==s.h.n(n)&&s.q.I(s.a.Ga,null,[n,"change"])}var s="undefined"!=typeof o?o:{},y,h,l,a;s.b=function(n,t){for(var i=n.split("."),r=s,u=0;u<i.length-1;u++)r=r[i[u]];r[i[i.length-1]]=t};s.r=function(n,t,i){n[t]=i};s.version="2.3.0";s.b("version",s.version);s.a=function(){function o(n,t){for(var i in n)n.hasOwnProperty(i)&&t(i,n[i])}function h(n,t){if("input"!==s.a.u(n)||!n.type||"click"!=t.toLowerCase())return!1;var i=n.type;return"checkbox"==i||"radio"==i}var c={},l={},a,n;return c[e&&/Firefox\/2/i.test(e.userAgent)?"KeyboardEvent":"UIEvents"]=["keyup","keydown","keypress"],c.MouseEvents="click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "),o(c,function(n,t){if(t.length)for(var i=0,r=t.length;i<r;i++)l[t[i]]=n}),a={propertychange:!0},n=r&&function(){for(var n=3,i=r.createElement("div"),u=i.getElementsByTagName("i");i.innerHTML="<!--[if gt IE "+ ++n+"]><i><\/i><![endif]-->",u[0];);return 4<n?n:t}(),{Ta:["authenticity_token",/^__RequestVerificationToken(_.*)?$/],p:function(n,t){for(var i=0,r=n.length;i<r;i++)t(n[i])},k: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},La:function(n,t,i){for(var r=0,u=n.length;r<u;r++)if(t.call(i,n[r]))return n[r];return null},ka:function(n,t){var i=s.a.k(n,t);0<=i&&n.splice(i,1)},Ma:function(n){n=n||[];for(var i=[],t=0,r=n.length;t<r;t++)0>s.a.k(i,n[t])&&i.push(n[t]);return i},Z:function(n,t){n=n||[];for(var r=[],i=0,u=n.length;i<u;i++)r.push(t(n[i]));return r},Y:function(n,t){n=n||[];for(var r=[],i=0,u=n.length;i<u;i++)t(n[i])&&r.push(n[i]);return r},R: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},ja:function(n,t,i){var r=n.indexOf?n.indexOf(t):s.a.k(n,t);0>r?i&&n.push(t):i||n.splice(r,1)},extend:function(n,t){if(t)for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);return n},w:o,oa:function(n){for(;n.firstChild;)s.removeNode(n.firstChild)},Mb:function(n){n=s.a.N(n);for(var i=r.createElement("div"),t=0,u=n.length;t<u;t++)i.appendChild(s.H(n[t]));return i},Oa:function(n,t){for(var r,i=0,f=n.length,u=[];i<f;i++)r=n[i].cloneNode(!0),u.push(t?s.H(r):r);return u},P:function(n,t){if(s.a.oa(n),t)for(var i=0,r=t.length;i<r;i++)n.appendChild(t[i])},eb: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++)s.removeNode(r[i])}},hb:function(t,i){7>n?t.setAttribute("selected",i):t.selected=i},F:function(n){return null===n||n===t?"":n.trim?n.trim():n.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")},Wb:function(n,t){for(var r,u=[],f=(n||"").split(t),i=0,e=f.length;i<e;i++)r=s.a.F(f[i]),""!==r&&u.push(r);return u},Tb:function(n,t){return n=n||"",t.length>n.length?!1:n.substring(0,t.length)===t},yb:function(n,t){if(t.compareDocumentPosition)return 16==(t.compareDocumentPosition(n)&16);for(;null!=n;){if(n==t)return!0;n=n.parentNode}return!1},aa:function(n){return s.a.yb(n,n.ownerDocument)},pb:function(n){return!!s.a.La(n,s.a.aa)},u:function(n){return n&&n.tagName&&n.tagName.toLowerCase()},o:function(t,r,u){var o=n&&a[r],f,e,c;if(o||"undefined"==typeof i)if(o||"function"!=typeof t.addEventListener)if("undefined"!=typeof t.attachEvent)f=function(n){u.call(t,n)},e="on"+r,t.attachEvent(e,f),s.a.C.ia(t,function(){t.detachEvent(e,f)});else throw Error("Browser doesn't support addEventListener or attachEvent");else t.addEventListener(r,u,!1);else h(t,r)&&(c=u,u=function(n,t){var i=this.checked;t&&(this.checked=!0!==t.sb);c.call(this,n);this.checked=i}),i(t).bind(r,u)},Ga:function(n,t){if(!n||!n.nodeType)throw Error("element must be a DOM node when calling triggerEvent");if("undefined"!=typeof i){var f=[];h(n,t)&&f.push({sb:n.checked});i(n).trigger(t,f)}else if("function"==typeof r.createEvent)if("function"==typeof n.dispatchEvent)f=r.createEvent(l[t]||"HTMLEvents"),f.initEvent(t,!0,!0,u,0,0,0,0,0,!1,!1,!1,!1,0,n),n.dispatchEvent(f);else throw Error("The supplied element doesn't support dispatchEvent");else if("undefined"!=typeof n.fireEvent)h(n,t)&&(n.checked=!0!==n.checked),n.fireEvent("on"+t);else throw Error("Browser doesn't support triggering events");},c:function(n){return s.T(n)?n():n},ya:function(n){return s.T(n)?n.t():n},ga:function(n,t,i){if(t){var r=/\S+/g,u=n.className.match(r)||[];s.a.p(t.match(r),function(n){s.a.ja(u,n,i)});n.className=u.join(" ")}},ib:function(n,i){var u=s.a.c(i),f;(null===u||u===t)&&(u="");f=s.e.firstChild(n);!f||3!=f.nodeType||s.e.nextSibling(f)?s.e.P(n,[r.createTextNode(u)]):f.data=u;s.a.Bb(n)},gb:function(t,i){if(t.name=i,7>=n)try{t.mergeAttributes(r.createElement("<input name='"+t.name+"'/>"),!1)}catch(u){}},Bb:function(t){9<=n&&(t=1==t.nodeType?t:t.parentNode,t.style&&(t.style.zoom=t.style.zoom))},zb:function(t){if(n){var i=t.style.width;t.style.width=0;t.style.width=i}},Qb:function(n,t){n=s.a.c(n);t=s.a.c(t);for(var r=[],i=n;i<=t;i++)r.push(i);return r},N:function(n){for(var i=[],t=0,r=n.length;t<r;t++)i.push(n[t]);return i},Ub:6===n,Vb:7===n,ca:n,Ua:function(n,t){for(var r=s.a.N(n.getElementsByTagName("input")).concat(s.a.N(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},Nb:function(n){return"string"==typeof n&&(n=s.a.F(n))?f&&f.parse?f.parse(n):new Function("return "+n)():null},Ca:function(n,t,i){if(!f||!f.stringify)throw 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");return f.stringify(s.a.c(n),t,i)},Ob:function(n,t,i){var c,e,h,f,u,l;i=i||{};var a=i.params||{},v=i.includeFields||this.Ta,c=n;if("object"==typeof n&&"form"===s.a.u(n))for(c=n.action,e=v.length-1;0<=e;e--)for(h=s.a.Ua(n,v[e]),f=h.length-1;0<=f;f--)a[h[f].name]=h[f].value;t=s.a.c(t);u=r.createElement("form");u.style.display="none";u.action=c;u.method="post";for(l in t)n=r.createElement("input"),n.name=l,n.value=s.a.Ca(s.a.c(t[l])),u.appendChild(n);o(a,function(n,t){var i=r.createElement("input");i.name=n;i.value=t;u.appendChild(i)});r.body.appendChild(u);i.submitter?i.submitter(u):u.submit();setTimeout(function(){u.parentNode.removeChild(u)},0)}}}();s.b("utils",s.a);s.b("utils.arrayForEach",s.a.p);s.b("utils.arrayFirst",s.a.La);s.b("utils.arrayFilter",s.a.Y);s.b("utils.arrayGetDistinctValues",s.a.Ma);s.b("utils.arrayIndexOf",s.a.k);s.b("utils.arrayMap",s.a.Z);s.b("utils.arrayPushAll",s.a.R);s.b("utils.arrayRemoveItem",s.a.ka);s.b("utils.extend",s.a.extend);s.b("utils.fieldsIncludedWithJsonPost",s.a.Ta);s.b("utils.getFormFields",s.a.Ua);s.b("utils.peekObservable",s.a.ya);s.b("utils.postJson",s.a.Ob);s.b("utils.parseJson",s.a.Nb);s.b("utils.registerEventHandler",s.a.o);s.b("utils.stringifyJson",s.a.Ca);s.b("utils.range",s.a.Qb);s.b("utils.toggleDomNodeCssClass",s.a.ga);s.b("utils.triggerEvent",s.a.Ga);s.b("utils.unwrapObservable",s.a.c);s.b("utils.objectForEach",s.a.w);s.b("utils.addOrRemoveItem",s.a.ja);s.b("unwrap",s.a.c);Function.prototype.bind||(Function.prototype.bind=function(n){var i=this,t=Array.prototype.slice.call(arguments);return n=t.shift(),function(){return i.apply(n,t.concat(Array.prototype.slice.call(arguments)))}});s.a.f=new function(){var r=0,n="__ko__"+(new Date).getTime(),i={};return{get:function(n,i){var r=s.a.f.pa(n,!1);return r===t?t:r[i]},set:function(n,i,r){(r!==t||s.a.f.pa(n,!1)!==t)&&(s.a.f.pa(n,!0)[i]=r)},pa:function(u,f){var e=u[n];if(!e||"null"===e||!i[e]){if(!f)return t;e=u[n]="ko"+r++;i[e]={}}return i[e]},clear:function(t){var r=t[n];return r?(delete i[r],t[n]=null,!0):!1}}};s.b("utils.domData",s.a.f);s.b("utils.domData.clear",s.a.f.clear);s.a.C=new function(){function n(n,i){var r=s.a.f.get(n,u);return r===t&&i&&(r=[],s.a.f.set(n,u,r)),r}function r(t){var u=n(t,!1),e;if(u)for(u=u.slice(0),e=0;e<u.length;e++)u[e](t);if(s.a.f.clear(t),"function"==typeof i&&"function"==typeof i.cleanData&&i.cleanData([t]),f[t.nodeType])for(u=t.firstChild;t=u;)u=t.nextSibling,8===t.nodeType&&r(t)}var u="__ko_domNodeDisposal__"+(new Date).getTime(),e={1:!0,8:!0,9:!0},f={1:!0,9:!0};return{ia:function(t,i){if("function"!=typeof i)throw Error("Callback must be a function");n(t,!0).push(i)},cb:function(i,r){var f=n(i,!1);f&&(s.a.ka(f,r),0==f.length&&s.a.f.set(i,u,t))},H:function(n){var t,i,u;if(e[n.nodeType]&&(r(n),f[n.nodeType]))for(t=[],s.a.R(t,n.getElementsByTagName("*")),i=0,u=t.length;i<u;i++)r(t[i]);return n},removeNode:function(n){s.H(n);n.parentNode&&n.parentNode.removeChild(n)}}};s.H=s.a.C.H;s.removeNode=s.a.C.removeNode;s.b("cleanNode",s.H);s.b("removeNode",s.removeNode);s.b("utils.domNodeDisposal",s.a.C);s.b("utils.domNodeDisposal.addDisposeCallback",s.a.C.ia);s.b("utils.domNodeDisposal.removeDisposeCallback",s.a.C.cb),function(){s.a.xa=function(n){var t,f;if("undefined"!=typeof i){if(i.parseHTML)t=i.parseHTML(n)||[];else if((t=i.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(f=s.a.F(n).toLowerCase(),t=r.createElement("div"),f=f.match(/^<(thead|tbody|tfoot)/)&&[1,"<table>","<\/table>"]||!f.indexOf("<tr")&&[2,"<table><tbody>","<\/tbody><\/table>"]||(!f.indexOf("<td")||!f.indexOf("<th"))&&[3,"<table><tbody><tr>","<\/tr><\/tbody><\/table>"]||[0,"",""],n="ignored<div>"+f[1]+n+f[2]+"<\/div>","function"==typeof u.innerShiv?t.appendChild(u.innerShiv(n)):t.innerHTML=n;f[0]--;)t=t.lastChild;t=s.a.N(t.lastChild.childNodes)}return t};s.a.fa=function(n,r){if(s.a.oa(n),r=s.a.c(r),null!==r&&r!==t)if("string"!=typeof r&&(r=r.toString()),"undefined"!=typeof i)i(n).html(r);else for(var f=s.a.xa(r),u=0;u<f.length;u++)n.appendChild(f[u])}}();s.b("utils.parseHtmlFragment",s.a.xa);s.b("utils.setHtml",s.a.fa);s.s=function(){function i(n,t){var r;if(n)if(8==n.nodeType)r=s.s.$a(n.nodeValue),null!=r&&t.push({xb:n,Kb:r});else if(1==n.nodeType)for(var r=0,u=n.childNodes,f=u.length;r<f;r++)i(u[r],t)}var n={};return{va:function(t){if("function"!=typeof t)throw Error("You can only pass a function to ko.memoization.memoize()");var i=(4294967296*(1+Math.random())|0).toString(16).substring(1)+(4294967296*(1+Math.random())|0).toString(16).substring(1);return n[i]=t,"<!--[ko_memo:"+i+"]-->"},mb:function(i,r){var u=n[i];if(u===t)throw Error("Couldn't find any memo with ID "+i+". Perhaps it's already been unmemoized.");try{return u.apply(null,r||[]),!0}finally{delete n[i]}},nb:function(n,t){var f=[],u,o,r,e;for(i(n,f),u=0,o=f.length;u<o;u++)r=f[u].xb,e=[r],t&&s.a.R(e,t),s.s.mb(f[u].Kb,e),r.nodeValue="",r.parentNode&&r.parentNode.removeChild(r)},$a:function(n){return(n=n.match(/^\[ko_memo\:(.*?)\]$/))?n[1]:null}}}();s.b("memoization",s.s);s.b("memoization.memoize",s.s.va);s.b("memoization.unmemoize",s.s.mb);s.b("memoization.parseMemoText",s.s.$a);s.b("memoization.unmemoizeDomNodeAndDescendants",s.s.nb);s.Sa={throttle:function(n,t){n.throttleEvaluation=t;var i=null;return s.j({read:n,write:function(r){clearTimeout(i);i=setTimeout(function(){n(r)},t)}})},notify:function(t,i){return t.equalityComparer="always"==i?n(!1):s.m.fn.equalityComparer,t}};s.b("extenders",s.Sa);s.kb=function(n,t,i){this.target=n;this.la=t;this.wb=i;s.r(this,"dispose",this.B)};s.kb.prototype.B=function(){this.Hb=!0;this.wb()};s.V=function(){this.G={};s.a.extend(this,s.V.fn);s.r(this,"subscribe",this.Da);s.r(this,"extend",this.extend);s.r(this,"getSubscriptionsCount",this.Db)};s.V.fn={Da:function(n,t,i){i=i||"change";var r=new s.kb(this,t?n.bind(t):n,function(){s.a.ka(this.G[i],r)}.bind(this));return this.G[i]||(this.G[i]=[]),this.G[i].push(r),r},notifySubscribers:function(n,t){t=t||"change";this.G[t]&&s.q.I(function(){s.a.p(this.G[t].slice(0),function(t){t&&!0!==t.Hb&&t.la(n)})},this)},Db:function(){var n=0;return s.a.w(this.G,function(t,i){n+=i.length}),n},extend:function(n){var t=this;return n&&s.a.w(n,function(n,i){var r=s.Sa[n];"function"==typeof r&&(t=r(t,i))}),t}};s.Wa=function(n){return null!=n&&"function"==typeof n.Da&&"function"==typeof n.notifySubscribers};s.b("subscribable",s.V);s.b("isSubscribable",s.Wa);s.q=function(){var n=[];return{rb:function(t){n.push({la:t,Ra:[]})},end:function(){n.pop()},bb:function(t){if(!s.Wa(t))throw Error("Only subscribable things can act as dependencies");if(0<n.length){var i=n[n.length-1];!i||0<=s.a.k(i.Ra,t)||(i.Ra.push(t),i.la(t))}},I:function(t,i,r){try{return n.push(null),t.apply(i,r||[])}finally{n.pop()}}}}();y={undefined:!0,boolean:!0,number:!0,string:!0};s.m=function(n){function t(){return 0<arguments.length?(t.equalityComparer&&t.equalityComparer(i,arguments[0])||(t.K(),i=arguments[0],t.J()),this):(s.q.bb(t),i)}var i=n;return s.V.call(t),t.t=function(){return i},t.J=function(){t.notifySubscribers(i)},t.K=function(){t.notifySubscribers(i,"beforeChange")},s.a.extend(t,s.m.fn),s.r(t,"peek",t.t),s.r(t,"valueHasMutated",t.J),s.r(t,"valueWillMutate",t.K),t};s.m.fn={equalityComparer:function(n,t){return null===n||typeof n in y?n===t:!1}};h=s.m.Pb="__ko_proto__";s.m.fn[h]=s.m;s.qa=function(n,i){return null===n||n===t||n[h]===t?!1:n[h]===i?!0:s.qa(n[h],i)};s.T=function(n){return s.qa(n,s.m)};s.Xa=function(n){return"function"==typeof n&&n[h]===s.m||"function"==typeof n&&n[h]===s.j&&n.Eb?!0:!1};s.b("observable",s.m);s.b("isObservable",s.T);s.b("isWriteableObservable",s.Xa);s.U=function(n){if(n=n||[],"object"!=typeof n||!("length"in n))throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");return n=s.m(n),s.a.extend(n,s.U.fn),n};s.U.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.K(),i.push(u),r.splice(t,1),t--);return i.length&&this.J(),i},removeAll:function(n){if(n===t){var i=this.t(),r=i.slice(0);return this.K(),i.splice(0,i.length),this.J(),r}return n?this.remove(function(t){return 0<=s.a.k(n,t)}):[]},destroy:function(n){var i=this.t(),r="function"==typeof n?n:function(t){return t===n},t;for(this.K(),t=i.length-1;0<=t;t--)r(i[t])&&(i[t]._destroy=!0);this.J()},destroyAll:function(i){return i===t?this.destroy(n(!0)):i?this.destroy(function(n){return 0<=s.a.k(i,n)}):[]},indexOf:function(n){var t=this();return s.a.k(t,n)},replace:function(n,t){var i=this.indexOf(n);0<=i&&(this.K(),this.t()[i]=t,this.J())}};s.a.p("pop push reverse shift sort splice unshift".split(" "),function(n){s.U.fn[n]=function(){var t=this.t();return this.K(),t=t[n].apply(t,arguments),this.J(),t}});s.a.p(["slice"],function(n){s.U.fn[n]=function(){var t=this();return t[n].apply(t,arguments)}});s.b("observableArray",s.U);s.j=function(i,r,u){function w(){s.a.p(o,function(n){n.B()});o=[]}function nt(){var n=f.throttleEvaluation;n&&0<=n?(clearTimeout(d),d=setTimeout(c,n)):c()}function c(){var n,u,i;if(!p)if(a&&y())h();else{p=!0;try{for(n=s.a.Z(o,function(n){return n.target}),s.q.rb(function(i){var r;0<=(r=s.a.k(n,i))?n[r]=t:o.push(i.Da(nt))}),u=e.call(r),i=n.length-1;0<=i;i--)n[i]&&o.splice(i,1)[0].B();a=!0;f.notifySubscribers(l,"beforeChange");l=u;f.notifySubscribers(l)}finally{s.q.end();p=!1}o.length||h()}}function f(){if(0<arguments.length){if("function"==typeof k)k.apply(r,arguments);else throw 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.");return this}return a||c(),s.q.bb(f),l}function b(){return!a||0<o.length}var l,a=!1,p=!1,e=i,g,y;if(e&&"object"==typeof e?(u=e,e=u.read):(u=u||{},e||(e=u.read)),"function"!=typeof e)throw Error("Pass a function that returns the value of the ko.computed");var k=u.write,v=u.disposeWhenNodeIsRemoved||u.$||null,y=u.disposeWhen||u.Qa||n(!1),h=w,o=[],d=null;return r||(r=u.owner),f.t=function(){return a||c(),l},f.Cb=function(){return o.length},f.Eb="function"==typeof u.write,f.B=function(){h()},f.ta=b,s.V.call(f),s.a.extend(f,s.j.fn),s.r(f,"peek",f.t),s.r(f,"dispose",f.B),s.r(f,"isActive",f.ta),s.r(f,"getDependenciesCount",f.Cb),!0!==u.deferEvaluation&&c(),v&&b()&&(h=function(){s.a.C.cb(v,h);w()},s.a.C.ia(v,h),g=y,y=function(){return!s.a.aa(v)||g()}),f};s.Gb=function(n){return s.qa(n,s.j)};o=s.m.Pb;s.j[o]=s.m;s.j.fn={};s.j.fn[o]=s.j;s.b("dependentObservable",s.j);s.b("computed",s.j);s.b("isComputed",s.Gb),function(){function n(u,f,e){if(e=e||new i,u=f(u),"object"!=typeof u||null===u||u===t||u instanceof Date||u instanceof String||u instanceof Number||u instanceof Boolean)return u;var o=u instanceof Array?[]:{};return e.save(u,o),r(u,function(i){var r=f(u[i]),s;switch(typeof r){case"boolean":case"number":case"string":case"function":o[i]=r;break;case"object":case"undefined":s=e.get(r);o[i]=s!==t?s:n(r,f,e)}}),o}function r(n,t){if(n instanceof Array){for(var i=0;i<n.length;i++)t(i);"function"==typeof n.toJSON&&t("toJSON")}else for(i in n)t(i)}function i(){this.keys=[];this.Ha=[]}s.lb=function(t){if(0==arguments.length)throw Error("When calling ko.toJS, pass the object you want to convert.");return n(t,function(n){for(var t=0;s.T(n)&&10>t;t++)n=n();return n})};s.toJSON=function(n,t,i){return n=s.lb(n),s.a.Ca(n,t,i)};i.prototype={save:function(n,t){var i=s.a.k(this.keys,n);0<=i?this.Ha[i]=t:(this.keys.push(n),this.Ha.push(t))},get:function(n){return n=s.a.k(this.keys,n),0<=n?this.Ha[n]:t}}}();s.b("toJS",s.lb);s.b("toJSON",s.toJSON),function(){s.h={n:function(n){switch(s.a.u(n)){case"option":return!0===n.__ko__hasDomDataOptionValue__?s.a.f.get(n,s.d.options.wa):7>=s.a.ca?n.getAttributeNode("value")&&n.getAttributeNode("value").specified?n.value:n.text:n.value;case"select":return 0<=n.selectedIndex?s.h.n(n.options[n.selectedIndex]):t;default:return n.value}},W:function(n,i){switch(s.a.u(n)){case"option":switch(typeof i){case"string":s.a.f.set(n,s.d.options.wa,t);"__ko__hasDomDataOptionValue__"in n&&delete n.__ko__hasDomDataOptionValue__;n.value=i;break;default:s.a.f.set(n,s.d.options.wa,i);n.__ko__hasDomDataOptionValue__=!0;n.value="number"==typeof i?i:""}break;case"select":""===i&&(i=t);(null===i||i===t)&&(n.selectedIndex=-1);for(var r=n.options.length-1;0<=r;r--)if(s.h.n(n.options[r])==i){n.selectedIndex=r;break}1<n.size||-1!==n.selectedIndex||(n.selectedIndex=0);break;default:(null===i||i===t)&&(i="");n.value=i}}}}();s.b("selectExtensions",s.h);s.b("selectExtensions.readValue",s.h.n);s.b("selectExtensions.writeValue",s.h.W);s.g=function(){function n(n,i){for(var r=null;n!=r;)r=n,n=n.replace(t,function(n,t){return i[t]});return n}var t=/\@ko_token_(\d+)\@/g,i=["true","false","null","undefined"],r=/^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i;return{S:[],da:function(t){var i=s.a.F(t),f,e,r,u;if(3>i.length)return[];for("{"===i.charAt(0)&&(i=i.substring(1,i.length-1)),t=[],f=null,r=0;r<i.length;r++)if(u=i.charAt(r),null===f)switch(u){case'"':case"'":case"/":f=r;e=u}else if(u==e&&"\\"!==i.charAt(r-1)){u=i.substring(f,r+1);t.push(u);var c="@ko_token_"+(t.length-1)+"@",i=i.substring(0,f)+c+i.substring(r+1),r=r-(u.length-c.length),f=null}e=f=null;for(var o=0,h=null,r=0;r<i.length;r++){if(u=i.charAt(r),null===f)switch(u){case"{":f=r;h=u;e="}";break;case"(":f=r;h=u;e=")";break;case"[":f=r;h=u;e="]"}u===h?o++:u===e&&(o--,0===o&&(u=i.substring(f,r+1),t.push(u),c="@ko_token_"+(t.length-1)+"@",i=i.substring(0,f)+c+i.substring(r+1),r-=u.length-c.length,f=null))}for(e=[],i=i.split(","),f=0,r=i.length;f<r;f++)o=i[f],h=o.indexOf(":"),0<h&&h<o.length-1?(u=o.substring(h+1),e.push({key:n(o.substring(0,h),t),value:n(u,t)})):e.push({unknown:n(o,t)});return e},ea:function(n){var e="string"==typeof n?s.g.da(n):n,f=[],t,h,o,u;for(n=[],h=0;t=e[h];h++)if(0<f.length&&f.push(","),t.key){n:{o=t.key;u=s.a.F(o);switch(u.length&&u.charAt(0)){case"'":case'"':break n;default:o="'"+u+"'"}}t=t.value;f.push(o);f.push(":");f.push(t);t=s.a.F(t);0<=s.a.k(i,s.a.F(t).toLowerCase())?t=!1:(u=t.match(r),t=null===u?!1:u[1]?"Object("+u[1]+")"+u[2]:t);t&&(0<n.length&&n.push(", "),n.push(o+" : function(__ko_value) { "+t+" = __ko_value; }"))}else t.unknown&&f.push(t.unknown);return e=f.join(""),0<n.length&&(e=e+", '_ko_property_writers' : { "+n.join("")+" } "),e},Jb:function(n,t){for(var i=0;i<n.length;i++)if(s.a.F(n[i].key)==t)return!0;return!1},ha:function(n,t,i,r,u){n&&s.T(n)?!s.Xa(n)||u&&n.t()===r||n(r):(n=t()._ko_property_writers)&&n[i]&&n[i](r)}}}();s.b("expressionRewriting",s.g);s.b("expressionRewriting.bindingRewriteValidators",s.g.S);s.b("expressionRewriting.parseObjectLiteral",s.g.da);s.b("expressionRewriting.preProcessBindings",s.g.ea);s.b("jsonExpressionRewriting",s.g);s.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson",s.g.ea),function(){function n(n){return 8==n.nodeType&&(i?n.text:n.nodeValue).match(e)}function t(n){return 8==n.nodeType&&(i?n.text:n.nodeValue).match(o)}function u(i,r){for(var u=i,f=1,e=[];u=u.nextSibling;){if(t(u)&&(f--,0===f))return e;e.push(u);n(u)&&f++}if(!r)throw Error("Cannot find closing comment tag to match: "+i.nodeValue);return null}function f(n,t){var i=u(n,t);return i?0<i.length?i[i.length-1].nextSibling:n.nextSibling:null}var i=r&&"<!--test-->"===r.createComment("test").text,e=i?/^\x3c!--\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*--\x3e$/:/^\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*$/,o=i?/^\x3c!--\s*\/ko\s*--\x3e$/:/^\s*\/ko\s*$/,h={ul:!0,ol:!0};s.e={L:{},childNodes:function(t){return n(t)?u(t):t.childNodes},ba:function(t){if(n(t)){t=s.e.childNodes(t);for(var i=0,r=t.length;i<r;i++)s.removeNode(t[i])}else s.a.oa(t)},P:function(t,i){if(n(t)){s.e.ba(t);for(var u=t.nextSibling,r=0,f=i.length;r<f;r++)u.parentNode.insertBefore(i[r],u)}else s.a.P(t,i)},ab:function(t,i){n(t)?t.parentNode.insertBefore(i,t.nextSibling):t.firstChild?t.insertBefore(i,t.firstChild):t.appendChild(i)},Va:function(t,i,r){r?n(t)?t.parentNode.insertBefore(i,r.nextSibling):r.nextSibling?t.insertBefore(i,r.nextSibling):t.appendChild(i):s.e.ab(t,i)},firstChild:function(i){return n(i)?!i.nextSibling||t(i.nextSibling)?null:i.nextSibling:i.firstChild},nextSibling:function(i){return n(i)&&(i=f(i)),i.nextSibling&&t(i.nextSibling)?null:i.nextSibling},ob:function(t){return(t=n(t))?t[1]:null},Za:function(i){var o,r,u,e;if(h[s.a.u(i)]&&(o=i.firstChild,o))do if(1===o.nodeType){if(r=o.firstChild,u=null,r)do u?u.push(r):n(r)?(e=f(r,!0),e?r=e:u=[r]):t(r)&&(u=[r]);while(r=r.nextSibling);if(r=u)for(u=o.nextSibling,e=0;e<r.length;e++)u?i.insertBefore(r[e],u):i.appendChild(r[e])}while(o=o.nextSibling)}}}();s.b("virtualElements",s.e);s.b("virtualElements.allowedBindings",s.e.L);s.b("virtualElements.emptyNode",s.e.ba);s.b("virtualElements.insertAfter",s.e.Va);s.b("virtualElements.prepend",s.e.ab);s.b("virtualElements.setDomNodeChildren",s.e.P),function(){s.M=function(){this.Na={}};s.a.extend(s.M.prototype,{nodeHasBindings:function(n){switch(n.nodeType){case 1:return null!=n.getAttribute("data-bind");case 8:return null!=s.e.ob(n);default:return!1}},getBindings:function(n,t){var i=this.getBindingsString(n,t);return i?this.parseBindingsString(i,t,n):null},getBindingsString:function(n){switch(n.nodeType){case 1:return n.getAttribute("data-bind");case 8:return s.e.ob(n);default:return null}},parseBindingsString:function(n,t,i){var r,f,e,o;try{return(r=this.Na[n])||(f=this.Na,o="with($context){with($data||{}){return{"+s.g.ea(n)+"}}}",e=new Function("$context","$element",o),r=f[n]=e),r(t,i)}catch(u){throw u.message="Unable to parse bindings.\nBindings value: "+n+"\nMessage: "+u.message,u;}}});s.M.instance=new s.M}();s.b("bindingProvider",s.M),function(){function n(n,t,r){for(var u=s.e.firstChild(t);t=u;)u=s.e.nextSibling(t),i(n,t,r)}function i(t,i,u){var e=!0,f=1===i.nodeType;f&&s.e.Za(i);(f&&u||s.M.instance.nodeHasBindings(i))&&(e=r(i,null,t,u).Sb);e&&n(t,i,!f)}function r(n,i,r,u){function c(n){return function(){return e[n]}}function l(){return e}var o=0,e,h,a=s.a.f.get(n,f);if(!i){if(a)throw Error("You cannot apply bindings multiple times to the same element.");s.a.f.set(n,f,!0)}return s.j(function(){var f=r&&r instanceof s.A?r:new s.A(s.a.c(r)),v=f.$data;!a&&u&&s.jb(n,f);(e=("function"==typeof i?i(f,n):i)||s.M.instance.getBindings(n,f))&&(0===o&&(o=1,s.a.w(e,function(i){var r=s.d[i];if(r&&8===n.nodeType&&!s.e.L[i])throw Error("The binding '"+i+"' cannot be used with virtual elements");if(r&&"function"==typeof r.init&&(r=r.init(n,c(i),l,v,f))&&r.controlsDescendantBindings){if(h!==t)throw Error("Multiple bindings ("+h+" and "+i+") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");h=i}}),o=2),2===o&&s.a.w(e,function(t){var i=s.d[t];i&&"function"==typeof i.update&&i.update(n,c(t),l,v,f)}))},null,{$:n}),{Sb:h===t}}s.d={};s.A=function(n,t,i){t?(s.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=s);this.$data=n;i&&(this[i]=n)};s.A.prototype.createChildContext=function(n,t){return new s.A(n,this,t)};s.A.prototype.extend=function(n){var t=s.a.extend(new s.A,this);return s.a.extend(t,n)};var f="__ko_boundElement";s.jb=function(n,t){if(2==arguments.length)s.a.f.set(n,"__ko_bindingContext__",t);else return s.a.f.get(n,"__ko_bindingContext__")};s.Ka=function(n,t,i){return 1===n.nodeType&&s.e.Za(n),r(n,t,i,!0)};s.Ja=function(t,i){1!==i.nodeType&&8!==i.nodeType||n(t,i,!0)};s.Ia=function(n,t){if(t&&1!==t.nodeType&&8!==t.nodeType)throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");t=t||u.document.body;i(n,t,!0)};s.na=function(n){switch(n.nodeType){case 1:case 8:var i=s.jb(n);if(i)return i;if(n.parentNode)return s.na(n.parentNode)}return t};s.ub=function(n){return(n=s.na(n))?n.$data:t};s.b("bindingHandlers",s.d);s.b("applyBindings",s.Ia);s.b("applyBindingsToDescendants",s.Ja);s.b("applyBindingsToNode",s.Ka);s.b("contextFor",s.na);s.b("dataFor",s.ub)}();l={"class":"className","for":"htmlFor"};s.d.attr={update:function(n,i){var r=s.a.c(i())||{};s.a.w(r,function(i,r){r=s.a.c(r);var u=!1===r||null===r||r===t;u&&n.removeAttribute(i);8>=s.a.ca&&i in l?(i=l[i],u?n.removeAttribute(i):n[i]=r):u||n.setAttribute(i,r.toString());"name"===i&&s.a.gb(n,u?"":r.toString())})}};s.d.checked={init:function(t,i,r){s.a.o(t,"click",function(){var u,n,f;if("checkbox"==t.type)u=t.checked;else if("radio"==t.type&&t.checked)u=t.value;else return;n=i();f=s.a.c(n);"checkbox"==t.type&&f instanceof Array?s.a.ja(n,t.value,t.checked):s.g.ha(n,r,"checked",u,!0)});"radio"!=t.type||t.name||s.d.uniqueName.init(t,n(!0))},update:function(n,t){var i=s.a.c(t());"checkbox"==n.type?n.checked=i instanceof Array?0<=s.a.k(i,n.value):i:"radio"==n.type&&(n.checked=n.value==i)}};s.d.css={update:function(n,t){var i=s.a.c(t());"object"==typeof i?s.a.w(i,function(t,i){i=s.a.c(i);s.a.ga(n,t,i)}):(i=String(i||""),s.a.ga(n,n.__ko__cssValue,!1),n.__ko__cssValue=i,s.a.ga(n,i,!0))}};s.d.enable={update:function(n,t){var i=s.a.c(t());i&&n.disabled?n.removeAttribute("disabled"):i||n.disabled||(n.disabled=!0)}};s.d.disable={update:function(n,t){s.d.enable.update(n,function(){return!s.a.c(t())})}};s.d.event={init:function(n,t,i,r){var u=t()||{};s.a.w(u,function(u){"string"==typeof u&&s.a.o(n,u,function(n){var e,o=t()[u],h,f;if(o){h=i();try{f=s.a.N(arguments);f.unshift(r);e=o.apply(r,f)}finally{!0!==e&&(n.preventDefault?n.preventDefault():n.returnValue=!1)}!1===h[u+"Bubble"]&&(n.cancelBubble=!0,n.stopPropagation&&n.stopPropagation())}})})}};s.d.foreach={Ya:function(n){return function(){var i=n(),t=s.a.ya(i);return!t||"number"==typeof t.length?{foreach:i,templateEngine:s.D.sa}:(s.a.c(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:s.D.sa})}},init:function(n,t){return s.d.template.init(n,s.d.foreach.Ya(t))},update:function(n,t,i,r,u){return s.d.template.update(n,s.d.foreach.Ya(t),i,r,u)}};s.g.S.foreach=!1;s.e.L.foreach=!0;s.d.hasfocus={init:function(n,t,i){function r(r){var u,f;if(n.__ko_hasfocusUpdating=!0,u=n.ownerDocument,"activeElement"in u){try{f=u.activeElement}catch(e){f=u.body}r=f===n}u=t();s.g.ha(u,i,"hasfocus",r,!0);n.__ko_hasfocusLastValue=r;n.__ko_hasfocusUpdating=!1}var u=r.bind(null,!0),f=r.bind(null,!1);s.a.o(n,"focus",u);s.a.o(n,"focusin",u);s.a.o(n,"blur",f);s.a.o(n,"focusout",f)},update:function(n,t){var i=!!s.a.c(t());n.__ko_hasfocusUpdating||n.__ko_hasfocusLastValue===i||(i?n.focus():n.blur(),s.q.I(s.a.Ga,null,[n,i?"focusin":"focusout"]))}};s.d.hasFocus=s.d.hasfocus;s.d.html={init:function(){return{controlsDescendantBindings:!0}},update:function(n,t){s.a.fa(n,t())}};a="__ko_withIfBindingData";c("if");c("ifnot",!1,!0);c("with",!0,!1,function(n,t){return n.createChildContext(t)});s.d.options={init:function(n){if("select"!==s.a.u(n))throw Error("options binding applies only to SELECT elements");for(;0<n.length;)n.remove(0);return{controlsDescendantBindings:!0}},update:function(n,i,u){function a(n,t,i){var r=typeof t;return"function"==r?t(n):"string"==r?n[t]:i}function y(n,t){if(e){var i=0<=s.a.k(e,s.h.n(t[0]));s.a.hb(t[0],i)}}var p=0==n.length,h=!p&&n.multiple?n.scrollTop:null,l;i=s.a.c(i());var f=u(),w=f.optionsIncludeDestroyed,c={},o,e;n.multiple?e=s.a.Z(n.selectedOptions||s.a.Y(n.childNodes,function(n){return n.tagName&&"option"===s.a.u(n)&&n.selected}),function(n){return s.h.n(n)}):0<=n.selectedIndex&&(e=[s.h.n(n.options[n.selectedIndex])]);i?("undefined"==typeof i.length&&(i=[i]),l=s.a.Y(i,function(n){return w||n===t||null===n||!s.a.c(n._destroy)}),"optionsCaption"in f&&(o=s.a.c(f.optionsCaption),null!==o&&o!==t&&l.unshift(c))):i=[];u=y;f.optionsAfterRender&&(u=function(n,i){y(0,i);s.q.I(f.optionsAfterRender,null,[i[0],n!==c?n:t])});s.a.Aa(n,l,function(n,i,u){return u.length&&(e=u[0].selected&&[s.h.n(u[0])]),i=r.createElement("option"),n===c?(s.a.fa(i,o),s.h.W(i,t)):(u=a(n,f.optionsValue,n),s.h.W(i,s.a.c(u)),n=a(n,f.optionsText,u),s.a.ib(i,n)),[i]},null,u);e=null;p&&"value"in f&&v(n,s.a.ya(f.value),!0);s.a.zb(n);h&&20<Math.abs(h-n.scrollTop)&&(n.scrollTop=h)}};s.d.options.wa="__ko.optionValueDomData__";s.d.selectedOptions={init:function(n,t,i){s.a.o(n,"change",function(){var u=t(),r=[];s.a.p(n.getElementsByTagName("option"),function(n){n.selected&&r.push(s.h.n(n))});s.g.ha(u,i,"selectedOptions",r)})},update:function(n,t){if("select"!=s.a.u(n))throw Error("values binding applies only to SELECT elements");var i=s.a.c(t());i&&"number"==typeof i.length&&s.a.p(n.getElementsByTagName("option"),function(n){var t=0<=s.a.k(i,s.h.n(n));s.a.hb(n,t)})}};s.d.style={update:function(n,t){var i=s.a.c(t()||{});s.a.w(i,function(t,i){i=s.a.c(i);n.style[t]=i||""})}};s.d.submit={init:function(n,t,i,r){if("function"!=typeof t())throw Error("The value for a submit binding must be a function");s.a.o(n,"submit",function(i){var u,f=t();try{u=f.call(r,n)}finally{!0!==u&&(i.preventDefault?i.preventDefault():i.returnValue=!1)}})}};s.d.text={update:function(n,t){s.a.ib(n,t())}};s.e.L.text=!0;s.d.uniqueName={init:function(n,t){if(t()){var i="ko_unique_"+ ++s.d.uniqueName.tb;s.a.gb(n,i)}}};s.d.uniqueName.tb=0;s.d.value={init:function(n,t,i){function f(){e=!1;var r=t(),u=s.h.n(n);s.g.ha(r,i,"value",u)}var r=["change"],u=i().valueUpdate,e=!1;u&&("string"==typeof u&&(u=[u]),s.a.R(r,u),r=s.a.Ma(r));!s.a.ca||"input"!=n.tagName.toLowerCase()||"text"!=n.type||"off"==n.autocomplete||n.form&&"off"==n.form.autocomplete||-1!=s.a.k(r,"propertychange")||(s.a.o(n,"propertychange",function(){e=!0}),s.a.o(n,"blur",function(){e&&f()}));s.a.p(r,function(t){var i=f;s.a.Tb(t,"after")&&(i=function(){setTimeout(f,0)},t=t.substring(5));s.a.o(n,t,i)})},update:function(n,t){var u="select"===s.a.u(n),r=s.a.c(t()),i=s.h.n(n);r!==i&&(i=function(){s.h.W(n,r)},i(),u&&setTimeout(i,0));u&&0<n.length&&v(n,r,!1)}};s.d.visible={update:function(n,t){var i=s.a.c(t()),r="none"!=n.style.display;i&&!r?n.style.display="":!i&&r&&(n.style.display="none")}},function(n){s.d[n]={init:function(t,i,r,u){return s.d.event.init.call(this,t,function(){var t={};return t[n]=i(),t},r,u)}}}("click");s.v=function(){};s.v.prototype.renderTemplateSource=function(){throw Error("Override renderTemplateSource");};s.v.prototype.createJavaScriptEvaluatorBlock=function(){throw Error("Override createJavaScriptEvaluatorBlock");};s.v.prototype.makeTemplateSource=function(n,t){if("string"==typeof n){t=t||r;var i=t.getElementById(n);if(!i)throw Error("Cannot find template with ID "+n);return new s.l.i(i)}if(1==n.nodeType||8==n.nodeType)return new s.l.Q(n);throw Error("Unknown template type: "+n);};s.v.prototype.renderTemplate=function(n,t,i,r){return n=this.makeTemplateSource(n,r),this.renderTemplateSource(n,t,i)};s.v.prototype.isTemplateRewritten=function(n,t){return!1===this.allowTemplateRewriting?!0:this.makeTemplateSource(n,t).data("isRewritten")};s.v.prototype.rewriteTemplate=function(n,t,i){n=this.makeTemplateSource(n,i);t=t(n.text());n.text(t);n.data("isRewritten",!0)};s.b("templateEngine",s.v);s.Ea=function(){function n(n,t,i,r){var o,f,u,e;for(n=s.g.da(n),o=s.g.S,f=0;f<n.length;f++)if(u=n[f].key,o.hasOwnProperty(u))if(e=o[u],"function"==typeof e){if(u=e(n[f].value))throw Error(u);}else if(!e)throw Error("This template engine does not support the '"+u+"' binding within its templates");return i="ko.__tr_ambtns(function($context,$element){return(function(){return{ "+s.g.ea(n)+" } })()},'"+i.toLowerCase()+"')",r.createJavaScriptEvaluatorBlock(i)+t}var t=/(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,i=/\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;return{Ab:function(n,t,i){t.isTemplateRewritten(n,i)||t.rewriteTemplate(n,function(n){return s.Ea.Lb(n,t)},i)},Lb:function(r,u){return r.replace(t,function(t,i,r,f,e){return n(e,i,r,u)}).replace(i,function(t,i){return n(i,"<!-- ko -->","#comment",u)})},qb:function(n,t){return s.s.va(function(i,r){var u=i.nextSibling;u&&u.nodeName.toLowerCase()===t&&s.Ka(u,n,r)})}}}();s.b("__tr_ambtns",s.Ea.qb),function(){s.l={};s.l.i=function(n){this.i=n};s.l.i.prototype.text=function(){var n=s.a.u(this.i),n="script"===n?"text":"textarea"===n?"value":"innerHTML",t;if(0==arguments.length)return this.i[n];t=arguments[0];"innerHTML"===n?s.a.fa(this.i,t):this.i[n]=t};s.l.i.prototype.data=function(n){if(1===arguments.length)return s.a.f.get(this.i,"templateSourceData_"+n);s.a.f.set(this.i,"templateSourceData_"+n,arguments[1])};s.l.Q=function(n){this.i=n};s.l.Q.prototype=new s.l.i;s.l.Q.prototype.text=function(){if(0==arguments.length){var n=s.a.f.get(this.i,"__ko_anon_template__")||{};return n.Fa===t&&n.ma&&(n.Fa=n.ma.innerHTML),n.Fa}s.a.f.set(this.i,"__ko_anon_template__",{Fa:arguments[0]})};s.l.i.prototype.nodes=function(){if(0==arguments.length)return(s.a.f.get(this.i,"__ko_anon_template__")||{}).ma;s.a.f.set(this.i,"__ko_anon_template__",{ma:arguments[0]})};s.b("templateSources",s.l);s.b("templateSources.domElement",s.l.i);s.b("templateSources.anonymousTemplate",s.l.Q)}(),function(){function r(n,t,i){var r;for(t=s.e.nextSibling(t);n&&(r=n)!==t;)n=s.e.nextSibling(r),1!==r.nodeType&&8!==r.nodeType||i(r)}function u(n,t){if(n.length){var i=n[0],u=n[n.length-1];r(i,u,function(n){s.Ia(t,n)});r(i,u,function(n){s.s.nb(n,[t])})}}function n(n){return n.nodeType?n:0<n.length?n[0]:null}function f(t,r,f,e,o){o=o||{};var h=t&&n(t),h=h&&h.ownerDocument,c=o.templateEngine||i;if(s.Ea.Ab(f,c,h),f=c.renderTemplate(f,e,o,h),"number"!=typeof f.length||0<f.length&&"number"!=typeof f[0].nodeType)throw Error("Template engine must return an array of DOM nodes");h=!1;switch(r){case"replaceChildren":s.e.P(t,f);h=!0;break;case"replaceNode":s.a.eb(t,f);h=!0;break;case"ignoreTargetNode":break;default:throw Error("Unknown renderMode: "+r);}return h&&(u(f,e),o.afterRender&&s.q.I(o.afterRender,null,[f,e.$data])),f}var i;s.Ba=function(n){if(n!=t&&!(n instanceof s.v))throw Error("templateEngine must inherit from ko.templateEngine");i=n};s.za=function(r,u,e,o,h){if(e=e||{},(e.templateEngine||i)==t)throw Error("Set a template engine before calling renderTemplate");if(h=h||"replaceChildren",o){var c=n(o);return s.j(function(){var t=u&&u instanceof s.A?u:new s.A(s.a.c(u)),i="function"==typeof r?r(t.$data,t):r,t=f(o,h,i,t,e);"replaceNode"==h&&(o=t,c=n(o))},null,{Qa:function(){return!c||!s.a.aa(c)},$:c&&"replaceNode"==h?c.parentNode:c})}return s.s.va(function(n){s.za(r,u,e,n,"replaceNode")})};s.Rb=function(n,i,r,e,o){function c(n,t){u(t,h);r.afterRender&&r.afterRender(t,n)}function l(t,i){h=o.createChildContext(s.a.c(t),r.as);h.$index=i;var u="function"==typeof n?n(t,h):n;return f(null,"ignoreTargetNode",u,h,r)}var h;return s.j(function(){var n=s.a.c(i)||[];"undefined"==typeof n.length&&(n=[n]);n=s.a.Y(n,function(n){return r.includeDestroyed||n===t||null===n||!s.a.c(n._destroy)});s.q.I(s.a.Aa,null,[e,n,l,r,c])},null,{$:e})};s.d.template={init:function(n,t){var i=s.a.c(t());return"string"==typeof i||i.name||1!=n.nodeType&&8!=n.nodeType||(i=1==n.nodeType?n.childNodes:s.e.childNodes(n),i=s.a.Mb(i),new s.l.Q(n).nodes(i)),{controlsDescendantBindings:!0}},update:function(n,i,r,u,f){i=s.a.c(i());r={};u=!0;var e,o=null;"string"!=typeof i&&(r=i,i=s.a.c(r.name),"if"in r&&(u=s.a.c(r["if"])),u&&"ifnot"in r&&(u=!s.a.c(r.ifnot)),e=s.a.c(r.data));"foreach"in r?o=s.Rb(i||n,u&&r.foreach||[],r,n,f):u?(f="data"in r?f.createChildContext(e,r.as):f,o=s.za(i||n,f,r,n)):s.e.ba(n);f=o;(e=s.a.f.get(n,"__ko__templateComputedDomDataKey__"))&&"function"==typeof e.B&&e.B();s.a.f.set(n,"__ko__templateComputedDomDataKey__",f&&f.ta()?f:t)}};s.g.S.template=function(n){return n=s.g.da(n),1==n.length&&n[0].unknown||s.g.Jb(n,"name")?null:"This template engine does not support anonymous templates nested within its templates"};s.e.L.template=!0}();s.b("setTemplateEngine",s.Ba);s.b("renderTemplate",s.za);s.a.Pa=function(){function n(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,y,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()}return function(t,i,r){return t=t||[],i=i||[],t.length<=i.length?n(t,i,"added","deleted",r):n(i,t,"deleted","added",r)}}();s.b("utils.compareArrays",s.a.Pa),function(){function n(n){for(;n.length&&!s.a.aa(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 i(i,r,u,f,e){var o=[];return i=s.j(function(){var t=r(u,e,n(o))||[];0<o.length&&(s.a.eb(o,t),f&&s.q.I(f,null,[u,t,e]));o.splice(0,o.length);s.a.R(o,t)},null,{$:i,Qa:function(){return!s.a.pb(o)}}),{O:o,j:i.ta()?i:t}}s.a.Aa=function(r,u,f,e,o){function rt(t,i){h=d[i];nt!==i&&(it[t]=h);h.ra(nt++);n(h.O);g.push(h);w.push(h)}function y(n,t){if(n)for(var i=0,r=t.length;i<r;i++)t[i]&&s.a.p(t[i].O,function(r){n(r,i,t[i].X)})}var c,v,ut;u=u||[];e=e||{};var v=s.a.f.get(r,"setDomNodeChildrenFromArrayMapping_lastMappingResult")===t,d=s.a.f.get(r,"setDomNodeChildrenFromArrayMapping_lastMappingResult")||[],p=s.a.Z(d,function(n){return n.X}),l=s.a.Pa(p,u,e.dontLimitMoves),g=[],a=0,nt=0,tt=[],w=[];u=[];for(var it=[],p=[],h,c=0,b,k;b=l[c];c++)switch(k=b.moved,b.status){case"deleted":k===t&&(h=d[a],h.j&&h.j.B(),tt.push.apply(tt,n(h.O)),e.beforeRemove&&(u[c]=h,w.push(h)));a++;break;case"retained":rt(c,a++);break;case"added":k!==t?rt(c,k):(h={X:b.value,ra:s.m(nt++)},g.push(h),w.push(h),v||(p[c]=h))}for(y(e.beforeMove,it),s.a.p(tt,e.beforeRemove?s.H:s.removeNode),c=0,v=s.e.firstChild(r);h=w[c];c++){for(h.O||s.a.extend(h,i(r,f,h.X,o,h.ra)),a=0;l=h.O[a];v=l.nextSibling,ut=l,a++)l!==v&&s.e.Va(r,l,ut);!h.Fb&&o&&(o(h.X,h.O,h.ra),h.Fb=!0)}y(e.beforeRemove,u);y(e.afterMove,it);y(e.afterAdd,p);s.a.f.set(r,"setDomNodeChildrenFromArrayMapping_lastMappingResult",g)}}();s.b("utils.setDomNodeChildrenFromArrayMapping",s.a.Aa);s.D=function(){this.allowTemplateRewriting=!1};s.D.prototype=new s.v;s.D.prototype.renderTemplateSource=function(n){var t=(9>s.a.ca?0:n.nodes)?n.nodes():null;return t?s.a.N(t.cloneNode(!0).childNodes):(n=n.text(),s.a.xa(n))};s.D.sa=new s.D;s.Ba(s.D.sa);s.b("nativeTemplateEngine",s.D),function(){s.ua=function(){var n=this.Ib=function(){if("undefined"==typeof i||!i.tmpl)return 0;try{if(0<=i.tmpl.tag.tmpl.open.toString().indexOf("__"))return 2}catch(n){}return 1}();this.renderTemplateSource=function(t,u,f){if(f=f||{},2>n)throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");var e=t.data("precompiled");return e||(e=t.text()||"",e=i.template(null,"{{ko_with $item.koBindingContext}}"+e+"{{/ko_with}}"),t.data("precompiled",e)),t=[u.$data],u=i.extend({koBindingContext:u},f.templateOptions),u=i.tmpl(e,t,u),u.appendTo(r.createElement("div")),i.fragments={},u};this.createJavaScriptEvaluatorBlock=function(n){return"{{ko_code ((function() { return "+n+" })()) }}"};this.addTemplate=function(n,t){r.write("<script type='text/html' id='"+n+"'>"+t+"<\/script>")};0<n&&(i.tmpl.tag.ko_code={open:"__.push($1 || '');"},i.tmpl.tag.ko_with={open:"with($1) {",close:"} "})};s.ua.prototype=new s.v;var n=new s.ua;0<n.Ib&&s.Ba(n);s.b("jqueryTmplTemplateEngine",s.ua)}()})})()})();ko.bindingHandlers.valueKeep={init:function(n,t,i,r){var u=n.getAttribute("value");ko.bindingHandlers.value.init(n,t,i,r);t()(u)},update:ko.bindingHandlers.value.update};ko.bindingHandlers.readonly={update:function(n,t){var i=function(){return!1};t()?$(n).is(":checkbox")?$(n).attr("disabled","disabled"):($(n).attr("readonly","readonly"),$(n).addClass("disabled")):$(n).is(":checkbox")?$(n).removeAttr("disabled"):($(n).removeAttr("readonly"),$(n).removeClass("disabled"))}};TestFinances.prototype.toMinJSON=function(){var n=ko.toJSON(this);return delete n.totalExpenses,n}