{"size": 75097, "ext": "js", "max_stars_repo_path": "src/main/resources/static/js/jsviews.min.js", "max_stars_repo_name": "siyoon210/voca-test", "max_stars_repo_stars_event_min_datetime": "2019-08-07T01:53:16.000Z", "max_stars_repo_stars_event_max_datetime": "2019-08-07T01:53:16.000Z", "max_issues_repo_path": "src/main/resources/static/js/jsviews.min.js", "max_issues_repo_name": "siyoon210/voca-test", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/main/resources/static/js/jsviews.min.js", "max_forks_repo_name": "siyoon210/voca-test", "max_forks_repo_forks_event_min_datetime": "2019-09-27T00:42:53.000Z", "max_forks_repo_forks_event_max_datetime": "2019-09-27T00:42:53.000Z"}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": 1, "avg_line_length": 10728.1428571429, "max_line_length": 32048, "alphanum_fraction": 0.5907559556}
/*! jsviews.js v1.0.5 single-file version: http://jsviews.com/ */
/*! includes JsRender, JsObservable and JsViews - see: http://jsviews.com/#download */
!function(e,t){var n=t.jQuery;"object"==typeof exports?module.exports=n?e(t,n):function(n){return e(t,n)}:"function"==typeof define&&define.amd?define(["jquery"],function(n){return e(t,n)}):e(t,!1)}(function(e,t){"use strict";function n(e,t){return function(){var n,r=this,i=r.base;return r.base=e,n=t.apply(r,arguments),r.base=i,n}}function r(e,t){return Ye(t)&&(t=n(e?e._d?e:n(o,e):o,t),t._d=(e&&e._d||0)+1),t}function i(e,t){var n,i=t.props;for(n in i)!jt.test(n)||e[n]&&e[n].fix||(e[n]="convert"!==n?r(e.constructor.prototype[n],i[n]):i[n])}function a(e){return e}function o(){return""}function s(e){try{throw console.log("JsRender dbg breakpoint: "+e),"dbg breakpoint"}catch(t){}return this.base?this.baseApply(arguments):e}function l(e){this.name=(t.link?"JsViews":"JsRender")+" Error",this.message=e||this.name}function d(e,t){if(e){for(var n in t)e[n]=t[n];return e}}function p(e,t,n){return e?et(e)?p.apply(We,e):(ut=n?n[0]:ut,/^(\W|_){5}$/.test(e+t+ut)||L("Invalid delimiters"),dt=e[0],pt=e[1],ct=t[0],ft=t[1],ot.delimiters=[dt+pt,ct+ft,ut],e="\\"+dt+"(\\"+ut+")?\\"+pt,t="\\"+ct+"\\"+ft,ze="(?:(\\w+(?=[\\/\\s\\"+ct+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+ct+"]|\\"+ct+"(?!\\"+ft+"))*?)",at.rTag="(?:"+ze+")",ze=new RegExp("(?:"+e+ze+"(\\/)?|\\"+dt+"(\\"+ut+")?\\"+pt+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+t,"g"),at.rTmpl=new RegExp("^\\s|\\s$|<.*>|([^\\\\]|^)[{}]|"+e+".*"+t),lt):ot.delimiters}function c(e,t){t||e===!0||(t=e,e=void 0);var n,r,i,a,o=this,s="root"===t;if(e){if(a=t&&o.type===t&&o,!a)if(n=o.views,o._.useKey){for(r in n)if(a=t?n[r].get(e,t):n[r])break}else for(r=0,i=n.length;!a&&r<i;r++)a=t?n[r].get(e,t):n[r]}else if(s)a=o.root;else if(t)for(;o&&!a;)a=o.type===t?o:void 0,o=o.parent;else a=o.parent;return a||void 0}function f(){var e=this.get("item");return e?e.index:void 0}function u(){return this.index}function g(e,t,n,r){var i,a,s,l=0;if(1===n&&(r=1,n=void 0),t)for(a=t.split("."),s=a.length;e&&l<s;l++)i=e,e=a[l]?e[a[l]]:e;return n&&(n.lt=n.lt||l<s),void 0===e?r?o:"":r?function(){return e.apply(i,arguments)}:e}function v(n,r,i){var a,o,s,l,p,c,f,u=this,g=!vt&&arguments.length>1,v=u.ctx;if(n){if(u._||(p=u.index,u=u.tag),c=u,v&&v.hasOwnProperty(n)||(v=rt).hasOwnProperty(n)){if(s=v[n],"tag"===n||"tagCtx"===n||"root"===n||"parentTags"===n)return s}else v=void 0;if((!vt&&u.tagCtx||u.linked)&&(s&&s._cxp||(u=u.tagCtx||Ye(s)?u:(u=u.scope||u,!u.isTop&&u.ctx.tag||u),void 0!==s&&u.tagCtx&&(u=u.tagCtx.view.scope),v=u._ocps,s=v&&v.hasOwnProperty(n)&&v[n]||s,s&&s._cxp||!i&&!g||((v||(u._ocps=u._ocps||{}))[n]=s=[{_ocp:s,_vw:c,_key:n}],s._cxp={path:_t,ind:0,updateValue:function(e,n){return t.observable(s[0]).setProperty(_t,e),this}})),l=s&&s._cxp)){if(arguments.length>2)return o=s[1]?at._ceo(s[1].deps):[_t],o.unshift(s[0]),o._cxp=l,o;if(p=l.tagElse,f=s[1]?l.tag&&l.tag.cvtArgs?l.tag.cvtArgs(p,1)[l.ind]:s[1](s[0].data,s[0],at):s[0]._ocp,g)return s&&f!==r&&at._ucp(n,r,u,l),u;s=f}return s&&Ye(s)&&(a=function(){return s.apply(this&&this!==e?this:c,arguments)},d(a,s)),a||s}}function h(e){return e&&(e.fn?e:this.getRsc("templates",e)||tt(e))}function _(e,t,n,r){var a,o,s,l,p,c="number"==typeof n&&t.tmpl.bnds[n-1];if(void 0===r&&c&&c._lr&&(r=""),void 0!==r?n=r={props:{},args:[r]}:c&&(n=c(t.data,t,at)),c=c._bd&&c,e||c){if(o=t._lc,a=o&&o.tag,n.view=t,!a){if(a=d(new at._tg,{_:{bnd:c,unlinked:!0,lt:n.lt},inline:!o,tagName:":",convert:e,onArrayChange:!0,flow:!0,tagCtx:n,tagCtxs:[n],_is:"tag"}),l=n.args.length,l>1)for(p=a.bindTo=[];l--;)p.unshift(l);o&&(o.tag=a,a.linkCtx=o),n.ctx=J(n.ctx,(o?o.view:t).ctx),i(a,n)}a._er=r&&s,a.ctx=n.ctx||a.ctx||{},n.ctx=void 0,s=a.cvtArgs()[0],a._er=r&&s}else s=n.args[0];return s=c&&t._.onRender?t._.onRender(s,t,a):s,void 0!=s?s:""}function m(e,t){var n,r,i,a,o,s,l,d=this;if(d.tagName){if(s=d,d=(s.tagCtxs||[d])[e||0],!d)return}else s=d.tag;if(o=s.bindFrom,a=d.args,(l=s.convert)&&""+l===l&&(l="true"===l?void 0:d.view.getRsc("converters",l)||L("Unknown converter: '"+l+"'")),l&&!t&&(a=a.slice()),o){for(i=[],n=o.length;n--;)r=o[n],i.unshift(b(d,r));t&&(a=i)}if(l){if(l=l.apply(s,i||a),void 0===l)return a;if(o=o||[0],n=o.length,et(l)&&l.length===n||(l=[l],o=[0],n=1),t)a=l;else for(;n--;)r=o[n],+r===r&&(a[r]=l[n])}return a}function b(e,t){return e=e[+t===t?"args":"props"],e&&e[t]}function x(e){return this.cvtArgs(e,1)}function y(e,t){var n,r,i=this;if(""+t===t){for(;void 0===n&&i;)r=i.tmpl&&i.tmpl[e],n=r&&r[t],i=i.parent;return n||We[e][t]}}function w(e,t,n,r,a,o){function s(e){var t=l[e];if(void 0!==t)for(t=et(t)?t:[t],h=t.length;h--;)$=t[h],isNaN(parseInt($))||(t[h]=parseInt($));return t||[0]}t=t||Qe;var l,d,p,c,f,u,g,h,_,y,w,k,C,E,j,A,I,T,V,N,P,S,M,B,R,$,U,D,q,K,H=0,z="",Q=t._lc||!1,W=t.ctx,X=n||t.tmpl,Z="number"==typeof r&&t.tmpl.bnds[r-1];for("tag"===e._is?(l=e,e=l.tagName,r=l.tagCtxs,p=l.template):(d=t.getRsc("tags",e)||L("Unknown tag: {{"+e+"}} "),p=d.template),void 0===o&&Z&&(Z._lr=d.lateRender&&Z._lr!==!1||Z._lr)&&(o=""),void 0!==o?(z+=o,r=o=[{props:{},args:[],params:{props:{}}}]):Z&&(r=Z(t.data,t,at)),g=r.length;H<g;H++)w=r[H],I=w.tmpl,(!Q||!Q.tag||H&&!Q.tag.inline||l._er||I&&+I===I)&&(I&&X.tmpls&&(w.tmpl=w.content=X.tmpls[I-1]),w.index=H,w.ctxPrm=v,w.render=O,w.cvtArgs=m,w.bndArgs=x,w.view=t,w.ctx=J(J(w.ctx,d&&d.ctx),W)),(n=w.props.tmpl)&&(w.tmpl=t._getTmpl(n),w.content=w.content||w.tmpl),l?Q&&Q.fn._lr&&(T=!!l.init):(l=new d._ctr,T=!!l.init,l.parent=u=W&&W.tag,l.tagCtxs=r,Q&&(l.inline=!1,Q.tag=l),l.linkCtx=Q,(l._.bnd=Z||Q.fn)?(l._.ths=w.params.props["this"],l._.lt=r.lt,l._.arrVws={}):l.dataBoundOnly&&L(e+" must be data-bound:\n{^{"+e+"}}")),B=l.dataMap,w.tag=l,B&&r&&(w.map=r[H].map),l.flow||(k=w.ctx=w.ctx||{},c=l.parents=k.parentTags=W&&J(k.parentTags,W.parentTags)||{},u&&(c[u.tagName]=u),c[l.tagName]=k.tag=l,k.tagCtx=w);if(!(l._er=o)){for(i(l,r[0]),l.rendering={rndr:l.rendering},H=0;H<g;H++){if(w=l.tagCtx=r[H],M=w.props,l.ctx=w.ctx,!H){if(T&&(l.init(w,Q,l.ctx),T=void 0),w.args.length||w.argDefault===!1||l.argDefault===!1||(w.args=P=[w.view.data],w.params.args=["#data"]),E=s("bindTo"),void 0!==l.bindTo&&(l.bindTo=E),void 0!==l.bindFrom?l.bindFrom=s("bindFrom"):l.bindTo&&(l.bindFrom=l.bindTo=E),j=l.bindFrom||E,D=E.length,U=j.length,l._.bnd&&(q=l.linkedElement)&&(l.linkedElement=q=et(q)?q:[q],D!==q.length&&L("linkedElement not same length as bindTo")),(q=l.linkedCtxParam)&&(l.linkedCtxParam=q=et(q)?q:[q],U!==q.length&&L("linkedCtxParam not same length as bindFrom/bindTo")),j)for(l._.fromIndex={},l._.toIndex={},_=U;_--;)for($=j[_],h=D;h--;)$===E[h]&&(l._.fromIndex[h]=_,l._.toIndex[_]=h);Q&&(Q.attr=l.attr=Q.attr||l.attr||Q._dfAt),f=l.attr,l._.noVws=f&&f!==Ot}if(P=l.cvtArgs(H),l.linkedCtxParam)for(S=l.cvtArgs(H,1),h=U,K=l.constructor.prototype.ctx;h--;)(C=l.linkedCtxParam[h])&&($=j[h],A=S[h],w.ctx[C]=at._cp(K&&void 0===A?K[C]:A,void 0!==A&&b(w.params,$),w.view,l._.bnd&&{tag:l,cvt:l.convert,ind:h,tagElse:H}));(V=M.dataMap||B)&&(P.length||M.dataMap)&&(N=w.map,N&&N.src===P[0]&&!a||(N&&N.src&&N.unmap(),V.map(P[0],w,N,!l._.bnd),N=w.map),P=[N.tgt]),y=void 0,l.render&&(y=l.render.apply(l,P),t.linked&&y&&!At.test(y)&&(n={links:[]},n.render=n.fn=function(){return y},y=F(n,t.data,void 0,!0,t,void 0,void 0,l))),P.length||(P=[t]),void 0===y&&(R=P[0],l.contentCtx&&(R=l.contentCtx===!0?t:l.contentCtx(R)),y=w.render(R,!0)||(a?void 0:"")),z=z?z+(y||""):void 0!==y?""+y:void 0}l.rendering=l.rendering.rndr}return l.tagCtx=r[0],l.ctx=l.tagCtx.ctx,l._.noVws&&l.inline&&(z="text"===f?nt.html(z):""),Z&&t._.onRender?t._.onRender(z,t,l):z}function k(e,t,n,r,i,a,o,s){var l,d,p,c=this,u="array"===t;c.content=s,c.views=u?[]:{},c.data=r,c.tmpl=i,p=c._={key:0,useKey:u?0:1,id:""+Pt++,onRender:o,bnds:{}},c.linked=!!o,c.type=t||"top",n&&"top"!==n.type||((c.ctx=e||{}).root=c.data),(c.parent=n)?(c.root=n.root||c,l=n.views,d=n._,c.isTop=d.scp,c.scope=(!e.tag||e.tag===n.ctx.tag)&&!c.isTop&&n.scope||c,d.useKey?(l[p.key="_"+d.useKey++]=c,c.index=Rt,c.getIndex=f):l.length===(p.key=c.index=a)?l.push(c):l.splice(a,0,c),c.ctx=e||n.ctx):t&&(c.root=c)}function C(e){var t,n,r;for(t in qt)n=t+"s",e[n]&&(r=e[n],e[n]={},We[n](r,e))}function E(e,t,n){function i(){var t=this;t._={unlinked:!0},t.inline=!0,t.tagName=e}var a,o,s,l=new at._tg;if(Ye(t)?t={depends:t.depends,render:t}:""+t===t&&(t={template:t}),o=t.baseTag){t.flow=!!t.flow,o=""+o===o?n&&n.tags[o]||it[o]:o,o||L('baseTag: "'+t.baseTag+'" not found'),l=d(l,o);for(s in t)l[s]=r(o[s],t[s])}else l=d(l,t);return void 0!==(a=l.template)&&(l.template=""+a===a?tt[a]||tt(a):a),(i.prototype=l).constructor=l._ctr=i,n&&(l._parentTmpl=n),l}function j(e){return this.base.apply(this,e)}function A(e,n,r,i){function a(n){var a,s;if(""+n===n||n.nodeType>0&&(o=n)){if(!o)if(/^\.\/[^\\:*?"<>]*$/.test(n))(s=tt[e=e||n])?n=s:o=document.getElementById(n);else if(t.fn&&!at.rTmpl.test(n))try{o=t(n,document)[0]}catch(l){}o&&("SCRIPT"!==o.tagName&&L(n+": Use script block, not "+o.tagName),i?n=o.innerHTML:(a=o.getAttribute(Bt),a&&(a!==Lt?(n=tt[a],delete tt[a]):t.fn&&(n=t.data(o)[Lt])),a&&n||(e=e||(t.fn?Lt:n),n=A(e,o.innerHTML,r,i)),n.tmplName=e=e||a,e!==Lt&&(tt[e]=n),o.setAttribute(Bt,e),t.fn&&t.data(o,Lt,n))),o=void 0}else n.fn||(n=void 0);return n}var o,s,l=n=n||"";if(at._html=nt.html,0===i&&(i=void 0,l=a(l)),i=i||(n.markup?n.bnds?d({},n):n:{}),i.tmplName=i.tmplName||e||"unnamed",r&&(i._parentTmpl=r),!l&&n.markup&&(l=a(n.markup))&&l.fn&&(l=l.markup),void 0!==l)return l.render||n.render?l.tmpls&&(s=l):(n=N(l,i),$(l.replace(xt,"\\$&"),n)),s||(s=d(function(){return s.render.apply(s,arguments)},n),C(s)),s}function I(e,t){return Ye(e)?e.call(t):e}function T(e,t,n){Object.defineProperty(e,t,{value:n,configurable:!0})}function V(e,n){function r(e){p.apply(this,e)}function i(){return new r(arguments)}function a(e,t){for(var n,r,i,a,o,s=0;s<b;s++)i=u[s],n=void 0,i+""!==i&&(n=i,i=n.getter,o=n.parentRef),void 0===(a=e[i])&&n&&void 0!==(r=n.defaultVal)&&(a=I(r,e)),t(a,n&&f[n.type],i,o)}function o(t){t=t+""===t?JSON.parse(t):t;var n,r,i,o,d=0,p=t,c=[];if(et(t)){for(t=t||[],n=t.length;d<n;d++)c.push(this.map(t[d]));return c._is=e,c.unmap=l,c.merge=s,c}if(t){for(a(t,function(e,t){t&&(e=t.map(e)),c.push(e)}),p=this.apply(this,c),d=b;d--;)if(i=c[d],o=u[d].parentRef,o&&i&&i.unmap)if(et(i))for(n=i.length;n--;)T(i[n],o,p);else T(i,o,p);for(r in t)r===Ge||y[r]||(p[r]=t[r])}return p}function s(e,t,n){e=e+""===e?JSON.parse(e):e;var r,o,s,l,d,p,c,f,u,g,h=0,_=this;if(et(_)){for(c={},u=[],o=e.length,s=_.length;h<o;h++){for(f=e[h],p=!1,r=0;r<s&&!p;r++)c[r]||(d=_[r],v&&(c[r]=p=v+""===v?f[v]&&(y[v]?d[v]():d[v])===f[v]:v(d,f)));p?(d.merge(f),u.push(d)):(u.push(g=i.map(f)),n&&T(g,n,t))}return void(x?x(_).refresh(u,!0):_.splice.apply(_,[0,_.length].concat(u)))}a(e,function(e,t,n,r){t?_[n]().merge(e,_,r):_[n]()!==e&&_[n](e)});for(l in e)l===Ge||y[l]||(_[l]=e[l])}function l(){function e(e){for(var t=[],n=0,r=e.length;n<r;n++)t.push(e[n].unmap());return t}var t,n,r,i,a=0,o=this;if(et(o))return e(o);for(t={};a<b;a++)n=u[a],r=void 0,n+""!==n&&(r=n,n=r.getter),i=o[n](),t[n]=r&&i&&f[r.type]?et(i)?e(i):i.unmap():i;for(n in o)!o.hasOwnProperty(n)||"_"===n.charAt(0)&&y[n.slice(1)]||n===Ge||Ye(o[n])||(t[n]=o[n]);return t}var d,p,c,f=this,u=n.getters,g=n.extend,v=n.id,h=t.extend({_is:e||"unnamed",unmap:l,merge:s},g),_="",m="",b=u?u.length:0,x=t.observable,y={};for(r.prototype=h,d=0;d<b;d++)!function(e){e=e.getter||e,y[e]=d+1;var t="_"+e;_+=(_?",":"")+e,m+="this."+t+" = "+e+";\n",h[e]=h[e]||function(n){return arguments.length?void(x?x(this).setProperty(e,n):this[t]=n):this[t]},x&&(h[e].set=h[e].set||function(e){this[t]=e})}(u[d]);return m=new Function(_,m),p=function(){m.apply(this,arguments),(c=arguments[b+1])&&T(this,arguments[b],c)},p.prototype=h,h.constructor=p,i.map=o,i.getters=u,i.extend=g,i.id=v,i}function N(e,n){var r,i=st._wm||{},a={tmpls:[],links:{},bnds:[],_is:"template",render:O};return n&&(a=d(a,n)),a.markup=e,a.htmlTag||(r=kt.exec(e),a.htmlTag=r?r[1].toLowerCase():""),r=i[a.htmlTag],r&&r!==i.div&&(a.markup=t.trim(a.markup)),a}function P(e,t){function n(i,a,o){var s,l,d,p=at.onStore[e];if(i&&typeof i===Ft&&!i.nodeType&&!i.markup&&!i.getTgt&&!("viewModel"===e&&i.getters||i.extend)){for(l in i)n(l,i[l],a);return a||We}return i&&""+i!==i&&(o=a,a=i,i=void 0),d=o?"viewModel"===e?o:o[r]=o[r]||{}:n,s=t.compile,void 0===a&&(a=s?i:d[i],i=void 0),null===a?i&&delete d[i]:(s&&(a=s.call(d,i,a,o,0)||{},a._is=e),i&&(d[i]=a)),p&&p(i,a,o,s),a}var r=e+"s";We[r]=n}function S(e){lt[e]=lt[e]||function(t){return arguments.length?(ot[e]=t,lt):ot[e]}}function M(e){function t(t,n){this.tgt=e.getTgt(t,n),n.map=this}return Ye(e)&&(e={getTgt:e}),e.baseMap&&(e=d(d({},e.baseMap),e)),e.map=function(e,n){return new t(e,n)},e}function O(e,t,n,r,i,a){var o,s,l,d,p,c,f,u,g=r,v="";if(t===!0?(n=t,t=void 0):typeof t!==Ft&&(t=void 0),(l=this.tag)?(p=this,g=g||p.view,d=g._getTmpl(l.template||p.tmpl),arguments.length||(e=l.contentCtx&&Ye(l.contentCtx)?e=l.contentCtx(e):g)):d=this,d){if(!r&&e&&"view"===e._is&&(g=e),g&&e===g&&(e=g.data),c=!g,vt=vt||c,g||((t=t||{}).root=e),!vt||st.useViews||d.useViews||g&&g!==Qe)v=F(d,e,t,n,g,i,a,l);else{if(g?(f=g.data,u=g.index,g.index=Rt):(g=Qe,f=g.data,g.data=e,g.ctx=t),et(e)&&!n)for(o=0,s=e.length;o<s;o++)g.index=o,g.data=e[o],v+=d.fn(e[o],g,at);else g.data=e,v+=d.fn(e,g,at);g.data=f,g.index=u}c&&(vt=void 0)}return v}function F(e,t,n,r,i,a,o,s){var l,p,c,f,u,g,v,h,_,m,b,x,y,w="";if(s&&(_=s.tagName,x=s.tagCtx,n=n?J(n,s.ctx):s.ctx,e===i.content?v=e!==i.ctx._wrp?i.ctx._wrp:void 0:e!==x.content?e===s.template?(v=x.tmpl,n._wrp=x.content):v=x.content||i.content:v=i.content,x.props.link===!1&&(n=n||{},n.link=!1)),i&&(o=o||i._.onRender,y=n&&n.link===!1,y&&i._.nl&&(o=void 0),n=J(n,i.ctx),x=!s&&i.tag?i.tag.tagCtxs[i.tagElse]:x),(m=x&&x.props.itemVar)&&("~"!==m[0]&&R("Use itemVar='~myItem'"),m=m.slice(1)),a===!0&&(g=!0,a=0),o&&s&&s._.noVws&&(o=void 0),h=o,o===!0&&(h=void 0,o=i._.onRender),n=e.helpers?J(e.helpers,n):n,b=n,et(t)&&!r)for(c=g?i:void 0!==a&&i||new k(n,"array",i,t,e,a,o,v),c._.nl=y,i&&i._.useKey&&(c._.bnd=!s||s._.bnd&&s,c.tag=s),l=0,p=t.length;l<p;l++)f=new k(b,"item",c,t[l],e,(a||0)+l,o,c.content),m&&((f.ctx=d({},b))[m]=at._cp(t[l],"#data",f)),u=e.fn(t[l],f,at),w+=c._.onRender?c._.onRender(u,f):u;else c=g?i:new k(b,_||"data",i,t,e,a,o,v),m&&((c.ctx=d({},b))[m]=at._cp(t,"#data",c)),c.tag=s,c._.nl=y,w+=e.fn(t,c,at);return s&&(c.tagElse=x.index,x.contentView=c),h?h(w,c):w}function B(e,t,n){var r=void 0!==n?Ye(n)?n.call(t.data,e,t):n||"":"{Error: "+(e.message||e)+"}";return ot.onError&&void 0!==(n=ot.onError.call(t.data,e,n&&r,t))&&(r=n),t&&!t._lc?nt.html(r):r}function L(e){throw new at.Err(e)}function R(e){L("Syntax error\n"+e)}function $(e,t,n,r,i){function a(t){t-=v,t&&_.push(e.substr(v,t).replace(mt,"\\n"))}function o(t,n){t&&(t+="}}",R((n?"{{"+n+"}} block has {{/"+t+" without {{"+t:"Unmatched or missing {{/"+t)+", in template:\n"+e))}function s(s,l,d,f,g,b,x,y,w,k,C,E){(x&&l||w&&!d||y&&":"===y.slice(-1)||k)&&R(s),b&&(g=":",f=Ot),w=w||n&&!i;var j,A,I,T=(l||n)&&[[]],V="",N="",P="",S="",M="",O="",F="",B="",L=!w&&!g;d=d||(y=y||"#data",g),a(E),v=E+s.length,x?u&&_.push(["*","\n"+y.replace(/^:/,"ret+= ").replace(bt,"$1")+";\n"]):d?("else"===d&&(wt.test(y)&&R('For "{{else if expr}}" use "{{else expr}}"'),T=m[9]&&[[]],m[10]=e.substring(m[10],E),A=m[11]||m[0]||R("Mismatched: "+s),m=h.pop(),_=m[2],L=!0),y&&K(y.replace(mt," "),T,t,n).replace(yt,function(e,t,n,r,i,a,o,s){return"this:"===r&&(a="undefined"),s&&(I=I||"@"===s[0]),r="'"+i+"':",o?(N+=n+a+",",S+="'"+s+"',"):n?(P+=r+"j._cp("+a+',"'+s+'",view),',O+=r+"'"+s+"',"):t?F+=a:("trigger"===i&&(B+=a),"lateRender"===i&&(j="false"!==s),V+=r+a+",",M+=r+"'"+s+"',",c=c||jt.test(i)),""}).slice(0,-1),T&&T[0]&&T.pop(),p=[d,f||!!r||c||"",L&&[],D(S||(":"===d?"'#data',":""),M,O),D(N||(":"===d?"data,":""),V,P),F,B,j,I,T||0],_.push(p),L&&(h.push(m),m=p,m[10]=v,m[11]=A)):C&&(o(C!==m[0]&&C!==m[11]&&C,m[0]),m[10]=e.substring(m[10],E),m=h.pop()),o(!m&&C),_=m[2]}var l,d,p,c,f,u=ot.allowCode||t&&t.allowCode||lt.allowCode===!0,g=[],v=0,h=[],_=g,m=[,,g];if(u&&t._is&&(t.allowCode=u),n&&(void 0!==r&&(e=e.slice(0,-r.length-2)+ct),e=dt+e+ft),o(h[0]&&h[0][2].pop()[0]),e.replace(ze,s),a(e.length),(v=g[g.length-1])&&o(""+v!==v&&+v[10]===v[10]&&v[0]),n){for(d=H(g,e,n),f=[],l=g.length;l--;)f.unshift(g[l][9]);U(d,f)}else d=H(g,t);return d}function U(e,t){var n,r,i=0,a=t.length;for(e.deps=[],e.paths=[];i<a;i++){e.paths.push(r=t[i]);for(n in r)"_jsvto"!==n&&r.hasOwnProperty(n)&&r[n].length&&!r[n].skp&&(e.deps=e.deps.concat(r[n]))}}function D(e,t,n){return[e.slice(0,-1),t.slice(0,-1),n.slice(0,-1)]}function q(e,t){return"\n\t"+(t?t+":{":"")+"args:["+e[0]+"],\n\tprops:{"+e[1]+"}"+(e[2]?",\n\tctx:{"+e[2]+"}":"")}function K(e,t,n,r){function i(i,p,b,x,y,w,k,C,E,j,A,I,T,V,N,P,S,M,O,F,B){function L(e,n,i,s,l,d,p,u){var g="."===i;if(i&&(y=y.slice(n.length),/^\.?constructor$/.test(u||y)&&R(e),g||(e=(j?(r?"":"(ltOb.lt=ltOb.lt||")+"(ob=":"")+(s?'view.ctxPrm("'+s+'")':l?"view":"data")+(j?")===undefined"+(r?"":")")+'?"":view._getOb(ob,"':"")+(u?(d?"."+d:s?"":l?"":"."+i)+(p||""):(u=s?"":l?d||"":i,"")),e+=u?"."+u:"",e=n+("view.data"===e.slice(0,9)?e.slice(5):e)+(j?(r?'"':'",ltOb')+(A?",1)":")"):"")),c)){if(q="_linkTo"===a?o=t._jsvto=t._jsvto||[]:f.bd,K=g&&q[q.length-1]){if(K._cpfn){for(;K.sb;)K=K.sb;K.bnd&&(y="^"+y.slice(1)),K.sb=y,K.bnd=K.bnd||"^"===y[0]}}else q.push(y);m[h]=F+(g?1:0)}return e}x&&!C&&(y=x+y),w=w||"",b=b||p||T,y=y||E,j&&(j=!/\)|]/.test(B[F-1]))&&(y=y.slice(1).split(".").join("^")),A=A||M||"";var U,D,q,K,H,J=")";if("["===A&&(A="[j._sq(",J=")]"),!k||d||l){if(c&&S&&!d&&!l&&h&&(U=m[h-1],B.length-1>F-(U||0))){if(U=B.slice(U,F+i.length),D!==!0)if(q=o||u[h-1].bd,K=q[q.length-1],K&&K.prm){for(;K.sb&&K.sb.prm;)K=K.sb;H=K.sb={path:K.sb,bnd:K.bnd}}else q.push(H={path:q.pop()});S=pt+":"+U+" onerror=''"+ct,D=v[S],D||(v[S]=!0,v[S]=D=$(S,n,!0)),D!==!0&&H&&(H._cpfn=D,H.prm=f.bd,H.bnd=H.bnd||H.path&&H.path.indexOf("^")>=0)}return d?(d=!V,d?i:T+'"'):l?(l=!N,l?i:T+'"'):(b?(m[h]=F++,f=u[++h]={bd:[]},b):"")+(O?h?"":(g=B.slice(g,F),(a?(a=s=o=!1,"\b"):"\b,")+g+(g=F+i.length,c&&t.push(f.bd=[]),"\b")):C?(h&&R(e),c&&t.pop(),a="_"+y,s=x,g=F+i.length,c&&(c=f.bd=t[a]=[],c.skp=!x),y+":"):y?y.split("^").join(".").replace(at.rPath,L)+(A?(f=u[++h]={bd:[]},_[h]=J,A):w):w?w:P?(P=_[h]||P,_[h]=!1,f=u[--h],P+(A?(f=u[++h],_[h]=J,A):"")):I?(_[h]||R(e),","):p?"":(d=V,l=N,'"'))}R(e)}var a,o,s,l,d,p,c=t&&t[0],f={bd:c},u={0:f},g=0,v=(n?n.links:c&&(c.links=c.links||{}))||Qe.tmpl.links,h=0,_={},m={};return"@"===e[0]&&(e=e.replace(Nt,".")),p=(e+(n?" ":"")).replace(at.rPrm,i),!h&&p||R(e)}function H(e,t,n){var r,i,a,o,s,l,d,p,c,f,u,g,v,h,_,m,b,x,y,w,k,C,E,j,A,I,T,V,P,S,M,O,F,B=0,L=st.useViews||t.useViews||t.tags||t.templates||t.helpers||t.converters,$="",D={},K=e.length;for(""+t===t?(x=n?'data-link="'+t.replace(mt," ").slice(1,-1)+'"':t,t=0):(x=t.tmplName||"unnamed",t.allowCode&&(D.allowCode=!0),t.debug&&(D.debug=!0),u=t.bnds,b=t.tmpls),r=0;r<K;r++)if(i=e[r],""+i===i)$+='\n+"'+i+'"';else if(a=i[0],"*"===a)$+=";\n"+i[1]+"\nret=ret";else{if(o=i[1],k=!n&&i[2],s=q(i[3],"params")+"},"+q(v=i[4]),S=i[6],M=i[7],i[8]?(O="\nvar ob,ltOb={},ctxs=",F=";\nctxs.lt=ltOb.lt;\nreturn ctxs;"):(O="\nreturn ",F=""),C=i[10]&&i[10].replace(bt,"$1"),(A="else"===a)?g&&g.push(i[9]):(V=i[5]||ot.debugMode!==!1&&"undefined",u&&(g=i[9])&&(g=[g],B=u.push(1))),L=L||v[1]||v[2]||g||/view.(?!index)/.test(v[0]),(I=":"===a)?o&&(a=o===Ot?">":o+a):(k&&(y=N(C,D),y.tmplName=x+"/"+a,y.useViews=y.useViews||L,H(k,y),L=y.useViews,b.push(y)),A||(w=a,L=L||a&&(!it[a]||!it[a].flow),j=$,$=""),E=e[r+1],E=E&&"else"===E[0]),P=V?";\ntry{\nret+=":"\n+",h="",_="",I&&(g||S||o&&o!==Ot||M)){if(T=new Function("data,view,j,u","// "+x+" "+ ++B+" "+a+O+"{"+s+"};"+F),T._er=V,T._tag=a,T._bd=!!g,T._lr=M,n)return T;U(T,g),m='c("'+o+'",view,',f=!0,h=m+B+",",_=")"}if($+=I?(n?(V?"try{\n":"")+"return ":P)+(f?(f=void 0,L=c=!0,m+(T?(u[B-1]=T,B):"{"+s+"}")+")"):">"===a?(d=!0,"h("+v[0]+")"):(p=!0,"((v="+v[0]+")!=null?v:"+(n?"null)":'"")'))):(l=!0,"\n{view:view,content:false,tmpl:"+(k?b.length:"false")+","+s+"},"),w&&!E){if($="["+$.slice(0,-1)+"]",m='t("'+w+'",view,this,',n||g){if($=new Function("data,view,j,u"," // "+x+" "+B+" "+w+O+$+F),$._er=V,$._tag=w,g&&U(u[B-1]=$,g),$._lr=M,n)return $;h=m+B+",undefined,",_=")"}$=j+P+m+(g&&B||$)+")",g=0,w=0}V&&!E&&(L=!0,$+=";\n}catch(e){ret"+(n?"urn ":"+=")+h+"j._err(e,view,"+V+")"+_+";}"+(n?"":"ret=ret"))}$="// "+x+(D.debug?"\ndebugger;":"")+"\nvar v"+(l?",t=j._tag":"")+(c?",c=j._cnvt":"")+(d?",h=j._html":"")+(n?(i[8]?", ob":"")+";\n":',ret=""')+$+(n?"\n":";\nreturn ret;");try{$=new Function("data,view,j,u",$)}catch(J){R("Compiled template code:\n\n"+$+'\n: "'+(J.message||J)+'"')}return t&&(t.fn=$,t.useViews=!!L),$}function J(e,t){return e&&e!==t?t?d(d({},t),e):e:t&&d({},t)}function z(e,n){var r,i,a=n.map,o=a&&a.propsArr;if(!o){if(o=[],typeof e===Ft||Ye(e))for(r in e)i=e[r],r===Ge||!e.hasOwnProperty(r)||n.props.noFunctions&&t.isFunction(i)||o.push({key:r,prop:i});a&&(a.propsArr=a.options&&o)}return Q(o,n)}function Q(e,n){var r,i,a,o=n.tag,s=n.props,l=n.params.props,d=s.filter,p=s.sort,c=p===!0,f=parseInt(s.step),u=s.reverse?-1:1;if(!et(e))return e;if(c||p&&""+p===p?(r=e.map(function(e,t){return e=c?e:g(e,p),{i:t,v:""+e===e?e.toLowerCase():e}}),r.sort(function(e,t){return e.v>t.v?u:e.v<t.v?-u:0}),e=r.map(function(t){return e[t.i]})):(p||u<0)&&!o.dataMap&&(e=e.slice()),Ye(p)&&(e=e.sort(function(){return p.apply(n,arguments)})),u<0&&(!p||Ye(p))&&(e=e.reverse()),e.filter&&d&&(e=e.filter(d,n),n.tag.onFilter&&n.tag.onFilter(n)),l.sorted&&(r=p||u<0?e:e.slice(),o.sorted?t.observable(o.sorted).refresh(r):n.map.sorted=r),i=s.start,a=s.end,(l.start&&void 0===i||l.end&&void 0===a)&&(i=a=0),isNaN(i)&&isNaN(a)||(i=+i||0,a=void 0===a||a>e.length?e.length:+a,e=e.slice(i,a)),f>1){for(i=0,a=e.length,r=[];i<a;i+=f)r.push(e[i]);e=r}return l.paged&&o.paged&&Ze(o.paged).refresh(e),e}function W(e,n,r){var i=this.jquery&&(this[0]||L("Unknown template")),a=i.getAttribute(Bt);return O.call(a&&t.data(i)[Lt]||tt(i),e,n,r)}function X(e){return St[e]||(St[e]="&#"+e.charCodeAt(0)+";")}function Z(e,t){return Mt[t]||""}function G(e){return void 0!=e?Et.test(e)&&(""+e).replace(It,X)||e:""}function Y(e){return""+e===e?e.replace(Tt,X):e}function ee(e){return""+e===e?e.replace(Vt,Z):e}function te(e,t,n,r,i){var a,o,s,l,d,p,c,f,u,g,v,h,_,m,b,x,y,w,k,C;if(r&&r._tgId&&(w=r,r=w._tgId,w.bindTo||(Ie(lr[r],w),w.bindTo=[0])),(p=lr[r])&&(v=p.to))for(v=v[t||0],a=p.linkCtx,u=a.elem,d=a.view,w=a.tag,!w&&v._cxp&&(w=v._cxp.path!==_t&&v._cxp.tag,c=e[0],e=[],e[v._cxp.ind]=c),w&&(w._.chg=1,(s=w.convertBack)&&(o=Ye(s)?s:d.getRsc("converters",s))),"SELECT"===u.nodeName?(u.multiple&&null===e[0]&&(e=[[]]),u._jsvSel=e):u._jsvSel&&(k=u._jsvSel,C=yr(u.value,k),C>-1&&!u.checked?k.splice(C,1):C<0&&u.checked&&k.push(u.value),e=[k.slice()]),f=e,o&&(e=o.apply(w,e),void 0===e&&(v=[]),e=et(e)?e:[e]),x=v.length;x--;)if((h=v[x])&&(h=h+""===h?[a.data,h]:h,l=h[0],_=h.tag,c=(l&&l._ocp&&!l._vw?f:e)[x],!(void 0===c||w&&w.onBeforeUpdateVal&&w.onBeforeUpdateVal(i,{change:"change",data:l,path:h[1],index:x,tagElse:t,value:c})===!1)))if(_)void 0!==(y=_._.toIndex[h.ind])&&_.updateValue(c,y,h.tagElse,void 0,void 0,i),_.setValue(c,h.ind,h.tagElse);else if(void 0!==c&&l){if((_=i&&(g=i.target)._jsvInd===x&&g._jsvLkEl)&&void 0!==(y=_._.fromIndex[x])&&_.setValue(f[x],y,g._jsvElse),l._cpfn)for(b=a._ctxCb,m=l,l=a.data,m._cpCtx&&(l=m.data,b=m._cpCtx);m&&m.sb;)l=b(m,l),m=m.sb;Ze(l,n).setProperty(h[1],c)}if(w)return w._.chg=void 0,w}function ne(e){var n,r,i=e.target,a=le(i),o=Zn[a];if(!i._jsvTr||e.delegateTarget!==wn&&"number"!==e.target.type||"input"===e.type){for(r=Ye(a)?a(i):(i=t(i),o?i[o]():i.attr(a)),e.target._jsvChg=1,mr.lastIndex=0;n=mr.exec(e.target._jsvBnd);)Le(r,i._jsvInd,i._jsvElse,void 0,n[1],e);e.target._jsvChg=void 0}}function re(e,t){var n,r,i,a,o,s,l,d,p,c=this,f=c.fn,u=c.tag,g=c.data,v=c.elem,h=c.convert,_=v.parentNode,m=c.view,b=m._lc,x=t&&Oe(m,On,u);if(_&&(!x||x.call(u||c,e,t)!==!1)&&(!t||"*"===e.data.prop||e.data.prop===t.path)){if(m._lc=c,t&&(c.eventArgs=t),t||c._toLk){if(c._toLk=0,f._er)try{r=f(g,m,at)}catch(y){o=f._er,s=B(y,m,new Function("data,view","return "+o+";")(g,m)),r=[{props:{},args:[s],tag:u}]}else r=f(g,m,at);if(n=u&&u.attr||c.attr||(c._dfAt=le(v,!0,void 0!==h)),n===Kn&&(u&&u.parentElem||c.elem).type===Rn&&(n=Ln),u){if(a=o||u._er,r=r[0]?r:[r],i=!a&&(u.onUpdate===!1||t&&Ye(u.onUpdate)&&u.onUpdate(e,t,r)===!1),Ve(u,r,a),u._.chg&&(n===Ot||n===Kn)||i||n===qn)return Ce(u,e,t),u._.chg||ce(c,g,v),m._lc=b,t&&(x=Oe(m,Fn,u))&&x.call(u||c,e,t),void(u.tagCtx.props.dataMap&&u.tagCtx.props.dataMap.map(u.tagCtx.args[0],u.tagCtx,u.tagCtx.map,vt||!u._.bnd));for(u.onUnbind&&u.onUnbind(u.tagCtx,c,u.ctx,e,t),u.linkedElems=u.linkedElem=u.mainElem=u.displayElem=void 0,p=u.tagCtxs.length;p--;)d=u.tagCtxs[p],d.linkedElems=d.mainElem=d.displayElem=void 0;r=":"===u.tagName?at._cnvt(u.convert,m,r[0]):at._tag(u,m,m.tmpl,r,!0,s)}else f._tag&&(h=""===h?Jn:h,r=h?at._cnvt(h,m,r[0]||r):at._tag(f._tag,m,m.tmpl,r,!0,s),$e(u=c.tag),n=c.attr||n);(l=u&&(!u.inline||c.fn._lr)&&u.template)&&ce(c,g,v),ae(r,c,n,u),c._noUpd=0,u&&(u._er=o,Ce(u,e,t))}l||ce(c,g,v),u&&u._.ths&&u.updateValue(u,u.bindTo?u.bindTo.length:1),t&&(x=Oe(m,Fn,u))&&x.call(u||c,e,t),m._lc=b}}function ie(e,t){e._df=t,e[(t?"set":"remove")+"Attribute"](Wn,"")}function ae(n,r,i,a){var o,s,l,d,p,c,f,u,g,v,h,_,m,b,x=!(i===qn||void 0===n||r._noUpd||(i===Kn||i===Ot)&&!a&&r.elem._jsvChg),y=r.data,w=a&&a.parentElem||r.elem,k=w.parentNode,C=t(w),E=r.view,j=r._val,A=a;return a&&(a._.unlinked=!0,a.parentElem=a.parentElem||r.expr||a._elCnt?w:k,s=a._prv,l=a._nxt),x?("visible"===i&&(i="css-display"),/^css-/.test(i)?("visible"===r.attr&&(m=(w.currentStyle||xr.call(e,w,"")).display,n?(n=w._jsvd||m,n!==qn||(n=sr[_=w.nodeName])||(h=document.createElement(_),document.body.appendChild(h),n=sr[_]=(h.currentStyle||xr.call(e,h,"")).display,document.body.removeChild(h))):(w._jsvd=m,n=qn)),(A=A||j!==n)&&t.style(w,i.slice(4),n)):"link"!==i&&(/^data-/.test(i)?t.data(w,i.slice(5),n):/^prop-/.test(i)?(c=!0,i=i.slice(5)):i===Ln?(c=!0,w.name&&et(n)?(w._jsvSel=n,n=yr(w.value,n)>-1):n=n&&"false"!==n):i===$n?(c=!0,i=Ln,n=w.value===n):"selected"===i||"disabled"===i||"multiple"===i||"readonly"===i?n=n&&"false"!==n?i:null:i===Kn&&"SELECT"===w.nodeName&&(w._jsvSel=et(n)?n:""+n),(o=Zn[i])?i===Ot?a&&a.inline?(p=a.nodes(!0),a._elCnt&&(s&&s!==l?Fe(s,l,w,a._tgId,"^",!0):(f=s?s.getAttribute(Sn):w._df,u=a._tgId+"^",g=f.indexOf("#"+u)+1,v=f.indexOf("/"+u),g&&v>0&&(g+=u.length,v>g&&(Be(f.slice(g,v)),f=f.slice(0,g)+f.slice(v),s?s.setAttribute(Sn,f):w._df&&ie(w,f)))),s=s?s.previousSibling:l?l.previousSibling:w.lastChild),t(p).remove(),d=E.link(E.data,w,s,l,n,a&&{tag:a._tgId})):(x=x&&j!==n,x&&(C.empty(),d=E.link(y,w,s,l,n,a&&{tag:a._tgId}))):((A=A||j!==n)&&("text"===i&&w.children&&!w.children[0]?w[Pn]=null===n?"":n:C[o](n)),!(b=k._jsvSel)||i!==Kn&&C.attr(Kn)||(w.selected=yr(""+n,et(b)?b:[b])>-1)):(A=A||j!==n)&&C[c?"prop":"attr"](i,void 0!==n||c?n:null)),r._val=n,fe(d),A):void(r._val=n)}function oe(e,t){var n=this,r=Oe(n,On,n.tag),i=Oe(n,Fn,n.tag);if(!r||r.call(n,e,t)!==!1){if(t){var a=t.change,o=t.index,s=t.items;switch(n._.srt=t.refresh,a){case"insert":n.addViews(o,s,t._dly);break;case"remove":n.removeViews(o,s.length,void 0,t._dly);break;case"move":n.moveViews(t.oldIndex,o,s.length);break;case"refresh":n._.srt=void 0,n.fixIndex(0)}}i&&i.call(n,e,t)}}function se(e){var n,r,i=e.type,a=e.data,o=e._.bnd;!e._.useKey&&o&&((r=e._.bndArr)&&(t([r[1]]).off(Gt,r[0]),e._.bndArr=void 0),o!==!!o?i?o._.arrVws[e._.id]=e:delete o._.arrVws[e._.id]:i&&a&&(n=function(t){t.data&&t.data.off||oe.apply(e,arguments)},t([a]).on(Gt,n),e._.bndArr=[n,a]))}function le(e,t,n){var r=e.nodeName.toLowerCase(),i=st._fe[r]||e.contentEditable===Jn&&{to:Ot,from:Ot};return i?t?"input"===r&&e.type===$n?$n:i.to:i.from:t?n?"text":Ot:""}function de(e,n,r,i,a,o,s){var l,d,p,c,f,u=e.parentElem,g=e._prv,v=e._nxt,h=e._elCnt;if(g&&g.parentNode!==u&&L("Missing parentNode"),s){c=e.nodes(),h&&g&&g!==v&&Fe(g,v,u,e._.id,"_",!0),e.removeViews(void 0,void 0,!0),d=v,h&&(g=g?g.previousSibling:v?v.previousSibling:u.lastChild),t(c).remove();for(f in e._.bnds)Pe(f)}else{if(n){if(p=i[n-1],!p)return!1;g=p._nxt}h?(d=g,g=d?d.previousSibling:u.lastChild):d=g.nextSibling}l=r.render(a,o,e._.useKey&&s,e,s||n,!0),fe(e.link(a,u,g,d,l,p))}function pe(e,t,n){var r,i;return n?(i="^`",$e(n),r=n._tgId,r||(lr[r=dr++]=n,n._tgId=""+r)):(i="_`",In[r=t._.id]=t),"#"+r+i+(void 0!=e?e:"")+"/"+r+i}function ce(e,t,n){var r,i,a,o,s,l,p,c,f,u,g,v,h=e.tag,_=!h,m=e.convertBack,b=e._hdl;if(t="object"==typeof t&&t,h&&((f=h.convert)&&(f=f===Jn?h.tagCtx.props.convert:f,f=e.view.getRsc("converters",f)||f,f=f&&f.depends,f=f&&at._dp(f,t,b)),(u=h.tagCtx.props.depends||h.depends)&&(u=at._dp(u,h,b),f=f?f.concat(u):u),v=h.linkedElems),f=f||[],!e._depends||""+e._depends!=""+f){if(s=e.fn.deps.slice(),e._depends&&(g=e._depends.bdId,Ze._apply(1,[t],s,e._depends,b,e._ctxCb,!0)),h){for(i=h.boundProps.length;i--;)for(p=h.boundProps[i],a=h._.bnd.paths.length;a--;)c=h._.bnd.paths[a]["_"+p],c&&c.length&&c.skp&&(s=s.concat(c));_=void 0===h.onArrayChange||h.onArrayChange===!0}for(i=s.length;i--;)l=s[i],l._cpfn&&(s[i]=d({},l));if(r=Ze._apply(_?0:1,[t],s,f,b,e._ctxCb),g||(g=e._bndId||""+dr++,e._bndId=void 0,n._jsvBnd=(n._jsvBnd||"")+"&"+g,e.view._.bnds[g]=g),r.elem=n,r.linkCtx=e,r._tgId=g,f.bdId=g,e._depends=f,lr[g]=r,(v||void 0!==m||h&&h.bindTo)&&Ie(r,h,m),v)for(i=v.length;i--;)for(o=v[i],a=o&&o.length;a--;)o[a]._jsvLkEl=h,Ae(h,o[a]),o[a]._jsvBnd="&"+g+"+";else void 0!==m&&Ae(h,n);h&&!h.inline&&(h.flow||n.setAttribute(Sn,(n.getAttribute(Sn)||"")+"#"+g+"^/"+g+"^"),h._tgId=""+g)}}function fe(e){var t;if(e)for(;t=e.pop();)t._hdl()}function ue(e,t,n,r,i,a,o){return ge(this,e,t,n,r,i,a,o)}function ge(e,n,r,i,a,o,s,l){if(i===!0?(a=i,i=void 0):i="object"!=typeof i?void 0:d({},i),e&&n){n=n.jquery?n:t(n),wn||(wn=document.body,Vn="oninput"in wn,t(wn).on(Mn,ne).on("blur.jsv","[contenteditable]",ne));for(var p,c,f,u,g,v,h,_,m,b,x=pe,y=i&&"replace"===i.target,w=n.length;w--;){if(h=n[w],b=o||Cn(h),""+e===e)he(m=[],e,h,b,void 0,"expr",r,i);else{if(void 0!==e.markup)y&&(v=h.parentNode),b._.scp=!0,f=e.render(r,i,a,b,void 0,x,!0),b._.scp=void 0,v?(s=h.previousSibling,l=h.nextSibling,t.cleanData([h],!0),v.removeChild(h),h=v):(s=l=void 0,t(h).empty());else{if(e!==!0||b!==Qe)break;_={lnk:"top"}}if(h._df&&!l){for(u=xe(h._df,!0,fr),p=0,c=u.length;p<c;p++)g=u[p],(g=In[g.id])&&void 0!==g.data&&g.parent.removeViews(g._.key,void 0,!0);ie(h)}m=b.link(r,h,s,l,f,_,i)}fe(m)}}return n}function ve(e,n,r,i,a,o,s,l){function d(e,t,n,r,i,o,s,l,d,p,c,f,g,h){var _,m,b="";return h?(u=0,e):(v=(d||p||"").toLowerCase(),r=r||c,n=n||g,q&&!n&&(!e||r||v||o&&!u)&&(q=void 0,D=de.shift()),r=r||n,r&&(r=r.toLowerCase(),u=0,q=void 0,M&&(n||g?or[D]||/;svg;|;math;/.test(";"+de.join(";")+";")||(_="'<"+D+".../"):or[r]?_="'</"+r:de.length&&r===D||(_="Mismatch: '</"+r),_&&R(_+">' in:\n"+a)),Q=z,D=de.shift(),z=ir[D],c=c?"</"+c+">":"",Q&&(ae+=X,X="",z?ae+="-":(b=c+Qn+"@"+ae+zn+(f||""),ae=ce.shift()))),z&&!u?(o?X+=o:t=c||g||"",v&&(t+=v,X&&(t+=" "+Sn+'="'+X+'"',X=""))):t=o?t+b+i+(u?"":Qn+o+zn)+l+v:b||e,M&&s&&(u&&R("{^{ within elem markup ("+u+' ). Use data-link="..."'),"#"===o.charAt(0)?de.unshift(o.slice(1)):o.slice(1)!==(m=de.shift())&&R("Closing tag for {^{...}} under different elem: <"+m+">")),v&&(u=v,de.unshift(D),D=v.slice(1),M&&de[0]&&de[0]===ar[D]&&L("Parent of <tr> must be <tbody>"),q=or[D],(z=ir[D])&&!Q&&(ce.unshift(ae),ae=""),Q=z,ae&&z&&(ae+="+")),t)}function p(e,t){var r,i,a,o,s,l,d,p=[];if(e){for("@"===e._tkns.charAt(0)&&(t=y.previousSibling,y.parentNode.removeChild(y),y=void 0),b=e.length;b--;){if(k=e[b],a=k.ch,r=k.path)for(m=r.length-1;i=r.charAt(m--);)"+"===i?"-"===r.charAt(m)?(m--,t=t.previousSibling):t=t.parentNode:t=t.lastChild;"^"===a?(v=lr[s=k.id])&&(d=t&&(!y||y.parentNode!==t),y&&!d||(v.parentElem=t),k.elCnt&&d&&ie(t,(k.open?"#":"/")+s+a+(t._df||"")),p.push([d?null:y,k])):(w=In[s=k.id])&&(w.parentElem||(w.parentElem=t||y&&y.parentNode||n,w._.onRender=pe,w._.onArrayChange=oe,se(w)),o=w.parentElem,k.open?(w._elCnt=k.elCnt,t&&!y?ie(t,"#"+s+a+(t._df||"")):(w._prv||ie(o,me(o._df,"#"+s+a)),
    w._prv=y)):(!t||y&&y.parentNode===t?y&&(w._nxt||ie(o,me(o._df,"/"+s+a)),w._nxt=y):(ie(t,"/"+s+a+(t._df||"")),w._nxt=void 0),(l=Oe(w,Bn)||ue)&&l.call(w.ctx.tag,w)))}for(b=p.length;b--;)le.push(p[b])}return!e||e.elCnt}function c(e){var t,n,r;if(e)for(b=e.length,m=0;m<b;m++)if(k=e[m],v=lr[k.id],!v._is&&v.linkCtx&&(n=v=v.linkCtx.tag,r=v.tagName===P,!v.flow||r)){if(!N){for(t=1;n=n.parent;)t++;O=O||t}!N&&t!==O||P&&!r||V.push(v)}}function f(){var o,l,d="",f={},u=jn+(te?",["+Wn+"]":"");for(x=rr?n.querySelectorAll(u):t(u,n).get(),_=x.length,r&&r.innerHTML&&(E=rr?r.querySelectorAll(u):t(u,r).get(),r=E.length?E[E.length-1]:r),O=0,h=0;h<_;h++)if(y=x[h],r&&!G)G=y===r;else{if(i&&y===i){te&&(d+=be(y));break}if(y.parentNode)if(te){if(d+=be(y),y._df){for(o=h+1;o<_&&y.contains(x[o]);)o++;f[o-1]=y._df}f[h]&&(d+=f[h]||"")}else ee&&(k=xe(y,void 0,gr))&&(k=k[0])&&(Y=Y?k.id!==Y&&Y:k.open&&k.id),!Y&&ge(xe(y))&&y.getAttribute(En)&&le.push([y])}if(te&&(d+=n._df||"",(l=d.indexOf("#"+te.id)+1)&&(d=d.slice(l+te.id.length)),l=d.indexOf("/"+te.id),l+1&&(d=d.slice(0,l)),c(xe(d,void 0,hr))),void 0===a&&n.getAttribute(En)&&le.push([n]),ye(r,z),ye(i,z),!te)for(z&&ae+X&&(y=i,ae&&(i?p(xe(ae+"+",!0),i):p(xe(ae,!0),n)),p(xe(X,!0),n),i&&(d=i.getAttribute(Sn),(_=d.indexOf(Z)+1)&&(d=d.slice(_+Z.length-1)),i.setAttribute(Sn,X+d))),_=le.length,h=0;h<_;h++)y=le[h],C=y[1],y=y[0],C?(v=lr[C.id])&&((g=v.linkCtx)&&(v=g.tag,v.linkCtx=g),C.open?(y&&(v.parentElem=y.parentNode,v._prv=y),v._elCnt=C.elCnt,w=v.tagCtx.view,he(fe,void 0,v._prv,w,C.id)):(v._nxt=y,v._.unlinked&&!v._toLk&&(S=v.tagCtx,w=S.view,Ce(v)))):he(fe,y.getAttribute(En),y,Cn(y),void 0,ee,e,s)}var u,g,v,h,_,m,b,x,y,w,k,C,E,j,A,I,T,V,N,P,S,M,O,F,B,$,U,D,q,K,H,J,z,Q,W,X,Z,G,Y,ee,te,ne=this,re=ne._.id+"_",ae="",le=[],de=[],ce=[],fe=[],ue=Oe(ne,Bn),ge=p;if(o&&(o.tmpl?A="/"+o._.id+"_":(ee=o.lnk,o.tag&&(re=o.tag+"^",o=!0),(te=o.get)&&(ge=c,V=te.tags,N=te.deep,P=te.name)),o=o===!0),n=n?""+n===n?t(n)[0]:n.jquery?n[0]:n:ne.parentElem||document.body,M=!st.noValidate&&n.contentEditable!==Jn,D=n.tagName.toLowerCase(),z=!!ir[D],r=r&&we(r,z),i=i&&we(i,z)||null,void 0!=a){if(H=document.createElement("div"),K=H,Z=X="",W="http://www.w3.org/2000/svg"===n.namespaceURI?"svg_ns":(U=kt.exec(a))&&U[1]||"",z){for(T=i;T&&!(I=xe(T));)T=T.nextSibling;(J=I?I._tkns:n._df)&&(j=A||"",!o&&A||(j+="#"+re),m=J.indexOf(j),m+1&&(m+=j.length,Z=X=J.slice(0,m),J=J.slice(m),I?T.setAttribute(Sn,J):ie(n,J)))}if(q=void 0,a=(""+a).replace(cr,d),M&&de.length&&R("Mismatched '<"+D+"...>' in:\n"+a),l)return;for(nr.appendChild(H),W=An[W]||An.div,F=W[0],K.innerHTML=W[1]+a+W[2];F--;)K=K.lastChild;for(nr.removeChild(H),B=document.createDocumentFragment();$=K.firstChild;)B.appendChild($);n.insertBefore(B,i)}return f(),fe}function he(e,t,n,r,i,a,o,s){var l,d,p,c,f,u,g,v,h,_,m,b=[];if(i)v=lr[i],v=v.linkCtx?v.linkCtx.tag:v,g=v.linkCtx||{type:"inline",data:r.data,elem:v._elCnt?v.parentElem:n,view:r,ctx:r.ctx,attr:Ot,fn:v._.bnd,tag:v,_bndId:i},v.linkCtx=g,_e(g,e),v._toLk=g._bndId;else if(t&&n){for(o=a?o:r.data,l=r.tmpl,t=ke(t,le(n)),m=kn.lastIndex=0;d=kn.exec(t);)b.push(d),m=kn.lastIndex;for(m<t.length&&R(t);d=b.shift();){for(h=kn.lastIndex,p=d[1],f=d[3];b[0]&&"else"===b[0][4];)f+=ft+dt+b.shift()[3],_=!0;_&&(f+=ft+dt+pt+"/"+d[4]+ct),g={type:a||"link",data:o,elem:n,view:r,ctx:s,attr:p,_toLk:1,_noUpd:d[2]},c=void 0,d[6]&&(c=d[10]||void 0,g.convert=d[5]||"",void 0!==c&&le(n)&&(p&&R(f+"- Remove target: "+p),g.convertBack=c=c.slice(1))),g.expr=p+f,u=l.links[f],u||(l.links[f]=u=at.tmplFn(f.replace(xt,"\\$&"),l,!0,c,_)),g.fn=u,_e(g,e),kn.lastIndex=h}}}function _e(e,n){function r(t,n){n&&n.refresh||re.call(e,t,n)}var i,a=e.type;if("top"!==a&&"expr"!==a||(e.view=new at.View(at.extendCtx(e.ctx,e.view.ctx),"link",e.view,e.data,e.expr,(void 0),pe)),e._ctxCb=at._gccb(i=e.view),e._hdl=r,"SELECT"===e.elem.nodeName&&"link"===a&&!e.attr){var o=t(e.elem);o.on("jsv-domchange",function(){if(!arguments[3].refresh){var t=e.fn(i.data,i,at);o.val(e.convert||e.convertBack?at._cnvt(e.convert,i,t):t)}})}e.fn._lr?(e._toLk=1,n.push(e)):r(!0)}function me(e,t){var n;return e?(n=e.indexOf(t),n+1?e.slice(0,n)+e.slice(n+t.length):e):""}function be(e){return e&&(""+e===e?e:e.tagName===Hn?e.type.slice(3):1===e.nodeType&&e.getAttribute(Sn)||"")}function xe(e,t,n){function r(e,t,n,r,a,s){o.push({elCnt:i,id:r,ch:a,open:t,close:n,path:s,token:e})}var i,a,o=[];if(a=t?e:be(e))return i=o.elCnt=e.tagName!==Hn,i="@"===a.charAt(0)||i,o._tkns=a,a.replace(n||_r,r),o}function ye(e,t){e&&("jsv"===e.type?e.parentNode.removeChild(e):t&&""===e.getAttribute(En)&&e.removeAttribute(En))}function we(e,t){for(var n=e;t&&n&&1!==n.nodeType;)n=n.previousSibling;return n&&(1!==n.nodeType?(n=document.createElement(Hn),n.type="jsv",e.parentNode.insertBefore(n,e)):be(n)||n.getAttribute(En)||n.setAttribute(En,"")),n}function ke(e,n){return e=t.trim(e),e.slice(-1)!==ct?e=pt+":"+e+(n?":":"")+ct:e}function Ce(e,n,r){function i(){a=w.linkedElems||e.linkedElems||e.linkedElem&&[e.linkedElem],a&&(e.linkedElems=w.linkedElems=a,e.linkedElem=a[0]=e.linkedElem||a[0]),(s=w.mainElem||e.mainElem)&&(w.mainElem=e.mainElem=s),(s=w.displayElem||e.displayElem)&&(w.displayElem=e.displayElem=s)}var a,o,s,l,d,p,c,f,u,g,v,h,_,m,b,x,y,w=e.tagCtx,k=e.tagCtxs,C=k&&k.length,E=e.linkCtx,j=e.bindTo||{};if(e._.unlinked){if(p=t(E.elem),e.linkedElement||e.mainElement||e.displayElement){if(o=e.linkedElement)for(e.linkedElem=void 0,l=o.length;l--;)if(o[l])for(c=!e.inline&&p.filter(o[l]),d=C;d--;)g=k[d],a=g.linkedElems=g.linkedElems||new Array(l),s=c[0]?c:g.contents(!0,o[l]),s[0]&&s[0].type!==$n&&(a[l]=s.eq(0));if(o=e.mainElement)for(c=!e.inline&&p.filter(o),d=C;d--;)g=k[d],s=c[0]?c:g.contents(!0,o).eq(0),s[0]&&(g.mainElem=s);if(o=e.displayElement)for(c=!e.inline&&p.filter(o),d=C;d--;)g=k[d],s=c[0]?c:g.contents(!0,o).eq(0),s[0]&&(g.displayElem=s);i()}e.onBind&&(e.onBind(w,E,e.ctx,n,r),i())}for(d=C;d--;){if(g=k[d],v=g.props,e._.unlinked&&g.map&&e.mapProps){for(b=e.mapProps.length,x=v.mapDepends||e.mapDepends||[],x=et(x)?x:[x];b--;){var A=e.mapProps[b];y=e._.bnd.paths[d]["_"+A],y&&y.length&&y.skp&&(x=x.concat(y))}x.length&&g.map.observe(x,E)}(s=g.mainElem||!e.mainElement&&g.linkedElems&&g.linkedElems[0])&&(s[0]&&v.id&&!s[0].id&&(s[0].id=v.id),e.setSize&&((h=!j.height&&v.height||e.height)&&s.height(h),(h=!j.width&&v.width||e.width)&&s.width(h))),(h=(s=g.displayElem||s)&&(!j["class"]&&v["class"]||e.className))&&(_=s[0]._jsvCl,h!==_&&(s.hasClass(_)&&s.removeClass(_),s.addClass(h),s[0]._jsvCl=h))}if(e.onAfterLink&&(e.onAfterLink(w,E,e.ctx,n,r),i()),!e.flow&&!e._.chg)for(e._tgId&&e._.unlinked&&(e.linkedElems||e.bindTo)&&Ie(lr[e._tgId],e),d=k.length;d--;){for(v=e.cvtArgs(d,1),l=v.length;l--;)h=v[l],e.setValue(h,l,d);if(e._.unlinked)for(w=k[d],a=w.linkedElems||!d&&e.linkedElem&&[e.linkedElem],m=(e.bindTo||[0]).length;m--;)if((s=a&&a[m])&&(l=s.length))for(;l--;)f=s[l],u=f._jsvLkEl,u&&u===e||(f._jsvLkEl=e,f._jsvInd=m,f._jsvElse=d,Ae(e,f),f._jsvBnd="&"+e._tgId+"+")}e._.unlinked=void 0,e._.lt&&e.refresh()}function Ee(e){var t=e.which;t>15&&t<21||t>32&&t<41||t>111&&t<131||27===t||144===t||setTimeout(function(){ne(e)})}function je(e,t,n){t!==!0||!Vn||Nn&&e[0].contentEditable===Jn?(t=""+t===t?t:"keydown.jsv",e[n](t,t.indexOf("keydown")>=0?Ee:ne)):e[n]("input.jsv",ne)}function Ae(e,n){var r,i,a=n._jsvTr||!1;e&&(i=e.tagCtx.props.trigger,void 0===i&&(i=e.trigger)),void 0===i&&(i=ot.trigger),i=i&&("INPUT"===n.tagName&&n.type!==Rn&&n.type!==$n||"textarea"===n.type||n.contentEditable===Jn)&&i||!1,a!==i&&(r=t(n),je(r,a,"off"),je(r,n._jsvTr=i,"on"))}function Ie(e,t,n){var r,i,a,o,s,l,d,p,c,f,u,g,v,h,_=1,m=[],b=e.linkCtx,x=b.data,y=b.fn.paths;if(e&&!e.to){for(t&&(t.convertBack||(t.convertBack=n),l=t.bindTo,_=t.tagCtxs?t.tagCtxs.length:1);_--;){if(v=[],g=y[_])for(l=g._jsvto?["jsvto"]:l||[0],!_&&t&&t._.ths&&(l=l.concat("this")),p=l.length;p--;){if(i="",u=b._ctxCb,d=l[p],d=g[+d===d?d:"_"+d],r=d&&d.length){if(a=d[r-1],a._cpfn){for(o=a;a.sb&&a.sb._cpfn;)i=a=a.sb;i=a.sb||i&&i.path,a=i?i.slice(1):o.path}s=i?[o,a]:Te(a,x,u)}else f=t.linkedCtxParam,s=[],h=t._.fromIndex,h&&f&&f[h[p]]&&(s=[t.tagCtxs[_].ctx[f[h[p]]][0],_t]);(c=s._cxp)&&c.tag&&a.indexOf(".")<0&&(s=c),v.unshift(s)}m.unshift(v)}e.to=m}}function Te(e,t,n){for(var r,i,a,o,s,l,d,p;e&&e!==_t&&(a=n(r=e.split("^").join("."),t))&&(o=a.length);){if(s=a[0]._cxp)if(d=d||s,l=a[0][0],_t in l?(p=l,l=l._vw):p=l.data,d.path=e=a[0][1],a=[d.data=p,e],n=at._gccb(l),e._cpfn){for(i=e,i.data=a[0],i._cpCtx=n;e.sb&&e.sb._cpfn;)r=e=e.sb;r=e.sb||r&&r.path,e=r?r.slice(1):i.path,a=[i,e]}else s.tag&&s.path===_t&&(a=s);else a=o>1?[a[o-2],a[o-1]]:[a[o-1]];t=a[0],e=a[1]}return a=a||[t,r],a._cxp=d,a}function Ve(e,t,n){var r,i,a=e.tagCtx.view,o=e.tagCtxs||[e.tagCtx],s=o.length,l=!t;if(l){if(t=e._.bnd.call(a.tmpl,(e.linkCtx||a).data,a,at),t.lt)return;e._.lt=void 0,t=et(t)?t:[t]}if(n)o=e.tagCtxs=t,e.tagCtx=o[0],$e(e);else for(;s--;)r=o[s],i=t[s],d(r.ctx,i.ctx),r.args=i.args,l&&(r.tmpl=i.tmpl),Ze(r.props).setProperty(i.props);return at._thp(e,o[0]),o}function Ne(e){for(var t,n,r,i=[],a=e.length,o=a;o--;)i.push(e[o]);for(o=a;o--;)if(n=i[o],n.parentNode){if(r=n._jsvBnd)for(r=r.slice(1).split("&"),n._jsvBnd="",t=r.length;t--;)Pe(r[t],n._jsvLkEl,n);Be(be(n)+(n._df||""),n)}}function Pe(e,n,r){var i,a,o,s,l,d,p,c,f,u,g,v,h,_,m=lr[e];if(n)r._jsvLkEl=void 0;else if(m&&(!r||r===m.elem)){delete lr[e];for(i in m.bnd)s=m.bnd[i],l=m.cbId,et(s)?t([s]).off(Gt+l).off(Zt+l):t(s).off(Zt+l),delete m.bnd[i];if(a=m.linkCtx){if(o=a.tag){if(d=o.tagCtxs)for(p=d.length;p--;)v=d[p],(c=v.map)&&c.unmap(),(h=v.linkedElems)&&(_=(_||[]).concat(h));o.onUnbind&&o.onUnbind(o.tagCtx,a,o.ctx),o.onDispose&&o.onDispose(),o._elCnt||(o._prv&&o._prv.parentNode.removeChild(o._prv),o._nxt&&o._nxt.parentNode.removeChild(o._nxt))}for(h=_||[t(a.elem)],p=h.length;p--;)f=h[p],(u=f&&f[0]&&f[0]._jsvTr)&&(je(f,u,"off"),f[0]._jsvTr=void 0);g=a.view,"link"===g.type?g.parent.removeViews(g._.key,void 0,!0):delete g._.bnds[e]}delete Yt[m.cbId]}}function Se(e){e?(e=e.jquery?e:t(e),e.each(function(){for(var e;(e=Cn(this,!0))&&e.parent;)e.parent.removeViews(e._.key,void 0,!0);Ne(this.getElementsByTagName("*"))}),Ne(e)):(wn&&(t(wn).off(Mn,ne).off("blur.jsv","[contenteditable]",ne),wn=void 0),Qe.removeViews(),Ne(document.body.getElementsByTagName("*")))}function Me(e){return e.type===Rn?e[Ln]:e.value}function Oe(e,t,n){return n&&n[t]||e.ctx[t]&&e.ctxPrm(t)||We.helpers[t]}function Fe(e,t,n,r,i,a){var o,s,l,d,p,c,f,u=0,g=e===t;if(e){for(l=xe(e)||[],o=0,s=l.length;o<s;o++){if(d=l[o],c=d.id,c===r&&d.ch===i){if(!a)break;s=0}g||(p="_"===d.ch?In[c]:lr[c].linkCtx.tag,p&&(d.open?p._prv=t:d.close&&(p._nxt=t))),u+=c.length+2}u&&e.setAttribute(Sn,e.getAttribute(Sn).slice(u)),f=t?t.getAttribute(Sn):n._df,(s=f.indexOf("/"+r+i)+1)&&(f=l._tkns.slice(0,u)+f.slice(s+(a?-1:r.length+1))),f&&(t?t.setAttribute(Sn,f):ie(n,f))}else ie(n,me(n._df,"#"+r+i)),a||t||ie(n,me(n._df,"/"+r+i))}function Be(e,t){var n,r,i,a;if(a=xe(e,!0,ur))for(n=0,r=a.length;n<r;n++)i=a[n],"_"===i.ch?!(i=In[i.id])||!i.type||t&&i._prv!==t&&i.parentElem!==t||i.parent.removeViews(i._.key,void 0,!0):Pe(i.id,void 0,t)}function Le(e,t,n,r,i,a){var o=this,s=[];return o&&o._tgId&&(i=o),arguments.length<4&&(+t!==t?(r=t,n=t=0):+n!==n&&(r=n,n=0)),s[t||0]=e,te(s,n,r,i,a),o}function Re(){for(var e=arguments.length;e--;)this.tag.setValue(arguments[e],e,this.index)}function $e(e){var n,r,i,a,o,s,l,d;if(e.contents=function(e,n){e!==!!e&&(n=e,e=void 0);var r,i=t(this.nodes());return i[0]&&(n=e?n||"*":n,r=n?i.filter(n):i,i=e?r.add(i.find(n)):r),i},e.nodes=function(e,t,n){var r,i=this.contentView||this,a=i._elCnt,o=!t&&a,s=[];if(!i.args)for(t=t||i._prv,n=n||i._nxt,r=o?t===i._nxt?i.parentElem.lastSibling:t:i.inline===!1?t||i.linkCtx.elem.firstChild:t&&t.nextSibling;r&&(!n||r!==n);)(e||a||r.tagName!==Hn)&&s.push(r),r=r.nextSibling;return s},e.childTags=function(e,t){e!==!!e&&(t=e,e=void 0);var n=this.contentView||this,r=n.link?n:n.tagCtx.view,i=n._prv,a=n._elCnt,o=[];return n.args||r.link(void 0,n.parentElem,a?i&&i.previousSibling:i,n._nxt,void 0,{get:{tags:o,deep:e,name:t,id:n.link?n._.id+"_":n._tgId+"^"}}),o},"tag"===e._is){for(l=e,r=l.tagCtxs.length;r--;)i=l.tagCtxs[r],i.setValues=Re,i.contents=e.contents,i.childTags=e.childTags,i.nodes=e.nodes;if(a=l.boundProps=l.boundProps||[],o=l.bindFrom)for(n=o.length;n--;)s=o[n],s+""===s&&(o[s]=1,yr(s,a)<0&&a.push(s));l.setValue=at._gm(l.constructor.prototype.setValue||function(e){return e},function(e,r,i){r=r||0,i=i||0;var a,o,s,d,p,c,f=l.tagCtxs[i],u=l.base.call(l,e,r,i);if(void 0!==u&&(e=u),void 0!==e&&(l.convert||void 0===l._.toIndex[r])&&(s=l.linkedCtxParam)&&s[r]&&(d=s[r])&&f.ctxPrm(d,e),p=l._.toIndex[r],void 0!==p&&(c=f.linkedElems||l.linkedElem&&[l.linkedElem])&&(a=c[p])&&(n=a.length))for(;n--;)o=a[n],void 0===e||o._jsvChg||l.linkCtx._val===e||(void 0!==o.value?o.type===Rn?o[Ln]=e&&"false"!==e:o.type===$n?o[Ln]=o.value===e:et(e)?o.value=e:t(o).val(e):o[o.contentEditable===Jn?"innerHTML":Pn]=e),f.props.name&&(o.name=o.name||f.props.name);return l}),l.updateValue=Le,l.updateValues=function(){var e,t,n=this,r=n.bindTo?n.bindTo.length:1,i=arguments.length-r;return i&&(e=arguments[r],i>1?t=i>1?arguments[r+1]:void 0:+e!==e&&(t=e,e=0)),te(arguments,e,t,this)},l.setValues=function(){return Re.apply(l.tagCtx,arguments),l},l.refresh=function(){var e,t,n=l.linkCtx,r=l.tagCtx.view;if(t=Ve(l))return l.onUnbind&&(l.onUnbind(l.tagCtx,n,l.ctx),l._.unlinked=!0),e=l.inline?Ot:n.attr||le(l.parentElem,!0),t=":"===l.tagName?at._cnvt(l.convert,r,l.tagCtx):at._tag(l,r,r.tmpl,t,!0),ce(n,n.data,n.elem),ae(t,n,e,l),Ce(l),l},l.domChange=function(){var e=this.parentElem,n=t._data(e).events,r="jsv-domchange";n&&n[r]&&t(e).triggerHandler(r,arguments)}}else d=e,d.addViews=function(e,t,n){var r,i=this,a=t.length,o=i.views;!i._.useKey&&a&&(r=o.length+a,!n&&r!==i.data.length||de(i,e,i.tmpl,o,t,i.ctx)===!1||i._.srt||i.fixIndex(e+a))},d.removeViews=function(e,n,r,i){function a(e){var n,i,a,o,s,l,d=c[e];if(d&&d.link){if(n=d._.id,r||(l=d.nodes()),d.removeViews(void 0,void 0,!0),d.type=void 0,o=d._prv,s=d._nxt,a=d.parentElem,r||(d._elCnt&&Fe(o,s,a,n,"_"),t(l).remove()),!d._elCnt)try{o.parentNode.removeChild(o),s.parentNode.removeChild(s)}catch(p){}se(d);for(i in d._.bnds)Pe(i);delete In[n]}}var o,s,l,d=this,p=!d._.useKey,c=d.views;if(p&&(l=c.length),void 0===e)if(p){for(o=l;o--;)a(o);d.views=[]}else{for(s in c)a(s);d.views={}}else if(void 0===n&&(p?n=1:(a(e),delete c[e])),p&&n&&(i||l-n===d.data.length)){for(o=e+n;o-- >e;)a(o);c.splice(e,n),d._.srt||d.fixIndex(e)}},d.moveViews=function(e,n,r){function i(e,t){return RegExp("^(.*)("+(t?"\\/":"#")+e._.id+"_.*)$").exec(t||e._prv.getAttribute(Sn))}function a(e,t){var n=e._prv;n.setAttribute(Sn,t),t.replace(vr,function(e,t,r,i){lr[i].linkCtx.tag[t?"_prv":"_nxt"]=n}),t.replace(gr,function(e,t,r,i){In[i][t?"_prv":"_nxt"]=n})}var o,s,l,d=this,p=d._nxt,c=d.views,f=n<e,u=f?n:e,g=f?e:n,v=n,h=[],_=c.splice(e,r);for(n>c.length&&(n=c.length),c.splice.apply(c,[n,0].concat(_)),r=_.length,l=n+r,g+=r,v;v<l;v++)s=c[v],o=s.nodes(!0),h=d._elCnt?h.concat(o):h.concat(s._prv,o,s._nxt);if(h=t(h),l<c.length?h.insertBefore(c[l]._prv):p?h.insertBefore(p):h.appendTo(d.parentElem),d._elCnt){var m,b=f?u+r:g-r,x=(c[u-1],c[u]),y=c[b],w=c[g],k=i(x),C=i(y);a(x,C[1]+k[2]),w?(m=i(w),a(w,k[1]+m[2])):(c[g-1]._nxt=p,p?(m=i(d,p.getAttribute(Sn)),p.setAttribute(Sn,k[1]+m[2])):(m=i(d,d.parentElem._df),ie(d.parentElem,k[1]+m[2]))),a(y,m[1]+C[2])}d.fixIndex(u)},d.refresh=function(){var e=this,t=e.parent;return t&&(de(e,e.index,e.tmpl,t.views,e.data,void 0,!0),se(e)),e},d.fixIndex=function(e){for(var t=this.views,n=t.length;e<n--;)t[n].index!==n&&Ze(t[n]).setProperty("index",n)},d.link=ve}function Ue(e,t,n){var r,i,a=e.options.props;if(qe(e.propsArr,n.path,n.value,n.remove),void 0!==a.sort||void 0!==a.start||void 0!==a.end||void 0!==a.step||a.filter||a.reverse)e.update();else if("set"===n.change){for(r=e.tgt,i=r.length;i--&&r[i].key!==n.path;);i===-1?n.path&&!n.remove&&Ze(r).insert({key:n.path,prop:n.value}):n.remove?Ze(r).remove(i):Ze(r[i]).setProperty("prop",n.value)}}function De(e,t,n){var r,i,a,o,s=e.src,l=n.change;if("set"===l)"prop"===n.path?Ze(s).setProperty(t.target.key,n.value):(Ze(s).removeProperty(n.oldValue),Ze(s).setProperty(n.value,t.target.prop));else if("insert"===l||(o="remove"===l))for(r=n.items,i=r.length;i--;)(a=r[i].key)&&(qe(e.propsArr,a,r[i].prop,o),o?(Ze(s).removeProperty(a),delete s[a]):Ze(s).setProperty(a,r[i].prop))}function qe(e,t,n,r){for(var i=e.length;i--&&e[i].key!==t;);i===-1?t&&!r&&e.push({key:t,prop:n}):r&&e.splice(i,1)}function Ke(e){return br.test(e)}var He=t===!1;if(t=t||e.jQuery,!t||!t.fn)throw"JsViews requires jQuery";var Je,ze,Qe,We,Xe,Ze,Ge,Ye,et,tt,nt,rt,it,at,ot,st,lt,dt,pt,ct,ft,ut,gt,vt,ht="v1.0.5",_t="_ocp",mt=/[ \t]*(\r\n|\n|\r)/g,bt=/\\(['"])/g,xt=/['"\\]/g,yt=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,wt=/^if\s/,kt=/<(\w+)[>\s]/,Ct=/[\x00`><"'&=]/g,Et=/[\x00`><\"'&=]/,jt=/^on[A-Z]|^convert(Back)?$/,At=/^\#\d+_`[\s\S]*\/\d+_`$/,It=Ct,Tt=/[&<>]/g,Vt=/&(amp|gt|lt);/g,Nt=/\[['"]?|['"]?\]/g,Pt=0,St={"&":"&amp;","<":"&lt;",">":"&gt;","\0":"&#0;","'":"&#39;",'"':"&#34;","`":"&#96;","=":"&#61;"},Mt={amp:"&",gt:">",lt:"<"},Ot="html",Ft="object",Bt="data-jsv-tmpl",Lt="jsvTmpl",Rt="For #index in nested block use #getIndex().",$t={},Ut=e.jsrender,Dt=Ut&&t&&!t.render,qt={template:{compile:A},tag:{compile:E},viewModel:{compile:V},helper:{},converter:{}};if(We={jsviews:ht,sub:{rPath:/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,rPrm:/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(~?[\w$.^]+)?\s*((\+\+|--)|\+|-|~(?![\w$])|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?(@)?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,View:k,Err:l,tmplFn:$,parse:K,extend:d,extendCtx:J,syntaxErr:R,onStore:{template:function(e,t){null===t?delete $t[e]:e&&($t[e]=t)}},addSetting:S,settings:{allowCode:!1},advSet:o,_thp:i,_gm:r,_tg:function(){},_cnvt:_,_tag:w,_er:L,_err:B,_cp:a,_sq:function(e){return"constructor"===e&&R(""),e}},settings:{delimiters:p,advanced:function(e){return e?(d(st,e),at.advSet(),lt):st}},map:M},(l.prototype=new Error).constructor=l,f.depends=function(){return[this.get("item"),"index"]},u.depends="index",k.prototype={get:c,getIndex:u,ctxPrm:v,getRsc:y,_getTmpl:h,_getOb:g,_is:"view"},at=We.sub,lt=We.settings,!(Ut||t&&t.render)){for(Je in qt)P(Je,qt[Je]);if(nt=We.converters,rt=We.helpers,it=We.tags,at._tg.prototype={baseApply:j,cvtArgs:m,bndArgs:x,ctxPrm:v},Qe=at.topView=new k,t){if(t.fn.render=W,Ge=t.expando,t.observable){if(ht!==(ht=t.views.jsviews))throw"JsObservable requires JsRender "+ht;d(at,t.views.sub),We.map=t.views.map}}else t={},He&&(e.jsrender=t),t.renderFile=t.__express=t.compile=function(){throw"Node.js: use npm jsrender, or jsrender-node.js"},t.isFunction=function(e){return"function"==typeof e},t.isArray=Array.isArray||function(e){return"[object Array]"==={}.toString.call(e)},at._jq=function(e){e!==t&&(d(e,t),t=e,t.fn.render=W,delete t.jsrender,Ge=t.expando)},t.jsrender=ht;ot=at.settings,ot.allowCode=!1,Ye=t.isFunction,t.render=$t,t.views=We,t.templates=tt=We.templates;for(gt in ot)S(gt);(lt.debugMode=function(e){return void 0===e?ot.debugMode:(ot.debugMode=e,ot.onError=e+""===e?function(){return e}:Ye(e)?e:void 0,lt)})(!1),st=ot.advanced={useViews:!1,_jsv:!1},it({"if":{render:function(e){var t=this,n=t.tagCtx,r=t.rendering.done||!e&&(n.args.length||!n.index)?"":(t.rendering.done=!0,void(t.selected=n.index));return r},contentCtx:!0,flow:!0},"for":{sortDataMap:M(Q),init:function(e,t){this.setDataMap(this.tagCtxs)},render:function(e){var t,n,r,i,a,o=this,s=o.tagCtx,l=s.argDefault===!1,d=s.props,p=l||s.args.length,c="",f=0;if(!o.rendering.done){if(t=p?e:s.view.data,l)for(l=d.reverse?"unshift":"push",i=+d.end,a=+d.step||1,t=[],r=+d.start||0;(i-r)*a>0;r+=a)t[l](r);void 0!==t&&(n=et(t),c+=s.render(t,!p||d.noIteration),f+=n?t.length:1),(o.rendering.done=f)&&(o.selected=s.index)}return c},setDataMap:function(e){for(var t,n,r,i=this,a=e.length;a--;)t=e[a],n=t.props,r=t.params.props,t.argDefault=void 0===n.end||t.args.length>0,n.dataMap=t.argDefault!==!1&&et(t.args[0])&&(r.sort||r.start||r.end||r.step||r.filter||r.reverse||n.sort||n.start||n.end||n.step||n.filter||n.reverse)&&i.sortDataMap},flow:!0},props:{baseTag:"for",dataMap:M(z),init:o,flow:!0},include:{flow:!0},"*":{render:a,flow:!0},":*":{render:a,flow:!0},dbg:rt.dbg=nt.dbg=s}),nt({html:G,attr:G,encode:Y,unencode:ee,url:function(e){return void 0!=e?encodeURI(""+e):null===e?e:""}})}if(ot=at.settings,et=(t||Ut).isArray,lt.delimiters("{{","}}","^"),Dt&&Ut.views.sub._jq(t),We=t.views,at=We.sub,Ye=t.isFunction,et=t.isArray,Ge=t.expando,!t.observe){var Kt=t.event.special,Ht=[].slice,Jt=[].splice,zt=[].concat,Qt=parseInt,Wt=/\S+/g,Xt=/^[^.[]*$/,Zt=at.propChng=at.propChng||"propertyChange",Gt=at.arrChng=at.arrChng||"arrayChange",Yt={},en=Zt+".observe",tn=1,nn=1,rn=1,an=t.data,on={},sn=[],ln=function(e){return e?e._cId=e._cId||".obs"+nn++:""},dn=function(e,t){return this._data=t,this._ns=e,this},pn=function(e,t){return this._data=t,this._ns=e,this},cn=function(e){return et(e)?[e]:e},fn=function(e,t,n){e=e?et(e)?e:[e]:[];var r,i,a,o,s=a=t,l=e&&e.length,d=[];for(r=0;r<l;r++)i=e[r],Ye(i)?(o=t.tagName?t.linkCtx.data:t,d=d.concat(fn(i.call(t,o,n),o,n))):""+i===i?(s!==a&&d.push(a=s),d.push(i)):(t=s=i=void 0===i?null:i,s!==a&&d.push(a=s));return d.length&&(d.unshift({_ar:1}),d.push({_ar:-1})),d},un=function(e,t){for(var n in e)return;delete Yt[t]},gn=function(e,t){function n(e){return typeof e===Ft&&(f[0]||!c&&et(e))}if(!e.data||!e.data.off){var r,i,a,o=t.oldValue,s=t.value,l=e.data,d=l.observeAll,p=l.cb,c=l._arOk?0:1,f=l.paths,u=l.ns;e.type===Gt?(p.array||p).call(l,e,t):l.prop!==t.path&&"*"!==l.prop||(d?(r=d._path+"."+t.path,i=d.filter,a=[e.target].concat(d.parents()),n(o)&&vn(void 0,u,[o],f,p,!0,i,[a],r),n(s)&&vn(void 0,u,[s],f,p,void 0,i,[a],r)):(n(o)&&vn(c,u,[o],f,p,!0),n(s)&&vn(c,u,[s],f,p)),l.cb(e,t))}},vn=function(){var e=zt.apply([],arguments);return Xe.apply(e.shift(),e)},hn=function(e,t,n){mn(this._ns,this._data,e,t,[],"root",n)},_n=function(e,t){hn.call(this,e,t,!0)},mn=function(e,n,r,i,a,o,s,l){function d(e,t){for(f=e.length,g=o+"[]";f--;)p(e,f,t,1)}function p(t,n,a,o){var s,d;+n!==n&&n===Ge||!(s=Ze._fltr(g,t[n],v,i))||(d=v.slice(),o&&h&&d[0]!==h&&d.unshift(h),mn(e,s,r,i||(o?void 0:0),d,g,a,l))}function c(e,t){switch(o=e.data.observeAll._path,h=e.target,t.change){case"insert":d(t.items);break;case"remove":d(t.items,!0);break;case"set":g=o+"."+t.path,p(t,"oldValue",!0),p(t,"value")}h=void 0,r.apply(this,arguments)}c._wrp=1;var f,u,g,v,h,_,m=!l||l.un||!s;if(n&&typeof n===Ft){if(v=[n].concat(a),u=et(n)?"":"*",l&&m&&t.hasData(n)&&l[_=an(n).obId])return void l[_]++;if(l||(l={un:s}),r){if(u||0!==i)if(c._cId=ln(r),m)Xe(e,n,u,c,s,i,v,o),_=an(n).obId,l[_]=(l[_]||0)+1;else{if(--l[an(n).obId])return;Xe(e,n,u,c,s,i,v,o)}}else l&&(l[an(n).obId]=1),Xe(e,n,u,void 0,s,i,v,o);if(u)for(f in n)g=o+"."+f,p(n,f,s);else d(n,s)}},bn=function(e){return Xt.test(e)},xn=function(){return[].push.call(arguments,!0),Xe.apply(void 0,arguments)},yn=function(e){var t,n=this.slice();for(this.length=0,this._go=0;t=n.shift();)t.skip||t[0]._trigger(t[1],t[2],!0);this.paths={}};Xe=function(){function e(){function i(e,t){var n;for(g in t)n=t[g],et(n)?o(e,n,p,p):a(e,n,void 0,I,"")}function a(e,i,a,o,s,l,d){var c,f,u,v=cn(i),h=b,m=x;if(o=n?o+"."+n:o,!p&&(d||l))for(j=t._data(i).events,j=j&&j[l?Gt:Zt],A=j&&j.length;A--;)if(g=j[A]&&j[A].data,g&&(d&&g.ns!==n||!d&&g.ns===n&&g.cb&&g.cb._cId===e._cId&&(!e._wrp||g.cb._wrp)))return;p||d?t(v).off(o,gn):(f=l?{}:{fullPath:a,paths:s?[s]:[],prop:E,_arOk:r},f.ns=n,f.cb=e,x&&(f.observeAll={_path:m,path:function(){return c=h.length,m.replace(/[[.]/g,function(e){return c--,"["===e?"["+t.inArray(h[c-1],h[c]):"."})},parents:function(){return h},filter:y}),t(v).on(o,null,f,gn),_&&(_[(u=an(i)).obId||(u.obId=tn++)]=i))}function o(e,t,n,i,o){if(r){var s,l=x;s=t,o&&(s=t[o],x+="."+o),y&&s&&(s=Ze._fltr(x,s,o?[t].concat(b):b,y)),s&&(i||et(s))&&a(e,s,void 0,Gt+".observe"+ln(e),void 0,!0,n),x=l}}function s(i){function l(i,c,f,u){function v(t){return t.ob=u(t,i),t.cb=function(n,a){var s=t.ob,l=t.sb,d=u(t,i);d!==s&&(typeof s===Ft&&(o(f,s,!0),(l||r&&et(s))&&e([s],l,f,u,!0)),t.ob=d,typeof d===Ft&&(o(f,d),(l||r&&et(d))&&e([d],l,f,u))),f(n,a)}}function _(e,i){function d(e,t){var n;if("insert"===t.change||(p="remove"===t.change)){for(n=t.items.length;n--;)_(t.items[n],i.slice());p=!1}}f&&(d._cId=ln(f));var c,v,h,m,b,k,C,T=e;if(e&&e._cxp)return l(e[0],[e[1]],f,u);for(;void 0!==(E=i.shift());){if(T&&typeof T===Ft&&""+E===E){if(""===E)continue;if("()"===E.slice(-2)&&(E=E.slice(0,-2),C=!0),i.length<w+1&&!T.nodeType){if(!p&&(j=t._data(T).events)){for(j=j&&j[Zt],A=j&&j.length,v=0;A--;)g=j[A].data,!g||g.ns!==n||g.cb._cId!==f._cId||g.cb._inId!==f._inId||!g._arOk!=!r||g.prop!==E&&"*"!==g.prop&&"**"!==g.prop||((b=i.join("."))&&g.paths.push(b),v++);if(v){T=T[E];continue}}if("*"===E||"**"===E){if(!p&&j&&j.length&&a(f,T,y,I,"",!1,!0),"*"===E){a(f,T,y,I,"");for(b in T)b!==Ge&&o(f,T,p,void 0,b)}else t.observable(n,T)[(p?"un":"")+"observeAll"](f);break}"[]"==E?et(T)&&(p?a(f,T,y,Gt+ln(f),void 0,p,p):Xe(n,T,d,p)):E&&a(f,T,y,I+".p_"+E,i.join("^"))}if(x&&(x+="."+E),"[]"===E){for(et(T)&&(m=T,c=T.length);c--;)T=m[c],_(T,i.slice());return}E=T[E],i[0]||o(f,E,p)}if(Ye(E)&&(k=E,(h=k.depends)&&(T._vw&&T._ocp&&(T=T._vw,T._tgId&&(T=T.tagCtx.view),T=T.data),s(zt.apply([],[[T],fn(h,T,f)]))),C)){if(!i[0]){o(f,k.call(T),p);break}if(E=k.call(T),!E)break}T=E}}var b,y,w=0,k=c.length;for(!i||u||!(C="view"===i._is)&&"tag"!==i._is||(u=at._gccb(C?i:i.tagCtx.contentView),f&&!p&&!function(){var e=i,t=f;f=function(n,r){t.call(e,n,r)},f._cId=t._cId,f._inId=t._inId}(),i=C?i.data:i),c[0]||(et(i)?o(f,i,p,!0):p&&a(f,i,void 0,I,"")),b=0;b<k;b++)if(y=c[b],""!==y)if(y&&y._ar)r+=y._ar;else if(""+y===y)if(d=y.split("^"),d[1]&&(w=d[0].split(".").length,y=d.join("."),w=y.split(".").length-w),u&&(h=u(y,i,w))){if(h.length){var T=h[0],V=h[1];if(T&&T._cxp&&(V=T[1],T=T[0],"view"===T._is)){l(T,[V],f);continue}V+""===V?_(T,V.split(".")):l(h.shift(),h,f,u)}}else _(i,y.split("."));else!Ye(y)&&y&&y._cpfn&&(m=p?y.cb:v(y),m._cId=f._cId,m._inId=m._inId||".obIn"+rn++,(y.bnd||y.prm&&y.prm.length||!y.sb)&&e([i],y.path,y.prm.length?[y.root||i]:[],y.prm,m,u,p),y.sb&&(y.sb.prm&&(y.sb.root=i),l(y.ob,[y.sb],f,u)))}for(var f,u=[],_=i.length;_--;)f=i[_],f+""===f||f&&(f._ar||f._cpfn)?u.unshift(f):(l(f,u,c,v),u=[])}var l,d,p,c,f,u,g,v,h,_,m,b,x,y,w,k,C,E,j,A,I=en,T=1!=this?zt.apply([],arguments):Ht.call(arguments),V=T.pop()||!1,N=T.length;if(V+""===V&&(x=V,b=T.pop(),y=T.pop(),V=!!T.pop(),N-=3),V===!!V&&(p=V,V=T[N-1],V=!N||V+""===V||V&&!Ye(V)?void 0:(N--,T.pop()),p&&!N&&Ye(T[0])&&(V=T.shift())),c=V,N&&Ye(T[N-1])&&(v=c,V=c=T.pop(),N--),!p||!c||c._cId){for(I+=c?(u=c._inId||"",p?c._cId+u:(f=ln(c))+u):"",f&&!p&&(_=Yt[f]=Yt[f]||{}),w=n&&n.match(Wt)||[""],k=w.length;k--;){if(n=w[k],p&&arguments.length<3)if(c)i(c,Yt[c._cId]);else if(!T[0])for(l in Yt)i(c,Yt[l]);s(T)}return f&&un(_,f),{cbId:f,bnd:_}}}var n,r=1==this?0:1,i=Ht.call(arguments),a=i[0];return a+""===a&&(n=a,i.shift()),e.apply(1,i)},sn.wait=function(){var e=this;e._go=1,setTimeout(function(){e.trigger(!0),e._go=0,e.paths={}})},Ze=function(e,t,n){e+""!==e&&(n=t,t=e,e=""),n=void 0===n?st.asyncObserve:n;var r=et(t)?new pn(e,t):new dn(e,t);return n&&(n===!0&&(r.async=!0,n=sn),n.trigger||(et(n)?(n.trigger=yn,n.paths={}):n=void 0),r._batch=n),r},t.observable=Ze,Ze._fltr=function(e,t,n,r){if(!r||!Ye(r)||r(e,t,n))return t=Ye(t)?t.set&&t.call(n[0]):t,typeof t===Ft&&t},Ze.Object=dn,Ze.Array=pn,t.observe=Ze.observe=Xe,t.unobserve=Ze.unobserve=xn,Ze._apply=vn,dn.prototype={_data:null,observeAll:hn,unobserveAll:_n,data:function(){return this._data},setProperty:function(e,t,n){e=e||"";var r,i,a,o,s=e+""!==e,l=this,d=l._data,p=l._batch;if(d)if(s)if(n=t,et(e))for(r=e.length;r--;)i=e[r],l.setProperty(i.name,i.value,void 0===n||n);else{p||(l._batch=o=[],o.trigger=yn,o.paths={});for(r in e)l.setProperty(r,e[r],n);o&&(l._batch.trigger(),l._batch=void 0)}else if(e!==Ge){for(a=e.split(/[.^]/);d&&a.length>1;)d=d[a.shift()];d&&l._setProperty(d,a[0],t,n)}return l},removeProperty:function(e){return this.setProperty(e,on),this},_setProperty:function(e,t,n,r){var i,a,o,s,l,d=t?e[t]:e;Ye(d)&&d.set&&(l=e._vw||e,a=d,i=a.set===!0?a:a.set,d=a.call(l)),(d!==n||r&&d!=n)&&(!(d instanceof Date&&n instanceof Date)||d>n||d<n)&&(i?(i.call(l,n),n=a.call(l)):(o=n===on)?void 0!==d?(delete e[t],n=void 0):t=void 0:t&&(e[t]=n),t&&(s={change:"set",path:t,value:n,oldValue:d,remove:o},e._ocp&&(s.ctxPrm=e._key),this._trigger(e,s)))},_trigger:function(e,n,r){var i,a,o,s=this;t.hasData(e)&&(!r&&(a=s._batch)?(s.async&&!a._go&&a.wait(),a.push([s,e,n]),i=an(e).obId+n.path,(o=a.paths[i])&&(a[o-1].skip=1),a.paths[i]=a.length):(t(e).triggerHandler(Zt+(this._ns?"."+/^\S+/.exec(this._ns)[0]:""),n),n.oldValue=null))}},pn.prototype={_data:null,observeAll:hn,unobserveAll:_n,data:function(){return this._data},insert:function(e,t){var n=this._data;return 1===arguments.length&&(t=e,e=n.length),e=Qt(e),e>-1&&(t=et(t)?t:[t],t.length&&this._insert(e,t)),this},_insert:function(e,t){var n=this._data,r=n.length;e>r&&(e=r),Jt.apply(n,[e,0].concat(t)),this._trigger({change:"insert",index:e,items:t},r)},remove:function(e,t){var n,r=this._data;return void 0===e&&(e=r.length-1),e=Qt(e),t=t?Qt(t):0===t?0:1,t>0&&e>-1&&(n=r.slice(e,e+t),(t=n.length)&&this._remove(e,t,n)),this},_remove:function(e,t,n){var r=this._data,i=r.length;r.splice(e,t),this._trigger({change:"remove",index:e,items:n},i)},move:function(e,t,n){return n=n?Qt(n):0===n?0:1,e=Qt(e),t=Qt(t),n>0&&e>-1&&t>-1&&e!==t&&this._move(e,t,n),this},_move:function(e,t,n){var r,i=this._data,a=i.length,o=e+n-a;o>0&&(n-=o),n&&(r=i.splice(e,n),t>i.length&&(t=i.length),Jt.apply(i,[t,0].concat(r)),t!==e&&this._trigger({change:"move",oldIndex:e,index:t,items:r},a))},refresh:function(e){function t(){i&&(s.insert(r-i,l),f+=i,n+=i,i=0,l=[])}var n,r,i,a,o,s=this,l=[],d=s._data,p=d.slice(),c=d.length,f=c,u=e.length;for(s._srt=!0,r=i=0;r<u;r++)if((a=e[r])===d[r-i])t();else{for(n=r-i;n<f&&a!==d[n];n++);if(n<f){for(t(),o=0;o++<u-n&&e[r+o]===d[n+o];);s.move(n,r,o),r+=o-1}else i++,l.push(a)}return t(),f>r&&s.remove(r,f-r),s._srt=void 0,(c||u)&&s._trigger({change:"refresh",oldItems:p},c),s},_trigger:function(e,n,r){var i,a,o,s=this;t.hasData(a=s._data)&&(!r&&(o=s._batch)?(e._dly=!0,o.push([s,e,n]),s.async&&!o._go&&o.wait()):(i=a.length,a=t([a]),s._srt?e.refresh=!0:i!==n&&a.triggerHandler(Zt,{change:"set",path:"length",value:i,oldValue:n}),a.triggerHandler(Gt+(s._ns?"."+/^\S+/.exec(s._ns)[0]:""),e)))}},Kt[Zt]=Kt[Gt]={remove:function(e){var n,r,i,a,o,s=e.data;if(s&&(s.off=!0,s=s.cb)&&(n=Yt[s._cId])){for(i=t._data(this).events[e.type],a=i.length;a--&&!r;)r=(o=i[a].data)&&o.cb&&o.cb._cId===s._cId;r||(delete n[an(this).obId],un(n,s._cId))}}},We.map=function(e){function n(t,n,r,i){var a,o,s=this;s.src&&s.unmap(),n&&(n.map=s),(typeof t===Ft||Ye(t))&&(s.src=t,i?s.tgt=e.getTgt(t,n):(r&&(s.tgt=r.tgt||et(r)&&r),s.tgt=s.tgt||[],s.options=n||s.options,(o=s.update())?s=o:(e.obsSrc&&Ze(s.src).observeAll(s.obs=function(t,n){a||n.refresh||(a=!0,e.obsSrc(s,t,n),a=void 0)},s.srcFlt),e.obsTgt&&Ze(s.tgt).observeAll(s.obt=function(t,n){a||s.tgt._updt||(a=!0,e.obsTgt(s,t,n),a=void 0)},s.tgtFlt))))}return Ye(e)&&(e={getTgt:e}),e.baseMap&&(e=t.extend({},e.baseMap,e)),e.map=function(e,t,r,i){return new n(e,t,r,i)},(n.prototype={srcFlt:e.srcFlt||bn,tgtFlt:e.tgtFlt||bn,update:function(t){var n,r,i=this,a=i.tgt;if(!a._updt&&(a._updt=!0,n=i.options&&i.options.map,Ze(a).refresh(e.getTgt(i.src,i.options=t||i.options)),a._updt=!1,r=i.options&&i.options.map,r&&n!==r))return r},observe:function(e,n){var r=this,i=r.options;r.obmp&&xn(r.obmp),r.obmp=function(){var e=n.fn(n.data,n.view,at)[i.index];t.extend(i.props,e.props),i.args=e.args,r.update()},Ze._apply(1,n.data,fn(e,n.tag,r.obmp),r.obmp,n._ctxCb)},unmap:function(){var e=this;e.src&&e.obs&&Ze(e.src).unobserveAll(e.obs,e.srcFlt),
    e.tgt&&e.obt&&Ze(e.tgt).unobserveAll(e.obt,e.tgtFlt),e.obmp&&xn(e.obmp),e.src=void 0},map:n,_def:e}).constructor=n,e},at.advSet=function(){st=ot.advanced,at._gccb=this._gccb,e._jsv=st._jsv?{cbBindings:Yt}:void 0},at._dp=fn,at._gck=ln,at._obs=Xe,st=ot.advanced=st||{useViews:!1,_jsv:!1}}if(lt=We.settings,ot=at.settings,st=ot.advanced,nt=We.converters,t.templates=tt=We.templates,it=We.tags,kt=/<(?!script)(\w+)[>\s]/,t.link)return t;ot.trigger=!0;var wn,kn,Cn,En,jn,An,In,Tn,Vn,Nn=window.navigator.userAgent,Pn=void 0!==document.textContent?"textContent":"innerText",Sn="data-jsv",Mn="change.jsv",On="onBeforeChange",Fn="onAfterChange",Bn="onAfterCreate",Ln="checked",Rn="checkbox",$n="radio",Un="input[type=",Dn=Un+Rn+"]",qn="none",Kn="value",Hn="SCRIPT",Jn="true",zn='"></script>',Qn='<script type="jsv',Wn=Sn+"-df",Xn="script,["+Sn+"]",Zn={value:"val",input:"val",html:Ot,text:"text"},Gn={from:Kn,to:Kn},Yn=0,er=t.cleanData,tr=lt.delimiters,nr=document.createDocumentFragment(),rr=document.querySelector,ir={ol:1,ul:1,table:1,tbody:1,thead:1,tfoot:1,tr:1,colgroup:1,dl:1,select:1,optgroup:1,svg:1,svg_ns:1},ar={tr:"table"},or={br:1,img:1,input:1,hr:1,area:1,base:1,col:1,link:1,meta:1,command:1,embed:1,keygen:1,param:1,source:1,track:1,wbr:1},sr={},lr={},dr=1,pr=/^#(view\.?)?/,cr=/((\/>)|<\/(\w+)>|)(\s*)([#\/]\d+(?:_|(\^)))`(\s*)(<\w+(?=[\s\/>]))?|\s*(?:(<\w+(?=[\s\/>]))|<\/(\w+)>(\s*)|(\/>)\s*|(>)|$)/g,fr=/(#)()(\d+)(_)/g,ur=/(#)()(\d+)([_^])/g,gr=/(?:(#)|(\/))(\d+)(_)/g,vr=/(?:(#)|(\/))(\d+)(\^)/g,hr=/(#)()(\d+)(\^)/g,_r=/(?:(#)|(\/))(\d+)([_^])([-+@\d]+)?/g,mr=/&(\d+)\+?/g,br=/^[^.]*$/,xr=e.getComputedStyle,yr=t.inArray;if(Un+=$n+"]",Nn=Nn.indexOf("MSIE ")>0||Nn.indexOf("Trident/")>0,Ze=t.observable,!Ze)throw requiresStr+"JsObservable";return Xe=Ze.observe,$e(at.View.prototype),at.onStore.template=function(e,n,r){null===n?(delete t.link[e],delete t.render[e]):(n.link=ue,e&&!r&&"jsvTmpl"!==e&&(t.render[e]=n,t.link[e]=function(){return ue.apply(n,arguments)}))},at.viewInfos=xe,(lt.delimiters=function(){var e=tr.apply(0,arguments);return tr!==p&&(e=p.apply(0,arguments)),kn=new RegExp("(?:^|\\s*)([\\w-]*)(\\"+ut+")?(\\"+pt+at.rTag+"(:\\w*)?\\"+ct+")","g"),e})(),at.addSetting("trigger"),nt.merge=function(e){var t,n=this.linkCtx.elem.className,r=this.tagCtx.props.toggle;return r&&(t=r.replace(/[\\^$.|?*+()[{]/g,"\\$&"),t="(\\s(?="+t+"$)|(\\s)|^)("+t+"(\\s|$))",n=n.replace(new RegExp(t),"$2"),e=n+(e?(n&&" ")+r:"")),e},it({on:{attr:qn,bindTo:[],init:function(e){for(var n,r=this,i=0,a=e.args,o=a.length;i<o&&!Ye(a[i]);i++);r._hi=o>i&&i+1,r.inline&&(at.rTmpl.exec(n=t.trim(e.tmpl.markup))||(r.template="<button>"+(n||e.params.args[i]||"noop")+"</button>"),r.attr=Ot)},onBind:function(){this.template&&(this.mainElem=this.contents("button"))},onAfterLink:function(e,n){var r,i,a,o=this,s=o._hi,l=e.args,d=l.length,p=e.props,c=p.data,f=e.view,u=p.context;s&&(r=l[s-1],i=l.slice(s),l=l.slice(0,s-1),o._sel=l[1],a=o.activeElem=o.activeElem||t(o.inline?(o._sel=l[1]||"*",o.parentElem):n.elem),u||(u=/^(.*)[.^][\w$]+$/.exec(e.params.args.slice(-i.length-1)[0]),u=u&&at.tmplFn(pt+":"+u[1]+ct,f.tmpl,!0)(n.data,f)),o._evs&&o.onUnbind(e,n,o.ctx),a.on(o._evs=l[0]||"click",o._sel,void 0==c?null:c,o._hlr=function(e){var t,a=!o.inline;if(!a)for(t=o.contents("*"),d=t.length;!a&&d--;)t[d].contains(e.target)&&(a=!0);if(a)return r.apply(u||n.data,[].concat(i,e,{change:e.type,view:f,linkCtx:n},i.slice.call(arguments,1)))}))},onUpdate:!1,onArrayChange:!1,onUnbind:function(){var e=this,t=Yn;e.activeElem&&(Yn=0,e.activeElem.off(e._evs,e._sel,e._hlr),Yn=t)},contentCtx:!0,setSize:!0,dataBoundOnly:!0},radiogroup:{boundProps:["disabled"],init:function(e){this.name=e.props.name||(Math.random()+"jsv").slice(9)},onBind:function(e,n){var r,i,a,o=this,s=e.params.props;for(s=s&&s.disabled,o.inline?(r=o.contents("*")[0],r=r&&Cn(r).ctx.tag===o.parent?r:o.parentElem,i=o.contents(!0,Un)):(r=n.elem,i=t(Un,n.elem)),o.linkedElem=i,a=i.length;a--;)i[a].name=i[a].name||o.name;t(r).on("jsv-domchange",function(t,n){var l,d,p=n.ctx.parentTags;if(!o.inline||r!==o.parentElem||p&&p[o.tagName]===o){for(d=o.cvtArgs()[0],i=o.linkedElem=o.contents(!0,Un),a=i.length;a--;)l=i[a],l._jsvLkEl=o,l.name=l.name||o.name,l._jsvBnd="&"+o._tgId+"+",l.checked=d===l.value,s&&(l.disabled=!!e.props.disabled);o.linkedElems=e.linkedElems=[i]}})},onAfterLink:function(e,t,n,r,i){var a=e.params.props;a&&a.disabled&&this.linkedElem.prop("disabled",!!e.props.disabled)},onUpdate:!1,contentCtx:!0,dataBoundOnly:!0},checkboxgroup:{boundProps:["disabled"],init:function(e){this.name=e.props.name||(Math.random()+"jsv").slice(9)},onBind:function(e,n){for(var r,i=this,a=e.params.props,o=a&&a.convert,s=a&&a.convertBack,l=a&&a.disabled,d=e.params.args[0]+(o?" convert="+o:"")+(s?" convertBack="+s:""),p=i.contents(!0,Dn),c=p.length;c--;)p[c].name=p[c].name||i.name;p.link(d,n.data),i.inline?(r=i.contents("*")[0],r=r&&t.view(r).ctx.tag===i.parent?r:i.parentElem):r=n.elem,t(r).on("jsv-domchange",function(a,o){var s,f=o.ctx.parentTags;if(!i.inline||r!==i.parentElem||f&&f[i.tagName]===i)for(p=i.contents(!0,Dn),c=p.length;c--;)s=p[c],s._jsvSel||(s.name=s.name||i.name,t.link(d,s,n.data),l&&(s.disabled=!!e.props.disabled))})},onAfterLink:function(e,t,n,r,i){var a=e.params.props;a&&a.disabled&&this.contents(!0,Dn).prop("disabled",!!e.props.disabled)},onUpdate:!1,contentCtx:!0,dataBoundOnly:!0}}),d(it["for"],{sortDataMap:We.map({getTgt:it["for"].sortDataMap.getTgt,obsSrc:function(e,t,n){e.update()},obsTgt:function(e,t,n){var r,i=n.items,a=e.src;if("remove"===n.change)for(r=i.length;r--;)Ze(a).remove(yr(i[r],a));else"insert"===n.change&&Ze(a).insert(i)}}),mapProps:["filter","sort","reverse","start","end","step"],bindTo:["paged","sorted"],bindFrom:[0],onArrayChange:function(e,t,n,r){var i,a,o=e.target.length,s=this;if(!s.rendering)if(s._.noVws||s.tagCtxs[1]&&("insert"===t.change&&o===t.items.length||"remove"===t.change&&!o))a=n.map&&n.map.propsArr,s.refresh(),a&&(n.map.propsArr=a);else for(i in s._.arrVws)i=s._.arrVws[i],i.data===e.target&&oe.apply(i,arguments);s.domChange(n,r,t),e.done=!0},onUpdate:function(e,t,n){this.setDataMap(n)},onBind:function(e,t,n,r,i){for(var a,o=this,s=0,l=o._ars=o._ars||{},d=o.tagCtxs,p=d.length,c=o.selected||0;s<=c;s++)e=d[s],a=e.map?e.map.tgt:e.args.length?e.args[0]:e.view.data,l[s]&&(Xe(l[s],!0),delete l[s]),!l[s]&&et(a)&&!function(){var n=e;Xe(a,l[s]=function(e,r){o.onArrayChange(e,r,n,t)})}();for(s=c+1;s<p;s++)l[s]&&(Xe(l[s],!0),delete l[s]);i&&o.domChange(e,t,i)},onAfterLink:function(e){for(var n,r,i,a=this,o=0,s=a.tagCtxs,l=(s.length,a.selected||0);o<=l;o++)e=s[o],r=e.map,n=e.map?r.tgt:e.args.length?e.args[0]:e.view.data,et(n)&&(i=e.params.props)&&(i.paged&&!a.paged&&(t.observable(a).setProperty("paged",n.slice()),a.updateValue(a.paged,0,o,!0)),i.sorted&&!a.sorted&&(t.observable(a).setProperty("sorted",r&&r.sorted||n.slice()),a.updateValue(a.sorted,1,o,!0)))},onDispose:function(){var e,t=this;for(e in t._ars)Xe(t._ars[e],!0)}}),d(it["if"],{onUpdate:function(e,t,n){for(var r,i,a=0;r=this.tagCtxs[a];a++)if(i=r.props.tmpl!==n[a].props.tmpl||r.args.length&&!(r=r.args[0])!=!n[a].args[0],!this.convert&&r||i)return i;return!1},onAfterLink:function(e,t,n,r,i){i&&this.domChange(e,t,i)}}),it("props",{baseTag:"for",dataMap:We.map({getTgt:it.props.dataMap.getTgt,obsSrc:Ue,obsTgt:De,tgtFlt:Ke}),flow:!0}),d(t,{view:Cn=function(e,n,r){function i(e,t){if(e)for(o=xe(e,t,fr),l=0,d=o.length;l<d&&(!(a=In[o[l].id])||!(a=a&&r?a.get(!0,r):a));l++);}n!==!!n&&(r=n,n=void 0);var a,o,s,l,d,p,c,f=0,u=document.body;if(e&&e!==u&&Qe._.useKey>1&&(e=""+e===e?t(e)[0]:e.jquery?e[0]:e)){if(n){if(i(e._df,!0),!a&&e.tagName)for(c=rr?e.querySelectorAll(Xn):t(Xn,e).get(),p=c.length,s=0;!a&&s<p;s++)i(c[s]);return a}for(;e;){if(o=xe(e,void 0,gr))for(p=o.length;p--;)if(a=o[p],a.open){if(f<1)return a=In[a.id],a&&r?a.get(r):a||Qe;f--}else f++;e=e.previousSibling||e.parentNode}}return Qe},link:ge,unlink:Se,cleanData:function(e){e.length&&Yn&&Ne(e),er.apply(t,arguments)}}),d(t.fn,{link:function(e,t,n,r,i,a,o){return ge(e,this,t,n,r,i,a,o)},unlink:function(){return Se(this)},view:function(e,t){return Cn(this[0],e,t)}}),t.each([Ot,"replaceWith","empty","remove"],function(e,n){var r=t.fn[n];t.fn[n]=function(){var e;Yn++;try{e=r.apply(this,arguments)}finally{Yn--}return e}}),d(Qe=at.topView,{tmpl:{links:{}}}),In={0:Qe},at._glt=function(e){for(var t,n=/#(\d*)\^\/\1\^/g,r=[],i=be(e);t=n.exec(i);)(t=lr[t[1]])&&r.push(t.linkCtx.tag);return r},at._gccb=function(e){return function(t,n,r){var i,a,o,s,l,d,p,c,f,u,g;if(e&&t){if(t._cpfn)return t._cpfn.call(e.tmpl,n,e,at);if("~"===t.charAt(0)){if("~tag"===t.slice(0,4)&&(a=e.ctx,"."===t.charAt(4)?(i=t.slice(5),a=a.tag):"~tagCtx."===t.slice(0,8)&&(i=t.slice(8),a=a.tagCtx),i))return a?[a,i]:[];if(t=t.slice(1).split("."),s=e.ctxPrm(l=t.shift(),void 0,!0))if(c=s._cxp){if(t.length&&(d="."+t.join("."),l=s[p=s.length-1],l._cpfn?(l.sb=d,l.bnd=!!r):(s[p]=(l+d).replace("#data.",""),"#view"===l.slice(0,5)&&(s[p]=s[p].slice(6),s.splice(p,0,e)))),o=[s],(a=c.tag)&&a.convert)for(g=a.bindTo||[0],p=g.length;p--;)void 0!==r&&p!==c.ind&&(u=g[p],f=[s[0],a.tagCtx.params[+u===u?"args":"props"]],f._cxp=c,o.push(f))}else(t.length||Ye(s))&&(o=[s,t.join(".")]);return o||[]}if("#"===t.charAt(0))return"#data"===t?[]:[e,t.replace(pr,"")]}}},at._cp=function(e,n,r,i){if(r.linked){if(i&&(i.cvt||void 0===i.tag._.toIndex[i.ind]))e=[{_ocp:e}],i.updateValue=function(n){return t.observable(e._cxp.data).setProperty(_t,n),this};else if(n){var a=pt+":"+n+ct,o=Qe.tmpl.links,s=o[a];s||(o[a]=s=at.tmplFn(a,r.tmpl,!0)),e=s.deps[0]?[r,s]:[{_ocp:i?e:s()}]}else e=[{_ocp:e}];e._cxp=i||{updateValue:function(t){return Ze(e._cxp.data).setProperty(e._cxp.path,t),this}}}return e},at._ucp=function(e,t,n,r){var i=r.tag,a=i?yr(e,i.linkedCtxParam):0;return r.path||Te("~"+e,n.data,at._gccb(n)),(r.updateValue||i.updateValue)(t,a,r.tagElse,void 0,i)},at._ceo=function wr(e){for(var t,n=[],r=e.length;r--;)t=e[r],t._cpfn&&(t=d({},t),t.prm=wr(t.prm)),n.unshift(t);return n},Tn=at.advSet,at.advSet=function(){Tn.call(at),e._jsv=st._jsv?d(e._jsv||{},{views:In,bindings:lr}):void 0,En=st.linkAttr,jn=Xn+",["+En+"]",An=st._wm,An.optgroup=An.option,An.tbody=An.tfoot=An.colgroup=An.caption=An.thead,An.th=An.td},lt.advanced({linkAttr:"data-link",useViews:!1,noValidate:!1,_wm:{option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],svg_ns:[1,"<svg>","</svg>"],div:t.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},_fe:{input:{from:Me,to:Kn},textarea:Gn,select:Gn,optgroup:{to:"label"}}}),t},window);
//# sourceMappingURL=jsviews.min.js.map
