work.suroh.tk/node_modules/liquidjs/dist/liquid.min.js

3 lines
42 KiB
JavaScript

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).Liquid=t()}(this,function(){"use strict";var F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q=function(e){return function(){var u=e.apply(this,arguments);return new Promise(function(o,a){return function t(e,r){try{var n=u[e](r),i=n.value}catch(e){return void a(e)}if(!n.done)return Promise.resolve(i).then(function(e){t("next",e)},function(e){t("throw",e)});o(i)}("next")})}};!function(e){var s,t=Object.prototype,c=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",n=r.asyncIterator||"@@asyncIterator",o=r.toStringTag||"@@toStringTag",a="object"===("undefined"==typeof module?"undefined":F(module)),u=e.regeneratorRuntime;if(u)a&&(module.exports=u);else{(u=e.regeneratorRuntime=a?module.exports:{}).wrap=w;var p="suspendedStart",f="suspendedYield",h="executing",g="completed",d={},l={};l[i]=function(){return this};var v=Object.getPrototypeOf,m=v&&v(v(O([])));m&&m!==t&&c.call(m,i)&&(l=m);var y=E.prototype=b.prototype=Object.create(l);k.prototype=y.constructor=E,E.constructor=k,E[o]=k.displayName="GeneratorFunction",u.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===k||"GeneratorFunction"===(t.displayName||t.name))},u.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,o in e||(e[o]="GeneratorFunction")),e.prototype=Object.create(y),e},u.awrap=function(e){return{__await:e}},R(T.prototype),T.prototype[n]=function(){return this},u.AsyncIterator=T,u.async=function(e,t,r,n){var i=new T(w(e,t,r,n));return u.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},R(y),y[o]="Generator",y[i]=function(){return this},y.toString=function(){return"[object Generator]"},u.keys=function(r){var n=[];for(var e in r)n.push(e);return n.reverse(),function e(){for(;n.length;){var t=n.pop();if(t in r)return e.value=t,e.done=!1,e}return e.done=!0,e}},u.values=O,j.prototype={constructor:j,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=s,this.done=!1,this.delegate=null,this.method="next",this.arg=s,this.tryEntries.forEach(L),!e)for(var t in this)"t"===t.charAt(0)&&c.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=s)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var n=this;function e(e,t){return o.type="throw",o.arg=r,n.next=e,t&&(n.method="next",n.arg=s),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var i=this.tryEntries[t],o=i.completion;if("root"===i.tryLoc)return e("end");if(i.tryLoc<=this.prev){var a=c.call(i,"catchLoc"),u=c.call(i,"finallyLoc");if(a&&u){if(this.prev<i.catchLoc)return e(i.catchLoc,!0);if(this.prev<i.finallyLoc)return e(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return e(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return e(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;0<=r;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&c.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),L(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;L(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:O(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=s),d}}}function w(e,t,r,n){var o,a,u,s,i=t&&t.prototype instanceof b?t:b,c=Object.create(i.prototype),l=new j(n||[]);return c._invoke=(o=e,a=r,u=l,s=p,function(e,t){if(s===h)throw new Error("Generator is already running");if(s===g){if("throw"===e)throw t;return M()}for(u.method=e,u.arg=t;;){var r=u.delegate;if(r){var n=S(r,u);if(n){if(n===d)continue;return n}}if("next"===u.method)u.sent=u._sent=u.arg;else if("throw"===u.method){if(s===p)throw s=g,u.arg;u.dispatchException(u.arg)}else"return"===u.method&&u.abrupt("return",u.arg);s=h;var i=x(o,a,u);if("normal"===i.type){if(s=u.done?g:f,i.arg===d)continue;return{value:i.arg,done:u.done}}"throw"===i.type&&(s=g,u.method="throw",u.arg=i.arg)}}),c}function x(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}function b(){}function k(){}function E(){}function R(e){["next","throw","return"].forEach(function(t){e[t]=function(e){return this._invoke(t,e)}})}function T(s){var t;this._invoke=function(r,n){function e(){return new Promise(function(e,t){!function t(e,r,n,i){var o=x(s[e],s,r);if("throw"!==o.type){var a=o.arg,u=a.value;return u&&"object"===(void 0===u?"undefined":F(u))&&c.call(u,"__await")?Promise.resolve(u.__await).then(function(e){t("next",e,n,i)},function(e){t("throw",e,n,i)}):Promise.resolve(u).then(function(e){a.value=e,n(a)},function(e){return t("throw",e,n,i)})}i(o.arg)}(r,n,e,t)})}return t=t?t.then(e,e):e()}}function S(e,t){var r=e.iterator[t.method];if(r===s){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=s,S(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=x(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=s),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function _(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function L(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,n=function e(){for(;++r<t.length;)if(c.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=s,e.done=!0,e};return n.next=n}}return{next:M}}function M(){return{value:s,done:!0}}}(function(){return this||"object"===("undefined"==typeof self?"undefined":F(self))&&self}()||Function("return this")());var n=Object.prototype.toString,i=Array.prototype.toString;function Z(e){return"[object String]"===n.call(e)}function o(e){return"function"==typeof e}function e(t){return function(){var e=arguments;return new Promise(function(r,n){t.apply(void 0,Array.prototype.slice.call(e).concat([function(e,t){e?n(e):r(t)}]))})}}function a(e){return u(e)?String(e):o(e.to_liquid)?a(e.to_liquid()):o(e.toLiquid)?a(e.toLiquid()):o(e.to_s)?e.to_s():-1<[n,i].indexOf(e.toString)?(t=e,r=[],JSON.stringify(t,function(e,t){if(re(t)){if(-1!==r.indexOf(t))return;r.push(t)}return t})):o(e.toString)?e.toString():n.call(e);var t,r}function ee(e){return Object.create(e)}function u(e){return null==e}function te(e){return"[object Array]"===n.call(e)}function m(t){return t=re(t)?t:{},Array.prototype.slice.call(arguments,1).forEach(function(e){return Object.assign(t,e)}),t}function y(e){return e[e.length-1]}function s(e){for(var t={},r=[],n=0,i=e.length;n<i;++n)t.hasOwnProperty(e[n])||(r.push(e[n]),t[e[n]]=1);return r}function re(e){var t=void 0===e?"undefined":F(e);return null!==e&&("object"===t||"function"===t)}var t=new RegExp(/'[^']*'/.source+"|"+/"[^"]*"/.source),f=new RegExp("(?:"+t.source+"|[^'\"])*"),r=/-?\d+\.?\d*|\.?\d+/,c=/true|false/,ne=/[\w-]+[?]?/,l=new RegExp("\\[(?:"+t.source+"|[\\w-\\.]+)\\]"),p=new RegExp("(?:"+t.source+"|"+c.source+"|"+r.source+")"),h=new RegExp(ne.source+"(?:\\."+ne.source+"|"+l.source+")*"),g=new RegExp("(?:"+h.source+"|"+r.source+")"),d=new RegExp("\\("+g.source+"\\.\\."+g.source+"\\)"),v=new RegExp("\\(("+g.source+")\\.\\.("+g.source+")\\)"),ie=new RegExp("(?:"+h.source+"|"+p.source+"|"+d.source+")"),oe=new RegExp("(?:"+ne.source+")\\s*:\\s*(?:"+ie.source+")"),w=new RegExp("("+ne.source+")\\s*:\\s*("+ie.source+")","g"),x=new RegExp("^\\s*("+ne.source+")\\s*([\\s\\S]*)\\s*$"),b=new RegExp("^"+p.source+"$","i"),k=new RegExp("^"+h.source+"$"),E=new RegExp("^"+r.source+"$"),R=new RegExp("^"+c.source+"$","i"),ae=new RegExp("^"+t.source+"$"),T=new RegExp("^"+v.source+"$"),S=new RegExp("^"+/-?\d+/.source+"$"),_=new RegExp("(?:"+ne.source+"\\s*:\\s*)?"+ie.source),L=new RegExp(_.source+"(\\s*,\\s*"+_.source+")*"),j=new RegExp(ne.source+"(?:\\s*:\\s*"+L.source+")?","g"),O=new RegExp("("+ne.source+")(?:\\s*:\\s*("+L.source+"))?"),M=new RegExp("^"+O.source+"$"),P=[/\s+or\s+/,/\s+and\s+/,/==|!=|<=|>=|<|>|\s+contains\s+/];function A(){this.name=this.constructor.name,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}function D(e,t){A.call(this),this.input=t.input,this.line=t.line,this.file=t.file;var r,i,o,n,a,u=(r=t.input,i=t.line,o=r.split("\n"),n=Math.max(i-2,1),a=Math.min(i+3,o.length),function(e,t,r){1===arguments.length&&(t=e,e=0),r=r||1;for(var n=[],i=e;i<t;i+=r)n.push(i);return n}(n,a+1).map(function(e){return[e===i?">> ":" ",(t=e,r=a,n=t+"",Array((r+"").length-n.length).join(" ")+n),"| ",o[e-1]].join("");var t,r,n}).join("\n"));this.message=function(e,t){e=e||"",t.file&&(e+=", file:"+t.file);t.line&&(e+=", line:"+t.line);return e}(e.message,t),this.stack=u+"\n"+(this.stack||this.message)+(e.stack?"\nFrom "+e.stack:"")}function I(e,t){D.call(this,{message:e},t)}function q(e,t){m(this,e),this.originalError=e,D.call(this,e,t)}function C(e,t){if(e instanceof C)return e;m(this,e),this.originalError=e,D.call(this,e,t.token)}function V(e){A.call(this),this.message=e+""}function N(e){A.call(this),this.message=e+""}function ue(e,t){if(!e)throw new N(t=t||"expect "+e+" to be true")}(I.prototype=ee(Error.prototype)).constructor=I,(q.prototype=ee(Error.prototype)).constructor=q,(C.prototype=ee(Error.prototype)).constructor=C,(V.prototype=ee(Error.prototype)).constructor=V,(N.prototype=ee(Error.prototype)).constructor=N;var Y={getAll:function(){return this.contexts.reduce(function(e,t){return m(e,t)},ee(null))},get:function(e){var r=this,t=this.propertyAccessSeq(e),n=this.findContextFor(t[0])||y(this.contexts);return t.reduce(function(e,t){return r.readProperty(e,t)},n)},set:function(e,r){var n=this.propertyAccessSeq(e),i=this.findContextFor(n[0])||y(this.contexts);n.some(function(e,t){return!re(i)||(t===n.length-1?(i[e]=r,!0):(void 0===i[e]&&(i[e]={}),void(i=i[e])))})},unshift:function(e){return this.contexts.unshift(e)},push:function(e){return this.contexts.push(e)},pop:function(t){if(!arguments.length)return this.contexts.pop();var e=this.contexts.findIndex(function(e){return e===t});if(-1===e)throw new TypeError("scope not found, cannot pop");return this.contexts.splice(e,1)[0]},findContextFor:function(e,t){t=t||function(){return!0};for(var r=this.contexts.length-1;0<=r;r--){var n=this.contexts[r];if(t(n)&&e in n)return n}return null},readProperty:function(e,t){var r,n=void 0;if(u(e)?n=void 0:(e=function(e){if(o(e.to_liquid))return e.to_liquid();if(o(e.toLiquid))return e.toLiquid();return e}(e),n="size"===t?u((r=e).size)&&(te(r)||Z(r))?r.length:r.size:e[t],o(e.liquid_method_missing)&&(n=e.liquid_method_missing(t))),u(n)&&this.opts.strict_variables)throw new TypeError("undefined variable: "+t);return n},propertyAccessSeq:function(e){e=String(e);for(var t,r=[],n="",i=void 0,o=0;o<e.length;)switch(e[o]){case"[":u();var a=e[o+1];o=/['"]/.test(a)?(ue(-1!==(i=e.indexOf(a,o+2)),"unbalanced "+a+": "+e),n=e.slice(o+2,i),u(),i+2):(ue(-1!==(i=$(e,o+1)),"unbalanced []: "+e),n=e.slice(o+1,i),t=n,S.test(t)||(n=String(this.get(n))),u(),i+1);break;case".":u(),o++;break;default:n+=e[o],o++}if(u(),!r.length)throw new TypeError('invalid path:"'+e+'"');return r;function u(){n.length&&r.push(n),n=""}}};function $(e,t){for(var r=1,n=t;n<e.length;n++)if("["===e[n]&&r++,"]"===e[n]&&0===--r)return n;return-1}var H={};function z(n,i){var e=Promise.reject(new Error("init"));return n.forEach(function(t,r){e=e.catch(function(e){return i(t,r,n)})}),e}function se(r,n){var i=Promise.resolve("init"),o=[];return r.forEach(function(e,t){i=i.then(function(){return n(e,t,r)}).then(function(e){return o.push(e)})}),i.then(function(){return o})}var G,U,W={},J=e(W.stat),B=e(W.readFile),X=(G=Q(regeneratorRuntime.mark(function e(r,n,t){var i,o=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return H.extname(r)||(r+=t.extname),n=s(n=t.root.concat(n||[])),i=n.map(function(e){return H.resolve(e,r)}),e.abrupt("return",z(i,function(){var t=Q(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,J(t);case 3:return e.abrupt("return",t);case 6:throw e.prev=6,e.t0=e.catch(0),e.t0.message=e.t0.code+": Failed to lookup "+r+" in: "+n,e.t0;case 10:case"end":return e.stop()}},e,o,[[0,6]])}));return function(e){return t.apply(this,arguments)}}()));case 5:case"end":return e.stop()}},e,this)})),function(e,t,r){return G.apply(this,arguments)}),K=(U=Q(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",B(t,"utf8"));case 1:case"end":return e.stop()}},e,this)})),function(e){return U.apply(this,arguments)});function ce(o,a,e){ue(Z(o),"illegal input");for(var r,n,i,t,u,s,c,l=/({%-?([\s\S]*?)-?%})|({{-?([\s\S]*?)-?}})/g,p=0,f=(r=o,n=0,i=-1,{get:function(e){var t=r.slice(i+1,e).split("\n");return n+=t.length-1,i=e,n+1}}),h=0,g=[];t=l.exec(o);h=l.lastIndex)t.index>h&&g.push(v(h,t.index)),g.push(t[1]?d(t[1],t[2].trim(),t.index):(u=t[3],s=t[4].trim(),c=t.index,{type:"value",line:f.get(c),trim_left:"{{-"===u.slice(0,3),trim_right:"-}}"===u.slice(-3),raw:u,value:s,input:o,file:a}));return o.length>h&&g.push(v(h,o.length)),function(a,u){u=m({greedy:!0},u);var s=!1;a.forEach(function(e,t){var r,n,i,o;i=e,o=u,!s&&("tag"===i.type?i.trim_left||o.trim_tag_left:"value"===i.type?i.trim_left||o.trim_value_left:void 0)&&function(e,t){if(e&&"html"===e.type){var r=t?/\s+$/g:/[\t\r ]*$/g;e.value=e.value.replace(r,"")}}(a[t-1],u.greedy),"tag"===e.type&&"raw"===e.name&&(s=!0),"tag"===e.type&&"endraw"===e.name&&(s=!1),r=e,n=u,!s&&("tag"===r.type?r.trim_right||n.trim_tag_right:"value"===r.type?r.trim_right||n.trim_value_right:void 0)&&function(e,t){if(e&&"html"===e.type){var r=t?/^\s+/g:/^[\t\r ]*\n?/g;e.value=e.value.replace(r,"")}}(a[t+1],u.greedy)})}(g,e),g;function d(e,t,r){var n=t.match(x),i={type:"tag",indent:p,line:f.get(r),trim_left:"{%-"===e.slice(0,3),trim_right:"-%}"===e.slice(-3),raw:e,value:t,input:o,file:a};if(!n)throw new I("illegal tag syntax",i);return i.name=n[1],i.args=n[2],i}function v(e,t){var r=o.slice(e,t);return p=y(r.split("\n")).length,{type:"html",raw:r,value:r}}}var le,pe=(le=ge,{"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},">":function(e,t){return null!==e&&null!==t&&t<e},"<":function(e,t){return null!==e&&null!==t&&e<t},">=":function(e,t){return null!==e&&null!==t&&t<=e},"<=":function(e,t){return null!==e&&null!==t&&e<=t},contains:function(e,t){return!!e&&"function"==typeof e.indexOf&&-1<e.indexOf(t)},and:function(e,t){return le(e)&&le(t)},or:function(e,t){return le(e)||le(t)}});function fe(e,t){ue(t,"unable to evalExp: scope undefined");for(var r=P,n=void 0,i=0;i<r.length;i++){var o=r[i],a=new RegExp("^("+f.source+")("+o.source+")("+f.source+")$");if(n=e.match(a)){var u=fe(n[1],t);return(0,pe[n[2].trim()])(u,fe(n[3],t))}}if(n=e.match(T)){for(var s=he(n[1],t),c=he(n[2],t),l=[],p=s;p<=c;p++)l.push(p);return l}return he(e,t)}function he(e,t){if(e=e&&e.trim()){if(r=e,b.test(r))return function(e){var t=e.match(E);if(t)return Number(e);if(t=e.match(R))return"true"===e.toLowerCase();if(t=e.match(ae))return e.slice(1,-1);throw new TypeError("cannot parse '"+e+"' as literal")}(e);var r,n;if(n=e,k.test(n))return t.get(e);throw new TypeError("cannot eval '"+e+"' as value")}}function ge(e){return!de(e)}function de(e){return!1===e||null==e}var ve,me,ye,we={renderTemplates:(ye=Q(regeneratorRuntime.mark(function e(t,n){var r,i,o,a,u,s,c,l,p=(r=Q(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("tag"===t.type)return e.next=3,this.renderTag(t,n);e.next=5;break;case 3:return r=e.sent,e.abrupt("return",void 0===r?"":r);case 5:if("value"===t.type)return e.abrupt("return",this.renderValue(t,n));e.next=7;break;case 7:return e.abrupt("return",t.value);case 8:case"end":return e.stop()}},e,this)})),function(e){return r.apply(this,arguments)});return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:ue(n,"unable to evalTemplates: scope undefined"),a=!(o=!(i="")),u=void 0,e.prev=5,s=t[Symbol.iterator]();case 7:if(o=(c=s.next()).done){e.next=24;break}return l=c.value,e.prev=9,e.next=12,p.call(this,l);case 12:i+=e.sent,e.next=21;break;case 15:if(e.prev=15,e.t0=e.catch(9),e.t0 instanceof V)throw e.t0.resolvedHTML=i,e.t0;e.next=20;break;case 20:throw new C(e.t0,l);case 21:o=!0,e.next=7;break;case 24:e.next=30;break;case 26:e.prev=26,e.t1=e.catch(5),a=!0,u=e.t1;case 30:e.prev=30,e.prev=31,!o&&s.return&&s.return();case 33:if(e.prev=33,a)throw u;e.next=36;break;case 36:return e.finish(33);case 37:return e.finish(30);case 38:return e.abrupt("return",i);case 39:case"end":return e.stop()}},e,this,[[5,26,30,38],[9,15],[31,,33,37]])})),function(e,t){return ye.apply(this,arguments)}),renderTag:(me=Q(regeneratorRuntime.mark(function e(t,r){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("continue"===t.name)throw new V("continue");e.next=2;break;case 2:if("break"===t.name)throw new V("break");e.next=4;break;case 4:return e.abrupt("return",t.render(r));case 5:case"end":return e.stop()}},e,this)})),function(e,t){return me.apply(this,arguments)}),renderValue:(ve=Q(regeneratorRuntime.mark(function e(t,r){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.evalValue(t,r),e.abrupt("return",void 0===n?"":a(n));case 2:case"end":return e.stop()}},e,this)})),function(e,t){return ve.apply(this,arguments)}),evalValue:function(e,r){return ue(r,"unable to evalValue: scope undefined"),e.filters.reduce(function(e,t){return t.render(e,r)},fe(e.initial,r))}};function xe(e,t){var r={},n=void 0;for(w.lastIndex=0;n=w.exec(e);){var i=n[1],o=n[2];r[i]=he(o,t)}return r}var be=new RegExp(""+ie.source,"g");function ke(r,o){var t={init:function(e){return this.tokens=e,this.handlers={},this},on:function(e,t){return this.handlers[e]=t,this},trigger:function(e,t){var r=this.handlers[e];if("function"==typeof r)return r(t),!0},start:function(){this.trigger("start");for(var e=void 0;!this.stopRequested&&(e=this.tokens.shift());)if(!(this.trigger("token",e)||"tag"===e.type&&this.trigger("tag:"+e.name,e))){var t=n(e,this.tokens);this.trigger("template",t)}return this.stopRequested||this.trigger("end"),this},stop:function(){return this.stopRequested=!0,this}};function n(t,e){try{var r=null;return(r="tag"===t.type?i(t,e):"value"===t.type?a(t.value):t).token=t,r}catch(e){throw new q(e,t)}}function i(e,t){return"continue"===e.name||"break"===e.name?e:r.construct(e,t)}function a(e){var t,r=(t=e,ie.exec(t));ue(r,"illegal value string: "+e);var n=r[0];e=e.substr(r.index+r[0].length);for(var i=[];r=j.exec(e);)i.push([r[0].trim()]);return{type:"value",initial:n,filters:i.map(function(e){return o.construct(e)})}}return{parse:function(e){for(var t=void 0,r=[];t=e.shift();)r.push(n(t,e));return r},parseTag:i,parseStream:function(e){return ee(t).init(e)},parseValue:a}}var Ee=/[^\s,]+/;function Re(e,t){var r,n,i,o,a,u,s,c,l,p,f,h,g,d,v,m,y,w,x,b,k,E,R,T,S,_,L,j,O,M,F,P,A,D,I,q,C,V,N,Y,$,H,z,G,U,W,J,B,X,K;r=e,n=t,i=new RegExp("("+ne.source+")\\s*=([^]*)"),o=n.Types.AssignScope,r.registerTag("assign",{parse:function(e){var t=e.args.match(i);ue(t,"illegal token "+e.raw),this.key=t[1],this.value=t[2]},render:function(e){var t=ee(o);return t[this.key]=r.evalValue(this.value,e),e.push(t),Promise.resolve("")}}),a=e,u=t,c=new RegExp("("+ne.source+")"),l=u.Types.CaptureScope,a.registerTag("capture",{parse:function(t,e){var r=this,n=t.args.match(c);ue(n,t.args+" not valid identifier"),this.variable=n[1],this.templates=[];var i=a.parser.parseStream(e);i.on("tag:endcapture",function(e){return i.stop()}).on("template",function(e){return r.templates.push(e)}).on("end",function(e){throw new Error("tag "+t.raw+" not closed")}),i.start()},render:(s=Q(regeneratorRuntime.mark(function e(t,r){var n,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.renderer.renderTemplates(this.templates,t);case 2:n=e.sent,(i=ee(l))[this.variable]=n,t.push(i);case 6:case"end":return e.stop()}},e,this)})),function(e,t){return s.apply(this,arguments)})}),f=t,(p=e).registerTag("case",{parse:function(t,e){var r=this;this.cond=t.args,this.cases=[],this.elseTemplates=[];var n=[],i=p.parser.parseStream(e).on("tag:when",function(e){r.cases.push({val:e.args,templates:n=[]})}).on("tag:else",function(){return n=r.elseTemplates}).on("tag:endcase",function(e){return i.stop()}).on("template",function(e){return n.push(e)}).on("end",function(e){throw new Error("tag "+t.raw+" not closed")});i.start()},render:function(e,t){for(var r=0;r<this.cases.length;r++){var n=this.cases[r];if(f.evalExp(n.val,e)===f.evalExp(this.cond,e))return p.renderer.renderTemplates(n.templates,e)}return p.renderer.renderTemplates(this.elseTemplates,e)}}),(h=e).registerTag("comment",{parse:function(t,e){var r=h.parser.parseStream(e);r.on("token",function(e){"endcomment"===e.name&&r.stop()}).on("end",function(e){throw new Error("tag "+t.raw+" not closed")}),r.start()}}),g=e,d=t,v=new RegExp("^(?:("+ie.source+")\\s*:\\s*)?(.*)$"),m=new RegExp(ie.source,"g"),g.registerTag("cycle",{parse:function(e,t){var r=v.exec(e.args);ue(r,"illegal tag: "+e.raw),this.group=r[1]||"";var n=r[2];for(this.candidates=[];r=m.exec(n);)this.candidates.push(r[0]);ue(this.candidates.length,"empty candidates: "+e.raw)},render:function(e,t){var r="cycle:"+d.evalValue(this.group,e)+":"+this.candidates.join(","),n=e.opts.groups=e.opts.groups||{},i=n[r];void 0===i&&(i=n[r]=0);var o=this.candidates[i];return i=(i+1)%this.candidates.length,n[r]=i,d.evalValue(o,e)}}),y=e,w=t.Types,x=w.CaptureScope,b=w.AssignScope,k=w.DecrementScope,y.registerTag("decrement",{parse:function(e){var t=e.args.match(ne);ue(t,"illegal identifier "+e.args),this.variable=t[0]},render:function(e,t){var r=e.findContextFor(this.variable,function(e){var t=Object.getPrototypeOf(e);return t!==x&&t!==b});return r||(r=ee(k),e.unshift(r)),"number"!=typeof r[this.variable]&&(r[this.variable]=0),--r[this.variable]}}),E=e,R=t,T=Q(regeneratorRuntime.mark(function e(r,t){var n,i,o,a,u,s,c=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(te(n=R.evalExp(this.collection,r))||(Z(n)&&0<n.length?n=[n]:re(n)&&(n=Object.keys(n).map(function(e){return[e,n[e]]}))),te(n)&&n.length){e.next=4;break}return e.abrupt("return",E.renderer.renderTemplates(this.elseTemplates,r));case 4:return i=t.offset||0,o=void 0===t.limit?n.length:t.limit,n=n.slice(i,i+o),this.reversed&&n.reverse(),a=n.map(function(e,t){var r={};return r[c.variable]=e,r.forloop={first:0===t,index:t+1,index0:t,last:t===n.length-1,length:n.length,rindex:n.length-t,rindex0:n.length-t-1},r}),u="",s=!1,e.next=13,se(a,function(){var t=Q(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(s)return e.abrupt("return");e.next=2;break;case 2:return r.push(t),e.prev=3,e.next=6,E.renderer.renderTemplates(c.templates,r);case 6:u+=e.sent,e.next=17;break;case 9:if(e.prev=9,e.t0=e.catch(3),!(e.t0 instanceof _)){e.next=16;break}u+=e.t0.resolvedHTML,"break"===e.t0.message&&(s=!0),e.next=17;break;case 16:throw e.t0;case 17:r.pop(t);case 18:case"end":return e.stop()}},e,c,[[3,9]])}));return function(e){return t.apply(this,arguments)}}());case 13:return e.abrupt("return",u);case 14:case"end":return e.stop()}},e,this)})),S=function(e,t){return T.apply(this,arguments)},_=R.Types.RenderBreakError,L=new RegExp("^("+ne.source+")\\s+in\\s+("+ie.source+")(?:\\s+"+oe.source+")*(?:\\s+(reversed))?(?:\\s+"+oe.source+")*$"),E.registerTag("for",{parse:function(e,t){var r=this,n=L.exec(e.args);ue(n,"illegal tag: "+e.raw),this.variable=n[1],this.collection=n[2],this.reversed=!!n[3],this.templates=[],this.elseTemplates=[];var i=void 0,o=E.parser.parseStream(t).on("start",function(){return i=r.templates}).on("tag:else",function(){return i=r.elseTemplates}).on("tag:endfor",function(){return o.stop()}).on("template",function(e){return i.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});o.start()},render:S}),O=t,(j=e).registerTag("if",{parse:function(t,e){var r=this;this.branches=[],this.elseTemplates=[];var n=void 0,i=j.parser.parseStream(e).on("start",function(){return r.branches.push({cond:t.args,templates:n=[]})}).on("tag:elsif",function(e){r.branches.push({cond:e.args,templates:n=[]})}).on("tag:else",function(){return n=r.elseTemplates}).on("tag:endif",function(e){return i.stop()}).on("template",function(e){return n.push(e)}).on("end",function(e){throw new Error("tag "+t.raw+" not closed")});i.start()},render:function(e,t){var r=!0,n=!1,i=void 0;try{for(var o,a=this.branches[Symbol.iterator]();!(r=(o=a.next()).done);r=!0){var u=o.value,s=O.evalExp(u.cond,e);if(O.isTruthy(s))return j.renderer.renderTemplates(u.templates,e)}}catch(e){n=!0,i=e}finally{try{!r&&a.return&&a.return()}finally{if(n)throw i}}return j.renderer.renderTemplates(this.elseTemplates,e)}}),M=e,F=t,A=new RegExp("with\\s+("+ie.source+")"),M.registerTag("include",{parse:function(e){var t=Ee.exec(e.args);t&&(this.staticValue=t[0]),(t=ie.exec(e.args))&&(this.value=t[0]),(t=A.exec(e.args))&&(this.with=t[1])},render:(P=Q(regeneratorRuntime.mark(function e(t,r){var n,i,o,a,u,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(n=void 0,!t.opts.dynamicPartials){e.next=12;break}if(ae.exec(this.value))return i=this.value.slice(1,-1),e.next=6,M.parseAndRender(i,t.getAll(),t.opts);e.next=9;break;case 6:n=e.sent,e.next=10;break;case 9:n=F.evalValue(this.value,t);case 10:e.next=13;break;case 12:n=this.staticValue;case 13:return ue(n,"cannot include with empty filename"),o=t.opts.blocks,a=t.opts.blockMode,t.opts.blocks={},t.opts.blockMode="output",this.with&&(r[n]=F.evalValue(this.with,t)),e.next=21,M.getTemplate(n,t.opts.root);case 21:return u=e.sent,t.push(r),e.next=25,M.renderer.renderTemplates(u,t);case 25:return s=e.sent,t.pop(r),t.opts.blocks=o,t.opts.blockMode=a,e.abrupt("return",s);case 30:case"end":return e.stop()}},e,this)})),function(e,t){return P.apply(this,arguments)})}),D=e,I=t.Types,q=I.CaptureScope,C=I.AssignScope,V=I.IncrementScope,D.registerTag("increment",{parse:function(e){var t=e.args.match(ne);ue(t,"illegal identifier "+e.args),this.variable=t[0]},render:function(e,t){var r=e.findContextFor(this.variable,function(e){var t=Object.getPrototypeOf(e);return t!==q&&t!==C});r||(r=ee(V),e.unshift(r)),"number"!=typeof r[this.variable]&&(r[this.variable]=0);var n=r[this.variable];return r[this.variable]++,n}}),Y=t,z=/\S+/,(N=e).registerTag("layout",{parse:function(e,t){var r=z.exec(e.args);r&&(this.staticLayout=r[0]),(r=ie.exec(e.args))&&(this.layout=r[0]),this.tpls=N.parser.parse(t)},render:($=Q(regeneratorRuntime.mark(function e(t,r){var n,i,o,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return ue(n=t.opts.dynamicPartials?Y.evalValue(this.layout,t):this.staticLayout,"cannot apply layout with empty filename"),t.opts.blockMode="store",e.next=5,N.renderer.renderTemplates(this.tpls,t);case 5:return i=e.sent,void 0===t.opts.blocks[""]&&(t.opts.blocks[""]=i),e.next=9,N.getTemplate(n,t.opts.root);case 9:return o=e.sent,t.push(r),t.opts.blockMode="output",e.next=14,N.renderer.renderTemplates(o,t);case 14:return a=e.sent,t.pop(r),e.abrupt("return",a);case 17:case"end":return e.stop()}},e,this)})),function(e,t){return $.apply(this,arguments)})}),N.registerTag("block",{parse:function(e,t){var r=this,n=/\w+/.exec(e.args);this.block=n?n[0]:"",this.tpls=[];var i=N.parser.parseStream(t).on("tag:endblock",function(){return i.stop()}).on("template",function(e){return r.tpls.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});i.start()},render:(H=Q(regeneratorRuntime.mark(function e(t){var r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===(r=t.opts.blocks[this.block])){e.next=5;break}e.t0=r,e.next=8;break;case 5:return e.next=7,N.renderer.renderTemplates(this.tpls,t);case 7:e.t0=e.sent;case 8:if(n=e.t0,"store"===t.opts.blockMode)return t.opts.blocks[this.block]=n,e.abrupt("return","");e.next=12;break;case 12:return e.abrupt("return",n);case 13:case"end":return e.stop()}},e,this)})),function(e){return H.apply(this,arguments)})}),(G=e).registerTag("raw",{parse:function(e,t){var r=this;this.tokens=[];var n=G.parser.parseStream(t);n.on("token",function(e){"endraw"===e.name?n.stop():r.tokens.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")}),n.start()},render:function(e,t){return this.tokens.map(function(e){return e.raw}).join("")}}),U=e,W=t,B=new RegExp("^("+ne.source+")\\s+in\\s+("+ie.source+")(?:\\s+"+oe.source+")*$"),U.registerTag("tablerow",{parse:function(e,t){var r=this,n=B.exec(e.args);ue(n,"illegal tag: "+e.raw),this.variable=n[1],this.collection=n[2],this.templates=[];var i=void 0,o=U.parser.parseStream(t).on("start",function(){return i=r.templates}).on("tag:endtablerow",function(e){return o.stop()}).on("template",function(e){return i.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});o.start()},render:(J=Q(regeneratorRuntime.mark(function e(i,t){var r,n,o,a,u,s,c,l=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=W.evalExp(this.collection,i)||[],n=t.offset||0,o=void 0===t.limit?r.length:t.limit,r=r.slice(n,n+o),a=t.cols||r.length,u=r.map(function(e,t){var r={};return r[l.variable]=e,r}),s=void 0,c="",e.next=10,se(u,function(){var r=Q(regeneratorRuntime.mark(function e(t,r){var n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=Math.floor(r/a)+1,1==(n=r%a+1)&&(1!==s&&(c+="</tr>"),c+='<tr class="row'+s+'">'),c+='<td class="col'+n+'">',i.push(t),e.next=7,U.renderer.renderTemplates(l.templates,i);case 7:return c+=e.sent,c+="</td>",i.pop(t),e.abrupt("return",c);case 11:case"end":return e.stop()}},e,l)}));return function(e,t){return r.apply(this,arguments)}}());case 10:return 0<s&&(c+="</tr>"),e.abrupt("return",c);case 12:case"end":return e.stop()}},e,this)})),function(e,t){return J.apply(this,arguments)})}),K=t,(X=e).registerTag("unless",{parse:function(t,e){var r=this;this.templates=[],this.elseTemplates=[];var n=void 0,i=X.parser.parseStream(e).on("start",function(e){n=r.templates,r.cond=t.args}).on("tag:else",function(){return n=r.elseTemplates}).on("tag:endunless",function(e){return i.stop()}).on("template",function(e){return n.push(e)}).on("end",function(e){throw new Error("tag "+t.raw+" not closed")});i.start()},render:function(e,t){var r=K.evalExp(this.cond,e);return K.isFalsy(r)?X.renderer.renderTemplates(this.templates,e):X.renderer.renderTemplates(this.elseTemplates,e)}})}var Te=["January","February","March","April","May","June","July","August","September","October","November","December"],Se=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_e=Te.map(Oe),Le=Se.map(Oe),je={1:"st",2:"nd",3:"rd",default:"th"};function Oe(e){return e.slice(0,3)}var Me={daysInMonth:function(e){return[31,Me.isLeapYear(e)?29:28,31,30,31,30,31,31,30,31,30,31]},getDayOfYear:function(e){for(var t=0,r=0;r<e.getMonth();++r)t+=Me.daysInMonth(e)[r];return t+e.getDate()},getWeekOfYear:function(e,t){var r=this.getDayOfYear(e)+(t-e.getDay()),n=7-new Date(e.getFullYear(),0,1).getDay()+t;return Fe.pad(Math.floor((r-n)/7)+1,2)},isLeapYear:function(e){var t=e.getFullYear();return!(0!=(3&t)||!(t%100||t%400==0&&t))},getSuffix:function(e){var t=e.getDate().toString(),r=parseInt(t.slice(-1));return je[r]||je.default},century:function(e){return parseInt(e.getFullYear().toString().substring(0,2),10)}},Fe={pad:function(e,t,r){r||(r="0");for(var n=e.toString(),i=t-n.length;0<i--;)n=r+n;return n}},Pe={a:function(e){return Le[e.getDay()]},A:function(e){return Se[e.getDay()]},b:function(e){return _e[e.getMonth()]},B:function(e){return Te[e.getMonth()]},c:function(e){return e.toLocaleString()},C:function(e){return Me.century(e)},d:function(e){return Fe.pad(e.getDate(),2)},e:function(e){return Fe.pad(e.getDate(),2," ")},H:function(e){return Fe.pad(e.getHours(),2)},I:function(e){return Fe.pad(e.getHours()%12||12,2)},j:function(e){return Fe.pad(Me.getDayOfYear(e),3)},k:function(e){return Fe.pad(e.getHours(),2," ")},l:function(e){return Fe.pad(e.getHours()%12||12,2," ")},L:function(e){return Fe.pad(e.getMilliseconds(),3)},m:function(e){return Fe.pad(e.getMonth()+1,2)},M:function(e){return Fe.pad(e.getMinutes(),2)},p:function(e){return e.getHours()<12?"AM":"PM"},P:function(e){return e.getHours()<12?"am":"pm"},q:function(e){return Me.getSuffix(e)},s:function(e){return Math.round(e.valueOf()/1e3)},S:function(e){return Fe.pad(e.getSeconds(),2)},u:function(e){return e.getDay()||7},U:function(e){return Me.getWeekOfYear(e,0)},w:function(e){return e.getDay()},W:function(e){return Me.getWeekOfYear(e,1)},x:function(e){return e.toLocaleDateString()},X:function(e){return e.toLocaleTimeString()},y:function(e){return e.getFullYear().toString().substring(2,4)},Y:function(e){return e.getFullYear()},z:function(e){var t=e.getTimezoneOffset()/60*100;return(0<t?"-":"+")+Fe.pad(Math.abs(t),4)},"%":function(){return"%"}};Pe.h=Pe.b,Pe.N=Pe.L;var Ae={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},De={"&amp;":"&","&lt;":"<","&gt;":">","&#34;":'"',"&#39;":"'"},Ie={abs:function(e){return Math.abs(e)},append:function(e,t){return e+t},capitalize:function(e){return Ve(e).charAt(0).toUpperCase()+e.slice(1)},ceil:function(e){return Math.ceil(e)},concat:function(e,t){return Array.prototype.concat.call(e,t)},date:function(e,t){var r,n=e;return"now"===e?n=new Date:Z(e)&&(n=new Date(e)),(r=n)instanceof Date&&!isNaN(r.getTime())?function(e,t){for(var r="",n=t;;){var i=/%./g,o=i.exec(n);if(!o)return r+n;r+=n.slice(0,i.lastIndex-2),n=n.slice(i.lastIndex);var a=o[0].charAt(1),u=Pe[a];r+=u?u.call(this,e):"%"+a}}(n,t):e},default:function(e,t){return ge(e)?e:t},divided_by:function(e,t){return e/t},downcase:function(e){return e.toLowerCase()},escape:qe,escape_once:function(e){return qe(Ve(e).replace(/&(amp|lt|gt|#34|#39);/g,function(e){return De[e]}))},first:function(e){return e[0]},floor:function(e){return Math.floor(e)},join:function(e,t){return e.join(void 0===t?" ":t)},last:function(e){return y(e)},lstrip:function(e){return Ve(e).replace(/^\s+/,"")},map:function(e,t){return e.map(function(e){return e[t]})},minus:Ne(function(e,t){return e-t}),modulo:Ne(function(e,t){return e%t}),newline_to_br:function(e){return e.replace(/\n/g,"<br />")},plus:Ne(function(e,t){return Number(e)+Number(t)}),prepend:function(e,t){return t+e},remove:function(e,t){return e.split(t).join("")},remove_first:function(e,t){return e.replace(t,"")},replace:function(e,t,r){return Ve(e).split(t).join(r)},replace_first:function(e,t,r){return Ve(e).replace(t,r)},reverse:function(e){return e.reverse()},round:function(e,t){var r=Math.pow(10,t||0);return Math.round(e*r,t)/r},rstrip:function(e){return Ve(e).replace(/\s+$/,"")},size:function(e){return e.length},slice:function(e,t,r){return void 0===r&&(r=1),e.slice(t,t+r)},sort:function(e,t){return e.sort(t)},split:function(e,t){return Ve(e).split(t)},strip:function(e){return Ve(e).trim()},strip_html:function(e){return Ve(e).replace(/<script.*?<\/script>|<!--.*?-->|<style.*?<\/style>|<.*?>/g,"")},strip_newlines:function(e){return Ve(e).replace(/\n/g,"")},times:function(e,t){return e*t},truncate:function(e,t,r){return r=void 0===r?"...":r,t=t||16,(e=Ve(e)).length<=t?e:e.substr(0,t-r.length)+r},truncatewords:function(e,t,r){void 0===r&&(r="...");var n=e.split(" "),i=n.slice(0,t).join(" ");return n.length>t&&(i+=r),i},uniq:function(e){var t={};return(e||[]).filter(function(e){return!t.hasOwnProperty(e)&&(t[e]=!0)})},upcase:function(e){return Ve(e).toUpperCase()},url_decode:function(e){return e.split("+").map(decodeURIComponent).join(" ")},url_encode:function(e){return e.split(" ").map(encodeURIComponent).join("+")}};function qe(e){return Ve(e).replace(/&|<|>|"|'/g,function(e){return Ae[e]})}function Ce(e){var t=(e+"").split(".");return 1<t.length?t[1].length:0}function Ve(e){return e+""}function Ne(o){return function(e,t){var r,n,i=(r=e,n=t,Math.max(Ce(r),Ce(n)));return o(e,t).toFixed(i)}}function Ye(r){return function(e,t){for(var r in e=e||{})if(e.hasOwnProperty(r)&&!1===t(e[r],r,e))break;return e}(Ie,function(e,t){return r.registerFilter(t,e)})}Ye.filters=Ie;var $e,He,ze,Ge,Ue={init:function(e,t,r){return r.cache&&(this.cache={}),this.options=r,this.tag=e,this.filter=t,this.parser=ke(e,t),this.renderer=ee(we),Re(this,We),Ye(this),this},parse:function(e,t){var r=ce(e,t,this.options);return this.parser.parse(r)},render:function(e,t,r){r=m({},this.options,r);var n,i,o,a=(n=t,i=r,(o=ee(Y)).opts=m({dynamicPartials:!0,strict_variables:!1,strict_filters:!1,blocks:{},root:[]},i),o.contexts=[n||{}],o);return this.renderer.renderTemplates(e,a)},parseAndRender:(Ge=Q(regeneratorRuntime.mark(function e(t,r,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.parse(t);case 2:return i=e.sent,e.abrupt("return",this.render(i,r,n));case 4:case"end":return e.stop()}},e,this)})),function(e,t,r){return Ge.apply(this,arguments)}),getTemplate:(ze=Q(regeneratorRuntime.mark(function e(t,r){var n,i=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,X(t,r,this.options);case 2:return n=e.sent,e.abrupt("return",this.respectCache(n,Q(regeneratorRuntime.mark(function e(){var t;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,K(n);case 2:return t=e.sent,e.abrupt("return",i.parse(t,n));case 4:case"end":return e.stop()}},e,i)}))));case 4:case"end":return e.stop()}},e,this)})),function(e,t){return ze.apply(this,arguments)}),renderFile:(He=Q(regeneratorRuntime.mark(function e(t,r,n){var i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return n=m({},n),e.next=3,this.getTemplate(t,n.root);case 3:return i=e.sent,e.abrupt("return",this.render(i,r,n));case 5:case"end":return e.stop()}},e,this)})),function(e,t,r){return He.apply(this,arguments)}),respectCache:($e=Q(regeneratorRuntime.mark(function e(t,r){var n,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if((n=this.options.cache)&&this.cache[t])return e.abrupt("return",this.cache[t]);e.next=3;break;case 3:return e.next=5,r();case 5:return i=e.sent,n&&(this.cache[t]=i),e.abrupt("return",i);case 8:case"end":return e.stop()}},e,this)})),function(e,t){return $e.apply(this,arguments)}),evalValue:function(e,t){var r=this.parser.parseValue(e.trim());return this.renderer.evalValue(r,t)},registerFilter:function(e,t){return this.filter.register(e,t)},registerTag:function(e,t){return this.tag.register(e,t)},plugin:function(e){return e.call(this,We)},express:function(n){n=n||{};var i=this;return function(e,t,r){ue(te(this.root)||Z(this.root),"illegal views root, are you using express.js?"),n.root=this.root,i.renderFile(e,t,n).then(function(e){return r(null,e)},r)}}};function We(e){(e=m({root:["."],cache:!1,extname:"",dynamicPartials:!0,trim_tag_right:!1,trim_tag_left:!1,trim_value_right:!1,trim_value_left:!1,greedy:!0,strict_filters:!1,strict_variables:!1},e)).root=function(e){if(te(e))return e;if(Z(e))return[e];throw new TypeError("illegal root: "+e)}(e.root);var t,n,i,r=ee(Ue);return r.init((n={},i={render:(t=Q(regeneratorRuntime.mark(function e(t){var r,n;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=xe(this.token.args,t),"function"!=typeof(n=this.tagImpl).render)return e.abrupt("return","");e.next=4;break;case 4:return e.abrupt("return",n.render(t,r));case 5:case"end":return e.stop()}},e,this)})),function(e){return t.apply(this,arguments)}),parse:function(e,t){this.type="tag",this.token=e,this.name=e.name;var r=n[this.name];ue(r,"tag "+this.name+" not found"),this.tagImpl=ee(r),this.tagImpl.parse&&this.tagImpl.parse(e,t)}},{construct:function(e,t){var r=ee(i);return r.parse(e,t),r},register:function(e,t){n[e]=t},clear:function(){n={}}}),function(s){s=m({},s);var c={},t={render:function(e,t){var r=this.args.map(function(e){return he(e,t)});return r.unshift(e),this.filter.apply(null,r)},parse:function(e){var t=M.exec(e);ue(t,"illegal filter: "+e);var r=t[1],n=t[2]||"",i=c[r];if("function"!=typeof i){if(s.strict_filters)throw new TypeError("undefined filter: "+r);return this.name=r,this.filter=function(e){return e},this.args=[],this}for(var o=[];t=be.exec(n.trim());){var a=t[0],u=new RegExp(a+"\\s*:","g").exec(t.input);u&&u.index===t.index?o.push("'"+a+"'"):o.push(a)}return this.name=r,this.filter=i,this.args=o,this}};return{construct:function(e){return ee(t).parse(e)},register:function(e,t){c[e]=t},clear:function(){c={}}}}(e),e),r}return(We.default=We).isTruthy=ge,We.isFalsy=de,We.evalExp=fe,We.evalValue=he,We.Types={ParseError:q,TokenizationError:I,RenderBreakError:V,AssertionError:N,AssignScope:{},CaptureScope:{},IncrementScope:{},DecrementScope:{}},We});
//# sourceMappingURL=liquid.min.js.map