-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjade.min.js
2 lines (2 loc) · 48.3 KB
/
jade.min.js
1
2
(function(e){if("function"==typeof bootstrap)bootstrap("jade",e);else if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeJade=e}else"undefined"!=typeof window?window.jade=e():global.jade=e()})(function(){var define,ses,bootstrap,module,exports;return function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){if(!Array.isArray){Array.isArray=function(arr){return"[object Array]"==Object.prototype.toString.call(arr)}}if(!Object.keys){Object.keys=function(obj){var arr=[];for(var key in obj){if(obj.hasOwnProperty(key)){arr.push(key)}}return arr}}exports.merge=function merge(a,b){var ac=a["class"];var bc=b["class"];if(ac||bc){ac=ac||[];bc=bc||[];if(!Array.isArray(ac))ac=[ac];if(!Array.isArray(bc))bc=[bc];ac=ac.filter(nulls);bc=bc.filter(nulls);a["class"]=ac.concat(bc).join(" ")}for(var key in b){if(key!="class"){a[key]=b[key]}}return a};function nulls(val){return val!=null}exports.attrs=function attrs(obj,escaped){var buf=[],terse=obj.terse;delete obj.terse;var keys=Object.keys(obj),len=keys.length;if(len){buf.push("");for(var i=0;i<len;++i){var key=keys[i],val=obj[key];if("boolean"==typeof val||null==val){if(val){terse?buf.push(key):buf.push(key+'="'+key+'"')}}else if(0==key.indexOf("data")&&"string"!=typeof val){buf.push(key+"='"+JSON.stringify(val)+"'")}else if("class"==key&&Array.isArray(val)){buf.push(key+'="'+exports.escape(val.join(" "))+'"')}else if(escaped&&escaped[key]){buf.push(key+'="'+exports.escape(val)+'"')}else{buf.push(key+'="'+val+'"')}}}return buf.join(" ")};exports.escape=function escape(html){return String(html).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")};exports.rethrow=function rethrow(err,filename,lineno){if(!filename)throw err;if(typeof window!="undefined")throw err;var context=3,str=require("fs").readFileSync(filename,"utf8"),lines=str.split("\n"),start=Math.max(lineno-context,0),end=Math.min(lines.length,lineno+context);var context=lines.slice(start,end).map(function(line,i){var curr=i+start+1;return(curr==lineno?" > ":" ")+curr+"| "+line}).join("\n");err.path=filename;err.message=(filename||"Jade")+":"+lineno+"\n"+context+"\n\n"+err.message;throw err}},{fs:1}],3:[function(require,module,exports){module.exports=["meta","img","link","input","source","area","base","col","br","hr"]},{}],4:[function(require,module,exports){module.exports={5:"<!DOCTYPE html>","default":"<!DOCTYPE html>",xml:'<?xml version="1.0" encoding="utf-8" ?>',transitional:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',strict:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">',frameset:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">',1.1:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">',basic:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.1//EN" "http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd">',mobile:'<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.2//EN" "http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd">'}},{}],5:[function(require,module,exports){exports.merge=function(a,b){for(var key in b)a[key]=b[key];return a}},{}],6:[function(require,module,exports){var Parser=require("./parser"),Lexer=require("./lexer"),Compiler=require("./compiler"),runtime=require("./runtime"),fs=require("fs");exports.version="0.30.0";exports.selfClosing=require("./self-closing");exports.doctypes=require("./doctypes");exports.filters=require("./filters");exports.utils=require("./utils");exports.Compiler=Compiler;exports.Parser=Parser;exports.Lexer=Lexer;exports.nodes=require("./nodes");exports.runtime=runtime;exports.cache={};function parse(str,options){try{var parser=new Parser(str,options.filename,options);var compiler=new(options.compiler||Compiler)(parser.parse(),options),js=compiler.compile();if(options.debug){console.error("\nCompiled Function:\n\n[90m%s[0m",js.replace(/^/gm," "))}return""+"var buf = [];\n"+(options.self?"var self = locals || {};\n"+js:"with (locals || {}) {\n"+js+"\n}\n")+'return buf.join("");'}catch(err){parser=parser.context();runtime.rethrow(err,parser.filename,parser.lexer.lineno)}}function stripBOM(str){return 65279==str.charCodeAt(0)?str.substring(1):str}exports.compile=function(str,options){var options=options||{},filename=options.filename?JSON.stringify(options.filename):"undefined",fn;str=stripBOM(String(str));if(options.compileDebug!==false){fn=["jade.debug = [{ lineno: 1, filename: "+filename+" }];","try {",parse(str,options),"} catch (err) {"," jade.rethrow(err, jade.debug[0].filename, jade.debug[0].lineno);","}"].join("\n")}else{fn=parse(str,options)}if(options.client)return new Function("locals",fn);fn=new Function("locals, jade",fn);return function(locals){return fn(locals,Object.create(runtime))}};exports.render=function(str,options,fn){if("function"==typeof options){fn=options,options={}}if(options.cache&&!options.filename){return fn(new Error('the "filename" option is required for caching'))}try{var path=options.filename;var tmpl=options.cache?exports.cache[path]||(exports.cache[path]=exports.compile(str,options)):exports.compile(str,options);fn(null,tmpl(options))}catch(err){fn(err)}};exports.renderFile=function(path,options,fn){var key=path+":string";if("function"==typeof options){fn=options,options={}}try{options.filename=path;var str=options.cache?exports.cache[key]||(exports.cache[key]=fs.readFileSync(path,"utf8")):fs.readFileSync(path,"utf8");exports.render(str,options,fn)}catch(err){fn(err)}};exports.__express=exports.renderFile},{fs:1,"./parser":7,"./lexer":8,"./compiler":9,"./runtime":2,"./self-closing":3,"./doctypes":4,"./utils":5,"./filters":10,"./nodes":11}],10:[function(require,module,exports){module.exports=filter;function filter(name,str,options){if(typeof filter[name]==="function"){var res=filter[name](str,options)}else{throw new Error('unknown filter ":'+name+'"')}return res}filter.exists=function(name,str,options){return typeof filter[name]==="function"}},{}],12:[function(require,module,exports){var process=module.exports={};process.nextTick=function(){var canSetImmediate=typeof window!=="undefined"&&window.setImmediate;var canPost=typeof window!=="undefined"&&window.postMessage&&window.addEventListener;if(canSetImmediate){return function(f){return window.setImmediate(f)}}if(canPost){var queue=[];window.addEventListener("message",function(ev){if(ev.source===window&&ev.data==="process-tick"){ev.stopPropagation();if(queue.length>0){var fn=queue.shift();fn()}}},true);return function nextTick(fn){queue.push(fn);window.postMessage("process-tick","*")}}return function nextTick(fn){setTimeout(fn,0)}}();process.title="browser";process.browser=true;process.env={};process.argv=[];process.binding=function(name){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(dir){throw new Error("process.chdir is not supported")}},{}],13:[function(require,module,exports){(function(process){function filter(xs,fn){var res=[];for(var i=0;i<xs.length;i++){if(fn(xs[i],i,xs))res.push(xs[i])}return res}function normalizeArray(parts,allowAboveRoot){var up=0;for(var i=parts.length;i>=0;i--){var last=parts[i];if(last=="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up--;up){parts.unshift("..")}}return parts}var splitPathRe=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;exports.resolve=function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:process.cwd();if(typeof path!=="string"||!path){continue}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=normalizeArray(filter(resolvedPath.split("/"),function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."};exports.normalize=function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.slice(-1)==="/";path=normalizeArray(filter(path.split("/"),function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path};exports.join=function(){var paths=Array.prototype.slice.call(arguments,0);return exports.normalize(filter(paths,function(p,index){return p&&typeof p==="string"}).join("/"))};exports.dirname=function(path){var dir=splitPathRe.exec(path)[1]||"";var isWindows=false;if(!dir){return"."}else if(dir.length===1||isWindows&&dir.length<=3&&dir.charAt(1)===":"){return dir}else{return dir.substring(0,dir.length-1)}};exports.basename=function(path,ext){var f=splitPathRe.exec(path)[2]||"";if(ext&&f.substr(-1*ext.length)===ext){f=f.substr(0,f.length-ext.length)}return f};exports.extname=function(path){return splitPathRe.exec(path)[3]||""};exports.relative=function(from,to){from=exports.resolve(from).substr(1);to=exports.resolve(to).substr(1);function trim(arr){var start=0;for(;start<arr.length;start++){if(arr[start]!=="")break}var end=arr.length-1;for(;end>=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i<length;i++){if(fromParts[i]!==toParts[i]){samePartsLength=i;break}}var outputParts=[];for(var i=samePartsLength;i<fromParts.length;i++){outputParts.push("..")}outputParts=outputParts.concat(toParts.slice(samePartsLength));return outputParts.join("/")}})(require("__browserify_process"))},{__browserify_process:12}],7:[function(require,module,exports){var Lexer=require("./lexer"),nodes=require("./nodes"),utils=require("./utils"),filters=require("./filters"),path=require("path"),extname=path.extname;var Parser=exports=module.exports=function Parser(str,filename,options){this.input=str;this.lexer=new Lexer(str,options);this.filename=filename;this.blocks=[];this.mixins={};this.options=options;this.contexts=[this]};var textOnly=exports.textOnly=["script","style"];Parser.prototype={context:function(parser){if(parser){this.contexts.push(parser)}else{return this.contexts.pop()}},advance:function(){return this.lexer.advance()},skip:function(n){while(n--)this.advance()},peek:function(){return this.lookahead(1)},line:function(){return this.lexer.lineno},lookahead:function(n){return this.lexer.lookahead(n)},parse:function(){var block=new nodes.Block,parser;block.line=this.line();while("eos"!=this.peek().type){if("newline"==this.peek().type){this.advance()}else{block.push(this.parseExpr())}}if(parser=this.extending){this.context(parser);var ast=parser.parse();this.context();for(var name in this.mixins)ast.unshift(this.mixins[name]);return ast}else{this.handleBlocks()}return block},handleBlocks:function(){this.blocks.reverse();var blocksHash={};for(var i in this.blocks){if(!{}.hasOwnProperty.call(blocksHash,[this.blocks[i].name])){blocksHash[this.blocks[i].name]=this.blocks[i]}else{switch(this.blocks[i].mode){case"append":blocksHash[this.blocks[i].name].nodes=blocksHash[this.blocks[i].name].nodes.concat(this.blocks[i].nodes);break;case"prepend":blocksHash[this.blocks[i].name].nodes=this.blocks[i].nodes.concat(blocksHash[this.blocks[i].name].nodes);break;default:blocksHash[this.blocks[i].name].nodes=this.blocks[i].nodes}this.blocks[i]=blocksHash[this.blocks[i].name]}}},expect:function(type){if(this.peek().type===type){return this.advance()}else{throw new Error('expected "'+type+'", but got "'+this.peek().type+'"')}},accept:function(type){if(this.peek().type===type){return this.advance()}},parseExpr:function(){switch(this.peek().type){case"tag":return this.parseTag();case"mixin":return this.parseMixin();case"block":return this.parseBlock();case"case":return this.parseCase();case"when":return this.parseWhen();case"default":return this.parseDefault();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"doctype":return this.parseDoctype();case"filter":return this.parseFilter();case"comment":return this.parseComment();case"text":return this.parseText();case"each":return this.parseEach();case"code":return this.parseCode();case"call":return this.parseCall();case"interpolation":return this.parseInterpolation();case"yield":this.advance();var block=new nodes.Block;block.yield=true;return block;case"id":case"class":var tok=this.advance();this.lexer.defer(this.lexer.tok("tag","div"));this.lexer.defer(tok);return this.parseExpr();default:throw new Error('unexpected token "'+this.peek().type+'"')}},parseText:function(){var tok=this.expect("text");var node=new nodes.Text(tok.val);node.line=this.line();return node},parseBlockExpansion:function(){if(":"==this.peek().type){this.advance();return new nodes.Block(this.parseExpr())}else{return this.block()}},parseCase:function(){var val=this.expect("case").val;var node=new nodes.Case(val);node.line=this.line();node.block=this.block();return node},parseWhen:function(){var val=this.expect("when").val;return new nodes.Case.When(val,this.parseBlockExpansion())},parseDefault:function(){this.expect("default");return new nodes.Case.When("default",this.parseBlockExpansion())},parseCode:function(){var tok=this.expect("code");var node=new nodes.Code(tok.val,tok.buffer,tok.escape);var block;var i=1;node.line=this.line();while(this.lookahead(i)&&"newline"==this.lookahead(i).type)++i;block="indent"==this.lookahead(i).type;if(block){this.skip(i-1);node.block=this.block()}return node},parseComment:function(){var tok=this.expect("comment");var node;if("indent"==this.peek().type){node=new nodes.BlockComment(tok.val,this.block(),tok.buffer)}else{node=new nodes.Comment(tok.val,tok.buffer)}node.line=this.line();return node},parseDoctype:function(){var tok=this.expect("doctype");var node=new nodes.Doctype(tok.val);node.line=this.line();return node},parseFilter:function(){var tok=this.expect("filter");var attrs=this.accept("attrs");var block;this.lexer.pipeless=true;block=this.parseTextBlock();this.lexer.pipeless=false;var node=new nodes.Filter(tok.val,block,attrs&&attrs.attrs);node.line=this.line();return node},parseEach:function(){var tok=this.expect("each");var node=new nodes.Each(tok.code,tok.val,tok.key);node.line=this.line();node.block=this.block();if(this.peek().type=="code"&&this.peek().val=="else"){this.advance();node.alternative=this.block()}return node},resolvePath:function(path,purpose){var p=require("path");var dirname=p.dirname;var basename=p.basename;var join=p.join;if(path[0]!=="/"&&!this.filename)throw new Error('the "filename" option is required to use "'+purpose+'" with "relative" paths');if(path[0]==="/"&&!this.options.basedir)throw new Error('the "basedir" option is required to use "'+purpose+'" with "absolute" paths');path=join(path[0]==="/"?this.options.basedir:dirname(this.filename),path);if(basename(path).indexOf(".")===-1)path+=".jade";return path},parseExtends:function(){var fs=require("fs");var path=this.resolvePath(this.expect("extends").val.trim(),"extends");if(".jade"!=path.substr(-5))path+=".jade";var str=fs.readFileSync(path,"utf8");var parser=new Parser(str,path,this.options);parser.blocks=this.blocks.reverse();parser.contexts=this.contexts;this.extending=parser;return new nodes.Literal("")},parseBlock:function(){var block=this.expect("block");var mode=block.mode;var name=block.val.trim();block="indent"==this.peek().type?this.block():new nodes.Block(new nodes.Literal(""));block.mode=mode;block.name=name;this.blocks.push(block);return block},parseInclude:function(){var fs=require("fs");var path=this.resolvePath(this.expect("include").val.trim(),"include");if(".jade"!=path.substr(-5)){var str=fs.readFileSync(path,"utf8").replace(/\r/g,"");var ext=extname(path).slice(1);if(filters.exists(ext))str=filters(ext,str,{filename:path});return new nodes.Literal(str)}var str=fs.readFileSync(path,"utf8");var parser=new Parser(str,path,this.options);parser.blocks=utils.merge([],this.blocks);parser.mixins=this.mixins;this.context(parser);var ast=parser.parse();this.context();ast.filename=path;if("indent"==this.peek().type){ast.includeBlock().push(this.block())}return ast},parseCall:function(){var tok=this.expect("call");var name=tok.val;var args=tok.args;var mixin=new nodes.Mixin(name,args,new nodes.Block,true);this.tag(mixin);if(mixin.block.isEmpty())mixin.block=null;return mixin},parseMixin:function(){var tok=this.expect("mixin");var name=tok.val;var args=tok.args;var mixin;if("indent"==this.peek().type){mixin=new nodes.Mixin(name,args,this.block(),false);this.mixins[name]=mixin;return mixin}else{return new nodes.Mixin(name,args,null,true)}},parseTextBlock:function(){var block=new nodes.Block;block.line=this.line();var spaces=this.expect("indent").val;if(null==this._spaces)this._spaces=spaces;var indent=Array(spaces-this._spaces+1).join(" ");while("outdent"!=this.peek().type){switch(this.peek().type){case"newline":this.advance();break;case"indent":this.parseTextBlock().nodes.forEach(function(node){block.push(node)});break;default:var text=new nodes.Text(indent+this.advance().val);text.line=this.line();block.push(text)}}if(spaces==this._spaces)this._spaces=null;this.expect("outdent");return block},block:function(){var block=new nodes.Block;block.line=this.line();this.expect("indent");while("outdent"!=this.peek().type){if("newline"==this.peek().type){this.advance()}else{block.push(this.parseExpr())}}this.expect("outdent");return block},parseInterpolation:function(){var tok=this.advance();var tag=new nodes.Tag(tok.val);tag.buffer=true;return this.tag(tag)},parseTag:function(){var i=2;if("attrs"==this.lookahead(i).type)++i;var tok=this.advance();var tag=new nodes.Tag(tok.val);tag.selfClosing=tok.selfClosing;return this.tag(tag)},tag:function(tag){var dot;tag.line=this.line();out:while(true){switch(this.peek().type){case"id":case"class":var tok=this.advance();tag.setAttribute(tok.type,"'"+tok.val+"'");continue;case"attrs":var tok=this.advance(),obj=tok.attrs,escaped=tok.escaped,names=Object.keys(obj);if(tok.selfClosing)tag.selfClosing=true;for(var i=0,len=names.length;i<len;++i){var name=names[i],val=obj[name];tag.setAttribute(name,val,escaped[name])}continue;default:break out}}if("."==this.peek().val){dot=tag.textOnly=true;this.advance()}switch(this.peek().type){case"text":tag.block.push(this.parseText());break;case"code":tag.code=this.parseCode();break;case":":this.advance();tag.block=new nodes.Block;tag.block.push(this.parseExpr());break}while("newline"==this.peek().type)this.advance();tag.textOnly=tag.textOnly||~textOnly.indexOf(tag.name);if("script"==tag.name){var type=tag.getAttribute("type");if(!dot&&type&&"text/javascript"!=type.replace(/^['"]|['"]$/g,"")){tag.textOnly=false}}if("indent"==this.peek().type){if(tag.textOnly){this.lexer.pipeless=true;tag.block=this.parseTextBlock();this.lexer.pipeless=false}else{var block=this.block();if(tag.block){for(var i=0,len=block.nodes.length;i<len;++i){tag.block.push(block.nodes[i])}}else{tag.block=block}}}return tag}}},{path:13,fs:1,"./lexer":8,"./utils":5,"./filters":10,"./nodes":11}],11:[function(require,module,exports){exports.Node=require("./node");exports.Tag=require("./tag");exports.Code=require("./code");exports.Each=require("./each");exports.Case=require("./case");exports.Text=require("./text");exports.Block=require("./block");exports.Mixin=require("./mixin");exports.Filter=require("./filter");exports.Comment=require("./comment");exports.Literal=require("./literal");exports.BlockComment=require("./block-comment");exports.Doctype=require("./doctype")},{"./node":14,"./tag":15,"./each":16,"./code":17,"./text":18,"./case":19,"./block":20,"./mixin":21,"./filter":22,"./comment":23,"./literal":24,"./block-comment":25,"./doctype":26}],14:[function(require,module,exports){var Node=module.exports=function Node(){};Node.prototype.clone=function(){return this}},{}],9:[function(require,module,exports){(function(){var nodes=require("./nodes"),filters=require("./filters"),doctypes=require("./doctypes"),selfClosing=require("./self-closing"),runtime=require("./runtime"),utils=require("./utils"),parseJSExpression=require("character-parser").parseMax;var Compiler=module.exports=function Compiler(node,options){this.options=options=options||{};this.node=node;this.hasCompiledDoctype=false;this.hasCompiledTag=false;this.pp=options.pretty||false;this.debug=false!==options.compileDebug;this.indents=0;this.parentIndents=0;if(options.doctype)this.setDoctype(options.doctype)};Compiler.prototype={compile:function(){this.buf=[];if(this.pp)this.buf.push("jade.indent = [];");this.lastBufferedIdx=-1;this.visit(this.node);return this.buf.join("\n")},setDoctype:function(name){name=name||"default";this.doctype=doctypes[name.toLowerCase()]||"<!DOCTYPE "+name+">";this.terse=this.doctype.toLowerCase()=="<!doctype html>";this.xml=0==this.doctype.indexOf("<?xml")},buffer:function(str,interpolate){var self=this;if(interpolate){var match=/(\\)?([#!]){((?:.|\n)*)$/.exec(str);if(match){this.buffer(str.substr(0,match.index),false);if(match[1]){this.buffer(match[2]+"{",false);this.buffer(match[3],true);return}else{try{var rest=match[3];var range=parseJSExpression(rest);var code=("!"==match[2]?"":"jade.escape")+"((jade.interp = "+range.src+") == null ? '' : jade.interp)"}catch(ex){throw ex;this.buffer(match[2]+"{",false);this.buffer(match[3],true);return}this.bufferExpression(code);this.buffer(rest.substr(range.end+1),true);return}}}str=JSON.stringify(str);str=str.substr(1,str.length-2);if(this.lastBufferedIdx==this.buf.length){if(this.lastBufferedType==="code")this.lastBuffered+=' + "';this.lastBufferedType="text";this.lastBuffered+=str;this.buf[this.lastBufferedIdx-1]="buf.push("+this.bufferStartChar+this.lastBuffered+'");'}else{this.buf.push('buf.push("'+str+'");');this.lastBufferedType="text";this.bufferStartChar='"';this.lastBuffered=str;this.lastBufferedIdx=this.buf.length}},bufferExpression:function(src){if(this.lastBufferedIdx==this.buf.length){if(this.lastBufferedType==="text")this.lastBuffered+='"';this.lastBufferedType="code";this.lastBuffered+=" + ("+src+")";this.buf[this.lastBufferedIdx-1]="buf.push("+this.bufferStartChar+this.lastBuffered+");"}else{this.buf.push("buf.push("+src+");");this.lastBufferedType="code";this.bufferStartChar="";this.lastBuffered="("+src+")";this.lastBufferedIdx=this.buf.length}},prettyIndent:function(offset,newline){offset=offset||0;newline=newline?"\n":"";this.buffer(newline+Array(this.indents+offset).join(" "));if(this.parentIndents)this.buf.push("buf.push.apply(buf, jade.indent);")},visit:function(node){var debug=this.debug;if(debug){this.buf.push("jade.debug.unshift({ lineno: "+node.line+", filename: "+(node.filename?JSON.stringify(node.filename):"jade.debug[0].filename")+" });")}if(false===node.debug&&this.debug){this.buf.pop();this.buf.pop()}this.visitNode(node);if(debug)this.buf.push("jade.debug.shift();")},visitNode:function(node){var name=node.constructor.name||node.constructor.toString().match(/function ([^(\s]+)()/)[1];return this["visit"+name](node)},visitCase:function(node){var _=this.withinCase;this.withinCase=true;this.buf.push("switch ("+node.expr+"){");this.visit(node.block);this.buf.push("}");this.withinCase=_},visitWhen:function(node){if("default"==node.expr){this.buf.push("default:")}else{this.buf.push("case "+node.expr+":")}this.visit(node.block);this.buf.push(" break;")},visitLiteral:function(node){this.buffer(node.str)},visitBlock:function(block){var len=block.nodes.length,escape=this.escape,pp=this.pp;if(this.parentIndents&&block.mode){if(pp)this.buf.push("jade.indent.push('"+Array(this.indents+1).join(" ")+"');");this.buf.push("block && block();");if(pp)this.buf.push("jade.indent.pop();");return}if(pp&&len>1&&!escape&&block.nodes[0].isText&&block.nodes[1].isText)this.prettyIndent(1,true);for(var i=0;i<len;++i){if(pp&&i>0&&!escape&&block.nodes[i].isText&&block.nodes[i-1].isText)this.prettyIndent(1,false);this.visit(block.nodes[i]);if(block.nodes[i+1]&&block.nodes[i].isText&&block.nodes[i+1].isText)this.buffer("\n")}},visitDoctype:function(doctype){if(doctype&&(doctype.val||!this.doctype)){this.setDoctype(doctype.val||"default")}if(this.doctype)this.buffer(this.doctype);this.hasCompiledDoctype=true},visitMixin:function(mixin){var name=mixin.name.replace(/-/g,"_")+"_mixin",args=mixin.args||"",block=mixin.block,attrs=mixin.attrs,pp=this.pp;if(mixin.call){if(pp)this.buf.push("jade.indent.push('"+Array(this.indents+1).join(" ")+"');");if(block||attrs.length){this.buf.push(name+".call({");if(block){this.buf.push("block: function(){");this.parentIndents++;var _indents=this.indents;this.indents=0;this.visit(mixin.block);this.indents=_indents;this.parentIndents--;if(attrs.length){this.buf.push("},")}else{this.buf.push("}")}}if(attrs.length){var val=this.attrs(attrs);if(val.inherits){this.buf.push("attributes: jade.merge({"+val.buf+"}, attributes), escaped: jade.merge("+val.escaped+", escaped, true)")}else{this.buf.push("attributes: {"+val.buf+"}, escaped: "+val.escaped)}}if(args){this.buf.push("}, "+args+");")}else{this.buf.push("});")}}else{this.buf.push(name+"("+args+");")}if(pp)this.buf.push("jade.indent.pop();")}else{this.buf.push("var "+name+" = function("+args+"){");this.buf.push("var block = this.block, attributes = this.attributes || {}, escaped = this.escaped || {};");this.parentIndents++;this.visit(block);this.parentIndents--;this.buf.push("};")}},visitTag:function(tag){this.indents++;var name=tag.name,pp=this.pp,self=this;function bufferName(){if(tag.buffer)self.bufferExpression(name);else self.buffer(name)}if(!this.hasCompiledTag){if(!this.hasCompiledDoctype&&"html"==name){this.visitDoctype()}this.hasCompiledTag=true}if(pp&&!tag.isInline())this.prettyIndent(0,true);if((~selfClosing.indexOf(name)||tag.selfClosing)&&!this.xml){this.buffer("<");bufferName();this.visitAttributes(tag.attrs);this.terse?this.buffer(">"):this.buffer("/>")}else{if(tag.attrs.length){this.buffer("<");bufferName();if(tag.attrs.length)this.visitAttributes(tag.attrs);this.buffer(">")}else{this.buffer("<");bufferName();this.buffer(">")}if(tag.code)this.visitCode(tag.code);this.escape="pre"==tag.name;this.visit(tag.block);if(pp&&!tag.isInline()&&"pre"!=tag.name&&!tag.canInline())this.prettyIndent(0,true);this.buffer("</");bufferName();this.buffer(">")}this.indents--},visitFilter:function(filter){var text=filter.block.nodes.map(function(node){return node.val}).join("\n");filter.attrs=filter.attrs||{};filter.attrs.filename=this.options.filename;this.buffer(filters(filter.name,text,filter.attrs),true)},visitText:function(text){this.buffer(text.val,true)},visitComment:function(comment){if(!comment.buffer)return;if(this.pp)this.prettyIndent(1,true);this.buffer("<!--"+comment.val+"-->")},visitBlockComment:function(comment){if(!comment.buffer)return;if(0==comment.val.trim().indexOf("if")){this.buffer("<!--["+comment.val.trim()+"]>");this.visit(comment.block);this.buffer("<![endif]-->")}else{this.buffer("<!--"+comment.val);this.visit(comment.block);this.buffer("-->")}},visitCode:function(code){if(code.buffer){var val=code.val.trimLeft();val="null == (jade.interp = "+val+') ? "" : jade.interp';if(code.escape)val="jade.escape("+val+")";this.bufferExpression(val)}else{this.buf.push(code.val)}if(code.block){if(!code.buffer)this.buf.push("{");this.visit(code.block);if(!code.buffer)this.buf.push("}")}},visitEach:function(each){this.buf.push(""+"// iterate "+each.obj+"\n"+";(function(){\n"+" var $$obj = "+each.obj+";\n"+" if ('number' == typeof $$obj.length) {\n");if(each.alternative){this.buf.push(" if ($$obj.length) {")}this.buf.push(""+" for (var "+each.key+" = 0, $$l = $$obj.length; "+each.key+" < $$l; "+each.key+"++) {\n"+" var "+each.val+" = $$obj["+each.key+"];\n");this.visit(each.block);this.buf.push(" }\n");if(each.alternative){this.buf.push(" } else {");this.visit(each.alternative);this.buf.push(" }")}this.buf.push(""+" } else {\n"+" var $$l = 0;\n"+" for (var "+each.key+" in $$obj) {\n"+" $$l++;"+" var "+each.val+" = $$obj["+each.key+"];\n");this.visit(each.block);this.buf.push(" }\n");if(each.alternative){this.buf.push(" if ($$l === 0) {");this.visit(each.alternative);this.buf.push(" }")}this.buf.push(" }\n}).call(this);\n")},visitAttributes:function(attrs){var val=this.attrs(attrs);if(val.inherits){this.bufferExpression("jade.attrs(jade.merge({ "+val.buf+" }, attributes), jade.merge("+val.escaped+", escaped, true))")}else if(val.constant){eval("var buf={"+val.buf+"};");this.buffer(runtime.attrs(buf,JSON.parse(val.escaped)))}else{this.bufferExpression("jade.attrs({ "+val.buf+" }, "+val.escaped+")")}},attrs:function(attrs){var buf=[],classes=[],escaped={},constant=attrs.every(function(attr){return isConstant(attr.val)}),inherits=false;if(this.terse)buf.push("terse: true");attrs.forEach(function(attr){if(attr.name=="attributes")return inherits=true;escaped[attr.name]=attr.escaped;if(attr.name=="class"){classes.push("("+attr.val+")")}else{var pair="'"+attr.name+"':("+attr.val+")";buf.push(pair)}});if(classes.length){classes=classes.join(" + ' ' + ");buf.push('"class": '+classes)}return{buf:buf.join(", "),escaped:JSON.stringify(escaped),inherits:inherits,constant:constant}}};function isConstant(val){if(/^ *("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|true|false|null|undefined) *$/i.test(val))return true;if(!isNaN(Number(val)))return true;var matches;if(matches=/^ *\[(.*)\] *$/.exec(val))return matches[1].split(",").every(isConstant);return false}})()},{"./doctypes":4,"./self-closing":3,"./runtime":2,"./filters":10,"./utils":5,"./nodes":11,"character-parser":27}],8:[function(require,module,exports){var utils=require("./utils");var parseJSExpression=require("character-parser").parseMax;var Lexer=module.exports=function Lexer(str,options){options=options||{};this.input=str.replace(/\r\n|\r/g,"\n");this.colons=options.colons;this.deferredTokens=[];this.lastIndents=0;this.lineno=1;this.stash=[];this.indentStack=[];this.indentRe=null;this.pipeless=false};Lexer.prototype={tok:function(type,val){return{type:type,line:this.lineno,val:val}},consume:function(len){this.input=this.input.substr(len)},scan:function(regexp,type){var captures;if(captures=regexp.exec(this.input)){this.consume(captures[0].length);return this.tok(type,captures[1])}},defer:function(tok){this.deferredTokens.push(tok)},lookahead:function(n){var fetch=n-this.stash.length;while(fetch-->0)this.stash.push(this.next());return this.stash[--n]},bracketExpression:function(skip){skip=skip||0;var start=this.input[skip];if(start!="("&&start!="{"&&start!="[")throw new Error("unrecognized start character");var end={"(":")","{":"}","[":"]"}[start];var range=parseJSExpression(this.input,{start:skip+1});if(this.input[range.end]!==end)throw new Error("start character "+start+" does not match end character "+this.input[range.end]);return range},stashed:function(){return this.stash.length&&this.stash.shift()},deferred:function(){return this.deferredTokens.length&&this.deferredTokens.shift()},eos:function(){if(this.input.length)return;if(this.indentStack.length){this.indentStack.shift();return this.tok("outdent")}else{return this.tok("eos")}},blank:function(){var captures;if(captures=/^\n *\n/.exec(this.input)){this.consume(captures[0].length-1);++this.lineno;if(this.pipeless)return this.tok("text","");return this.next()}},comment:function(){var captures;if(captures=/^ *\/\/(-)?([^\n]*)/.exec(this.input)){this.consume(captures[0].length);
var tok=this.tok("comment",captures[2]);tok.buffer="-"!=captures[1];return tok}},interpolation:function(){if(/^#\{/.test(this.input)){var match;try{match=this.bracketExpression(1)}catch(ex){return}this.consume(match.end+1);return this.tok("interpolation",match.src)}},tag:function(){var captures;if(captures=/^(\w[-:\w]*)(\/?)/.exec(this.input)){this.consume(captures[0].length);var tok,name=captures[1];if(":"==name[name.length-1]){name=name.slice(0,-1);tok=this.tok("tag",name);this.defer(this.tok(":"));while(" "==this.input[0])this.input=this.input.substr(1)}else{tok=this.tok("tag",name)}tok.selfClosing=!!captures[2];return tok}},filter:function(){return this.scan(/^:(\w+)/,"filter")},doctype:function(){return this.scan(/^(?:!!!|doctype) *([^\n]+)?/,"doctype")},id:function(){return this.scan(/^#([\w-]+)/,"id")},className:function(){return this.scan(/^\.([\w-]+)/,"class")},text:function(){return this.scan(/^(?:\| ?| ?)?([^\n]+)/,"text")},"extends":function(){return this.scan(/^extends? +([^\n]+)/,"extends")},prepend:function(){var captures;if(captures=/^prepend +([^\n]+)/.exec(this.input)){this.consume(captures[0].length);var mode="prepend",name=captures[1],tok=this.tok("block",name);tok.mode=mode;return tok}},append:function(){var captures;if(captures=/^append +([^\n]+)/.exec(this.input)){this.consume(captures[0].length);var mode="append",name=captures[1],tok=this.tok("block",name);tok.mode=mode;return tok}},block:function(){var captures;if(captures=/^block\b *(?:(prepend|append) +)?([^\n]*)/.exec(this.input)){this.consume(captures[0].length);var mode=captures[1]||"replace",name=captures[2],tok=this.tok("block",name);tok.mode=mode;return tok}},yield:function(){return this.scan(/^yield */,"yield")},include:function(){return this.scan(/^include +([^\n]+)/,"include")},"case":function(){return this.scan(/^case +([^\n]+)/,"case")},when:function(){return this.scan(/^when +([^:\n]+)/,"when")},"default":function(){return this.scan(/^default */,"default")},assignment:function(){var captures;if(captures=/^(\w+) += *([^;\n]+)( *;? *)/.exec(this.input)){this.consume(captures[0].length);var name=captures[1],val=captures[2];return this.tok("code","var "+name+" = ("+val+");")}},call:function(){var captures;if(captures=/^\+([-\w]+)/.exec(this.input)){this.consume(captures[0].length);var tok=this.tok("call",captures[1]);if(captures=/^ *\(/.exec(this.input)){try{var range=this.bracketExpression(captures[0].length-1);if(!/^ *[-\w]+ *=/.test(range.src)){this.consume(range.end+1);tok.args=range.src}}catch(ex){}}return tok}},mixin:function(){var captures;if(captures=/^mixin +([-\w]+)(?: *\((.*)\))?/.exec(this.input)){this.consume(captures[0].length);var tok=this.tok("mixin",captures[1]);tok.args=captures[2];return tok}},conditional:function(){var captures;if(captures=/^(if|unless|else if|else)\b([^\n]*)/.exec(this.input)){this.consume(captures[0].length);var type=captures[1],js=captures[2];switch(type){case"if":js="if ("+js+")";break;case"unless":js="if (!("+js+"))";break;case"else if":js="else if ("+js+")";break;case"else":js="else";break}return this.tok("code",js)}},"while":function(){var captures;if(captures=/^while +([^\n]+)/.exec(this.input)){this.consume(captures[0].length);return this.tok("code","while ("+captures[1]+")")}},each:function(){var captures;if(captures=/^(?:- *)?(?:each|for) +(\w+)(?: *, *(\w+))? * in *([^\n]+)/.exec(this.input)){this.consume(captures[0].length);var tok=this.tok("each",captures[1]);tok.key=captures[2]||"$index";tok.code=captures[3];return tok}},code:function(){var captures;if(captures=/^(!?=|-)[ \t]*([^\n]+)/.exec(this.input)){this.consume(captures[0].length);var flags=captures[1];captures[1]=captures[2];var tok=this.tok("code",captures[1]);tok.escape=flags.charAt(0)==="=";tok.buffer=flags.charAt(0)==="="||flags.charAt(1)==="=";return tok}},attrs:function(){if("("==this.input.charAt(0)){var index=this.bracketExpression().end,str=this.input.substr(1,index-1),tok=this.tok("attrs"),len=str.length,colons=this.colons,states=["key"],escapedAttr,key="",val="",quote,c,p;function state(){return states[states.length-1]}function interpolate(attr){return attr.replace(/(\\)?#\{(.+)/g,function(_,escape,expr){if(escape)return _;try{var range=parseJSExpression(expr);if(expr[range.end]!=="}")return _.substr(0,2)+interpolate(_.substr(2));return quote+" + ("+range.src+") + "+quote+interpolate(expr.substr(range.end+1))}catch(ex){return _.substr(0,2)+interpolate(_.substr(2))}})}this.consume(index+1);tok.attrs={};tok.escaped={};function parse(c){var real=c;if(colons&&":"==c)c="=";switch(c){case",":case"\n":switch(state()){case"expr":case"array":case"string":case"object":val+=c;break;default:states.push("key");val=val.trim();key=key.trim();if(""==key)return;key=key.replace(/^['"]|['"]$/g,"").replace("!","");tok.escaped[key]=escapedAttr;tok.attrs[key]=""==val?true:interpolate(val);key=val=""}break;case"=":switch(state()){case"key char":key+=real;break;case"val":case"expr":case"array":case"string":case"object":val+=real;break;default:escapedAttr="!"!=p;states.push("val")}break;case"(":if("val"==state()||"expr"==state())states.push("expr");val+=c;break;case")":if("expr"==state()||"val"==state())states.pop();val+=c;break;case"{":if("val"==state())states.push("object");val+=c;break;case"}":if("object"==state())states.pop();val+=c;break;case"[":if("val"==state())states.push("array");val+=c;break;case"]":if("array"==state())states.pop();val+=c;break;case'"':case"'":switch(state()){case"key":states.push("key char");break;case"key char":states.pop();break;case"string":if(c==quote)states.pop();val+=c;break;default:states.push("string");val+=c;quote=c}break;case"":break;default:switch(state()){case"key":case"key char":key+=c;break;default:val+=c}}p=c}for(var i=0;i<len;++i){parse(str.charAt(i))}parse(",");if("/"==this.input.charAt(0)){this.consume(1);tok.selfClosing=true}return tok}},indent:function(){var captures,re;if(this.indentRe){captures=this.indentRe.exec(this.input)}else{re=/^\n(\t*) */;captures=re.exec(this.input);if(captures&&!captures[1].length){re=/^\n( *)/;captures=re.exec(this.input)}if(captures&&captures[1].length)this.indentRe=re}if(captures){var tok,indents=captures[1].length;++this.lineno;this.consume(indents+1);if(" "==this.input[0]||" "==this.input[0]){throw new Error("Invalid indentation, you can use tabs or spaces but not both")}if("\n"==this.input[0])return this.tok("newline");if(this.indentStack.length&&indents<this.indentStack[0]){while(this.indentStack.length&&this.indentStack[0]>indents){this.stash.push(this.tok("outdent"));this.indentStack.shift()}tok=this.stash.pop()}else if(indents&&indents!=this.indentStack[0]){this.indentStack.unshift(indents);tok=this.tok("indent",indents)}else{tok=this.tok("newline")}return tok}},pipelessText:function(){if(this.pipeless){if("\n"==this.input[0])return;var i=this.input.indexOf("\n");if(-1==i)i=this.input.length;var str=this.input.substr(0,i);this.consume(str.length);return this.tok("text",str)}},colon:function(){return this.scan(/^: */,":")},advance:function(){return this.stashed()||this.next()},next:function(){return this.deferred()||this.blank()||this.eos()||this.pipelessText()||this.yield()||this.doctype()||this.interpolation()||this["case"]()||this.when()||this["default"]()||this["extends"]()||this.append()||this.prepend()||this.block()||this.include()||this.mixin()||this.call()||this.conditional()||this.each()||this["while"]()||this.assignment()||this.tag()||this.filter()||this.code()||this.id()||this.className()||this.attrs()||this.indent()||this.comment()||this.colon()||this.text()}}},{"./utils":5,"character-parser":27}],27:[function(require,module,exports){exports=module.exports=parse;exports.parse=parse;function parse(src,state,options){options=options||{};state=state||exports.defaultState();var start=options.start||0;var end=options.end||src.length;var index=start;while(index<end){if(state.roundDepth<0||state.curlyDepth<0||state.squareDepth<0){throw new SyntaxError("Mismatched Bracket: "+src[index-1])}exports.parseChar(src[index++],state)}return state}exports.parseMax=parseMax;function parseMax(src,options){options=options||{};var start=options.start||0;var index=start;var state=exports.defaultState();while(state.roundDepth>=0&&state.curlyDepth>=0&&state.squareDepth>=0){if(index>=src.length){throw new Error("The end of the string was reached with no closing bracket found.")}exports.parseChar(src[index++],state)}var end=index-1;return{start:start,end:end,src:src.substring(start,end)}}exports.parseUntil=parseUntil;function parseUntil(src,delimiter,options){options=options||{};var includeLineComment=options.includeLineComment||false;var start=options.start||0;var index=start;var state=exports.defaultState();while(state.singleQuote||state.doubleQuote||state.regexp||state.blockComment||!includeLineComment&&state.lineComment||!startsWith(src,delimiter,index)){exports.parseChar(src[index++],state)}var end=index;return{start:start,end:end,src:src.substring(start,end)}}exports.parseChar=parseChar;function parseChar(character,state){if(character.length!==1)throw new Error("Character must be a string of length 1");state=state||defaultState();var wasComment=state.blockComment||state.lineComment;var lastChar=state.history?state.history[0]:"";if(state.lineComment){if(character==="\n"){state.lineComment=false}}else if(state.blockComment){if(state.lastChar==="*"&&character==="/"){state.blockComment=false}}else if(state.singleQuote){if(character==="'"&&!state.escaped){state.singleQuote=false}else if(character==="\\"&&!state.escaped){state.escaped=true}else{state.escaped=false}}else if(state.doubleQuote){if(character==='"'&&!state.escaped){state.doubleQuote=false}else if(character==="\\"&&!state.escaped){state.escaped=true}else{state.escaped=false}}else if(state.regexp){if(character==="/"&&!state.escaped){state.regexp=false}else if(character==="\\"&&!state.escaped){state.escaped=true}else{state.escaped=false}}else if(lastChar==="/"&&character==="/"){history=history.substr(1);state.lineComment=true}else if(lastChar==="/"&&character==="*"){history=history.substr(1);state.blockComment=true}else if(character==="/"){var history=state.history.replace(/^\s*/,"");if(history[0]===")"){}else if(history[0]==="}"){}else if(isPunctuator(history[0])){state.regexp=true}else if(/^\w+\b/.test(history)&&isKeyword(/^\w+\b/.exec(history)[0])){state.regexp=true}else{}}else if(character==="'"){state.singleQuote=true}else if(character==='"'){state.doubleQuote=true}else if(character==="("){state.roundDepth++}else if(character===")"){state.roundDepth--}else if(character==="{"){state.curlyDepth++}else if(character==="}"){state.curlyDepth--}else if(character==="["){state.squareDepth++}else if(character==="]"){state.squareDepth--}if(!state.blockComment&&!state.lineComment&&!wasComment)state.history=character+state.history;return state}exports.defaultState=defaultState;function defaultState(){return{lineComment:false,blockComment:false,singleQuote:false,doubleQuote:false,regexp:false,escaped:false,roundDepth:0,curlyDepth:0,squareDepth:0,history:""}}function startsWith(str,start,i){return str.substr(i||0,start.length)===start}function isPunctuator(c){var code=c.charCodeAt(0);switch(code){case 46:case 40:case 41:case 59:case 44:case 123:case 125:case 91:case 93:case 58:case 63:case 126:case 37:case 38:case 42:case 43:case 45:case 47:case 60:case 62:case 94:case 124:case 33:case 61:return true;default:return false}}function isKeyword(id){return id==="if"||id==="in"||id==="do"||id==="var"||id==="for"||id==="new"||id==="try"||id==="let"||id==="this"||id==="else"||id==="case"||id==="void"||id==="with"||id==="enum"||id==="while"||id==="break"||id==="catch"||id==="throw"||id==="const"||id==="yield"||id==="class"||id==="super"||id==="return"||id==="typeof"||id==="delete"||id==="switch"||id==="export"||id==="import"||id==="default"||id==="finally"||id==="extends"||id==="function"||id==="continue"||id==="debugger"||id==="package"||id==="private"||id==="interface"||id==="instanceof"||id==="implements"||id==="protected"||id==="public"||id==="static"||id==="yield"||id==="let"}},{}],15:[function(require,module,exports){var Attrs=require("./attrs"),Block=require("./block"),inlineTags=require("../inline-tags");var Tag=module.exports=function Tag(name,block){this.name=name;this.attrs=[];this.block=block||new Block};Tag.prototype.__proto__=Attrs.prototype;Tag.prototype.clone=function(){var clone=new Tag(this.name,this.block.clone());clone.line=this.line;clone.attrs=this.attrs;clone.textOnly=this.textOnly;return clone};Tag.prototype.isInline=function(){return~inlineTags.indexOf(this.name)};Tag.prototype.canInline=function(){var nodes=this.block.nodes;function isInline(node){if(node.isBlock)return node.nodes.every(isInline);return node.isText||node.isInline&&node.isInline()}if(!nodes.length)return true;if(1==nodes.length)return isInline(nodes[0]);if(this.block.nodes.every(isInline)){for(var i=1,len=nodes.length;i<len;++i){if(nodes[i-1].isText&&nodes[i].isText)return false}return true}return false}},{"./block":20,"./attrs":28,"../inline-tags":29}],18:[function(require,module,exports){var Node=require("./node");var Text=module.exports=function Text(line){this.val="";if("string"==typeof line)this.val=line};Text.prototype.__proto__=Node.prototype;Text.prototype.isText=true},{"./node":14}],16:[function(require,module,exports){var Node=require("./node");var Each=module.exports=function Each(obj,val,key,block){this.obj=obj;this.val=val;this.key=key;this.block=block};Each.prototype.__proto__=Node.prototype},{"./node":14}],19:[function(require,module,exports){var Node=require("./node");var Case=exports=module.exports=function Case(expr,block){this.expr=expr;this.block=block};Case.prototype.__proto__=Node.prototype;var When=exports.When=function When(expr,block){this.expr=expr;this.block=block;this.debug=false};When.prototype.__proto__=Node.prototype},{"./node":14}],22:[function(require,module,exports){var Node=require("./node"),Block=require("./block");var Filter=module.exports=function Filter(name,block,attrs){this.name=name;this.block=block;this.attrs=attrs};Filter.prototype.__proto__=Node.prototype},{"./block":20,"./node":14}],20:[function(require,module,exports){var Node=require("./node");var Block=module.exports=function Block(node){this.nodes=[];if(node)this.push(node)};Block.prototype.__proto__=Node.prototype;Block.prototype.isBlock=true;Block.prototype.replace=function(other){other.nodes=this.nodes};Block.prototype.push=function(node){return this.nodes.push(node)};Block.prototype.isEmpty=function(){return 0==this.nodes.length};Block.prototype.unshift=function(node){return this.nodes.unshift(node)};Block.prototype.includeBlock=function(){var ret=this,node;for(var i=0,len=this.nodes.length;i<len;++i){node=this.nodes[i];if(node.yield)return node;else if(node.textOnly)continue;else if(node.includeBlock)ret=node.includeBlock();else if(node.block&&!node.block.isEmpty())ret=node.block.includeBlock();if(ret.yield)return ret}return ret};Block.prototype.clone=function(){var clone=new Block;for(var i=0,len=this.nodes.length;i<len;++i){clone.push(this.nodes[i].clone())}return clone}},{"./node":14}],17:[function(require,module,exports){var Node=require("./node");var Code=module.exports=function Code(val,buffer,escape){this.val=val;this.buffer=buffer;this.escape=escape;if(val.match(/^ *else/))this.debug=false};Code.prototype.__proto__=Node.prototype},{"./node":14}],21:[function(require,module,exports){var Attrs=require("./attrs");var Mixin=module.exports=function Mixin(name,args,block,call){this.name=name;this.args=args;this.block=block;this.attrs=[];this.call=call};Mixin.prototype.__proto__=Attrs.prototype},{"./attrs":28}],23:[function(require,module,exports){var Node=require("./node");var Comment=module.exports=function Comment(val,buffer){this.val=val;this.buffer=buffer};Comment.prototype.__proto__=Node.prototype},{"./node":14}],26:[function(require,module,exports){var Node=require("./node");var Doctype=module.exports=function Doctype(val){this.val=val};Doctype.prototype.__proto__=Node.prototype},{"./node":14}],24:[function(require,module,exports){var Node=require("./node");var Literal=module.exports=function Literal(str){this.str=str};Literal.prototype.__proto__=Node.prototype},{"./node":14}],25:[function(require,module,exports){var Node=require("./node");var BlockComment=module.exports=function BlockComment(val,block,buffer){this.block=block;this.val=val;this.buffer=buffer};BlockComment.prototype.__proto__=Node.prototype},{"./node":14}],29:[function(require,module,exports){module.exports=["a","abbr","acronym","b","br","code","em","font","i","img","ins","kbd","map","samp","small","span","strong","sub","sup"]},{}],28:[function(require,module,exports){var Node=require("./node"),Block=require("./block");var Attrs=module.exports=function Attrs(){this.attrs=[]};Attrs.prototype.__proto__=Node.prototype;Attrs.prototype.setAttribute=function(name,val,escaped){this.attrs.push({name:name,val:val,escaped:escaped});return this};Attrs.prototype.removeAttribute=function(name){for(var i=0,len=this.attrs.length;i<len;++i){if(this.attrs[i]&&this.attrs[i].name==name){delete this.attrs[i]}}};Attrs.prototype.getAttribute=function(name){for(var i=0,len=this.attrs.length;i<len;++i){if(this.attrs[i]&&this.attrs[i].name==name){return this.attrs[i].val}}}},{"./node":14,"./block":20}]},{},[6])(6)});