var Hogan={};(function(j,h){j.Template=function(o,p,n,m){this.r=o||this.r;this.c=n;this.options=m;this.text=p||"";this.buf=(h)?[]:""};j.Template.prototype={r:function(o,n,m){return""},v:c,t:e,render:function b(o,n,m){return this.ri([o],n||{},m)},ri:function(o,n,m){return this.r(o,n,m)},rp:function(o,q,p,m){var n=p[o];if(!n){return""}if(this.c&&typeof n=="string"){n=this.c.compile(n,this.options)}return n.ri(q,p,m)},rs:function(p,o,q){var m=p[p.length-1];if(!g(m)){q(p,o,this);return}for(var n=0;n=0;o--){n=m[o];if(n&&typeof n=="object"&&q in n){t=n[q];s=true;break}}if(!s){return(r)?false:""}if(!r&&typeof t=="function"){t=this.lv(t,m,p)}return t},ho:function(s,m,p,r,o){var q=this.c;var n=this.options;n.delimiters=o;var r=s.call(m,r);r=(r==null)?String(r):r.toString();this.b(q.compile(r,n).render(m,p));return false},b:(h)?function(m){this.buf.push(m)}:function(m){this.buf+=m},fl:(h)?function(){var m=this.buf.join("");this.buf=[];return m}:function(){var m=this.buf;this.buf="";return m},ls:function(n,u,r,o,m,p,v){var q=u[u.length-1],s=null;if(!o&&this.c&&n.length>0){return this.ho(n,q,r,this.text.substring(m,p),v)}s=n.call(q);if(typeof s=="function"){if(o){return true}else{if(this.c){return this.ho(s,q,r,this.text.substring(m,p),v)}}}return s},lv:function(q,o,p){var n=o[o.length-1];var m=q.call(n);if(typeof m=="function"){m=e(m.call(n));if(this.c&&~m.indexOf("{\u007B")){return this.c.compile(m,this.options).render(n,p)}}return e(m)}};var i=/&/g,d=//g,l=/\'/g,k=/\"/g,f=/[&<>\"\']/;function e(m){return String((m===null||m===undefined)?"":m)}function c(m){m=e(m);return f.test(m)?m.replace(i,"&").replace(d,"<").replace(a,">").replace(l,"'").replace(k,"""):m}var g=Array.isArray||function(m){return Object.prototype.toString.call(m)==="[object Array]"}})(typeof exports!=="undefined"?exports:Hogan);(function(n){var f=/\S/,j=/\"/g,o=/\n/g,k=/\r/g,u=/\\/g,a={"#":1,"^":2,"/":3,"!":4,">":5,"<":6,"=":7,_v:8,"{":9,"&":10};n.scan=function m(G,B){var O=G.length,y=0,D=1,x=2,z=y,C=null,Q=null,P="",J=[],F=false,N=0,K=0,H="{{",M="}}";function L(){if(P.length>0){J.push(new String(P));P=""}}function A(){var S=true;for(var R=K;R"){T.indent=J[S].toString()}J.splice(S,1)}}}else{if(!R){J.push({tag:"\n"})}}F=false;K=J.length}function E(V,S){var U="="+M,R=V.indexOf(U,S),T=q(V.substring(V.indexOf("=",S)+1,R)).split(" ");H=T[0];M=T[1];return R+U.length-1}if(B){B=B.split(" ");H=B[0];M=B[1]}for(N=0;N0){z=D.shift();if(z.tag=="#"||z.tag=="^"||e(z,C)){y.push(z);z.nodes=b(D,z.tag,y,C);x.push(z)}else{if(z.tag=="/"){if(y.length===0){throw new Error("Closing tag without opener: /"+z.n)}B=y.pop();if(z.n!=B.n&&!g(z.n,B.n,C)){throw new Error("Nesting error: "+B.n+" vs. "+z.n)}B.end=z.i;return x}else{x.push(z)}}}if(y.length>0){throw new Error("missing closing tag: "+y.pop().n)}return x}function e(A,y){for(var z=0,x=y.length;z"){B+=d(y[A])}else{if(x=="{"||x=="&"){B+=c(y[A].n,i(y[A].n))}else{if(x=="\n"){B+=l('"\\n"'+(y.length-1==A?"":" + i"))}else{if(x=="_v"){B+=p(y[A].n,i(y[A].n))}else{if(x===undefined){B+=l('"'+v(y[A])+'"')}}}}}}}}return B}function h(y,C,B,A,x,z){return"if(_.s(_."+B+'("'+v(C)+'",c,p,1),c,p,0,'+A+","+x+',"'+z+'")){_.rs(c,p,function(c,p,_){'+t(y)+"});c.pop();}"}function s(x,z,y){return"if(!_.s(_."+y+'("'+v(z)+'",c,p,1),c,p,1,0,0,"")){'+t(x)+"};"}function d(x){return'_.b(_.rp("'+v(x.n)+'",c,p,"'+(x.indent||"")+'"));'}function c(y,x){return"_.b(_.t(_."+x+'("'+v(y)+'",c,p,0)));'}function p(y,x){return"_.b(_.v(_."+x+'("'+v(y)+'",c,p,0)));'}function l(x){return"_.b("+x+");"}n.parse=function(y,z,x){x=x||{};return b(y,"",[],x.sectionTags||[])},n.cache={};n.compile=function(A,x){x=x||{};var z=A+"||"+!!x.asString;var y=this.cache[z];if(y){return y}y=this.generate(this.parse(this.scan(A,x.delimiters),A,x),A,x);return this.cache[z]=y}})(typeof exports!=="undefined"?exports:Hogan);