// // Dust - Asynchronous Templating v0.6.0 // http://akdubya.github.com/dustjs // // Copyright (c) 2010, Aleksander Williams // Released under the MIT License. // var dust={};function getGlobal(){return function(){return this.dust}.call(null)} (function(f){function h(a,c,d){this.stack=a;this.global=c;this.blocks=d}function k(a,c,d,b){this.tail=c;this.isObject=!f.isArray(a)&&a&&"object"===typeof a;this.head=a;this.index=d;this.of=b}function l(a){this.head=new b(this);this.callback=a;this.out=""}function e(){this.head=new b(this)}function b(a,c,d){this.root=a;this.next=c;this.data="";this.flushable=!1;this.taps=d}function i(a,c){this.head=a;this.tail=c}f.cache={};f.register=function(a,c){a&&(f.cache[a]=c)};f.render=function(a,c,d){d=(new l(d)).head; f.load(a,d,h.wrap(c)).end()};f.stream=function(a,c){var d=new e;f.nextTick(function(){f.load(a,d.head,h.wrap(c)).end()});return d};f.renderSource=function(a,c,d){return f.compileFn(a)(c,d)};f.compileFn=function(a,c){var d=f.loadSource(f.compile(a,c));return function(a,c){var b=c?new l(c):new e;f.nextTick(function(){d(b.head,h.wrap(a)).end()});return b}};f.load=function(a,c,d){var b=f.cache[a];return b?b(c,d):f.onLoad?c.map(function(c){f.onLoad(a,function(b,e){if(b)return c.setError(b);f.cache[a]|| f.loadSource(f.compile(e,a));f.cache[a](c,d).end()})}):c.setError(Error("Template Not Found: "+a))};f.loadSource=function(a){return eval(a)};f.isArray=Array.isArray?Array.isArray:function(a){return"[object Array]"==Object.prototype.toString.call(a)};f.nextTick=function(){return"undefined"!==typeof process?process.nextTick:function(a){setTimeout(a,0)}}();f.isEmpty=function(a){return f.isArray(a)&&!a.length?!0:0===a?!1:!a};f.filter=function(a,c,d){if(d)for(var b=0,e=d.length;b\"\']/),j=/&/g,m=//g,o=/\"/g,p=/\'/g;f.escapeHtml=function(a){return"string"===typeof a?!g.test(a)?a:a.replace(j,"&").replace(m,"<").replace(n,">").replace(o,""").replace(p,"'"):a};var q= /\\/g,r=/\r/g,s=/\u2028/g,t=/\u2029/g,u=/\n/g,v=/\f/g,w=/'/g,x=/"/g,y=/\t/g;f.escapeJs=function(a){return"string"===typeof a?a.replace(q,"\\\\").replace(x,'\\"').replace(w,"\\'").replace(r,"\\r").replace(s,"\\u2028").replace(t,"\\u2029").replace(u,"\\n").replace(v,"\\f").replace(y,"\\t"):a}})(dust);"undefined"!==typeof exports&&(dust.helpers=require("./dust-helpers").helpers,"undefined"!==typeof process&&require("./server")(dust),module.exports=dust); (function(f){function h(e){e=e.current();return typeof e==="object"&&e.isSelect===true}function k(e,b,f,g,j){var g=g||{},m;if(g.key)m=b.get(g.key);else if(h(b)){m=b.current().value;b.current().isResolved&&(j=function(){return false})}else throw"No key specified for filter and no key found in context from select statement";if(j(g.value,l(m,g.type,b))){if(h(b))b.current().isResolved=true;return e.render(f.block,b)}return f["else"]?e.render(f["else"],b):e.write("")}function l(e,b,f){if(e)switch(b||typeof e){case "number":return+e; case "string":return""+e;case "boolean":return Boolean(e);case "date":return new Date(e);case "context":return f.get(e)}return e}f.helpers={sep:function(e,b,f){return b.stack.index===b.stack.of-1?e:f.block(e,b)},idx:function(e,b,f){return f.block(e,b.push(b.stack.index))},"if":function(e,b,f,g){if(g&&g.cond){var j=g.cond;if(typeof j==="function"){j="";e.tap(function(b){j=j+b;return""}).render(g.cond,b).untap();j===""&&(j=false)}if(eval(j))return e.render(f.block,b);if(f["else"])return e.render(f["else"], b)}else typeof window!=="undefined"&&window.console&&window.console.log("No expression given!");return e},select:function(e,b,f,g){return e.render(f.block,b.push({isSelect:true,isResolved:false,value:b.get(g.key)}))},eq:function(e,b,f,g){return k(e,b,f,g,function(b,e){return e===b})},lt:function(e,b,f,g){return k(e,b,f,g,function(b,e){return eb})},gte:function(e,b, f,g){return k(e,b,f,g,function(b,e){return e>=b})},"else":function(e,b,f,g){return k(e,b,f,g,function(){return true})}}})("undefined"!==typeof exports?exports:getGlobal());