!function(e,b){return"function"===typeof require&&typeof exports===typeof module?module.exports=b:e.MiniHandlebars=b}(this,function(){var e=function(b,c){this.o=null!=b?b:{};this.templates=null!=c?c:{}};e.prototype.render=function(b,c){var a,h=1,j,k={},d=[],f;c=e._extend(this.o.locals,c);b.replace(/\{\{(\/\w+|#?\w+)( [\w, ]+)?\}\}/g,function(){var a,b,c,e,f,g;a=arguments;c="/"===a[1][0];g={s:a[0],b:b="string"===typeof a[2],a:b&&a[2].replace(/(^ +| +$)/,"").split(/, */)||[],v:b===c,n:f=b===c?a[1]: "/"===a[1][0]||"#"===a[1][0]?a[1].slice(1):a[1],l:e=b===c&&h||b&&h++||c&&--h,k:e+"."+f,x:a[3]};return!!(1===e&&c&&(d[k[g.k]].o=g)||(g.v||g.b)&&(k[g.k]=d.push(g)-1))||a[0]});f=0;for(a in d)1===d[a].l&&(j=function(c,e){b=b.substr(0,d[a].x+f)+e+b.substr(d[a].x+c+f);f+=e.length-c},d[a].v?j(d[a].s.length,c[d[a].n]):d[a].b&&j(d[a].o.x+(d[a].o.s.length-d[a].x),c[d[a].n].apply(function(){},[b.substr(d[a].x+d[a].s.length+f,d[a].o.x-(d[a].x+d[a].s.length)),c].concat(d[a].a))));return b};e._extend=function(){var b= arguments,c,a={},e;for(e in b)for(c in b[e])({}).hasOwnProperty.call(b[e],c)&&(a[c]=b[e][c]);return a};return e}());