text: /*! Swig v1.0.0-rc1 | https://paularmstrong.github.com/swig | @license https://github.com/paularmstrong/swig/blob/master/LICENSE */
  /*! DateZ (c) 2011 Tomo Universalis | @license https://github.com/TomoUniversalis/DateZ/blob/master/LISENCE */
  !function(e,t,n){function r(n,i){if(!t[n]){if(!e[n]){var a="function"==typeof require&&require;if(!i&&a)return a(n,!0);if(o)return o(n,!0);throw new Error("Cannot find module '"+n+"'")}var s=t[n]={exports:{}};e[n][0].call(s.exports,function(t){var o=e[n][1][t];return r(o?o:t)},s,s.exports)}return t[n].exports}for(var o="function"==typeof require&&require,i=0;i<n.length;i++)r(n[i]);return r}({1:[function(e){var t=e("../lib/swig");"function"==typeof window.define&&"object"==typeof window.define.amd?window.define("swig",[],function(){return t}):window.swig=t},{"../lib/swig":6}],2:[function(e,t,n){var r=e("./utils"),o={full:["January","February","March","April","May","June","July","August","September","October","November","December"],abbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},i={full:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],abbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],alt:{"-1":"Yesterday",0:"Today",1:"Tomorrow"}};n.defaultTZOffset=0,n.DateZ=function(){var e={"default":["getUTCDate","getUTCDay","getUTCFullYear","getUTCHours","getUTCMilliseconds","getUTCMinutes","getUTCMonth","getUTCSeconds","toISOString","toGMTString","toUTCString","valueOf","getTime"],z:["getDate","getDay","getFullYear","getHours","getMilliseconds","getMinutes","getMonth","getSeconds","getYear","toDateString","toLocaleDateString","toLocaleTimeString"]},t=this;t.date=t.dateZ=arguments.length>1?new Date(Date.UTC.apply(Date,arguments)+6e4*(new Date).getTimezoneOffset()):1===arguments.length?new Date(new Date(arguments["0"])):new Date,t.timezoneOffset=t.dateZ.getTimezoneOffset(),r.each(e.z,function(e){t[e]=function(){return t.dateZ[e]()}}),r.each(e["default"],function(e){t[e]=function(){return t.date[e]()}}),this.setTimezoneOffset(n.defaultTZOffset)},n.DateZ.prototype={getTimezoneOffset:function(){return this.timezoneOffset},setTimezoneOffset:function(e){return this.timezoneOffset=e,this.dateZ=new Date(this.date.getTime()+6e4*this.date.getTimezoneOffset()-6e4*this.timezoneOffset),this}},n.d=function(e){return(e.getDate()<10?"0":"")+e.getDate()},n.D=function(e){return i.abbr[e.getDay()]},n.j=function(e){return e.getDate()},n.l=function(e){return i.full[e.getDay()]},n.N=function(e){var t=e.getDay();return t>=1?t+1:7},n.S=function(e){var t=e.getDate();return 1===t%10&&11!==t?"st":2===t%10&&12!==t?"nd":3===t%10&&13!==t?"rd":"th"},n.w=function(e){return e.getDay()},n.z=function(e,t,r){var o=e.getFullYear(),i=new n.DateZ(o,e.getMonth(),e.getDate(),12,0,0),a=new n.DateZ(o,0,1,12,0,0);return i.setTimezoneOffset(t,r),a.setTimezoneOffset(t,r),Math.round((i-a)/864e5)},n.W=function(e){var t,n=new Date(e.valueOf()),r=(e.getDay()+6)%7;return n.setDate(n.getDate()-r+3),t=n.valueOf(),n.setMonth(0,1),4!==n.getDay()&&n.setMonth(0,1+(4-n.getDay()+7)%7),1+Math.ceil((t-n)/6048e5)},n.F=function(e){return o.full[e.getMonth()]},n.m=function(e){return(e.getMonth()<9?"0":"")+(e.getMonth()+1)},n.M=function(e){return o.abbr[e.getMonth()]},n.n=function(e){return e.getMonth()+1},n.t=function(e){return 32-new Date(e.getFullYear(),e.getMonth(),32).getDate()},n.L=function(e){return 29===new Date(e.getFullYear(),1,29).getDate()},n.o=function(e){var t=new Date(e.valueOf());return t.setDate(t.getDate()-(e.getDay()+6)%7+3),t.getFullYear()},n.Y=function(e){return e.getFullYear()},n.y=function(e){return e.getFullYear().toString().substr(2)},n.a=function(e){return e.getHours()<12?"am":"pm"},n.A=function(e){return e.getHours()<12?"AM":"PM"},n.B=function(e){var t,n=e.getUTCHours();return n=23===n?0:n+1,t=Math.abs((60*(60*n+e.getUTCMinutes())+e.getUTCSeconds())/86.4).toFixed(0),"000".concat(t).slice(t.length)},n.g=function(e){var t=e.getHours();return 0===t?12:t>12?t-12:t},n.G=function(e){return e.getHours()},n.h=function(e){var t=e.getHours();return(10>t||t>12&&22>t?"0":"")+(12>t?t:t-12)},n.H=function(e){var t=e.getHours();return(10>t?"0":"")+t},n.i=function(e){var t=e.getMinutes();return(10>t?"0":"")+t},n.s=function(e){var t=e.getSeconds();return(10>t?"0":"")+t},n.O=function(e){var t=e.getTimezoneOffset();return(0>t?"-":"+")+(10>t/60?"0":"")+Math.abs(t/60)+"00"},n.Z=function(e){return 60*e.getTimezoneOffset()},n.c=function(e){return e.toISOString()},n.r=function(e){return e.toUTCString()},n.U=function(e){return e.getTime()/1e3}},{"./utils":23}],3:[function(e,t,n){!function(){var t=e("./utils"),r=e("./dateformatter");n.addslashes=function(e){return"object"==typeof e?(t.each(e,function(t,r){e[r]=n.addslashes(t)}),e):e.replace(/\\/g,"\\\\").replace(/\'/g,"\\'").replace(/\"/g,'\\"')},n.capitalize=function(e){return"object"==typeof e?(t.each(e,function(t,r){e[r]=n.capitalize(t)}),e):e.toString().charAt(0).toUpperCase()+e.toString().substr(1).toLowerCase()},n.date=function(e,t,n,o){var i,a=t.length,s=new r.DateZ(e),u=0,c="";for(n&&s.setTimezoneOffset(n,o),u;a>u;u+=1)i=t.charAt(u),c+=r.hasOwnProperty(i)?r[i](s,n,o):i;return c},n.default=function(e,t){return"undefined"==typeof e||!e&&"number"!=typeof e?t:e},n.escape=function(e,r){if("object"==typeof e)return t.each(e,function(t,r){e[r]=n.escape(t)}),e;if("string"!=typeof e)return e;var o,i=0,a="";switch(r){case"js":for(e=e.replace(/\\/g,"\\u005C"),i;i<e.length;i+=1)o=e.charCodeAt(i),32>o?(o=o.toString(16).toUpperCase(),o=o.length<2?"0"+o:o,a+="\\u00"+o):a+=e[i];return a.replace(/&/g,"\\u0026").replace(/</g,"\\u003C").replace(/>/g,"\\u003E").replace(/\'/g,"\\u0027").replace(/"/g,"\\u0022").replace(/\=/g,"\\u003D").replace(/-/g,"\\u002D").replace(/;/g,"\\u003B");default:return e.replace(/&(?!amp;|lt;|gt;|quot;|#39;)/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}},n.e=n.escape,n.first=function(e){if("object"==typeof e&&!t.isArray(e)){var n=t.keys(e);return e[n[0]]}return"string"==typeof e?e.substr(0,1):e[0]},n.join=function(e,n){if(t.isArray(e))return e.join(n);if("object"==typeof e){var r=[];return t.each(e,function(e){r.push(e)}),r.join(n)}return e},n.json=function(e,t){return JSON.stringify(e,null,t||0)},n.json_encode=n.json,n.last=function(e){if("object"==typeof e&&!t.isArray(e)){var n=t.keys(e);return e[n[n.length-1]]}return"string"==typeof e?e.charAt(e.length-1):e[e.length-1]},n.lower=function(e){return"object"==typeof e?(t.each(e,function(t,r){e[r]=n.lower(t)}),e):e.toString().toLowerCase()},n.raw=function(e){return n.safe(e)},n.raw.safe=!0,n.replace=function(e,t,n,r){var o=new RegExp(t,r);return e.replace(o,n)},n.reverse=function(e){return n.sort(e,!0)},n.safe=function(e){return e},n.safe.safe=!0,n.sort=function(e,n){var r;if(t.isArray(e))r=e.sort();else switch(typeof e){case"object":r=t.keys(e).sort();break;case"string":return r=e.split(""),n?r.reverse().join(""):r.sort().join("")}return r&&n?r.reverse():r||e},n.striptags=function(e){return"object"==typeof e?(t.each(e,function(t,r){e[r]=n.striptags(t)}),e):e.toString().replace(/(<([^>]+)>)/gi,"")},n.title=function(e){return"object"==typeof e?(t.each(e,function(t,r){e[r]=n.title(t)}),e):e.toString().replace(/\w\S*/g,function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()})},n.uniq=function(e){var n;return e&&t.isArray(e)?(n=[],t.each(e,function(e){-1===n.indexOf(e)&&n.push(e)}),n):""},n.upper=function(e){return"object"==typeof e?(t.each(e,function(t,r){e[r]=n.upper(t)}),e):e.toString().toUpperCase()},n.url_encode=function(e){return"object"==typeof e?(t.each(e,function(t,r){e[r]=n.url_encode(t)}),e):encodeURIComponent(e)},n.url_decode=function(e){return"object"==typeof e?(t.each(e,function(t,r){e[r]=n.url_decode(t)}),e):decodeURIComponent(e)}}()},{"./dateformatter":2,"./utils":23}],4:[function(e,t,n){function r(e){var t;return o.some(a,function(n){return o.some(n.regex,function(r){var o,i=e.match(r);if(i)return o=i[n.idx||0].replace(/\s*$/,""),o=n.hasOwnProperty("replace")&&n.replace.hasOwnProperty(o)?n.replace[o]:o,t={match:o,type:n.type,length:i[0].length},!0})}),t||(t={match:e,type:i.UNKNOWN,length:e.length}),t}var o=e("./utils"),i={WHITESPACE:0,STRING:1,FILTER:2,FILTEREMPTY:3,FUNCTION:4,FUNCTIONEMPTY:5,PARENOPEN:6,PARENCLOSE:7,COMMA:8,VAR:9,NUMBER:10,OPERATOR:11,BRACKETOPEN:12,BRACKETCLOSE:13,DOTKEY:14,ARRAYOPEN:15,CURLYOPEN:17,CURLYCLOSE:18,COLON:19,COMPARATOR:20,LOGIC:21,NOT:22,BOOL:23,ASSIGNMENT:24,METHODOPEN:25,UNKNOWN:100},a=[{type:i.WHITESPACE,regex:[/^\s+/]},{type:i.STRING,regex:[/^""/,/^".*?[^\\]"/,/^''/,/^'.*?[^\\]'/]},{type:i.FILTER,regex:[/^\|\s*(\w+)\(/],idx:1},{type:i.FILTEREMPTY,regex:[/^\|\s*(\w+)/],idx:1},{type:i.FUNCTIONEMPTY,regex:[/^\s*(\w+)\(\)/],idx:1},{type:i.FUNCTION,regex:[/^\s*(\w+)\(/],idx:1},{type:i.PARENOPEN,regex:[/^\(/]},{type:i.PARENCLOSE,regex:[/^\)/]},{type:i.COMMA,regex:[/^,/]},{type:i.LOGIC,regex:[/^(&&|\|\||and|or)\s*/],idx:1,replace:{and:"&&",or:"||"}},{type:i.COMPARATOR,regex:[/^(===|==|\!==|\!=|<=|<|>=|>|in\s|gte\s|gt\s|lte\s|lt\s)\s*/],idx:1,replace:{gte:">=",gt:">",lte:"<=",lt:"<"}},{type:i.ASSIGNMENT,regex:[/^(=|\+=|-=|\*=|\/=)/]},{type:i.NOT,regex:[/^(not|\!)\s*/],idx:1,replace:{not:"!"}},{type:i.BOOL,regex:[/^(true|false)/]},{type:i.VAR,regex:[/^[a-zA-Z_$]\w*((\.\w*)+)?/,/^[a-zA-Z_$]\w*/]},{type:i.BRACKETOPEN,regex:[/^\[/]},{type:i.BRACKETCLOSE,regex:[/^\]/]},{type:i.CURLYOPEN,regex:[/^\{/]},{type:i.COLON,regex:[/^\:/]},{type:i.CURLYCLOSE,regex:[/^\}/]},{type:i.DOTKEY,regex:[/^\.(\w+)/],idx:1},{type:i.NUMBER,regex:[/^[+\-]?\d+(\.\d+)?/]},{type:i.OPERATOR,regex:[/^(\+|\-|\/|\*|%)/]}];n.types=i,n.read=function(e){for(var t,n,o=0,i=[];o<e.length;)t=e.substring(o),n=r(t),o+=n.length,i.push(n);return i}},{"./utils":23}],5:[function(e,t,n){!function(){function t(e){return e.replace(/[\-\/\\\^$*+?.()|\[\]{}]/g,"\\$&")}function r(e,t,n,r,i,s){this.out=[],this.state=[],this.filterApplyIdx=[],this._parsers={},this.line=i,this.filename=s,this.filters=t,this.macros=n,this.escape=r,this.parse=function(){var t=this;return t._parsers.start&&t._parsers.start.call(t),o.each(e,function(n,r){var o=e[r-1];if(t.isLast=r===e.length-1,o)for(;o.type===a.WHITESPACE;)r-=1,o=e[r-1];t.prevToken=o,t.parseToken(n)}),t._parsers.end&&t._parsers.end.call(t),t.escape&&(t.filterApplyIdx=[0],"string"==typeof t.escape?(t.parseToken({type:a.FILTER,match:"e"}),t.parseToken({type:a.COMMA,match:","}),t.parseToken({type:a.STRING,match:String(r)}),t.parseToken({type:a.PARENCLOSE,match:")"})):t.parseToken({type:a.FILTEREMPTY,match:"e"})),t.out}}var o=e("./utils"),i=e("./lexer"),a=i.types,s=["break","case","catch","continue","debugger","default","delete","do","else","finally","for","function","if","in","instanceof","new","return","switch","this","throw","try","typeof","var","void","while","with"];r.prototype={on:function(e,t){this._parsers[e]=t},parseToken:function(e){var t,n=this,r=n._parsers[e.type]||n._parsers["*"],i=e.match,s=n.prevToken,u=n.state.length?n.state[n.state.length-1]:null;if(!r||"function"!=typeof r||r.call(this,e))switch(u&&s&&u===a.FILTER&&s.type===a.FILTER&&e.type!==a.PARENCLOSE&&e.type!==a.COMMA&&e.type!==a.OPERATOR&&e.type!==a.FILTER&&e.type!==a.FILTEREMPTY&&n.out.push(", "),u&&u===a.METHODOPEN&&(n.state.pop(),e.type!==a.PARENCLOSE&&n.out.push(", ")),e.type){case a.WHITESPACE:break;case a.STRING:n.filterApplyIdx.push(n.out.length),n.out.push(i.replace(/\\/g,"\\\\"));break;case a.NUMBER:n.filterApplyIdx.push(n.out.length),n.out.push(i);break;case a.FILTER:n.filters.hasOwnProperty(i)&&"function"==typeof n.filters[i]||o.throwError('Invalid filter "'+i+'"',n.line,n.filename),n.escape=n.filters[i].safe?!1:n.escape,t=n.filterApplyIdx.pop(),n.out.splice(t,0,'_filters["'+i+'"]('),n.state.push(e.type),n.filterApplyIdx.push(t);break;case a.FILTEREMPTY:n.filters.hasOwnProperty(i)&&"function"==typeof n.filters[i]||o.throwError('Invalid filter "'+i+'"',n.line,n.filename),n.escape=n.filters[i].safe?!1:n.escape,n.out.splice(n.filterApplyIdx[n.filterApplyIdx.length-1],0,'_filters["'+i+'"]('),n.out.push(")");break;case a.FUNCTION:case a.FUNCTIONEMPTY:n.out.push("((typeof "+i+' !== "undefined") ? '+i+" : ((typeof _ctx."+i+' !== "undefined") ? _ctx.'+i+" : _fn))("),-1!==n.macros.indexOf(i)&&(n.escape=!1),e.type===a.FUNCTIONEMPTY?n.out[n.out.length-1]=n.out[n.out.length-1]+")":n.state.push(e.type),n.filterApplyIdx.push(n.out.length-1);break;case a.PARENOPEN:n.state.push(e.type),n.filterApplyIdx.length?(n.out.splice(n.filterApplyIdx[n.filterApplyIdx.length-1],0,"("),s&&s.type===a.VAR?(t=s.match.split(".").slice(0,-1),n.out.push(" || _fn).call("+n.checkMatch(t)),n.state.push(a.METHODOPEN),-1!==n.macros.indexOf(s.match)&&(n.escape=!1)):n.out.push(" || _fn)(")):n.out.push("("),n.filterApplyIdx.push(n.out.length-1);break;case a.PARENCLOSE:t=n.state.pop(),t!==a.PARENOPEN&&t!==a.FUNCTION&&t!==a.FILTER&&o.throwError("Mismatched nesting state",n.line,n.filename),n.out.push(")"),n.filterApplyIdx.pop();break;case a.COMMA:u!==a.FUNCTION&&u!==a.FILTER&&u!==a.ARRAYOPEN&&u!==a.CURLYOPEN&&u!==a.PARENOPEN&&o.throwError("Unexpected comma",n.line,n.filename),n.out.push(", "),n.filterApplyIdx.pop();break;case a.VAR:n.parseVar(e,i,u,s);break;case a.BRACKETOPEN:!s||s.type!==a.VAR&&s.type!==a.BRACKETCLOSE&&s.type!==a.PARENCLOSE?(n.state.push(a.ARRAYOPEN),n.filterApplyIdx.push(n.out.length)):n.state.push(e.type),n.out.push("[");break;case a.BRACKETCLOSE:t=n.state.pop(),t!==a.BRACKETOPEN&&t!==a.ARRAYOPEN&&o.throwError("Unexpected closing square bracket",n.line,n.filename),n.out.push("]"),n.filterApplyIdx.pop();break;case a.CURLYOPEN:n.state.push(e.type),n.out.push("{"),n.filterApplyIdx.push(n.out.length-1);break;case a.COLON:u!==a.CURLYOPEN&&o.throwError("Unexpected colon",n.line,n.filename),n.out.push(":"),n.filterApplyIdx.pop();break;case a.CURLYCLOSE:n.state.pop()!==a.CURLYOPEN&&o.throwError("Unexpected closing curly brace",n.line,n.filename),n.out.push("}"),n.filterApplyIdx.pop();break;case a.DOTKEY:(!s||s.type!==a.VAR&&s.type!==a.BRACKETCLOSE&&s.type!==a.DOTKEY)&&o.throwError('Unexpected key "'+i+'"',n.line,n.filename),n.out.push("."+i);break;case a.OPERATOR:n.out.push(" "+i+" "),n.filterApplyIdx.pop()}},parseVar:function(e,t,n){var r=this;return t=t.split("."),-1!==s.indexOf(t[0])&&o.throwError('Reserved keyword "'+t[0]+'" attempted to be used as a variable',r.line,r.filename),r.filterApplyIdx.push(r.out.length),n===a.CURLYOPEN?(t.length>1&&o.throwError("Unexpected dot",r.line,r.filename),r.out.push(t[0]),void 0):(r.out.push(r.checkMatch(t)),void 0)},checkMatch:function(e){function t(t){var n=t+r,i=e,a="";return a="(typeof "+n+' !== "undefined"',o.each(i,function(e,t){0!==t&&(a+=' && "'+e+'" in '+n,n+="."+e)}),a+=")"}function n(n){return"("+t(n)+" ? "+n+e.join(".")+' : "")'}var r=e[0];return"("+t("")+" ? "+n("")+" : "+n("_ctx.")+")"}},n.parse=function(e,s,u,c){function l(e,t){var n,a,u=i.read(o.strip(e));return n=new r(u,c,D,g,t,s.filename),a=n.parse().join(""),n.state.length&&o.throwError('Unable to parse "'+e+'"',t,s.filename),{compile:function(){return"_output += "+a+";\n"}}}function f(e,t){var n,l,f,p,h,d,m;if(o.startsWith(e,"end")){if(m=S[S.length-1],m&&m.name===e.split(/\s+/)[0].replace(/^end/,"")&&m.ends){switch(m.name){case"autoescape":g=s.autoescape;break;case"raw":j=!1}return S.pop(),void 0}j||o.throwError('Unexpected end of tag "'+e.replace(/^end/,"")+'"',t,s.filename)}if(!j){switch(f=e.split(/\s+(.+)?/),p=f.shift(),u.hasOwnProperty(p)||o.throwError('Unexpected tag "'+e+'"',t,s.filename),n=i.read(o.strip(f.join(" "))),l=new r(n,c,D,!1,t,s.filename),h=u[p],h.parse(f[1],t,l,a,S,s)||o.throwError('Unexpected tag "'+p+'"',t,s.filename),l.parse(),d=l.out,p){case"autoescape":g="false"!==d[0]?d[0]:!1;break;case"raw":j=!0}return{block:!!u[p].block,compile:h.compile,args:d,content:[],ends:h.ends,name:p}}}function p(e){return"string"==typeof e&&(e=e.replace(/\s*$/,"")),e}e=e.replace(/\r\n/g,"\n");var h,g=s.autoescape,d=s.tagControls[0],m=s.tagControls[1],y=s.varControls[0],w=s.varControls[1],v=t(d),E=t(m),O=t(y),x=t(w),T=new RegExp("^"+v+"-?\\s*-?|-?\\s*-?"+E+"$","g"),A=new RegExp("^"+v+"-"),C=new RegExp("-"+E+"$"),b=new RegExp("^"+O+"-?\\s*-?|-?\\s*-?"+x+"$","g"),R=new RegExp("^"+O+"-"),N=new RegExp("-"+x+"$"),k=s.cmtControls[0],U=s.cmtControls[1],I="[\\s\\S]*?",_=new RegExp("("+v+I+E+"|"+O+I+x+"|"+t(k)+I+t(U)+")"),P=1,S=[],M=null,F=[],L={},D=[],j=!1;return n.parseVariable=l,o.each(e.split(_),function(e){var t,n,r,i,a;if(e){if(!j&&o.startsWith(e,y)&&o.endsWith(e,w))r=R.test(e),h=N.test(e),t=l(e.replace(b,""),P);else if(o.startsWith(e,d)&&o.endsWith(e,m))r=A.test(e),h=C.test(e),t=f(e.replace(T,""),P),t&&("extends"===t.name&&(M=t.args.join("").replace(/^\'|\'$/g,"").replace(/^\"|\"$/g,"")),!t.block||S.length&&"block"!==t.name||(L[t.args.join("")]=t),"macro"===t.name&&D.push(t.args[0])),j&&!t&&(t=e);else if(j||!o.startsWith(e,k)&&!o.endsWith(e,U))t=h?e.replace(/^\s*/,""):e,h=!1;else if(o.startsWith(e,k)&&o.endsWith(e,U))return;r&&F.length&&(i=F.pop(),"string"==typeof i?i=p(i):i.content&&i.content.length&&(a=p(i.content.pop()),i.content.push(a)),F.push(i)),t&&(S.length?S[S.length-1].content.push(t):F.push(t),t.name&&t.ends&&S.push(t),n=e.match(/\n/g),P+=n?n.length:0)}}),{name:s.filename,parent:M,tokens:F,blocks:L}},n.compile=function(e,t,r,i){var a="",s=o.isArray(e)?e:e.tokens;return o.each(s,function(e){var o;return"string"==typeof e?(a+='_output += "'+e.replace(/\\/g,"\\\\").replace(/\n|\r/g,"\\n").replace(/"/g,'\\"')+'";\n',void 0):(o=e.compile(n.compile,e.args?e.args.slice(0):[],e.content?e.content.slice(0):[],t,r,i),a+=o||"",void 0)}),a}}()},{"./lexer":4,"./utils":23}],6:[function(e,t,n){!function(){function t(){return""}function r(e){if(e&&(a.each(["varControls","tagControls","cmtControls"],function(t){if(e.hasOwnProperty(t)){if(!a.isArray(e[t])||2!==e[t].length)throw new Error('Option "'+t+'" must be an array containing 2 different control strings.');if(e[t][0]===e[t][1])throw new Error('Option "'+t+'" open and close controls must not be the same.');a.each(e[t],function(e,n){if(e.length<2)throw new Error('Option "'+t+'" '+(n?"open ":"close ")+'control must be at least 2 characters. Saw "'+e+'" instead.')})}}),e.hasOwnProperty("cache")&&e.cache&&"memory"!==e.cache&&(!e.cache.get||!e.cache.set)))throw new Error("Invalid cache option "+JSON.stringify(e.cache)+' found. Expected "memory" or { get: function (key) { ... }, set: function (key, value) { ... } }.')}var o=e("fs"),i=e("path"),a=e("./utils"),s=e("./tags"),u=e("./filters"),c=e("./parser"),l=e("./dateformatter");n.version="1.0.0-rc1";var f,p={autoescape:!0,varControls:["{{","}}"],tagControls:["{%","%}"],cmtControls:["{#","#}"],locals:{},cache:"memory"};n.setDefaults=function(e){r(e);var t=a.extend({},p.locals,e.locals||{});a.extend(p,e),p.locals=t,f.options=a.extend(f.options,e)},n.setDefaultTZOffset=function(e){l.tzOffset=e},n.Swig=function(e){function l(e){return e&&e.locals?a.extend({},m.options.locals,e.locals):m.options.locals}function f(e){return m.options.cache?"memory"===m.options.cache?m.cache[e]:m.options.cache.get(e):void 0}function h(e,t){return m.options.cache?"memory"===m.options.cache?(m.cache[e]=t,void 0):(m.options.cache.set(e,t),void 0):void 0}function g(e,t){return a.each(e,function(e){"block"!==e.name&&t.unshift(e)}),a.map(t,function(t){var n=t.args?t.args.join(""):"";return"block"===t.name&&e[n]&&(t=e[n]),t.content&&t.content.length&&(t.content=g(e,t.content)),t})}function d(e,t){for(var n,r,o,s=e.parent,u=[],c=[];s;){if(!t||!t.filename)throw new Error('Cannot extend "'+s+'" because current template has no filename.');if(n=n||t.filename,n=i.resolve(i.dirname(n),s),r=m.parseFile(n,a.extend({},t,{filename:n})),s=r.parent,-1!==u.indexOf(n))throw new Error('Illegal circular extends of "'+n+'".');u.push(n),c.push(r)}for(o=c.length,o=c.length-2;o>=0;o-=1)c[o].tokens=g(c[o].blocks,c[o+1].tokens);return c}r(e),this.options=a.extend({},p,e||{}),this.cache={},this.extensions={};var m=this,y=s,w=u;this.invalidateCache=function(){"memory"===m.options.cache&&(m.cache={})},this.setFilter=function(e,t){if("function"!=typeof t)throw new Error('Filter "'+e+'" is not a valid function.');w[e]=t},this.setTag=function(e,t,n,r,o){if("function"!=typeof t)throw new Error('Tag "'+e+'" parse method is not a valid function.');if("function"!=typeof n)throw new Error('Tag "'+e+'" compile method is not a valid function.');y[e]={parse:t,compile:n,ends:r||!1,block:!!o}},this.setExtension=function(e,t){m.extensions[e]=t},this.parse=function(e,t){r(t);var n,o=l(t),i={};for(n in t)t.hasOwnProperty(n)&&"locals"!==n&&(i[n]=t[n]);return t=a.extend({},m.options,i),t.locals=o,c.parse(e,t,y,w)},this.parseFile=function(e,t){var n;if(t||(t={}),e=t.resolveFrom?i.resolve(i.dirname(t.resolveFrom),e):e,!o||!o.readFileSync)throw new Error("Unable to find file "+e+" because there is no filesystem to read from.");return n=o.readFileSync(e,"utf8"),t.filename||(t=a.extend({filename:e},t)),m.parse(n,t)},this.precompile=function(e,t){var n,r=m.parse(e,t),o=d(r,t);return o.length&&(r.tokens=g(r.blocks,o[0].tokens)),n=new Function("_swig","_ctx","_filters","_utils","_fn",'  var _ext = _swig.extensions,\n    _output = "";\n'+c.compile(r,o,t)+"\n"+"  return _output;\n"),{tpl:n,tokens:r}},this.render=function(e,t){return n.compile(e,t)()},this.renderFile=function(e,t,r){return r?(n.compileFile(e,{},function(e,n){return e?(r(e),void 0):(r(null,n(t)),void 0)}),void 0):n.compileFile(e)(t)},this.compile=function(e,n){function r(e){return i.tpl(m,a.extend({},o,e||{}),w,a,t)}var o,i,s=n?n.filename:null,u=s?f(s):null;return u?u:(o=l(n),i=this.precompile(e,n),a.extend(r,i.tokens),s&&h(s,r),r)},this.compileFile=function(e,t,n){var r,s;if(t||(t={}),e=t.resolveFrom?i.resolve(i.dirname(t.resolveFrom),e):e,t.filename||(t=a.extend({filename:e},t)),s=f(e))return n?(n(null,s),void 0):s;if(!o||!o.readFileSync)throw new Error("Unable to find file "+e+" because there is no filesystem to read from.");return n?(o.readFile(e,"utf8",function(e,r){return e?(n(e),void 0):(n(e,m.compile(r,t)),void 0)}),void 0):(r=o.readFileSync(e,"utf8"),m.compile(r,t))},this.run=function(e,n){var r=l({locals:n});return e(m,r,w,a,t)}},f=new n.Swig,n.setFilter=f.setFilter,n.setTag=f.setTag,n.setExtension=f.setExtension,n.parseFile=f.parseFile,n.precompile=f.precompile,n.compile=f.compile,n.compileFile=f.compileFile,n.render=f.render,n.renderFile=f.renderFile,n.run=f.run,n.invalidateCache=f.invalidateCache}()},{"./dateformatter":2,"./filters":3,"./parser":5,"./tags":7,"./utils":23,fs:24,path:25}],7:[function(e,t,n){n.autoescape=e("./tags/autoescape"),n.block=e("./tags/block"),n.else=e("./tags/else"),n.elseif=e("./tags/elseif"),n.elif=n.elseif,n.extends=e("./tags/extends"),n.filter=e("./tags/filter"),n.for=e("./tags/for"),n.if=e("./tags/if"),n.import=e("./tags/import"),n.include=e("./tags/include"),n.macro=e("./tags/macro"),n.parent=e("./tags/parent"),n.raw=e("./tags/raw"),n.set=e("./tags/set"),n.spaceless=e("./tags/spaceless")},{"./tags/autoescape":8,"./tags/block":9,"./tags/else":10,"./tags/elseif":11,"./tags/extends":12,"./tags/filter":13,"./tags/for":14,"./tags/if":15,"./tags/import":16,"./tags/include":17,"./tags/macro":18,"./tags/parent":19,"./tags/raw":20,"./tags/set":21,"./tags/spaceless":22}],8:[function(e,t,n){var r=e("../utils"),o=["html","js"];n.compile=function(e,t,n){return e(n)},n.parse=function(e,t,n,i,a,s){var u;return n.on("*",function(e){return e.type!==i.WHITESPACE?u||e.type!==i.BOOL&&(e.type!==i.STRING||-1!==o.indexOf(e.match))?(r.throwError('Unexpected token "'+e.match+'" in autoescape tag',t,s.filename),void 0):(this.out.push(e.match),u=!0,void 0):void 0}),!0},n.ends=!0},{"../utils":23}],9:[function(e,t,n){n.compile=function(e,t,n,r,o){return e(n,r,o,t.join(""))},n.parse=function(e,t,n){return n.on("*",function(e){this.out.push(e.match)}),!0},n.ends=!0,n.block=!0},{}],10:[function(e,t,n){n.compile=function(){return"} else {\n"},n.parse=function(e,t,n,r,o){return n.on("*",function(e){throw new Error('"else" tag does not accept any tokens. Found "'+e.match+'" on line '+t+".")}),o.length&&"if"===o[o.length-1].name}},{}],11:[function(e,t,n){var r=e("./if").parse;n.compile=function(e,t){return"} else if ("+t.join(" ")+") {\n"},n.parse=function(e,t,n,o,i){var a=r(e,t,n,o,i);return a&&i.length&&"if"===i[i.length-1].name}},{"./if":15}],12:[function(e,t,n){n.compile=function(){},n.parse=function(){return!0},n.ends=!1},{}],13:[function(e,t,n){var r=e("../filters");n.compile=function(e,t,n,r,o){var i=t.shift().replace(/\($/,""),a='(function () {\n  var _output = "";\n'+e(n,r,o)+"  return _output;\n"+"})()";return")"===t[t.length-1]&&t.pop(),t=t.length?", "+t.join(""):"",'_output += _filters["'+i+'"]('+a+t+");\n"},n.parse=function(e,t,n,o){function i(e){if(!r.hasOwnProperty(e))throw new Error('Filter "'+e+'" does not exist on line '+t+".")}var a;return n.on(o.FUNCTION,function(e){return a?!0:(a=e.match.replace(/\($/,""),i(a),this.out.push(e.match),this.state.push(e.type),void 0)}),n.on(o.VAR,function(e){return a?!0:(a=e.match,i(a),this.out.push(a),void 0)}),!0},n.ends=!0},{"../filters":3}],14:[function(e,t,n){n.compile=function(e,t,n){var r,o=t.shift(),i="__k";return t[0]&&","===t[0]&&(t.shift(),i=o,o=t.shift()),r=t.join(""),["(function () {\n","  var __l = "+r+";\n","  if (!__l) { return; }\n","  var loop = { first: false, index: 1, index0: 0, revindex: __l.length, revindex0: __l.length - 1, length: __l.length, last: false };\n","  _utils.each(__l, function ("+o+", "+i+") {\n","    loop.key = "+i+";\n","    loop.first = (loop.index0 === 0);\n","    loop.last = (loop.revindex0 === 0);\n","    "+e(n),"    loop.index += 1; loop.index0 += 1; loop.revindex -= 1; loop.revindex0 -= 1;\n","  });\n","})();\n"].join("")},n.parse=function(e,t,n,r){var o,i;return n.on(r.NUMBER,function(e){var n=this.state.length?this.state[this.state.length-1]:null;if(!i||n!==r.ARRAYOPEN&&n!==r.CURLYOPEN&&n!==r.CURLYCLOSE&&n!==r.FUNCTION&&n!==r.FILTER)throw new Error('Unexpected number "'+e.match+'" on line '+t+".");return!0}),n.on(r.VAR,function(e){return i&&o?!0:(this.out.length||(o=!0),this.out.push(e.match),void 0)}),n.on(r.COMMA,function(e){return o&&this.prevToken.type===r.VAR?(this.out.push(e.match),void 0):!0}),n.on(r.COMPARATOR,function(e){if("in"!==e.match||!o)throw new Error('Unexpected token "'+e.match+'" on line '+t+".");i=!0}),!0},n.ends=!0},{}],15:[function(e,t,n){n.compile=function(e,t,n){return"if ("+t.join(" ")+") { \n"+e(n)+"\n"+"}"},n.parse=function(e,t,n,r){return n.on(r.COMPARATOR,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");if(this.prevToken.type===r.NOT)throw new Error('Attempted logic "not '+e.match+'" on line '+t+". Use !(foo "+e.match+") instead.");this.out.push(e.match)}),n.on(r.NOT,function(e){if(this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match)}),n.on(r.BOOL,function(e){this.out.push(e.match)}),n.on(r.LOGIC,function(e){if(!this.out.length||this.isLast)throw new Error('Unexpected logic "'+e.match+'" on line '+t+".");this.out.push(e.match),this.filterApplyIdx.pop()}),!0},n.ends=!0},{}],16:[function(e,t,n){!function(){var t=e("../utils");n.compile=function(e,n){var r=n.pop(),o="var "+r+" = {};\n"+"(function () {\n"+'  var _output = "";\n';return o+=t.map(n,function(e){return e.replace(/__ctx__/g,r)}).join(""),o+="}());\n"},n.parse=function(n,r,o,i,a,s){var u,c,l=e("../swig").parseFile,f=e("../parser").compile,p={resolveFrom:s.filename},h=t.extend({},s,p),g=[];return o.on(i.STRING,function(e){var n=this;if(!u)return u=l(e.match.replace(/^("|')|("|')$/g,""),p).tokens,t.each(u,function(e){var t,r,o="";e&&"macro"===e.name&&e.compile&&(t=e.args[0],o+="__ctx__."+t+" = "+e.compile(f,e.args,e.content,[],h),r=t+"\\.safe ",o=o.replace(new RegExp(r),"__ctx__."+r.replace(/\\/g,"")),g.push(t),n.out.push(o))}),void 0;throw new Error("Unexpected string "+e.match+" on line "+r+".")}),o.on(i.VAR,function(e){var n=this;if(!u||c)throw new Error('Unexpected variable "'+e.match+'" on line '+r+".");if("as"!==e.match)return c=e.match,n.out.push(c),t.each(g,function(e){n.macros.push(c+"."+e)}),!1}),!0},n.block=!0}()},{"../parser":5,"../swig":6,"../utils":23}],17:[function(e,t,n){var r="ignore",o="missing",i="only";n.compile=function(e,t){var n=t.shift(),r=t.indexOf(i),a=-1!==r?t.splice(r,1):!1,s=t.pop().replace(/\\/g,"\\\\"),u=t[t.length-1]===o?t.pop():!1,c=t.join("");return(u?"  try {\n":"")+"_output += _swig.compileFile("+n+", {"+'resolveFrom: "'+s+'"'+"})("+(a&&c?c:c?"_utils.extend({}, _ctx, "+c+")":"_ctx")+");\n"+(u?"} catch (e) {}\n":"")},n.parse=function(e,t,n,a,s,u){var c,l;return n.on(a.STRING,function(e){return c?!0:(c=e.match,this.out.push(c),void 0)}),n.on(a.VAR,function(e){if(!c)return c=e.match,!0;if(!l&&"with"===e.match)return l=!0,void 0;if(l&&e.match===i&&"with"!==this.prevToken.match)return this.out.push(e.match),void 0;if(e.match===r)return!1;if(e.match===o){if(this.prevToken.match!==r)throw new Error('Unexpected token "'+o+'" on line '+t+".");return this.out.push(e.match),!1}if(this.prevToken.match===r)throw new Error('Expected "'+o+'" on line '+t+' but found "'+e.match+'".');return!0}),n.on("end",function(){this.out.push(u.filename||null)}),!0}},{}],18:[function(e,t,n){n.compile=function(e,t,n,r,o,i){var a=t.shift();return"function "+a+"("+t.join("")+") {\n"+'  var _output = "";\n'+e(n,r,o,i)+"\n"+"  return _output;\n"+"};\n"+a+".safe = true;\n"},n.parse=function(e,t,n,r){var o;return n.on(r.VAR,function(e){if(-1!==e.match.indexOf("."))throw new Error('Unexpected dot in macro argument "'+e.match+'" on line '+t+".");this.out.push(e.match)}),n.on(r.FUNCTION,function(e){o||(o=e.match,this.out.push(o),this.state.push(r.FUNCTION))}),n.on(r.FUNCTIONEMPTY,function(e){o||(o=e.match,this.out.push(o))}),n.on(r.PARENCLOSE,function(){if(!this.isLast)throw new Error("Unexpected parenthesis close on line "+t+".")}),n.on(r.COMMA,function(){return!0}),n.on("*",function(){}),!0},n.ends=!0},{}],19:[function(e,t,n){n.compile=function(e,t,n,r,o,i){if(!r||!r.length)return"";var a,s,u=(t[0],!0),c=r.length,l=0;for(l;c>l;l+=1)if(a=r[l],a.blocks&&a.blocks.hasOwnProperty(i)&&u)return s=a.blocks[i],s.compile(e,[i],s.content,r.slice(l+1),o)+"\n"},n.parse=function(e,t,n,r,o,i){return n.on("*",function(e){throw new Error('Unexpected argument "'+e.match+'" on line '+t+".")}),n.on("end",function(){this.out.push(i.filename)}),!0}},{}],20:[function(e,t,n){n.compile=function(e,t,n){return e(n)},n.parse=function(e,t,n){return n.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" in raw tag on line '+t+".")}),!0},n.ends=!0},{}],21:[function(e,t,n){!function(){n.compile=function(e,t){return t.join(" ")+";\n"},n.parse=function(e,t,n,r){var o;return n.on(r.VAR,function(e){return this.out.length?!0:(o=e.match,this.out.push("var "+o+" = _ctx."+o+";\n"+o),void 0)}),n.on(r.ASSIGNMENT,function(e){if(1!==this.out.length||!o)throw new Error('Unexpected assignment "'+e.match+'" on line '+t+".");this.out.push(e.match)}),!0},n.block=!0}()},{}],22:[function(e,t,n){var r=e("../utils");n.compile=function(e,t,n,o,i){function a(e){return r.map(e,function(e){return e.content?(e.content=a(e.content),e):e.replace(/^\s+/,"").replace(/>\s+</g,"><").replace(/\s+$/,"")})}return e(a(n),o,i)},n.parse=function(e,t,n){return n.on("*",function(e){throw new Error('Unexpected token "'+e.match+'" on line '+t+".")}),!0},n.ends=!0},{"../utils":23}],23:[function(e,t,n){var r;n.strip=function(e){return e.replace(/^\s+|\s+$/g,"")},n.startsWith=function(e,t){return 0===e.indexOf(t)},n.endsWith=function(e,t){return-1!==e.indexOf(t,e.length-t.length)},n.each=function(e,t){var n,o;if(r(e))for(n=0,o=e.length,n;o>n&&t(e[n],n,e)!==!1;n+=1);else for(n in e)if(e.hasOwnProperty(n)&&t(e[n],n,e)===!1)break;return e},n.isArray=r=Array.hasOwnProperty("isArray")?Array.isArray:function(e){return e?"object"==typeof e&&-1!==Object.prototype.toString.call(e).indexOf():!1},n.some=function(e,t){var o,i,a=0;if(r(e))for(i=e.length,a;i>a&&!(o=t(e[a],a,e));a+=1);else n.each(e,function(n,r){return o=t(n,r,e),!o});return!!o},n.map=function(e,t){var n,o=0,i=[];if(r(e))for(n=e.length,o;n>o;o+=1)i[o]=t(e[o],o);else for(o in e)e.hasOwnProperty(o)&&(i[o]=t(e[o],o));return i},n.extend=function(){var e,t,n=arguments,r=n[0],o=n.length>1?Array.prototype.slice.call(n,1):[],i=0,a=o.length;
  for(i;a>i;i+=1){t=o[i]||{};for(e in t)t.hasOwnProperty(e)&&(r[e]=t[e])}return r},n.keys=function(e){return Object.keys?Object.keys(e):n.map(e,function(e,t){return t})},n.throwError=function(e,t,n){throw t&&(e+=" on line "+t),n&&(e+=" in file "+n),new Error(e+".")}},{}],24:[function(){},{}],25:[function(e,t,n){!function(e){function t(e,t){for(var n=[],r=0;r<e.length;r++)t(e[r],r,e)&&n.push(e[r]);return n}function r(e,t){for(var n=0,r=e.length;r>=0;r--){var o=e[r];"."==o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var o=/^(.+\/(?!$)|\/)?((?:.+?)?(\.[^.]*)?)$/;n.resolve=function(){for(var n="",o=!1,i=arguments.length;i>=-1&&!o;i--){var a=i>=0?arguments[i]:e.cwd();"string"==typeof a&&a&&(n=a+"/"+n,o="/"===a.charAt(0))}return n=r(t(n.split("/"),function(e){return!!e}),!o).join("/"),(o?"/":"")+n||"."},n.normalize=function(e){var n="/"===e.charAt(0),o="/"===e.slice(-1);return e=r(t(e.split("/"),function(e){return!!e}),!n).join("/"),e||n||(e="."),e&&o&&(e+="/"),(n?"/":"")+e},n.join=function(){var e=Array.prototype.slice.call(arguments,0);return n.normalize(t(e,function(e){return e&&"string"==typeof e}).join("/"))},n.dirname=function(e){var t=o.exec(e)[1]||"",n=!1;return t?1===t.length||n&&t.length<=3&&":"===t.charAt(1)?t:t.substring(0,t.length-1):"."},n.basename=function(e,t){var n=o.exec(e)[2]||"";return t&&n.substr(-1*t.length)===t&&(n=n.substr(0,n.length-t.length)),n},n.extname=function(e){return o.exec(e)[3]||""},n.relative=function(e,t){function r(e){for(var t=0;t<e.length&&""===e[t];t++);for(var n=e.length-1;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=n.resolve(e).substr(1),t=n.resolve(t).substr(1);for(var o=r(e.split("/")),i=r(t.split("/")),a=Math.min(o.length,i.length),s=a,u=0;a>u;u++)if(o[u]!==i[u]){s=u;break}for(var c=[],u=s;u<o.length;u++)c.push("..");return c=c.concat(i.slice(s)),c.join("/")}}(e("__browserify_process"))},{__browserify_process:26}],26:[function(e,t){var n=t.exports={};n.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){if(e.source===window&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var t=n.shift();t()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}]},{},[1]);
  //# sourceMappingURL=swig.js.map