3 lines
86 KiB
JavaScript
3 lines
86 KiB
JavaScript
/*! Browser bundle of nunjucks 3.2.0 */
|
||
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.nunjucks=n():t.nunjucks=n()}("undefined"!=typeof self?self:this,function(){return function(t){var n={};function i(r){if(n[r])return n[r].exports;var e=n[r]={i:r,l:!1,exports:{}};return t[r].call(e.exports,e,e.exports,i),e.l=!0,e.exports}return i.m=t,i.c=n,i.d=function(t,n,r){i.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},i.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(n,"a",n),n},i.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},i.p="",i(i.s=11)}([function(t,n,i){"use strict";var r=Array.prototype,e=Object.prototype,s={"&":"&",'"':""","'":"'","<":"<",">":">"},o=/[&"'<>]/g;function u(t,n){return e.hasOwnProperty.call(t,n)}function h(t){return s[t]}function f(t,n,i){var r,e,s;if(t instanceof Error&&(t=(e=t).name+": "+e.message),Object.setPrototypeOf?Object.setPrototypeOf(r=Error(t),f.prototype):Object.defineProperty(r=this,"message",{enumerable:!1,writable:!0,value:t}),Object.defineProperty(r,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(r,this.constructor),e){var o=Object.getOwnPropertyDescriptor(e,"stack");(s=o&&(o.get||function(){return o.value}))||(s=function(){return e.stack})}else{var u=Error(t).stack;s=function(){return u}}return Object.defineProperty(r,"stack",{get:function(){return s.call(r)}}),Object.defineProperty(r,"cause",{value:e}),r.lineno=n,r.colno=i,r.firstUpdate=!0,r.Update=function(t){var n="("+(t||"unknown path")+")";return this.firstUpdate&&(this.lineno&&this.colno?n+=" [Line "+this.lineno+", Column "+this.colno+"]":this.lineno&&(n+=" [Line "+this.lineno+"]")),n+="\n ",this.firstUpdate&&(n+=" "),this.message=n+(this.message||""),this.firstUpdate=!1,this},r}function c(t){return"[object Function]"===e.toString.call(t)}function a(t){return"[object Array]"===e.toString.call(t)}function l(t){return"[object String]"===e.toString.call(t)}function v(t){return"[object Object]"===e.toString.call(t)}function p(t){return Array.prototype.slice.call(t)}function d(t,n,i){return Array.prototype.indexOf.call(t||[],n,i)}function m(t){var n=[];for(var i in t)u(t,i)&&n.push(i);return n}(n=t.exports={}).hasOwnProp=u,n.t=function(t,i,r){if(r.Update||(r=new n.TemplateError(r)),r.Update(t),!i){var e=r;(r=Error(e.message)).name=e.name}return r},Object.setPrototypeOf?Object.setPrototypeOf(f.prototype,Error.prototype):f.prototype=Object.create(Error.prototype,{constructor:{value:f}}),n.TemplateError=f,n.escape=function(t){return t.replace(o,h)},n.isFunction=c,n.isArray=a,n.isString=l,n.isObject=v,n.groupBy=function(t,n){for(var i={},r=c(n)?n:function(t){return t[n]},e=0;e<t.length;e++){var s=t[e],o=r(s,e);(i[o]||(i[o]=[])).push(s)}return i},n.toArray=p,n.without=function(t){var n=[];if(!t)return n;for(var i=t.length,r=p(arguments).slice(1),e=-1;++e<i;)-1===d(r,t[e])&&n.push(t[e]);return n},n.repeat=function(t,n){for(var i="",r=0;r<n;r++)i+=t;return i},n.each=function(t,n,i){if(null!=t)if(r.forEach&&t.forEach===r.forEach)t.forEach(n,i);else if(t.length===+t.length)for(var e=0,s=t.length;e<s;e++)n.call(i,t[e],e,t)},n.map=function(t,n){var i=[];if(null==t)return i;if(r.map&&t.map===r.map)return t.map(n);for(var e=0;e<t.length;e++)i[i.length]=n(t[e],e);return t.length===+t.length&&(i.length=t.length),i},n.asyncIter=function(t,n,i){var r=-1;!function e(){++r<t.length?n(t[r],r,e,i):i()}()},n.asyncFor=function(t,n,i){var r=m(t||{}),e=r.length,s=-1;!function o(){var u=r[++s];s<e?n(u,t[u],s,e,o):i()}()},n.indexOf=d,n.keys=m,n.r=function(t){return m(t).map(function(n){return[n,t[n]]})},n.u=function(t){return m(t).map(function(n){return t[n]})},n.h=n.extend=function(t,n){return t=t||{},m(n).forEach(function(i){t[i]=n[i]}),t},n.inOperator=function(t,n){if(a(n)||l(n))return-1!==n.indexOf(t);if(v(n))return t in n;throw Error('Cannot use "in" operator to search for "'+t+'" in unexpected types.')}},function(t,n,i){"use strict";function r(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function e(t,n,i){return n&&r(t.prototype,n),i&&r(t,i),t}function s(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}var o=i(16),u=i(0);function h(t,n,i){i=i||{},u.keys(i).forEach(function(n){var r,e;i[n]=(r=t.prototype[n],e=i[n],"function"!=typeof r||"function"!=typeof e?e:function(){var t=this.parent;this.parent=r;var n=e.apply(this,arguments);return this.parent=t,n})});var r=function(t){function i(){return t.apply(this,arguments)||this}return s(i,t),e(i,[{key:"typename",get:function(){return n}}]),i}(t);return u.h(r.prototype,i),r}var f=function(){function t(){this.init.apply(this,arguments)}return t.prototype.init=function(){},t.extend=function(t,n){return"object"==typeof t&&(n=t,t="anonymous"),h(this,t,n)},e(t,[{key:"typename",get:function(){return this.constructor.name}}]),t}(),c=function(t){function n(){var n,i;return(n=i=t.call(this)||this).init.apply(n,arguments),i}return s(n,t),n.prototype.init=function(){},n.extend=function(t,n){return"object"==typeof t&&(n=t,t="anonymous"),h(this,t,n)},e(n,[{key:"typename",get:function(){return this.constructor.name}}]),n}(o);t.exports={Obj:f,EmitterObj:c}},function(t,n,i){"use strict";var r=i(0),e=Array.from,s="function"==typeof Symbol&&Symbol.iterator&&"function"==typeof e,o=function(){function t(t,n){this.variables={},this.parent=t,this.topLevel=!1,this.isolateWrites=n}var n=t.prototype;return n.set=function(t,n,i){var r=t.split("."),e=this.variables,s=this;if(i&&(s=this.resolve(r[0],!0)))s.set(t,n);else{for(var o=0;o<r.length-1;o++){var u=r[o];e[u]||(e[u]={}),e=e[u]}e[r[r.length-1]]=n}},n.get=function(t){var n=this.variables[t];return void 0!==n?n:null},n.lookup=function(t){var n=this.parent,i=this.variables[t];return void 0!==i?i:n&&n.lookup(t)},n.resolve=function(t,n){var i=n&&this.isolateWrites?void 0:this.parent;return void 0!==this.variables[t]?this:i&&i.resolve(t)},n.push=function(n){return new t(this,n)},n.pop=function(){return this.parent},t}();function u(t){return t&&Object.prototype.hasOwnProperty.call(t,"__keywords")}function h(t){var n=t.length;return 0===n?0:u(t[n-1])?n-1:n}function f(t){if("string"!=typeof t)return t;this.val=t,this.length=t.length}f.prototype=Object.create(String.prototype,{length:{writable:!0,configurable:!0,value:0}}),f.prototype.valueOf=function(){return this.val},f.prototype.toString=function(){return this.val},t.exports={Frame:o,makeMacro:function(t,n,i){var r=this;return function(){for(var e=arguments.length,s=Array(e),o=0;o<e;o++)s[o]=arguments[o];var f,c=h(s),a=function(t){var n=t.length;if(n){var i=t[n-1];if(u(i))return i}return{}}(s);if(c>t.length)f=s.slice(0,t.length),s.slice(f.length,c).forEach(function(t,i){i<n.length&&(a[n[i]]=t)}),f.push(a);else if(c<t.length){f=s.slice(0,c);for(var l=c;l<t.length;l++){var v=t[l];f.push(a[v]),delete a[v]}f.push(a)}else f=s;return i.apply(r,f)}},makeKeywordArgs:function(t){return t.__keywords=!0,t},numArgs:h,suppressValue:function(t,n){return t=void 0!==t&&null!==t?t:"",!n||t instanceof f||(t=r.escape(t.toString())),t},ensureDefined:function(t,n,i){if(null===t||void 0===t)throw new r.TemplateError("attempted to output null or undefined value",n+1,i+1);return t},memberLookup:function(t,n){if(void 0!==t&&null!==t)return"function"==typeof t[n]?function(){for(var i=arguments.length,r=Array(i),e=0;e<i;e++)r[e]=arguments[e];return t[n].apply(t,r)}:t[n]},contextOrFrameLookup:function(t,n,i){var r=n.lookup(i);return void 0!==r?r:t.lookup(i)},callWrap:function(t,n,i,r){if(!t)throw Error("Unable to call `"+n+"`, which is undefined or falsey");if("function"!=typeof t)throw Error("Unable to call `"+n+"`, which is not a function");return t.apply(i,r)},handleError:function(t,n,i){return t.lineno?t:new r.TemplateError(t,n,i)},isArray:r.isArray,keys:r.keys,SafeString:f,copySafeness:function(t,n){return t instanceof f?new f(n):n.toString()},markSafe:function(t){var n=typeof t;return"string"===n?new f(t):"function"!==n?t:function(n){var i=t.apply(this,arguments);return"string"==typeof i?new f(i):i}},asyncEach:function(t,n,i,e){if(r.isArray(t)){var s=t.length;r.asyncIter(t,function(t,r,e){switch(n){case 1:i(t,r,s,e);break;case 2:i(t[0],t[1],r,s,e);break;case 3:i(t[0],t[1],t[2],r,s,e);break;default:t.push(r,s,e),i.apply(this,t)}},e)}else r.asyncFor(t,function(t,n,r,e,s){i(t,n,r,e,s)},e)},asyncAll:function(t,n,i,e){var s,o,u=0;function h(t,n){u++,o[t]=n,u===s&&e(null,o.join(""))}if(r.isArray(t))if(s=t.length,o=Array(s),0===s)e(null,"");else for(var f=0;f<t.length;f++){var c=t[f];switch(n){case 1:i(c,f,s,h);break;case 2:i(c[0],c[1],f,s,h);break;case 3:i(c[0],c[1],c[2],f,s,h);break;default:c.push(f,s,h),i.apply(this,c)}}else{var a=r.keys(t||{});if(s=a.length,o=Array(s),0===s)e(null,"");else for(var l=0;l<a.length;l++){var v=a[l];i(v,t[v],l,s,h)}}},inOperator:r.inOperator,fromIterator:function(t){return"object"!=typeof t||null===t||r.isArray(t)?t:s&&Symbol.iterator in t?e(t):t}}},function(t,n,i){"use strict";function r(t,n){for(var i=0;i<n.length;i++){var r=n[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function e(t,n,i){return n&&r(t.prototype,n),i&&r(t,i),t}function s(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}function o(t,n,i){t instanceof n&&i.push(t),t instanceof u&&t.findAll(n,i)}var u=function(t){function n(){return t.apply(this,arguments)||this}s(n,t);var i=n.prototype;return i.init=function(t,n){for(var i=this,r=arguments,e=arguments.length,s=Array(e>2?e-2:0),o=2;o<e;o++)s[o-2]=arguments[o];this.lineno=t,this.colno=n,this.fields.forEach(function(t,n){var e=r[n+2];void 0===e&&(e=null),i[t]=e})},i.findAll=function(t,n){var i=this;return n=n||[],this instanceof f?this.children.forEach(function(i){return o(i,t,n)}):this.fields.forEach(function(r){return o(i[r],t,n)}),n},i.iterFields=function(t){var n=this;this.fields.forEach(function(i){t(n[i],i)})},n}(i(1).Obj),h=function(t){function n(){return t.apply(this,arguments)||this}return s(n,t),e(n,[{key:"typename",get:function(){return"Value"}},{key:"fields",get:function(){return["value"]}}]),n}(u),f=function(t){function n(){return t.apply(this,arguments)||this}s(n,t);var i=n.prototype;return i.init=function(n,i,r){t.prototype.init.call(this,n,i,r||[])},i.addChild=function(t){this.children.push(t)},e(n,[{key:"typename",get:function(){return"NodeList"}},{key:"fields",get:function(){return["children"]}}]),n}(u),c=f.extend("Root"),a=h.extend("Literal"),l=h.extend("Symbol"),v=f.extend("Group"),p=f.extend("Array"),d=u.extend("Pair",{fields:["key","value"]}),m=f.extend("Dict"),w=u.extend("LookupVal",{fields:["target","val"]}),b=u.extend("If",{fields:["cond","body","else_"]}),y=b.extend("IfAsync"),g=u.extend("InlineIf",{fields:["cond","body","else_"]}),k=u.extend("For",{fields:["arr","name","body","else_"]}),E=k.extend("AsyncEach"),x=k.extend("AsyncAll"),O=u.extend("Macro",{fields:["name","args","body"]}),T=O.extend("Caller"),A=u.extend("Import",{fields:["template","target","withContext"]}),j=function(t){function n(){return t.apply(this,arguments)||this}return s(n,t),n.prototype.init=function(n,i,r,e,s){t.prototype.init.call(this,n,i,r,e||new f,s)},e(n,[{key:"typename",get:function(){return"FromImport"}},{key:"fields",get:function(){return["template","names","withContext"]}}]),n}(u),_=u.extend("FunCall",{fields:["name","args"]}),N=_.extend("Filter"),S=N.extend("FilterAsync",{fields:["name","args","symbol"]}),L=m.extend("KeywordArgs"),F=u.extend("Block",{fields:["name","body"]}),I=u.extend("Super",{fields:["blockName","symbol"]}),C=u.extend("TemplateRef",{fields:["template"]}).extend("Extends"),R=u.extend("Include",{fields:["template","ignoreMissing"]}),K=u.extend("Set",{fields:["targets","value"]}),M=u.extend("Switch",{fields:["expr","cases","default"]}),P=u.extend("Case",{fields:["cond","body"]}),B=f.extend("Output"),V=u.extend("Capture",{fields:["body"]}),D=a.extend("TemplateData"),U=u.extend("UnaryOp",{fields:["target"]}),$=u.extend("BinOp",{fields:["left","right"]}),G=$.extend("In"),W=$.extend("Is"),H=$.extend("Or"),J=$.extend("And"),z=U.extend("Not"),Y=$.extend("Add"),q=$.extend("Concat"),X=$.extend("Sub"),Q=$.extend("Mul"),Z=$.extend("Div"),tt=$.extend("FloorDiv"),nt=$.extend("Mod"),it=$.extend("Pow"),rt=U.extend("Neg"),et=U.extend("Pos"),st=u.extend("Compare",{fields:["expr","ops"]}),ot=u.extend("CompareOperand",{fields:["expr","type"]}),ut=u.extend("CallExtension",{init:function(t,n,i,r){this.parent(),this.extName=t.__name||t,this.prop=n,this.args=i||new f,this.contentArgs=r||[],this.autoescape=t.autoescape},fields:["extName","prop","args","contentArgs"]}),ht=ut.extend("CallExtensionAsync");function ft(t,n,i){var r=t.split("\n");r.forEach(function(t,e){t&&(i&&e>0||!i)&&process.stdout.write(" ".repeat(n));var s=e===r.length-1?"":"\n";process.stdout.write(""+t+s)})}t.exports={Node:u,Root:c,NodeList:f,Value:h,Literal:a,Symbol:l,Group:v,Array:p,Pair:d,Dict:m,Output:B,Capture:V,TemplateData:D,If:b,IfAsync:y,InlineIf:g,For:k,AsyncEach:E,AsyncAll:x,Macro:O,Caller:T,Import:A,FromImport:j,FunCall:_,Filter:N,FilterAsync:S,KeywordArgs:L,Block:F,Super:I,Extends:C,Include:R,Set:K,Switch:M,Case:P,LookupVal:w,BinOp:$,In:G,Is:W,Or:H,And:J,Not:z,Add:Y,Concat:q,Sub:X,Mul:Q,Div:Z,FloorDiv:tt,Mod:nt,Pow:it,Neg:rt,Pos:et,Compare:st,CompareOperand:ot,CallExtension:ut,CallExtensionAsync:ht,printNodes:function t(n,i){if(i=i||0,ft(n.typename+": ",i),n instanceof f)ft("\n"),n.children.forEach(function(n){t(n,i+2)});else if(n instanceof ut)ft(n.extName+"."+n.prop+"\n"),n.args&&t(n.args,i+2),n.contentArgs&&n.contentArgs.forEach(function(n){t(n,i+2)});else{var r=[],e=null;n.iterFields(function(t,n){t instanceof u?r.push([n,t]):(e=e||{})[n]=t}),e?ft(JSON.stringify(e,null,2)+"\n",null,!0):ft("\n"),r.forEach(function(n){var r=n[0],e=n[1];ft("["+r+"] =>",i+2),t(e,i+4)})}}}},function(t,n){},function(t,n,i){"use strict";var r=i(8),e=i(17),s=i(3),o=i(0).TemplateError,u=i(2).Frame,h={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},f=function(t){var n,i;function r(){return t.apply(this,arguments)||this}i=t,(n=r).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i;var e=r.prototype;return e.init=function(t,n){this.templateName=t,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this.f="",this.inBlock=!1,this.throwOnUndefined=n},e.fail=function(t,n,i){throw void 0!==n&&(n+=1),void 0!==i&&(i+=1),new o(t,n,i)},e.a=function(){var t=this.v();return this.bufferStack.push(this.buffer),this.buffer=t,this.w("var "+this.buffer+' = "";'),t},e.b=function(){this.buffer=this.bufferStack.pop()},e.w=function(t){this.codebuf.push(t)},e.y=function(t){this.w(t+"\n")},e.g=function(){for(var t=this,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];i.forEach(function(n){return t.y(n)})},e.k=function(t,n){this.buffer="output",this.f="",this.y("function "+n+"(env, context, frame, runtime, cb) {"),this.y("var lineno = "+t.lineno+";"),this.y("var colno = "+t.colno+";"),this.y("var "+this.buffer+' = "";'),this.y("try {")},e.x=function(t){t||this.y("cb(null, "+this.buffer+");"),this.O(),this.y("} catch (e) {"),this.y(" cb(runtime.handleError(e, lineno, colno));"),this.y("}"),this.y("}"),this.buffer=null},e.T=function(){this.f+="})"},e.O=function(){this.y(this.f+";"),this.f=""},e.A=function(t){var n=this.f;this.f="",t.call(this),this.O(),this.f=n},e.j=function(t){var n=this.v();return"function("+n+(t?","+t:"")+") {\nif("+n+") { cb("+n+"); return; }"},e.v=function(){return this.lastId++,"t_"+this.lastId},e._=function(){return null==this.templateName?"undefined":JSON.stringify(this.templateName)},e.N=function(t,n){var i=this;t.children.forEach(function(t){i.compile(t,n)})},e.S=function(t,n,i,r){var e=this;i&&this.w(i),t.children.forEach(function(t,i){i>0&&e.w(","),e.compile(t,n)}),r&&this.w(r)},e.L=function(t,n){this.assertType(t,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(t,n)},e.assertType=function(t){for(var n=arguments.length,i=Array(n>1?n-1:0),r=1;r<n;r++)i[r-1]=arguments[r];i.some(function(n){return t instanceof n})||this.fail("assertType: invalid type: "+t.typename,t.lineno,t.colno)},e.compileCallExtension=function(t,n,i){var r=this,e=t.args,o=t.contentArgs,u="boolean"!=typeof t.autoescape||t.autoescape;if(i||this.w(this.buffer+" += runtime.suppressValue("),this.w('env.getExtension("'+t.extName+'")["'+t.prop+'"]('),this.w("context"),(e||o)&&this.w(","),e&&(e instanceof s.NodeList||this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"),e.children.forEach(function(t,i){r.L(t,n),(i!==e.children.length-1||o.length)&&r.w(",")})),o.length&&o.forEach(function(t,i){if(i>0&&r.w(","),t){r.y("function(cb) {"),r.y("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var e=r.a();r.A(function(){r.compile(t,n),r.y("cb(null, "+e+");")}),r.b(),r.y("return "+e+";"),r.y("}")}else r.w("null")}),i){var h=this.v();this.y(", "+this.j(h)),this.y(this.buffer+" += runtime.suppressValue("+h+", "+u+" && env.opts.autoescape);"),this.T()}else this.w(")"),this.w(", "+u+" && env.opts.autoescape);\n")},e.compileCallExtensionAsync=function(t,n){this.compileCallExtension(t,n,!0)},e.compileNodeList=function(t,n){this.N(t,n)},e.compileLiteral=function(t){if("string"==typeof t.value){var n=t.value.replace(/\\/g,"\\\\");n=(n=(n=(n=(n=n.replace(/"/g,'\\"')).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/\t/g,"\\t")).replace(/\u2028/g,"\\u2028"),this.w('"'+n+'"')}else null===t.value?this.w("null"):this.w(t.value.toString())},e.compileSymbol=function(t,n){var i=t.value,r=n.lookup(i);r?this.w(r):this.w('runtime.contextOrFrameLookup(context, frame, "'+i+'")')},e.compileGroup=function(t,n){this.S(t,n,"(",")")},e.compileArray=function(t,n){this.S(t,n,"[","]")},e.compileDict=function(t,n){this.S(t,n,"{","}")},e.compilePair=function(t,n){var i=t.key,r=t.value;i instanceof s.Symbol?i=new s.Literal(i.lineno,i.colno,i.value):i instanceof s.Literal&&"string"==typeof i.value||this.fail("compilePair: Dict keys must be strings or names",i.lineno,i.colno),this.compile(i,n),this.w(": "),this.L(r,n)},e.compileInlineIf=function(t,n){this.w("("),this.compile(t.cond,n),this.w("?"),this.compile(t.body,n),this.w(":"),null!==t.else_?this.compile(t.else_,n):this.w('""'),this.w(")")},e.compileIn=function(t,n){this.w("runtime.inOperator("),this.compile(t.left,n),this.w(","),this.compile(t.right,n),this.w(")")},e.compileIs=function(t,n){var i=t.right.name?t.right.name.value:t.right.value;this.w('env.getTest("'+i+'").call(context, '),this.compile(t.left,n),t.right.args&&(this.w(","),this.compile(t.right.args,n)),this.w(") === true")},e.F=function(t,n,i){this.compile(t.left,n),this.w(i),this.compile(t.right,n)},e.compileOr=function(t,n){return this.F(t,n," || ")},e.compileAnd=function(t,n){return this.F(t,n," && ")},e.compileAdd=function(t,n){return this.F(t,n," + ")},e.compileConcat=function(t,n){return this.F(t,n,' + "" + ')},e.compileSub=function(t,n){return this.F(t,n," - ")},e.compileMul=function(t,n){return this.F(t,n," * ")},e.compileDiv=function(t,n){return this.F(t,n," / ")},e.compileMod=function(t,n){return this.F(t,n," % ")},e.compileNot=function(t,n){this.w("!"),this.compile(t.target,n)},e.compileFloorDiv=function(t,n){this.w("Math.floor("),this.compile(t.left,n),this.w(" / "),this.compile(t.right,n),this.w(")")},e.compilePow=function(t,n){this.w("Math.pow("),this.compile(t.left,n),this.w(", "),this.compile(t.right,n),this.w(")")},e.compileNeg=function(t,n){this.w("-"),this.compile(t.target,n)},e.compilePos=function(t,n){this.w("+"),this.compile(t.target,n)},e.compileCompare=function(t,n){var i=this;this.compile(t.expr,n),t.ops.forEach(function(t){i.w(" "+h[t.type]+" "),i.compile(t.expr,n)})},e.compileLookupVal=function(t,n){this.w("runtime.memberLookup(("),this.L(t.target,n),this.w("),"),this.L(t.val,n),this.w(")")},e.I=function(t){switch(t.typename){case"Symbol":return t.value;case"FunCall":return"the return value of ("+this.I(t.name)+")";case"LookupVal":return this.I(t.target)+'["'+this.I(t.val)+'"]';case"Literal":return t.value.toString();default:return"--expression--"}},e.compileFunCall=function(t,n){this.w("(lineno = "+t.lineno+", colno = "+t.colno+", "),this.w("runtime.callWrap("),this.L(t.name,n),this.w(', "'+this.I(t.name).replace(/"/g,'\\"')+'", context, '),this.S(t.args,n,"[","])"),this.w(")")},e.compileFilter=function(t,n){var i=t.name;this.assertType(i,s.Symbol),this.w('env.getFilter("'+i.value+'").call(context, '),this.S(t.args,n),this.w(")")},e.compileFilterAsync=function(t,n){var i=t.name,r=t.symbol.value;this.assertType(i,s.Symbol),n.set(r,r),this.w('env.getFilter("'+i.value+'").call(context, '),this.S(t.args,n),this.y(", "+this.j(r)),this.T()},e.compileKeywordArgs=function(t,n){this.w("runtime.makeKeywordArgs("),this.compileDict(t,n),this.w(")")},e.compileSet=function(t,n){var i=this,r=[];t.targets.forEach(function(t){var e=t.value,s=n.lookup(e);null!==s&&void 0!==s||(s=i.v(),i.y("var "+s+";")),r.push(s)}),t.value?(this.w(r.join(" = ")+" = "),this.L(t.value,n),this.y(";")):(this.w(r.join(" = ")+" = "),this.compile(t.body,n),this.y(";")),t.targets.forEach(function(t,n){var e=r[n],s=t.value;i.y('frame.set("'+s+'", '+e+", true);"),i.y("if(frame.topLevel) {"),i.y('context.setVariable("'+s+'", '+e+");"),i.y("}"),"_"!==s.charAt(0)&&(i.y("if(frame.topLevel) {"),i.y('context.addExport("'+s+'", '+e+");"),i.y("}"))})},e.compileSwitch=function(t,n){var i=this;this.w("switch ("),this.compile(t.expr,n),this.w(") {"),t.cases.forEach(function(t,r){i.w("case "),i.compile(t.cond,n),i.w(": "),i.compile(t.body,n),t.body.children.length&&i.y("break;")}),t.default&&(this.w("default:"),this.compile(t.default,n)),this.w("}")},e.compileIf=function(t,n,i){var r=this;this.w("if("),this.L(t.cond,n),this.y(") {"),this.A(function(){r.compile(t.body,n),i&&r.w("cb()")}),t.else_?(this.y("}\nelse {"),this.A(function(){r.compile(t.else_,n),i&&r.w("cb()")})):i&&(this.y("}\nelse {"),this.w("cb()")),this.y("}")},e.compileIfAsync=function(t,n){this.w("(function(cb) {"),this.compileIf(t,n,!0),this.w("})("+this.j()),this.T()},e.C=function(t,n,i,r){var e=this;[{name:"index",val:i+" + 1"},{name:"index0",val:i},{name:"revindex",val:r+" - "+i},{name:"revindex0",val:r+" - "+i+" - 1"},{name:"first",val:i+" === 0"},{name:"last",val:i+" === "+r+" - 1"},{name:"length",val:r}].forEach(function(t){e.y('frame.set("loop.'+t.name+'", '+t.val+");")})},e.compileFor=function(t,n){var i=this,r=this.v(),e=this.v(),o=this.v();if(n=n.push(),this.y("frame = frame.push();"),this.w("var "+o+" = "),this.L(t.arr,n),this.y(";"),this.w("if("+o+") {"),this.y(o+" = runtime.fromIterator("+o+");"),t.name instanceof s.Array){this.y("var "+r+";"),this.y("if(runtime.isArray("+o+")) {"),this.y("var "+e+" = "+o+".length;"),this.y("for("+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),t.name.children.forEach(function(e,s){var u=i.v();i.y("var "+u+" = "+o+"["+r+"]["+s+"];"),i.y('frame.set("'+e+'", '+o+"["+r+"]["+s+"]);"),n.set(t.name.children[s].value,u)}),this.C(t,o,r,e),this.A(function(){i.compile(t.body,n)}),this.y("}"),this.y("} else {");var u=t.name.children,h=u[0],f=u[1],c=this.v(),a=this.v();n.set(h.value,c),n.set(f.value,a),this.y(r+" = -1;"),this.y("var "+e+" = runtime.keys("+o+").length;"),this.y("for(var "+c+" in "+o+") {"),this.y(r+"++;"),this.y("var "+a+" = "+o+"["+c+"];"),this.y('frame.set("'+h.value+'", '+c+");"),this.y('frame.set("'+f.value+'", '+a+");"),this.C(t,o,r,e),this.A(function(){i.compile(t.body,n)}),this.y("}"),this.y("}")}else{var l=this.v();n.set(t.name.value,l),this.y("var "+e+" = "+o+".length;"),this.y("for(var "+r+"=0; "+r+" < "+o+".length; "+r+"++) {"),this.y("var "+l+" = "+o+"["+r+"];"),this.y('frame.set("'+t.name.value+'", '+l+");"),this.C(t,o,r,e),this.A(function(){i.compile(t.body,n)}),this.y("}")}this.y("}"),t.else_&&(this.y("if (!"+e+") {"),this.compile(t.else_,n),this.y("}")),this.y("frame = frame.pop();")},e.R=function(t,n,i){var r=this,e=this.v(),o=this.v(),u=this.v(),h=i?"asyncAll":"asyncEach";if(n=n.push(),this.y("frame = frame.push();"),this.w("var "+u+" = runtime.fromIterator("),this.L(t.arr,n),this.y(");"),t.name instanceof s.Array){var f=t.name.children.length;this.w("runtime."+h+"("+u+", "+f+", function("),t.name.children.forEach(function(t){r.w(t.value+",")}),this.w(e+","+o+",next) {"),t.name.children.forEach(function(t){var i=t.value;n.set(i,i),r.y('frame.set("'+i+'", '+i+");")})}else{var c=t.name.value;this.y("runtime."+h+"("+u+", 1, function("+c+", "+e+", "+o+",next) {"),this.y('frame.set("'+c+'", '+c+");"),n.set(c,c)}this.C(t,u,e,o),this.A(function(){var s;i&&(s=r.a()),r.compile(t.body,n),r.y("next("+e+(s?","+s:"")+");"),i&&r.b()});var a=this.v();this.y("}, "+this.j(a)),this.T(),i&&this.y(this.buffer+" += "+a+";"),t.else_&&(this.y("if (!"+u+".length) {"),this.compile(t.else_,n),this.y("}")),this.y("frame = frame.pop();")},e.compileAsyncEach=function(t,n){this.R(t,n)},e.compileAsyncAll=function(t,n){this.R(t,n,!0)},e.K=function(t,n){var i=this,r=[],e=null,o="macro_"+this.v(),h=void 0!==n;t.args.children.forEach(function(n,o){o===t.args.children.length-1&&n instanceof s.Dict?e=n:(i.assertType(n,s.Symbol),r.push(n))});var f,c=[].concat(r.map(function(t){return"l_"+t.value}),["kwargs"]),a=r.map(function(t){return'"'+t.value+'"'}),l=(e&&e.children||[]).map(function(t){return'"'+t.key.value+'"'});f=h?n.push(!0):new u,this.g("var "+o+" = runtime.makeMacro(","["+a.join(", ")+"], ","["+l.join(", ")+"], ","function ("+c.join(", ")+") {","var callerFrame = frame;","frame = "+(h?"frame.push(true);":"new runtime.Frame();"),"kwargs = kwargs || {};",'if (Object.prototype.hasOwnProperty.call(kwargs, "caller")) {','frame.set("caller", kwargs.caller); }'),r.forEach(function(t){i.y('frame.set("'+t.value+'", l_'+t.value+");"),f.set(t.value,"l_"+t.value)}),e&&e.children.forEach(function(t){var n=t.key.value;i.w('frame.set("'+n+'", '),i.w('Object.prototype.hasOwnProperty.call(kwargs, "'+n+'")'),i.w(' ? kwargs["'+n+'"] : '),i.L(t.value,f),i.w(");")});var v=this.a();return this.A(function(){i.compile(t.body,f)}),this.y("frame = "+(h?"frame.pop();":"callerFrame;")),this.y("return new runtime.SafeString("+v+");"),this.y("});"),this.b(),o},e.compileMacro=function(t,n){var i=this.K(t),r=t.name.value;n.set(r,i),n.parent?this.y('frame.set("'+r+'", '+i+");"):("_"!==t.name.value.charAt(0)&&this.y('context.addExport("'+r+'");'),this.y('context.setVariable("'+r+'", '+i+");"))},e.compileCaller=function(t,n){this.w("(function (){");var i=this.K(t,n);this.w("return "+i+";})()")},e.M=function(t,n,i,r){var e=this.v(),s=this._(),o=this.j(e),u=i?"true":"false",h=r?"true":"false";return this.w("env.getTemplate("),this.L(t.template,n),this.y(", "+u+", "+s+", "+h+", "+o),e},e.compileImport=function(t,n){var i=t.target.value,r=this.M(t,n,!1,!1);this.T(),this.y(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this.j(r)),this.T(),n.set(i,r),n.parent?this.y('frame.set("'+i+'", '+r+");"):this.y('context.setVariable("'+i+'", '+r+");")},e.compileFromImport=function(t,n){var i=this,r=this.M(t,n,!1,!1);this.T(),this.y(r+".getExported("+(t.withContext?"context.getVariables(), frame, ":"")+this.j(r)),this.T(),t.names.children.forEach(function(t){var e,o,u=i.v();t instanceof s.Pair?(e=t.key.value,o=t.value.value):o=e=t.value,i.y("if(Object.prototype.hasOwnProperty.call("+r+', "'+e+'")) {'),i.y("var "+u+" = "+r+"."+e+";"),i.y("} else {"),i.y("cb(new Error(\"cannot import '"+e+"'\")); return;"),i.y("}"),n.set(o,u),n.parent?i.y('frame.set("'+o+'", '+u+");"):i.y('context.setVariable("'+o+'", '+u+");")})},e.compileBlock=function(t){var n=this.v();this.inBlock||this.w('(parentTemplate ? function(e, c, f, r, cb) { cb(""); } : '),this.w('context.getBlock("'+t.name.value+'")'),this.inBlock||this.w(")"),this.y("(env, context, frame, runtime, "+this.j(n)),this.y(this.buffer+" += "+n+";"),this.T()},e.compileSuper=function(t,n){var i=t.blockName.value,r=t.symbol.value,e=this.j(r);this.y('context.getSuper(env, "'+i+'", b_'+i+", frame, runtime, "+e),this.y(r+" = runtime.markSafe("+r+");"),this.T(),n.set(r,r)},e.compileExtends=function(t,n){var i=this.v(),r=this.M(t,n,!0,!1);this.y("parentTemplate = "+r),this.y("for(var "+i+" in parentTemplate.blocks) {"),this.y("context.addBlock("+i+", parentTemplate.blocks["+i+"]);"),this.y("}"),this.T()},e.compileInclude=function(t,n){this.y("var tasks = [];"),this.y("tasks.push("),this.y("function(callback) {");var i=this.M(t,n,!1,t.ignoreMissing);this.y("callback(null,"+i+");});"),this.y("});");var r=this.v();this.y("tasks.push("),this.y("function(template, callback){"),this.y("template.render(context.getVariables(), frame, "+this.j(r)),this.y("callback(null,"+r+");});"),this.y("});"),this.y("tasks.push("),this.y("function(result, callback){"),this.y(this.buffer+" += result;"),this.y("callback(null);"),this.y("});"),this.y("env.waterfall(tasks, function(){"),this.T()},e.compileTemplateData=function(t,n){this.compileLiteral(t,n)},e.compileCapture=function(t,n){var i=this,r=this.buffer;this.buffer="output",this.y("(function() {"),this.y('var output = "";'),this.A(function(){i.compile(t.body,n)}),this.y("return output;"),this.y("})()"),this.buffer=r},e.compileOutput=function(t,n){var i=this;t.children.forEach(function(r){r instanceof s.TemplateData?r.value&&(i.w(i.buffer+" += "),i.compileLiteral(r,n),i.y(";")):(i.w(i.buffer+" += runtime.suppressValue("),i.throwOnUndefined&&i.w("runtime.ensureDefined("),i.compile(r,n),i.throwOnUndefined&&i.w(","+t.lineno+","+t.colno+")"),i.w(", env.opts.autoescape);\n"))})},e.compileRoot=function(t,n){var i=this;n&&this.fail("compileRoot: root node can't have frame"),n=new u,this.k(t,"root"),this.y("var parentTemplate = null;"),this.N(t,n),this.y("if(parentTemplate) {"),this.y("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this.y("} else {"),this.y("cb(null, "+this.buffer+");"),this.y("}"),this.x(!0),this.inBlock=!0;var r=[],e=t.findAll(s.Block);e.forEach(function(t,n){var e=t.name.value;if(-1!==r.indexOf(e))throw Error('Block "'+e+'" defined more than once.');r.push(e),i.k(t,"b_"+e);var s=new u;i.y("var frame = frame.push(true);"),i.compile(t.body,s),i.x()}),this.y("return {"),e.forEach(function(t,n){var r="b_"+t.name.value;i.y(r+": "+r+",")}),this.y("root: root\n};")},e.compile=function(t,n){var i=this["compile"+t.typename];i?i.call(this,t,n):this.fail("compile: Cannot compile node: "+t.typename,t.lineno,t.colno)},e.getCode=function(){return this.codebuf.join("")},r}(i(1).Obj);t.exports={compile:function(t,n,i,s,o){void 0===o&&(o={});var u=new f(s,o.throwOnUndefined),h=(i||[]).map(function(t){return t.preprocess}).filter(function(t){return!!t}).reduce(function(t,n){return n(t)},t);return u.compile(e.transform(r.parse(h,i,o),n,s)),u.getCode()},Compiler:f}},function(t,n,i){"use strict";var r=i(4),e=i(1).EmitterObj;t.exports=function(t){var n,i;function e(){return t.apply(this,arguments)||this}i=t,(n=e).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i;var s=e.prototype;return s.resolve=function(t,n){return r.resolve(r.dirname(t),n)},s.isRelative=function(t){return 0===t.indexOf("./")||0===t.indexOf("../")},e}(e)},function(t,n,i){"use strict";function r(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}var e=i(12),s=i(15),o=i(0),u=i(5),h=i(18),f=i(10),c=f.FileSystemLoader,a=f.WebLoader,l=f.PrecompiledLoader,v=i(20),p=i(21),d=i(1),m=d.Obj,w=d.EmitterObj,b=i(2),y=b.handleError,g=b.Frame,k=i(22);function E(t,n,i){e(function(){t(n,i)})}var x={type:"code",obj:{root:function(t,n,i,r,e){try{e(null,"")}catch(t){e(y(t,null,null))}}}},O=function(t){function n(){return t.apply(this,arguments)||this}r(n,t);var i=n.prototype;return i.init=function(t,n){var i=this;n=this.opts=n||{},this.opts.dev=!!n.dev,this.opts.autoescape=null==n.autoescape||n.autoescape,this.opts.throwOnUndefined=!!n.throwOnUndefined,this.opts.trimBlocks=!!n.trimBlocks,this.opts.lstripBlocks=!!n.lstripBlocks,this.loaders=[],t?this.loaders=o.isArray(t)?t:[t]:c?this.loaders=[new c("views")]:a&&(this.loaders=[new a("/views")]),"undefined"!=typeof window&&window.nunjucksPrecompiled&&this.loaders.unshift(new l(window.nunjucksPrecompiled)),this.P(),this.globals=p(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],o.r(h).forEach(function(t){var n=t[0],r=t[1];return i.addFilter(n,r)}),o.r(v).forEach(function(t){var n=t[0],r=t[1];return i.addTest(n,r)})},i.P=function(){var t=this;this.loaders.forEach(function(n){n.cache={},"function"==typeof n.on&&(n.on("update",function(i,r){n.cache[i]=null,t.emit("update",i,r,n)}),n.on("load",function(i,r){t.emit("load",i,r,n)}))})},i.invalidateCache=function(){this.loaders.forEach(function(t){t.cache={}})},i.addExtension=function(t,n){return n.__name=t,this.extensions[t]=n,this.extensionsList.push(n),this},i.removeExtension=function(t){var n=this.getExtension(t);n&&(this.extensionsList=o.without(this.extensionsList,n),delete this.extensions[t])},i.getExtension=function(t){return this.extensions[t]},i.hasExtension=function(t){return!!this.extensions[t]},i.addGlobal=function(t,n){return this.globals[t]=n,this},i.getGlobal=function(t){if(void 0===this.globals[t])throw Error("global not found: "+t);return this.globals[t]},i.addFilter=function(t,n,i){var r=n;return i&&this.asyncFilters.push(t),this.filters[t]=r,this},i.getFilter=function(t){if(!this.filters[t])throw Error("filter not found: "+t);return this.filters[t]},i.addTest=function(t,n){return this.tests[t]=n,this},i.getTest=function(t){if(!this.tests[t])throw Error("test not found: "+t);return this.tests[t]},i.resolveTemplate=function(t,n,i){return!(!t.isRelative||!n)&&t.isRelative(i)&&t.resolve?t.resolve(n,i):i},i.getTemplate=function(t,n,i,r,e){var s,u=this,h=this,f=null;if(t&&t.raw&&(t=t.raw),o.isFunction(i)&&(e=i,i=null,n=n||!1),o.isFunction(n)&&(e=n,n=!1),t instanceof A)f=t;else{if("string"!=typeof t)throw Error("template names must be a string: "+t);for(var c=0;c<this.loaders.length;c++){var a=this.loaders[c];if(f=a.cache[this.resolveTemplate(a,i,t)])break}}if(f)return n&&f.compile(),e?void e(null,f):f;return o.asyncIter(this.loaders,function(n,r,e,s){function o(t,i){t?s(t):i?(i.loader=n,s(null,i)):e()}t=h.resolveTemplate(n,i,t),n.async?n.getSource(t,o):o(null,n.getSource(t))},function(i,o){if(o||i||r||(i=Error("template not found: "+t)),i){if(e)return void e(i);throw i}var h;o?(h=new A(o.src,u,o.path,n),o.noCache||(o.loader.cache[t]=h)):h=new A(x,u,"",n),e?e(null,h):s=h}),s},i.express=function(t){return k(this,t)},i.render=function(t,n,i){o.isFunction(n)&&(i=n,n=null);var r=null;return this.getTemplate(t,function(t,e){if(t&&i)E(i,t);else{if(t)throw t;r=e.render(n,i)}}),r},i.renderString=function(t,n,i,r){return o.isFunction(i)&&(r=i,i={}),new A(t,this,(i=i||{}).path).render(n,r)},i.waterfall=function(t,n,i){return s(t,n,i)},n}(w),T=function(t){function n(){return t.apply(this,arguments)||this}r(n,t);var i=n.prototype;return i.init=function(t,n,i){var r=this;this.env=i||new O,this.ctx=o.extend({},t),this.blocks={},this.exported=[],o.keys(n).forEach(function(t){r.addBlock(t,n[t])})},i.lookup=function(t){return t in this.env.globals&&!(t in this.ctx)?this.env.globals[t]:this.ctx[t]},i.setVariable=function(t,n){this.ctx[t]=n},i.getVariables=function(){return this.ctx},i.addBlock=function(t,n){return this.blocks[t]=this.blocks[t]||[],this.blocks[t].push(n),this},i.getBlock=function(t){if(!this.blocks[t])throw Error('unknown block "'+t+'"');return this.blocks[t][0]},i.getSuper=function(t,n,i,r,e,s){var u=o.indexOf(this.blocks[n]||[],i),h=this.blocks[n][u+1];if(-1===u||!h)throw Error('no super block available for "'+n+'"');h(t,this,r,e,s)},i.addExport=function(t){this.exported.push(t)},i.getExported=function(){var t=this,n={};return this.exported.forEach(function(i){n[i]=t.ctx[i]}),n},n}(m),A=function(t){function n(){return t.apply(this,arguments)||this}r(n,t);var i=n.prototype;return i.init=function(t,n,i,r){if(this.env=n||new O,o.isObject(t))switch(t.type){case"code":this.tmplProps=t.obj;break;case"string":this.tmplStr=t.obj;break;default:throw Error("Unexpected template object type "+t.type+"; expected 'code', or 'string'")}else{if(!o.isString(t))throw Error("src must be a string or an object describing the source");this.tmplStr=t}if(this.path=i,r)try{this.B()}catch(t){throw o.t(this.path,this.env.opts.dev,t)}else this.compiled=!1},i.render=function(t,n,i){var r=this;"function"==typeof t?(i=t,t={}):"function"==typeof n&&(i=n,n=null);var e=!n;try{this.compile()}catch(t){var s=o.t(this.path,this.env.opts.dev,t);if(i)return E(i,s);throw s}var u=new T(t||{},this.blocks,this.env),h=n?n.push(!0):new g;h.topLevel=!0;var f=null,c=!1;return this.rootRenderFunc(this.env,u,h,b,function(t,n){if(c){if(i)return;throw t}if(t&&(t=o.t(r.path,r.env.opts.dev,t),c=!0),i)e?E(i,t,n):i(t,n);else{if(t)throw t;f=n}}),f},i.getExported=function(t,n,i){"function"==typeof t&&(i=t,t={}),"function"==typeof n&&(i=n,n=null);try{this.compile()}catch(t){if(i)return i(t);throw t}var r=n?n.push():new g;r.topLevel=!0;var e=new T(t||{},this.blocks,this.env);this.rootRenderFunc(this.env,e,r,b,function(t){t?i(t,null):i(null,e.getExported())})},i.compile=function(){this.compiled||this.B()},i.B=function(){var t;if(this.tmplProps)t=this.tmplProps;else{var n=u.compile(this.tmplStr,this.env.asyncFilters,this.env.extensionsList,this.path,this.env.opts);t=Function(n)()}this.blocks=this.V(t),this.rootRenderFunc=t.root,this.compiled=!0},i.V=function(t){var n={};return o.keys(t).forEach(function(i){"b_"===i.slice(0,2)&&(n[i.slice(2)]=t[i])}),n},n}(m);t.exports={Environment:O,Template:A}},function(t,n,i){"use strict";var r=i(9),e=i(3),s=i(1).Obj,o=i(0),u=function(t){var n,i;function s(){return t.apply(this,arguments)||this}i=t,(n=s).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i;var u=s.prototype;return u.init=function(t){this.tokens=t,this.peeked=null,this.breakOnBlocks=null,this.dropLeadingWhitespace=!1,this.extensions=[]},u.nextToken=function(t){var n;if(this.peeked){if(t||this.peeked.type!==r.TOKEN_WHITESPACE)return n=this.peeked,this.peeked=null,n;this.peeked=null}if(n=this.tokens.nextToken(),!t)for(;n&&n.type===r.TOKEN_WHITESPACE;)n=this.tokens.nextToken();return n},u.peekToken=function(){return this.peeked=this.peeked||this.nextToken(),this.peeked},u.pushToken=function(t){if(this.peeked)throw Error("pushToken: can only push one token on between reads");this.peeked=t},u.error=function(t,n,i){if(void 0===n||void 0===i){var r=this.peekToken()||{};n=r.lineno,i=r.colno}return void 0!==n&&(n+=1),void 0!==i&&(i+=1),new o.TemplateError(t,n,i)},u.fail=function(t,n,i){throw this.error(t,n,i)},u.skip=function(t){var n=this.nextToken();return!(!n||n.type!==t)||(this.pushToken(n),!1)},u.expect=function(t){var n=this.nextToken();return n.type!==t&&this.fail("expected "+t+", got "+n.type,n.lineno,n.colno),n},u.skipValue=function(t,n){var i=this.nextToken();return!(!i||i.type!==t||i.value!==n)||(this.pushToken(i),!1)},u.skipSymbol=function(t){return this.skipValue(r.TOKEN_SYMBOL,t)},u.advanceAfterBlockEnd=function(t){var n;return t||((n=this.peekToken())||this.fail("unexpected end of file"),n.type!==r.TOKEN_SYMBOL&&this.fail("advanceAfterBlockEnd: expected symbol token or explicit name to be passed"),t=this.nextToken().value),(n=this.nextToken())&&n.type===r.TOKEN_BLOCK_END?"-"===n.value.charAt(0)&&(this.dropLeadingWhitespace=!0):this.fail("expected block end in "+t+" statement"),n},u.advanceAfterVariableEnd=function(){var t=this.nextToken();t&&t.type===r.TOKEN_VARIABLE_END?this.dropLeadingWhitespace="-"===t.value.charAt(t.value.length-this.tokens.tags.VARIABLE_END.length-1):(this.pushToken(t),this.fail("expected variable end"))},u.parseFor=function(){var t,n,i=this.peekToken();if(this.skipSymbol("for")?(t=new e.For(i.lineno,i.colno),n="endfor"):this.skipSymbol("asyncEach")?(t=new e.AsyncEach(i.lineno,i.colno),n="endeach"):this.skipSymbol("asyncAll")?(t=new e.AsyncAll(i.lineno,i.colno),n="endall"):this.fail("parseFor: expected for{Async}",i.lineno,i.colno),t.name=this.parsePrimary(),t.name instanceof e.Symbol||this.fail("parseFor: variable name expected for loop"),this.peekToken().type===r.TOKEN_COMMA){var s=t.name;for(t.name=new e.Array(s.lineno,s.colno),t.name.addChild(s);this.skip(r.TOKEN_COMMA);){var o=this.parsePrimary();t.name.addChild(o)}}return this.skipSymbol("in")||this.fail('parseFor: expected "in" keyword for loop',i.lineno,i.colno),t.arr=this.parseExpression(),this.advanceAfterBlockEnd(i.value),t.body=this.parseUntilBlocks(n,"else"),this.skipSymbol("else")&&(this.advanceAfterBlockEnd("else"),t.else_=this.parseUntilBlocks(n)),this.advanceAfterBlockEnd(),t},u.parseMacro=function(){var t=this.peekToken();this.skipSymbol("macro")||this.fail("expected macro");var n=this.parsePrimary(!0),i=this.parseSignature(),r=new e.Macro(t.lineno,t.colno,n,i);return this.advanceAfterBlockEnd(t.value),r.body=this.parseUntilBlocks("endmacro"),this.advanceAfterBlockEnd(),r},u.parseCall=function(){var t=this.peekToken();this.skipSymbol("call")||this.fail("expected call");var n=this.parseSignature(!0)||new e.NodeList,i=this.parsePrimary();this.advanceAfterBlockEnd(t.value);var r=this.parseUntilBlocks("endcall");this.advanceAfterBlockEnd();var s=new e.Symbol(t.lineno,t.colno,"caller"),o=new e.Caller(t.lineno,t.colno,s,n,r),u=i.args.children;return u[u.length-1]instanceof e.KeywordArgs||u.push(new e.KeywordArgs),u[u.length-1].addChild(new e.Pair(t.lineno,t.colno,s,o)),new e.Output(t.lineno,t.colno,[i])},u.parseWithContext=function(){var t=this.peekToken(),n=null;return this.skipSymbol("with")?n=!0:this.skipSymbol("without")&&(n=!1),null!==n&&(this.skipSymbol("context")||this.fail("parseFrom: expected context after with/without",t.lineno,t.colno)),n},u.parseImport=function(){var t=this.peekToken();this.skipSymbol("import")||this.fail("parseImport: expected import",t.lineno,t.colno);var n=this.parseExpression();this.skipSymbol("as")||this.fail('parseImport: expected "as" keyword',t.lineno,t.colno);var i=this.parseExpression(),r=this.parseWithContext(),s=new e.Import(t.lineno,t.colno,n,i,r);return this.advanceAfterBlockEnd(t.value),s},u.parseFrom=function(){var t=this.peekToken();this.skipSymbol("from")||this.fail("parseFrom: expected from");var n=this.parseExpression();this.skipSymbol("import")||this.fail("parseFrom: expected import",t.lineno,t.colno);for(var i,s=new e.NodeList;;){var o=this.peekToken();if(o.type===r.TOKEN_BLOCK_END){s.children.length||this.fail("parseFrom: Expected at least one import name",t.lineno,t.colno),"-"===o.value.charAt(0)&&(this.dropLeadingWhitespace=!0),this.nextToken();break}s.children.length>0&&!this.skip(r.TOKEN_COMMA)&&this.fail("parseFrom: expected comma",t.lineno,t.colno);var u=this.parsePrimary();if("_"===u.value.charAt(0)&&this.fail("parseFrom: names starting with an underscore cannot be imported",u.lineno,u.colno),this.skipSymbol("as")){var h=this.parsePrimary();s.addChild(new e.Pair(u.lineno,u.colno,u,h))}else s.addChild(u);i=this.parseWithContext()}return new e.FromImport(t.lineno,t.colno,n,s,i)},u.parseBlock=function(){var t=this.peekToken();this.skipSymbol("block")||this.fail("parseBlock: expected block",t.lineno,t.colno);var n=new e.Block(t.lineno,t.colno);n.name=this.parsePrimary(),n.name instanceof e.Symbol||this.fail("parseBlock: variable name expected",t.lineno,t.colno),this.advanceAfterBlockEnd(t.value),n.body=this.parseUntilBlocks("endblock"),this.skipSymbol("endblock"),this.skipSymbol(n.name.value);var i=this.peekToken();return i||this.fail("parseBlock: expected endblock, got end of file"),this.advanceAfterBlockEnd(i.value),n},u.parseExtends=function(){var t=this.peekToken();this.skipSymbol("extends")||this.fail("parseTemplateRef: expected extends");var n=new e.Extends(t.lineno,t.colno);return n.template=this.parseExpression(),this.advanceAfterBlockEnd(t.value),n},u.parseInclude=function(){var t=this.peekToken();this.skipSymbol("include")||this.fail("parseInclude: expected include");var n=new e.Include(t.lineno,t.colno);return n.template=this.parseExpression(),this.skipSymbol("ignore")&&this.skipSymbol("missing")&&(n.ignoreMissing=!0),this.advanceAfterBlockEnd(t.value),n},u.parseIf=function(){var t,n=this.peekToken();this.skipSymbol("if")||this.skipSymbol("elif")||this.skipSymbol("elseif")?t=new e.If(n.lineno,n.colno):this.skipSymbol("ifAsync")?t=new e.IfAsync(n.lineno,n.colno):this.fail("parseIf: expected if, elif, or elseif",n.lineno,n.colno),t.cond=this.parseExpression(),this.advanceAfterBlockEnd(n.value),t.body=this.parseUntilBlocks("elif","elseif","else","endif");var i=this.peekToken();switch(i&&i.value){case"elseif":case"elif":t.else_=this.parseIf();break;case"else":this.advanceAfterBlockEnd(),t.else_=this.parseUntilBlocks("endif"),this.advanceAfterBlockEnd();break;case"endif":t.else_=null,this.advanceAfterBlockEnd();break;default:this.fail("parseIf: expected elif, else, or endif, got end of file")}return t},u.parseSet=function(){var t=this.peekToken();this.skipSymbol("set")||this.fail("parseSet: expected set",t.lineno,t.colno);for(var n,i=new e.Set(t.lineno,t.colno,[]);(n=this.parsePrimary())&&(i.targets.push(n),this.skip(r.TOKEN_COMMA)););return this.skipValue(r.TOKEN_OPERATOR,"=")?(i.value=this.parseExpression(),this.advanceAfterBlockEnd(t.value)):this.skip(r.TOKEN_BLOCK_END)?(i.body=new e.Capture(t.lineno,t.colno,this.parseUntilBlocks("endset")),i.value=null,this.advanceAfterBlockEnd()):this.fail("parseSet: expected = or block end in set tag",t.lineno,t.colno),i},u.parseSwitch=function(){var t=this.peekToken();this.skipSymbol("switch")||this.skipSymbol("case")||this.skipSymbol("default")||this.fail('parseSwitch: expected "switch," "case" or "default"',t.lineno,t.colno);var n=this.parseExpression();this.advanceAfterBlockEnd("switch"),this.parseUntilBlocks("case","default","endswitch");var i,r=this.peekToken(),s=[];do{this.skipSymbol("case");var o=this.parseExpression();this.advanceAfterBlockEnd("switch");var u=this.parseUntilBlocks("case","default","endswitch");s.push(new e.Case(r.line,r.col,o,u)),r=this.peekToken()}while(r&&"case"===r.value);switch(r.value){case"default":this.advanceAfterBlockEnd(),i=this.parseUntilBlocks("endswitch"),this.advanceAfterBlockEnd();break;case"endswitch":this.advanceAfterBlockEnd();break;default:this.fail('parseSwitch: expected "case," "default" or "endswitch," got EOF.')}return new e.Switch(t.lineno,t.colno,n,s,i)},u.parseStatement=function(){var t=this.peekToken();if(t.type!==r.TOKEN_SYMBOL&&this.fail("tag name expected",t.lineno,t.colno),this.breakOnBlocks&&-1!==o.indexOf(this.breakOnBlocks,t.value))return null;switch(t.value){case"raw":return this.parseRaw();case"verbatim":return this.parseRaw("verbatim");case"if":case"ifAsync":return this.parseIf();case"for":case"asyncEach":case"asyncAll":return this.parseFor();case"block":return this.parseBlock();case"extends":return this.parseExtends();case"include":return this.parseInclude();case"set":return this.parseSet();case"macro":return this.parseMacro();case"call":return this.parseCall();case"import":return this.parseImport();case"from":return this.parseFrom();case"filter":return this.parseFilterStatement();case"switch":return this.parseSwitch();default:if(this.extensions.length)for(var n=0;n<this.extensions.length;n++){var i=this.extensions[n];if(-1!==o.indexOf(i.tags||[],t.value))return i.parse(this,e,r)}this.fail("unknown block tag: "+t.value,t.lineno,t.colno)}},u.parseRaw=function(t){for(var n="end"+(t=t||"raw"),i=RegExp("([\\s\\S]*?){%\\s*("+t+"|"+n+")\\s*(?=%})%}"),r=1,s="",o=null,u=this.advanceAfterBlockEnd();(o=this.tokens.D(i))&&r>0;){var h=o[0],f=o[1],c=o[2];c===t?r+=1:c===n&&(r-=1),0===r?(s+=f,this.tokens.backN(h.length-f.length)):s+=h}return new e.Output(u.lineno,u.colno,[new e.TemplateData(u.lineno,u.colno,s)])},u.parsePostfix=function(t){for(var n,i=this.peekToken();i;){if(i.type===r.TOKEN_LEFT_PAREN)t=new e.FunCall(i.lineno,i.colno,t,this.parseSignature());else if(i.type===r.TOKEN_LEFT_BRACKET)(n=this.parseAggregate()).children.length>1&&this.fail("invalid index"),t=new e.LookupVal(i.lineno,i.colno,t,n.children[0]);else{if(i.type!==r.TOKEN_OPERATOR||"."!==i.value)break;this.nextToken();var s=this.nextToken();s.type!==r.TOKEN_SYMBOL&&this.fail("expected name as lookup value, got "+s.value,s.lineno,s.colno),n=new e.Literal(s.lineno,s.colno,s.value),t=new e.LookupVal(i.lineno,i.colno,t,n)}i=this.peekToken()}return t},u.parseExpression=function(){return this.parseInlineIf()},u.parseInlineIf=function(){var t=this.parseOr();if(this.skipSymbol("if")){var n=this.parseOr(),i=t;(t=new e.InlineIf(t.lineno,t.colno)).body=i,t.cond=n,this.skipSymbol("else")?t.else_=this.parseOr():t.else_=null}return t},u.parseOr=function(){for(var t=this.parseAnd();this.skipSymbol("or");){var n=this.parseAnd();t=new e.Or(t.lineno,t.colno,t,n)}return t},u.parseAnd=function(){for(var t=this.parseNot();this.skipSymbol("and");){var n=this.parseNot();t=new e.And(t.lineno,t.colno,t,n)}return t},u.parseNot=function(){var t=this.peekToken();return this.skipSymbol("not")?new e.Not(t.lineno,t.colno,this.parseNot()):this.parseIn()},u.parseIn=function(){for(var t=this.parseIs();;){var n=this.nextToken();if(!n)break;var i=n.type===r.TOKEN_SYMBOL&&"not"===n.value;if(i||this.pushToken(n),!this.skipSymbol("in")){i&&this.pushToken(n);break}var s=this.parseIs();t=new e.In(t.lineno,t.colno,t,s),i&&(t=new e.Not(t.lineno,t.colno,t))}return t},u.parseIs=function(){var t=this.parseCompare();if(this.skipSymbol("is")){var n=this.skipSymbol("not"),i=this.parseCompare();t=new e.Is(t.lineno,t.colno,t,i),n&&(t=new e.Not(t.lineno,t.colno,t))}return t},u.parseCompare=function(){for(var t=["==","===","!=","!==","<",">","<=",">="],n=this.parseConcat(),i=[];;){var r=this.nextToken();if(!r)break;if(-1===t.indexOf(r.value)){this.pushToken(r);break}i.push(new e.CompareOperand(r.lineno,r.colno,this.parseConcat(),r.value))}return i.length?new e.Compare(i[0].lineno,i[0].colno,n,i):n},u.parseConcat=function(){for(var t=this.parseAdd();this.skipValue(r.TOKEN_TILDE,"~");){var n=this.parseAdd();t=new e.Concat(t.lineno,t.colno,t,n)}return t},u.parseAdd=function(){for(var t=this.parseSub();this.skipValue(r.TOKEN_OPERATOR,"+");){var n=this.parseSub();t=new e.Add(t.lineno,t.colno,t,n)}return t},u.parseSub=function(){for(var t=this.parseMul();this.skipValue(r.TOKEN_OPERATOR,"-");){var n=this.parseMul();t=new e.Sub(t.lineno,t.colno,t,n)}return t},u.parseMul=function(){for(var t=this.parseDiv();this.skipValue(r.TOKEN_OPERATOR,"*");){var n=this.parseDiv();t=new e.Mul(t.lineno,t.colno,t,n)}return t},u.parseDiv=function(){for(var t=this.parseFloorDiv();this.skipValue(r.TOKEN_OPERATOR,"/");){var n=this.parseFloorDiv();t=new e.Div(t.lineno,t.colno,t,n)}return t},u.parseFloorDiv=function(){for(var t=this.parseMod();this.skipValue(r.TOKEN_OPERATOR,"//");){var n=this.parseMod();t=new e.FloorDiv(t.lineno,t.colno,t,n)}return t},u.parseMod=function(){for(var t=this.parsePow();this.skipValue(r.TOKEN_OPERATOR,"%");){var n=this.parsePow();t=new e.Mod(t.lineno,t.colno,t,n)}return t},u.parsePow=function(){for(var t=this.parseUnary();this.skipValue(r.TOKEN_OPERATOR,"**");){var n=this.parseUnary();t=new e.Pow(t.lineno,t.colno,t,n)}return t},u.parseUnary=function(t){var n,i=this.peekToken();return n=this.skipValue(r.TOKEN_OPERATOR,"-")?new e.Neg(i.lineno,i.colno,this.parseUnary(!0)):this.skipValue(r.TOKEN_OPERATOR,"+")?new e.Pos(i.lineno,i.colno,this.parseUnary(!0)):this.parsePrimary(),t||(n=this.parseFilter(n)),n},u.parsePrimary=function(t){var n,i=this.nextToken(),s=null;if(i?i.type===r.TOKEN_STRING?n=i.value:i.type===r.TOKEN_INT?n=parseInt(i.value,10):i.type===r.TOKEN_FLOAT?n=parseFloat(i.value):i.type===r.TOKEN_BOOLEAN?"true"===i.value?n=!0:"false"===i.value?n=!1:this.fail("invalid boolean: "+i.value,i.lineno,i.colno):i.type===r.TOKEN_NONE?n=null:i.type===r.TOKEN_REGEX&&(n=RegExp(i.value.body,i.value.flags)):this.fail("expected expression, got end of file"),void 0!==n?s=new e.Literal(i.lineno,i.colno,n):i.type===r.TOKEN_SYMBOL?s=new e.Symbol(i.lineno,i.colno,i.value):(this.pushToken(i),s=this.parseAggregate()),t||(s=this.parsePostfix(s)),s)return s;throw this.error("unexpected token: "+i.value,i.lineno,i.colno)},u.parseFilterName=function(){for(var t=this.expect(r.TOKEN_SYMBOL),n=t.value;this.skipValue(r.TOKEN_OPERATOR,".");)n+="."+this.expect(r.TOKEN_SYMBOL).value;return new e.Symbol(t.lineno,t.colno,n)},u.parseFilterArgs=function(t){return this.peekToken().type===r.TOKEN_LEFT_PAREN?this.parsePostfix(t).args.children:[]},u.parseFilter=function(t){for(;this.skip(r.TOKEN_PIPE);){var n=this.parseFilterName();t=new e.Filter(n.lineno,n.colno,n,new e.NodeList(n.lineno,n.colno,[t].concat(this.parseFilterArgs(t))))}return t},u.parseFilterStatement=function(){var t=this.peekToken();this.skipSymbol("filter")||this.fail("parseFilterStatement: expected filter");var n=this.parseFilterName(),i=this.parseFilterArgs(n);this.advanceAfterBlockEnd(t.value);var r=new e.Capture(n.lineno,n.colno,this.parseUntilBlocks("endfilter"));this.advanceAfterBlockEnd();var s=new e.Filter(n.lineno,n.colno,n,new e.NodeList(n.lineno,n.colno,[r].concat(i)));return new e.Output(n.lineno,n.colno,[s])},u.parseAggregate=function(){var t,n=this.nextToken();switch(n.type){case r.TOKEN_LEFT_PAREN:t=new e.Group(n.lineno,n.colno);break;case r.TOKEN_LEFT_BRACKET:t=new e.Array(n.lineno,n.colno);break;case r.TOKEN_LEFT_CURLY:t=new e.Dict(n.lineno,n.colno);break;default:return null}for(;;){var i=this.peekToken().type;if(i===r.TOKEN_RIGHT_PAREN||i===r.TOKEN_RIGHT_BRACKET||i===r.TOKEN_RIGHT_CURLY){this.nextToken();break}if(t.children.length>0&&(this.skip(r.TOKEN_COMMA)||this.fail("parseAggregate: expected comma after expression",n.lineno,n.colno)),t instanceof e.Dict){var s=this.parsePrimary();this.skip(r.TOKEN_COLON)||this.fail("parseAggregate: expected colon after dict key",n.lineno,n.colno);var o=this.parseExpression();t.addChild(new e.Pair(s.lineno,s.colno,s,o))}else{var u=this.parseExpression();t.addChild(u)}}return t},u.parseSignature=function(t,n){var i=this.peekToken();if(!n&&i.type!==r.TOKEN_LEFT_PAREN){if(t)return null;this.fail("expected arguments",i.lineno,i.colno)}i.type===r.TOKEN_LEFT_PAREN&&(i=this.nextToken());for(var s=new e.NodeList(i.lineno,i.colno),o=new e.KeywordArgs(i.lineno,i.colno),u=!1;;){if(i=this.peekToken(),!n&&i.type===r.TOKEN_RIGHT_PAREN){this.nextToken();break}if(n&&i.type===r.TOKEN_BLOCK_END)break;if(u&&!this.skip(r.TOKEN_COMMA))this.fail("parseSignature: expected comma after expression",i.lineno,i.colno);else{var h=this.parseExpression();this.skipValue(r.TOKEN_OPERATOR,"=")?o.addChild(new e.Pair(h.lineno,h.colno,h,this.parseExpression())):s.addChild(h)}u=!0}return o.children.length&&s.addChild(o),s},u.parseUntilBlocks=function(){for(var t=this.breakOnBlocks,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];this.breakOnBlocks=i;var e=this.parse();return this.breakOnBlocks=t,e},u.parseNodes=function(){for(var t,n=[];t=this.nextToken();)if(t.type===r.TOKEN_DATA){var i=t.value,s=this.peekToken(),o=s&&s.value;this.dropLeadingWhitespace&&(i=i.replace(/^\s*/,""),this.dropLeadingWhitespace=!1),s&&(s.type===r.TOKEN_BLOCK_START&&"-"===o.charAt(o.length-1)||s.type===r.TOKEN_VARIABLE_START&&"-"===o.charAt(this.tokens.tags.VARIABLE_START.length)||s.type===r.TOKEN_COMMENT&&"-"===o.charAt(this.tokens.tags.COMMENT_START.length))&&(i=i.replace(/\s*$/,"")),n.push(new e.Output(t.lineno,t.colno,[new e.TemplateData(t.lineno,t.colno,i)]))}else if(t.type===r.TOKEN_BLOCK_START){this.dropLeadingWhitespace=!1;var u=this.parseStatement();if(!u)break;n.push(u)}else if(t.type===r.TOKEN_VARIABLE_START){var h=this.parseExpression();this.dropLeadingWhitespace=!1,this.advanceAfterVariableEnd(),n.push(new e.Output(t.lineno,t.colno,[h]))}else t.type===r.TOKEN_COMMENT?this.dropLeadingWhitespace="-"===t.value.charAt(t.value.length-this.tokens.tags.COMMENT_END.length-1):this.fail("Unexpected token at top-level: "+t.type,t.lineno,t.colno);return n},u.parse=function(){return new e.NodeList(0,0,this.parseNodes())},u.parseAsRoot=function(){return new e.Root(0,0,this.parseNodes())},s}(s);t.exports={parse:function(t,n,i){var e=new u(r.lex(t,i));return void 0!==n&&(e.extensions=n),e.parseAsRoot()},Parser:u}},function(t,n,i){"use strict";var r=i(0),e="{%",s="%}",o="{{",u="}}",h="{#",f="#}";function c(t,n,i,r){return{type:t,value:n,lineno:i,colno:r}}var a=function(){function t(t,n){this.str=t,this.index=0,this.len=t.length,this.lineno=0,this.colno=0,this.in_code=!1;var i=(n=n||{}).tags||{};this.tags={BLOCK_START:i.blockStart||e,BLOCK_END:i.blockEnd||s,VARIABLE_START:i.variableStart||o,VARIABLE_END:i.variableEnd||u,COMMENT_START:i.commentStart||h,COMMENT_END:i.commentEnd||f},this.trimBlocks=!!n.trimBlocks,this.lstripBlocks=!!n.lstripBlocks}var n=t.prototype;return n.nextToken=function(){var t,n=this.lineno,i=this.colno;if(this.in_code){var e=this.current();if(this.isFinished())return null;if('"'===e||"'"===e)return c("string",this.U(e),n,i);if(t=this.$(" \n\t\r "))return c("whitespace",t,n,i);if((t=this.G(this.tags.BLOCK_END))||(t=this.G("-"+this.tags.BLOCK_END)))return this.in_code=!1,this.trimBlocks&&("\n"===(e=this.current())?this.forward():"\r"===e&&(this.forward(),"\n"===(e=this.current())?this.forward():this.back())),c("block-end",t,n,i);if((t=this.G(this.tags.VARIABLE_END))||(t=this.G("-"+this.tags.VARIABLE_END)))return this.in_code=!1,c("variable-end",t,n,i);if("r"===e&&"/"===this.str.charAt(this.index+1)){this.forwardN(2);for(var s="";!this.isFinished();){if("/"===this.current()&&"\\"!==this.previous()){this.forward();break}s+=this.current(),this.forward()}for(var o=["g","i","m","y"],u="";!this.isFinished();){if(!(-1!==o.indexOf(this.current())))break;u+=this.current(),this.forward()}return c("regex",{body:s,flags:u},n,i)}if(-1!=="()[]{}%*-+~/#,:|.<>=!".indexOf(e)){this.forward();var h,f=["==","===","!=","!==","<=",">=","//","**"],a=e+this.current();switch(-1!==r.indexOf(f,a)&&(this.forward(),e=a,-1!==r.indexOf(f,a+this.current())&&(e=a+this.current(),this.forward())),e){case"(":h="left-paren";break;case")":h="right-paren";break;case"[":h="left-bracket";break;case"]":h="right-bracket";break;case"{":h="left-curly";break;case"}":h="right-curly";break;case",":h="comma";break;case":":h="colon";break;case"~":h="tilde";break;case"|":h="pipe";break;default:h="operator"}return c(h,e,n,i)}if((t=this.W(" \n\t\r ()[]{}%*-+~/#,:|.<>=!")).match(/^[-+]?[0-9]+$/))return"."===this.current()?(this.forward(),c("float",t+"."+this.$("0123456789"),n,i)):c("int",t,n,i);if(t.match(/^(true|false)$/))return c("boolean",t,n,i);if("none"===t)return c("none",t,n,i);if("null"===t)return c("none",t,n,i);if(t)return c("symbol",t,n,i);throw Error("Unexpected value while parsing: "+t)}var l,v=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if((t=this.G(this.tags.BLOCK_START+"-"))||(t=this.G(this.tags.BLOCK_START)))return this.in_code=!0,c("block-start",t,n,i);if((t=this.G(this.tags.VARIABLE_START+"-"))||(t=this.G(this.tags.VARIABLE_START)))return this.in_code=!0,c("variable-start",t,n,i);t="";var p=!1;for(this.H(this.tags.COMMENT_START)&&(p=!0,t=this.G(this.tags.COMMENT_START));null!==(l=this.W(v));){if(t+=l,(this.H(this.tags.BLOCK_START)||this.H(this.tags.VARIABLE_START)||this.H(this.tags.COMMENT_START))&&!p){if(this.lstripBlocks&&this.H(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=t.length){var d=t.slice(-this.colno);if(/^\s+$/.test(d)&&!(t=t.slice(0,-this.colno)).length)return this.nextToken()}break}if(this.H(this.tags.COMMENT_END)){if(!p)throw Error("unexpected end of comment");t+=this.G(this.tags.COMMENT_END);break}t+=this.current(),this.forward()}if(null===l&&p)throw Error("expected end of comment, got end of file");return c(p?"comment":"data",t,n,i)},n.U=function(t){this.forward();for(var n="";!this.isFinished()&&this.current()!==t;){var i=this.current();if("\\"===i){switch(this.forward(),this.current()){case"n":n+="\n";break;case"t":n+="\t";break;case"r":n+="\r";break;default:n+=this.current()}this.forward()}else n+=i,this.forward()}return this.forward(),n},n.H=function(t){return this.index+t.length>this.len?null:this.str.slice(this.index,this.index+t.length)===t},n.G=function(t){return this.H(t)?(this.forwardN(t.length),t):null},n.W=function(t){return this.J(!0,t||"")},n.$=function(t){return this.J(!1,t)},n.J=function(t,n){if(this.isFinished())return null;var i=n.indexOf(this.current());if(t&&-1===i||!t&&-1!==i){var r=this.current();this.forward();for(var e=n.indexOf(this.current());(t&&-1===e||!t&&-1!==e)&&!this.isFinished();)r+=this.current(),this.forward(),e=n.indexOf(this.current());return r}return""},n.D=function(t){var n=this.currentStr().match(t);return n?(this.forwardN(n[0].length),n):null},n.isFinished=function(){return this.index>=this.len},n.forwardN=function(t){for(var n=0;n<t;n++)this.forward()},n.forward=function(){this.index++,"\n"===this.previous()?(this.lineno++,this.colno=0):this.colno++},n.backN=function(t){for(var n=0;n<t;n++)this.back()},n.back=function(){if(this.index--,"\n"===this.current()){this.lineno--;var t=this.src.lastIndexOf("\n",this.index-1);this.colno=-1===t?this.index:this.index-t}else this.colno--},n.current=function(){return this.isFinished()?"":this.str.charAt(this.index)},n.currentStr=function(){return this.isFinished()?"":this.str.substr(this.index)},n.previous=function(){return this.str.charAt(this.index-1)},t}();t.exports={lex:function(t,n){return new a(t,n)},TOKEN_STRING:"string",TOKEN_WHITESPACE:"whitespace",TOKEN_DATA:"data",TOKEN_BLOCK_START:"block-start",TOKEN_BLOCK_END:"block-end",TOKEN_VARIABLE_START:"variable-start",TOKEN_VARIABLE_END:"variable-end",TOKEN_COMMENT:"comment",TOKEN_LEFT_PAREN:"left-paren",TOKEN_RIGHT_PAREN:"right-paren",TOKEN_LEFT_BRACKET:"left-bracket",TOKEN_RIGHT_BRACKET:"right-bracket",TOKEN_LEFT_CURLY:"left-curly",TOKEN_RIGHT_CURLY:"right-curly",TOKEN_OPERATOR:"operator",TOKEN_COMMA:"comma",TOKEN_COLON:"colon",TOKEN_TILDE:"tilde",TOKEN_PIPE:"pipe",TOKEN_INT:"int",TOKEN_FLOAT:"float",TOKEN_BOOLEAN:"boolean",TOKEN_NONE:"none",TOKEN_SYMBOL:"symbol",TOKEN_SPECIAL:"special",TOKEN_REGEX:"regex"}},function(t,n,i){"use strict";var r=i(6),e=i(19).PrecompiledLoader,s=function(t){var n,i;function r(n,i){var r;return(r=t.call(this)||this).baseURL=n||".",i=i||{},r.useCache=!!i.useCache,r.async=!!i.async,r}i=t,(n=r).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i;var e=r.prototype;return e.resolve=function(t,n){throw Error("relative templates not support in the browser yet")},e.getSource=function(t,n){var i,r=this,e=this.useCache;return this.fetch(this.baseURL+"/"+t,function(s,o){if(s)if(n)n(s.content);else{if(404!==s.status)throw s.content;i=null}else i={src:o,path:t,noCache:!e},r.emit("load",t,i),n&&n(null,i)}),i},e.fetch=function(t,n){if("undefined"==typeof window)throw Error("WebLoader can only by used in a browser");var i=new XMLHttpRequest,r=!0;i.onreadystatechange=function(){4===i.readyState&&r&&(r=!1,0===i.status||200===i.status?n(null,i.responseText):n({status:i.status,content:i.responseText}))},t+=(-1===t.indexOf("?")?"?":"&")+"s="+(new Date).getTime(),i.open("GET",t,this.async),i.send()},r}(r);t.exports={WebLoader:s,PrecompiledLoader:e}},function(t,n,i){"use strict";var r,e=i(0),s=i(7),o=s.Environment,u=s.Template,h=i(6),f=i(10),c=i(23),a=i(5),l=i(8),v=i(9),p=i(2),d=i(3),m=i(25);function w(t,n){var i;return n=n||{},e.isObject(t)&&(n=t,t=null),f.FileSystemLoader?i=new f.FileSystemLoader(t,{watch:n.watch,noCache:n.noCache}):f.WebLoader&&(i=new f.WebLoader(t,{useCache:n.web&&n.web.useCache,async:n.web&&n.web.async})),r=new o(i,n),n&&n.express&&r.express(n.express),r}t.exports={Environment:o,Template:u,Loader:h,FileSystemLoader:f.FileSystemLoader,NodeResolveLoader:f.NodeResolveLoader,PrecompiledLoader:f.PrecompiledLoader,WebLoader:f.WebLoader,compiler:a,parser:l,lexer:v,runtime:p,lib:e,nodes:d,installJinjaCompat:m,configure:w,reset:function(){r=void 0},compile:function(t,n,i,e){return r||w(),new u(t,n,i,e)},render:function(t,n,i){return r||w(),r.render(t,n,i)},renderString:function(t,n,i){return r||w(),r.renderString(t,n,i)},precompile:c?c.precompile:void 0,precompileString:c?c.precompileString:void 0}},function(t,n,i){"use strict";var r=i(13),e=[],s=[],o=r.makeRequestCallFromTimer(function(){if(s.length)throw s.shift()});function u(t){var n;(n=e.length?e.pop():new h).task=t,r(n)}function h(){this.task=null}t.exports=u,h.prototype.call=function(){try{this.task.call()}catch(t){u.onerror?u.onerror(t):(s.push(t),o())}finally{this.task=null,e[e.length]=this}}},function(t,n,i){"use strict";!function(n){function i(t){e.length||(r(),!0),e[e.length]=t}t.exports=i;var r,e=[],s=0,o=1024;function u(){for(;s<e.length;){var t=s;if(s+=1,e[t].call(),s>o){for(var n=0,i=e.length-s;n<i;n++)e[n]=e[n+s];e.length-=s,s=0}}e.length=0,s=0,!1}var h,f,c,a=void 0!==n?n:self,l=a.MutationObserver||a.WebKitMutationObserver;function v(t){return function(){var n=setTimeout(r,0),i=setInterval(r,50);function r(){clearTimeout(n),clearInterval(i),t()}}}"function"==typeof l?(h=1,f=new l(u),c=document.createTextNode(""),f.observe(c,{characterData:!0}),r=function(){h=-h,c.data=h}):r=v(u),i.requestFlush=r,i.makeRequestCallFromTimer=v}(i(14))},function(t,n){var i;i=function(){return this}();try{i=i||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(i=window)}t.exports=i},function(t,n,i){var r;!function(i){"use strict";var e=function(){var t=Array.prototype.slice.call(arguments);"function"==typeof t[0]&&t[0].apply(null,t.splice(1))},s=function(t){"function"==typeof setImmediate?setImmediate(t):"undefined"!=typeof process&&process.nextTick?process.nextTick(t):setTimeout(t,0)},o=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},u=function(t,n,i){var r=i?s:e;if(n=n||function(){},!o(t))return n(Error("First argument to waterfall must be an array of functions"));if(!t.length)return n();var u=function(t){return function(i){if(i)n.apply(null,arguments),n=function(){};else{var e=Array.prototype.slice.call(arguments,1),s=t.next();s?e.push(u(s)):e.push(n),r(function(){t.apply(null,e)})}}};u(function(t){var n=function(i){var r=function(){return t.length&&t[i].apply(null,arguments),r.next()};return r.next=function(){return i<t.length-1?n(i+1):null},r};return n(0)}(t))()};void 0===(r=function(){return u}.apply(n,[]))||(t.exports=r)}()},function(t,n,i){"use strict";var r,e="object"==typeof Reflect?Reflect:null,s=e&&"function"==typeof e.apply?e.apply:function(t,n,i){return Function.prototype.apply.call(t,n,i)};r=e&&"function"==typeof e.ownKeys?e.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype.z=void 0,u.prototype.Y=0,u.prototype.q=void 0;var h=10;function f(t){return void 0===t.q?u.defaultMaxListeners:t.q}function c(t,n,i,r){var e,s,o;if("function"!=typeof i)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof i);if(void 0===(s=t.z)?(s=t.z=Object.create(null),t.Y=0):(void 0!==s.newListener&&(t.emit("newListener",n,i.listener?i.listener:i),s=t.z),o=s[n]),void 0===o)o=s[n]=i,++t.Y;else if("function"==typeof o?o=s[n]=r?[i,o]:[o,i]:r?o.unshift(i):o.push(i),(e=f(t))>0&&o.length>e&&!o.warned){o.warned=!0;var u=Error("Possible EventEmitter memory leak detected. "+o.length+" "+n+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=n,u.count=o.length,console&&console.warn&&console.warn(u)}return t}function a(t,n,i){var r={fired:!1,wrapFn:void 0,target:t,type:n,listener:i},e=function(){for(var t=[],n=0;n<arguments.length;n++)t.push(arguments[n]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,s(this.listener,this.target,t))}.bind(r);return e.listener=i,r.wrapFn=e,e}function l(t,n,i){var r=t.z;if(void 0===r)return[];var e=r[n];return void 0===e?[]:"function"==typeof e?i?[e.listener||e]:[e]:i?function(t){for(var n=Array(t.length),i=0;i<n.length;++i)n[i]=t[i].listener||t[i];return n}(e):p(e,e.length)}function v(t){var n=this.z;if(void 0!==n){var i=n[t];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function p(t,n){for(var i=Array(n),r=0;r<n;++r)i[r]=t[r];return i}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");h=t}}),u.init=function(){void 0!==this.z&&this.z!==Object.getPrototypeOf(this).z||(this.z=Object.create(null),this.Y=0),this.q=this.q||void 0},u.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this.q=t,this},u.prototype.getMaxListeners=function(){return f(this)},u.prototype.emit=function(t){for(var n=[],i=1;i<arguments.length;i++)n.push(arguments[i]);var r="error"===t,e=this.z;if(void 0!==e)r=r&&void 0===e.error;else if(!r)return!1;if(r){var o;if(n.length>0&&(o=n[0]),o instanceof Error)throw o;var u=Error("Unhandled error."+(o?" ("+o.message+")":""));throw u.context=o,u}var h=e[t];if(void 0===h)return!1;if("function"==typeof h)s(h,this,n);else{var f=h.length,c=p(h,f);for(i=0;i<f;++i)s(c[i],this,n)}return!0},u.prototype.addListener=function(t,n){return c(this,t,n,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(t,n){return c(this,t,n,!0)},u.prototype.once=function(t,n){if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);return this.on(t,a(this,t,n)),this},u.prototype.prependOnceListener=function(t,n){if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);return this.prependListener(t,a(this,t,n)),this},u.prototype.removeListener=function(t,n){var i,r,e,s,o;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(r=this.z))return this;if(void 0===(i=r[t]))return this;if(i===n||i.listener===n)0==--this.Y?this.z=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,i.listener||n));else if("function"!=typeof i){for(e=-1,s=i.length-1;s>=0;s--)if(i[s]===n||i[s].listener===n){o=i[s].listener,e=s;break}if(e<0)return this;0===e?i.shift():function(t,n){for(;n+1<t.length;n++)t[n]=t[n+1];t.pop()}(i,e),1===i.length&&(r[t]=i[0]),void 0!==r.removeListener&&this.emit("removeListener",t,o||n)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var n,i,r;if(void 0===(i=this.z))return this;if(void 0===i.removeListener)return 0===arguments.length?(this.z=Object.create(null),this.Y=0):void 0!==i[t]&&(0==--this.Y?this.z=Object.create(null):delete i[t]),this;if(0===arguments.length){var e,s=Object.keys(i);for(r=0;r<s.length;++r)"removeListener"!==(e=s[r])&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this.z=Object.create(null),this.Y=0,this}if("function"==typeof(n=i[t]))this.removeListener(t,n);else if(void 0!==n)for(r=n.length-1;r>=0;r--)this.removeListener(t,n[r]);return this},u.prototype.listeners=function(t){return l(this,t,!0)},u.prototype.rawListeners=function(t){return l(this,t,!1)},u.listenerCount=function(t,n){return"function"==typeof t.listenerCount?t.listenerCount(n):v.call(t,n)},u.prototype.listenerCount=v,u.prototype.eventNames=function(){return this.Y>0?r(this.z):[]}},function(t,n,i){"use strict";var r=i(3),e=i(0),s=0;function o(){return"hole_"+s++}function u(t,n){for(var i=null,r=0;r<t.length;r++){var e=n(t[r]);e!==t[r]&&(i||(i=t.slice()),i[r]=e)}return i||t}function h(t,n,i){if(!(t instanceof r.Node))return t;if(!i){var e=n(t);if(e&&e!==t)return e}if(t instanceof r.NodeList){var s=u(t.children,function(t){return h(t,n,i)});s!==t.children&&(t=new r[t.typename](t.lineno,t.colno,s))}else if(t instanceof r.CallExtension){var o=h(t.args,n,i),f=u(t.contentArgs,function(t){return h(t,n,i)});o===t.args&&f===t.contentArgs||(t=new r[t.typename](t.extName,t.prop,o,f))}else{var c=t.fields.map(function(n){return t[n]}),a=u(c,function(t){return h(t,n,i)});a!==c&&(t=new r[t.typename](t.lineno,t.colno),a.forEach(function(n,i){t[t.fields[i]]=n}))}return i&&n(t)||t}function f(t,n){return h(t,n,!0)}function c(t,n,i){var s=[],u=f(i?t[i]:t,function(t){var i;return t instanceof r.Block?t:((t instanceof r.Filter&&-1!==e.indexOf(n,t.name.value)||t instanceof r.CallExtensionAsync)&&(i=new r.Symbol(t.lineno,t.colno,o()),s.push(new r.FilterAsync(t.lineno,t.colno,t.name,t.args,i))),i)});return i?t[i]=u:t=u,s.length?(s.push(t),new r.NodeList(t.lineno,t.colno,s)):t}function a(t,n){return function(t){return f(t,function(t){if(t instanceof r.If||t instanceof r.For){var n=!1;if(h(t,function(t){if(t instanceof r.FilterAsync||t instanceof r.IfAsync||t instanceof r.AsyncEach||t instanceof r.AsyncAll||t instanceof r.CallExtensionAsync)return n=!0,t}),n){if(t instanceof r.If)return new r.IfAsync(t.lineno,t.colno,t.cond,t.body,t.else_);if(t instanceof r.For&&!(t instanceof r.AsyncAll))return new r.AsyncEach(t.lineno,t.colno,t.arr,t.name,t.body,t.else_)}}})}(function(t){return h(t,function(t){if(t instanceof r.Block){var n=!1,i=o();t.body=h(t.body,function(t){if(t instanceof r.FunCall&&"super"===t.name.value)return n=!0,new r.Symbol(t.lineno,t.colno,i)}),n&&t.body.children.unshift(new r.Super(0,0,t.name,new r.Symbol(0,0,i)))}})}(function(t,n){return f(t,function(t){return t instanceof r.Output?c(t,n):t instanceof r.Set?c(t,n,"value"):t instanceof r.For?c(t,n,"arr"):t instanceof r.If?c(t,n,"cond"):t instanceof r.CallExtension?c(t,n,"args"):void 0})}(t,n)))}t.exports={transform:function(t,n){return a(t,n||[])}}},function(t,n,i){"use strict";var r=i(0),e=i(2);function s(t,n){return null===t||void 0===t||!1===t?n:t}function o(t){return t!=t}function u(t){var n=(t=s(t,"")).toLowerCase();return e.copySafeness(t,n.charAt(0).toUpperCase()+n.slice(1))}function h(t){if(r.isString(t))return t.split("");if(r.isObject(t))return r.r(t||{}).map(function(t){return{key:t[0],value:t[1]}});if(r.isArray(t))return t;throw new r.TemplateError("list filter: type not iterable")}function f(t){return e.copySafeness(t,t.replace(/^\s*|\s*$/g,""))}(n=t.exports={}).abs=Math.abs,n.batch=function(t,n,i){var r,e=[],s=[];for(r=0;r<t.length;r++)r%n==0&&s.length&&(e.push(s),s=[]),s.push(t[r]);if(s.length){if(i)for(r=s.length;r<n;r++)s.push(i);e.push(s)}return e},n.capitalize=u,n.center=function(t,n){if(t=s(t,""),n=n||80,t.length>=n)return t;var i=n-t.length,o=r.repeat(" ",i/2-i%2),u=r.repeat(" ",i/2);return e.copySafeness(t,o+t+u)},n.default=function(t,n,i){return i?t||n:void 0!==t?t:n},n.dictsort=function(t,n,i){if(!r.isObject(t))throw new r.TemplateError("dictsort filter: val must be an object");var e,s=[];for(var o in t)s.push([o,t[o]]);if(void 0===i||"key"===i)e=0;else{if("value"!==i)throw new r.TemplateError("dictsort filter: You can only sort by either key or value");e=1}return s.sort(function(t,i){var s=t[e],o=i[e];return n||(r.isString(s)&&(s=s.toUpperCase()),r.isString(o)&&(o=o.toUpperCase())),s>o?1:s===o?0:-1}),s},n.dump=function(t,n){return JSON.stringify(t,null,n)},n.escape=function(t){return t instanceof e.SafeString?t:(t=null===t||void 0===t?"":t,e.markSafe(r.escape(t.toString())))},n.safe=function(t){return t instanceof e.SafeString?t:(t=null===t||void 0===t?"":t,e.markSafe(t.toString()))},n.first=function(t){return t[0]},n.forceescape=function(t){return t=null===t||void 0===t?"":t,e.markSafe(r.escape(t.toString()))},n.groupby=function(t,n){return r.groupBy(t,n)},n.indent=function(t,n,i){if(""===(t=s(t,"")))return"";n=n||4;var o=t.split("\n"),u=r.repeat(" ",n),h=o.map(function(t,n){return 0!==n||i?""+u+t+"\n":t+"\n"}).join("");return e.copySafeness(t,h)},n.join=function(t,n,i){return n=n||"",i&&(t=r.map(t,function(t){return t[i]})),t.join(n)},n.last=function(t){return t[t.length-1]},n.length=function(t){var n=s(t,"");return void 0!==n?"function"==typeof Map&&n instanceof Map||"function"==typeof Set&&n instanceof Set?n.size:!r.isObject(n)||n instanceof e.SafeString?n.length:r.keys(n).length:0},n.list=h,n.lower=function(t){return(t=s(t,"")).toLowerCase()},n.nl2br=function(t){return null===t||void 0===t?"":e.copySafeness(t,t.replace(/\r\n|\n/g,"<br />\n"))},n.random=function(t){return t[Math.floor(Math.random()*t.length)]},n.rejectattr=function(t,n){return t.filter(function(t){return!t[n]})},n.selectattr=function(t,n){return t.filter(function(t){return!!t[n]})},n.replace=function(t,n,i,r){var s=t;if(n instanceof RegExp)return t.replace(n,i);void 0===r&&(r=-1);var o="";if("number"==typeof n)n=""+n;else if("string"!=typeof n)return t;if("number"==typeof t&&(t=""+t),"string"!=typeof t&&!(t instanceof e.SafeString))return t;if(""===n)return o=i+t.split("").join(i)+i,e.copySafeness(t,o);var u=t.indexOf(n);if(0===r||-1===u)return t;for(var h=0,f=0;u>-1&&(-1===r||f<r);)o+=t.substring(h,u)+i,h=u+n.length,f++,u=t.indexOf(n,h);return h<t.length&&(o+=t.substring(h)),e.copySafeness(s,o)},n.reverse=function(t){var n;return(n=r.isString(t)?h(t):r.map(t,function(t){return t})).reverse(),r.isString(t)?e.copySafeness(t,n.join("")):n},n.round=function(t,n,i){var r=Math.pow(10,n=n||0);return("ceil"===i?Math.ceil:"floor"===i?Math.floor:Math.round)(t*r)/r},n.slice=function(t,n,i){for(var r=Math.floor(t.length/n),e=t.length%n,s=[],o=0,u=0;u<n;u++){var h=o+u*r;u<e&&o++;var f=o+(u+1)*r,c=t.slice(h,f);i&&u>=e&&c.push(i),s.push(c)}return s},n.sum=function(t,n,i){return void 0===i&&(i=0),n&&(t=r.map(t,function(t){return t[n]})),i+t.reduce(function(t,n){return t+n},0)},n.sort=e.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(t,n,i,e){var s=r.map(t,function(t){return t});return s.sort(function(t,s){var o=e?t[e]:t,u=e?s[e]:s;return!i&&r.isString(o)&&r.isString(u)&&(o=o.toLowerCase(),u=u.toLowerCase()),o<u?n?1:-1:o>u?n?-1:1:0}),s}),n.string=function(t){return e.copySafeness(t,t)},n.striptags=function(t,n){var i=f((t=s(t,"")).replace(/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,"")),r="";return r=n?i.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,"\n").replace(/\n\n\n+/g,"\n\n"):i.replace(/\s+/gi," "),e.copySafeness(t,r)},n.title=function(t){var n=(t=s(t,"")).split(" ").map(function(t){return u(t)});return e.copySafeness(t,n.join(" "))},n.trim=f,n.truncate=function(t,n,i,r){var o=t;if(t=s(t,""),n=n||255,t.length<=n)return t;if(i)t=t.substring(0,n);else{var u=t.lastIndexOf(" ",n);-1===u&&(u=n),t=t.substring(0,u)}return t+=void 0!==r&&null!==r?r:"...",e.copySafeness(o,t)},n.upper=function(t){return(t=s(t,"")).toUpperCase()},n.urlencode=function(t){var n=encodeURIComponent;return r.isString(t)?n(t):(r.isArray(t)?t:r.r(t)).map(function(t){var i=t[0],r=t[1];return n(i)+"="+n(r)}).join("&")};var c=/^(?:\(|<|<)?(.*?)(?:\.|,|\)|\n|>)?$/,a=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,l=/^https?:\/\/.*$/,v=/^www\./,p=/\.(?:org|net|com)(?:\:|\/|$)/;n.urlize=function(t,n,i){o(n)&&(n=1/0);var r=!0===i?' rel="nofollow"':"";return t.split(/(\s+)/).filter(function(t){return t&&t.length}).map(function(t){var i=t.match(c),e=i?i[1]:t,s=e.substr(0,n);return l.test(e)?'<a href="'+e+'"'+r+">"+s+"</a>":v.test(e)?'<a href="http://'+e+'"'+r+">"+s+"</a>":a.test(e)?'<a href="mailto:'+e+'">'+e+"</a>":p.test(e)?'<a href="http://'+e+'"'+r+">"+s+"</a>":t}).join("")},n.wordcount=function(t){var n=(t=s(t,""))?t.match(/\w+/g):null;return n?n.length:null},n.float=function(t,n){var i=parseFloat(t);return o(i)?n:i},n.int=function(t,n){var i=parseInt(t,10);return o(i)?n:i},n.d=n.default,n.e=n.escape},function(t,n,i){"use strict";var r=function(t){var n,i;function r(n){var i;return(i=t.call(this)||this).precompiled=n||{},i}return i=t,(n=r).prototype=Object.create(i.prototype),n.prototype.constructor=n,n.__proto__=i,r.prototype.getSource=function(t){return this.precompiled[t]?{src:{type:"code",obj:this.precompiled[t]},path:t}:null},r}(i(6));t.exports={PrecompiledLoader:r}},function(t,n,i){"use strict";var r=i(2).SafeString;n.callable=function(t){return"function"==typeof t},n.defined=function(t){return void 0!==t},n.divisibleby=function(t,n){return t%n==0},n.escaped=function(t){return t instanceof r},n.equalto=function(t,n){return t===n},n.eq=n.equalto,n.sameas=n.equalto,n.even=function(t){return t%2==0},n.falsy=function(t){return!t},n.ge=function(t,n){return t>=n},n.greaterthan=function(t,n){return t>n},n.gt=n.greaterthan,n.le=function(t,n){return t<=n},n.lessthan=function(t,n){return t<n},n.lt=n.lessthan,n.lower=function(t){return t.toLowerCase()===t},n.ne=function(t,n){return t!==n},n.null=function(t){return null===t},n.number=function(t){return"number"==typeof t},n.odd=function(t){return t%2==1},n.string=function(t){return"string"==typeof t},n.truthy=function(t){return!!t},n.undefined=function(t){return void 0===t},n.upper=function(t){return t.toUpperCase()===t},n.iterable=function(t){return"undefined"!=typeof Symbol?!!t[Symbol.iterator]:Array.isArray(t)||"string"==typeof t},n.mapping=function(t){var n=null!==t&&void 0!==t&&"object"==typeof t&&!Array.isArray(t);return Set?n&&!(t instanceof Set):n}},function(t,n,i){"use strict";t.exports=function(){return{range:function(t,n,i){void 0===n?(n=t,t=0,i=1):i||(i=1);var r=[];if(i>0)for(var e=t;e<n;e+=i)r.push(e);else for(var s=t;s>n;s+=i)r.push(s);return r},cycler:function(){return t=Array.prototype.slice.call(arguments),n=-1,{current:null,reset:function(){n=-1,this.current=null},next:function(){return++n>=t.length&&(n=0),this.current=t[n],this.current}};var t,n},joiner:function(t){return function(t){t=t||",";var n=!0;return function(){var i=n?"":t;return n=!1,i}}(t)}}}},function(t,n,i){var r=i(4);t.exports=function(t,n){function i(t,n){if(this.name=t,this.path=t,this.defaultEngine=n.defaultEngine,this.ext=r.extname(t),!this.ext&&!this.defaultEngine)throw Error("No default engine was specified and no extension was provided.");this.ext||(this.name+=this.ext=("."!==this.defaultEngine[0]?".":"")+this.defaultEngine)}return i.prototype.render=function(n,i){t.render(this.name,n,i)},n.set("view",i),n.set("nunjucksEnv",t),t}},function(t,n,i){"use strict";var r=i(4),e=i(4),s=i(0).t,o=i(5),u=i(7).Environment,h=i(24);function f(t,n){return!!Array.isArray(n)&&n.some(function(n){return t.match(n)})}function c(t,n){(n=n||{}).isString=!0;var i=n.env||new u([]),r=n.wrapper||h;if(!n.name)throw Error('the "name" option is required when compiling a string');return r([a(t,n.name,i)],n)}function a(t,n,i){var r,e=(i=i||new u([])).asyncFilters,h=i.extensionsList;n=n.replace(/\\/g,"/");try{r=o.compile(t,e,h,n,i.opts)}catch(t){throw s(n,!1,t)}return{name:n,template:r}}t.exports={precompile:function(t,n){var i=(n=n||{}).env||new u([]),s=n.wrapper||h;if(n.isString)return c(t,n);var o=r.existsSync(t)&&r.statSync(t),l=[],v=[];if(o.isFile())l.push(a(r.readFileSync(t,"utf-8"),n.name||t,i));else if(o.isDirectory()){!function i(s){r.readdirSync(s).forEach(function(o){var u=e.join(s,o),h=u.substr(e.join(t,"/").length),c=r.statSync(u);c&&c.isDirectory()?f(h+="/",n.exclude)||i(u):f(h,n.include)&&v.push(u)})}(t);for(var p=0;p<v.length;p++){var d=v[p].replace(e.join(t,"/"),"");try{l.push(a(r.readFileSync(v[p],"utf-8"),d,i))}catch(t){if(!n.force)throw t;console.error(t)}}}return s(l,n)},precompileString:c}},function(t,n,i){"use strict";t.exports=function(t,n){var i="";n=n||{};for(var r=0;r<t.length;r++){var e=JSON.stringify(t[r].name);i+="(function() {(window.nunjucksPrecompiled = window.nunjucksPrecompiled || {})["+e+"] = (function() {\n"+t[r].template+"\n})();\n",n.asFunction&&(i+="return function(ctx, cb) { return nunjucks.render("+e+", ctx, cb); }\n"),i+="})();\n"}return i}},function(t,n,i){t.exports=function(){"use strict";var t,n,i=this.runtime,r=this.lib,e=this.compiler.Compiler,s=this.parser.Parser,o=this.nodes,u=this.lexer,h=i.contextOrFrameLookup,f=i.memberLookup;function c(t){return{index:t.index,lineno:t.lineno,colno:t.colno}}if(e&&(t=e.prototype.assertType),s&&(n=s.prototype.parseAggregate),i.contextOrFrameLookup=function(t,n,i){var r=h.apply(this,arguments);if(void 0!==r)return r;switch(i){case"True":return!0;case"False":return!1;case"None":return null;default:return}},o&&e&&s){var a=o.Node.extend("Slice",{fields:["start","stop","step"],init:function(t,n,i,r,e){i=i||new o.Literal(t,n,null),r=r||new o.Literal(t,n,null),e=e||new o.Literal(t,n,1),this.parent(t,n,i,r,e)}});e.prototype.assertType=function(n){n instanceof a||t.apply(this,arguments)},e.prototype.compileSlice=function(t,n){this.w("("),this.L(t.start,n),this.w("),("),this.L(t.stop,n),this.w("),("),this.L(t.step,n),this.w(")")},s.prototype.parseAggregate=function(){var t=this,i=c(this.tokens);i.colno--,i.index--;try{return n.apply(this)}catch(n){var e=c(this.tokens),s=function(){return r.h(t.tokens,e),n};r.h(this.tokens,i),this.peeked=!1;var h=this.peekToken();if(h.type!==u.TOKEN_LEFT_BRACKET)throw s();this.nextToken();for(var f=new a(h.lineno,h.colno),l=!1,v=0;v<=f.fields.length&&!this.skip(u.TOKEN_RIGHT_BRACKET);v++){if(v===f.fields.length){if(!l)break;this.fail("parseSlice: too many slice components",h.lineno,h.colno)}this.skip(u.TOKEN_COLON)?l=!0:(f[f.fields[v]]=this.parseExpression(),l=this.skip(u.TOKEN_COLON)||l)}if(!l)throw s();return new o.Array(h.lineno,h.colno,[f])}}}function l(t,n){return Object.prototype.hasOwnProperty.call(t,n)}var v={pop:function(t){if(void 0===t)return this.pop();if(t>=this.length||t<0)throw Error("KeyError");return this.splice(t,1)},append:function(t){return this.push(t)},remove:function(t){for(var n=0;n<this.length;n++)if(this[n]===t)return this.splice(n,1);throw Error("ValueError")},count:function(t){for(var n=0,i=0;i<this.length;i++)this[i]===t&&n++;return n},index:function(t){var n;if(-1===(n=this.indexOf(t)))throw Error("ValueError");return n},find:function(t){return this.indexOf(t)},insert:function(t,n){return this.splice(t,0,n)}},p={items:function(){return r.r(this)},values:function(){return r.u(this)},keys:function(){return r.keys(this)},get:function(t,n){var i=this[t];return void 0===i&&(i=n),i},has_key:function(t){return l(this,t)},pop:function(t,n){var i=this[t];if(void 0===i&&void 0!==n)i=n;else{if(void 0===i)throw Error("KeyError");delete this[t]}return i},popitem:function(){var t=r.keys(this);if(!t.length)throw Error("KeyError");var n=t[0],i=this[n];return delete this[n],[n,i]},setdefault:function(t,n){return void 0===n&&(n=null),t in this||(this[t]=n),this[t]},update:function(t){return r.h(this,t),null}};return p.iteritems=p.items,p.itervalues=p.values,p.iterkeys=p.keys,i.memberLookup=function(t,n,e){return 4===arguments.length?function(t,n,r,e){t=t||[],null===n&&(n=e<0?t.length-1:0),null===r?r=e<0?-1:t.length:r<0&&(r+=t.length),n<0&&(n+=t.length);for(var s=[],o=n;!(o<0||o>t.length||e>0&&o>=r||e<0&&o<=r);o+=e)s.push(i.memberLookup(t,o));return s}.apply(this,arguments):(t=t||{},r.isArray(t)&&l(v,n)?v[n].bind(t):r.isObject(t)&&l(p,n)?p[n].bind(t):f.apply(this,arguments))},function(){i.contextOrFrameLookup=h,i.memberLookup=f,e&&(e.prototype.assertType=t),s&&(s.prototype.parseAggregate=n)}}}])});
|
||
//# sourceMappingURL=nunjucks.min.js.map
|