mapexplorer-rails 1.0.0.pre.alpha → 1.0.0.pre.alpha.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mapexplorer/rails/version.rb +1 -1
  3. data/vendor/assets/babel-polyfill/README.md +0 -0
  4. data/vendor/assets/babel-polyfill/bower.json +22 -0
  5. data/vendor/assets/babel-polyfill/browser-polyfill.js +5 -0
  6. data/vendor/assets/d3/LICENSE +27 -0
  7. data/vendor/assets/d3/README.md +45 -0
  8. data/vendor/assets/d3/bower.json +7 -0
  9. data/vendor/assets/d3/d3.js +16383 -0
  10. data/vendor/assets/d3/d3.min.js +8 -0
  11. data/vendor/assets/jsrender/MIT-LICENSE.txt +20 -0
  12. data/vendor/assets/jsrender/bower.json +43 -0
  13. data/vendor/assets/jsrender/index.js +8 -0
  14. data/vendor/assets/jsrender/jsrender-node.js +2298 -0
  15. data/vendor/assets/jsrender/jsrender.js +2350 -0
  16. data/vendor/assets/jsrender/jsrender.min.js +4 -0
  17. data/vendor/assets/jsrender/jsrender.min.js.map +1 -0
  18. data/vendor/assets/jsrender/tmplify/index.js +64 -0
  19. data/vendor/assets/mapexplorer-core/LICENSE +21 -0
  20. data/vendor/assets/mapexplorer-core/README.md +235 -0
  21. data/vendor/assets/mapexplorer-core/assets/stylesheets/map.scss +38 -0
  22. data/vendor/assets/mapexplorer-core/assets/stylesheets/mapexplorer-core.scss +3 -0
  23. data/vendor/assets/mapexplorer-core/assets/stylesheets/merkle-path.scss +10 -0
  24. data/vendor/assets/mapexplorer-core/assets/stylesheets/variables.scss +14 -0
  25. data/vendor/assets/mapexplorer-core/bower.json +32 -0
  26. data/vendor/assets/mapexplorer-core/dist/mapexplorer-core.js +3872 -0
  27. data/vendor/assets/mapexplorer-core/dist/mapexplorer-core.js.map +1 -0
  28. data/vendor/assets/mapexplorer-core/dist/mapexplorer-core.min.js +35 -0
  29. data/vendor/assets/mapexplorer-core/karma.conf.js +117 -0
  30. data/vendor/assets/mapexplorer-core/package.json +85 -0
  31. data/vendor/assets/mapexplorer-core/rollup.bower.config.js +41 -0
  32. data/vendor/assets/mapexplorer-core/rollup.es.config.js +16 -0
  33. data/vendor/assets/mapexplorer-core/rollup.umd.config.js +25 -0
  34. data/vendor/assets/stratumn-sdk/LICENSE +21 -0
  35. data/vendor/assets/stratumn-sdk/README.md +267 -0
  36. data/vendor/assets/stratumn-sdk/bower.json +27 -0
  37. data/vendor/assets/stratumn-sdk/dist/stratumn-sdk.js +813 -0
  38. data/vendor/assets/stratumn-sdk/dist/stratumn-sdk.js.map +1 -0
  39. data/vendor/assets/stratumn-sdk/dist/stratumn-sdk.min.js +2 -0
  40. data/vendor/assets/stratumn-sdk/dist/stratumn-sdk.min.js.map +1 -0
  41. data/vendor/assets/stratumn-sdk/examples/browser/index.html +34 -0
  42. data/vendor/assets/stratumn-sdk/package.json +67 -0
  43. data/vendor/assets/stratumn-sdk/rollup.base.config.js +13 -0
  44. data/vendor/assets/stratumn-sdk/rollup.bower.config.js +18 -0
  45. data/vendor/assets/stratumn-sdk/rollup.bower.min.config.js +7 -0
  46. data/vendor/assets/stratumn-sdk/rollup.es.config.js +9 -0
  47. data/vendor/assets/stratumn-sdk/rollup.umd.config.js +10 -0
  48. metadata +46 -1
@@ -0,0 +1,4 @@
1
+ /*! JsRender v0.9.83 (Beta): http://jsviews.com/#jsrender */
2
+ /*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */
3
+ !function(e,t){var n=t.jQuery;"object"==typeof exports?module.exports=n?e(t,n):function(n){if(n&&!n.fn)throw"Provide jQuery or null";return e(t,n)}:"function"==typeof define&&define.amd?define(function(){return e(t)}):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 ee(t)&&(t=n(e?e._d?e:n(s,e):s,t),t._d=1),t}function i(e,t){for(var n in t.props)Ve.test(n)&&(e[n]=r(e[n],t.props[n]))}function o(e){return e}function s(){return""}function a(e){try{throw console.log("JsRender dbg breakpoint: "+e),"dbg breakpoint"}catch(t){}return this.base?this.baseApply(arguments):e}function d(e){this.name=(t.link?"JsViews":"JsRender")+" Error",this.message=e||this.name}function u(e,t){for(var n in t)e[n]=t[n];return e}function l(e,t,n){return e?te(e)?l.apply(X,e):(ae.delimiters=[e,t,ge=n?n.charAt(0):ge],le=e.charAt(0),pe=e.charAt(1),ce=t.charAt(0),fe=t.charAt(1),e="\\"+le+"(\\"+ge+")?\\"+pe,t="\\"+ce+"\\"+fe,G="(?:(\\w+(?=[\\/\\s\\"+ce+"]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^\\"+ce+"]|\\"+ce+"(?!\\"+fe+"))*?)",se.rTag="(?:"+G+")",G=new RegExp("(?:"+e+G+"(\\/)?|\\"+le+"(\\"+ge+")?\\"+pe+"(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))"+t,"g"),se.rTmpl=new RegExp("<.*>|([^\\\\]|^)[{}]|"+e+".*"+t),ue):ae.delimiters}function p(e,t){t||e===!0||(t=e,e=void 0);var n,r,i,o,s=this,a=!t||"root"===t;if(e){if(o=t&&s.type===t&&s,!o)if(n=s.views,s._.useKey){for(r in n)if(o=t?n[r].get(e,t):n[r])break}else for(r=0,i=n.length;!o&&r<i;r++)o=t?n[r].get(e,t):n[r]}else if(a)for(;s.parent;)o=s,s=s.parent;else for(;s&&!o;)o=s.type===t?s:void 0,s=s.parent;return o}function c(){var e=this.get("item");return e?e.index:void 0}function f(){return this.index}function g(t,n){var r,i,o=this,s=o.ctx;if(s&&(s=s[t]),void 0===s&&(s=ie[t]),s&&s._cp){if(n)return i=se._ceo(s[1].deps),i.unshift(s[0]),i._cp=!0,i;s=X.getCtx(s)}return s&&ee(s)&&!s._wrp&&(r=function(){return s.apply(this&&this!==e?this:o,arguments)},r._wrp=o,u(r,s)),r||s}function v(e){return e&&(e.fn?e:this.getRsc("templates",e)||ne(e))}function h(e,t,n,r){var o,s,a="number"==typeof n&&t.tmpl.bnds[n-1],d=t.linkCtx;return void 0!==r?n=r={props:{},args:[r]}:a&&(n=a(t.data,t,se)),s=n.args[0],(e||a)&&(o=d&&d.tag,o||(o=u(new se._tg,{_:{inline:!d,bnd:a,unlinked:!0},tagName:":",cvt:e,flow:!0,tagCtx:n}),d&&(d.tag=o,o.linkCtx=d),n.ctx=B(n.ctx,(d?d.view:t).ctx)),o._er=r&&s,i(o,n),n.view=t,o.ctx=n.ctx||o.ctx||{},n.ctx=void 0,s=o.cvtArgs("true"!==e&&e)[0],s=a&&t._.onRender?t._.onRender(s,t,o):s),void 0!=s?s:""}function m(e){var t=this,n=t.tagCtx,r=n.view,i=n.args;return e=e||t.convert,e=e&&(""+e===e?r.getRsc("converters",e)||S("Unknown converter: '"+e+"'"):e),i=i.length||n.index?e?i.slice():i:[r.data],e&&(e.depends&&(t.depends=se.getDeps(t.depends,t,e.depends,e)),i[0]=e.apply(t,i)),i}function w(e,t){for(var n,r,i=this;void 0===n&&i;)r=i.tmpl&&i.tmpl[e],n=r&&r[t],i=i.parent;return n||X[e][t]}function x(e,n,r,o,s,a){n=n||W;var d,u,l,p,c,f,g,v,h,m,w,x,_,b,y,k,j,C,T,A,V="",R=n.linkCtx||0,$=n.ctx,M=r||n.tmpl,F="number"==typeof o&&n.tmpl.bnds[o-1];for("tag"===e._is?(d=e,e=d.tagName,o=d.tagCtxs,l=d.template):(u=n.getRsc("tags",e)||S("Unknown tag: {{"+e+"}} "),l=u.template),void 0!==a?(V+=a,o=a=[{props:{},args:[]}]):F&&(o=F(n.data,n,se)),v=o.length,g=0;g<v;g++)m=o[g],(!R||!R.tag||g&&!R.tag._.inline||d._er)&&((x=M.tmpls&&m.tmpl)&&(x=m.content=M.tmpls[x-1]),m.index=g,m.tmpl=x,m.render=E,m.view=n,m.ctx=B(m.ctx,$)),(r=m.props.tmpl)&&(m.tmpl=n.getTmpl(r)),d||(d=new u._ctr,_=!!d.init,d.parent=f=$&&$.tag,d.tagCtxs=o,T=d.dataMap,R&&(d._.inline=!1,R.tag=d,d.linkCtx=R),(d._.bnd=F||R.fn)?d._.arrVws={}:d.dataBoundOnly&&S("{^{"+e+"}} tag must be data-bound")),o=d.tagCtxs,T=d.dataMap,m.tag=d,T&&o&&(m.map=o[g].map),d.flow||(w=m.ctx=m.ctx||{},p=d.parents=w.parentTags=$&&B(w.parentTags,$.parentTags)||{},f&&(p[f.tagName]=f),p[d.tagName]=w.tag=d);if(!(d._er=a)){for(i(d,o[0]),d.rendering={},g=0;g<v;g++)m=d.tagCtx=o[g],j=m.props,k=d.cvtArgs(),(b=j.dataMap||T)&&(k.length||j.dataMap)&&(y=m.map,y&&y.src===k[0]&&!s||(y&&y.src&&y.unmap(),y=m.map=b.map(k[0],j,void 0,!d._.bnd)),k=[y.tgt]),d.ctx=m.ctx,g||(_&&(C=d.template,d.init(m,R,d.ctx),_=void 0),R&&(R.attr=d.attr=R.attr||d.attr),c=d.attr,d._.noVws=c&&c!==Ne),h=void 0,d.render&&(h=d.render.apply(d,k),n.linked&&h&&d.linkedElem&&!Re.test(h)&&(h=N(t.templates(h),k[0],void 0,void 0,n,void 0,void 0,d))),k.length||(k=[n]),void 0===h&&(A=k[0],d.contentCtx&&(A=d.contentCtx(A)),h=m.render(A,!0)||(s?void 0:"")),V=V?V+(h||""):h;d.rendering=void 0}return d.tagCtx=o[0],d.ctx=d.tagCtx.ctx,d._.noVws&&d._.inline&&(V="text"===c?re.html(V):""),F&&n._.onRender?n._.onRender(V,n,d):V}function _(e,t,n,r,i,o,s,a){var d,u,l,p=this,f="array"===t;p.content=a,p.views=f?[]:{},p.parent=n,p.type=t||"top",p.data=r,p.tmpl=i,l=p._={key:0,useKey:f?0:1,id:""+Me++,onRender:s,bnds:{}},p.linked=!!s,n?(d=n.views,u=n._,u.useKey?(d[l.key="_"+u.useKey++]=p,p.index=Oe,p.getIndex=c):d.length===(l.key=p.index=o)?d.push(p):d.splice(o,0,p),p.ctx=e||n.ctx):p.ctx=e}function b(e){var t,n,r;for(t in Ke)n=t+"s",e[n]&&(r=e[n],e[n]={},X[n](r,e))}function y(e,t,n){function i(){var t=this;t._={inline:!0,unlinked:!0},t.tagName=e}var o,s,a,d=new se._tg;if(ee(t)?t={depends:t.depends,render:t}:""+t===t&&(t={template:t}),s=t.baseTag){t.flow=!!t.flow,t.baseTag=s=""+s===s?n&&n.tags[s]||oe[s]:s,d=u(d,s);for(a in t)d[a]=r(s[a],t[a])}else d=u(d,t);return void 0!==(o=d.template)&&(d.template=""+o===o?ne[o]||ne(o):o),d.init!==!1&&((i.prototype=d).constructor=d._ctr=i),n&&(d._parentTmpl=n),d}function k(e){return this.base.apply(this,e)}function j(e,n,r,i){function o(n){var o,a;if(""+n===n||n.nodeType>0&&(s=n)){if(!s)if(/^\.\/[^\\:*?"<>]*$/.test(n))(a=ne[e=e||n])?n=a:s=document.getElementById(n);else if(t.fn&&!se.rTmpl.test(n))try{s=t(document).find(n)[0]}catch(d){}s&&(i?n=s.innerHTML:(o=s.getAttribute(Se),o?o!==Ie?(n=ne[o],delete ne[o]):t.fn&&(n=t.data(s)[Ie]):(e=e||(t.fn?Ie:n),n=j(e,s.innerHTML,r,i)),n.tmplName=e=e||o,e!==Ie&&(ne[e]=n),s.setAttribute(Se,e),t.fn&&t.data(s,Ie,n))),s=void 0}else n.fn||(n=void 0);return n}var s,a,d=n=n||"";if(0===i&&(i=void 0,d=o(d)),i=i||(n.markup?n:{}),i.tmplName=e,r&&(i._parentTmpl=r),!d&&n.markup&&(d=o(n.markup))&&d.fn&&(d=d.markup),void 0!==d)return d.fn||n.fn?d.fn&&(a=d):(n=V(d,i),O(d.replace(ye,"\\$&"),n)),a||(a=u(function(){return a.render.apply(a,arguments)},n),b(a)),e&&!r&&e!==Ie&&(Ue[e]=a),a}function C(e,n){return t.isFunction(e)?e.call(n):e}function T(e){var t,n=[],r=e.length;for(t=0;t<r;t++)n.push(e[t].unmap());return n}function A(e,n){function r(e){l.apply(this,e)}function i(){return new r(arguments)}function o(e,t){var n,r,i,o,s,a=c.length;for(n=0;n<a;n++)o=c[n],r=void 0,o+""!==o&&(r=o,o=r.getter),void 0===(s=e[o])&&r&&void 0!==(i=r.defaultVal)&&(s=C(i,e)),t(s,r&&p[r.type],o)}function s(t){t=t+""===t?JSON.parse(t):t;var n,r,i,s=t,u=[];if(te(t)){for(t=t||[],r=t.length,n=0;n<r;n++)u.push(this.map(t[n]));return u._is=e,u.unmap=d,u.merge=a,u}if(t){o(t,function(e,t){t&&(e=t.map(e)),u.push(e)}),s=this.apply(this,u);for(i in t)i===Y||_[i]||(s[i]=t[i])}return s}function a(e){e=e+""===e?JSON.parse(e):e;var t,n,r,s,a,d,u,l,p,c,f=this;if(te(f)){for(l={},c=[],r=e.length,s=f.length,t=0;t<r;t++){for(p=e[t],u=!1,n=0;n<s&&!u;n++)l[n]||(d=f[n],g&&(l[n]=u=g+""===g?p[g]&&(_[g]?d[g]():d[g])===p[g]:g(d,p)));u?(d.merge(p),c.push(d)):c.push(i.map(p))}return void(x?x(f).refresh(c,!0):f.splice.apply(f,[0,f.length].concat(c)))}o(e,function(e,t,n){t?f[n]().merge(e):f[n](e)});for(a in e)a===Y||_[a]||(f[a]=e[a])}function d(){var e,n,r,i,o,s,a=this;if(te(a))return T(a);for(e={},i=c.length,r=0;r<i;r++)n=c[r],o=void 0,n+""!==n&&(o=n,n=o.getter),s=a[n](),e[n]=o&&s&&p[o.type]?te(s)?T(s):s.unmap():s;for(n in a)"_is"===n||_[n]||n===Y||"_"===n.charAt(0)&&_[n.slice(1)]||t.isFunction(a[n])||(e[n]=a[n]);return e}var u,l,p=this,c=n.getters,f=n.extend,g=n.id,v=t.extend({_is:e||"unnamed",unmap:d,merge:a},f),h="",m="",w=c?c.length:0,x=t.observable,_={};for(r.prototype=v,u=0;u<w;u++)!function(e){e=e.getter||e,_[e]=u+1;var t="_"+e;h+=(h?",":"")+e,m+="this."+t+" = "+e+";\n",v[e]=v[e]||function(n){return arguments.length?void(x?x(this).setProperty(e,n):this[t]=n):this[t]},x&&(v[e].set=v[e].set||function(e){this[t]=e})}(c[u]);return l=new Function(h,m.slice(0,-1)),l.prototype=v,v.constructor=l,i.map=s,i.getters=c,i.extend=f,i.id=g,i}function V(e,n){var r,i=de._wm||{},o=u({tmpls:[],links:{},bnds:[],_is:"template",render:E},n);return o.markup=e,n.htmlTag||(r=Ce.exec(e),o.htmlTag=r?r[1].toLowerCase():""),r=i[o.htmlTag],r&&r!==i.div&&(o.markup=t.trim(o.markup)),o}function R(e,t){function n(i,o,s){var a,d,u,l;if(i&&typeof i===Fe&&!i.nodeType&&!i.markup&&!i.getTgt&&!("viewModel"===e&&i.getters||i.extend)){for(u in i)n(u,i[u],o);return o||X}return void 0===o&&(o=i,i=void 0),i&&""+i!==i&&(s=o,o=i,i=void 0),l=s?"viewModel"===e?s:s[r]=s[r]||{}:n,d=t.compile,null===o?i&&delete l[i]:(o=d?d.call(l,i,o,s,0):o,i&&(l[i]=o)),d&&o&&(o._is=e),o&&(a=se.onStore[e])&&a(i,o,d),o}var r=e+"s";X[r]=n}function $(e){ue[e]=function(t){return arguments.length?(ae[e]=t,ue):ae[e]}}function M(e){function t(t,n){this.tgt=e.getTgt(t,n)}return ee(e)&&(e={getTgt:e}),e.baseMap&&(e=u(u({},e.baseMap),e)),e.map=function(e,n){return new t(e,n)},e}function E(e,t,n,r,i,o){var s,a,d,u,l,p,c,f,g=r,v="";if(t===!0?(n=t,t=void 0):typeof t!==Fe&&(t=void 0),(d=this.tag)?(l=this,g=g||l.view,u=g.getTmpl(d.template||l.tmpl),arguments.length||(e=g)):u=this,u){if(!r&&e&&"view"===e._is&&(g=e),g&&e===g&&(e=g.data),p=!g,he=he||p,g||((t=t||{}).root=e),!he||de.useViews||u.useViews||g&&g!==W)v=N(u,e,t,n,g,i,o,d);else{if(g?(c=g.data,f=g.index,g.index=Oe):(g=W,g.data=e,g.ctx=t),te(e)&&!n)for(s=0,a=e.length;s<a;s++)g.index=s,g.data=e[s],v+=u.fn(e[s],g,se);else g.data=e,v+=u.fn(e,g,se);g.data=c,g.index=f}p&&(he=void 0)}return v}function N(e,t,n,r,i,o,s,a){function d(e){b=u({},n),b[x]=e}var l,p,c,f,g,v,h,m,w,x,b,y,k="";if(a&&(w=a.tagName,y=a.tagCtx,n=n?B(n,a.ctx):a.ctx,e===i.content?h=e!==i.ctx._wrp?i.ctx._wrp:void 0:e!==y.content?e===a.template?(h=y.tmpl,n._wrp=y.content):h=y.content||i.content:h=i.content,y.props.link===!1&&(n=n||{},n.link=!1),(x=y.props.itemVar)&&("~"!==x.charAt(0)&&I("Use itemVar='~myItem'"),x=x.slice(1))),i&&(s=s||i._.onRender,n=B(n,i.ctx)),o===!0&&(v=!0,o=0),s&&(n&&n.link===!1||a&&a._.noVws)&&(s=void 0),m=s,s===!0&&(m=void 0,s=i._.onRender),n=e.helpers?B(e.helpers,n):n,b=n,te(t)&&!r)for(c=v?i:void 0!==o&&i||new _(n,"array",i,t,e,o,s,h),i&&i._.useKey&&(c._.bnd=!a||a._.bnd&&a),x&&(c.it=x),x=c.it,l=0,p=t.length;l<p;l++)x&&d(t[l]),f=new _(b,"item",c,t[l],e,(o||0)+l,s,c.content),g=e.fn(t[l],f,se),k+=c._.onRender?c._.onRender(g,f):g;else x&&d(t),c=v?i:new _(b,w||"data",i,t,e,o,s,h),a&&!a.flow&&(c.tag=a,a.view=c),k+=e.fn(t,c,se);return m?m(k,c):k}function F(e,t,n){var r=void 0!==n?ee(n)?n.call(t.data,e,t):n||"":"{Error: "+e.message+"}";return ae.onError&&void 0!==(n=ae.onError.call(t.data,e,n&&r,t))&&(r=n),t&&!t.linkCtx?re.html(r):r}function S(e){throw new se.Err(e)}function I(e){S("Syntax error\n"+e)}function O(e,t,n,r,i){function o(t){t-=v,t&&m.push(e.substr(v,t).replace(_e,"\\n"))}function s(t,n){t&&(t+="}}",I((n?"{{"+n+"}} block has {{/"+t+" without {{"+t:"Unmatched or missing {{/"+t)+", in template:\n"+e))}function a(a,d,u,c,g,x,_,b,y,k,j,C){(_&&d||y&&!u||b&&":"===b.slice(-1)||k)&&I(a),x&&(g=":",c=Ne),y=y||n&&!i;var T=(d||n)&&[[]],A="",V="",R="",$="",M="",E="",N="",F="",S=!y&&!g;u=u||(b=b||"#data",g),o(C),v=C+a.length,_?f&&m.push(["*","\n"+b.replace(/^:/,"ret+= ").replace(be,"$1")+";\n"]):u?("else"===u&&(je.test(b)&&I('for "{{else if expr}}" use "{{else expr}}"'),T=w[7]&&[[]],w[8]=e.substring(w[8],C),w=h.pop(),m=w[2],S=!0),b&&K(b.replace(_e," "),T,t).replace(ke,function(e,t,n,r,i,o,s,a){return r="'"+i+"':",s?(V+=o+",",$+="'"+a+"',"):n?(R+=r+"j._cp("+o+',"'+a+'",view),',E+=r+"'"+a+"',"):t?N+=o:("trigger"===i&&(F+=o),A+=r+o+",",M+=r+"'"+a+"',",p=p||Ve.test(i)),""}).slice(0,-1),T&&T[0]&&T.pop(),l=[u,c||!!r||p||"",S&&[],q($||(":"===u?"'#data',":""),M,E),q(V||(":"===u?"data,":""),A,R),N,F,T||0],m.push(l),S&&(h.push(w),w=l,w[8]=v)):j&&(s(j!==w[0]&&"else"!==w[0]&&j,w[0]),w[8]=e.substring(w[8],C),w=h.pop()),s(!w&&j),m=w[2]}var d,u,l,p,c,f=ae.allowCode||t&&t.allowCode||ue.allowCode===!0,g=[],v=0,h=[],m=g,w=[,,g];if(f&&t._is&&(t.allowCode=f),n&&(void 0!==r&&(e=e.slice(0,-r.length-2)+ce),e=le+e+fe),s(h[0]&&h[0][2].pop()[0]),e.replace(G,a),o(e.length),(v=g[g.length-1])&&s(""+v!==v&&+v[8]===v[8]&&v[0]),n){for(u=P(g,e,n),c=[],d=g.length;d--;)c.unshift(g[d][7]);U(u,c)}else u=P(g,t);return u}function U(e,t){var n,r,i=0,o=t.length;for(e.deps=[],e.paths=[];i<o;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 q(e,t,n){return[e.slice(0,-1),t.slice(0,-1),n.slice(0,-1)]}function J(e,t){return"\n\t"+(t?t+":{":"")+"args:["+e[0]+"]"+(e[1]||!t?",\n\tprops:{"+e[1]+"}":"")+(e[2]?",\n\tctx:{"+e[2]+"}":"")}function K(e,t,n){function r(r,m,w,x,_,b,y,k,j,C,T,A,V,R,$,M,E,N,F,S){function U(e,n,r,s,a,d,p,c){var f="."===r;if(r&&(_=_.slice(n.length),/^\.?constructor$/.test(c||_)&&I(e),f||(e=(s?'view.hlp("'+s+'")':a?"view":"data")+(c?(d?"."+d:s?"":a?"":"."+r)+(p||""):(c=s?"":a?d||"":r,"")),e+=c?"."+c:"",e=n+("view.data"===e.slice(0,9)?e.slice(5):e)),u)){if(K="linkTo"===i?o=t._jsvto=t._jsvto||[]:l.bd,P=f&&K[K.length-1]){if(P._jsv){for(;P.sb;)P=P.sb;P.bnd&&(_="^"+_.slice(1)),P.sb=_,P.bnd=P.bnd||"^"===_.charAt(0)}}else K.push(_);h[g]=F+(f?1:0)}return e}x&&!k&&(_=x+_),b=b||"",w=w||m||A,_=_||j,C=C||E||"";var q,J,K,P,B,L=")";if("["===C&&(C="[j._sq(",L=")]"),!y||d||a){if(u&&M&&!d&&!a&&(!i||s||o)&&(q=h[g-1],S.length-1>F-(q||0))){if(q=S.slice(q,F+r.length),J!==!0)if(K=o||p[g-1].bd,P=K[K.length-1],P&&P.prm){for(;P.sb&&P.sb.prm;)P=P.sb;B=P.sb={path:P.sb,bnd:P.bnd}}else K.push(B={path:K.pop()});M=pe+":"+q+" onerror=''"+ce,J=f[M],J||(f[M]=!0,f[M]=J=O(M,n,!0)),J!==!0&&B&&(B._jsv=J,B.prm=l.bd,B.bnd=B.bnd||B.path&&B.path.indexOf("^")>=0)}return d?(d=!V,d?r:A+'"'):a?(a=!R,a?r:A+'"'):(w?(h[g]=F++,l=p[++g]={bd:[]},w):"")+(N?g?"":(c=S.slice(c,F),(i?(i=s=o=!1,"\b"):"\b,")+c+(c=F+r.length,u&&t.push(l.bd=[]),"\b")):k?(g&&I(e),u&&t.pop(),i=_,s=x,c=F+r.length,u&&(u=l.bd=t[i]=[],u.skp=!x),_+":"):_?_.split("^").join(".").replace(we,U)+(C?(l=p[++g]={bd:[]},v[g]=L,C):b):b?b:$?($=v[g]||$,v[g]=!1,l=p[--g],$+(C?(l=p[++g],v[g]=L,C):"")):T?(v[g]||I(e),","):m?"":(d=V,a=R,'"'))}I(e)}var i,o,s,a,d,u=t&&t[0],l={bd:u},p={0:l},c=0,f=(n?n.links:u&&(u.links=u.links||{}))||W.tmpl.links,g=0,v={},h={},m=(e+(n?" ":"")).replace(xe,r);return!g&&m||I(e)}function P(e,t,n){var r,i,o,s,a,d,u,l,p,c,f,g,v,h,m,w,x,_,b,y,k,j,C,T,A,R,$,M,E,N,F=0,S=de.useViews||t.useViews||t.tags||t.templates||t.helpers||t.converters,O="",q={},K=e.length;for(""+t===t?(_=n?'data-link="'+t.replace(_e," ").slice(1,-1)+'"':t,t=0):(_=t.tmplName||"unnamed",t.allowCode&&(q.allowCode=!0),t.debug&&(q.debug=!0),f=t.bnds,x=t.tmpls),r=0;r<K;r++)if(i=e[r],""+i===i)O+='\n+"'+i+'"';else if(o=i[0],"*"===o)O+=";\n"+i[1]+"\nret=ret";else{if(s=i[1],k=!n&&i[2],a=J(i[3],"params")+"},"+J(v=i[4]),M=i[5],N=i[6],j=i[8]&&i[8].replace(be,"$1"),(A="else"===o)?g&&g.push(i[7]):(F=0,f&&(g=i[7])&&(g=[g],F=f.push(1))),S=S||v[1]||v[2]||g||/view.(?!index)/.test(v[0]),(R=":"===o)?s&&(o=s===Ne?">":s+o):(k&&(b=V(j,q),b.tmplName=_+"/"+o,b.useViews=b.useViews||S,P(k,b),S=b.useViews,x.push(b)),A||(y=o,S=S||o&&(!oe[o]||!oe[o].flow),T=O,O=""),C=e[r+1],C=C&&"else"===C[0]),E=M?";\ntry{\nret+=":"\n+",h="",m="",R&&(g||N||s&&s!==Ne)){if($=new Function("data,view,j,u"," // "+_+" "+F+" "+o+"\nreturn {"+a+"};"),$._er=M,$._tag=o,n)return $;U($,g),w='c("'+s+'",view,',c=!0,h=w+F+",",m=")"}if(O+=R?(n?(M?"try{\n":"")+"return ":E)+(c?(c=void 0,S=p=!0,w+(g?(f[F-1]=$,F):"{"+a+"}")+")"):">"===o?(u=!0,"h("+v[0]+")"):(l=!0,"((v="+v[0]+")!=null?v:"+(n?"null)":'"")'))):(d=!0,"\n{view:view,tmpl:"+(k?x.length:"0")+","+a+"},"),y&&!C){if(O="["+O.slice(0,-1)+"]",w='t("'+y+'",view,this,',n||g){if(O=new Function("data,view,j,u"," // "+_+" "+F+" "+y+"\nreturn "+O+";"),O._er=M,O._tag=y,g&&U(f[F-1]=O,g),n)return O;h=w+F+",undefined,",m=")"}O=T+E+w+(F||O)+")",g=0,y=0}M&&(S=!0,O+=";\n}catch(e){ret"+(n?"urn ":"+=")+h+"j._err(e,view,"+M+")"+m+";}"+(n?"":"ret=ret"))}O="// "+_+"\nvar v"+(d?",t=j._tag":"")+(p?",c=j._cnvt":"")+(u?",h=j._html":"")+(n?";\n":',ret=""\n')+(q.debug?"debugger;":"")+O+(n?"\n":";\nreturn ret;"),ae.debugMode!==!1&&(O="try {\n"+O+"\n}catch(e){\nreturn j._err(e, view);\n}");try{O=new Function("data,view,j,u",O)}catch(B){I("Compiled template code:\n\n"+O+'\n: "'+B.message+'"')}return t&&(t.fn=O,t.useViews=!!S),O}function B(e,t){return e&&e!==t?t?u(u({},t),e):e:t&&u({},t)}function L(e){return Ee[e]||(Ee[e]="&#"+e.charCodeAt(0)+";")}function Q(e){var t,n,r=[];if(typeof e===Fe)for(t in e)n=e[t],t!==Y&&e.hasOwnProperty(t)&&!ee(n)&&r.push({key:t,prop:n});return r}function H(e,n,r){var i=this.jquery&&(this[0]||S("Unknown template")),o=i.getAttribute(Se);return E.call(o?t.data(i)[Ie]:ne(i),e,n,r)}function D(e){return void 0!=e?Ae.test(e)&&(""+e).replace($e,L)||e:""}var Z=t===!1;t=t&&t.fn?t:e.jQuery;var z,G,W,X,Y,ee,te,ne,re,ie,oe,se,ae,de,ue,le,pe,ce,fe,ge,ve,he,me="v0.9.83",we=/^(!*?)(?:null|true|false|\d[\d.]*|([\w$]+|\.|~([\w$]+)|#(view|([\w$]+))?)([\w$.^]*?)(?:[.[^]([\w$]+)\]?)?)$/g,xe=/(\()(?=\s*\()|(?:([([])\s*)?(?:(\^?)(!*?[#~]?[\w$.^]+)?\s*((\+\+|--)|\+|-|&&|\|\||===|!==|==|!=|<=|>=|[<>%*:?\/]|(=))\s*|(!*?[#~]?[\w$.^]+)([([])?)|(,\s*)|(\(?)\\?(?:(')|("))|(?:\s*(([)\]])(?=\s*[.^]|\s*$|[^([])|[)\]])([([]?))|(\s+)/g,_e=/[ \t]*(\r\n|\n|\r)/g,be=/\\(['"])/g,ye=/['"\\]/g,ke=/(?:\x08|^)(onerror:)?(?:(~?)(([\w$_\.]+):)?([^\x08]+))\x08(,)?([^\x08]+)/gi,je=/^if\s/,Ce=/<(\w+)[>\s]/,Te=/[\x00`><"'&=]/g,Ae=/[\x00`><\"'&=]/,Ve=/^on[A-Z]|^convert(Back)?$/,Re=/^\#\d+_`[\s\S]*\/\d+_`$/,$e=Te,Me=0,Ee={"&":"&amp;","<":"&lt;",">":"&gt;","\0":"&#0;","'":"&#39;",'"':"&#34;","`":"&#96;","=":"&#61;"},Ne="html",Fe="object",Se="data-jsv-tmpl",Ie="jsvTmpl",Oe="For #index in nested block use #getIndex().",Ue={},qe=e.jsrender,Je=qe&&t&&!t.render,Ke={template:{compile:j},tag:{compile:y},viewModel:{compile:A},helper:{},converter:{}};if(X={jsviews:me,sub:{View:_,Err:d,tmplFn:O,parse:K,extend:u,extendCtx:B,syntaxErr:I,onStore:{},addSetting:$,settings:{allowCode:!1},advSet:s,_ths:i,_tg:function(){},_cnvt:h,_tag:x,_er:S,_err:F,_html:D,_cp:o,_sq:function(e){return"constructor"===e&&I(""),e}},settings:{delimiters:l,advanced:function(e){return e?(u(de,e),se.advSet(),ue):de}},getCtx:o,map:M},(d.prototype=new Error).constructor=d,c.depends=function(){return[this.get("item"),"index"]},f.depends="index",_.prototype={get:p,getIndex:f,getRsc:w,getTmpl:v,hlp:g,_is:"view"},se=X.sub,ue=X.settings,!(qe||t&&t.render)){for(z in Ke)R(z,Ke[z]);re=X.converters,ie=X.helpers,oe=X.tags,se._tg.prototype={baseApply:k,cvtArgs:m},W=se.topView=new _,t?(t.fn.render=H,Y=t.expando,t.observable&&(u(se,t.views.sub),X.map=t.views.map)):(t={},Z&&(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)},se._jq=function(e){e!==t&&(u(e,t),t=e,t.fn.render=H,delete t.jsrender,Y=t.expando)},t.jsrender=me),ae=se.settings,ae.allowCode=!1,ee=t.isFunction,t.render=Ue,t.views=X,t.templates=ne=X.templates;for(ve in ae)$(ve);(ue.debugMode=function(e){return void 0===e?ae.debugMode:(ae.debugMode=e,ae.onError=e+""===e?new Function("","return '"+e+"';"):ee(e)?e:void 0,ue)})(!1),de=ae.advanced={useViews:!1,_jsv:!1},oe({"if":{render:function(e){var t=this,n=t.tagCtx,r=t.rendering.done||!e&&(arguments.length||!n.index)?"":(t.rendering.done=!0,t.selected=n.index,n.render(n.view,!0));return r},flow:!0},"for":{render:function(e){var t,n=!arguments.length,r=this,i=r.tagCtx,o="",s=0;return r.rendering.done||(t=n?i.view.data:e,void 0!==t&&(o+=i.render(t,n),s+=te(t)?t.length:1),(r.rendering.done=s)&&(r.selected=i.index)),o},flow:!0},props:{baseTag:"for",dataMap:M(Q),flow:!0},include:{flow:!0},"*":{render:o,flow:!0},":*":{render:o,flow:!0},dbg:ie.dbg=re.dbg=a}),re({html:D,attr:D,url:function(e){return void 0!=e?encodeURI(""+e):null===e?e:""}})}return ae=se.settings,te=(t||qe).isArray,ue.delimiters("{{","}}","^"),Je&&qe.views.sub._jq(t),t||qe},window);
4
+ //# sourceMappingURL=jsrender.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["jsrender.js"],"names":["factory","global","$","jQuery","exports","module","fn","define","amd","getDerivedMethod","baseMethod","method","ret","tag","this","prevBase","base","apply","arguments","getMethod","$isFunction","_d","noop","tagHandlersFromProps","tagCtx","prop","props","rHasHandlers","test","retVal","val","dbgBreak","console","log","e","baseApply","JsViewsError","message","name","link","$extend","target","source","$viewsDelimiters","openChars","closeChars","$isArray","$views","$subSettings","delimiters","linkChar","charAt","delimOpenChar0","delimOpenChar1","delimCloseChar0","delimCloseChar1","rTag","$sub","RegExp","rTmpl","$viewsSettings","getView","inner","type","undefined","views","i","l","found","view","root","_","useKey","get","length","parent","getNestedIndex","index","getIndex","getHelper","helper","isContextCb","wrapped","deps","res","ctx","$helpers","_cp","_ceo","unshift","getCtx","_wrp","getTemplate","tmpl","getRsc","$templates","convertVal","converter","onError","value","boundTag","bnds","linkCtx","args","data","_tg","inline","bnd","unlinked","tagName","cvt","flow","extendCtx","_er","cvtArgs","onRender","convertArgs","convert","error","slice","depends","getDeps","getResource","resourceType","itemName","store","renderTag","parentView","tagCtxs","isUpdate","topView","tagDef","template","tags","attr","parentTag","itemRet","tagCtxCtx","content","callInit","mapDef","thisMap","initialTmpl","tagDataMap","contentCtx","parentTmpl","_is","tmpls","render","renderContent","getTmpl","_ctr","init","dataMap","arrVws","dataBoundOnly","map","parents","parentTags","rendering","src","unmap","tgt","noVws","HTML","linked","linkedElem","rWrappedInViewMarker","renderWithViews","templates","$converters","html","View","context","key","contentTmpl","parentView_","self_","self","isArray","id","viewId","indexStr","push","splice","compileChildResources","storeName","storeNames","resources","jsvStores","compileTag","Tag","baseTag","compiledDef","$tags","prototype","constructor","_parentTmpl","compileTmpl","options","lookupTemplate","currentName","nodeType","elem","document","getElementById","find","innerHTML","getAttribute","tmplAttr","jsvTmpl","tmplName","setAttribute","compiledTmpl","tmplOrMarkup","markup","tmplObject","tmplFn","replace","rEscapeQuotes","$render","getDefaultVal","defaultVal","isFunction","call","unmapArray","modelArr","arr","compileViewModel","GetNew","vm","iterate","action","j","getterType","ob","m","getters","getter","viewModels","JSON","parse","merge","viewModel","$expando","getterNames","mod","assigned","newModArr","model","$observable","refresh","concat","extend","proto","body","observable","privField","setProperty","set","Function","htmlTag","wrapMap","$subSettingsAdvanced","_wm","links","rFirstElem","exec","toLowerCase","div","trim","registerStore","storeSettings","theStore","item","onStore","compile","thisStore","OBJECT","getTgt","addSetting","st","Map","baseMap","noIteration","isTopRenderCall","prevData","prevIndex","result","isRenderCall","useViews","setItemVar","newCtx","itemVar","newView","childView","itemResult","swapContent","outerOnRender","syntaxError","helpers","it","onRenderError","fallback","Err","isLinkExpr","convertBack","hasElse","pushprecedingContent","shift","loc","substr","rNewLine","blockTagCheck","block","parseTag","all","bind","colon","codeTag","params","slash","bind2","closeBlock","pathBindings","ctxProps","paramsArgs","paramsProps","paramsCtxProps","useTrigger","allowCode","rUnescapeQuotes","rTestElseIf","current","substring","stack","pop","parseParams","rBuildHash","onerror","isCtx","keyToken","keyValue","arg","param","hasHandlers","newNode","parsedParam","bindings","astTop","buildCode","setPaths","pathsArr","paths","hasOwnProperty","skp","paramStructure","parts","parseTokens","lftPrn0","lftPrn","bound","path","operator","err","eq","path2","prn","comma","lftPrn2","apos","quot","rtPrn","rtPrnDot","prn2","space","full","parsePath","allPath","not","object","viewProperty","pathTokens","leafToken","subPath","binds","named","bindto","_jsvto","bndCtx","bd","theOb","_jsv","sb","pathStart","parenDepth","expr","exprFn","newOb","rtSq","aposed","quoted","boundName","bndStack","prm","tmplLinks","indexOf","paramIndex","split","join","rPath","fnCall","0","rParams","ast","node","hasTag","hasEncoder","getsVal","hasCnvt","useCnvt","tmplBindings","boundOnErrStart","boundOnErrEnd","tagRender","nestedTmpls","nestedTmpl","tagAndElses","nextIsElse","oldCode","isElse","isGetVal","tagCtxFn","tagStart","trigger","tmplBindingKey","converters","code","tmplOptions","debug","_tag","debugMode","parentContext","getCharEntity","ch","charEntities","charCodeAt","getTargetProps","$fnRender","tmplElem","jquery","htmlEncode","text","rIsHtml","rHtmlEncode","setGlobals","jsvStoreName","setting","versionNumber","rAttrEncode","&","<",">","\u0000","'","\"","`","=","jsr","jsrender","jsrToJq","jsviews","sub","syntaxErr","settings","advSet","_ths","_cnvt","_err","_html","_sq","token","advanced","Error","hlp","expando","renderFile","__express","Array","obj","_jq","jq","if","done","selected","for","finalElse","include","*",":*","dbg","url","encodeURI","window"],"mappings":";;CAaC,SAASA,EAASC,GAElB,GAAIC,GAAID,EAAOE,MAEQ,iBAAZC,SACVC,OAAOD,QAAUF,EACdF,EAAQC,EAAQC,GAChB,SAASA,GACV,GAAIA,IAAMA,EAAEI,GACX,KAAM,wBAEP,OAAON,GAAQC,EAAQC,IAEG,kBAAXK,SAAyBA,OAAOC,IACjDD,OAAO,WACN,MAAOP,GAAQC,KAGhBD,EAAQC,GAAQ,IAKlB,SAASA,EAAQC,GACjB,YAsHA,SAASO,GAAiBC,EAAYC,GACrC,MAAO,YACN,GAAIC,GACHC,EAAMC,KACNC,EAAWF,EAAIG,IAKhB,OAHAH,GAAIG,KAAON,EACXE,EAAMD,EAAOM,MAAMJ,EAAKK,WACxBL,EAAIG,KAAOD,EACJH,GAIT,QAASO,GAAUT,EAAYC,GAc9B,MAXIS,IAAYT,KACfA,EAASF,EACNC,EAEEA,EAAWW,GACVX,EACAD,EAAiBa,EAAMZ,GAHxBY,EAIHX,GAEFA,EAAOU,GAAK,GAENV,EAGR,QAASY,GAAqBV,EAAKW,GAClC,IAAK,GAAIC,KAAQD,GAAOE,MACnBC,GAAaC,KAAKH,KACrBZ,EAAIY,GAAQN,EAAUN,EAAIY,GAAOD,EAAOE,MAAMD,KAOjD,QAASI,GAAOC,GACf,MAAOA,GAGR,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AEZA,GAAKkd,IACTmC","file":"jsrender.min.js","sourcesContent":["/*! JsRender v0.9.83 (Beta): http://jsviews.com/#jsrender */\n/*! **VERSION FOR WEB** (For NODE.JS see http://jsviews.com/download/jsrender-node.js) */\n/*\n * Best-of-breed templating in browser or on Node.js.\n * Does not require jQuery, or HTML DOM\n * Integrates with JsViews (http://jsviews.com/#jsviews)\n *\n * Copyright 2016, Boris Moore\n * Released under the MIT License.\n */\n\n//jshint -W018, -W041\n\n(function(factory, global) {\n\t// global var is the this object, which is window when running in the usual browser environment\n\tvar $ = global.jQuery;\n\n\tif (typeof exports === \"object\") { // CommonJS e.g. Browserify\n\t\tmodule.exports = $\n\t\t\t? factory(global, $)\n\t\t\t: function($) { // If no global jQuery, take optional jQuery passed as parameter: require('jsrender')(jQuery)\n\t\t\t\tif ($ && !$.fn) {\n\t\t\t\t\tthrow \"Provide jQuery or null\";\n\t\t\t\t}\n\t\t\t\treturn factory(global, $);\n\t\t\t};\n\t} else if (typeof define === \"function\" && define.amd) { // AMD script loader, e.g. RequireJS\n\t\tdefine(function() {\n\t\t\treturn factory(global);\n\t\t});\n\t} else { // Browser using plain <script> tag\n\t\tfactory(global, false);\n\t}\n} (\n\n// factory (for jsrender.js)\nfunction(global, $) {\n\"use strict\";\n\n//========================== Top-level vars ==========================\n\n// global var is the this object, which is window when running in the usual browser environment\nvar setGlobals = $ === false; // Only set globals if script block in browser (not AMD and not CommonJS)\n\n$ = $ && $.fn ? $ : global.jQuery; // $ is jQuery passed in by CommonJS loader (Browserify), or global jQuery.\n\nvar versionNumber = \"v0.9.83\",\n\tjsvStoreName, rTag, rTmplString, topView, $views,\t$expando,\n\n//TODO\ttmplFnsCache = {},\n\t$isFunction, $isArray, $templates, $converters, $helpers, $tags, $sub, $subSettings, $subSettingsAdvanced, $viewsSettings, delimOpenChar0, delimOpenChar1, delimCloseChar0, delimCloseChar1, linkChar, setting, baseOnError,\n\n\trPath = /^(!*?)(?:null|true|false|\\d[\\d.]*|([\\w$]+|\\.|~([\\w$]+)|#(view|([\\w$]+))?)([\\w$.^]*?)(?:[.[^]([\\w$]+)\\]?)?)$/g,\n\t// not object helper view viewProperty pathTokens leafToken\n\n\trParams = /(\\()(?=\\s*\\()|(?:([([])\\s*)?(?:(\\^?)(!*?[#~]?[\\w$.^]+)?\\s*((\\+\\+|--)|\\+|-|&&|\\|\\||===|!==|==|!=|<=|>=|[<>%*:?\\/]|(=))\\s*|(!*?[#~]?[\\w$.^]+)([([])?)|(,\\s*)|(\\(?)\\\\?(?:(')|(\"))|(?:\\s*(([)\\]])(?=\\s*[.^]|\\s*$|[^([])|[)\\]])([([]?))|(\\s+)/g,\n\t// lftPrn0 lftPrn bound path operator err eq path2 prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space\n\t// (left paren? followed by (path? followed by operator) or (path followed by left paren?)) or comma or apos or quot or right paren or space\n\n\tisRenderCall,\n\trNewLine = /[ \\t]*(\\r\\n|\\n|\\r)/g,\n\trUnescapeQuotes = /\\\\(['\"])/g,\n\trEscapeQuotes = /['\"\\\\]/g, // Escape quotes and \\ character\n\trBuildHash = /(?:\\x08|^)(onerror:)?(?:(~?)(([\\w$_\\.]+):)?([^\\x08]+))\\x08(,)?([^\\x08]+)/gi,\n\trTestElseIf = /^if\\s/,\n\trFirstElem = /<(\\w+)[>\\s]/,\n\trAttrEncode = /[\\x00`><\"'&=]/g, // Includes > encoding since rConvertMarkers in JsViews does not skip > characters in attribute strings\n\trIsHtml = /[\\x00`><\\\"'&=]/,\n\trHasHandlers = /^on[A-Z]|^convert(Back)?$/,\n\trWrappedInViewMarker = /^\\#\\d+_`[\\s\\S]*\\/\\d+_`$/,\n\trHtmlEncode = rAttrEncode,\n\tviewId = 0,\n\tcharEntities = {\n\t\t\"&\": \"&amp;\",\n\t\t\"<\": \"&lt;\",\n\t\t\">\": \"&gt;\",\n\t\t\"\\x00\": \"&#0;\",\n\t\t\"'\": \"&#39;\",\n\t\t'\"': \"&#34;\",\n\t\t\"`\": \"&#96;\",\n\t\t\"=\": \"&#61;\"\n\t},\n\tHTML = \"html\",\n\tOBJECT = \"object\",\n\ttmplAttr = \"data-jsv-tmpl\",\n\tjsvTmpl = \"jsvTmpl\",\n\tindexStr = \"For #index in nested block use #getIndex().\",\n\t$render = {},\n\n\tjsr = global.jsrender,\n\tjsrToJq = jsr && $ && !$.render, // JsRender already loaded, without jQuery. but we will re-load it now to attach to jQuery\n\n\tjsvStores = {\n\t\ttemplate: {\n\t\t\tcompile: compileTmpl\n\t\t},\n\t\ttag: {\n\t\t\tcompile: compileTag\n\t\t},\n\t\tviewModel: {\n\t\t\tcompile: compileViewModel\n\t\t},\n\t\thelper: {},\n\t\tconverter: {}\n\t};\n\n\t// views object ($.views if jQuery is loaded, jsrender.views if no jQuery, e.g. in Node.js)\n\t$views = {\n\t\tjsviews: versionNumber,\n\t\tsub: {\n\t\t\t// subscription, e.g. JsViews integration\n\t\t\tView: View,\n\t\t\tErr: JsViewsError,\n\t\t\ttmplFn: tmplFn,\n\t\t\tparse: parseParams,\n\t\t\textend: $extend,\n\t\t\textendCtx: extendCtx,\n\t\t\tsyntaxErr: syntaxError,\n\t\t\tonStore: {},\n\t\t\taddSetting: addSetting,\n\t\t\tsettings: {\n\t\t\t\tallowCode: false\n\t\t\t},\n\t\t\tadvSet: noop, // Update advanced settings\n\t\t\t_ths: tagHandlersFromProps,\n\t\t\t_tg: function() {}, // Constructor for tagDef\n\t\t\t_cnvt: convertVal,\n\t\t\t_tag: renderTag,\n\t\t\t_er: error,\n\t\t\t_err: onRenderError,\n\t\t\t_html: htmlEncode,\n\t\t\t_cp: retVal, // Get compiled contextual parameters (or properties) ~foo=expr. In JsRender, simply returns val.\n\t\t\t_sq: function(token) {\n\t\t\t\tif (token === \"constructor\") {\n\t\t\t\t\tsyntaxError(\"\");\n\t\t\t\t}\n\t\t\t\treturn token;\n\t\t\t}\n\t\t},\n\t\tsettings: {\n\t\t\tdelimiters: $viewsDelimiters,\n\t\t\tadvanced: function(value) {\n\t\t\t\treturn value\n\t\t\t\t\t? (\n\t\t\t\t\t\t\t$extend($subSettingsAdvanced, value),\n\t\t\t\t\t\t\t$sub.advSet(),\n\t\t\t\t\t\t\t$viewsSettings\n\t\t\t\t\t\t)\n\t\t\t\t\t\t: $subSettingsAdvanced;\n\t\t\t\t}\n\t\t},\n\t\tgetCtx: retVal, // Get ctx.foo value. In JsRender, simply returns val.\n\t\tmap: dataMap // If jsObservable loaded first, use that definition of dataMap\n\t};\n\nfunction getDerivedMethod(baseMethod, method) {\n\treturn function() {\n\t\tvar ret,\n\t\t\ttag = this,\n\t\t\tprevBase = tag.base;\n\n\t\ttag.base = baseMethod; // Within method call, calling this.base will call the base method\n\t\tret = method.apply(tag, arguments); // Call the method\n\t\ttag.base = prevBase; // Replace this.base to be the base method of the previous call, for chained calls\n\t\treturn ret;\n\t};\n}\n\nfunction getMethod(baseMethod, method) {\n\t// For derived methods (or handlers declared declaratively as in {{:foo onChange=~fooChanged}} replace by a derived method, to allow using this.base(...)\n\t// or this.baseApply(arguments) to call the base implementation. (Equivalent to this._super(...) and this._superApply(arguments) in jQuery UI)\n\tif ($isFunction(method)) {\n\t\tmethod = getDerivedMethod(\n\t\t\t\t!baseMethod\n\t\t\t\t\t? noop // no base method implementation, so use noop as base method\n\t\t\t\t\t: baseMethod._d\n\t\t\t\t\t\t? baseMethod // baseMethod is a derived method, so us it\n\t\t\t\t\t\t: getDerivedMethod(noop, baseMethod), // baseMethod is not derived so make its base method be the noop method\n\t\t\t\tmethod\n\t\t\t);\n\t\tmethod._d = 1; // Add flag that this is a derived method\n\t}\n\treturn method;\n}\n\nfunction tagHandlersFromProps(tag, tagCtx) {\n\tfor (var prop in tagCtx.props) {\n\t\tif (rHasHandlers.test(prop)) {\n\t\t\ttag[prop] = getMethod(tag[prop], tagCtx.props[prop]);\n\t\t\t// Copy over the onFoo props, convert and convertBack from tagCtx.props to tag (overrides values in tagDef).\n\t\t\t// Note: unsupported scenario: if handlers are dynamically added ^onFoo=expression this will work, but dynamically removing will not work.\n\t\t}\n\t}\n}\n\nfunction retVal(val) {\n\treturn val;\n}\n\nfunction noop() {\n\treturn \"\";\n}\n\nfunction dbgBreak(val) {\n\t// Usage examples: {{dbg:...}}, {{:~dbg(...)}}, {{dbg .../}}, {^{for ... onAfterLink=~dbg}} etc.\n\ttry {\n\t\tconsole.log(\"JsRender dbg breakpoint: \" + val);\n\t\tthrow \"dbg breakpoint\"; // To break here, stop on caught exceptions.\n\t}\n\tcatch (e) {}\n\treturn this.base ? this.baseApply(arguments) : val;\n}\n\nfunction JsViewsError(message) {\n\t// Error exception type for JsViews/JsRender\n\t// Override of $.views.sub.Error is possible\n\tthis.name = ($.link ? \"JsViews\" : \"JsRender\") + \" Error\";\n\tthis.message = message || this.name;\n}\n\nfunction $extend(target, source) {\n\tfor (var name in source) {\n\t\ttarget[name] = source[name];\n\t}\n\treturn target;\n}\n\n(JsViewsError.prototype = new Error()).constructor = JsViewsError;\n\n//========================== Top-level functions ==========================\n\n//===================\n// views.delimiters\n//===================\n\nfunction $viewsDelimiters(openChars, closeChars, link) {\n\t// Set the tag opening and closing delimiters and 'link' character. Default is \"{{\", \"}}\" and \"^\"\n\t// openChars, closeChars: opening and closing strings, each with two characters\n\tif (!openChars) {\n\t\treturn $subSettings.delimiters;\n\t}\n\tif ($isArray(openChars)) {\n\t\treturn $viewsDelimiters.apply($views, openChars);\n\t}\n\n\t$subSettings.delimiters = [openChars, closeChars, linkChar = link ? link.charAt(0) : linkChar];\n\n\tdelimOpenChar0 = openChars.charAt(0); // Escape the characters - since they could be regex special characters\n\tdelimOpenChar1 = openChars.charAt(1);\n\tdelimCloseChar0 = closeChars.charAt(0);\n\tdelimCloseChar1 = closeChars.charAt(1);\n\topenChars = \"\\\\\" + delimOpenChar0 + \"(\\\\\" + linkChar + \")?\\\\\" + delimOpenChar1; // Default is \"{^{\"\n\tcloseChars = \"\\\\\" + delimCloseChar0 + \"\\\\\" + delimCloseChar1; // Default is \"}}\"\n\t// Build regex with new delimiters\n\t// [tag (followed by / space or }) or cvtr+colon or html or code] followed by space+params then convertBack?\n\trTag = \"(?:(\\\\w+(?=[\\\\/\\\\s\\\\\" + delimCloseChar0 + \"]))|(\\\\w+)?(:)|(>)|(\\\\*))\\\\s*((?:[^\\\\\"\n\t\t+ delimCloseChar0 + \"]|\\\\\" + delimCloseChar0 + \"(?!\\\\\" + delimCloseChar1 + \"))*?)\";\n\n\t// Make rTag available to JsViews (or other components) for parsing binding expressions\n\t$sub.rTag = \"(?:\" + rTag + \")\";\n\t// { ^? { tag+params slash? or closingTag or comment\n\trTag = new RegExp(\"(?:\" + openChars + rTag + \"(\\\\/)?|\\\\\" + delimOpenChar0 + \"(\\\\\" + linkChar + \")?\\\\\" + delimOpenChar1 + \"(?:(?:\\\\/(\\\\w+))\\\\s*|!--[\\\\s\\\\S]*?--))\" + closeChars, \"g\");\n\n\t// Default: bind tagName cvt cln html code params slash bind2 closeBlk comment\n\t// /(?:{(\\^)?{(?:(\\w+(?=[\\/\\s}]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^}]|}(?!}))*?)(\\/)?|{(\\^)?{(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))}}\n\n\t$sub.rTmpl = new RegExp(\"<.*>|([^\\\\\\\\]|^)[{}]|\" + openChars + \".*\" + closeChars);\n\t// $sub.rTmpl looks for html tags or { or } char not preceded by \\\\, or JsRender tags {{xxx}}. Each of these strings are considered\n\t// NOT to be jQuery selectors\n\treturn $viewsSettings;\n}\n\n//=========\n// View.get\n//=========\n\nfunction getView(inner, type) { //view.get(inner, type)\n\tif (!type && inner !== true) {\n\t\t// view.get(type)\n\t\ttype = inner;\n\t\tinner = undefined;\n\t}\n\n\tvar views, i, l, found,\n\t\tview = this,\n\t\troot = !type || type === \"root\";\n\t\t// If type is undefined, returns root view (view under top view).\n\n\tif (inner) {\n\t\t// Go through views - this one, and all nested ones, depth-first - and return first one with given type.\n\t\t// If type is undefined, i.e. view.get(true), return first child view.\n\t\tfound = type && view.type === type && view;\n\t\tif (!found) {\n\t\t\tviews = view.views;\n\t\t\tif (view._.useKey) {\n\t\t\t\tfor (i in views) {\n\t\t\t\t\tif (found = type ? views[i].get(inner, type) : views[i]) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (i = 0, l = views.length; !found && i < l; i++) {\n\t\t\t\t\tfound = type ? views[i].get(inner, type) : views[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else if (root) {\n\t\t// Find root view. (view whose parent is top view)\n\t\twhile (view.parent) {\n\t\t\tfound = view;\n\t\t\tview = view.parent;\n\t\t}\n\t} else {\n\t\twhile (view && !found) {\n\t\t\t// Go through views - this one, and all parent ones - and return first one with given type.\n\t\t\tfound = view.type === type ? view : undefined;\n\t\t\tview = view.parent;\n\t\t}\n\t}\n\treturn found;\n}\n\nfunction getNestedIndex() {\n\tvar view = this.get(\"item\");\n\treturn view ? view.index : undefined;\n}\n\ngetNestedIndex.depends = function() {\n\treturn [this.get(\"item\"), \"index\"];\n};\n\nfunction getIndex() {\n\treturn this.index;\n}\n\ngetIndex.depends = \"index\";\n\n//==========\n// View.hlp\n//==========\n\nfunction getHelper(helper, isContextCb) {\n\t// Helper method called as view.hlp(key) from compiled template, for helpers or template parameters ~foo\n\tvar wrapped, deps,\n\tview = this,\n\tres = view.ctx;\n\n\tif (res) {\n\t\tres = res[helper];\n\t}\n\tif (res === undefined) {\n\t\tres = $helpers[helper];\n\t}\n\tif (res && res._cp) { // If this helper resource is a contextual parameter, ~foo=expr\n\t\tif (isContextCb) { // In a context callback for a contextual param, return the [view, dependencies...] array - needed for observe call\n\t\t\tdeps = $sub._ceo(res[1].deps); // fn deps, with any exprObs cloned\n\t\t\tdeps.unshift(res[0]); // view\n\t\t\tdeps._cp = true;\n\t\t\treturn deps;\n\t\t}\n\t\tres = $views.getCtx(res); // If a contextual param, but not a context callback, return evaluated param - fn(data, view, j)\n\t}\n\n\tif (res) {\n\t\tif ($isFunction(res) && !res._wrp) {\n\t\t\t// If it is of type function, and not already wrapped, we will wrap it, so if called with no this pointer it will be called with the\n\t\t\t// view as 'this' context. If the helper ~foo() was in a data-link expression, the view will have a 'temporary' linkCtx property too.\n\t\t\t// Note that helper functions on deeper paths will have specific this pointers, from the preceding path.\n\t\t\t// For example, ~util.foo() will have the ~util object as 'this' pointer\n\t\t\twrapped = function() {\n\t\t\t\treturn res.apply((!this || this === global) ? view : this, arguments);\n\t\t\t};\n\t\t\twrapped._wrp = view;\n\t\t\t$extend(wrapped, res); // Attach same expandos (if any) to the wrapped function\n\t\t}\n\t}\n\treturn wrapped || res;\n}\n\nfunction getTemplate(tmpl) {\n\treturn tmpl && (tmpl.fn\n\t\t? tmpl\n\t\t: this.getRsc(\"templates\", tmpl) || $templates(tmpl)); // not yet compiled\n}\n\n//==============\n// views._cnvt\n//==============\n\nfunction convertVal(converter, view, tagCtx, onError) {\n\t// self is template object or linkCtx object\n\tvar tag, value,\n\t\t// if tagCtx is an integer, then it is the key for the compiled function to return the boundTag tagCtx\n\t\tboundTag = typeof tagCtx === \"number\" && view.tmpl.bnds[tagCtx-1],\n\t\tlinkCtx = view.linkCtx; // For data-link=\"{cvt:...}\"...\n\n\tif (onError !== undefined) {\n\t\ttagCtx = onError = {props: {}, args: [onError]};\n\t} else if (boundTag) {\n\t\ttagCtx = boundTag(view.data, view, $sub);\n\t}\n\n\tvalue = tagCtx.args[0];\n\tif (converter || boundTag) {\n\t\ttag = linkCtx && linkCtx.tag;\n\t\tif (!tag) {\n\t\t\ttag = $extend(new $sub._tg(), {\n\t\t\t\t_: {\n\t\t\t\t\tinline: !linkCtx,\n\t\t\t\t\tbnd: boundTag,\n\t\t\t\t\tunlinked: true\n\t\t\t\t},\n\t\t\t\ttagName: \":\",\n\t\t\t\tcvt: converter,\n\t\t\t\tflow: true,\n\t\t\t\ttagCtx: tagCtx\n\t\t\t});\n\t\t\tif (linkCtx) {\n\t\t\t\tlinkCtx.tag = tag;\n\t\t\t\ttag.linkCtx = linkCtx;\n\t\t\t}\n\t\t\ttagCtx.ctx = extendCtx(tagCtx.ctx, (linkCtx ? linkCtx.view : view).ctx);\n\t\t}\n\t\ttag._er = onError && value;\n\t\ttagHandlersFromProps(tag, tagCtx);\n\n\t\ttagCtx.view = view;\n\n\t\ttag.ctx = tagCtx.ctx || tag.ctx || {};\n\t\ttagCtx.ctx = undefined;\n\n\t\tvalue = tag.cvtArgs(converter !== \"true\" && converter)[0]; // If there is a convertBack but no convert, converter will be \"true\"\n\n\t\t// Call onRender (used by JsViews if present, to add binding annotations around rendered content)\n\t\tvalue = boundTag && view._.onRender\n\t\t\t? view._.onRender(value, view, tag)\n\t\t\t: value;\n\t}\n\treturn value != undefined ? value : \"\";\n}\n\nfunction convertArgs(converter) {\n\tvar tag = this,\n\t\ttagCtx = tag.tagCtx,\n\t\tview = tagCtx.view,\n\t\targs = tagCtx.args;\n\n\tconverter = converter || tag.convert;\n\tconverter = converter && (\"\" + converter === converter\n\t\t? (view.getRsc(\"converters\", converter) || error(\"Unknown converter: '\" + converter + \"'\"))\n\t\t: converter);\n\n\targs = !args.length && !tagCtx.index // On the opening tag with no args, bind to the current data context\n\t\t? [view.data]\n\t\t: converter\n\t\t\t? args.slice() // If there is a converter, use a copy of the tagCtx.args array for rendering, and replace the args[0] in\n\t\t\t// the copied array with the converted value. But we do not modify the value of tag.tagCtx.args[0] (the original args array)\n\t\t\t: args; // If no converter, get the original tagCtx.args\n\n\tif (converter) {\n\t\tif (converter.depends) {\n\t\t\ttag.depends = $sub.getDeps(tag.depends, tag, converter.depends, converter);\n\t\t}\n\t\targs[0] = converter.apply(tag, args);\n\t}\n\treturn args;\n}\n\n//=============\n// views._tag\n//=============\n\nfunction getResource(resourceType, itemName) {\n\tvar res, store,\n\t\tview = this;\n\twhile ((res === undefined) && view) {\n\t\tstore = view.tmpl && view.tmpl[resourceType];\n\t\tres = store && store[itemName];\n\t\tview = view.parent;\n\t}\n\treturn res || $views[resourceType][itemName];\n}\n\nfunction renderTag(tagName, parentView, tmpl, tagCtxs, isUpdate, onError) {\n\tparentView = parentView || topView;\n\tvar tag, tag_, tagDef, template, tags, attr, parentTag, i, l, itemRet, tagCtx, tagCtxCtx,\n\t\tcontent, callInit, mapDef, thisMap, args, props, initialTmpl, tagDataMap, contentCtx,\n\t\tret = \"\",\n\t\tlinkCtx = parentView.linkCtx || 0,\n\t\tctx = parentView.ctx,\n\t\tparentTmpl = tmpl || parentView.tmpl,\n\t\t// if tagCtx is an integer, then it is the key for the compiled function to return the boundTag tagCtxs\n\t\tboundTag = typeof tagCtxs === \"number\" && parentView.tmpl.bnds[tagCtxs-1];\n\n\tif (tagName._is === \"tag\") {\n\t\ttag = tagName;\n\t\ttagName = tag.tagName;\n\t\ttagCtxs = tag.tagCtxs;\n\t\ttemplate = tag.template;\n\t} else {\n\t\ttagDef = parentView.getRsc(\"tags\", tagName) || error(\"Unknown tag: {{\" + tagName + \"}} \");\n\t\ttemplate = tagDef.template;\n\t}\n\n\tif (onError !== undefined) {\n\t\tret += onError;\n\t\ttagCtxs = onError = [{props: {}, args: []}];\n\t} else if (boundTag) {\n\t\ttagCtxs = boundTag(parentView.data, parentView, $sub);\n\t}\n\n\tl = tagCtxs.length;\n\tfor (i = 0; i < l; i++) {\n\t\ttagCtx = tagCtxs[i];\n\t\tif (!linkCtx || !linkCtx.tag || i && !linkCtx.tag._.inline || tag._er) {\n\t\t\t// Initialize tagCtx\n\t\t\t// For block tags, tagCtx.tmpl is an integer > 0\n\t\t\tif (content = parentTmpl.tmpls && tagCtx.tmpl) {\n\t\t\t\tcontent = tagCtx.content = parentTmpl.tmpls[content - 1];\n\t\t\t}\n\t\t\ttagCtx.index = i;\n\t\t\ttagCtx.tmpl = content; // Set the tmpl property to the content of the block tag\n\t\t\ttagCtx.render = renderContent;\n\t\t\ttagCtx.view = parentView;\n\t\t\ttagCtx.ctx = extendCtx(tagCtx.ctx, ctx); // Clone and extend parentView.ctx\n\t\t}\n\t\tif (tmpl = tagCtx.props.tmpl) {\n\t\t\t// If the tmpl property is overridden, set the value (when initializing, or, in case of binding: ^tmpl=..., when updating)\n\t\t\ttagCtx.tmpl = parentView.getTmpl(tmpl);\n\t\t}\n\n\t\tif (!tag) {\n\t\t\t// This will only be hit for initial tagCtx (not for {{else}}) - if the tag instance does not exist yet\n\t\t\t// Instantiate tag if it does not yet exist\n\t\t\t// If the tag has not already been instantiated, we will create a new instance.\n\t\t\t// ~tag will access the tag, even within the rendering of the template content of this tag.\n\t\t\t// From child/descendant tags, can access using ~tag.parent, or ~parentTags.tagName\n\t\t\ttag = new tagDef._ctr();\n\t\t\tcallInit = !!tag.init;\n\n\t\t\ttag.parent = parentTag = ctx && ctx.tag;\n\t\t\ttag.tagCtxs = tagCtxs;\n\t\t\ttagDataMap = tag.dataMap;\n\n\t\t\tif (linkCtx) {\n\t\t\t\ttag._.inline = false;\n\t\t\t\tlinkCtx.tag = tag;\n\t\t\t\ttag.linkCtx = linkCtx;\n\t\t\t}\n\t\t\tif (tag._.bnd = boundTag || linkCtx.fn) {\n\t\t\t\t// Bound if {^{tag...}} or data-link=\"{tag...}\"\n\t\t\t\ttag._.arrVws = {};\n\t\t\t} else if (tag.dataBoundOnly) {\n\t\t\t\terror(\"{^{\" + tagName + \"}} tag must be data-bound\");\n\t\t\t}\n\t\t\t//TODO better perf for childTags() - keep child tag.tags array, (and remove child, when disposed)\n\t\t\t// tag.tags = [];\n\t\t}\n\t\ttagCtxs = tag.tagCtxs;\n\t\ttagDataMap = tag.dataMap;\n\n\t\ttagCtx.tag = tag;\n\t\tif (tagDataMap && tagCtxs) {\n\t\t\ttagCtx.map = tagCtxs[i].map; // Copy over the compiled map instance from the previous tagCtxs to the refreshed ones\n\t\t}\n\t\tif (!tag.flow) {\n\t\t\ttagCtxCtx = tagCtx.ctx = tagCtx.ctx || {};\n\n\t\t\t// tags hash: tag.ctx.tags, merged with parentView.ctx.tags,\n\t\t\ttags = tag.parents = tagCtxCtx.parentTags = ctx && extendCtx(tagCtxCtx.parentTags, ctx.parentTags) || {};\n\t\t\tif (parentTag) {\n\t\t\t\ttags[parentTag.tagName] = parentTag;\n\t\t\t\t//TODO better perf for childTags: parentTag.tags.push(tag);\n\t\t\t}\n\t\t\ttags[tag.tagName] = tagCtxCtx.tag = tag;\n\t\t}\n\t}\n\tif (!(tag._er = onError)) {\n\t\ttagHandlersFromProps(tag, tagCtxs[0]);\n\t\ttag.rendering = {}; // Provide object for state during render calls to tag and elses. (Used by {{if}} and {{for}}...)\n\t\tfor (i = 0; i < l; i++) {\n\t\t\ttagCtx = tag.tagCtx = tagCtxs[i];\n\t\t\tprops = tagCtx.props;\n\t\t\targs = tag.cvtArgs();\n\n\t\t\tif (mapDef = props.dataMap || tagDataMap) {\n\t\t\t\tif (args.length || props.dataMap) {\n\t\t\t\t\tthisMap = tagCtx.map;\n\t\t\t\t\tif (!thisMap || thisMap.src !== args[0] || isUpdate) {\n\t\t\t\t\t\tif (thisMap && thisMap.src) {\n\t\t\t\t\t\t\tthisMap.unmap(); // only called if observable map - not when only used in JsRender, e.g. by {{props}}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthisMap = tagCtx.map = mapDef.map(args[0], props, undefined, !tag._.bnd);\n\t\t\t\t\t}\n\t\t\t\t\targs = [thisMap.tgt];\n\t\t\t\t}\n\t\t\t}\n\t\t\ttag.ctx = tagCtx.ctx;\n\n\t\t\tif (!i) {\n\t\t\t\tif (callInit) {\n\t\t\t\t\tinitialTmpl = tag.template;\n\t\t\t\t\ttag.init(tagCtx, linkCtx, tag.ctx);\n\t\t\t\t\tcallInit = undefined;\n\t\t\t\t}\n\t\t\t\tif (linkCtx) {\n\t\t\t\t\t// Set attr on linkCtx to ensure outputting to the correct target attribute.\n\t\t\t\t\t// Setting either linkCtx.attr or this.attr in the init() allows per-instance choice of target attrib.\n\t\t\t\t\tlinkCtx.attr = tag.attr = linkCtx.attr || tag.attr;\n\t\t\t\t}\n\t\t\t\tattr = tag.attr;\n\t\t\t\ttag._.noVws = attr && attr !== HTML;\n\t\t\t}\n\n\t\t\titemRet = undefined;\n\t\t\tif (tag.render) {\n\t\t\t\titemRet = tag.render.apply(tag, args);\n\t\t\t\tif (parentView.linked && itemRet && tag.linkedElem && !rWrappedInViewMarker.test(itemRet)) {\n\t\t\t\t\t// When a tag renders content from the render method, with data linking, and has a linkedElem binding, then we need to wrap with\n\t\t\t\t\t// view markers, if absent, so the content is a view associated with the tag, which will correctly dispose bindings if deleted.\n\t\t\t\t\titemRet = renderWithViews($.templates(itemRet), args[0], undefined, undefined, parentView, undefined, undefined, tag);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!args.length) {\n\t\t\t\targs = [parentView]; // no arguments - (e.g. {{else}}) get data context from view.\n\t\t\t}\n\t\t\tif (itemRet === undefined) {\n\t\t\t\tcontentCtx = args[0]; // Default data context for wrapped block content is the first argument. Defined tag.contentCtx function to override this.\n\t\t\t\tif (tag.contentCtx) {\n\t\t\t\t\tcontentCtx = tag.contentCtx(contentCtx);\n\t\t\t\t}\n\t\t\t\titemRet = tagCtx.render(contentCtx, true) || (isUpdate ? undefined : \"\");\n\t\t\t}\n\t\t\t// No return value from render, and no template/content tagCtx.render(...), so return undefined\n\t\t\tret = ret ? ret + (itemRet || \"\") : itemRet; // If no rendered content, this will be undefined\n\t\t}\n\t\ttag.rendering = undefined;\n\t}\n\ttag.tagCtx = tagCtxs[0];\n\ttag.ctx = tag.tagCtx.ctx;\n\n\tif (tag._.noVws) {\n\t\t\tif (tag._.inline) {\n\t\t\t// inline tag with attr set to \"text\" will insert HTML-encoded content - as if it was element-based innerText\n\t\t\tret = attr === \"text\"\n\t\t\t\t? $converters.html(ret)\n\t\t\t\t: \"\";\n\t\t}\n\t}\n\treturn boundTag && parentView._.onRender\n\t\t// Call onRender (used by JsViews if present, to add binding annotations around rendered content)\n\t\t? parentView._.onRender(ret, parentView, tag)\n\t\t: ret;\n}\n\n//=================\n// View constructor\n//=================\n\nfunction View(context, type, parentView, data, template, key, onRender, contentTmpl) {\n\t// Constructor for view object in view hierarchy. (Augmented by JsViews if JsViews is loaded)\n\tvar views, parentView_, tag, self_,\n\t\tself = this,\n\t\tisArray = type === \"array\";\n\n\tself.content = contentTmpl;\n\tself.views = isArray ? [] : {};\n\tself.parent = parentView;\n\tself.type = type || \"top\";\n\tself.data = data;\n\tself.tmpl = template;\n\t// If the data is an array, this is an 'array view' with a views array for each child 'item view'\n\t// If the data is not an array, this is an 'item view' with a views 'hash' object for any child nested views\n\t// ._.useKey is non zero if is not an 'array view' (owning a data array). Use this as next key for adding to child views hash\n\tself_ = self._ = {\n\t\tkey: 0,\n\t\tuseKey: isArray ? 0 : 1,\n\t\tid: \"\" + viewId++,\n\t\tonRender: onRender,\n\t\tbnds: {}\n\t};\n\tself.linked = !!onRender;\n\tif (parentView) {\n\t\tviews = parentView.views;\n\t\tparentView_ = parentView._;\n\t\tif (parentView_.useKey) {\n\t\t\t// Parent is not an 'array view'. Add this view to its views object\n\t\t\t// self._key = is the key in the parent view hash\n\t\t\tviews[self_.key = \"_\" + parentView_.useKey++] = self;\n\t\t\tself.index = indexStr;\n\t\t\tself.getIndex = getNestedIndex;\n\t\t} else if (views.length === (self_.key = self.index = key)) { // Parent is an 'array view'. Add this view to its views array\n\t\t\tviews.push(self); // Adding to end of views array. (Using push when possible - better perf than splice)\n\t\t} else {\n\t\t\tviews.splice(key, 0, self); // Inserting in views array\n\t\t}\n\t\t// If no context was passed in, use parent context\n\t\t// If context was passed in, it should have been merged already with parent context\n\t\tself.ctx = context || parentView.ctx;\n\t} else {\n\t\tself.ctx = context;\n\t}\n}\n\nView.prototype = {\n\tget: getView,\n\tgetIndex: getIndex,\n\tgetRsc: getResource,\n\tgetTmpl: getTemplate,\n\thlp: getHelper,\n\t_is: \"view\"\n};\n\n//====================================================\n// Registration\n//====================================================\n\nfunction compileChildResources(parentTmpl) {\n\tvar storeName, storeNames, resources;\n\tfor (storeName in jsvStores) {\n\t\tstoreNames = storeName + \"s\";\n\t\tif (parentTmpl[storeNames]) {\n\t\t\tresources = parentTmpl[storeNames]; // Resources not yet compiled\n\t\t\tparentTmpl[storeNames] = {}; // Remove uncompiled resources\n\t\t\t$views[storeNames](resources, parentTmpl); // Add back in the compiled resources\n\t\t}\n\t}\n}\n\n//===============\n// compileTag\n//===============\n\nfunction compileTag(name, tagDef, parentTmpl) {\n\tvar tmpl, baseTag, prop,\n\t\tcompiledDef = new $sub._tg();\n\n\tfunction Tag() {\n\t\tvar tag = this;\n\t\ttag._ = {\n\t\t\tinline: true,\n\t\t\tunlinked: true\n\t\t};\n\n\t\ttag.tagName = name;\n\t}\n\n\tif ($isFunction(tagDef)) {\n\t\t// Simple tag declared as function. No presenter instantation.\n\t\ttagDef = {\n\t\t\tdepends: tagDef.depends,\n\t\t\trender: tagDef\n\t\t};\n\t} else if (\"\" + tagDef === tagDef) {\n\t\ttagDef = {template: tagDef};\n\t}\n\tif (baseTag = tagDef.baseTag) {\n\t\ttagDef.flow = !!tagDef.flow; // Set flow property, so defaults to false even if baseTag has flow=true\n\t\ttagDef.baseTag = baseTag = \"\" + baseTag === baseTag\n\t\t\t? (parentTmpl && parentTmpl.tags[baseTag] || $tags[baseTag])\n\t\t\t: baseTag;\n\n\t\tcompiledDef = $extend(compiledDef, baseTag);\n\n\t\tfor (prop in tagDef) {\n\t\t\tcompiledDef[prop] = getMethod(baseTag[prop], tagDef[prop]);\n\t\t}\n\t} else {\n\t\tcompiledDef = $extend(compiledDef, tagDef);\n\t}\n\n\t// Tag declared as object, used as the prototype for tag instantiation (control/presenter)\n\tif ((tmpl = compiledDef.template) !== undefined) {\n\t\tcompiledDef.template = \"\" + tmpl === tmpl ? ($templates[tmpl] || $templates(tmpl)) : tmpl;\n\t}\n\tif (compiledDef.init !== false) {\n\t\t// Set init: false on tagDef if you want to provide just a render method, or render and template, but no constructor or prototype.\n\t\t// so equivalent to setting tag to render function, except you can also provide a template.\n\t\t(Tag.prototype = compiledDef).constructor = compiledDef._ctr = Tag;\n\t}\n\n\tif (parentTmpl) {\n\t\tcompiledDef._parentTmpl = parentTmpl;\n\t}\n\treturn compiledDef;\n}\n\nfunction baseApply(args) {\n\t// In derived method (or handler declared declaratively as in {{:foo onChange=~fooChanged}} can call base method,\n\t// using this.baseApply(arguments) (Equivalent to this._superApply(arguments) in jQuery UI)\n\treturn this.base.apply(this, args);\n}\n\n//===============\n// compileTmpl\n//===============\n\nfunction compileTmpl(name, tmpl, parentTmpl, options) {\n\t// tmpl is either a template object, a selector for a template script block, the name of a compiled template, or a template object\n\n\t//==== nested functions ====\n\tfunction lookupTemplate(value) {\n\t\t// If value is of type string - treat as selector, or name of compiled template\n\t\t// Return the template object, if already compiled, or the markup string\n\t\tvar currentName, tmpl;\n\t\tif ((\"\" + value === value) || value.nodeType > 0 && (elem = value)) {\n\t\t\tif (!elem) {\n\t\t\t\tif (/^\\.\\/[^\\\\:*?\"<>]*$/.test(value)) {\n\t\t\t\t\t// tmpl=\"./some/file.html\"\n\t\t\t\t\t// If the template is not named, use \"./some/file.html\" as name.\n\t\t\t\t\tif (tmpl = $templates[name = name || value]) {\n\t\t\t\t\t\tvalue = tmpl;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// BROWSER-SPECIFIC CODE (not on Node.js):\n\t\t\t\t\t\t// Look for server-generated script block with id \"./some/file.html\"\n\t\t\t\t\t\telem = document.getElementById(value);\n\t\t\t\t\t}\n\t\t\t\t} else if ($.fn && !$sub.rTmpl.test(value)) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\telem = $(document).find(value)[0]; // if jQuery is loaded, test for selector returning elements, and get first element\n\t\t\t\t\t} catch (e) {}\n\t\t\t\t}// END BROWSER-SPECIFIC CODE\n\t\t\t} //BROWSER-SPECIFIC CODE\n\t\t\tif (elem) {\n\t\t\t\t// Generally this is a script element.\n\t\t\t\t// However we allow it to be any element, so you can for example take the content of a div,\n\t\t\t\t// use it as a template, and replace it by the same content rendered against data.\n\t\t\t\t// e.g. for linking the content of a div to a container, and using the initial content as template:\n\t\t\t\t// $.link(\"#content\", model, {tmpl: \"#content\"});\n\t\t\t\tif (options) {\n\t\t\t\t\t// We will compile a new template using the markup in the script element\n\t\t\t\t\tvalue = elem.innerHTML;\n\t\t\t\t} else {\n\t\t\t\t\t// We will cache a single copy of the compiled template, and associate it with the name\n\t\t\t\t\t// (renaming from a previous name if there was one).\n\t\t\t\t\tcurrentName = elem.getAttribute(tmplAttr);\n\t\t\t\t\tif (currentName) {\n\t\t\t\t\t\tif (currentName !== jsvTmpl) {\n\t\t\t\t\t\t\tvalue = $templates[currentName];\n\t\t\t\t\t\t\tdelete $templates[currentName];\n\t\t\t\t\t\t} else if ($.fn) {\n\t\t\t\t\t\t\tvalue = $.data(elem)[jsvTmpl];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tname = name || ($.fn ? jsvTmpl : value);\n\t\t\t\t\t\tvalue = compileTmpl(name, elem.innerHTML, parentTmpl, options);\n\t\t\t\t\t}\n\t\t\t\t\tvalue.tmplName = name = name || currentName;\n\t\t\t\t\tif (name !== jsvTmpl) {\n\t\t\t\t\t\t$templates[name] = value;\n\t\t\t\t\t}\n\t\t\t\t\telem.setAttribute(tmplAttr, name);\n\t\t\t\t\tif ($.fn) {\n\t\t\t\t\t\t$.data(elem, jsvTmpl, value);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} // END BROWSER-SPECIFIC CODE\n\t\t\telem = undefined;\n\t\t} else if (!value.fn) {\n\t\t\tvalue = undefined;\n\t\t\t// If value is not a string. HTML element, or compiled template, return undefined\n\t\t}\n\t\treturn value;\n\t}\n\n\tvar elem, compiledTmpl,\n\t\ttmplOrMarkup = tmpl = tmpl || \"\";\n\n\t//==== Compile the template ====\n\tif (options === 0) {\n\t\toptions = undefined;\n\t\ttmplOrMarkup = lookupTemplate(tmplOrMarkup); // Top-level compile so do a template lookup\n\t}\n\n\t// If options, then this was already compiled from a (script) element template declaration.\n\t// If not, then if tmpl is a template object, use it for options\n\toptions = options || (tmpl.markup ? tmpl : {});\n\toptions.tmplName = name;\n\tif (parentTmpl) {\n\t\toptions._parentTmpl = parentTmpl;\n\t}\n\t// If tmpl is not a markup string or a selector string, then it must be a template object\n\t// In that case, get it from the markup property of the object\n\tif (!tmplOrMarkup && tmpl.markup && (tmplOrMarkup = lookupTemplate(tmpl.markup))) {\n\t\tif (tmplOrMarkup.fn) {\n\t\t\t// If the string references a compiled template object, need to recompile to merge any modified options\n\t\t\ttmplOrMarkup = tmplOrMarkup.markup;\n\t\t}\n\t}\n\tif (tmplOrMarkup !== undefined) {\n\t\tif (tmplOrMarkup.fn || tmpl.fn) {\n\t\t\t// tmpl is already compiled, so use it\n\t\t\tif (tmplOrMarkup.fn) {\n\t\t\t\tcompiledTmpl = tmplOrMarkup;\n\t\t\t}\n\t\t} else {\n\t\t\t// tmplOrMarkup is a markup string, not a compiled template\n\t\t\t// Create template object\n\t\t\ttmpl = tmplObject(tmplOrMarkup, options);\n\t\t\t// Compile to AST and then to compiled function\n\t\t\ttmplFn(tmplOrMarkup.replace(rEscapeQuotes, \"\\\\$&\"), tmpl);\n\t\t}\n\t\tif (!compiledTmpl) {\n\t\t\tcompiledTmpl = $extend(function() {\n\t\t\t\treturn compiledTmpl.render.apply(compiledTmpl, arguments);\n\t\t\t}, tmpl);\n\n\t\t\tcompileChildResources(compiledTmpl);\n\t\t}\n\t\tif (name && !parentTmpl && name !== jsvTmpl) {\n\t\t\t$render[name] = compiledTmpl;\n\t\t}\n\t\treturn compiledTmpl;\n\t}\n}\n\n//==== /end of function compileTmpl ====\n\n//=================\n// compileViewModel\n//=================\n\nfunction getDefaultVal(defaultVal, data) {\n\treturn $.isFunction(defaultVal)\n\t\t? defaultVal.call(data)\n\t\t: defaultVal;\n}\n\nfunction unmapArray(modelArr) {\n\t\tvar i, arr = [],\n\t\t\tl = modelArr.length;\n\t\tfor (i=0; i<l; i++) {\n\t\t\tarr.push(modelArr[i].unmap());\n\t\t}\n\t\treturn arr;\n}\n\nfunction compileViewModel(name, type) {\n\tvar i, constructor,\n\t\tviewModels = this,\n\t\tgetters = type.getters,\n\t\textend = type.extend,\n\t\tid = type.id,\n\t\tproto = $.extend({\n\t\t\t_is: name || \"unnamed\",\n\t\t\tunmap: unmap,\n\t\t\tmerge: merge\n\t\t}, extend),\n\t\targs = \"\",\n\t\tbody = \"\",\n\t\tl = getters ? getters.length : 0,\n\t\t$observable = $.observable,\n\t\tgetterNames = {};\n\n\tfunction GetNew(args) {\n\t\tconstructor.apply(this, args);\n\t}\n\n\tfunction vm() {\n\t\treturn new GetNew(arguments);\n\t}\n\n\tfunction iterate(data, action) {\n\t\tvar j, getterType, defaultVal, prop, ob,\n\t\t\tm = getters.length;\n\t\tfor (j=0; j<m; j++) {\n\t\t\tprop = getters[j];\n\t\t\tgetterType = undefined;\n\t\t\tif (prop + \"\" !== prop) {\n\t\t\t\tgetterType = prop;\n\t\t\t\tprop = getterType.getter;\n\t\t\t}\n\t\t\tif ((ob = data[prop]) === undefined && getterType && (defaultVal = getterType.defaultVal) !== undefined) {\n\t\t\t\tob = getDefaultVal(defaultVal, data);\n\t\t\t}\n\t\t\taction(ob, getterType && viewModels[getterType.type], prop);\n\t\t}\n\t}\n\n\tfunction map(data) {\n\t\tdata = data + \"\" === data\n\t\t\t? JSON.parse(data) // Accept JSON string\n\t\t\t: data; // or object/array\n\t\tvar i, j, l, m, prop,\n\t\t\tob = data,\n\t\t\tarr = [];\n\n\t\tif ($isArray(data)) {\n\t\t\tdata = data || [];\n\t\t\tl = data.length;\n\t\t\tfor (i=0; i<l; i++) {\n\t\t\t\tarr.push(this.map(data[i]));\n\t\t\t}\n\t\t\tarr._is = name;\n\t\t\tarr.unmap = unmap;\n\t\t\tarr.merge = merge;\n\t\t\treturn arr;\n\t\t}\n\n\t\tif (data) {\n\t\t\titerate(data, function(ob, viewModel) {\n\t\t\t\tif (viewModel) { // Iterate to build getters arg array (value, or mapped value)\n\t\t\t\t\tob = viewModel.map(ob);\n\t\t\t\t}\n\t\t\t\tarr.push(ob);\n\t\t\t});\n\n\t\t\tob = this.apply(this, arr); // Insantiate this View Model, passing getters args array to constructor\n\t\t\tfor (prop in data) { // Copy over any other properties. that are not get/set properties\n\t\t\t\tif (prop !== $expando && !getterNames[prop]) {\n\t\t\t\t\tob[prop] = data[prop];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn ob;\n\t}\n\n\tfunction merge(data) {\n\t\tdata = data + \"\" === data\n\t\t\t? JSON.parse(data) // Accept JSON string\n\t\t\t: data; // or object/array\n\t\tvar i, j, l, m, prop, mod, found, assigned, ob, newModArr,\n\t\t\tmodel = this;\n\n\t\tif ($isArray(model)) {\n\t\t\tassigned = {};\n\t\t\tnewModArr = [];\n\t\t\tl = data.length;\n\t\t\tm = model.length;\n\t\t\tfor (i=0; i<l; i++) {\n\t\t\t\tob = data[i];\n\t\t\t\tfound = false;\n\t\t\t\tfor (j=0; j<m && !found; j++) {\n\t\t\t\t\tif (assigned[j]) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\tmod = model[j];\n\n\t\t\t\t\tif (id) {\n\t\t\t\t\t\tassigned[j] = found = id + \"\" === id\n\t\t\t\t\t\t? (ob[id] && (getterNames[id] ? mod[id]() : mod[id]) === ob[id])\n\t\t\t\t\t\t: id(mod, ob);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (found) {\n\t\t\t\t\tmod.merge(ob);\n\t\t\t\t\tnewModArr.push(mod);\n\t\t\t\t} else {\n\t\t\t\t\tnewModArr.push(vm.map(ob));\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($observable) {\n\t\t\t\t$observable(model).refresh(newModArr, true);\n\t\t\t} else {\n\t\t\t\tmodel.splice.apply(model, [0, model.length].concat(newModArr));\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\titerate(data, function(ob, viewModel, getter) {\n\t\t\tif (viewModel) {\n\t\t\t\tmodel[getter]().merge(ob); // Update typed property\n\t\t\t} else {\n\t\t\t\tmodel[getter](ob); // Update non-typed property\n\t\t\t}\n\t\t});\n\t\tfor (prop in data) {\n\t\t\tif (prop !== $expando && !getterNames[prop]) {\n\t\t\t\tmodel[prop] = data[prop];\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction unmap() {\n\t\tvar ob, prop, i, l, getterType, arr, value,\n\t\t\tmodel = this;\n\n\t\tif ($isArray(model)) {\n\t\t\treturn unmapArray(model);\n\t\t}\n\t\tob = {};\n\t\tl = getters.length;\n\t\tfor (i=0; i<l; i++) {\n\t\t\tprop = getters[i];\n\t\t\tgetterType = undefined;\n\t\t\tif (prop + \"\" !== prop) {\n\t\t\t\tgetterType = prop;\n\t\t\t\tprop = getterType.getter;\n\t\t\t}\n\t\t\tvalue = model[prop]();\n\t\t\tob[prop] = getterType && value && viewModels[getterType.type]\n\t\t\t\t? $isArray(value)\n\t\t\t\t\t? unmapArray(value)\n\t\t\t\t\t: value.unmap()\n\t\t\t\t: value;\n\t\t}\n\t\tfor (prop in model) {\n\t\t\tif (prop !== \"_is\" && !getterNames[prop] && prop !== $expando && (prop.charAt(0) !== \"_\" || !getterNames[prop.slice(1)]) && !$.isFunction(model[prop])) {\n\t\t\t\tob[prop] = model[prop];\n\t\t\t}\n\t\t}\n\t\treturn ob;\n\t}\n\n\tGetNew.prototype = proto;\n\n\tfor (i=0; i<l; i++) {\n\t\t(function(getter) {\n\t\t\tgetter = getter.getter || getter;\n\t\t\tgetterNames[getter] = i+1;\n\t\t\tvar privField = \"_\" + getter;\n\n\t\t\targs += (args ? \",\" : \"\") + getter;\n\t\t\tbody += \"this.\" + privField + \" = \" + getter + \";\\n\";\n\t\t\tproto[getter] = proto[getter] || function(val) {\n\t\t\t\tif (!arguments.length) {\n\t\t\t\t\treturn this[privField]; // If there is no argument, use as a getter\n\t\t\t\t}\n\t\t\t\tif ($observable) {\n\t\t\t\t\t$observable(this).setProperty(getter, val);\n\t\t\t\t} else {\n\t\t\t\t\tthis[privField] = val;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tif ($observable) {\n\t\t\t\tproto[getter].set = proto[getter].set || function(val) {\n\t\t\t\t\tthis[privField] = val; // Setter called by observable property change\n\t\t\t\t};\n\t\t\t}\n\t\t})(getters[i]);\n\t}\n\n\tconstructor = new Function(args, body.slice(0, -1));\n\tconstructor.prototype = proto;\n\tproto.constructor = constructor;\n\n\tvm.map = map;\n\tvm.getters = getters;\n\tvm.extend = extend;\n\tvm.id = id;\n\treturn vm;\n}\n\nfunction tmplObject(markup, options) {\n\t// Template object constructor\n\tvar htmlTag,\n\t\twrapMap = $subSettingsAdvanced._wm || {}, // Only used in JsViews. Otherwise empty: {}\n\t\ttmpl = $extend(\n\t\t\t{\n\t\t\t\ttmpls: [],\n\t\t\t\tlinks: {}, // Compiled functions for link expressions\n\t\t\t\tbnds: [],\n\t\t\t\t_is: \"template\",\n\t\t\t\trender: renderContent\n\t\t\t},\n\t\t\toptions\n\t\t);\n\n\ttmpl.markup = markup;\n\tif (!options.htmlTag) {\n\t\t// Set tmpl.tag to the top-level HTML tag used in the template, if any...\n\t\thtmlTag = rFirstElem.exec(markup);\n\t\ttmpl.htmlTag = htmlTag ? htmlTag[1].toLowerCase() : \"\";\n\t}\n\thtmlTag = wrapMap[tmpl.htmlTag];\n\tif (htmlTag && htmlTag !== wrapMap.div) {\n\t\t// When using JsViews, we trim templates which are inserted into HTML contexts where text nodes are not rendered (i.e. not 'Phrasing Content').\n\t\t// Currently not trimmed for <li> tag. (Not worth adding perf cost)\n\t\ttmpl.markup = $.trim(tmpl.markup);\n\t}\n\n\treturn tmpl;\n}\n\n//==============\n// registerStore\n//==============\n\nfunction registerStore(storeName, storeSettings) {\n\n\tfunction theStore(name, item, parentTmpl) {\n\t\t// The store is also the function used to add items to the store. e.g. $.templates, or $.views.tags\n\n\t\t// For store of name 'thing', Call as:\n\t\t// $.views.things(items[, parentTmpl]),\n\t\t// or $.views.things(name, item[, parentTmpl])\n\n\t\tvar onStore, compile, itemName, thisStore;\n\t\tif (name && typeof name === OBJECT && !name.nodeType && !name.markup && !name.getTgt && !(storeName === \"viewModel\" && name.getters || name.extend)) {\n\t\t\t// Call to $.views.things(items[, parentTmpl]),\n\n\t\t\t// Adding items to the store\n\t\t\t// If name is a hash, then item is parentTmpl. Iterate over hash and call store for key.\n\t\t\tfor (itemName in name) {\n\t\t\t\ttheStore(itemName, name[itemName], item);\n\t\t\t}\n\t\t\treturn item || $views;\n\t\t}\n\t\t// Adding a single unnamed item to the store\n\t\tif (item === undefined) {\n\t\t\titem = name;\n\t\t\tname = undefined;\n\t\t}\n\t\tif (name && \"\" + name !== name) { // name must be a string\n\t\t\tparentTmpl = item;\n\t\t\titem = name;\n\t\t\tname = undefined;\n\t\t}\n\t\tthisStore = parentTmpl\n\t\t\t? storeName === \"viewModel\"\n\t\t\t\t? parentTmpl\n\t\t\t\t: (parentTmpl[storeNames] = parentTmpl[storeNames] || {})\n\t\t\t: theStore;\n\t\tcompile = storeSettings.compile;\n\t\tif (item === null) {\n\t\t\t// If item is null, delete this entry\n\t\t\tif (name) {\n\t\t\t\tdelete thisStore[name];\n\t\t\t}\n\t\t} else {\n\t\t\titem = compile ? compile.call(thisStore, name, item, parentTmpl, 0) : item;\n\t\t\tif (name) {\n\t\t\t\tthisStore[name] = item;\n\t\t\t}\n\t\t}\n\t\tif (compile && item) {\n\t\t\titem._is = storeName; // Only do this for compiled objects (tags, templates...)\n\t\t}\n\t\tif (item && (onStore = $sub.onStore[storeName])) {\n\t\t\t// e.g. JsViews integration\n\t\t\tonStore(name, item, compile);\n\t\t}\n\t\treturn item;\n\t}\n\n\tvar storeNames = storeName + \"s\";\n\n\t$views[storeNames] = theStore;\n}\n\nfunction addSetting(st) {\n\t$viewsSettings[st] = function(value) {\n\t\treturn arguments.length\n\t\t\t? ($subSettings[st] = value, $viewsSettings)\n\t\t\t: $subSettings[st];\n\t};\n}\n\n//=========\n// dataMap\n//=========\n\nfunction dataMap(mapDef) {\n\tfunction Map(source, options) {\n\t\tthis.tgt = mapDef.getTgt(source, options);\n\t}\n\n\tif ($isFunction(mapDef)) {\n\t\t// Simple map declared as function\n\t\tmapDef = {\n\t\t\tgetTgt: mapDef\n\t\t};\n\t}\n\n\tif (mapDef.baseMap) {\n\t\tmapDef = $extend($extend({}, mapDef.baseMap), mapDef);\n\t}\n\n\tmapDef.map = function(source, options) {\n\t\treturn new Map(source, options);\n\t};\n\treturn mapDef;\n}\n\n//==============\n// renderContent\n//==============\n\nfunction renderContent(data, context, noIteration, parentView, key, onRender) {\n\tvar i, l, tag, tmpl, tagCtx, isTopRenderCall, prevData, prevIndex,\n\t\tview = parentView,\n\t\tresult = \"\";\n\n\tif (context === true) {\n\t\tnoIteration = context; // passing boolean as second param - noIteration\n\t\tcontext = undefined;\n\t} else if (typeof context !== OBJECT) {\n\t\tcontext = undefined; // context must be a boolean (noIteration) or a plain object\n\t}\n\n\tif (tag = this.tag) {\n\t\t// This is a call from renderTag or tagCtx.render(...)\n\t\ttagCtx = this;\n\t\tview = view || tagCtx.view;\n\t\ttmpl = view.getTmpl(tag.template || tagCtx.tmpl);\n\t\tif (!arguments.length) {\n\t\t\tdata = view;\n\t\t}\n\t} else {\n\t\t// This is a template.render(...) call\n\t\ttmpl = this;\n\t}\n\n\tif (tmpl) {\n\t\tif (!parentView && data && data._is === \"view\") {\n\t\t\tview = data; // When passing in a view to render or link (and not passing in a parent view) use the passed-in view as parentView\n\t\t}\n\n\t\tif (view) {\n\t\t\tif (data === view) {\n\t\t\t\t// Inherit the data from the parent view.\n\t\t\t\t// This may be the contents of an {{if}} block\n\t\t\t\tdata = view.data;\n\t\t\t}\n\t\t}\n\n\t\tisTopRenderCall = !view;\n\t\tisRenderCall = isRenderCall || isTopRenderCall;\n\t\tif (!view) {\n\t\t\t(context = context || {}).root = data; // Provide ~root as shortcut to top-level data.\n\t\t}\n\t\tif (!isRenderCall || $subSettingsAdvanced.useViews || tmpl.useViews || view && view !== topView) {\n\t\t\tresult = renderWithViews(tmpl, data, context, noIteration, view, key, onRender, tag);\n\t\t} else {\n\t\t\tif (view) { // In a block\n\t\t\t\tprevData = view.data;\n\t\t\t\tprevIndex = view.index;\n\t\t\t\tview.index = indexStr;\n\t\t\t} else {\n\t\t\t\tview = topView;\n\t\t\t\tview.data = data;\n\t\t\t\tview.ctx = context;\n\t\t\t}\n\t\t\tif ($isArray(data) && !noIteration) {\n\t\t\t\t// Create a view for the array, whose child views correspond to each data item. (Note: if key and parentView are passed in\n\t\t\t\t// along with parent view, treat as insert -e.g. from view.addViews - so parentView is already the view item for array)\n\t\t\t\tfor (i = 0, l = data.length; i < l; i++) {\n\t\t\t\t\tview.index = i;\n\t\t\t\t\tview.data = data[i];\n\t\t\t\t\tresult += tmpl.fn(data[i], view, $sub);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tview.data = data;\n\t\t\t\tresult += tmpl.fn(data, view, $sub);\n\t\t\t}\n\t\t\tview.data = prevData;\n\t\t\tview.index = prevIndex;\n\t\t}\n\t\tif (isTopRenderCall) {\n\t\t\tisRenderCall = undefined;\n\t\t}\n\t}\n\treturn result;\n}\n\nfunction renderWithViews(tmpl, data, context, noIteration, view, key, onRender, tag) {\n\tfunction setItemVar(item) {\n\t\t// When itemVar is specified, set modified ctx with user-named ~item\n\t\tnewCtx = $extend({}, context);\n\t\tnewCtx[itemVar] = item;\n\t}\n\n\t// Render template against data as a tree of subviews (nested rendered template instances), or as a string (top-level template).\n\t// If the data is the parent view, treat as noIteration, re-render with the same data context.\n\tvar i, l, newView, childView, itemResult, swapContent, contentTmpl, outerOnRender, tmplName, itemVar, newCtx, tagCtx,\n\t\tresult = \"\";\n\n\tif (tag) {\n\t\t// This is a call from renderTag or tagCtx.render(...)\n\t\ttmplName = tag.tagName;\n\t\ttagCtx = tag.tagCtx;\n\t\tcontext = context ? extendCtx(context, tag.ctx) : tag.ctx;\n\n\t\tif (tmpl === view.content) { // {{xxx tmpl=#content}}\n\t\t\tcontentTmpl = tmpl !== view.ctx._wrp // We are rendering the #content\n\t\t\t\t? view.ctx._wrp // #content was the tagCtx.props.tmpl wrapper of the block content - so within this view, #content will now be the view.ctx._wrp block content\n\t\t\t\t: undefined; // #content was the view.ctx._wrp block content - so within this view, there is no longer any #content to wrap.\n\t\t} else if (tmpl !== tagCtx.content) {\n\t\t\tif (tmpl === tag.template) { // Rendering {{tag}} tag.template, replacing block content.\n\t\t\t\tcontentTmpl = tagCtx.tmpl; // Set #content to block content (or wrapped block content if tagCtx.props.tmpl is set)\n\t\t\t\tcontext._wrp = tagCtx.content; // Pass wrapped block content to nested views\n\t\t\t} else { // Rendering tagCtx.props.tmpl wrapper\n\t\t\t\tcontentTmpl = tagCtx.content || view.content; // Set #content to wrapped block content\n\t\t\t}\n\t\t} else {\n\t\t\tcontentTmpl = view.content; // Nested views inherit same wrapped #content property\n\t\t}\n\n\t\tif (tagCtx.props.link === false) {\n\t\t\t// link=false setting on block tag\n\t\t\t// We will override inherited value of link by the explicit setting link=false taken from props\n\t\t\t// The child views of an unlinked view are also unlinked. So setting child back to true will not have any effect.\n\t\t\tcontext = context || {};\n\t\t\tcontext.link = false;\n\t\t}\n\n\t\tif (itemVar = tagCtx.props.itemVar) {\n\t\t\tif (itemVar.charAt(0) !== \"~\") {\n\t\t\t\tsyntaxError(\"Use itemVar='~myItem'\");\n\t\t\t}\n\t\t\titemVar = itemVar.slice(1);\n\t\t}\n\t}\n\n\tif (view) {\n\t\tonRender = onRender || view._.onRender;\n\t\tcontext = extendCtx(context, view.ctx);\n\t}\n\n\tif (key === true) {\n\t\tswapContent = true;\n\t\tkey = 0;\n\t}\n\n\t// If link===false, do not call onRender, so no data-linking marker nodes\n\tif (onRender && (context && context.link === false || tag && tag._.noVws)) {\n\t\tonRender = undefined;\n\t}\n\touterOnRender = onRender;\n\tif (onRender === true) {\n\t\t// Used by view.refresh(). Don't create a new wrapper view.\n\t\touterOnRender = undefined;\n\t\tonRender = view._.onRender;\n\t}\n\t// Set additional context on views created here, (as modified context inherited from the parent, and to be inherited by child views)\n\tcontext = tmpl.helpers\n\t\t? extendCtx(tmpl.helpers, context)\n\t\t: context;\n\n\tnewCtx = context;\n\tif ($isArray(data) && !noIteration) {\n\t\t// Create a view for the array, whose child views correspond to each data item. (Note: if key and view are passed in\n\t\t// along with parent view, treat as insert -e.g. from view.addViews - so view is already the view item for array)\n\t\tnewView = swapContent\n\t\t\t? view\n\t\t\t: (key !== undefined && view)\n\t\t\t\t|| new View(context, \"array\", view, data, tmpl, key, onRender, contentTmpl);\n\t\tif (view && view._.useKey) {\n\t\t\t// Parent is not an 'array view'\n\t\t\tnewView._.bnd = !tag || tag._.bnd && tag; // For array views that are data bound for collection change events, set the\n\t\t\t// view._.bnd property to true for top-level link() or data-link=\"{for}\", or to the tag instance for a data-bound tag, e.g. {^{for ...}}\n\t\t}\n\t\tif (itemVar) {\n\t\t\tnewView.it = itemVar;\n\t\t}\n\t\titemVar = newView.it;\n\t\tfor (i = 0, l = data.length; i < l; i++) {\n\t\t\t// Create a view for each data item.\n\t\t\tif (itemVar) {\n\t\t\t\tsetItemVar(data[i]); // use modified ctx with user-named ~item\n\t\t\t}\n\t\t\tchildView = new View(newCtx, \"item\", newView, data[i], tmpl, (key || 0) + i, onRender, newView.content);\n\n\t\t\titemResult = tmpl.fn(data[i], childView, $sub);\n\t\t\tresult += newView._.onRender ? newView._.onRender(itemResult, childView) : itemResult;\n\t\t}\n\t} else {\n\t\t// Create a view for singleton data object. The type of the view will be the tag name, e.g. \"if\" or \"myTag\" except for\n\t\t// \"item\", \"array\" and \"data\" views. A \"data\" view is from programmatic render(object) against a 'singleton'.\n\t\tif (itemVar) {\n\t\t\tsetItemVar(data);\n\t\t}\n\t\tnewView = swapContent ? view : new View(newCtx, tmplName || \"data\", view, data, tmpl, key, onRender, contentTmpl);\n\t\tif (tag && !tag.flow) {\n\t\t\tnewView.tag = tag;\n\t\t\ttag.view = newView;\n\t\t}\n\t\tresult += tmpl.fn(data, newView, $sub);\n\t}\n\treturn outerOnRender ? outerOnRender(result, newView) : result;\n}\n\n//===========================\n// Build and compile template\n//===========================\n\n// Generate a reusable function that will serve to render a template against data\n// (Compile AST then build template function)\n\nfunction onRenderError(e, view, fallback) {\n\tvar message = fallback !== undefined\n\t\t? $isFunction(fallback)\n\t\t\t? fallback.call(view.data, e, view)\n\t\t\t: fallback || \"\"\n\t\t: \"{Error: \" + e.message + \"}\";\n\n\tif ($subSettings.onError && (fallback = $subSettings.onError.call(view.data, e, fallback && message, view)) !== undefined) {\n\t\tmessage = fallback; // There is a settings.debugMode(handler) onError override. Call it, and use return value (if any) to replace message\n\t}\n\n\treturn view && !view.linkCtx ? $converters.html(message) : message;\n}\n\nfunction error(message) {\n\tthrow new $sub.Err(message);\n}\n\nfunction syntaxError(message) {\n\terror(\"Syntax error\\n\" + message);\n}\n\nfunction tmplFn(markup, tmpl, isLinkExpr, convertBack, hasElse) {\n\t// Compile markup to AST (abtract syntax tree) then build the template function code from the AST nodes\n\t// Used for compiling templates, and also by JsViews to build functions for data link expressions\n\n\t//==== nested functions ====\n\tfunction pushprecedingContent(shift) {\n\t\tshift -= loc;\n\t\tif (shift) {\n\t\t\tcontent.push(markup.substr(loc, shift).replace(rNewLine, \"\\\\n\"));\n\t\t}\n\t}\n\n\tfunction blockTagCheck(tagName, block) {\n\t\tif (tagName) {\n\t\t\ttagName += '}}';\n\t\t\t//\t\t\t'{{include}} block has {{/for}} with no open {{for}}'\n\t\t\tsyntaxError((\n\t\t\t\tblock\n\t\t\t\t\t? '{{' + block + '}} block has {{/' + tagName + ' without {{' + tagName\n\t\t\t\t\t: 'Unmatched or missing {{/' + tagName) + ', in template:\\n' + markup);\n\t\t}\n\t}\n\n\tfunction parseTag(all, bind, tagName, converter, colon, html, codeTag, params, slash, bind2, closeBlock, index) {\n/*\n\n bind tagName cvt cln html code params slash bind2 closeBlk comment\n/(?:{(\\^)?{(?:(\\w+(?=[\\/\\s}]))|(\\w+)?(:)|(>)|(\\*))\\s*((?:[^}]|}(?!}))*?)(\\/)?|{(\\^)?{(?:(?:\\/(\\w+))\\s*|!--[\\s\\S]*?--))}}/g\n\n(?:\n {(\\^)?{ bind\n (?:\n (\\w+ tagName\n (?=[\\/\\s}])\n )\n |\n (\\w+)?(:) converter colon\n |\n (>) html\n |\n (\\*) codeTag\n )\n \\s*\n ( params\n (?:[^}]|}(?!}))*?\n )\n (\\/)? slash\n |\n {(\\^)?{ bind2\n (?:\n (?:\\/(\\w+))\\s* closeBlock\n |\n !--[\\s\\S]*?-- comment\n )\n)\n}}/g\n\n*/\n\t\tif (codeTag && bind || slash && !tagName || params && params.slice(-1) === \":\" || bind2) {\n\t\t\tsyntaxError(all);\n\t\t}\n\n\t\t// Build abstract syntax tree (AST): [tagName, converter, params, content, hash, bindings, contentMarkup]\n\t\tif (html) {\n\t\t\tcolon = \":\";\n\t\t\tconverter = HTML;\n\t\t}\n\t\tslash = slash || isLinkExpr && !hasElse;\n\n\t\tvar pathBindings = (bind || isLinkExpr) && [[]],\n\t\t\tprops = \"\",\n\t\t\targs = \"\",\n\t\t\tctxProps = \"\",\n\t\t\tparamsArgs = \"\",\n\t\t\tparamsProps = \"\",\n\t\t\tparamsCtxProps = \"\",\n\t\t\tonError = \"\",\n\t\t\tuseTrigger = \"\",\n\t\t\t// Block tag if not self-closing and not {{:}} or {{>}} (special case) and not a data-link expression\n\t\t\tblock = !slash && !colon;\n\n\t\t//==== nested helper function ====\n\t\ttagName = tagName || (params = params || \"#data\", colon); // {{:}} is equivalent to {{:#data}}\n\t\tpushprecedingContent(index);\n\t\tloc = index + all.length; // location marker - parsed up to here\n\t\tif (codeTag) {\n\t\t\tif (allowCode) {\n\t\t\t\tcontent.push([\"*\", \"\\n\" + params.replace(/^:/, \"ret+= \").replace(rUnescapeQuotes, \"$1\") + \";\\n\"]);\n\t\t\t}\n\t\t} else if (tagName) {\n\t\t\tif (tagName === \"else\") {\n\t\t\t\tif (rTestElseIf.test(params)) {\n\t\t\t\t\tsyntaxError('for \"{{else if expr}}\" use \"{{else expr}}\"');\n\t\t\t\t}\n\t\t\t\tpathBindings = current[7] && [[]];\n\t\t\t\tcurrent[8] = markup.substring(current[8], index); // contentMarkup for block tag\n\t\t\t\tcurrent = stack.pop();\n\t\t\t\tcontent = current[2];\n\t\t\t\tblock = true;\n\t\t\t}\n\t\t\tif (params) {\n\t\t\t\t// remove newlines from the params string, to avoid compiled code errors for unterminated strings\n\t\t\t\tparseParams(params.replace(rNewLine, \" \"), pathBindings, tmpl)\n\t\t\t\t\t.replace(rBuildHash, function(all, onerror, isCtx, key, keyToken, keyValue, arg, param) {\n\t\t\t\t\t\tkey = \"'\" + keyToken + \"':\";\n\t\t\t\t\t\tif (arg) {\n\t\t\t\t\t\t\targs += keyValue + \",\";\n\t\t\t\t\t\t\tparamsArgs += \"'\" + param + \"',\";\n\t\t\t\t\t\t} else if (isCtx) {\n\t\t\t\t\t\t\tctxProps += key + 'j._cp(' + keyValue + ',\"' + param + '\",view),';\n\t\t\t\t\t\t\t// Compiled code for evaluating tagCtx on a tag will have: ctx:{'foo':j._cp(compiledExpr, \"expr\", view)}\n\t\t\t\t\t\t\tparamsCtxProps += key + \"'\" + param + \"',\";\n\t\t\t\t\t\t} else if (onerror) {\n\t\t\t\t\t\t\tonError += keyValue;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tif (keyToken === \"trigger\") {\n\t\t\t\t\t\t\t\tuseTrigger += keyValue;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tprops += key + keyValue + \",\";\n\t\t\t\t\t\t\tparamsProps += key + \"'\" + param + \"',\";\n\t\t\t\t\t\t\thasHandlers = hasHandlers || rHasHandlers.test(keyToken);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t}).slice(0, -1);\n\t\t\t}\n\n\t\t\tif (pathBindings && pathBindings[0]) {\n\t\t\t\tpathBindings.pop(); // Remove the bindings that was prepared for next arg. (There is always an extra one ready).\n\t\t\t}\n\n\t\t\tnewNode = [\n\t\t\t\t\ttagName,\n\t\t\t\t\tconverter || !!convertBack || hasHandlers || \"\",\n\t\t\t\t\tblock && [],\n\t\t\t\t\tparsedParam(paramsArgs || (tagName === \":\" ? \"'#data',\" : \"\"), paramsProps, paramsCtxProps), // {{:}} equivalent to {{:#data}}\n\t\t\t\t\tparsedParam(args || (tagName === \":\" ? \"data,\" : \"\"), props, ctxProps),\n\t\t\t\t\tonError,\n\t\t\t\t\tuseTrigger,\n\t\t\t\t\tpathBindings || 0\n\t\t\t\t];\n\t\t\tcontent.push(newNode);\n\t\t\tif (block) {\n\t\t\t\tstack.push(current);\n\t\t\t\tcurrent = newNode;\n\t\t\t\tcurrent[8] = loc; // Store current location of open tag, to be able to add contentMarkup when we reach closing tag\n\t\t\t}\n\t\t} else if (closeBlock) {\n\t\t\tblockTagCheck(closeBlock !== current[0] && current[0] !== \"else\" && closeBlock, current[0]);\n\t\t\tcurrent[8] = markup.substring(current[8], index); // contentMarkup for block tag\n\t\t\tcurrent = stack.pop();\n\t\t}\n\t\tblockTagCheck(!current && closeBlock);\n\t\tcontent = current[2];\n\t}\n\t//==== /end of nested functions ====\n\n\tvar i, result, newNode, hasHandlers, bindings,\n\t\tallowCode = $subSettings.allowCode || tmpl && tmpl.allowCode\n\t\t\t|| $viewsSettings.allowCode === true, // include direct setting of settings.allowCode true for backward compat only\n\t\tastTop = [],\n\t\tloc = 0,\n\t\tstack = [],\n\t\tcontent = astTop,\n\t\tcurrent = [,,astTop];\n\n\tif (allowCode && tmpl._is) {\n\t\ttmpl.allowCode = allowCode;\n\t}\n\n//TODO\tresult = tmplFnsCache[markup]; // Only cache if template is not named and markup length < ...,\n//and there are no bindings or subtemplates?? Consider standard optimization for data-link=\"a.b.c\"\n//\t\tif (result) {\n//\t\t\ttmpl.fn = result;\n//\t\t} else {\n\n//\t\tresult = markup;\n\tif (isLinkExpr) {\n\t\tif (convertBack !== undefined) {\n\t\t\tmarkup = markup.slice(0, -convertBack.length - 2) + delimCloseChar0;\n\t\t}\n\t\tmarkup = delimOpenChar0 + markup + delimCloseChar1;\n\t}\n\n\tblockTagCheck(stack[0] && stack[0][2].pop()[0]);\n\t// Build the AST (abstract syntax tree) under astTop\n\tmarkup.replace(rTag, parseTag);\n\n\tpushprecedingContent(markup.length);\n\n\tif (loc = astTop[astTop.length - 1]) {\n\t\tblockTagCheck(\"\" + loc !== loc && (+loc[8] === loc[8]) && loc[0]);\n\t}\n//\t\t\tresult = tmplFnsCache[markup] = buildCode(astTop, tmpl);\n//\t\t}\n\n\tif (isLinkExpr) {\n\t\tresult = buildCode(astTop, markup, isLinkExpr);\n\t\tbindings = [];\n\t\ti = astTop.length;\n\t\twhile (i--) {\n\t\t\tbindings.unshift(astTop[i][7]); // With data-link expressions, pathBindings array for tagCtx[i] is astTop[i][7]\n\t\t}\n\t\tsetPaths(result, bindings);\n\t} else {\n\t\tresult = buildCode(astTop, tmpl);\n\t}\n\treturn result;\n}\n\nfunction setPaths(fn, pathsArr) {\n\tvar key, paths,\n\t\ti = 0,\n\t\tl = pathsArr.length;\n\tfn.deps = [];\n\tfn.paths = []; // The array of path binding (array/dictionary)s for each tag/else block's args and props\n\tfor (; i < l; i++) {\n\t\tfn.paths.push(paths = pathsArr[i]);\n\t\tfor (key in paths) {\n\t\t\tif (key !== \"_jsvto\" && paths.hasOwnProperty(key) && paths[key].length && !paths[key].skp) {\n\t\t\t\tfn.deps = fn.deps.concat(paths[key]); // deps is the concatenation of the paths arrays for the different bindings\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction parsedParam(args, props, ctx) {\n\treturn [args.slice(0, -1), props.slice(0, -1), ctx.slice(0, -1)];\n}\n\nfunction paramStructure(parts, type) {\n\treturn '\\n\\t'\n\t\t+ (type\n\t\t\t? type + ':{'\n\t\t\t: '')\n\t\t+ 'args:[' + parts[0] + ']'\n\t\t+ (parts[1] || !type\n\t\t\t? ',\\n\\tprops:{' + parts[1] + '}'\n\t\t\t: \"\")\n\t\t+ (parts[2] ? ',\\n\\tctx:{' + parts[2] + '}' : \"\");\n}\n\nfunction parseParams(params, pathBindings, tmpl) {\n\n\tfunction parseTokens(all, lftPrn0, lftPrn, bound, path, operator, err, eq, path2, prn, comma, lftPrn2, apos, quot, rtPrn, rtPrnDot, prn2, space, index, full) {\n\t// /(\\()(?=\\s*\\()|(?:([([])\\s*)?(?:(\\^?)(!*?[#~]?[\\w$.^]+)?\\s*((\\+\\+|--)|\\+|-|&&|\\|\\||===|!==|==|!=|<=|>=|[<>%*:?\\/]|(=))\\s*|(!*?[#~]?[\\w$.^]+)([([])?)|(,\\s*)|(\\(?)\\\\?(?:(')|(\"))|(?:\\s*(([)\\]])(?=\\s*[.^]|\\s*$|[^([])|[)\\]])([([]?))|(\\s+)/g,\n\t// lftPrn0 lftPrn bound path operator err eq path2 prn comma lftPrn2 apos quot rtPrn rtPrnDot prn2 space\n\t\t// (left paren? followed by (path? followed by operator) or (path followed by paren?)) or comma or apos or quot or right paren or space\n\t\tfunction parsePath(allPath, not, object, helper, view, viewProperty, pathTokens, leafToken) {\n\t\t\t//rPath = /^(!*?)(?:null|true|false|\\d[\\d.]*|([\\w$]+|\\.|~([\\w$]+)|#(view|([\\w$]+))?)([\\w$.^]*?)(?:[.[^]([\\w$]+)\\]?)?)$/g,\n\t\t\t// not object helper view viewProperty pathTokens leafToken\n\t\t\tvar subPath = object === \".\";\n\t\t\tif (object) {\n\t\t\t\tpath = path.slice(not.length);\n\t\t\t\tif (/^\\.?constructor$/.test(leafToken||path)) {\n\t\t\t\t\tsyntaxError(allPath);\n\t\t\t\t}\n\t\t\t\tif (!subPath) {\n\t\t\t\t\tallPath = (helper\n\t\t\t\t\t\t\t? 'view.hlp(\"' + helper + '\")'\n\t\t\t\t\t\t\t: view\n\t\t\t\t\t\t\t\t? \"view\"\n\t\t\t\t\t\t\t\t: \"data\")\n\t\t\t\t\t\t+ (leafToken\n\t\t\t\t\t\t\t? (viewProperty\n\t\t\t\t\t\t\t\t? \".\" + viewProperty\n\t\t\t\t\t\t\t\t: helper\n\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t: (view ? \"\" : \".\" + object)\n\t\t\t\t\t\t\t\t) + (pathTokens || \"\")\n\t\t\t\t\t\t\t: (leafToken = helper ? \"\" : view ? viewProperty || \"\" : object, \"\"));\n\n\t\t\t\t\tallPath = allPath + (leafToken ? \".\" + leafToken : \"\");\n\n\t\t\t\t\tallPath = not + (allPath.slice(0, 9) === \"view.data\"\n\t\t\t\t\t\t? allPath.slice(5) // convert #view.data... to data...\n\t\t\t\t\t\t: allPath);\n\t\t\t\t}\n\t\t\t\tif (bindings) {\n\t\t\t\t\tbinds = named === \"linkTo\" ? (bindto = pathBindings._jsvto = pathBindings._jsvto || []) : bndCtx.bd;\n\t\t\t\t\tif (theOb = subPath && binds[binds.length-1]) {\n\t\t\t\t\t\tif (theOb._jsv) {\n\t\t\t\t\t\t\twhile (theOb.sb) {\n\t\t\t\t\t\t\t\ttheOb = theOb.sb;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (theOb.bnd) {\n\t\t\t\t\t\t\t\tpath = \"^\" + path.slice(1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttheOb.sb = path;\n\t\t\t\t\t\t\ttheOb.bnd = theOb.bnd || path.charAt(0) === \"^\";\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbinds.push(path);\n\t\t\t\t\t}\n\t\t\t\t\tpathStart[parenDepth] = index + (subPath ? 1 : 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn allPath;\n\t\t}\n\n\t\t//bound = bindings && bound;\n\t\tif (bound && !eq) {\n\t\t\tpath = bound + path; // e.g. some.fn(...)^some.path - so here path is \"^some.path\"\n\t\t}\n\t\toperator = operator || \"\";\n\t\tlftPrn = lftPrn || lftPrn0 || lftPrn2;\n\t\tpath = path || path2;\n\t\t// Could do this - but not worth perf cost?? :-\n\t\t// if (!path.lastIndexOf(\"#data.\", 0)) { path = path.slice(6); } // If path starts with \"#data.\", remove that.\n\t\tprn = prn || prn2 || \"\";\n\n\t\tvar expr, exprFn, binds, theOb, newOb,\n\t\t\trtSq = \")\";\n\n\t\tif (prn === \"[\") {\n\t\t\tprn =\"[j._sq(\";\n\t\t\trtSq = \")]\";\n\t\t}\n\n\t\tif (err && !aposed && !quoted) {\n\t\t\tsyntaxError(params);\n\t\t} else {\n\t\t\tif (bindings && rtPrnDot && !aposed && !quoted) {\n\t\t\t\t// This is a binding to a path in which an object is returned by a helper/data function/expression, e.g. foo()^x.y or (a?b:c)^x.y\n\t\t\t\t// We create a compiled function to get the object instance (which will be called when the dependent data of the subexpression changes, to return the new object, and trigger re-binding of the subsequent path)\n\t\t\t\tif (!named || boundName || bindto) {\n\t\t\t\t\texpr = pathStart[parenDepth - 1];\n\t\t\t\t\tif (full.length - 1 > index - (expr || 0)) { // We need to compile a subexpression\n\t\t\t\t\t\texpr = full.slice(expr, index + all.length);\n\t\t\t\t\t\tif (exprFn !== true) { // If not reentrant call during compilation\n\t\t\t\t\t\t\tbinds = bindto || bndStack[parenDepth-1].bd;\n\t\t\t\t\t\t\t// Insert exprOb object, to be used during binding to return the computed object\n\t\t\t\t\t\t\ttheOb = binds[binds.length-1];\n\t\t\t\t\t\t\tif (theOb && theOb.prm) {\n\t\t\t\t\t\t\t\twhile (theOb.sb && theOb.sb.prm) {\n\t\t\t\t\t\t\t\t\ttheOb = theOb.sb;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tnewOb = theOb.sb = {path: theOb.sb, bnd: theOb.bnd};\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tbinds.push(newOb = {path: binds.pop()}); // Insert exprOb object, to be used during binding to return the computed object\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t // (e.g. \"some.object()\" in \"some.object().a.b\" - to be used as context for binding the following tokens \"a.b\")\n\t\t\t\t\t\t}\n\t\t\t\t\t\trtPrnDot = delimOpenChar1 + \":\" + expr // The parameter or function subexpression\n\t\t\t\t\t\t\t+ \" onerror=''\" // set onerror='' in order to wrap generated code with a try catch - returning '' as object instance if there is an error/missing parent\n\t\t\t\t\t\t\t+ delimCloseChar0;\n\t\t\t\t\t\texprFn = tmplLinks[rtPrnDot];\n\t\t\t\t\t\tif (!exprFn) {\n\t\t\t\t\t\t\ttmplLinks[rtPrnDot] = true; // Flag that this exprFn (for rtPrnDot) is being compiled\n\t\t\t\t\t\t\ttmplLinks[rtPrnDot] = exprFn = tmplFn(rtPrnDot, tmpl, true); // Compile the expression (or use cached copy already in tmpl.links)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (exprFn !== true && newOb) {\n\t\t\t\t\t\t\t// If not reentrant call during compilation\n\t\t\t\t\t\t\tnewOb._jsv = exprFn;\n\t\t\t\t\t\t\tnewOb.prm = bndCtx.bd;\n\t\t\t\t\t\t\tnewOb.bnd = newOb.bnd || newOb.path && newOb.path.indexOf(\"^\") >= 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (aposed\n\t\t\t\t// within single-quoted string\n\t\t\t\t? (aposed = !apos, (aposed ? all : lftPrn2 + '\"'))\n\t\t\t\t: quoted\n\t\t\t\t// within double-quoted string\n\t\t\t\t\t? (quoted = !quot, (quoted ? all : lftPrn2 + '\"'))\n\t\t\t\t\t:\n\t\t\t\t(\n\t\t\t\t\t(lftPrn\n\t\t\t\t\t\t? (pathStart[parenDepth] = index++, bndCtx = bndStack[++parenDepth] = {bd: []}, lftPrn)\n\t\t\t\t\t\t: \"\")\n\t\t\t\t\t+ (space\n\t\t\t\t\t\t? (parenDepth\n\t\t\t\t\t\t\t? \"\"\n\t\t\t\t// New arg or prop - so insert backspace \\b (\\x08) as separator for named params, used subsequently by rBuildHash, and prepare new bindings array\n\t\t\t\t\t\t\t: (paramIndex = full.slice(paramIndex, index), named\n\t\t\t\t\t\t\t\t? (named = boundName = bindto = false, \"\\b\")\n\t\t\t\t\t\t\t\t: \"\\b,\") + paramIndex + (paramIndex = index + all.length, bindings && pathBindings.push(bndCtx.bd = []), \"\\b\")\n\t\t\t\t\t\t)\n\t\t\t\t\t\t: eq\n\t\t\t\t// named param. Remove bindings for arg and create instead bindings array for prop\n\t\t\t\t\t\t\t? (parenDepth && syntaxError(params), bindings && pathBindings.pop(), named = path, boundName = bound, paramIndex = index + all.length,\n\t\t\t\t\t\t\t\t\tbindings && ((bindings = bndCtx.bd = pathBindings[named] = []), bindings.skp = !bound), path + ':')\n\t\t\t\t\t\t\t: path\n\t\t\t\t// path\n\t\t\t\t\t\t\t\t? (path.split(\"^\").join(\".\").replace(rPath, parsePath)\n\t\t\t\t\t\t\t\t\t+ (prn\n\t\t\t\t// some.fncall(\n\t\t\t\t\t\t\t\t\t\t? (bndCtx = bndStack[++parenDepth] = {bd: []}, fnCall[parenDepth] = rtSq, prn)\n\t\t\t\t\t\t\t\t\t\t: operator)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t: operator\n\t\t\t\t// operator\n\t\t\t\t\t\t\t\t\t? operator\n\t\t\t\t\t\t\t\t\t: rtPrn\n\t\t\t\t// function\n\t\t\t\t\t\t\t\t\t\t? ((rtPrn = fnCall[parenDepth] || rtPrn, fnCall[parenDepth] = false, bndCtx = bndStack[--parenDepth], rtPrn)\n\t\t\t\t\t\t\t\t\t\t\t+ (prn // rtPrn and prn, e.g )( in (a)() or a()(), or )[ in a()[]\n\t\t\t\t\t\t\t\t\t\t\t\t? (bndCtx = bndStack[++parenDepth], fnCall[parenDepth] = rtSq, prn)\n\t\t\t\t\t\t\t\t\t\t\t\t: \"\")\n\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t\t: comma\n\t\t\t\t\t\t\t\t\t\t\t? (fnCall[parenDepth] || syntaxError(params), \",\") // We don't allow top-level literal arrays or objects\n\t\t\t\t\t\t\t\t\t\t\t: lftPrn0\n\t\t\t\t\t\t\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t\t\t\t\t\t\t: (aposed = apos, quoted = quot, '\"')\n\t\t\t\t))\n\t\t\t);\n\t\t}\n\t}\n\n\tvar named, bindto, boundName,\n\t\tquoted, // boolean for string content in double quotes\n\t\taposed, // or in single quotes\n\t\tbindings = pathBindings && pathBindings[0], // bindings array for the first arg\n\t\tbndCtx = {bd: bindings},\n\t\tbndStack = {0: bndCtx},\n\t\tparamIndex = 0, // list,\n\t\ttmplLinks = (tmpl ? tmpl.links : bindings && (bindings.links = bindings.links || {})) || topView.tmpl.links,\n\t\t// The following are used for tracking path parsing including nested paths, such as \"a.b(c^d + (e))^f\", and chained computed paths such as\n\t\t// \"a.b().c^d().e.f().g\" - which has four chained paths, \"a.b()\", \"^c.d()\", \".e.f()\" and \".g\"\n\t\tparenDepth = 0,\n\t\tfnCall = {}, // We are in a function call\n\t\tpathStart = {}, // tracks the start of the current path such as c^d() in the above example\n\t\tresult = (params + (tmpl ? \" \" : \"\")).replace(rParams, parseTokens);\n\n\treturn !parenDepth && result || syntaxError(params); // Syntax error if unbalanced parens in params expression\n}\n\nfunction buildCode(ast, tmpl, isLinkExpr) {\n\t// Build the template function code from the AST nodes, and set as property on the passed-in template object\n\t// Used for compiling templates, and also by JsViews to build functions for data link expressions\n\tvar i, node, tagName, converter, tagCtx, hasTag, hasEncoder, getsVal, hasCnvt, useCnvt, tmplBindings, pathBindings, params, boundOnErrStart, boundOnErrEnd,\n\t\ttagRender, nestedTmpls, tmplName, nestedTmpl, tagAndElses, content, markup, nextIsElse, oldCode, isElse, isGetVal, tagCtxFn, onError, tagStart, trigger,\n\t\ttmplBindingKey = 0,\n\t\tuseViews = $subSettingsAdvanced.useViews || tmpl.useViews || tmpl.tags || tmpl.templates || tmpl.helpers || tmpl.converters,\n\t\tcode = \"\",\n\t\ttmplOptions = {},\n\t\tl = ast.length;\n\n\tif (\"\" + tmpl === tmpl) {\n\t\ttmplName = isLinkExpr ? 'data-link=\"' + tmpl.replace(rNewLine, \" \").slice(1, -1) + '\"' : tmpl;\n\t\ttmpl = 0;\n\t} else {\n\t\ttmplName = tmpl.tmplName || \"unnamed\";\n\t\tif (tmpl.allowCode) {\n\t\t\ttmplOptions.allowCode = true;\n\t\t}\n\t\tif (tmpl.debug) {\n\t\t\ttmplOptions.debug = true;\n\t\t}\n\t\ttmplBindings = tmpl.bnds;\n\t\tnestedTmpls = tmpl.tmpls;\n\t}\n\tfor (i = 0; i < l; i++) {\n\t\t// AST nodes: [0: tagName, 1: converter, 2: content, 3: params, 4: code, 5: onError, 6: trigger, 7:pathBindings, 8: contentMarkup]\n\t\tnode = ast[i];\n\n\t\t// Add newline for each callout to t() c() etc. and each markup string\n\t\tif (\"\" + node === node) {\n\t\t\t// a markup string to be inserted\n\t\t\tcode += '\\n+\"' + node + '\"';\n\t\t} else {\n\t\t\t// a compiled tag expression to be inserted\n\t\t\ttagName = node[0];\n\t\t\tif (tagName === \"*\") {\n\t\t\t\t// Code tag: {{* }}\n\t\t\t\tcode += \";\\n\" + node[1] + \"\\nret=ret\";\n\t\t\t} else {\n\t\t\t\tconverter = node[1];\n\t\t\t\tcontent = !isLinkExpr && node[2];\n\t\t\t\ttagCtx = paramStructure(node[3], 'params') + '},' + paramStructure(params = node[4]);\n\t\t\t\tonError = node[5];\n\t\t\t\ttrigger = node[6];\n\t\t\t\tmarkup = node[8] && node[8].replace(rUnescapeQuotes, \"$1\");\n\t\t\t\tif (isElse = tagName === \"else\") {\n\t\t\t\t\tif (pathBindings) {\n\t\t\t\t\t\tpathBindings.push(node[7]);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\ttmplBindingKey = 0;\n\t\t\t\t\tif (tmplBindings && (pathBindings = node[7])) { // Array of paths, or false if not data-bound\n\t\t\t\t\t\tpathBindings = [pathBindings];\n\t\t\t\t\t\ttmplBindingKey = tmplBindings.push(1); // Add placeholder in tmplBindings for compiled function\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tuseViews = useViews || params[1] || params[2] || pathBindings || /view.(?!index)/.test(params[0]);\n\t\t\t\t// useViews is for perf optimization. For render() we only use views if necessary - for the more advanced scenarios.\n\t\t\t\t// We use views if there are props, contextual properties or args with #... (other than #index) - but you can force\n\t\t\t\t// using the full view infrastructure, (and pay a perf price) by opting in: Set useViews: true on the template, manually...\n\t\t\t\tif (isGetVal = tagName === \":\") {\n\t\t\t\t\tif (converter) {\n\t\t\t\t\t\ttagName = converter === HTML ? \">\" : converter + tagName;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tif (content) { // TODO optimize - if content.length === 0 or if there is a tmpl=\"...\" specified - set content to null / don't run this compilation code - since content won't get used!!\n\t\t\t\t\t\t// Create template object for nested template\n\t\t\t\t\t\tnestedTmpl = tmplObject(markup, tmplOptions);\n\t\t\t\t\t\tnestedTmpl.tmplName = tmplName + \"/\" + tagName;\n\t\t\t\t\t\t// Compile to AST and then to compiled function\n\t\t\t\t\t\tnestedTmpl.useViews = nestedTmpl.useViews || useViews;\n\t\t\t\t\t\tbuildCode(content, nestedTmpl);\n\t\t\t\t\t\tuseViews = nestedTmpl.useViews;\n\t\t\t\t\t\tnestedTmpls.push(nestedTmpl);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (!isElse) {\n\t\t\t\t\t\t// This is not an else tag.\n\t\t\t\t\t\ttagAndElses = tagName;\n\t\t\t\t\t\tuseViews = useViews || tagName && (!$tags[tagName] || !$tags[tagName].flow);\n\t\t\t\t\t\t// Switch to a new code string for this bound tag (and its elses, if it has any) - for returning the tagCtxs array\n\t\t\t\t\t\toldCode = code;\n\t\t\t\t\t\tcode = \"\";\n\t\t\t\t\t}\n\t\t\t\t\tnextIsElse = ast[i + 1];\n\t\t\t\t\tnextIsElse = nextIsElse && nextIsElse[0] === \"else\";\n\t\t\t\t}\n\t\t\t\ttagStart = onError ? \";\\ntry{\\nret+=\" : \"\\n+\";\n\t\t\t\tboundOnErrStart = \"\";\n\t\t\t\tboundOnErrEnd = \"\";\n\n\t\t\t\tif (isGetVal && (pathBindings || trigger || converter && converter !== HTML)) {\n\t\t\t\t\t// For convertVal we need a compiled function to return the new tagCtx(s)\n\t\t\t\t\ttagCtxFn = new Function(\"data,view,j,u\", \" // \" + tmplName + \" \" + tmplBindingKey + \" \" + tagName\n\t\t\t\t\t\t\t\t\t\t+ \"\\nreturn {\" + tagCtx + \"};\");\n\t\t\t\t\ttagCtxFn._er = onError;\n\t\t\t\t\ttagCtxFn._tag = tagName;\n\n\t\t\t\t\tif (isLinkExpr) {\n\t\t\t\t\t\treturn tagCtxFn;\n\t\t\t\t\t}\n\n\t\t\t\t\tsetPaths(tagCtxFn, pathBindings);\n\t\t\t\t\ttagRender = 'c(\"' + converter + '\",view,';\n\t\t\t\t\tuseCnvt = true;\n\t\t\t\t\tboundOnErrStart = tagRender + tmplBindingKey + \",\";\n\t\t\t\t\tboundOnErrEnd = \")\";\n\t\t\t\t}\n\t\t\t\tcode += (isGetVal\n\t\t\t\t\t? (isLinkExpr ? (onError ? \"try{\\n\" : \"\") + \"return \" : tagStart) + (useCnvt // Call _cnvt if there is a converter: {{cnvt: ... }} or {^{cnvt: ... }}\n\t\t\t\t\t\t? (useCnvt = undefined, useViews = hasCnvt = true, tagRender + (pathBindings\n\t\t\t\t\t\t\t? ((tmplBindings[tmplBindingKey - 1] = tagCtxFn), tmplBindingKey) // Store the compiled tagCtxFn in tmpl.bnds, and pass the key to convertVal()\n\t\t\t\t\t\t\t: \"{\" + tagCtx + \"}\") + \")\")\n\t\t\t\t\t\t: tagName === \">\"\n\t\t\t\t\t\t\t? (hasEncoder = true, \"h(\" + params[0] + \")\")\n\t\t\t\t\t\t\t: (getsVal = true, \"((v=\" + params[0] + ')!=null?v:' + (isLinkExpr ? 'null)' : '\"\")'))\n\t\t\t\t\t\t\t// Non strict equality so data-link=\"title{:expr}\" with expr=null/undefined removes title attribute\n\t\t\t\t\t)\n\t\t\t\t\t: (hasTag = true, \"\\n{view:view,tmpl:\" // Add this tagCtx to the compiled code for the tagCtxs to be passed to renderTag()\n\t\t\t\t\t\t+ (content ? nestedTmpls.length : \"0\") + \",\" // For block tags, pass in the key (nestedTmpls.length) to the nested content template\n\t\t\t\t\t\t+ tagCtx + \"},\"));\n\n\t\t\t\tif (tagAndElses && !nextIsElse) {\n\t\t\t\t\t// This is a data-link expression or an inline tag without any elses, or the last {{else}} of an inline tag\n\t\t\t\t\t// We complete the code for returning the tagCtxs array\n\t\t\t\t\tcode = \"[\" + code.slice(0, -1) + \"]\";\n\t\t\t\t\ttagRender = 't(\"' + tagAndElses + '\",view,this,';\n\t\t\t\t\tif (isLinkExpr || pathBindings) {\n\t\t\t\t\t\t// This is a bound tag (data-link expression or inline bound tag {^{tag ...}}) so we store a compiled tagCtxs function in tmp.bnds\n\t\t\t\t\t\tcode = new Function(\"data,view,j,u\", \" // \" + tmplName + \" \" + tmplBindingKey + \" \" + tagAndElses + \"\\nreturn \" + code + \";\");\n\t\t\t\t\t\tcode._er = onError;\n\t\t\t\t\t\tcode._tag = tagAndElses;\n\t\t\t\t\t\tif (pathBindings) {\n\t\t\t\t\t\t\tsetPaths(tmplBindings[tmplBindingKey - 1] = code, pathBindings);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (isLinkExpr) {\n\t\t\t\t\t\t\treturn code; // For a data-link expression we return the compiled tagCtxs function\n\t\t\t\t\t\t}\n\t\t\t\t\t\tboundOnErrStart = tagRender + tmplBindingKey + \",undefined,\";\n\t\t\t\t\t\tboundOnErrEnd = \")\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// This is the last {{else}} for an inline tag.\n\t\t\t\t\t// For a bound tag, pass the tagCtxs fn lookup key to renderTag.\n\t\t\t\t\t// For an unbound tag, include the code directly for evaluating tagCtxs array\n\t\t\t\t\tcode = oldCode + tagStart + tagRender + (tmplBindingKey || code) + \")\";\n\t\t\t\t\tpathBindings = 0;\n\t\t\t\t\ttagAndElses = 0;\n\t\t\t\t}\n\t\t\t\tif (onError) {\n\t\t\t\t\tuseViews = true;\n\t\t\t\t\tcode += ';\\n}catch(e){ret' + (isLinkExpr ? \"urn \" : \"+=\") + boundOnErrStart + 'j._err(e,view,' + onError + ')' + boundOnErrEnd + ';}' + (isLinkExpr ? \"\" : 'ret=ret');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t// Include only the var references that are needed in the code\n\tcode = \"// \" + tmplName\n\n\t\t+ \"\\nvar v\"\n\t\t+ (hasTag ? \",t=j._tag\" : \"\") // has tag\n\t\t+ (hasCnvt ? \",c=j._cnvt\" : \"\") // converter\n\t\t+ (hasEncoder ? \",h=j._html\" : \"\") // html converter\n\t\t+ (isLinkExpr ? \";\\n\" : ',ret=\"\"\\n')\n\t\t+ (tmplOptions.debug ? \"debugger;\" : \"\")\n\t\t+ code\n\t\t+ (isLinkExpr ? \"\\n\" : \";\\nreturn ret;\");\n\n\tif ($subSettings.debugMode !== false) {\n\t\tcode = \"try {\\n\" + code + \"\\n}catch(e){\\nreturn j._err(e, view);\\n}\";\n\t}\n\n\ttry {\n\t\tcode = new Function(\"data,view,j,u\", code);\n\t} catch (e) {\n\t\tsyntaxError(\"Compiled template code:\\n\\n\" + code + '\\n: \"' + e.message + '\"');\n\t}\n\tif (tmpl) {\n\t\ttmpl.fn = code;\n\t\ttmpl.useViews = !!useViews;\n\t}\n\treturn code;\n}\n\n//==========\n// Utilities\n//==========\n\n// Merge objects, in particular contexts which inherit from parent contexts\nfunction extendCtx(context, parentContext) {\n\t// Return copy of parentContext, unless context is defined and is different, in which case return a new merged context\n\t// If neither context nor parentContext are defined, return undefined\n\treturn context && context !== parentContext\n\t\t? (parentContext\n\t\t\t? $extend($extend({}, parentContext), context)\n\t\t\t: context)\n\t\t: parentContext && $extend({}, parentContext);\n}\n\n// Get character entity for HTML and Attribute encoding\nfunction getCharEntity(ch) {\n\treturn charEntities[ch] || (charEntities[ch] = \"&#\" + ch.charCodeAt(0) + \";\");\n}\n\nfunction getTargetProps(source) {\n\t// this pointer is theMap - which has tagCtx.props too\n\t// arguments: tagCtx.args.\n\tvar key, prop,\n\t\tprops = [];\n\n\tif (typeof source === OBJECT) {\n\t\tfor (key in source) {\n\t\t\tprop = source[key];\n\t\t\tif (key !== $expando && source.hasOwnProperty(key) && !$isFunction(prop)) {\n\t\t\t\tprops.push({key: key, prop: prop});\n\t\t\t}\n\t\t}\n\t}\n\treturn props;\n}\n\nfunction $fnRender(data, context, noIteration) {\n\tvar tmplElem = this.jquery && (this[0] || error('Unknown template')), // Targeted element not found for jQuery template selector such as \"#myTmpl\"\n\t\ttmpl = tmplElem.getAttribute(tmplAttr);\n\n\treturn renderContent.call(tmpl ? $.data(tmplElem)[jsvTmpl] : $templates(tmplElem), data, context, noIteration);\n}\n\n//========================== Register converters ==========================\n\nfunction htmlEncode(text) {\n\t// HTML encode: Replace < > & ' and \" by corresponding entities.\n\treturn text != undefined ? rIsHtml.test(text) && (\"\" + text).replace(rHtmlEncode, getCharEntity) || text : \"\";\n}\n\n//========================== Initialize ==========================\n\n$sub = $views.sub;\n$viewsSettings = $views.settings;\n\nif (!(jsr || $ && $.render)) {\n\t// JsRender not already loaded, or loaded without jQuery, and we are now moving from jsrender namespace to jQuery namepace\n\tfor (jsvStoreName in jsvStores) {\n\t\tregisterStore(jsvStoreName, jsvStores[jsvStoreName]);\n\t}\n\n\t$converters = $views.converters;\n\t$helpers = $views.helpers;\n\t$tags = $views.tags;\n\n\t$sub._tg.prototype = {\n\t\tbaseApply: baseApply,\n\t\tcvtArgs: convertArgs\n\t};\n\n\ttopView = $sub.topView = new View();\n\n\t//BROWSER-SPECIFIC CODE\n\tif ($) {\n\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t// jQuery (= $) is loaded\n\n\t\t$.fn.render = $fnRender;\n\t\t$expando = $.expando;\n\t\tif ($.observable) {\n\t\t\t$extend($sub, $.views.sub); // jquery.observable.js was loaded before jsrender.js\n\t\t\t$views.map = $.views.map;\n\t\t}\n\n\t} else {\n\t\t////////////////////////////////////////////////////////////////////////////////////////////////\n\t\t// jQuery is not loaded.\n\n\t\t$ = {};\n\n\t\tif (setGlobals) {\n\t\t\tglobal.jsrender = $; // We are loading jsrender.js from a script element, not AMD or CommonJS, so set global\n\t\t}\n\n\t\t// Error warning if jsrender.js is used as template engine on Node.js (e.g. Express or Hapi...)\n\t\t// Use jsrender-node.js instead...\n\t\t$.renderFile = $.__express = $.compile = function() { throw \"Node.js: use npm jsrender, or jsrender-node.js\"; };\n\n\t\t//END BROWSER-SPECIFIC CODE\n\t\t$.isFunction = function(ob) {\n\t\t\treturn typeof ob === \"function\";\n\t\t};\n\n\t\t$.isArray = Array.isArray || function(obj) {\n\t\t\treturn ({}.toString).call(obj) === \"[object Array]\";\n\t\t};\n\n\t\t$sub._jq = function(jq) { // private method to move from JsRender APIs from jsrender namespace to jQuery namespace\n\t\t\tif (jq !== $) {\n\t\t\t\t$extend(jq, $); // map over from jsrender namespace to jQuery namespace\n\t\t\t\t$ = jq;\n\t\t\t\t$.fn.render = $fnRender;\n\t\t\t\tdelete $.jsrender;\n\t\t\t\t$expando = $.expando;\n\t\t\t}\n\t\t};\n\n\t\t$.jsrender = versionNumber;\n\t}\n\t$subSettings = $sub.settings;\n\t$subSettings.allowCode = false;\n\t$isFunction = $.isFunction;\n\t$.render = $render;\n\t$.views = $views;\n\t$.templates = $templates = $views.templates;\n\n\tfor (setting in $subSettings) {\n\t\taddSetting(setting);\n\t}\n\n\t($viewsSettings.debugMode = function(debugMode) {\n\t\treturn debugMode === undefined\n\t\t\t? $subSettings.debugMode\n\t\t\t: (\n\t\t\t\t$subSettings.debugMode = debugMode,\n\t\t\t\t$subSettings.onError = debugMode + \"\" === debugMode\n\t\t\t\t\t? new Function(\"\", \"return '\" + debugMode + \"';\" )\n\t\t\t\t\t: $isFunction(debugMode)\n\t\t\t\t\t\t? debugMode\n\t\t\t\t\t\t: undefined,\n\t\t\t\t$viewsSettings);\n\t})(false); // jshint ignore:line\n\n\t$subSettingsAdvanced = $subSettings.advanced = {\n\t\tuseViews: false,\n\t\t_jsv: false // For global access to JsViews store\n\t};\n\n\t//========================== Register tags ==========================\n\n\t$tags({\n\t\t\"if\": {\n\t\t\trender: function(val) {\n\t\t\t\t// This function is called once for {{if}} and once for each {{else}}.\n\t\t\t\t// We will use the tag.rendering object for carrying rendering state across the calls.\n\t\t\t\t// If not done (a previous block has not been rendered), look at expression for this block and render the block if expression is truthy\n\t\t\t\t// Otherwise return \"\"\n\t\t\t\tvar self = this,\n\t\t\t\t\ttagCtx = self.tagCtx,\n\t\t\t\t\tret = (self.rendering.done || !val && (arguments.length || !tagCtx.index))\n\t\t\t\t\t\t? \"\"\n\t\t\t\t\t\t: (self.rendering.done = true, self.selected = tagCtx.index,\n\t\t\t\t\t\t\t// Test is satisfied, so render content on current context. We call tagCtx.render() rather than return undefined\n\t\t\t\t\t\t\t// (which would also render the tmpl/content on the current context but would iterate if it is an array)\n\t\t\t\t\t\t\ttagCtx.render(tagCtx.view, true)); // no arg, so renders against parentView.data\n\t\t\t\treturn ret;\n\t\t\t},\n\t\t\tflow: true\n\t\t},\n\t\t\"for\": {\n\t\t\trender: function(val) {\n\t\t\t\t// This function is called once for {{for}} and once for each {{else}}.\n\t\t\t\t// We will use the tag.rendering object for carrying rendering state across the calls.\n\t\t\t\tvar finalElse = !arguments.length,\n\t\t\t\t\tvalue,\n\t\t\t\t\tself = this,\n\t\t\t\t\ttagCtx = self.tagCtx,\n\t\t\t\t\tresult = \"\",\n\t\t\t\t\tdone = 0;\n\n\t\t\t\tif (!self.rendering.done) {\n\t\t\t\t\tvalue = finalElse ? tagCtx.view.data : val; // For the final else, defaults to current data without iteration.\n\t\t\t\t\tif (value !== undefined) {\n\t\t\t\t\t\tresult += tagCtx.render(value, finalElse); // Iterates except on final else, if data is an array. (Use {{include}} to compose templates without array iteration)\n\t\t\t\t\t\tdone += $isArray(value) ? value.length : 1;\n\t\t\t\t\t}\n\t\t\t\t\tif (self.rendering.done = done) {\n\t\t\t\t\t\tself.selected = tagCtx.index;\n\t\t\t\t\t}\n\t\t\t\t\t// If nothing was rendered we will look at the next {{else}}. Otherwise, we are done.\n\t\t\t\t}\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tflow: true\n\t\t},\n\t\tprops: {\n\t\t\tbaseTag: \"for\",\n\t\t\tdataMap: dataMap(getTargetProps),\n\t\t\tflow: true\n\t\t},\n\t\tinclude: {\n\t\t\tflow: true\n\t\t},\n\t\t\"*\": {\n\t\t\t// {{* code... }} - Ignored if template.allowCode and $.views.settings.allowCode are false. Otherwise include code in compiled template\n\t\t\trender: retVal,\n\t\t\tflow: true\n\t\t},\n\t\t\":*\": {\n\t\t\t// {{:* returnedExpression }} - Ignored if template.allowCode and $.views.settings.allowCode are false. Otherwise include code in compiled template\n\t\t\trender: retVal,\n\t\t\tflow: true\n\t\t},\n\t\tdbg: $helpers.dbg = $converters.dbg = dbgBreak // Register {{dbg/}}, {{dbg:...}} and ~dbg() to throw and catch, as breakpoints for debugging.\n\t});\n\n\t$converters({\n\t\thtml: htmlEncode,\n\t\tattr: htmlEncode, // Includes > encoding since rConvertMarkers in JsViews does not skip > characters in attribute strings\n\t\turl: function(text) {\n\t\t\t// URL encoding helper.\n\t\t\treturn text != undefined ? encodeURI(\"\" + text) : text === null ? text : \"\"; // null returns null, e.g. to remove attribute. undefined returns \"\"\n\t\t}\n\t});\n}\n//========================== Define default delimiters ==========================\n$subSettings = $sub.settings;\n$isArray = ($||jsr).isArray;\n$viewsSettings.delimiters(\"{{\", \"}}\", \"^\");\n\nif (jsrToJq) { // Moving from jsrender namespace to jQuery namepace - copy over the stored items (templates, converters, helpers...)\n\tjsr.views.sub._jq($);\n}\nreturn $ || jsr;\n}, window));\n"]}
@@ -0,0 +1,64 @@
1
+ /*! JsRender tmplify submodule v0.9.75 (Beta): http://jsviews.com/#jsrender */
2
+ /*! Browserify transform for JsRender templates */
3
+ /*
4
+ * Copyright 2016, Boris Moore
5
+ * Released under the MIT License.
6
+ */
7
+
8
+ (function() {
9
+ "use strict";
10
+ var jsrender = require('./../jsrender-node.js'),
11
+ fs = require('fs'),
12
+ path = require('path'),
13
+ pathSep = path.sep,
14
+ through = require('through2'),
15
+ rootDirPath = path.resolve("./"),
16
+ rootDirPathLen = rootDirPath.length + 1;
17
+
18
+ function isTemplate(fileExt, extensions) {
19
+ extensions = typeof extensions === "string"
20
+ ? extensions
21
+ : "html jsrender jsr"; // Default extensions
22
+ return new RegExp("\\s" + fileExt + "\\s").test(" " + extensions + " ");
23
+ }
24
+
25
+ module.exports = function(file, options) {
26
+ var nodeFileDirName = path.dirname(file);
27
+
28
+ if (!isTemplate(path.extname(file).slice(1), options && (options.extensions || options.e))) {
29
+ return through();
30
+ }
31
+ return through(function(buf, enc, next) {
32
+ var createTmplCode, ref, pathFromFileDir,
33
+ markup = buf.toString().replace(/^\uFEFF/, ''), // Remove BOM if necessary
34
+ tmpl = jsrender.templates(markup),
35
+ bundledFile = 'var tmplRefs = [],\n'
36
+ + " mkup = '" + markup.replace(/['"\\]/g, "\\$&").replace(/[ \t]*(\r\n|\n|\r)/g, '\\n') + "',\n" // Normalize newlines, and escape quotes and \ character
37
+ + ' $ = global.jsrender || global.jQuery;\n\n',
38
+ templateName = './' + file.slice(rootDirPathLen).split(pathSep).join('/');
39
+
40
+ for (ref in tmpl.refs) {
41
+ // Recursively bundle any nested template references, e.g. {{include tmpl="./some/template.html/}}"
42
+ fs.stat(ref, function(err, stat) {
43
+ // Async check that file exists
44
+ if(err && err.code == 'ENOENT') {
45
+ throw new Error("Template '" + ref + "' not found at '" + err.path + "'. Use path relative to '" + rootDirPath + "'.");
46
+ }
47
+ });
48
+ pathFromFileDir = './' + path.relative(nodeFileDirName, ref).split(pathSep).join('/');
49
+ bundledFile += 'tmplRefs.push(require("' + pathFromFileDir + '"));\n';
50
+ }
51
+
52
+ createTmplCode = '$.templates("' + templateName + '", mkup)';
53
+ bundledFile +=
54
+ 'module.exports = $ ? ' + createTmplCode
55
+ + ' :\n function($) {\n'
56
+ + ' if (!$ || !$.views) {throw "Requires jsrender/jQuery";}\n'
57
+ + ' while (tmplRefs.length) {\n tmplRefs.pop()($); // compile nested template\n }\n\n'
58
+ + ' return ' + createTmplCode
59
+ + '\n };';
60
+ this.push(bundledFile);
61
+ next();
62
+ });
63
+ };
64
+ }());
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 Stratumn
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.