Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

liquidjs

Package Overview
Dependencies
Maintainers
1
Versions
208
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

liquidjs - npm Package Compare versions

Comparing version 9.2.0 to 9.3.0

4

CHANGELOG.md

@@ -1,2 +0,2 @@

# [9.2.0](https://github.com/harttle/liquidjs/compare/v9.1.1...v9.2.0) (2019-10-26)
# [9.3.0](https://github.com/harttle/liquidjs/compare/v9.2.0...v9.3.0) (2019-11-07)

@@ -6,3 +6,3 @@

* Support for the "render" tag [#163](https://github.com/harttle/liquidjs/issues/163) ([d5e7b04](https://github.com/harttle/liquidjs/commit/d5e7b04))
* support require.resolve for lookup, see [#168](https://github.com/harttle/liquidjs/issues/168) ([2dd4355](https://github.com/harttle/liquidjs/commit/2dd4355))

@@ -9,0 +9,0 @@ ## [9.1.1](https://github.com/harttle/liquidjs/compare/v9.1.0...v9.1.1) (2019-10-10)

@@ -7,2 +7,3 @@ export default interface IFS {

resolve: (root: string, file: string, ext: string) => string;
fallback?: (file: string) => string | undefined;
}

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).liquidjs={})}(this,function(e){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var y=function(){return(y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(s,o,u,a){return new(u=u||Promise)(function(e,t){function r(e){try{i(a.next(e))}catch(e){t(e)}}function n(e){try{i(a.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new u(function(e){e(t.value)}).then(r,n)}i((a=a.apply(s,o||[])).next())})}function w(r,n){var i,s,o,e,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,s&&(o=2&t[0]?s.return:t[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,t[1])).done)return o;switch(s=0,o&&(t=[2&t[0],o.value]),t[0]){case 0:case 1:o=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(o=0<(o=u.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3])){u.label=t[1];break}if(6===t[0]&&u.label<o[1]){u.label=o[1],o=t;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(t);break}o[2]&&u.ops.pop(),u.trys.pop();continue}t=n.call(r,u)}catch(e){t=[6,e],s=0}finally{i=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function m(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function r(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||0<t--)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e}var i=(o.prototype.valueOf=function(){},o.prototype.liquidMethodMissing=function(e){},o);function o(){}var u=Object.prototype.toString;function g(e){return"[object String]"===u.call(e)}function a(e){return"function"==typeof e}function c(e){return h(e=l(e))?"":String(e)}function l(e){return e instanceof i?e.valueOf():e}function p(e){return"number"==typeof e}function h(e){return null==e}function b(e){return"[object Array]"===u.call(e)}function f(e,t){for(var r in e=e||{})if(e.hasOwnProperty(r)&&!1===t(e[r],r,e))break;return e}function d(e){return e[e.length-1]}function x(e){var t=typeof e;return null!==e&&("object"==t||"function"==t)}function T(e,t,r){void 0===r&&(r=1);for(var n=[],i=e;i<t;i+=r)n.push(i);return n}function k(e,t,r){void 0===r&&(r=" ");for(var n=t-(e=String(e)).length;0<n--;)e=r+e;return e}var R,E=(t(S,R=Error),S.prototype.update=function(){var e=this.originalError,t=function(t){var r=t.input.split("\n"),e=Math.max(t.line-2,1),n=Math.min(t.line+3,r.length);return T(e,n+1).map(function(e){return(e===t.line?">> ":" ")+k(String(e),String(n).length)+"| "+r[e-1]}).join("\n")}(this.token);this.message=function(e,t){return t.file&&(e+=", file:"+t.file),e+=", line:"+t.line+", col:"+t.col}(e.message,this.token),this.stack=this.message+"\n"+t+"\n"+this.stack+"\nFrom "+e.stack},S);function S(e,t){var r=R.call(this,e.message)||this;return r.originalError=e,r.token=t,r}var q,O=(t(M,q=E),M);function M(e,t){var r=q.call(this,new Error(e),t)||this;return r.name="TokenizationError",q.prototype.update.call(r),r}var _,F=(t(L,_=E),L);function L(e,t){var r=_.call(this,e,t)||this;return r.name="ParseError",r.message=e.message,_.prototype.update.call(r),r}var P,D=(t(j,P=E),j.is=function(e){return e instanceof j},j);function j(e,t){var r=P.call(this,e,t.token)||this;return r.name="RenderError",r.message=e.message,P.prototype.update.call(r),r}var U,A=(t(N,U=Error),N);function N(e){var t=U.call(this,e)||this;return t.name="AssertionError",t.message=e+"",t}function H(e,t){if(!e)throw new A(t=t||"expect "+e+" to be true")}var z={root:["."],cache:!1,extname:"",dynamicPartials:!0,trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",strictFilters:!1,strictVariables:!1};function Y(e){return(e=e||{}).hasOwnProperty("root")&&(e.root=V(e.root)),e}function $(e){return y({},z,e)}function V(e){return b(e)?e:g(e)?[e]:[]}var C=(I.prototype.getRegister=function(e,t){return void 0===t&&(t={}),this.registers[e]=this.registers[e]||t},I.prototype.setRegister=function(e,t){return this.registers[e]=t},I.prototype.getAll=function(){return v([this.environments],this.scopes).reduce(function(e,t){return y(e,t)},{})},I.prototype.get=function(e){var t,r,n=this.parseProp(e),i=this.findScope(n[0])||this.environments;try{for(var s=m(n),o=s.next();!o.done;o=s.next()){var u=o.value;if(h(i=G(i,u))&&this.opts.strictVariables)throw new TypeError("undefined variable: "+u)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return i},I.prototype.push=function(e){return this.scopes.push(e)},I.prototype.pop=function(){return this.scopes.pop()},I.prototype.front=function(){return this.scopes[0]},I.prototype.findScope=function(e){for(var t=this.scopes.length-1;0<=t;t--){var r=this.scopes[t];if(e in r)return r}return null},I.prototype.parseProp=function(e){e=String(e);for(var t,r=[],n="",i=0;i<e.length;)switch(e[i]){case"[":o();var s=e[i+1];i=/['"]/.test(s)?(H(-1!==(t=e.indexOf(s,i+2)),"unbalanced "+s+": "+e),n=e.slice(i+2,t),o(),t+2):(H(-1!==(t=W(e,i+1)),"unbalanced []: "+e),n=e.slice(i+1,t),/^[+-]?\d+$/.test(n)||(n=String(this.get(n))),o(),t+1);break;case".":o(),i++;break;default:n+=e[i++]}if(o(),!r.length)throw new TypeError('invalid path:"'+e+'"');return r;function o(){n.length&&r.push(n),n=""}},I);function I(e,t,r){void 0===e&&(e={}),void 0===r&&(r=!1),this.scopes=[{}],this.registers={},this.sync=r,this.opts=$(t),this.environments=e}function G(e,t){return h(e)?e:(e=function e(t){return t&&a(t.toLiquid)?e(t.toLiquid()):t}(e))instanceof i?a(e[t])?e[t]():e.hasOwnProperty(t)?e[t]:e.liquidMethodMissing(t):"size"===t?function(e){return h(e.size)&&(b(e)||g(e))?e.length:e.size}(e):e[t]}function W(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 J,B={readFile:function(n){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,new Promise(function(e,t){var r=new XMLHttpRequest;r.onload=function(){200<=r.status&&r.status<300?e(r.responseText):t(new Error(r.statusText))},r.onerror=function(){t(new Error("An error occurred whilst receiving the response."))},r.open("GET",n),r.send()})]})})},resolve:function(e,t,i){return e.length&&"/"!==d(e)&&(e+="/"),function(e,t){var r=document.createElement("base");r.href=e;var n=document.getElementsByTagName("head")[0];n.insertBefore(r,n.firstChild);var i=document.createElement("a");i.href=t;var s=i.href;return n.removeChild(r),s}(e,t).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,function(e,t,r){var n=r.split("/").pop();return/\.\w+$/.test(n)?e:t+r+i})},exists:function(){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,!0]})})},existsSync:function(){return!0},readFileSync:function(e){var t=new XMLHttpRequest;if(t.open("GET",e,!1),t.send(),t.status<200||300<=t.status)throw new Error(t.statusText);return t.responseText}},X=function(e,t,r,n,i){this.trimLeft=!1,this.trimRight=!1,this.type="notset",this.col=n,this.line=r,this.raw=e,this.value=e,this.input=t,this.file=i},K=(t(Q,J=X),Q);function Q(e,t,r,n,i,s,o,u){var a=J.call(this,e,r,n,i,u)||this,c="-"===t[0],l="-"===d(t);return a.value=t.slice(c?1:0,l?-1:t.length).trim(),a.trimLeft=c||s,a.trimRight=l||o,a}var Z,ee=new RegExp(/'[^']*'/.source+"|"+/"[^"]*"/.source),te=/[+-]?(?:\d+\.?\d*|\.?\d+)/,re=/[\w-]+[?]?/,ne=new RegExp("\\[(?:"+ee.source+"|[\\w-\\.]+)\\]"),ie=new RegExp("(?:"+ee.source+"|"+/true|false/.source+"|"+te.source+")"),se=new RegExp(re.source+"(?:\\."+re.source+"|"+ne.source+")*"),oe=new RegExp("(?:"+se.source+"|"+te.source+")"),ue=new RegExp("\\("+oe.source+"\\.\\."+oe.source+"\\)"),ae=new RegExp("\\(("+oe.source+")\\.\\.("+oe.source+")\\)"),ce=new RegExp("(?:"+se.source+"|"+ie.source+"|"+ue.source+")"),le=new RegExp("(?:"+re.source+")\\s*:\\s*(?:"+ce.source+")"),pe=new RegExp("("+re.source+")\\s*:\\s*("+ce.source+")","g"),he=new RegExp("^\\s*("+re.source+")\\s*([\\s\\S]*?)\\s*$"),fe=new RegExp("^"+ee.source+"$"),de=new RegExp("^"+ae.source+"$"),ve=(t(ge,Z=K),ge.is=function(e){return"tag"===e.type},ge);function ge(e,t,r,n,i,s,o){var u=Z.call(this,e,t,r,n,i,s.trimTagLeft,s.trimTagRight,o)||this;u.type="tag";var a=u.value.match(he);if(!a)throw new O("illegal tag syntax",u);return u.name=a[1],u.args=a[2],u}var ye,we=(t(me,ye=X),me.is=function(e){return"html"===e.type},me);function me(e,t,r,n,i){var s=ye.call(this,e,t,r,n,i)||this;return s.type="html",s.value=e,s}function be(e,t){if(e&&we.is(e)){var r=t?/\s+$/g:/[\t\r ]*$/g;e.value=e.value.replace(r,"")}}function xe(e,t){if(e&&we.is(e)){var r=t?/^\s+/g:/^[\t\r ]*\n?/g;e.value=e.value.replace(r,"")}}var Te,ke,Re,Ee=(t(Se,Te=K),Se.is=function(e){return"output"===e.type},Se);function Se(e,t,r,n,i,s,o){var u=Te.call(this,e,t,r,n,i,s.trimOutputLeft,s.trimOutputRight,o)||this;return u.type="output",u}function qe(e){return e}(Re=ke=ke||{})[Re.HTML=0]="HTML",Re[Re.OUTPUT=1]="OUTPUT",Re[Re.TAG=2]="TAG";var Oe=(Me.prototype.tokenize=function(e,t){for(var r=[],n=this.options,i=n.tagDelimiterLeft,s=n.tagDelimiterRight,o=n.outputDelimiterLeft,u=n.outputDelimiterRight,a=0,c=1,l=ke.HTML,p="",h=0,f=1,d=1;a<e.length;){if("\n"===e[a]&&(c++,h=a+1),l===ke.HTML){if(e.substr(a,o.length)===o){p&&r.push(new we(qe(p),e,f,d,t)),f=c,d=a-h+1,a+=(p=o).length,l=ke.OUTPUT;continue}if(e.substr(a,i.length)===i){p&&r.push(new we(qe(p),e,f,d,t)),f=c,d=a-h+1,a+=(p=i).length,l=ke.TAG;continue}}else{if(l===ke.OUTPUT&&e.substr(a,u.length)===u){p+=u,r.push(new Ee(qe(p),p.slice(o.length,-u.length),e,f,d,this.options,t)),p="",f=c,d=(a+=u.length)-h+1,l=ke.HTML;continue}if(e.substr(a,s.length)===s){p+=s,r.push(new ve(qe(p),p.slice(i.length,-s.length),e,f,d,this.options,t)),p="",f=c,d=(a+=s.length)-h+1,l=ke.HTML;continue}}p+=e[a++]}if(l===ke.HTML)return p&&r.push(new we(qe(p),e,f,d,t)),function(e,t){t=y({greedy:!0},t);for(var r=!1,n=0;n<e.length;n++){var i=e[n];!r&&i.trimLeft&&be(e[n-1],t.greedy),ve.is(i)&&("raw"===i.name?r=!0:"endraw"===i.name&&(r=!1)),!r&&i.trimRight&&xe(e[n+1],t.greedy)}}(r,this.options),r;var v=l===ke.OUTPUT?"output":"tag",g=16<p.length?p.slice(0,13)+"...":p;throw new O(v+' "'+g+'" not closed',new X(qe(p),e,f,d,t))},Me);function Me(e){this.options=$(e)}var _e=(Fe.prototype.write=function(e){this.html+=e},Fe);function Fe(){this.html="",this.break=!1,this.continue=!1}var Le=(Pe.prototype.renderTemplates=function(t,r,n){var i,s,o,u,a,c,l,p;return void 0===n&&(n=new _e),w(this,function(e){switch(e.label){case 0:e.trys.push([0,7,8,9]),i=m(t),s=i.next(),e.label=1;case 1:if(s.done)return[3,6];o=s.value,e.label=2;case 2:return e.trys.push([2,4,,5]),[4,o.render(r,n)];case 3:return(u=e.sent())&&n.write(u),n.break||n.continue?[3,6]:[3,5];case 4:throw a=e.sent(),D.is(a)?a:new D(a,o);case 5:return s=i.next(),[3,1];case 6:return[3,9];case 7:return c=e.sent(),l={error:c},[3,9];case 8:try{s&&!s.done&&(p=i.return)&&p.call(i)}finally{if(l)throw l.error}return[7];case 9:return[2,n.html]}})},Pe);function Pe(){}function De(e){this.token=e}var je,Ue=(t(Ae,je=i),Ae.prototype.equals=function(e){return g(e)||b(e)?0===e.length:!!x(e)&&0===Object.keys(e).length},Ae.prototype.gt=function(){return!1},Ae.prototype.geq=function(){return!1},Ae.prototype.lt=function(){return!1},Ae.prototype.leq=function(){return!1},Ae.prototype.valueOf=function(){return""},Ae);function Ae(){return null!==je&&je.apply(this,arguments)||this}var Ne,He=(t(ze,Ne=Ue),ze.prototype.equals=function(e){return!1===e||!!h(l(e))||(g(e)?/^\s*$/.test(e):Ne.prototype.equals.call(this,e))},ze);function ze(){return null!==Ne&&Ne.apply(this,arguments)||this}var Ye,$e=(t(Ve,Ye=i),Ve.prototype.equals=function(e){return h(l(e))||e instanceof He},Ve.prototype.gt=function(){return!1},Ve.prototype.geq=function(){return!1},Ve.prototype.lt=function(){return!1},Ve.prototype.leq=function(){return!1},Ve.prototype.valueOf=function(){return null},Ve);function Ve(){return null!==Ye&&Ye.apply(this,arguments)||this}var Ce=(Ie.prototype.evaluate=function(e){var t=function(e){return"true"===(e=e.trim())||"false"!==e&&("nil"===e||"null"===e?new $e:"empty"===e?new Ue:"blank"===e?new He:isNaN(Number(e))?'"'!==e[0]&&"'"!==e[0]||e[0]!==d(e)?void 0:e.slice(1,-1):Number(e))}(this.str);return void 0!==t?t:e.get(this.str)},Ie.prototype.value=function(e){return l(this.evaluate(e))},Ie);function Ie(e){this.str=e}function Ge(e){return e&&a(e.equals)}function We(e){return!Je(e)}function Je(e){return!1===e||null==e}var Be={"==":1,"!=":1,">":1,"<":1,">=":1,"<=":1,contains:1,and:0,or:0},Xe={"==":function(e,t){return Ge(e)?e.equals(t):Ge(t)?t.equals(e):e===t},"!=":function(e,t){return Ge(e)?!e.equals(t):Ge(t)?!t.equals(e):e!==t},">":function(e,t){return Ge(e)?e.gt(t):Ge(t)?t.lt(e):t<e},"<":function(e,t){return Ge(e)?e.lt(t):Ge(t)?t.gt(e):e<t},">=":function(e,t){return Ge(e)?e.geq(t):Ge(t)?t.leq(e):t<=e},"<=":function(e,t){return Ge(e)?e.leq(t):Ge(t)?t.geq(e):e<=t},contains:function(e,t){return!(!e||!a(e.indexOf))&&-1<e.indexOf(t)},and:function(e,t){return We(e)&&We(t)},or:function(e,t){return We(e)||We(t)}},Ke=Object.keys(Be);function Qe(e){return Ke.includes(e)}var Ze=(et.prototype.evaluate=function(t){var r,n,i,s,o,u,a,c,l,p;return w(this,function(e){switch(e.label){case 0:H(t,"unable to evaluate: context not defined"),e.label=1;case 1:e.trys.push([1,9,10,11]),r=m(this.postfix),n=r.next(),e.label=2;case 2:return n.done?[3,8]:Qe(i=n.value)?(this.evaluateOnce(i),[3,7]):[3,3];case 3:return function(e){return"("===e[0]&&")"===e[e.length-1]}(i)?(o=(s=this.operands).push,[4,function(t,r){var n,i,s;return w(this,function(e){switch(e.label){case 0:return(n=t.match(de))?[4,new Ce(n[1]).value(r)]:[3,3];case 1:return i=e.sent(),[4,new Ce(n[2]).value(r)];case 2:return s=e.sent(),[2,T(+i,+s+1)];case 3:return[2]}})}(i,t)]):[3,5];case 4:return o.apply(s,[e.sent()]),[3,7];case 5:return a=(u=this.operands).push,[4,new Ce(i).evaluate(t)];case 6:a.apply(u,[e.sent()]),e.label=7;case 7:return n=r.next(),[3,2];case 8:return[3,11];case 9:return c=e.sent(),l={error:c},[3,11];case 10:try{n&&!n.done&&(p=r.return)&&p.call(r)}finally{if(l)throw l.error}return[7];case 11:return[2,this.operands[0]]}})},et.prototype.value=function(t){var r;return w(this,function(e){switch(e.label){case 0:return r=l,[4,this.evaluate(t)];case 1:return[2,r.apply(void 0,[e.sent()])]}})},et.prototype.evaluateOnce=function(e){var t=this.operands.pop(),r=this.operands.pop(),n=Xe[e](r,t);this.operands.push(n)},et);function et(e){void 0===e&&(e=""),this.operands=[],this.postfix=v(function(t){var r,n,i,s,o,u,a;return w(this,function(e){switch(e.label){case 0:r=[],e.label=1;case 1:e.trys.push([1,10,11,12]),n=m(function(t){var r,n,i,s,o;return w(this,function(e){switch(e.label){case 0:r=t.length,n="",i={'"':'"',"'":"'","[":"]","(":")"},s=0,e.label=1;case 1:if(!(s<r))return[3,8];switch(o=t[s],o){case"[":case'"':case"'":return[3,2];case" ":case"\t":case"\n":return[3,3]}return[3,6];case 2:for(n+=o;s+1<r&&(n+=t[++s],t[s]!==i[o]););return[3,7];case 3:return n?[4,n]:[3,5];case 4:e.sent(),e.label=5;case 5:return n="",[3,7];case 6:n+=o,e.label=7;case 7:return s++,[3,1];case 8:return n?[4,n]:[3,10];case 9:e.sent(),e.label=10;case 10:return[2]}})}(t)),i=n.next(),e.label=2;case 2:if(i.done)return[3,9];if(!Qe(s=i.value))return[3,6];e.label=3;case 3:return r.length&&Be[r[r.length-1]]>Be[s]?[4,r.pop()]:[3,5];case 4:return e.sent(),[3,3];case 5:return r.push(s),[3,8];case 6:return[4,s];case 7:e.sent(),e.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return o=e.sent(),u={error:o},[3,12];case 11:try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(u)throw u.error}return[7];case 12:return r.length?[4,r.pop()]:[3,14];case 13:return e.sent(),[3,12];case 14:return[2]}})}(e))}var tt=(rt.prototype.on=function(e,t){return this.handlers[e]=t,this},rt.prototype.trigger=function(e,t){var r=this.handlers[e];return!!r&&(r(t),!0)},rt.prototype.start=function(){var e;for(this.trigger("start");!this.stopRequested&&(e=this.tokens.shift());)if(!(this.trigger("token",e)||ve.is(e)&&this.trigger("tag:"+e.name,e))){var t=this.parseToken(e,this.tokens);this.trigger("template",t)}return this.stopRequested||this.trigger("end"),this},rt.prototype.stop=function(){return this.stopRequested=!0,this},rt);function rt(e,t){this.handlers={},this.stopRequested=!1,this.tokens=e,this.parseToken=t}var nt=(it.parse=function(e){var t,r=new it;for(pe.lastIndex=0;t=pe.exec(e);){var n=t[1],i=t[2];r[n]=i}return r},it.create=function(t,r){var n,i,s,o,u,a,c,l,p;return w(this,function(e){switch(e.label){case 0:n=it.parse(t),e.label=1;case 1:e.trys.push([1,6,7,8]),i=m(Object.keys(n)),s=i.next(),e.label=2;case 2:return s.done?[3,5]:(o=s.value,[4,new Ze((u=n)[a=o]).evaluate(r)]);case 3:u[a]=e.sent(),e.label=4;case 4:return s=i.next(),[3,2];case 5:return[3,8];case 6:return c=e.sent(),l={error:c},[3,8];case 7:try{s&&!s.done&&(p=i.return)&&p.call(i)}finally{if(l)throw l.error}return[7];case 8:return[2,n]}})},it);function it(){}var st,ot=(t(ut,st=De),ut.prototype.render=function(t,r){var n,i;return w(this,function(e){switch(e.label){case 0:return[4,nt.create(this.token.args,t)];case 1:return n=e.sent(),a((i=this.impl).render)?[4,i.render(t,n,r)]:[3,3];case 2:return[2,e.sent()];case 3:return[2]}})},ut.register=function(e,t){ut.impls[e]=t},ut.clear=function(){ut.impls={}},ut.impls={},ut);function ut(e,t,r){var n=st.call(this,e)||this;n.name=e.name;var i=ut.impls[e.name];return H(i,"tag "+e.name+" not found"),n.impl=Object.create(i),n.impl.liquid=r,n.impl.parse&&n.impl.parse(e,t),n}var at=(ct.prototype.render=function(t,r){var n,i,s,o,u,a,c,l,p,h,f,d;return w(this,function(e){switch(e.label){case 0:n=[],e.label=1;case 1:e.trys.push([1,8,9,10]),i=m(this.args),s=i.next(),e.label=2;case 2:return s.done?[3,7]:function(e){return b(e)}(o=s.value)?(a=(u=n).push,c=[o[0]],[4,new Ze(o[1]).evaluate(r)]):[3,4];case 3:return a.apply(u,[c.concat([e.sent()])]),[3,6];case 4:return p=(l=n).push,[4,new Ze(o).evaluate(r)];case 5:p.apply(l,[e.sent()]),e.label=6;case 6:return s=i.next(),[3,2];case 7:return[3,10];case 8:return h=e.sent(),f={error:h},[3,10];case 9:try{s&&!s.done&&(d=i.return)&&d.call(i)}finally{if(f)throw f.error}return[7];case 10:return[2,this.impl.apply({context:r},v([t],n))]}})},ct.register=function(e,t){ct.impls[e]=t},ct.clear=function(){ct.impls={}},ct.impls={},ct);function ct(e,t,r){var n=ct.impls[e];if(!n&&r)throw new TypeError("undefined filter: "+e);this.name=e,this.impl=n||function(e){return e},this.args=t}var lt=(pt.prototype.parseFilters=function(e,t){for(var r=t;r<e.length;)if("|"===e[r]){for(var n=++r;r<e.length&&"|"!==e[r];)r++;this.parseFilter(e,n,r)}else r++},pt.prototype.parseFilter=function(e,t,r){for(var n,i,s=e[t],o=[],u=t+1;u<r+1;u++)u===r||","===e[u]?((n||i)&&o.push(n?[n,i]:i),i=n=void 0):":"===e[u]?(n=i,i=void 0):void 0===i&&(i=e[u]);this.filters.push(new at(s,o,this.strictFilters))},pt.prototype.value=function(t){var r,n,i,s,o,u;return w(this,function(e){switch(e.label){case 0:return[4,new Ze(this.initial).evaluate(t)];case 1:r=e.sent(),e.label=2;case 2:e.trys.push([2,7,8,9]),n=m(this.filters),i=n.next(),e.label=3;case 3:return i.done?[3,6]:[4,i.value.render(r,t)];case 4:r=e.sent(),e.label=5;case 5:return i=n.next(),[3,3];case 6:return[3,9];case 7:return s=e.sent(),o={error:s},[3,9];case 8:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(o)throw o.error}return[7];case 9:return[2,r]}})},pt.tokenize=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if('"'===n||"'"===n){var i=r;for(r+=2;r<e.length&&e[r-1]!==n;++r);t.push(e.slice(i,r))}else if(/\s/.test(n))r++;else if(/[|,:]/.test(n))t.push(e[r++]);else{i=r++;for(var s=void 0;r<e.length&&!/[|,:\s]/.test(s=e[r]);++r)if('"'===s||"'"===s)for(r+=2;r<e.length&&e[r-1]!==s;++r);t.push(e.slice(i,r))}}return t},pt);function pt(e,t){this.filters=[];var r=pt.tokenize(e);this.strictFilters=t,this.initial=r[0],this.parseFilters(r,1)}var ht,ft=(t(dt,ht=De),dt.prototype.render=function(t,r){var n;return w(this,function(e){switch(e.label){case 0:return[4,this.value.value(t)];case 1:return n=e.sent(),r.write(c(l(n))),[2]}})},dt);function dt(e,t){var r=ht.call(this,e)||this;return r.value=new lt(e.value,t),r}var vt,gt=(t(yt,vt=De),yt.prototype.render=function(e,t){return w(this,function(e){return t.write(this.str),[2]})},yt);function yt(e){var t=vt.call(this,e)||this;return t.str=e.value,t}var wt=(mt.prototype.parse=function(e){for(var t,r=[];t=e.shift();)r.push(this.parseToken(t,e));return r},mt.prototype.parseToken=function(t,e){try{return ve.is(t)?new ot(t,e,this.liquid):Ee.is(t)?new ft(t,this.liquid.options.strictFilters):new gt(t)}catch(e){throw new F(e,t)}},mt.prototype.parseStream=function(e){var r=this;return new tt(e,function(e,t){return r.parseToken(e,t)})},mt);function mt(e){this.liquid=e}var bt,xt=new RegExp("("+re.source+")\\s*=([^]*)"),Tt={parse:function(e){var t=e.args.match(xt);H(t,"illegal token "+e.raw),this.key=t[1],this.value=t[2]},render:function(t){var r,n;return w(this,function(e){switch(e.label){case 0:return r=t.front(),n=this.key,[4,this.liquid._evalValue(this.value,t)];case 1:return r[n]=e.sent(),[2]}})}},kt=(t(Rt,bt=i),Rt.prototype.next=function(){this.i++},Rt.prototype.index0=function(){return this.i},Rt.prototype.index=function(){return this.i+1},Rt.prototype.first=function(){return 0===this.i},Rt.prototype.last=function(){return this.i===this.length-1},Rt.prototype.rindex=function(){return this.length-this.i},Rt.prototype.rindex0=function(){return this.length-this.i-1},Rt.prototype.valueOf=function(){return JSON.stringify(this)},Rt);function Rt(e){var t=bt.call(this)||this;return t.i=0,t.length=e,t}var Et,St,qt=new RegExp("^("+re.source+")\\s+in\\s+("+ce.source+")(?:\\s+"+le.source+")*(?:\\s+(reversed))?(?:\\s+"+le.source+")*$"),Ot={type:"block",parse:function(e,t){var r,n=this,i=qt.exec(e.args);H(i,"illegal tag: "+e.raw),this.variable=i[1],this.collection=i[2],this.reversed=!!i[3],this.templates=[],this.elseTemplates=[];var s=this.liquid.parser.parseStream(t).on("start",function(){return r=n.templates}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endfor",function(){return s.stop()}).on("template",function(e){return r.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});s.start()},render:function(t,r,n){var i,s,o,u,a,c,l,p,h,f,d;return w(this,function(e){switch(e.label){case 0:return i=this.liquid.renderer,[4,new Ze(this.collection).value(t)];case 1:return b(s=e.sent())||(g(s)&&0<s.length?s=[s]:x(s)&&(s=Object.keys(s).map(function(e){return[e,s[e]]}))),b(s)&&s.length?[3,3]:[4,i.renderTemplates(this.elseTemplates,t,n)];case 2:return e.sent(),[2];case 3:o=r.offset||0,u=void 0===r.limit?s.length:r.limit,s=s.slice(o,o+u),this.reversed&&s.reverse(),a={forloop:new kt(s.length)},t.push(a),e.label=4;case 4:e.trys.push([4,9,10,11]),c=m(s),l=c.next(),e.label=5;case 5:return l.done?[3,8]:(p=l.value,a[this.variable]=p,[4,i.renderTemplates(this.templates,t,n)]);case 6:if(e.sent(),n.break)return n.break=!1,[3,8];n.continue=!1,a.forloop.next(),e.label=7;case 7:return l=c.next(),[3,5];case 8:return[3,11];case 9:return h=e.sent(),f={error:h},[3,11];case 10:try{l&&!l.done&&(d=c.return)&&d.call(c)}finally{if(f)throw f.error}return[7];case 11:return t.pop(),[2]}})}},Mt=new RegExp("("+re.source+")"),_t={parse:function(e,t){var r=this,n=e.args.match(Mt);H(n,e.args+" not valid identifier"),this.variable=n[1],this.templates=[];var i=this.liquid.parser.parseStream(t);i.on("tag:endcapture",function(){return i.stop()}).on("template",function(e){return r.templates.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")}),i.start()},render:function(t){var r;return w(this,function(e){switch(e.label){case 0:return[4,this.liquid.renderer.renderTemplates(this.templates,t)];case 1:return r=e.sent(),t.front()[this.variable]=r,[2]}})}},Ft={parse:function(e,t){var r=this;this.cond=e.args,this.cases=[],this.elseTemplates=[];var n=[],i=this.liquid.parser.parseStream(t).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(){return i.stop()}).on("template",function(e){return n.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});i.start()},render:function(t,e,r){var n,i,s,o,u;return w(this,function(e){switch(e.label){case 0:n=this.liquid.renderer,i=0,e.label=1;case 1:return i<this.cases.length?(s=this.cases[i],[4,new Ze(s.val).value(t)]):[3,6];case 2:return o=e.sent(),[4,new Ze(this.cond).value(t)];case 3:return u=e.sent(),o!==u?[3,5]:[4,n.renderTemplates(s.templates,t,r)];case 4:return e.sent(),[2];case 5:return i++,[3,1];case 6:return[4,n.renderTemplates(this.elseTemplates,t,r)];case 7:return e.sent(),[2]}})}},Lt={parse:function(e,t){var r=this.liquid.parser.parseStream(t);r.on("token",function(e){"endcomment"===e.name&&r.stop()}).on("end",function(){throw new Error("tag "+e.raw+" not closed")}),r.start()}};(St=Et=Et||{})[St.OUTPUT=0]="OUTPUT",St[St.STORE=1]="STORE";var Pt,Dt=Et,jt=/[^\s,]+/,Ut=new RegExp("with\\s+("+ce.source+")"),At={parse:function(e){var t=jt.exec(e.args);t&&(this.staticValue=t[0]),(t=ce.exec(e.args))&&(this.value=t[0]),(t=Ut.exec(e.args))&&(this.with=t[1])},render:function(t,r,n){var i,s,o,u,a,c,l;return w(this,function(e){switch(e.label){case 0:return t.opts.dynamicPartials?fe.exec(this.value)?(s=this.value.slice(1,-1),[4,this.liquid._parseAndRender(s,t.getAll(),t.opts,t.sync)]):[3,2]:[3,5];case 1:return i=e.sent(),[3,4];case 2:return[4,new Ze(this.value).value(t)];case 3:i=e.sent(),e.label=4;case 4:return[3,6];case 5:i=this.staticValue,e.label=6;case 6:return H(i,"cannot include with empty filename"),o=t.getRegister("blocks"),u=t.getRegister("blockMode"),t.setRegister("blocks",{}),t.setRegister("blockMode",Dt.OUTPUT),this.with?(a=r,c=i,[4,new Ze(this.with).evaluate(t)]):[3,8];case 7:a[c]=e.sent(),e.label=8;case 8:return[4,this.liquid._parseFile(i,t.opts,t.sync)];case 9:return l=e.sent(),t.push(r),[4,this.liquid.renderer.renderTemplates(l,t,n)];case 10:return e.sent(),t.pop(),t.setRegister("blocks",o),t.setRegister("blockMode",u),[2]}})}},Nt=/[^\s,]+/,Ht=new RegExp("with\\s+("+ce.source+")"),zt={parse:function(e){var t=Nt.exec(e.args);t&&(this.staticValue=t[0]),(t=ce.exec(e.args))&&(this.value=t[0]),(t=Ht.exec(e.args))&&(this.with=t[1])},render:function(t,r,n){var i,s,o,u,a,c,l,p;return w(this,function(e){switch(e.label){case 0:return t.opts.dynamicPartials?fe.exec(this.value)?(s=this.value.slice(1,-1),[4,this.liquid._parseAndRender(s,t.getAll(),t.opts,t.sync)]):[3,2]:[3,5];case 1:return i=e.sent(),[3,4];case 2:return[4,new Ze(this.value).value(t)];case 3:i=e.sent(),e.label=4;case 4:return[3,6];case 5:i=this.staticValue,e.label=6;case 6:return H(i,"cannot render with empty filename"),o=t.getRegister("blocks"),u=t.getRegister("blockMode"),(a=new C({},t.opts,t.sync)).setRegister("blocks",{}),a.setRegister("blockMode",Dt.OUTPUT),this.with?(c=r,l=i,[4,new Ze(this.with).evaluate(t)]):[3,8];case 7:c[l]=e.sent(),e.label=8;case 8:return a.push(r),[4,this.liquid._parseFile(i,a.opts,a.sync)];case 9:return p=e.sent(),[4,this.liquid.renderer.renderTemplates(p,a,n)];case 10:return e.sent(),a.setRegister("blocks",o),a.setRegister("blockMode",u),[2]}})}},Yt={parse:function(e){var t=e.args.match(re);H(t,"illegal identifier "+e.args),this.variable=t[0]},render:function(e,t,r){var n=e.environments;p(n[this.variable])||(n[this.variable]=0),r.write(c(--n[this.variable]))}},$t=new RegExp("^(?:("+ce.source+")\\s*:\\s*)?(.*)$"),Vt=new RegExp(ce.source,"g"),Ct={parse:function(e){var t=$t.exec(e.args);H(t,"illegal tag: "+e.raw),this.group=new Ze(t[1]);var r=t[2];for(this.candidates=[];t=Vt.exec(r);)this.candidates.push(t[0]);H(this.candidates.length,"empty candidates: "+e.raw)},render:function(t,e,r){var n,i,s,o,u,a;return w(this,function(e){switch(e.label){case 0:return[4,this.group.value(t)];case 1:return n=e.sent(),i="cycle:"+n+":"+this.candidates.join(","),s=t.getRegister("cycle"),void 0===(o=s[i])&&(o=s[i]=0),u=this.candidates[o],o=(o+1)%this.candidates.length,s[i]=o,[4,new Ze(u).value(t)];case 2:return a=e.sent(),r.write(a),[2]}})}},It={parse:function(e,t){var r,n=this;this.branches=[],this.elseTemplates=[];var i=this.liquid.parser.parseStream(t).on("start",function(){return n.branches.push({cond:e.args,templates:r=[]})}).on("tag:elsif",function(e){n.branches.push({cond:e.args,templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endif",function(){return i.stop()}).on("template",function(e){return r.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});i.start()},render:function(t,e,r){var n,i,s,o,u,a,c;return w(this,function(e){switch(e.label){case 0:n=this.liquid.renderer,e.label=1;case 1:e.trys.push([1,7,8,9]),i=m(this.branches),s=i.next(),e.label=2;case 2:return s.done?[3,6]:(o=s.value,[4,new Ze(o.cond).value(t)]);case 3:return We(e.sent())?[4,n.renderTemplates(o.templates,t,r)]:[3,5];case 4:return e.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return u=e.sent(),a={error:u},[3,9];case 8:try{s&&!s.done&&(c=i.return)&&c.call(i)}finally{if(a)throw a.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,t,r)];case 10:return e.sent(),[2]}})}},Gt={parse:function(e){var t=e.args.match(re);H(t,"illegal identifier "+e.args),this.variable=t[0]},render:function(e,t,r){var n=e.environments;p(n[this.variable])||(n[this.variable]=0);var i=n[this.variable];n[this.variable]++,r.write(c(i))}},Wt=/\S+/,Jt={parse:function(e,t){var r=Wt.exec(e.args);r&&(this.staticLayout=r[0]),(r=ce.exec(e.args))&&(this.layout=r[0]),this.tpls=this.liquid.parser.parse(t)},render:function(t,r,n){var i,s,o,u,a,c,l;return w(this,function(e){switch(e.label){case 0:return t.opts.dynamicPartials?[4,new Ze(this.layout).value(t)]:[3,2];case 1:return s=e.sent(),[3,3];case 2:s=this.staticLayout,e.label=3;case 3:return H(i=s,"cannot apply layout with empty filename"),t.setRegister("blockMode",Dt.STORE),o=t.getRegister("blocks"),[4,(u=this.liquid.renderer).renderTemplates(this.tpls,t)];case 4:return a=e.sent(),void 0===o[""]&&(o[""]=a),[4,this.liquid._parseFile(i,t.opts,t.sync)];case 5:return c=e.sent(),t.push(r),t.setRegister("blockMode",Dt.OUTPUT),[4,u.renderTemplates(c,t)];case 6:return l=e.sent(),t.pop(),n.write(l),[2]}})}},Bt={parse:function(e,t){var r=this,n=/\w+/.exec(e.args);this.block=n?n[0]:"",this.tpls=[];var i=this.liquid.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:function(t,e,r){var n,i,s,o,u;return w(this,function(e){switch(e.label){case 0:return n=t.getRegister("blocks"),i=n[this.block],s=this.liquid.renderer,void 0===i?[3,1]:(u=i,[3,3]);case 1:return[4,s.renderTemplates(this.tpls,t)];case 2:u=e.sent(),e.label=3;case 3:return o=u,t.getRegister("blockMode",Dt.OUTPUT)===Dt.STORE?(n[this.block]=o,[2]):(r.write(o),[2])}})}},Xt={parse:function(e,t){var r=this;this.tokens=[];var n=this.liquid.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(){return this.tokens.map(function(e){return e.raw}).join("")}},Kt=(t(Qt,Pt=kt),Qt.prototype.row=function(){return Math.floor(this.i/this.cols)+1},Qt.prototype.col0=function(){return this.i%this.cols},Qt.prototype.col=function(){return this.col0()+1},Qt.prototype.col_first=function(){return 0===this.col0()},Qt.prototype.col_last=function(){return this.col()===this.cols},Qt);function Qt(e,t){var r=Pt.call(this,e)||this;return r.length=e,r.cols=t,r}var Zt=new RegExp("^("+re.source+")\\s+in\\s+("+ce.source+")(?:\\s+"+le.source+")*$"),er={assign:Tt,for:Ot,capture:_t,case:Ft,comment:Lt,include:At,render:zt,decrement:Yt,increment:Gt,cycle:Ct,if:It,layout:Jt,block:Bt,raw:Xt,tablerow:{parse:function(e,t){var r,n=this,i=Zt.exec(e.args);H(i,"illegal tag: "+e.raw),this.variable=i[1],this.collection=i[2],this.templates=[];var s=this.liquid.parser.parseStream(t).on("start",function(){return r=n.templates}).on("tag:endtablerow",function(){return s.stop()}).on("template",function(e){return r.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});s.start()},render:function(t,r,n){var i,s,o,u,a,c,l,p;return w(this,function(e){switch(e.label){case 0:return[4,new Ze(this.collection).value(t)];case 1:i=e.sent()||[],s=r.offset||0,o=void 0===r.limit?i.length:r.limit,i=i.slice(s,s+o),u=r.cols||i.length,a=this.liquid.renderer,c=new Kt(i.length,u),l={tablerowloop:c},t.push(l),p=0,e.label=2;case 2:return p<i.length?(l[this.variable]=i[p],0===c.col0()&&(1!==c.row()&&n.write("</tr>"),n.write('<tr class="row'+c.row()+'">')),n.write('<td class="col'+c.col()+'">'),[4,a.renderTemplates(this.templates,t,n)]):[3,5];case 3:e.sent(),n.write("</td>"),e.label=4;case 4:return p++,c.next(),[3,2];case 5:return i.length&&n.write("</tr>"),t.pop(),[2]}})}},unless:{parse:function(e,t){var r,n=this;this.templates=[],this.elseTemplates=[];var i=this.liquid.parser.parseStream(t).on("start",function(){r=n.templates,n.cond=e.args}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endunless",function(){return i.stop()}).on("template",function(e){return r.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});i.start()},render:function(t,e,r){var n;return w(this,function(e){switch(e.label){case 0:return n=this.liquid.renderer,[4,new Ze(this.cond).value(t)];case 1:return[4,Je(e.sent())?n.renderTemplates(this.templates,t,r):n.renderTemplates(this.elseTemplates,t,r)];case 2:return e.sent(),[2]}})}},break:{render:function(e,t,r){r.break=!0}},continue:{render:function(e,t,r){r.continue=!0}}},tr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},rr={"&amp;":"&","&lt;":"<","&gt;":">","&#34;":'"',"&#39;":"'"};function nr(e){return c(e).replace(/&|<|>|"|'/g,function(e){return tr[e]})}var ir={escape:nr,escape_once:function(e){return nr(function(e){return String(e).replace(/&(amp|lt|gt|#34|#39);/g,function(e){return rr[e]})}(e))},newline_to_br:function(e){return e.replace(/\n/g,"<br />")},strip_html:function(e){return e.replace(/<script.*?<\/script>|<!--.*?-->|<style.*?<\/style>|<.*?>/g,"")}},sr={append:function(e,t){return c(e)+c(t)},prepend:function(e,t){return c(t)+c(e)},capitalize:function(e){return(e=c(e)).charAt(0).toUpperCase()+e.slice(1)},lstrip:function(e){return c(e).replace(/^\s+/,"")},downcase:function(e){return c(e).toLowerCase()},upcase:function(e){return c(e).toUpperCase()},remove:function(e,t){return c(e).split(t).join("")},remove_first:function(e,t){return c(e).replace(t,"")},replace:function(e,t,r){return c(e).split(t).join(r)},replace_first:function(e,t,r){return c(e).replace(t,r)},rstrip:function(e){return c(e).replace(/\s+$/,"")},split:function(e,t){return c(e).split(t)},strip:function(e){return c(e).trim()},strip_newlines:function(e){return c(e).replace(/\n/g,"")},truncate:function(e,t,r){void 0===t&&(t=50);void 0===r&&(r="...");return(e=c(e)).length<=t?e:e.substr(0,t-r.length)+r},truncatewords:function(e,t,r){void 0===t&&(t=15);void 0===r&&(r="...");var n=e.split(/\s+/),i=n.slice(0,t).join(" ");n.length>=t&&(i+=r);return i}};var or=String.prototype.toLowerCase,ur={abs:function(e){return Math.abs(e)},at_least:function(e,t){return Math.max(e,t)},at_most:function(e,t){return Math.min(e,t)},ceil:function(e){return Math.ceil(e)},divided_by:function(e,t){return e/t},floor:function(e){return Math.floor(e)},minus:function(e,t){return e-t},modulo:function(e,t){return e%t},round:function(e,t){void 0===t&&(t=0);var r=Math.pow(10,t);return Math.round(e*r)/r},plus:function(e,t){return Number(e)+Number(t)},sort_natural:function(e,r){return e&&e.sort?void 0===r?v(e).sort(ar):v(e).sort(function(e,t){return ar(e[r],t[r])}):[]},times:function(e,t){return e*t}};function ar(e,t){return t?e?(e=or.call(e))<(t=or.call(t))?-1:t<e?1:0:1:-1}var cr={url_decode:function(e){return e.split("+").map(decodeURIComponent).join(" ")},url_encode:function(e){return e.split(" ").map(encodeURIComponent).join("+")}},lr={join:function(e,t){return e.join(void 0===t?" ":t)},last:function(e){return b(e)?d(e):""},first:function(e){return b(e)?e[0]:""},map:function(e,t){return e.map(function(e){return e[t]})},reverse:function(e){return v(e).reverse()},sort:function(e,t){return e.sort(t)},size:function(e){return e&&e.length||0},concat:function(e,t){return Array.prototype.concat.call(e,t)},slice:function(e,t,r){void 0===r&&(r=1);return t=t<0?e.length+t:t,e.slice(t,t+r)},uniq:function(e){var t={};return(e||[]).filter(function(e){return!t.hasOwnProperty(String(e))&&(t[String(e)]=!0)})},where:function(e,t,r){return e.filter(function(e){return void 0===r?We(e[t]):e[t]===r})}};var pr=["January","February","March","April","May","June","July","August","September","October","November","December"],hr=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],fr=pr.map(gr),dr=hr.map(gr),vr={1:"st",2:"nd",3:"rd",default:"th"};function gr(e){return e.slice(0,3)}var yr={daysInMonth:function(e){return[31,yr.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+=yr.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 k(String(Math.floor((r-n)/7)+1),2,"0")},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 vr[r]||vr.default},century:function(e){return parseInt(e.getFullYear().toString().substring(0,2),10)}},wr={a:function(e){return dr[e.getDay()]},A:function(e){return hr[e.getDay()]},b:function(e){return fr[e.getMonth()]},B:function(e){return pr[e.getMonth()]},c:function(e){return e.toLocaleString()},C:function(e){return yr.century(e)},d:function(e){return k(e.getDate(),2,"0")},e:function(e){return k(e.getDate(),2)},H:function(e){return k(e.getHours(),2,"0")},I:function(e){return k(String(e.getHours()%12||12),2,"0")},j:function(e){return k(yr.getDayOfYear(e),3,"0")},k:function(e){return k(e.getHours(),2)},l:function(e){return k(String(e.getHours()%12||12),2)},L:function(e){return k(e.getMilliseconds(),3,"0")},m:function(e){return k(e.getMonth()+1,2,"0")},M:function(e){return k(e.getMinutes(),2,"0")},p:function(e){return e.getHours()<12?"AM":"PM"},P:function(e){return e.getHours()<12?"am":"pm"},q:function(e){return yr.getSuffix(e)},s:function(e){return Math.round(e.valueOf()/1e3)},S:function(e){return k(e.getSeconds(),2,"0")},u:function(e){return e.getDay()||7},U:function(e){return yr.getWeekOfYear(e,0)},w:function(e){return e.getDay()},W:function(e){return yr.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?"-":"+")+k(String(Math.abs(t)),4,"0")},"%":function(){return"%"}};wr.h=wr.b,wr.N=wr.L;var mr=y({},ir,sr,ur,cr,{date:function(e,t){var r=e;return"now"===e?r=new Date:p(e)?r=new Date(1e3*e):g(e)&&(r=/^\d+$/.test(e)?new Date(1e3*+e):new Date(e)),function(e){return e instanceof Date&&!isNaN(e.getTime())}(r)?function(e,t){for(var r="",n=t;;){var i=/%./g,s=i.exec(n);if(!s)return r+n;r+=n.slice(0,i.lastIndex-2),n=n.slice(i.lastIndex);var o=s[0].charAt(1),u=wr[o];r+=u?u(e):"%"+o}}(r,t):e}},{default:function(e,t){return Je(l(e))||""===e?t:e}},lr);function br(t){var e={then:function(e){return e(t)},catch:function(){return e}};return e}function xr(r){var n={then:function(e,t){return t?t(r):n},catch:function(e){return e(r)}};return n}function Tr(n){return function(e){return e&&a(e.then)}(n)?n:function(e){return e&&a(e.next)&&a(e.throw)&&a(e.return)}(n)?function r(e){var t;try{t=n.next(e)}catch(e){return xr(e)}if(t.done)return br(t.value);return Tr(t.value).then(r,function(e){var t;try{t=n.throw(e)}catch(e){return xr(e)}return t.done?br(t.value):r(t.value)})}():br(n)}function kr(e){var t;return Tr(e).then(function(e){return br(t=e)}).catch(function(e){throw e}),t}var Rr=(Er.prototype.parse=function(e,t){var r=this.tokenizer.tokenize(e,t);return this.parser.parse(r)},Er.prototype._render=function(e,t,r,n){var i=y({},this.options,Y(r)),s=new C(t,i,n);return this.renderer.renderTemplates(e,s)},Er.prototype.render=function(t,r,n){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,Tr(this._render(t,r,n,!1))]})})},Er.prototype.renderSync=function(e,t,r){return kr(this._render(e,t,r,!0))},Er.prototype._parseAndRender=function(e,t,r,n){var i=this.parse(e);return this._render(i,t,r,n)},Er.prototype.parseAndRender=function(t,r,n){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,Tr(this._parseAndRender(t,r,n,!1))]})})},Er.prototype.parseAndRenderSync=function(e,t,r){return kr(this._parseAndRender(e,t,r,!0))},Er.prototype._parseFile=function(t,r,n){var i,s,o,u,a,c,l,p,h,f,d,v,g=this;return w(this,function(e){switch(e.label){case 0:i=y({},this.options,Y(r)),s=i.root.map(function(e){return g.fs.resolve(e,t,i.extname)}),e.label=1;case 1:e.trys.push([1,11,12,13]),o=m(s),u=o.next(),e.label=2;case 2:return u.done?[3,10]:(a=u.value,this.options.cache&&this.cache[a]?[2,this.cache[a]]:n?(c=this.fs.existsSync(a),[3,5]):[3,3]);case 3:return[4,this.fs.exists(a)];case 4:c=e.sent(),e.label=5;case 5:return c?(p=this.parse,n?(h=B.readFileSync(a),[3,8]):[3,6]):[3,9];case 6:return[4,this.fs.readFile(a)];case 7:h=e.sent(),e.label=8;case 8:return l=p.apply(this,[h,a]),[2,this.cache[a]=l];case 9:return u=o.next(),[3,2];case 10:return[3,13];case 11:return f=e.sent(),d={error:f},[3,13];case 12:try{u&&!u.done&&(v=o.return)&&v.call(o)}finally{if(d)throw d.error}return[7];case 13:throw this.lookupError(t,i.root)}})},Er.prototype.parseFile=function(t,r){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,Tr(this._parseFile(t,r,!1))]})})},Er.prototype.parseFileSync=function(e,t){return kr(this._parseFile(e,t,!0))},Er.prototype.renderFile=function(r,n,i){return s(this,void 0,void 0,function(){var t;return w(this,function(e){switch(e.label){case 0:return[4,this.parseFile(r,i)];case 1:return t=e.sent(),[2,this.render(t,n,i)]}})})},Er.prototype.renderFileSync=function(e,t,r){var n=Y(r),i=this.parseFileSync(e,n);return this.renderSync(i,t,r)},Er.prototype._evalValue=function(e,t){return new lt(e,this.options.strictFilters).value(t)},Er.prototype.evalValue=function(t,r){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,Tr(this._evalValue(t,r))]})})},Er.prototype.evalValueSync=function(e,t){return kr(this._evalValue(e,t))},Er.prototype.registerFilter=function(e,t){return at.register(e,t)},Er.prototype.registerTag=function(e,t){return ot.register(e,t)},Er.prototype.plugin=function(e){return e.call(this,Er)},Er.prototype.express=function(){var i=this;return function(e,t,r){var n={root:v(V(this.root),i.options.root)};i.renderFile(e,t,n).then(function(e){return r(null,e)},r)}},Er.prototype.lookupError=function(e,t){var r=new Error("ENOENT");return r.message='ENOENT: Failed to lookup "'+e+'" in "'+t+'"',r.code="ENOENT",r},Er.prototype.getTemplate=function(t,r){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,this.parseFile(t,r)]})})},Er.prototype.getTemplateSync=function(e,t){return this.parseFileSync(e,t)},Er);function Er(e){var r=this;void 0===e&&(e={}),this.cache={},this.options=$(Y(e)),this.parser=new wt(this),this.renderer=new Le,this.tokenizer=new Oe(this.options),this.fs=e.fs||B,f(er,function(e,t){return r.registerTag(t,e)}),f(mr,function(e,t){return r.registerFilter(t,e)})}e.AssertionError=A,e.Context=C,e.Drop=i,e.Emitter=_e,e.Expression=Ze,e.Hash=nt,e.Liquid=Rr,e.ParseError=F,e.ParseStream=tt,e.TagToken=ve,e.Token=X,e.TokenizationError=O,e.isFalsy=Je,e.isTruthy=We,Object.defineProperty(e,"__esModule",{value:!0})});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).liquidjs={})}(this,function(e){"use strict";var n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function t(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var y=function(){return(y=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(s,o,u,a){return new(u=u||Promise)(function(e,t){function r(e){try{i(a.next(e))}catch(e){t(e)}}function n(e){try{i(a.throw(e))}catch(e){t(e)}}function i(t){t.done?e(t.value):new u(function(e){e(t.value)}).then(r,n)}i((a=a.apply(s,o||[])).next())})}function w(r,n){var i,s,o,e,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return e={next:t(0),throw:t(1),return:t(2)},"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(t){return function(e){return function(t){if(i)throw new TypeError("Generator is already executing.");for(;u;)try{if(i=1,s&&(o=2&t[0]?s.return:t[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,t[1])).done)return o;switch(s=0,o&&(t=[2&t[0],o.value]),t[0]){case 0:case 1:o=t;break;case 4:return u.label++,{value:t[1],done:!1};case 5:u.label++,s=t[1],t=[0];continue;case 7:t=u.ops.pop(),u.trys.pop();continue;default:if(!(o=0<(o=u.trys).length&&o[o.length-1])&&(6===t[0]||2===t[0])){u=0;continue}if(3===t[0]&&(!o||t[1]>o[0]&&t[1]<o[3])){u.label=t[1];break}if(6===t[0]&&u.label<o[1]){u.label=o[1],o=t;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(t);break}o[2]&&u.ops.pop(),u.trys.pop();continue}t=n.call(r,u)}catch(e){t=[6,e],s=0}finally{i=o=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}}function m(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}function r(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||0<t--)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function v(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(r(arguments[t]));return e}var i=(o.prototype.valueOf=function(){},o.prototype.liquidMethodMissing=function(e){},o);function o(){}var u=Object.prototype.toString;function g(e){return"[object String]"===u.call(e)}function a(e){return"function"==typeof e}function c(e){return h(e=l(e))?"":String(e)}function l(e){return e instanceof i?e.valueOf():e}function p(e){return"number"==typeof e}function h(e){return null==e}function b(e){return"[object Array]"===u.call(e)}function f(e,t){for(var r in e=e||{})if(e.hasOwnProperty(r)&&!1===t(e[r],r,e))break;return e}function d(e){return e[e.length-1]}function x(e){var t=typeof e;return null!==e&&("object"==t||"function"==t)}function T(e,t,r){void 0===r&&(r=1);for(var n=[],i=e;i<t;i+=r)n.push(i);return n}function k(e,t,r){void 0===r&&(r=" ");for(var n=t-(e=String(e)).length;0<n--;)e=r+e;return e}var R,E=(t(S,R=Error),S.prototype.update=function(){var e=this.originalError,t=function(t){var r=t.input.split("\n"),e=Math.max(t.line-2,1),n=Math.min(t.line+3,r.length);return T(e,n+1).map(function(e){return(e===t.line?">> ":" ")+k(String(e),String(n).length)+"| "+r[e-1]}).join("\n")}(this.token);this.message=function(e,t){return t.file&&(e+=", file:"+t.file),e+=", line:"+t.line+", col:"+t.col}(e.message,this.token),this.stack=this.message+"\n"+t+"\n"+this.stack+"\nFrom "+e.stack},S);function S(e,t){var r=R.call(this,e.message)||this;return r.originalError=e,r.token=t,r}var q,O=(t(M,q=E),M);function M(e,t){var r=q.call(this,new Error(e),t)||this;return r.name="TokenizationError",q.prototype.update.call(r),r}var _,F=(t(L,_=E),L);function L(e,t){var r=_.call(this,e,t)||this;return r.name="ParseError",r.message=e.message,_.prototype.update.call(r),r}var P,D=(t(j,P=E),j.is=function(e){return e instanceof j},j);function j(e,t){var r=P.call(this,e,t.token)||this;return r.name="RenderError",r.message=e.message,P.prototype.update.call(r),r}var U,A=(t(N,U=Error),N);function N(e){var t=U.call(this,e)||this;return t.name="AssertionError",t.message=e+"",t}function H(e,t){if(!e)throw new A(t=t||"expect "+e+" to be true")}var z={root:["."],cache:!1,extname:"",dynamicPartials:!0,trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",strictFilters:!1,strictVariables:!1};function Y(e){return(e=e||{}).hasOwnProperty("root")&&(e.root=V(e.root)),e}function $(e){return y({},z,e)}function V(e){return b(e)?e:g(e)?[e]:[]}var C=(I.prototype.getRegister=function(e,t){return void 0===t&&(t={}),this.registers[e]=this.registers[e]||t},I.prototype.setRegister=function(e,t){return this.registers[e]=t},I.prototype.getAll=function(){return v([this.environments],this.scopes).reduce(function(e,t){return y(e,t)},{})},I.prototype.get=function(e){var t,r,n=this.parseProp(e),i=this.findScope(n[0])||this.environments;try{for(var s=m(n),o=s.next();!o.done;o=s.next()){var u=o.value;if(h(i=G(i,u))&&this.opts.strictVariables)throw new TypeError("undefined variable: "+u)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return i},I.prototype.push=function(e){return this.scopes.push(e)},I.prototype.pop=function(){return this.scopes.pop()},I.prototype.front=function(){return this.scopes[0]},I.prototype.findScope=function(e){for(var t=this.scopes.length-1;0<=t;t--){var r=this.scopes[t];if(e in r)return r}return null},I.prototype.parseProp=function(e){e=String(e);for(var t,r=[],n="",i=0;i<e.length;)switch(e[i]){case"[":o();var s=e[i+1];i=/['"]/.test(s)?(H(-1!==(t=e.indexOf(s,i+2)),"unbalanced "+s+": "+e),n=e.slice(i+2,t),o(),t+2):(H(-1!==(t=W(e,i+1)),"unbalanced []: "+e),n=e.slice(i+1,t),/^[+-]?\d+$/.test(n)||(n=String(this.get(n))),o(),t+1);break;case".":o(),i++;break;default:n+=e[i++]}if(o(),!r.length)throw new TypeError('invalid path:"'+e+'"');return r;function o(){n.length&&r.push(n),n=""}},I);function I(e,t,r){void 0===e&&(e={}),void 0===r&&(r=!1),this.scopes=[{}],this.registers={},this.sync=r,this.opts=$(t),this.environments=e}function G(e,t){return h(e)?e:(e=function e(t){return t&&a(t.toLiquid)?e(t.toLiquid()):t}(e))instanceof i?a(e[t])?e[t]():e.hasOwnProperty(t)?e[t]:e.liquidMethodMissing(t):"size"===t?function(e){return h(e.size)&&(b(e)||g(e))?e.length:e.size}(e):e[t]}function W(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 J,B={readFile:function(n){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,new Promise(function(e,t){var r=new XMLHttpRequest;r.onload=function(){200<=r.status&&r.status<300?e(r.responseText):t(new Error(r.statusText))},r.onerror=function(){t(new Error("An error occurred whilst receiving the response."))},r.open("GET",n),r.send()})]})})},resolve:function(e,t,i){return e.length&&"/"!==d(e)&&(e+="/"),function(e,t){var r=document.createElement("base");r.href=e;var n=document.getElementsByTagName("head")[0];n.insertBefore(r,n.firstChild);var i=document.createElement("a");i.href=t;var s=i.href;return n.removeChild(r),s}(e,t).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,function(e,t,r){var n=r.split("/").pop();return/\.\w+$/.test(n)?e:t+r+i})},exists:function(){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,!0]})})},existsSync:function(){return!0},readFileSync:function(e){var t=new XMLHttpRequest;if(t.open("GET",e,!1),t.send(),t.status<200||300<=t.status)throw new Error(t.statusText);return t.responseText}},X=function(e,t,r,n,i){this.trimLeft=!1,this.trimRight=!1,this.type="notset",this.col=n,this.line=r,this.raw=e,this.value=e,this.input=t,this.file=i},K=(t(Q,J=X),Q);function Q(e,t,r,n,i,s,o,u){var a=J.call(this,e,r,n,i,u)||this,c="-"===t[0],l="-"===d(t);return a.value=t.slice(c?1:0,l?-1:t.length).trim(),a.trimLeft=c||s,a.trimRight=l||o,a}var Z,ee=new RegExp(/'[^']*'/.source+"|"+/"[^"]*"/.source),te=/[+-]?(?:\d+\.?\d*|\.?\d+)/,re=/[\w-]+[?]?/,ne=new RegExp("\\[(?:"+ee.source+"|[\\w-\\.]+)\\]"),ie=new RegExp("(?:"+ee.source+"|"+/true|false/.source+"|"+te.source+")"),se=new RegExp(re.source+"(?:\\."+re.source+"|"+ne.source+")*"),oe=new RegExp("(?:"+se.source+"|"+te.source+")"),ue=new RegExp("\\("+oe.source+"\\.\\."+oe.source+"\\)"),ae=new RegExp("\\(("+oe.source+")\\.\\.("+oe.source+")\\)"),ce=new RegExp("(?:"+se.source+"|"+ie.source+"|"+ue.source+")"),le=new RegExp("(?:"+re.source+")\\s*:\\s*(?:"+ce.source+")"),pe=new RegExp("("+re.source+")\\s*:\\s*("+ce.source+")","g"),he=new RegExp("^\\s*("+re.source+")\\s*([\\s\\S]*?)\\s*$"),fe=new RegExp("^"+ee.source+"$"),de=new RegExp("^"+ae.source+"$"),ve=(t(ge,Z=K),ge.is=function(e){return"tag"===e.type},ge);function ge(e,t,r,n,i,s,o){var u=Z.call(this,e,t,r,n,i,s.trimTagLeft,s.trimTagRight,o)||this;u.type="tag";var a=u.value.match(he);if(!a)throw new O("illegal tag syntax",u);return u.name=a[1],u.args=a[2],u}var ye,we=(t(me,ye=X),me.is=function(e){return"html"===e.type},me);function me(e,t,r,n,i){var s=ye.call(this,e,t,r,n,i)||this;return s.type="html",s.value=e,s}function be(e,t){if(e&&we.is(e)){var r=t?/\s+$/g:/[\t\r ]*$/g;e.value=e.value.replace(r,"")}}function xe(e,t){if(e&&we.is(e)){var r=t?/^\s+/g:/^[\t\r ]*\n?/g;e.value=e.value.replace(r,"")}}var Te,ke,Re,Ee=(t(Se,Te=K),Se.is=function(e){return"output"===e.type},Se);function Se(e,t,r,n,i,s,o){var u=Te.call(this,e,t,r,n,i,s.trimOutputLeft,s.trimOutputRight,o)||this;return u.type="output",u}function qe(e){return e}(Re=ke=ke||{})[Re.HTML=0]="HTML",Re[Re.OUTPUT=1]="OUTPUT",Re[Re.TAG=2]="TAG";var Oe=(Me.prototype.tokenize=function(e,t){for(var r=[],n=this.options,i=n.tagDelimiterLeft,s=n.tagDelimiterRight,o=n.outputDelimiterLeft,u=n.outputDelimiterRight,a=0,c=1,l=ke.HTML,p="",h=0,f=1,d=1;a<e.length;){if("\n"===e[a]&&(c++,h=a+1),l===ke.HTML){if(e.substr(a,o.length)===o){p&&r.push(new we(qe(p),e,f,d,t)),f=c,d=a-h+1,a+=(p=o).length,l=ke.OUTPUT;continue}if(e.substr(a,i.length)===i){p&&r.push(new we(qe(p),e,f,d,t)),f=c,d=a-h+1,a+=(p=i).length,l=ke.TAG;continue}}else{if(l===ke.OUTPUT&&e.substr(a,u.length)===u){p+=u,r.push(new Ee(qe(p),p.slice(o.length,-u.length),e,f,d,this.options,t)),p="",f=c,d=(a+=u.length)-h+1,l=ke.HTML;continue}if(e.substr(a,s.length)===s){p+=s,r.push(new ve(qe(p),p.slice(i.length,-s.length),e,f,d,this.options,t)),p="",f=c,d=(a+=s.length)-h+1,l=ke.HTML;continue}}p+=e[a++]}if(l===ke.HTML)return p&&r.push(new we(qe(p),e,f,d,t)),function(e,t){t=y({greedy:!0},t);for(var r=!1,n=0;n<e.length;n++){var i=e[n];!r&&i.trimLeft&&be(e[n-1],t.greedy),ve.is(i)&&("raw"===i.name?r=!0:"endraw"===i.name&&(r=!1)),!r&&i.trimRight&&xe(e[n+1],t.greedy)}}(r,this.options),r;var v=l===ke.OUTPUT?"output":"tag",g=16<p.length?p.slice(0,13)+"...":p;throw new O(v+' "'+g+'" not closed',new X(qe(p),e,f,d,t))},Me);function Me(e){this.options=$(e)}var _e=(Fe.prototype.write=function(e){this.html+=e},Fe);function Fe(){this.html="",this.break=!1,this.continue=!1}var Le=(Pe.prototype.renderTemplates=function(t,r,n){var i,s,o,u,a,c,l,p;return void 0===n&&(n=new _e),w(this,function(e){switch(e.label){case 0:e.trys.push([0,7,8,9]),i=m(t),s=i.next(),e.label=1;case 1:if(s.done)return[3,6];o=s.value,e.label=2;case 2:return e.trys.push([2,4,,5]),[4,o.render(r,n)];case 3:return(u=e.sent())&&n.write(u),n.break||n.continue?[3,6]:[3,5];case 4:throw a=e.sent(),D.is(a)?a:new D(a,o);case 5:return s=i.next(),[3,1];case 6:return[3,9];case 7:return c=e.sent(),l={error:c},[3,9];case 8:try{s&&!s.done&&(p=i.return)&&p.call(i)}finally{if(l)throw l.error}return[7];case 9:return[2,n.html]}})},Pe);function Pe(){}function De(e){this.token=e}var je,Ue=(t(Ae,je=i),Ae.prototype.equals=function(e){return g(e)||b(e)?0===e.length:!!x(e)&&0===Object.keys(e).length},Ae.prototype.gt=function(){return!1},Ae.prototype.geq=function(){return!1},Ae.prototype.lt=function(){return!1},Ae.prototype.leq=function(){return!1},Ae.prototype.valueOf=function(){return""},Ae);function Ae(){return null!==je&&je.apply(this,arguments)||this}var Ne,He=(t(ze,Ne=Ue),ze.prototype.equals=function(e){return!1===e||!!h(l(e))||(g(e)?/^\s*$/.test(e):Ne.prototype.equals.call(this,e))},ze);function ze(){return null!==Ne&&Ne.apply(this,arguments)||this}var Ye,$e=(t(Ve,Ye=i),Ve.prototype.equals=function(e){return h(l(e))||e instanceof He},Ve.prototype.gt=function(){return!1},Ve.prototype.geq=function(){return!1},Ve.prototype.lt=function(){return!1},Ve.prototype.leq=function(){return!1},Ve.prototype.valueOf=function(){return null},Ve);function Ve(){return null!==Ye&&Ye.apply(this,arguments)||this}var Ce=(Ie.prototype.evaluate=function(e){var t=function(e){return"true"===(e=e.trim())||"false"!==e&&("nil"===e||"null"===e?new $e:"empty"===e?new Ue:"blank"===e?new He:isNaN(Number(e))?'"'!==e[0]&&"'"!==e[0]||e[0]!==d(e)?void 0:e.slice(1,-1):Number(e))}(this.str);return void 0!==t?t:e.get(this.str)},Ie.prototype.value=function(e){return l(this.evaluate(e))},Ie);function Ie(e){this.str=e}function Ge(e){return e&&a(e.equals)}function We(e){return!Je(e)}function Je(e){return!1===e||null==e}var Be={"==":1,"!=":1,">":1,"<":1,">=":1,"<=":1,contains:1,and:0,or:0},Xe={"==":function(e,t){return Ge(e)?e.equals(t):Ge(t)?t.equals(e):e===t},"!=":function(e,t){return Ge(e)?!e.equals(t):Ge(t)?!t.equals(e):e!==t},">":function(e,t){return Ge(e)?e.gt(t):Ge(t)?t.lt(e):t<e},"<":function(e,t){return Ge(e)?e.lt(t):Ge(t)?t.gt(e):e<t},">=":function(e,t){return Ge(e)?e.geq(t):Ge(t)?t.leq(e):t<=e},"<=":function(e,t){return Ge(e)?e.leq(t):Ge(t)?t.geq(e):e<=t},contains:function(e,t){return!(!e||!a(e.indexOf))&&-1<e.indexOf(t)},and:function(e,t){return We(e)&&We(t)},or:function(e,t){return We(e)||We(t)}},Ke=Object.keys(Be);function Qe(e){return Ke.includes(e)}var Ze=(et.prototype.evaluate=function(t){var r,n,i,s,o,u,a,c,l,p;return w(this,function(e){switch(e.label){case 0:H(t,"unable to evaluate: context not defined"),e.label=1;case 1:e.trys.push([1,9,10,11]),r=m(this.postfix),n=r.next(),e.label=2;case 2:return n.done?[3,8]:Qe(i=n.value)?(this.evaluateOnce(i),[3,7]):[3,3];case 3:return function(e){return"("===e[0]&&")"===e[e.length-1]}(i)?(o=(s=this.operands).push,[4,function(t,r){var n,i,s;return w(this,function(e){switch(e.label){case 0:return(n=t.match(de))?[4,new Ce(n[1]).value(r)]:[3,3];case 1:return i=e.sent(),[4,new Ce(n[2]).value(r)];case 2:return s=e.sent(),[2,T(+i,+s+1)];case 3:return[2]}})}(i,t)]):[3,5];case 4:return o.apply(s,[e.sent()]),[3,7];case 5:return a=(u=this.operands).push,[4,new Ce(i).evaluate(t)];case 6:a.apply(u,[e.sent()]),e.label=7;case 7:return n=r.next(),[3,2];case 8:return[3,11];case 9:return c=e.sent(),l={error:c},[3,11];case 10:try{n&&!n.done&&(p=r.return)&&p.call(r)}finally{if(l)throw l.error}return[7];case 11:return[2,this.operands[0]]}})},et.prototype.value=function(t){var r;return w(this,function(e){switch(e.label){case 0:return r=l,[4,this.evaluate(t)];case 1:return[2,r.apply(void 0,[e.sent()])]}})},et.prototype.evaluateOnce=function(e){var t=this.operands.pop(),r=this.operands.pop(),n=Xe[e](r,t);this.operands.push(n)},et);function et(e){void 0===e&&(e=""),this.operands=[],this.postfix=v(function(t){var r,n,i,s,o,u,a;return w(this,function(e){switch(e.label){case 0:r=[],e.label=1;case 1:e.trys.push([1,10,11,12]),n=m(function(t){var r,n,i,s,o;return w(this,function(e){switch(e.label){case 0:r=t.length,n="",i={'"':'"',"'":"'","[":"]","(":")"},s=0,e.label=1;case 1:if(!(s<r))return[3,8];switch(o=t[s],o){case"[":case'"':case"'":return[3,2];case" ":case"\t":case"\n":return[3,3]}return[3,6];case 2:for(n+=o;s+1<r&&(n+=t[++s],t[s]!==i[o]););return[3,7];case 3:return n?[4,n]:[3,5];case 4:e.sent(),e.label=5;case 5:return n="",[3,7];case 6:n+=o,e.label=7;case 7:return s++,[3,1];case 8:return n?[4,n]:[3,10];case 9:e.sent(),e.label=10;case 10:return[2]}})}(t)),i=n.next(),e.label=2;case 2:if(i.done)return[3,9];if(!Qe(s=i.value))return[3,6];e.label=3;case 3:return r.length&&Be[r[r.length-1]]>Be[s]?[4,r.pop()]:[3,5];case 4:return e.sent(),[3,3];case 5:return r.push(s),[3,8];case 6:return[4,s];case 7:e.sent(),e.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return o=e.sent(),u={error:o},[3,12];case 11:try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(u)throw u.error}return[7];case 12:return r.length?[4,r.pop()]:[3,14];case 13:return e.sent(),[3,12];case 14:return[2]}})}(e))}var tt=(rt.prototype.on=function(e,t){return this.handlers[e]=t,this},rt.prototype.trigger=function(e,t){var r=this.handlers[e];return!!r&&(r(t),!0)},rt.prototype.start=function(){var e;for(this.trigger("start");!this.stopRequested&&(e=this.tokens.shift());)if(!(this.trigger("token",e)||ve.is(e)&&this.trigger("tag:"+e.name,e))){var t=this.parseToken(e,this.tokens);this.trigger("template",t)}return this.stopRequested||this.trigger("end"),this},rt.prototype.stop=function(){return this.stopRequested=!0,this},rt);function rt(e,t){this.handlers={},this.stopRequested=!1,this.tokens=e,this.parseToken=t}var nt=(it.parse=function(e){var t,r=new it;for(pe.lastIndex=0;t=pe.exec(e);){var n=t[1],i=t[2];r[n]=i}return r},it.create=function(t,r){var n,i,s,o,u,a,c,l,p;return w(this,function(e){switch(e.label){case 0:n=it.parse(t),e.label=1;case 1:e.trys.push([1,6,7,8]),i=m(Object.keys(n)),s=i.next(),e.label=2;case 2:return s.done?[3,5]:(o=s.value,[4,new Ze((u=n)[a=o]).evaluate(r)]);case 3:u[a]=e.sent(),e.label=4;case 4:return s=i.next(),[3,2];case 5:return[3,8];case 6:return c=e.sent(),l={error:c},[3,8];case 7:try{s&&!s.done&&(p=i.return)&&p.call(i)}finally{if(l)throw l.error}return[7];case 8:return[2,n]}})},it);function it(){}var st,ot=(t(ut,st=De),ut.prototype.render=function(t,r){var n,i;return w(this,function(e){switch(e.label){case 0:return[4,nt.create(this.token.args,t)];case 1:return n=e.sent(),a((i=this.impl).render)?[4,i.render(t,n,r)]:[3,3];case 2:return[2,e.sent()];case 3:return[2]}})},ut.register=function(e,t){ut.impls[e]=t},ut.clear=function(){ut.impls={}},ut.impls={},ut);function ut(e,t,r){var n=st.call(this,e)||this;n.name=e.name;var i=ut.impls[e.name];return H(i,"tag "+e.name+" not found"),n.impl=Object.create(i),n.impl.liquid=r,n.impl.parse&&n.impl.parse(e,t),n}var at=(ct.prototype.render=function(t,r){var n,i,s,o,u,a,c,l,p,h,f,d;return w(this,function(e){switch(e.label){case 0:n=[],e.label=1;case 1:e.trys.push([1,8,9,10]),i=m(this.args),s=i.next(),e.label=2;case 2:return s.done?[3,7]:function(e){return b(e)}(o=s.value)?(a=(u=n).push,c=[o[0]],[4,new Ze(o[1]).evaluate(r)]):[3,4];case 3:return a.apply(u,[c.concat([e.sent()])]),[3,6];case 4:return p=(l=n).push,[4,new Ze(o).evaluate(r)];case 5:p.apply(l,[e.sent()]),e.label=6;case 6:return s=i.next(),[3,2];case 7:return[3,10];case 8:return h=e.sent(),f={error:h},[3,10];case 9:try{s&&!s.done&&(d=i.return)&&d.call(i)}finally{if(f)throw f.error}return[7];case 10:return[2,this.impl.apply({context:r},v([t],n))]}})},ct.register=function(e,t){ct.impls[e]=t},ct.clear=function(){ct.impls={}},ct.impls={},ct);function ct(e,t,r){var n=ct.impls[e];if(!n&&r)throw new TypeError("undefined filter: "+e);this.name=e,this.impl=n||function(e){return e},this.args=t}var lt=(pt.prototype.parseFilters=function(e,t){for(var r=t;r<e.length;)if("|"===e[r]){for(var n=++r;r<e.length&&"|"!==e[r];)r++;this.parseFilter(e,n,r)}else r++},pt.prototype.parseFilter=function(e,t,r){for(var n,i,s=e[t],o=[],u=t+1;u<r+1;u++)u===r||","===e[u]?((n||i)&&o.push(n?[n,i]:i),i=n=void 0):":"===e[u]?(n=i,i=void 0):void 0===i&&(i=e[u]);this.filters.push(new at(s,o,this.strictFilters))},pt.prototype.value=function(t){var r,n,i,s,o,u;return w(this,function(e){switch(e.label){case 0:return[4,new Ze(this.initial).evaluate(t)];case 1:r=e.sent(),e.label=2;case 2:e.trys.push([2,7,8,9]),n=m(this.filters),i=n.next(),e.label=3;case 3:return i.done?[3,6]:[4,i.value.render(r,t)];case 4:r=e.sent(),e.label=5;case 5:return i=n.next(),[3,3];case 6:return[3,9];case 7:return s=e.sent(),o={error:s},[3,9];case 8:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(o)throw o.error}return[7];case 9:return[2,r]}})},pt.tokenize=function(e){for(var t=[],r=0;r<e.length;){var n=e[r];if('"'===n||"'"===n){var i=r;for(r+=2;r<e.length&&e[r-1]!==n;++r);t.push(e.slice(i,r))}else if(/\s/.test(n))r++;else if(/[|,:]/.test(n))t.push(e[r++]);else{i=r++;for(var s=void 0;r<e.length&&!/[|,:\s]/.test(s=e[r]);++r)if('"'===s||"'"===s)for(r+=2;r<e.length&&e[r-1]!==s;++r);t.push(e.slice(i,r))}}return t},pt);function pt(e,t){this.filters=[];var r=pt.tokenize(e);this.strictFilters=t,this.initial=r[0],this.parseFilters(r,1)}var ht,ft=(t(dt,ht=De),dt.prototype.render=function(t,r){var n;return w(this,function(e){switch(e.label){case 0:return[4,this.value.value(t)];case 1:return n=e.sent(),r.write(c(l(n))),[2]}})},dt);function dt(e,t){var r=ht.call(this,e)||this;return r.value=new lt(e.value,t),r}var vt,gt=(t(yt,vt=De),yt.prototype.render=function(e,t){return w(this,function(e){return t.write(this.str),[2]})},yt);function yt(e){var t=vt.call(this,e)||this;return t.str=e.value,t}var wt=(mt.prototype.parse=function(e){for(var t,r=[];t=e.shift();)r.push(this.parseToken(t,e));return r},mt.prototype.parseToken=function(t,e){try{return ve.is(t)?new ot(t,e,this.liquid):Ee.is(t)?new ft(t,this.liquid.options.strictFilters):new gt(t)}catch(e){throw new F(e,t)}},mt.prototype.parseStream=function(e){var r=this;return new tt(e,function(e,t){return r.parseToken(e,t)})},mt);function mt(e){this.liquid=e}var bt,xt=new RegExp("("+re.source+")\\s*=([^]*)"),Tt={parse:function(e){var t=e.args.match(xt);H(t,"illegal token "+e.raw),this.key=t[1],this.value=t[2]},render:function(t){var r,n;return w(this,function(e){switch(e.label){case 0:return r=t.front(),n=this.key,[4,this.liquid._evalValue(this.value,t)];case 1:return r[n]=e.sent(),[2]}})}},kt=(t(Rt,bt=i),Rt.prototype.next=function(){this.i++},Rt.prototype.index0=function(){return this.i},Rt.prototype.index=function(){return this.i+1},Rt.prototype.first=function(){return 0===this.i},Rt.prototype.last=function(){return this.i===this.length-1},Rt.prototype.rindex=function(){return this.length-this.i},Rt.prototype.rindex0=function(){return this.length-this.i-1},Rt.prototype.valueOf=function(){return JSON.stringify(this)},Rt);function Rt(e){var t=bt.call(this)||this;return t.i=0,t.length=e,t}var Et,St,qt=new RegExp("^("+re.source+")\\s+in\\s+("+ce.source+")(?:\\s+"+le.source+")*(?:\\s+(reversed))?(?:\\s+"+le.source+")*$"),Ot={type:"block",parse:function(e,t){var r,n=this,i=qt.exec(e.args);H(i,"illegal tag: "+e.raw),this.variable=i[1],this.collection=i[2],this.reversed=!!i[3],this.templates=[],this.elseTemplates=[];var s=this.liquid.parser.parseStream(t).on("start",function(){return r=n.templates}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endfor",function(){return s.stop()}).on("template",function(e){return r.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});s.start()},render:function(t,r,n){var i,s,o,u,a,c,l,p,h,f,d;return w(this,function(e){switch(e.label){case 0:return i=this.liquid.renderer,[4,new Ze(this.collection).value(t)];case 1:return b(s=e.sent())||(g(s)&&0<s.length?s=[s]:x(s)&&(s=Object.keys(s).map(function(e){return[e,s[e]]}))),b(s)&&s.length?[3,3]:[4,i.renderTemplates(this.elseTemplates,t,n)];case 2:return e.sent(),[2];case 3:o=r.offset||0,u=void 0===r.limit?s.length:r.limit,s=s.slice(o,o+u),this.reversed&&s.reverse(),a={forloop:new kt(s.length)},t.push(a),e.label=4;case 4:e.trys.push([4,9,10,11]),c=m(s),l=c.next(),e.label=5;case 5:return l.done?[3,8]:(p=l.value,a[this.variable]=p,[4,i.renderTemplates(this.templates,t,n)]);case 6:if(e.sent(),n.break)return n.break=!1,[3,8];n.continue=!1,a.forloop.next(),e.label=7;case 7:return l=c.next(),[3,5];case 8:return[3,11];case 9:return h=e.sent(),f={error:h},[3,11];case 10:try{l&&!l.done&&(d=c.return)&&d.call(c)}finally{if(f)throw f.error}return[7];case 11:return t.pop(),[2]}})}},Mt=new RegExp("("+re.source+")"),_t={parse:function(e,t){var r=this,n=e.args.match(Mt);H(n,e.args+" not valid identifier"),this.variable=n[1],this.templates=[];var i=this.liquid.parser.parseStream(t);i.on("tag:endcapture",function(){return i.stop()}).on("template",function(e){return r.templates.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")}),i.start()},render:function(t){var r;return w(this,function(e){switch(e.label){case 0:return[4,this.liquid.renderer.renderTemplates(this.templates,t)];case 1:return r=e.sent(),t.front()[this.variable]=r,[2]}})}},Ft={parse:function(e,t){var r=this;this.cond=e.args,this.cases=[],this.elseTemplates=[];var n=[],i=this.liquid.parser.parseStream(t).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(){return i.stop()}).on("template",function(e){return n.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});i.start()},render:function(t,e,r){var n,i,s,o,u;return w(this,function(e){switch(e.label){case 0:n=this.liquid.renderer,i=0,e.label=1;case 1:return i<this.cases.length?(s=this.cases[i],[4,new Ze(s.val).value(t)]):[3,6];case 2:return o=e.sent(),[4,new Ze(this.cond).value(t)];case 3:return u=e.sent(),o!==u?[3,5]:[4,n.renderTemplates(s.templates,t,r)];case 4:return e.sent(),[2];case 5:return i++,[3,1];case 6:return[4,n.renderTemplates(this.elseTemplates,t,r)];case 7:return e.sent(),[2]}})}},Lt={parse:function(e,t){var r=this.liquid.parser.parseStream(t);r.on("token",function(e){"endcomment"===e.name&&r.stop()}).on("end",function(){throw new Error("tag "+e.raw+" not closed")}),r.start()}};(St=Et=Et||{})[St.OUTPUT=0]="OUTPUT",St[St.STORE=1]="STORE";var Pt,Dt=Et,jt=/[^\s,]+/,Ut=new RegExp("with\\s+("+ce.source+")"),At={parse:function(e){var t=jt.exec(e.args);t&&(this.staticValue=t[0]),(t=ce.exec(e.args))&&(this.value=t[0]),(t=Ut.exec(e.args))&&(this.with=t[1])},render:function(t,r,n){var i,s,o,u,a,c,l;return w(this,function(e){switch(e.label){case 0:return t.opts.dynamicPartials?fe.exec(this.value)?(s=this.value.slice(1,-1),[4,this.liquid._parseAndRender(s,t.getAll(),t.opts,t.sync)]):[3,2]:[3,5];case 1:return i=e.sent(),[3,4];case 2:return[4,new Ze(this.value).value(t)];case 3:i=e.sent(),e.label=4;case 4:return[3,6];case 5:i=this.staticValue,e.label=6;case 6:return H(i,"cannot include with empty filename"),o=t.getRegister("blocks"),u=t.getRegister("blockMode"),t.setRegister("blocks",{}),t.setRegister("blockMode",Dt.OUTPUT),this.with?(a=r,c=i,[4,new Ze(this.with).evaluate(t)]):[3,8];case 7:a[c]=e.sent(),e.label=8;case 8:return[4,this.liquid._parseFile(i,t.opts,t.sync)];case 9:return l=e.sent(),t.push(r),[4,this.liquid.renderer.renderTemplates(l,t,n)];case 10:return e.sent(),t.pop(),t.setRegister("blocks",o),t.setRegister("blockMode",u),[2]}})}},Nt=/[^\s,]+/,Ht=new RegExp("with\\s+("+ce.source+")"),zt={parse:function(e){var t=Nt.exec(e.args);t&&(this.staticValue=t[0]),(t=ce.exec(e.args))&&(this.value=t[0]),(t=Ht.exec(e.args))&&(this.with=t[1])},render:function(t,r,n){var i,s,o,u,a,c,l,p;return w(this,function(e){switch(e.label){case 0:return t.opts.dynamicPartials?fe.exec(this.value)?(s=this.value.slice(1,-1),[4,this.liquid._parseAndRender(s,t.getAll(),t.opts,t.sync)]):[3,2]:[3,5];case 1:return i=e.sent(),[3,4];case 2:return[4,new Ze(this.value).value(t)];case 3:i=e.sent(),e.label=4;case 4:return[3,6];case 5:i=this.staticValue,e.label=6;case 6:return H(i,"cannot render with empty filename"),o=t.getRegister("blocks"),u=t.getRegister("blockMode"),(a=new C({},t.opts,t.sync)).setRegister("blocks",{}),a.setRegister("blockMode",Dt.OUTPUT),this.with?(c=r,l=i,[4,new Ze(this.with).evaluate(t)]):[3,8];case 7:c[l]=e.sent(),e.label=8;case 8:return a.push(r),[4,this.liquid._parseFile(i,a.opts,a.sync)];case 9:return p=e.sent(),[4,this.liquid.renderer.renderTemplates(p,a,n)];case 10:return e.sent(),a.setRegister("blocks",o),a.setRegister("blockMode",u),[2]}})}},Yt={parse:function(e){var t=e.args.match(re);H(t,"illegal identifier "+e.args),this.variable=t[0]},render:function(e,t,r){var n=e.environments;p(n[this.variable])||(n[this.variable]=0),r.write(c(--n[this.variable]))}},$t=new RegExp("^(?:("+ce.source+")\\s*:\\s*)?(.*)$"),Vt=new RegExp(ce.source,"g"),Ct={parse:function(e){var t=$t.exec(e.args);H(t,"illegal tag: "+e.raw),this.group=new Ze(t[1]);var r=t[2];for(this.candidates=[];t=Vt.exec(r);)this.candidates.push(t[0]);H(this.candidates.length,"empty candidates: "+e.raw)},render:function(t,e,r){var n,i,s,o,u,a;return w(this,function(e){switch(e.label){case 0:return[4,this.group.value(t)];case 1:return n=e.sent(),i="cycle:"+n+":"+this.candidates.join(","),s=t.getRegister("cycle"),void 0===(o=s[i])&&(o=s[i]=0),u=this.candidates[o],o=(o+1)%this.candidates.length,s[i]=o,[4,new Ze(u).value(t)];case 2:return a=e.sent(),r.write(a),[2]}})}},It={parse:function(e,t){var r,n=this;this.branches=[],this.elseTemplates=[];var i=this.liquid.parser.parseStream(t).on("start",function(){return n.branches.push({cond:e.args,templates:r=[]})}).on("tag:elsif",function(e){n.branches.push({cond:e.args,templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endif",function(){return i.stop()}).on("template",function(e){return r.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});i.start()},render:function(t,e,r){var n,i,s,o,u,a,c;return w(this,function(e){switch(e.label){case 0:n=this.liquid.renderer,e.label=1;case 1:e.trys.push([1,7,8,9]),i=m(this.branches),s=i.next(),e.label=2;case 2:return s.done?[3,6]:(o=s.value,[4,new Ze(o.cond).value(t)]);case 3:return We(e.sent())?[4,n.renderTemplates(o.templates,t,r)]:[3,5];case 4:return e.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return u=e.sent(),a={error:u},[3,9];case 8:try{s&&!s.done&&(c=i.return)&&c.call(i)}finally{if(a)throw a.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,t,r)];case 10:return e.sent(),[2]}})}},Gt={parse:function(e){var t=e.args.match(re);H(t,"illegal identifier "+e.args),this.variable=t[0]},render:function(e,t,r){var n=e.environments;p(n[this.variable])||(n[this.variable]=0);var i=n[this.variable];n[this.variable]++,r.write(c(i))}},Wt=/\S+/,Jt={parse:function(e,t){var r=Wt.exec(e.args);r&&(this.staticLayout=r[0]),(r=ce.exec(e.args))&&(this.layout=r[0]),this.tpls=this.liquid.parser.parse(t)},render:function(t,r,n){var i,s,o,u,a,c,l;return w(this,function(e){switch(e.label){case 0:return t.opts.dynamicPartials?[4,new Ze(this.layout).value(t)]:[3,2];case 1:return s=e.sent(),[3,3];case 2:s=this.staticLayout,e.label=3;case 3:return H(i=s,"cannot apply layout with empty filename"),t.setRegister("blockMode",Dt.STORE),o=t.getRegister("blocks"),[4,(u=this.liquid.renderer).renderTemplates(this.tpls,t)];case 4:return a=e.sent(),void 0===o[""]&&(o[""]=a),[4,this.liquid._parseFile(i,t.opts,t.sync)];case 5:return c=e.sent(),t.push(r),t.setRegister("blockMode",Dt.OUTPUT),[4,u.renderTemplates(c,t)];case 6:return l=e.sent(),t.pop(),n.write(l),[2]}})}},Bt={parse:function(e,t){var r=this,n=/\w+/.exec(e.args);this.block=n?n[0]:"",this.tpls=[];var i=this.liquid.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:function(t,e,r){var n,i,s,o,u;return w(this,function(e){switch(e.label){case 0:return n=t.getRegister("blocks"),i=n[this.block],s=this.liquid.renderer,void 0===i?[3,1]:(u=i,[3,3]);case 1:return[4,s.renderTemplates(this.tpls,t)];case 2:u=e.sent(),e.label=3;case 3:return o=u,t.getRegister("blockMode",Dt.OUTPUT)===Dt.STORE?(n[this.block]=o,[2]):(r.write(o),[2])}})}},Xt={parse:function(e,t){var r=this;this.tokens=[];var n=this.liquid.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(){return this.tokens.map(function(e){return e.raw}).join("")}},Kt=(t(Qt,Pt=kt),Qt.prototype.row=function(){return Math.floor(this.i/this.cols)+1},Qt.prototype.col0=function(){return this.i%this.cols},Qt.prototype.col=function(){return this.col0()+1},Qt.prototype.col_first=function(){return 0===this.col0()},Qt.prototype.col_last=function(){return this.col()===this.cols},Qt);function Qt(e,t){var r=Pt.call(this,e)||this;return r.length=e,r.cols=t,r}var Zt=new RegExp("^("+re.source+")\\s+in\\s+("+ce.source+")(?:\\s+"+le.source+")*$"),er={assign:Tt,for:Ot,capture:_t,case:Ft,comment:Lt,include:At,render:zt,decrement:Yt,increment:Gt,cycle:Ct,if:It,layout:Jt,block:Bt,raw:Xt,tablerow:{parse:function(e,t){var r,n=this,i=Zt.exec(e.args);H(i,"illegal tag: "+e.raw),this.variable=i[1],this.collection=i[2],this.templates=[];var s=this.liquid.parser.parseStream(t).on("start",function(){return r=n.templates}).on("tag:endtablerow",function(){return s.stop()}).on("template",function(e){return r.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});s.start()},render:function(t,r,n){var i,s,o,u,a,c,l,p;return w(this,function(e){switch(e.label){case 0:return[4,new Ze(this.collection).value(t)];case 1:i=e.sent()||[],s=r.offset||0,o=void 0===r.limit?i.length:r.limit,i=i.slice(s,s+o),u=r.cols||i.length,a=this.liquid.renderer,c=new Kt(i.length,u),l={tablerowloop:c},t.push(l),p=0,e.label=2;case 2:return p<i.length?(l[this.variable]=i[p],0===c.col0()&&(1!==c.row()&&n.write("</tr>"),n.write('<tr class="row'+c.row()+'">')),n.write('<td class="col'+c.col()+'">'),[4,a.renderTemplates(this.templates,t,n)]):[3,5];case 3:e.sent(),n.write("</td>"),e.label=4;case 4:return p++,c.next(),[3,2];case 5:return i.length&&n.write("</tr>"),t.pop(),[2]}})}},unless:{parse:function(e,t){var r,n=this;this.templates=[],this.elseTemplates=[];var i=this.liquid.parser.parseStream(t).on("start",function(){r=n.templates,n.cond=e.args}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endunless",function(){return i.stop()}).on("template",function(e){return r.push(e)}).on("end",function(){throw new Error("tag "+e.raw+" not closed")});i.start()},render:function(t,e,r){var n;return w(this,function(e){switch(e.label){case 0:return n=this.liquid.renderer,[4,new Ze(this.cond).value(t)];case 1:return[4,Je(e.sent())?n.renderTemplates(this.templates,t,r):n.renderTemplates(this.elseTemplates,t,r)];case 2:return e.sent(),[2]}})}},break:{render:function(e,t,r){r.break=!0}},continue:{render:function(e,t,r){r.continue=!0}}},tr={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&#34;","'":"&#39;"},rr={"&amp;":"&","&lt;":"<","&gt;":">","&#34;":'"',"&#39;":"'"};function nr(e){return c(e).replace(/&|<|>|"|'/g,function(e){return tr[e]})}var ir={escape:nr,escape_once:function(e){return nr(function(e){return String(e).replace(/&(amp|lt|gt|#34|#39);/g,function(e){return rr[e]})}(e))},newline_to_br:function(e){return e.replace(/\n/g,"<br />")},strip_html:function(e){return e.replace(/<script.*?<\/script>|<!--.*?-->|<style.*?<\/style>|<.*?>/g,"")}},sr={append:function(e,t){return c(e)+c(t)},prepend:function(e,t){return c(t)+c(e)},capitalize:function(e){return(e=c(e)).charAt(0).toUpperCase()+e.slice(1)},lstrip:function(e){return c(e).replace(/^\s+/,"")},downcase:function(e){return c(e).toLowerCase()},upcase:function(e){return c(e).toUpperCase()},remove:function(e,t){return c(e).split(t).join("")},remove_first:function(e,t){return c(e).replace(t,"")},replace:function(e,t,r){return c(e).split(t).join(r)},replace_first:function(e,t,r){return c(e).replace(t,r)},rstrip:function(e){return c(e).replace(/\s+$/,"")},split:function(e,t){return c(e).split(t)},strip:function(e){return c(e).trim()},strip_newlines:function(e){return c(e).replace(/\n/g,"")},truncate:function(e,t,r){void 0===t&&(t=50);void 0===r&&(r="...");return(e=c(e)).length<=t?e:e.substr(0,t-r.length)+r},truncatewords:function(e,t,r){void 0===t&&(t=15);void 0===r&&(r="...");var n=e.split(/\s+/),i=n.slice(0,t).join(" ");n.length>=t&&(i+=r);return i}};var or=String.prototype.toLowerCase,ur={abs:function(e){return Math.abs(e)},at_least:function(e,t){return Math.max(e,t)},at_most:function(e,t){return Math.min(e,t)},ceil:function(e){return Math.ceil(e)},divided_by:function(e,t){return e/t},floor:function(e){return Math.floor(e)},minus:function(e,t){return e-t},modulo:function(e,t){return e%t},round:function(e,t){void 0===t&&(t=0);var r=Math.pow(10,t);return Math.round(e*r)/r},plus:function(e,t){return Number(e)+Number(t)},sort_natural:function(e,r){return e&&e.sort?void 0===r?v(e).sort(ar):v(e).sort(function(e,t){return ar(e[r],t[r])}):[]},times:function(e,t){return e*t}};function ar(e,t){return t?e?(e=or.call(e))<(t=or.call(t))?-1:t<e?1:0:1:-1}var cr={url_decode:function(e){return e.split("+").map(decodeURIComponent).join(" ")},url_encode:function(e){return e.split(" ").map(encodeURIComponent).join("+")}},lr={join:function(e,t){return e.join(void 0===t?" ":t)},last:function(e){return b(e)?d(e):""},first:function(e){return b(e)?e[0]:""},map:function(e,t){return e.map(function(e){return e[t]})},reverse:function(e){return v(e).reverse()},sort:function(e,t){return e.sort(t)},size:function(e){return e&&e.length||0},concat:function(e,t){return Array.prototype.concat.call(e,t)},slice:function(e,t,r){void 0===r&&(r=1);return t=t<0?e.length+t:t,e.slice(t,t+r)},uniq:function(e){var t={};return(e||[]).filter(function(e){return!t.hasOwnProperty(String(e))&&(t[String(e)]=!0)})},where:function(e,t,r){return e.filter(function(e){return void 0===r?We(e[t]):e[t]===r})}};var pr=["January","February","March","April","May","June","July","August","September","October","November","December"],hr=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],fr=pr.map(gr),dr=hr.map(gr),vr={1:"st",2:"nd",3:"rd",default:"th"};function gr(e){return e.slice(0,3)}var yr={daysInMonth:function(e){return[31,yr.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+=yr.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 k(String(Math.floor((r-n)/7)+1),2,"0")},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 vr[r]||vr.default},century:function(e){return parseInt(e.getFullYear().toString().substring(0,2),10)}},wr={a:function(e){return dr[e.getDay()]},A:function(e){return hr[e.getDay()]},b:function(e){return fr[e.getMonth()]},B:function(e){return pr[e.getMonth()]},c:function(e){return e.toLocaleString()},C:function(e){return yr.century(e)},d:function(e){return k(e.getDate(),2,"0")},e:function(e){return k(e.getDate(),2)},H:function(e){return k(e.getHours(),2,"0")},I:function(e){return k(String(e.getHours()%12||12),2,"0")},j:function(e){return k(yr.getDayOfYear(e),3,"0")},k:function(e){return k(e.getHours(),2)},l:function(e){return k(String(e.getHours()%12||12),2)},L:function(e){return k(e.getMilliseconds(),3,"0")},m:function(e){return k(e.getMonth()+1,2,"0")},M:function(e){return k(e.getMinutes(),2,"0")},p:function(e){return e.getHours()<12?"AM":"PM"},P:function(e){return e.getHours()<12?"am":"pm"},q:function(e){return yr.getSuffix(e)},s:function(e){return Math.round(e.valueOf()/1e3)},S:function(e){return k(e.getSeconds(),2,"0")},u:function(e){return e.getDay()||7},U:function(e){return yr.getWeekOfYear(e,0)},w:function(e){return e.getDay()},W:function(e){return yr.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?"-":"+")+k(String(Math.abs(t)),4,"0")},"%":function(){return"%"}};wr.h=wr.b,wr.N=wr.L;var mr=y({},ir,sr,ur,cr,{date:function(e,t){var r=e;return"now"===e?r=new Date:p(e)?r=new Date(1e3*e):g(e)&&(r=/^\d+$/.test(e)?new Date(1e3*+e):new Date(e)),function(e){return e instanceof Date&&!isNaN(e.getTime())}(r)?function(e,t){for(var r="",n=t;;){var i=/%./g,s=i.exec(n);if(!s)return r+n;r+=n.slice(0,i.lastIndex-2),n=n.slice(i.lastIndex);var o=s[0].charAt(1),u=wr[o];r+=u?u(e):"%"+o}}(r,t):e}},{default:function(e,t){return Je(l(e))||""===e?t:e}},lr);function br(t){var e={then:function(e){return e(t)},catch:function(){return e}};return e}function xr(r){var n={then:function(e,t){return t?t(r):n},catch:function(e){return e(r)}};return n}function Tr(n){return function(e){return e&&a(e.then)}(n)?n:function(e){return e&&a(e.next)&&a(e.throw)&&a(e.return)}(n)?function r(e){var t;try{t=n.next(e)}catch(e){return xr(e)}if(t.done)return br(t.value);return Tr(t.value).then(r,function(e){var t;try{t=n.throw(e)}catch(e){return xr(e)}return t.done?br(t.value):r(t.value)})}():br(n)}function kr(e){var t;return Tr(e).then(function(e){return br(t=e)}).catch(function(e){throw e}),t}var Rr=(Er.prototype.parse=function(e,t){var r=this.tokenizer.tokenize(e,t);return this.parser.parse(r)},Er.prototype._render=function(e,t,r,n){var i=y({},this.options,Y(r)),s=new C(t,i,n);return this.renderer.renderTemplates(e,s)},Er.prototype.render=function(t,r,n){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,Tr(this._render(t,r,n,!1))]})})},Er.prototype.renderSync=function(e,t,r){return kr(this._render(e,t,r,!0))},Er.prototype._parseAndRender=function(e,t,r,n){var i=this.parse(e);return this._render(i,t,r,n)},Er.prototype.parseAndRender=function(t,r,n){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,Tr(this._parseAndRender(t,r,n,!1))]})})},Er.prototype.parseAndRenderSync=function(e,t,r){return kr(this._parseAndRender(e,t,r,!0))},Er.prototype._parseFile=function(t,r,n){var i,s,o,u,a,c,l,p,h,f,d,v,g=this;return w(this,function(e){switch(e.label){case 0:i=y({},this.options,Y(r)),s=i.root.map(function(e){return g.fs.resolve(e,t,i.extname)}),void 0!==B.fallback&&void 0!==(a=B.fallback(t))&&s.push(a),e.label=1;case 1:e.trys.push([1,11,12,13]),o=m(s),u=o.next(),e.label=2;case 2:return u.done?[3,10]:(a=u.value,this.options.cache&&this.cache[a]?[2,this.cache[a]]:n?(c=this.fs.existsSync(a),[3,5]):[3,3]);case 3:return[4,this.fs.exists(a)];case 4:c=e.sent(),e.label=5;case 5:return c?(p=this.parse,n?(h=B.readFileSync(a),[3,8]):[3,6]):[3,9];case 6:return[4,this.fs.readFile(a)];case 7:h=e.sent(),e.label=8;case 8:return l=p.apply(this,[h,a]),[2,this.cache[a]=l];case 9:return u=o.next(),[3,2];case 10:return[3,13];case 11:return f=e.sent(),d={error:f},[3,13];case 12:try{u&&!u.done&&(v=o.return)&&v.call(o)}finally{if(d)throw d.error}return[7];case 13:throw this.lookupError(t,i.root)}})},Er.prototype.parseFile=function(t,r){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,Tr(this._parseFile(t,r,!1))]})})},Er.prototype.parseFileSync=function(e,t){return kr(this._parseFile(e,t,!0))},Er.prototype.renderFile=function(r,n,i){return s(this,void 0,void 0,function(){var t;return w(this,function(e){switch(e.label){case 0:return[4,this.parseFile(r,i)];case 1:return t=e.sent(),[2,this.render(t,n,i)]}})})},Er.prototype.renderFileSync=function(e,t,r){var n=Y(r),i=this.parseFileSync(e,n);return this.renderSync(i,t,r)},Er.prototype._evalValue=function(e,t){return new lt(e,this.options.strictFilters).value(t)},Er.prototype.evalValue=function(t,r){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,Tr(this._evalValue(t,r))]})})},Er.prototype.evalValueSync=function(e,t){return kr(this._evalValue(e,t))},Er.prototype.registerFilter=function(e,t){return at.register(e,t)},Er.prototype.registerTag=function(e,t){return ot.register(e,t)},Er.prototype.plugin=function(e){return e.call(this,Er)},Er.prototype.express=function(){var i=this;return function(e,t,r){var n={root:v(V(this.root),i.options.root)};i.renderFile(e,t,n).then(function(e){return r(null,e)},r)}},Er.prototype.lookupError=function(e,t){var r=new Error("ENOENT");return r.message='ENOENT: Failed to lookup "'+e+'" in "'+t+'"',r.code="ENOENT",r},Er.prototype.getTemplate=function(t,r){return s(this,void 0,void 0,function(){return w(this,function(e){return[2,this.parseFile(t,r)]})})},Er.prototype.getTemplateSync=function(e,t){return this.parseFileSync(e,t)},Er);function Er(e){var r=this;void 0===e&&(e={}),this.cache={},this.options=$(Y(e)),this.parser=new wt(this),this.renderer=new Le,this.tokenizer=new Oe(this.options),this.fs=e.fs||B,f(er,function(e,t){return r.registerTag(t,e)}),f(mr,function(e,t){return r.registerFilter(t,e)})}e.AssertionError=A,e.Context=C,e.Drop=i,e.Emitter=_e,e.Expression=Ze,e.Hash=nt,e.Liquid=Rr,e.ParseError=F,e.ParseStream=tt,e.TagToken=ve,e.Token=X,e.TokenizationError=O,e.isFalsy=Je,e.isTruthy=We,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=liquid.min.js.map
{
"name": "liquidjs",
"version": "9.2.0",
"version": "9.3.0",
"description": "Liquid template engine by pure JavaScript: compatible to shopify, easy to extend.",

@@ -112,3 +112,4 @@ "main": "dist/liquid.cjs.js",

"assets": [
"docs"
"docs",
"CHANGELOG.md"
],

@@ -115,0 +116,0 @@ "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc