Comparing version 9.27.0 to 9.27.1
@@ -0,1 +1,8 @@ | ||
## [9.27.1](https://github.com/harttle/liquidjs/compare/v9.27.0...v9.27.1) (2021-10-04) | ||
### Bug Fixes | ||
* directory info in lookupError message, [#395](https://github.com/harttle/liquidjs/issues/395) ([92bfc65](https://github.com/harttle/liquidjs/commit/92bfc65e0b1d937c00a8368b272223c702132d23)) | ||
# [9.27.0](https://github.com/harttle/liquidjs/compare/v9.26.0...v9.27.0) (2021-10-03) | ||
@@ -2,0 +9,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).liquidjs={})}(this,function(p){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function t(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(s,o,a,u){return new(a=a||Promise)(function(t,e){function r(t){try{i(u.next(t))}catch(t){e(t)}}function n(t){try{i(u.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):new a(function(t){t(e.value)}).then(r,n)}i((u=u.apply(s,o||[])).next())})}function T(r,n){var i,s,o,t,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,s&&(o=2&e[0]?s.return:e[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,e[1])).done)return o;switch(s=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(o=0<(o=a.trys).length&&o[o.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){a.label=e[1];break}if(6===e[0]&&a.label<o[1]){a.label=o[1],o=e;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(e);break}o[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(r,a)}catch(t){e=[6,t],s=0}finally{i=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}function k(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function m(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,s=r.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(n=s.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function w(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}var o=(e.prototype.valueOf=function(){},e.prototype.liquidMethodMissing=function(t){},e);function e(){}var r=Object.prototype.toString,a=String.prototype.toLowerCase;function u(t){return"string"==typeof t}function c(t){return"function"==typeof t}function l(t){return u(t=f(t))?t:d(t)?"":String(t)}function f(t){return t instanceof o?t.valueOf():t}function h(t){return"number"==typeof t}function d(t){return null==t}function v(t){return"[object Array]"===r.call(t)}function g(t,e){for(var r in t=t||{})if(t.hasOwnProperty(r)&&!1===e(t[r],r,t))break;return t}function y(t){return t[t.length-1]}function b(t){var e=typeof t;return null!==t&&("object"==e||"function"==e)}function x(t,e,r){void 0===r&&(r=1);for(var n=[],i=t;i<e;i+=r)n.push(i);return n}function q(t,e,r){return void 0===r&&(r=" "),O(t,e,r,function(t,e){return e+t})}function O(t,e,r,n){for(var i=e-(t=String(t)).length;0<i--;)t=n(t,r);return t}function S(t){return t}function F(t){return t.replace(/(\w?)([A-Z])/g,function(t,e,r){return(e?e+"_":"")+r.toLowerCase()})}function R(t,e){return null==t&&null==e?0:null==t?1:null==e?-1:(t=a.call(t))<(e=a.call(e))?-1:e<t?1:0}var E=function(t,e,r,n){this.key=t,this.value=e,this.next=r,this.prev=n},L=(P.prototype.write=function(t,e){if(this.cache[t])this.cache[t].value=e;else{var r=new E(t,e,this.head.next,this.head);this.head.next.prev=r,this.head.next=r,this.cache[t]=r,this.size++,this.ensureLimit()}},P.prototype.read=function(t){if(this.cache[t]){var e=this.cache[t].value;return this.remove(t),this.write(t,e),e}},P.prototype.remove=function(t){var e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--},P.prototype.clear=function(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}},P.prototype.ensureLimit=function(){this.size>this.limit&&this.remove(this.tail.prev.key)},P);function P(t,e){void 0===e&&(e=0),this.limit=t,this.size=e,this.cache={},this.head=new E("HEAD",null,null,null),this.tail=new E("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}var D=Object.freeze({resolve:function(t,e,i){return t.length&&"/"!==y(t)&&(t+="/"),function(t,e){var r=document.createElement("base");r.href=t;var n=document.getElementsByTagName("head")[0];n.insertBefore(r,n.firstChild);var i=document.createElement("a");i.href=e;var s=i.href;return n.removeChild(r),s}(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,function(t,e,r){var n=r.split("/").pop();return/\.\w+$/.test(n)?t:e+r+i})},readFile:function(n){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,new Promise(function(t,e){var r=new XMLHttpRequest;r.onload=function(){200<=r.status&&r.status<300?t(r.responseText):e(new Error(r.statusText))},r.onerror=function(){e(new Error("An error occurred whilst receiving the response."))},r.open("GET",n),r.send()})]})})},readFileSync:function(t){var e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||300<=e.status)throw new Error(e.statusText);return e.responseText},exists:function(t){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,!0]})})},existsSync:function(t){return!0}});function N(t){return t&&c(t.equals)}function M(t,e){return!A(t,e)}function A(t,e){return e.opts.jsTruthy?!t:!1===t||null==t}var I={"==":function(t,e){return N(t)?t.equals(e):N(e)?e.equals(t):t===e},"!=":function(t,e){return N(t)?!t.equals(e):N(e)?!e.equals(t):t!==e},">":function(t,e){return N(t)?t.gt(e):N(e)?e.lt(t):e<t},"<":function(t,e){return N(t)?t.lt(e):N(e)?e.gt(t):t<e},">=":function(t,e){return N(t)?t.geq(e):N(e)?e.leq(t):e<=t},"<=":function(t,e){return N(t)?t.leq(e):N(e)?e.geq(t):t<=e},contains:function(t,e){return!(!t||!c(t.indexOf))&&-1<t.indexOf(e)},and:function(t,e,r){return M(t,r)&&M(e,r)},or:function(t,e,r){return M(t,r)||M(e,r)}},_=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],V=1,j=4,B=16;function C(t){var e,r,n={};try{for(var i=k(Object.entries(t)),s=i.next();!s.done;s=i.next()){for(var o=m(s.value,2),a=o[0],u=o[1],c=n,l=0;l<a.length;l++){var h=a[l];c[h]=c[h]||{},l===a.length-1&&_[a.charCodeAt(l)]&V&&(c[h].needBoundary=!0),c=c[h]}c.handler=u,c.end=!0}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}_[160]=_[5760]=_[6158]=_[8192]=_[8193]=_[8194]=_[8195]=_[8196]=_[8197]=_[8198]=_[8199]=_[8200]=_[8201]=_[8202]=_[8232]=_[8233]=_[8239]=_[8287]=_[12288]=j;var z=(new Date).getTimezoneOffset(),H=/([zZ]|([+-])(\d{2}):(\d{2}))$/,K=/%([-_0^#:]+)?(\d+)?([EO])?(.)/,U=["January","February","March","April","May","June","July","August","September","October","November","December"],Q=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],W=U.map($),J=Q.map($),Y={1:"st",2:"nd",3:"rd",default:"th"};function $(t){return t.slice(0,3)}function G(t){for(var e=0,r=0;r<t.getMonth();++r)e+=[31,function(t){var e=t.getFullYear();return!(0!=(3&e)||!(e%100||e%400==0&&e))}(t)?29:28,31,30,31,30,31,31,30,31,30,31][r];return e+t.getDate()}function X(t,e){var r=G(t)+(e-t.getDay()),n=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((r-n)/7)+1)}var Z={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},tt={a:" ",A:" ",b:" ",B:" ",c:" ",e:" ",k:" ",l:" ",p:" ",P:" "},et={a:function(t){return J[t.getDay()]},A:function(t){return Q[t.getDay()]},b:function(t){return W[t.getMonth()]},B:function(t){return U[t.getMonth()]},c:function(t){return t.toLocaleString()},C:function(t){return function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t)},d:function(t){return t.getDate()},e:function(t){return t.getDate()},H:function(t){return t.getHours()},I:function(t){return String(t.getHours()%12||12)},j:function(t){return G(t)},k:function(t){return t.getHours()},l:function(t){return String(t.getHours()%12||12)},L:function(t){return t.getMilliseconds()},m:function(t){return t.getMonth()+1},M:function(t){return t.getMinutes()},N:function(t,e){var r=Number(e.width)||9;return function(t,e,r){return void 0===r&&(r=" "),O(t,e,r,function(t,e){return t+e})}(String(t.getMilliseconds()).substr(0,r),r,"0")},p:function(t){return t.getHours()<12?"AM":"PM"},P:function(t){return t.getHours()<12?"am":"pm"},q:function(t){return function(t){var e=t.getDate().toString(),r=parseInt(e.slice(-1));return Y[r]||Y.default}(t)},s:function(t){return Math.round(t.valueOf()/1e3)},S:function(t){return t.getSeconds()},u:function(t){return t.getDay()||7},U:function(t){return X(t,0)},w:function(t){return t.getDay()},W:function(t){return X(t,1)},x:function(t){return t.toLocaleDateString()},X:function(t){return t.toLocaleTimeString()},y:function(t){return t.getFullYear().toString().substring(2,4)},Y:function(t){return t.getFullYear()},z:function(t,e){var r=Math.abs(z),n=Math.floor(r/60),i=r%60;return(0<z?"-":"+")+q(n,2,"0")+(e.flags[":"]?":":"")+q(i,2,"0")},t:function(){return"\t"},n:function(){return"\n"},"%":function(){return"%"}};function rt(t,e){var r,n,i=m(e,5),s=i[0],o=i[1],a=void 0===o?"":o,u=i[2],c=i[3],l=i[4],h=et[l];if(!h)return s;var p={};try{for(var f=k(a),d=f.next();!d.done;d=f.next()){p[d.value]=!0}}catch(t){r={error:t}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}var v=String(h(t,{flags:p,width:u,modifier:c})),g=tt[l]||"0",y=u||Z[l]||0;return p["^"]?v=v.toUpperCase():p["#"]&&(v=function(t){return w(t).some(function(t){return"a"<=t&&t<="z"})?t.toUpperCase():t.toLowerCase()}(v)),p._?g=" ":p[0]&&(g="0"),p["-"]&&(y=0),q(v,y,g)}et.h=et.b;var nt={root:["."],layouts:["."],partials:["."],cache:void 0,extname:"",fs:D,dynamicPartials:!0,jsTruthy:!1,trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,lenientIf:!1,globals:{},keepOutputType:!1,timezoneOffset:z,operators:I,operatorsTrie:C(I)};function it(t){return v(t)?t:u(t)?[t]:[]}var st,ot=(t(at,st=Error),at.prototype.update=function(){var t=this.originalError;this.context=function(t){var e=m(t.getPosition(),1)[0],r=t.input.split("\n"),n=Math.max(e-2,1),i=Math.min(e+3,r.length);return x(n,i+1).map(function(t){return(t===e?">> ":" ")+q(String(t),String(i).length)+"| "+r[t-1]}).join("\n")}(this.token),this.message=function(t,e){e.file&&(t+=", file:"+e.file);var r=m(e.getPosition(),2),n=r[0],i=r[1];return t+=", line:"+n+", col:"+i}(t.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack+"\nFrom "+t.stack},at);function at(t,e){var r=st.call(this,t.message)||this;return r.originalError=t,r.token=e,r.context="",r}var ut,ct=(t(lt,ut=ot),lt);function lt(t,e){var r=ut.call(this,new Error(t),e)||this;return r.name="TokenizationError",ut.prototype.update.call(r),r}var ht,pt=(t(ft,ht=ot),ft);function ft(t,e){var r=ht.call(this,t,e)||this;return r.name="ParseError",r.message=t.message,ht.prototype.update.call(r),r}var dt,vt=(t(gt,dt=ot),gt.is=function(t){return"RenderError"===t.name},gt);function gt(t,e){var r=dt.call(this,t,e.token)||this;return r.name="RenderError",r.message=t.message,dt.prototype.update.call(r),r}var yt,mt=(t(wt,yt=ot),wt);function wt(t,e){var r=yt.call(this,t,e)||this;return r.name="UndefinedVariableError",r.message=t.message,yt.prototype.update.call(r),r}var bt,Tt=(t(kt,bt=Error),kt);function kt(t){var e=bt.call(this,"undefined variable: "+t)||this;return e.name="InternalUndefinedVariableError",e.variableName=t,e}var xt,qt=(t(Ot,xt=Error),Ot);function Ot(t){var e=xt.call(this,t)||this;return e.name="AssertionError",e.message=t+"",e}var St,Ft,Rt=(Et.prototype.getRegister=function(t){return this.registers[t]=this.registers[t]||{}},Et.prototype.setRegister=function(t,e){return this.registers[t]=e},Et.prototype.saveRegister=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.map(function(t){return[t,e.getRegister(t)]})},Et.prototype.restoreRegister=function(t){var i=this;return t.forEach(function(t){var e=m(t,2),r=e[0],n=e[1];return i.setRegister(r,n)})},Et.prototype.getAll=function(){return w([this.globals,this.environments],this.scopes).reduce(function(t,e){return i(t,e)},{})},Et.prototype.get=function(t){var e=this.findScope(t[0]);return this.getFromScope(e,t)},Et.prototype.getFromScope=function(t,e){var r=this;return"string"==typeof e&&(e=e.split(".")),e.reduce(function(t,e){if(d(t=function(t,e){return d(t)?t:c((t=function t(e){return e&&c(e.toLiquid)?t(e.toLiquid()):e}(t))[e])?t[e]():t instanceof o?t.hasOwnProperty(e)?t[e]:t.liquidMethodMissing(e):"size"===e?function(t){return v(t)||u(t)?t.length:t.size}(t):"first"===e?function(t){return v(t)?t[0]:t.first}(t):"last"===e?function(t){return v(t)?t[t.length-1]:t.last}(t):t[e]}(t,e))&&r.opts.strictVariables)throw new Tt(e);return t},t)},Et.prototype.push=function(t){return this.scopes.push(t)},Et.prototype.pop=function(){return this.scopes.pop()},Et.prototype.bottom=function(){return this.scopes[0]},Et.prototype.findScope=function(t){for(var e=this.scopes.length-1;0<=e;e--){var r=this.scopes[e];if(t in r)return r}return t in this.environments?this.environments:this.globals},Et);function Et(t,e,r){void 0===t&&(t={}),void 0===e&&(e=nt),void 0===r&&(r=!1),this.scopes=[{}],this.registers={},this.sync=r,this.opts=e,this.globals=e.globals,this.environments=t}(Ft=St=St||{}).Partials="partials",Ft.Layouts="layouts",Ft.Root="root";var Lt=(Pt.prototype.lookup=function(e,r,n){var i,s,o,a,u,c,l,h,p,f;return T(this,function(t){switch(t.label){case 0:i=this.options,s=i.fs,o=i.root,t.label=1;case 1:t.trys.push([1,8,9,10]),a=k(this.candidates(e,r)),u=a.next(),t.label=2;case 2:return u.done?[3,7]:(c=u.value,n?(l=s.existsSync(c),[3,5]):[3,3]);case 3:return[4,s.exists(c)];case 4:l=t.sent(),t.label=5;case 5:if(l)return[2,c];t.label=6;case 6:return u=a.next(),[3,2];case 7:return[3,10];case 8:return h=t.sent(),p={error:h},[3,10];case 9:try{u&&!u.done&&(f=a.return)&&f.call(a)}finally{if(p)throw p.error}return[7];case 10:throw this.lookupError(e,o)}})},Pt.prototype.candidates=function(e,r){var n,i,s,o,a,u,c,l,h,p,f;return T(this,function(t){switch(t.label){case 0:n=this.options,i=n.fs,s=n.extname,o=this.options[r],t.label=1;case 1:t.trys.push([1,6,7,8]),a=k(o),u=a.next(),t.label=2;case 2:return u.done?[3,5]:(c=u.value,[4,i.resolve(c,e,s)]);case 3:t.sent(),t.label=4;case 4:return u=a.next(),[3,2];case 5:return[3,8];case 6:return l=t.sent(),p={error:l},[3,8];case 7:try{u&&!u.done&&(f=a.return)&&f.call(a)}finally{if(p)throw p.error}return[7];case 8:return void 0===i.fallback?[3,10]:void 0===(h=i.fallback(e))?[3,10]:[4,h];case 9:t.sent(),t.label=10;case 10:return[2]}})},Pt.prototype.lookupError=function(t,e){var r=new Error("ENOENT");return r.message='ENOENT: Failed to lookup "'+t+'" in "'+e+'"',r.code="ENOENT",r},Pt);function Pt(t){this.options=t}var Dt=(Nt.prototype.write=function(t){this.buffer+=l(t)},Nt);function Nt(){this.buffer=""}var Mt=function(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")};function At(e){var t={then:function(t){return t(e)},catch:function(){return t}};return t}function It(r){var n={then:function(t,e){return e?e(r):n},catch:function(t){return t(r)}};return n}function _t(n){return function(t){return t&&c(t.then)}(n)?n:function(t){return t&&c(t.next)&&c(t.throw)&&c(t.return)}(n)?function r(t){var e;try{e=n.next(t)}catch(t){return It(t)}if(e.done)return At(e.value);return _t(e.value).then(r,function(t){var e;try{e=n.throw(t)}catch(t){return It(t)}return e.done?At(e.value):r(e.value)})}():At(n)}function Vt(t){return Promise.resolve(_t(t))}function jt(t){var e;return _t(t).then(function(t){return At(e=t)}).catch(function(t){throw t}),e}var Bt=(Ct.prototype.write=function(t){"string"!=typeof(t=f(t))&&""===this.buffer?this.buffer=t:this.buffer=l(this.buffer)+l(t)},Ct);function Ct(){this.buffer=""}var zt,Ht=(Kt.prototype.renderTemplatesToNodeStream=function(t,e){var r=this,n=new Mt;return Promise.resolve().then(function(){return _t(r.renderTemplates(t,e,n))}).then(function(){return n.end()},function(t){return n.error(t)}),n.stream},Kt.prototype.renderTemplates=function(e,r,n){var i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:n=n||(r.opts.keepOutputType?new Bt:new Dt),t.label=1;case 1:t.trys.push([1,8,9,10]),i=k(e),s=i.next(),t.label=2;case 2:if(s.done)return[3,7];o=s.value,t.label=3;case 3:return t.trys.push([3,5,,6]),[4,o.render(r,n)];case 4:return(a=t.sent())&&n.write(a),n.break||n.continue?[3,7]:[3,6];case 5:throw u=t.sent(),vt.is(u)?u:new vt(u,o);case 6:return s=i.next(),[3,2];case 7:return[3,10];case 8:return c=t.sent(),l={error:c},[3,10];case 9:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(l)throw l.error}return[7];case 10:return[2,n.buffer]}})},Kt);function Kt(){}function Ut(t){return!!(re(t)&p.TokenKind.Delimited)}function Qt(t){return re(t)===p.TokenKind.Operator}function Wt(t){return re(t)===p.TokenKind.HTML}function Jt(t){return re(t)===p.TokenKind.Output}function Yt(t){return re(t)===p.TokenKind.Tag}function $t(t){return re(t)===p.TokenKind.Quoted}function Gt(t){return re(t)===p.TokenKind.Literal}function Xt(t){return re(t)===p.TokenKind.Number}function Zt(t){return re(t)===p.TokenKind.PropertyAccess}function te(t){return re(t)===p.TokenKind.Word}function ee(t){return re(t)===p.TokenKind.Range}function re(t){return t?t.kind:-1}(zt=p.TokenKind||(p.TokenKind={}))[zt.Number=1]="Number",zt[zt.Literal=2]="Literal",zt[zt.Tag=4]="Tag",zt[zt.Output=8]="Output",zt[zt.HTML=16]="HTML",zt[zt.Filter=32]="Filter",zt[zt.Hash=64]="Hash",zt[zt.PropertyAccess=128]="PropertyAccess",zt[zt.Word=256]="Word",zt[zt.Range=512]="Range",zt[zt.Quoted=1024]="Quoted",zt[zt.Operator=2048]="Operator",zt[zt.Delimited=12]="Delimited";var ne=Object.freeze({isDelimitedToken:Ut,isOperatorToken:Qt,isHTMLToken:Wt,isOutputToken:Jt,isTagToken:Yt,isQuotedToken:$t,isLiteralToken:Gt,isNumberToken:Xt,isPropertyAccessToken:Zt,isWordToken:te,isRangeToken:ee}),ie=(se.prototype.on=function(t,e){return this.handlers[t]=e,this},se.prototype.trigger=function(t,e){var r=this.handlers[t];return!!r&&(r.call(this,e),!0)},se.prototype.start=function(){var t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());)if(!(this.trigger("token",t)||Yt(t)&&this.trigger("tag:"+t.name,t))){var e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this},se.prototype.stop=function(){return this.stopRequested=!0,this},se);function se(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}function oe(t){this.token=t}function ae(t,e){if(!t){var r=e?e():"expect "+t+" to be true";throw new qt(r)}}var ue,ce=(t(le,ue=o),le.prototype.equals=function(t){return d(f(t))},le.prototype.gt=function(){return!1},le.prototype.geq=function(){return!1},le.prototype.lt=function(){return!1},le.prototype.leq=function(){return!1},le.prototype.valueOf=function(){return null},le);function le(){return null!==ue&&ue.apply(this,arguments)||this}var he,pe=(t(fe,he=o),fe.prototype.equals=function(t){return!(t instanceof fe||(u(t=f(t))||v(t)?0!==t.length:!b(t)||0!==Object.keys(t).length))},fe.prototype.gt=function(){return!1},fe.prototype.geq=function(){return!1},fe.prototype.lt=function(){return!1},fe.prototype.leq=function(){return!1},fe.prototype.valueOf=function(){return""},fe);function fe(){return null!==he&&he.apply(this,arguments)||this}var de,ve=(t(ge,de=pe),ge.prototype.equals=function(t){return!1===t||!!d(f(t))||(u(t)?/^\s*$/.test(t):de.prototype.equals.call(this,t))},ge);function ge(){return null!==de&&de.apply(this,arguments)||this}var ye=new ce,me={true:!0,false:!1,nil:ye,null:ye,empty:new pe,blank:new ve},we=/[\da-fA-F]/,be=/[0-7]/,Te={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function ke(t){var e=t.charCodeAt(0);return 97<=e?e-87:65<=e?e-55:e-48}function xe(t){for(var e="",r=1;r<t.length-1;r++)if("\\"===t[r])if(void 0!==Te[t[r+1]])e+=Te[t[++r]];else if("u"===t[r+1]){for(var n=0,i=r+2;i<=r+5&&we.test(t[i]);)n=16*n+ke(t[i++]);r=i-1,e+=String.fromCharCode(n)}else if(be.test(t[r+1])){for(i=r+1,n=0;i<=r+3&&be.test(t[i]);)n=8*n+ke(t[i++]);r=i-1,e+=String.fromCharCode(n)}else e+=t[++r];else e+=t[r];return e}var qe=(Oe.prototype.evaluate=function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return T(this,function(t){switch(t.label){case 0:ae(e,function(){return"unable to evaluate: context not defined"}),n=[],t.label=1;case 1:t.trys.push([1,9,10,11]),i=k(this.postfix),s=i.next(),t.label=2;case 2:return s.done?[3,8]:Qt(o=s.value)?[4,n.pop()]:[3,5];case 3:return a=t.sent(),[4,n.pop()];case 4:return u=t.sent(),c=function(t,e,r,n,i){return(0,t[e.operator])(r,n,i)}(e.opts.operators,o,u,a,e),n.push(c),[3,7];case 5:return h=(l=n).push,[4,Se(o,e,r&&1===this.postfix.length)];case 6:h.apply(l,[t.sent()]),t.label=7;case 7:return s=i.next(),[3,2];case 8:return[3,11];case 9:return p=t.sent(),f={error:p},[3,11];case 10:try{s&&!s.done&&(d=i.return)&&d.call(i)}finally{if(f)throw f.error}return[7];case 11:return[2,n[0]]}})},Oe);function Oe(t){this.postfix=w(function(e){var r,n,i,s,o,a,u;return T(this,function(t){switch(t.label){case 0:r=[],t.label=1;case 1:t.trys.push([1,10,11,12]),n=k(e),i=n.next(),t.label=2;case 2:if(i.done)return[3,9];if(!Qt(s=i.value))return[3,6];t.label=3;case 3:return r.length&&r[r.length-1].getPrecedence()>s.getPrecedence()?[4,r.pop()]:[3,5];case 4:return t.sent(),[3,3];case 5:return r.push(s),[3,8];case 6:return[4,s];case 7:t.sent(),t.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return o=t.sent(),a={error:o},[3,12];case 11:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(a)throw a.error}return[7];case 12:return r.length?[4,r.pop()]:[3,14];case 13:return t.sent(),[3,12];case 14:return[2]}})}(t))}function Se(t,e,r){return void 0===r&&(r=!1),Zt(t)?function(e,r,n){var t=e.props.map(function(t){return Se(t,r,!1)});try{return r.get(w([e.propertyName],t))}catch(t){if(n&&"InternalUndefinedVariableError"===t.name)return null;throw new mt(t,e)}}(t,e,r):ee(t)?function(t,e){var r=Se(t.lhs,e),n=Se(t.rhs,e);return x(+r,+n+1)}(t,e):Gt(t)?function(t){return me[t.literal]}(t):Xt(t)?function(t){var e=t.whole.content+"."+(t.decimal?t.decimal.content:"");return Number(e)}(t):te(t)?t.getText():$t(t)?Fe(t):void 0}function Fe(t){return xe(t.getText())}var Re=(Ee.prototype.getText=function(){return this.input.slice(this.begin,this.end)},Ee.prototype.getPosition=function(){for(var t=m([1,1],2),e=t[0],r=t[1],n=0;n<this.begin;n++)"\n"===this.input[n]?(e++,r=1):r++;return[e,r]},Ee.prototype.size=function(){return this.end-this.begin},Ee);function Ee(t,e,r,n,i){this.kind=t,this.input=e,this.begin=r,this.end=n,this.file=i}var Le,Pe=(t(De,Le=Re),De);function De(t,e,r,n,i,s,o,a){var u=Le.call(this,t,r,n,i,a)||this;u.trimLeft=!1,u.trimRight=!1,u.content=u.getText();var c="-"===e[0],l="-"===y(e);return u.content=e.slice(c?1:0,l?-1:e.length).trim(),u.trimLeft=c||s,u.trimRight=l||o,u}function Ne(t,e){if(t&&Wt(t))for(var r=e?j:B;_[t.input.charCodeAt(t.end-1-t.trimRight)]&r;)t.trimRight++}function Me(t,e){if(t&&Wt(t)){for(var r=e?j:B;_[t.input.charCodeAt(t.begin+t.trimLeft)]&r;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}}var Ae,Ie=(t(_e,Ae=Re),_e);function _e(t,e){var r=Ae.call(this,p.TokenKind.Number,t.input,t.begin,e?e.end:t.end,t.file)||this;return r.whole=t,r.decimal=e,r}var Ve,je=(t(Be,Ve=Re),Be.prototype.isNumber=function(t){void 0===t&&(t=!1);for(var e=t&&64&_[this.input.charCodeAt(this.begin)]?this.begin+1:this.begin;e<this.end;e++)if(!(32&_[this.input.charCodeAt(e)]))return!1;return!0},Be);function Be(t,e,r,n){var i=Ve.call(this,p.TokenKind.Word,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.content=i.getText(),i}var Ce,ze=(t(He,Ce=Re),He);function He(t,e,r,n){var i=Ce.call(this,p.TokenKind.Literal,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.literal=i.getText(),i}var Ke,Ue={"==":1,"!=":1,">":1,"<":1,">=":1,"<=":1,contains:1,and:0,or:0},Qe=(t(We,Ke=Re),We.prototype.getPrecedence=function(){var t=this.getText();return t in Ue?Ue[t]:1},We);function We(t,e,r,n){var i=Ke.call(this,p.TokenKind.Operator,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.operator=i.getText(),i}var Je,Ye=(t($e,Je=Re),$e);function $e(t,e,r){var n=Je.call(this,p.TokenKind.PropertyAccess,t.input,t.begin,r,t.file)||this;return n.variable=t,n.props=e,n.propertyName=n.variable instanceof je?n.variable.getText():xe(n.variable.getText()),n}var Ge,Xe=(t(Ze,Ge=Re),Ze);function Ze(t,e,r,n,i,s){var o=Ge.call(this,p.TokenKind.Filter,r,n,i,s)||this;return o.name=t,o.args=e,o}var tr,er=(t(rr,tr=Re),rr);function rr(t,e,r,n,i,s){var o=tr.call(this,p.TokenKind.Hash,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.name=n,o.value=i,o.file=s,o}var nr,ir=(t(sr,nr=Re),sr);function sr(t,e,r,n){var i=nr.call(this,p.TokenKind.Quoted,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i}var or,ar=(t(ur,or=Re),ur.prototype.getContent=function(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)},ur);function ur(t,e,r,n){var i=or.call(this,p.TokenKind.HTML,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.trimLeft=0,i.trimRight=0,i}var cr,lr=(t(hr,cr=Re),hr);function hr(t,e,r,n,i,s){var o=cr.call(this,p.TokenKind.Range,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.lhs=n,o.rhs=i,o.file=s,o}var pr,fr=(t(dr,pr=Pe),dr);function dr(t,e,r,n,i){var s=n.trimOutputLeft,o=n.trimOutputRight,a=n.outputDelimiterLeft,u=n.outputDelimiterRight,c=t.slice(e+a.length,r-u.length);return pr.call(this,p.TokenKind.Output,c,t,e,r,s,o,i)||this}var vr=(gr.prototype.readExpression=function(){return new qe(this.readExpressionTokens())},gr.prototype.readExpressionTokens=function(){var e,r,n;return T(this,function(t){switch(t.label){case 0:return(e=this.readValue())?[4,e]:[2];case 1:t.sent(),t.label=2;case 2:return this.p<this.N?(r=this.readOperator())&&(n=this.readValue())?[4,r]:[2]:[3,5];case 3:return t.sent(),[4,n];case 4:return t.sent(),[3,2];case 5:return[2]}})},gr.prototype.readOperator=function(){this.skipBlank();var t=function(t,e,r,n){void 0===n&&(n=t.length);for(var i,s=r,o=e;s[t[o]]&&o<n;)(s=s[t[o++]]).end&&(i=s);return i?i.needBoundary&&_[t.charCodeAt(o)]&V?-1:o:-1}(this.input,this.p,this.trie,this.p+8);if(-1!==t)return new Qe(this.input,this.p,this.p=t,this.file)},gr.prototype.readFilters=function(){for(var t=[];;){var e=this.readFilter();if(!e)return t;t.push(e)}},gr.prototype.readFilter=function(){var t=this;if(this.skipBlank(),this.end())return null;ae("|"===this.peek(),function(){return"unexpected token at "+t.snapshot()}),this.p++;var e=this.p,r=this.readIdentifier();if(!r.size())return null;var n=[];if(this.skipBlank(),":"===this.peek())do{++this.p;var i=this.readFilterArg();for(i&&n.push(i);this.p<this.N&&","!==this.peek()&&"|"!==this.peek();)++this.p}while(","===this.peek());return new Xe(r.getText(),n,this.input,e,this.p,this.file)},gr.prototype.readFilterArg=function(){var t=this.readValue();if(t){if(this.skipBlank(),":"!==this.peek())return t;++this.p;var e=this.readValue();return[t.getText(),e]}},gr.prototype.readTopLevelTokens=function(t){void 0===t&&(t=nt);for(var e=[];this.p<this.N;){var r=this.readTopLevelToken(t);e.push(r)}return function(t,e){for(var r=!1,n=0;n<t.length;n++){var i=t[n];Ut(i)&&(!r&&i.trimLeft&&Ne(t[n-1],e.greedy),Yt(i)&&("raw"===i.name?r=!0:"endraw"===i.name&&(r=!1)),!r&&i.trimRight&&Me(t[n+1],e.greedy))}}(e,t),e},gr.prototype.readTopLevelToken=function(t){var e=t.tagDelimiterLeft,r=t.outputDelimiterLeft;return-1<this.rawBeginAt?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(r)?this.readOutputToken(t):this.readHTMLToken(t)},gr.prototype.readHTMLToken=function(t){for(var e=this.p;this.p<this.N;){var r=t.tagDelimiterLeft,n=t.outputDelimiterLeft;if(this.match(r))break;if(this.match(n))break;++this.p}return new ar(this.input,e,this.p,this.file)},gr.prototype.readTagToken=function(t){void 0===t&&(t=nt);var e=this.file,r=this.input,n=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.mkError("tag "+this.snapshot(n)+" not closed",n);var i=new mr(r,n,this.p,t,e);return"raw"===i.name&&(this.rawBeginAt=n),i},gr.prototype.readToDelimiter=function(t){for(;this.p<this.N;)if(8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1},gr.prototype.readOutputToken=function(t){void 0===t&&(t=nt);var e=this.file,r=this.input,n=t.outputDelimiterRight,i=this.p;if(-1===this.readToDelimiter(n))throw this.mkError("output "+this.snapshot(i)+" not closed",i);return new fr(r,i,this.p,t,e)},gr.prototype.readEndrawOrRawContent=function(t){for(var e=t.tagDelimiterLeft,r=t.tagDelimiterRight,n=this.p,i=this.readTo(e)-e.length;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(r)){var s=this.p;return n===i?(this.rawBeginAt=-1,new mr(this.input,n,s,t,this.file)):(this.p=i,new ar(this.input,n,i,this.file))}if(this.rmatch(e))break;this.p++}else i=this.readTo(e)-e.length;throw this.mkError("raw "+this.snapshot(this.rawBeginAt)+" not closed",n)},gr.prototype.mkError=function(t,e){return new ct(t,new je(this.input,e,this.N,this.file))},gr.prototype.snapshot=function(t){return void 0===t&&(t=this.p),JSON.stringify(function(t,e){return t.length>e?t.substr(0,e-3)+"...":t}(this.input.slice(t),16))},gr.prototype.readWord=function(){return console.warn("Tokenizer#readWord() will be removed, use #readIdentifier instead"),this.readIdentifier()},gr.prototype.readIdentifier=function(){this.skipBlank();for(var t=this.p;this.peekType()&V;)++this.p;return new je(this.input,t,this.p,this.file)},gr.prototype.readHashes=function(){for(var t=[];;){var e=this.readHash();if(!e)return t;t.push(e)}},gr.prototype.readHash=function(){this.skipBlank(),","===this.peek()&&++this.p;var t,e=this.p,r=this.readIdentifier();if(r.size())return this.skipBlank(),":"===this.peek()&&(++this.p,t=this.readValue()),new er(this.input,e,this.p,r,t,this.file)},gr.prototype.remaining=function(){return this.input.slice(this.p)},gr.prototype.advance=function(t){void 0===t&&(t=1),this.p+=t},gr.prototype.end=function(){return this.p>=this.N},gr.prototype.readTo=function(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1},gr.prototype.readValue=function(){var t=this.readQuoted()||this.readRange();if(t)return t;if("["===this.peek()){if(this.p++,!(i=this.readQuoted()))return;if("]"!==this.peek())return;return this.p++,new Ye(i,[],this.p)}var e=this.readIdentifier();if(e.size()){for(var r=e.isNumber(!0),n=[];;)if("["===this.peek()){r=!1,this.p++;var i=this.readValue()||new je(this.input,this.p,this.p,this.file);this.readTo("]"),n.push(i)}else{if("."!==this.peek()||"."===this.peek(1))break;if(this.p++,!(i=this.readIdentifier()).size())break;i.isNumber()||(r=!1),n.push(i)}return!n.length&&me.hasOwnProperty(e.content)?new ze(this.input,e.begin,e.end,this.file):r?new Ie(e,n[0]):new Ye(e,n,this.p)}},gr.prototype.readRange=function(){this.skipBlank();var t=this.p;if("("===this.peek()){++this.p;var e=this.readValueOrThrow();this.p+=2;var r=this.readValueOrThrow();return++this.p,new lr(this.input,t,this.p,e,r,this.file)}},gr.prototype.readValueOrThrow=function(){var t=this,e=this.readValue();return ae(e,function(){return"unexpected token "+t.snapshot()+", value expected"}),e},gr.prototype.readQuoted=function(){this.skipBlank();var t=this.p;if(8&this.peekType()){++this.p;for(var e=!1;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new ir(this.input,t,this.p,this.file)}},gr.prototype.readFileName=function(){for(var t=this.p;!(this.peekType()&j)&&","!==this.peek()&&this.p<this.N;)this.p++;return new je(this.input,t,this.p,this.file)},gr.prototype.match=function(t){for(var e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0},gr.prototype.rmatch=function(t){for(var e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0},gr.prototype.peekType=function(t){return void 0===t&&(t=0),_[this.input.charCodeAt(this.p+t)]},gr.prototype.peek=function(t){return void 0===t&&(t=0),this.input[this.p+t]},gr.prototype.skipBlank=function(){for(;this.peekType()&j;)++this.p},gr);function gr(t,e,r){void 0===r&&(r=""),this.input=t,this.trie=e,this.file=r,this.p=0,this.rawBeginAt=-1,this.N=t.length}var yr,mr=(t(wr,yr=Pe),wr);function wr(t,e,r,n,i){var s=this,o=n.trimTagLeft,a=n.trimTagRight,u=n.tagDelimiterLeft,c=n.tagDelimiterRight,l=t.slice(e+u.length,r-c.length);s=yr.call(this,p.TokenKind.Tag,l,t,e,r,o,a,i)||this;var h=new vr(s.content,n.operatorsTrie);if(s.name=h.readIdentifier().getText(),!s.name)throw new ct("illegal tag syntax",s);return h.skipBlank(),s.args=h.remaining(),s}var br=(Tr.prototype.render=function(e){var r,n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:r={},t.label=1;case 1:t.trys.push([1,8,9,10]),n=k(Object.keys(this.hash)),i=n.next(),t.label=2;case 2:return i.done?[3,7]:(s=i.value,o=r,a=s,void 0!==this.hash[s]?[3,3]:(u=!0,[3,5]));case 3:return[4,Se(this.hash[s],e)];case 4:u=t.sent(),t.label=5;case 5:o[a]=u,t.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return c=t.sent(),l={error:c},[3,10];case 9:try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(l)throw l.error}return[7];case 10:return[2,r]}})},Tr);function Tr(t){var e,r;this.hash={};var n=new vr(t,{});try{for(var i=k(n.readHashes()),s=i.next();!s.done;s=i.next()){var o=s.value;this.hash[o.name.content]=o.value}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}var kr=(xr.prototype.render=function(t,e){var r,n,i=[];try{for(var s=k(this.args),o=s.next();!o.done;o=s.next()){var a=o.value;v(a)?i.push([a[0],Se(a[1],e)]):i.push(Se(a,e))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this.impl.apply({context:e,liquid:this.liquid},w([t],i))},xr);function xr(t,e,r,n){this.name=t,this.impl=e||S,this.args=r,this.liquid=n}var qr=(Or.prototype.value=function(e,r){var n,i,s,o,a,u;return T(this,function(t){switch(t.label){case 0:return r=r||e.opts.lenientIf&&0<this.filters.length&&"default"===this.filters[0].name,[4,this.initial.evaluate(e,r)];case 1:n=t.sent(),t.label=2;case 2:t.trys.push([2,7,8,9]),i=k(this.filters),s=i.next(),t.label=3;case 3:return s.done?[3,6]:[4,s.value.render(n,e)];case 4:n=t.sent(),t.label=5;case 5:return s=i.next(),[3,3];case 6:return[3,9];case 7:return o=t.sent(),a={error:o},[3,9];case 8:try{s&&!s.done&&(u=i.return)&&u.call(i)}finally{if(a)throw a.error}return[7];case 9:return[2,n]}})},Or);function Or(t,n){this.filters=[];var e=new vr(t,n.options.operatorsTrie);this.initial=e.readExpression(),this.filters=e.readFilters().map(function(t){var e=t.name,r=t.args;return new kr(e,n.filters.get(e),r,n)})}var Sr,Fr=(t(Rr,Sr=oe),Rr.prototype.render=function(e,r){var n,i;return T(this,function(t){switch(t.label){case 0:return[4,new br(this.token.args).render(e)];case 1:return n=t.sent(),c((i=this.impl).render)?[4,i.render(e,r,n)]:[3,3];case 2:return[2,t.sent()];case 3:return[2]}})},Rr);function Rr(t,e,r){var n=Sr.call(this,t)||this;n.name=t.name;var i=r.tags.get(t.name);return n.impl=Object.create(i),n.impl.liquid=r,n.impl.parse&&n.impl.parse(t,e),n}var Er,Lr=(t(Pr,Er=oe),Pr.prototype.render=function(e,r){var n;return T(this,function(t){switch(t.label){case 0:return[4,this.value.value(e,!1)];case 1:return n=t.sent(),r.write(n),[2]}})},Pr);function Pr(t,e){var r=Er.call(this,t)||this;return r.value=new qr(t.content,e),r}var Dr,Nr=(t(Mr,Dr=oe),Mr.prototype.render=function(t,e){return T(this,function(t){return e.write(this.str),[2]})},Mr);function Mr(t){var e=Dr.call(this,t)||this;return e.str=t.getContent(),e}var Ar=(Ir.prototype.parse=function(t,e){var r=new vr(t,this.liquid.options.operatorsTrie,e).readTopLevelTokens(this.liquid.options);return this.parseTokens(r)},Ir.prototype.parseTokens=function(t){for(var e,r=[];e=t.shift();)r.push(this.parseToken(e,t));return r},Ir.prototype.parseToken=function(e,t){try{return Yt(e)?new Fr(e,t,this.liquid):Jt(e)?new Lr(e,this.liquid):new Nr(e)}catch(t){throw new pt(t,e)}},Ir.prototype.parseStream=function(t){var r=this;return new ie(t,function(t,e){return r.parseToken(t,e)})},Ir.prototype._parseFileCached=function(e,r,n){var i,s;return void 0===n&&(n=St.Root),T(this,function(t){switch(t.label){case 0:return i=n+":"+e,[4,this.cache.read(i)];case 1:return(s=t.sent())?[2,s]:[4,this._parseFile(e,r)];case 2:return s=t.sent(),this.cache.write(i,s),[2,s]}})},Ir.prototype._parseFile=function(e,r,n){var i,s,o,a;return void 0===n&&(n=St.Root),T(this,function(t){switch(t.label){case 0:return[4,this.loader.lookup(e,n,r)];case 1:return i=t.sent(),o=(s=this.liquid).parse,r?(a=this.fs.readFileSync(i),[3,4]):[3,2];case 2:return[4,this.fs.readFile(i)];case 3:a=t.sent(),t.label=4;case 4:return[2,o.apply(s,[a,i])]}})},Ir);function Ir(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new Lt(this.liquid.options)}var _r={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie);this.key=e.readIdentifier().content,e.skipBlank(),ae("="===e.peek(),function(){return"illegal token "+t.getText()}),e.advance(),this.value=e.remaining()},render:function(e){var r,n;return T(this,function(t){switch(t.label){case 0:return r=e.bottom(),n=this.key,[4,this.liquid._evalValue(this.value,e)];case 1:return r[n]=t.sent(),[2]}})}};function Vr(e){return v(e)?e:u(e)&&0<e.length?[e]:b(e)?Object.keys(e).map(function(t){return[t,e[t]]}):[]}function jr(t){return v(t)?t:[t]}var Br,Cr=(t(zr,Br=o),zr.prototype.next=function(){this.i++},zr.prototype.index0=function(){return this.i},zr.prototype.index=function(){return this.i+1},zr.prototype.first=function(){return 0===this.i},zr.prototype.last=function(){return this.i===this.length-1},zr.prototype.rindex=function(){return this.length-this.i},zr.prototype.rindex0=function(){return this.length-this.i-1},zr.prototype.valueOf=function(){return JSON.stringify(this)},zr);function zr(t){var e=Br.call(this)||this;return e.i=0,e.length=t,e}var Hr=["offset","limit","reversed"],Kr={type:"block",parse:function(t,e){var r,n=this,i=new vr(t.args,this.liquid.options.operatorsTrie),s=i.readIdentifier(),o=i.readIdentifier(),a=i.readValue();ae(s.size()&&"in"===o.content&&a,function(){return"illegal tag: "+t.getText()}),this.variable=s.content,this.collection=a,this.hash=new br(i.remaining()),this.templates=[],this.elseTemplates=[];var u=this.liquid.parser.parseStream(e).on("start",function(){return r=n.templates}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endfor",function(){return u.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});u.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return T(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=Vr,[4,Se(this.collection,e)];case 1:return(i=s.apply(void 0,[t.sent()])).length?[3,3]:[4,n.renderTemplates(this.elseTemplates,e,r)];case 2:return t.sent(),[2];case 3:return[4,this.hash.render(e)];case 4:o=t.sent(),a=this.liquid.options.orderedFilterParameters?Object.keys(o).filter(function(t){return Hr.includes(t)}):Hr.filter(function(t){return void 0!==o[t]}),i=a.reduce(function(t,e){return"offset"===e?function(t,e){return t.slice(e)}(t,o.offset):"limit"===e?function(t,e){return t.slice(0,e)}(t,o.limit):function(t){return w(t).reverse()}(t)},i),u={forloop:new Cr(i.length)},e.push(u),t.label=5;case 5:t.trys.push([5,10,11,12]),c=k(i),l=c.next(),t.label=6;case 6:return l.done?[3,9]:(h=l.value,u[this.variable]=h,[4,n.renderTemplates(this.templates,e,r)]);case 7:if(t.sent(),r.break)return r.break=!1,[3,9];r.continue=!1,u.forloop.next(),t.label=8;case 8:return l=c.next(),[3,6];case 9:return[3,12];case 10:return p=t.sent(),f={error:p},[3,12];case 11:try{l&&!l.done&&(d=c.return)&&d.call(c)}finally{if(f)throw f.error}return[7];case 12:return e.pop(),[2]}})}};var Ur={parse:function(t,e){var r=this,n=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=function(t){var e=t.readIdentifier().content;if(e)return e;var r=t.readQuoted();if(r)return Fe(r)}(n),ae(this.variable,function(){return t.args+" not valid identifier"}),this.templates=[];var i=this.liquid.parser.parseStream(e);i.on("tag:endcapture",function(){return i.stop()}).on("template",function(t){return r.templates.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),i.start()},render:function(e){var r;return T(this,function(t){switch(t.label){case 0:return[4,this.liquid.renderer.renderTemplates(this.templates,e)];case 1:return r=t.sent(),e.bottom()[this.variable]=r,[2]}})}};var Qr,Wr,Jr={parse:function(t,e){var n=this;this.cond=new qr(t.args,this.liquid),this.cases=[],this.elseTemplates=[];var i=[],r=this.liquid.parser.parseStream(e).on("tag:when",function(t){i=[];for(var e=new vr(t.args,n.liquid.options.operatorsTrie);!e.end();){var r=e.readValue();n.cases.push({val:r,templates:i}),e.readTo(",")}}).on("tag:else",function(){return i=n.elseTemplates}).on("tag:endcase",function(){return r.stop()}).on("template",function(t){return i.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});r.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=f,[4,this.cond.value(e,e.opts.lenientIf)];case 1:i=s.apply(void 0,[t.sent()]),t.label=2;case 2:t.trys.push([2,7,8,9]),o=k(this.cases),a=o.next(),t.label=3;case 3:return a.done?[3,6]:(u=a.value,Se(u.val,e,e.opts.lenientIf)!==i?[3,5]:[4,n.renderTemplates(u.templates,e,r)]);case 4:return t.sent(),[2];case 5:return a=o.next(),[3,3];case 6:return[3,9];case 7:return c=t.sent(),l={error:c},[3,9];case 8:try{a&&!a.done&&(h=o.return)&&h.call(o)}finally{if(l)throw l.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},Yr={parse:function(t,e){var r=this.liquid.parser.parseStream(e);r.on("token",function(t){"endcomment"===t.name&&r.stop()}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),r.start()}};(Wr=Qr=Qr||{})[Wr.OUTPUT=0]="OUTPUT",Wr[Wr.STORE=1]="STORE";var $r=Qr,Gr={parseFilePath:Xr,renderFilePath:Zr,parse:function(t){var e=t.args,r=new vr(e,this.liquid.options.operatorsTrie);for(this.file=this.parseFilePath(r,this.liquid);!r.end();){r.skipBlank();var n=r.p,i=r.readIdentifier();if(("with"===i.content||"for"===i.content)&&(r.skipBlank(),":"!==r.peek())){var s=r.readValue();if(s){var o=r.p,a=void 0;"as"===r.readIdentifier().content?a=r.readIdentifier():r.p=o,this[i.content]={value:s,alias:a&&a.content},r.skipBlank(),","===r.peek()&&r.advance();continue}}r.p=n;break}this.hash=new br(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d,v,g,y,m,w,b;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,[4,this.renderFilePath(this.file,e,i)];case 1:return ae(o=t.sent(),function(){return'illegal filename "'+o+'"'}),a=new Rt({},e.opts,e.sync),[4,s.render(e)];case 2:if(u=t.sent(),this.with&&(c=this.with,h=c.value,p=c.alias,u[p||o]=Se(h,e)),a.push(u),!this.for)return[3,12];l=this.for,h=l.value,p=l.alias,f=Vr(f=Se(h,e)),u.forloop=new Cr(f.length),t.label=3;case 3:t.trys.push([3,9,10,11]),d=k(f),v=d.next(),t.label=4;case 4:return v.done?[3,8]:(g=v.value,u[p]=g,[4,i._parsePartialFile(o,a.sync)]);case 5:return m=t.sent(),[4,i.renderer.renderTemplates(m,a,r)];case 6:t.sent(),u.forloop.next(),t.label=7;case 7:return v=d.next(),[3,4];case 8:return[3,11];case 9:return y=t.sent(),w={error:y},[3,11];case 10:try{v&&!v.done&&(b=d.return)&&b.call(d)}finally{if(w)throw w.error}return[7];case 11:return[3,15];case 12:return[4,i._parsePartialFile(o,a.sync)];case 13:return m=t.sent(),[4,i.renderer.renderTemplates(m,a,r)];case 14:t.sent(),t.label=15;case 15:return[2]}})}};function Xr(t,e){if(e.options.dynamicPartials){var r=t.readValue();if(void 0===r)throw new TypeError('illegal argument "'+t.input+'"');if("none"===r.getText())return null;if($t(r)){var n=e.parse(Fe(r));return 1===n.length&&Wt(n[0].token)?n[0].token.getContent():n}return r}var i=t.readFileName().getText();return"none"===i?null:i}function Zr(t,e,r){return"string"==typeof t?t:Array.isArray(t)?r.renderer.renderTemplates(t,e):Se(t,e)}var tn,en={parseFilePath:Xr,renderFilePath:Zr,parse:function(t){var e=t.args,r=new vr(e,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(r,this.liquid);var n=r.p;"with"===r.readIdentifier().content?(r.skipBlank(),":"!==r.peek()?this.withVar=r.readValue():r.p=n):r.p=n,this.hash=new br(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.withVar,a=i.renderer,[4,this.renderFilePath(this.file,e,i)];case 1:return ae(u=t.sent(),function(){return'illegal filename "'+u+'"'}),c=e.saveRegister("blocks","blockMode"),e.setRegister("blocks",{}),e.setRegister("blockMode",$r.OUTPUT),[4,s.render(e)];case 2:return l=t.sent(),o&&(l[u]=Se(o,e)),[4,i._parsePartialFile(u,e.sync)];case 3:return h=t.sent(),e.push(l),[4,a.renderTemplates(h,e,r)];case 4:return t.sent(),e.pop(),e.restoreRegister(c),[2]}})}},rn={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;h(r[this.variable])||(r[this.variable]=0),e.write(l(--r[this.variable]))}},nn={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie),r=e.readValue();for(e.skipBlank(),this.candidates=[],r&&(":"===e.peek()?(this.group=r,e.advance()):this.candidates.push(r));!e.end();){var n=e.readValue();n&&this.candidates.push(n),e.readTo(",")}ae(this.candidates.length,function(){return"empty candidates: "+t.getText()})},render:function(t,e){var r="cycle:"+Se(this.group,t)+":"+this.candidates.join(","),n=t.getRegister("cycle"),i=n[r];void 0===i&&(i=n[r]=0);var s=this.candidates[i];i=(i+1)%this.candidates.length,n[r]=i;var o=Se(s,t);e.write(o)}},sn={parse:function(t,e){var r,n=this;this.branches=[],this.elseTemplates=[],this.liquid.parser.parseStream(e).on("start",function(){return n.branches.push({predicate:new qr(t.args,n.liquid),templates:r=[]})}).on("tag:elsif",function(t){return n.branches.push({predicate:new qr(t.args,n.liquid),templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endif",function(){this.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:n=this.liquid.renderer,t.label=1;case 1:t.trys.push([1,7,8,9]),i=k(this.branches),s=i.next(),t.label=2;case 2:return s.done?[3,6]:(o=s.value,a=o.predicate,u=o.templates,[4,a.value(e,e.opts.lenientIf)]);case 3:return M(t.sent(),e)?[4,n.renderTemplates(u,e,r)]:[3,5];case 4:return t.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return c=t.sent(),l={error:c},[3,9];case 8:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(l)throw l.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},on={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;h(r[this.variable])||(r[this.variable]=0);var n=r[this.variable];r[this.variable]++,e.write(l(n))}},an={parseFilePath:Xr,renderFilePath:Zr,parse:function(t,e){var r=new vr(t.args,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(r,this.liquid),this.hash=new br(r.remaining()),this.tpls=this.liquid.parser.parseTokens(e)},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.file,a=i.renderer,null!==o?[3,2]:(e.setRegister("blockMode",$r.OUTPUT),[4,a.renderTemplates(this.tpls,e,r)]);case 1:return t.sent(),[2];case 2:return[4,this.renderFilePath(this.file,e,i)];case 3:return ae(u=t.sent(),function(){return'illegal filename "'+u+'"'}),[4,i._parseLayoutFile(u,e.sync)];case 4:return c=t.sent(),e.setRegister("blockMode",$r.STORE),[4,a.renderTemplates(this.tpls,e)];case 5:return l=t.sent(),void 0===(h=e.getRegister("blocks"))[""]&&(h[""]=function(t,e){return e.write(l)}),e.setRegister("blockMode",$r.OUTPUT),f=(p=e).push,[4,s.render(e)];case 6:return f.apply(p,[t.sent()]),[4,a.renderTemplates(c,e,r)];case 7:return t.sent(),e.pop(),[2]}})}},un=(t(cn,tn=o),cn.prototype.super=function(){return this.superBlockRender()},cn);function cn(t){void 0===t&&(t=function(){return""});var e=tn.call(this)||this;return e.superBlockRender=t,e}var ln,hn={parse:function(t,e){var r=this,n=/\w+/.exec(t.args);this.block=n?n[0]:"",this.tpls=[],this.liquid.parser.parseStream(e).on("tag:endblock",function(){this.stop()}).on("template",function(t){return r.tpls.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n;return T(this,function(t){switch(t.label){case 0:return n=this.getBlockRender(e),e.getRegister("blockMode")!==$r.STORE?[3,1]:(e.getRegister("blocks")[this.block]=n,[3,3]);case 1:return[4,n(new un,r)];case 2:t.sent(),t.label=3;case 3:return[2]}})},getBlockRender:function(n){function r(e,r){return T(this,function(t){switch(t.label){case 0:return n.push({block:e}),[4,i.renderer.renderTemplates(s,n,r)];case 1:return t.sent(),n.pop(),[2]}})}var i=this.liquid,s=this.tpls,o=n.getRegister("blocks")[this.block];return o?function(t,e){return o(new un(function(){return r(t,e)}),e)}:r}},pn={parse:function(t,e){var r=this;this.tokens=[];var n=this.liquid.parser.parseStream(e);n.on("token",function(t){"endraw"===t.name?n.stop():r.tokens.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),n.start()},render:function(){return this.tokens.map(function(t){return t.getText()}).join("")}},fn=(t(dn,ln=Cr),dn.prototype.row=function(){return Math.floor(this.i/this.cols)+1},dn.prototype.col0=function(){return this.i%this.cols},dn.prototype.col=function(){return this.col0()+1},dn.prototype.col_first=function(){return 0===this.col0()},dn.prototype.col_last=function(){return this.col()===this.cols},dn);function dn(t,e){var r=ln.call(this,t)||this;return r.length=t,r.cols=e,r}var vn={assign:_r,for:Kr,capture:Ur,case:Jr,comment:Yr,include:en,render:Gr,decrement:rn,increment:on,cycle:nn,if:sn,layout:an,block:hn,raw:pn,tablerow:{parse:function(t,e){var r=this,n=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=n.readIdentifier(),n.skipBlank();var i,s=n.readIdentifier();ae(s&&"in"===s.content,function(){return"illegal tag: "+t.getText()}),this.collection=n.readValue(),this.hash=new br(n.remaining()),this.templates=[];var o=this.liquid.parser.parseStream(e).on("start",function(){return i=r.templates}).on("tag:endtablerow",function(){return o.stop()}).on("template",function(t){return i.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});o.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p;return T(this,function(t){switch(t.label){case 0:return i=Vr,[4,Se(this.collection,e)];case 1:return n=i.apply(void 0,[t.sent()]),[4,this.hash.render(e)];case 2:s=t.sent(),o=s.offset||0,a=void 0===s.limit?n.length:s.limit,n=n.slice(o,o+a),u=s.cols||n.length,c=this.liquid.renderer,l=new fn(n.length,u),h={tablerowloop:l},e.push(h),p=0,t.label=3;case 3:return p<n.length?(h[this.variable.content]=n[p],0===l.col0()&&(1!==l.row()&&r.write("</tr>"),r.write('<tr class="row'+l.row()+'">')),r.write('<td class="col'+l.col()+'">'),[4,c.renderTemplates(this.templates,e,r)]):[3,6];case 4:t.sent(),r.write("</td>"),t.label=5;case 5:return p++,l.next(),[3,3];case 6:return n.length&&r.write("</tr>"),e.pop(),[2]}})}},unless:{parse:function(t,e){var r,n=this;this.branches=[],this.elseTemplates=[],this.liquid.parser.parseStream(e).on("start",function(){return n.branches.push({predicate:new qr(t.args,n.liquid),test:A,templates:r=[]})}).on("tag:elsif",function(t){return n.branches.push({predicate:new qr(t.args,n.liquid),test:M,templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endunless",function(){this.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f;return T(this,function(t){switch(t.label){case 0:n=this.liquid.renderer,t.label=1;case 1:t.trys.push([1,7,8,9]),i=k(this.branches),s=i.next(),t.label=2;case 2:return s.done?[3,6]:(o=s.value,a=o.predicate,u=o.test,c=o.templates,[4,a.value(e,e.opts.lenientIf)]);case 3:return l=t.sent(),u(l,e)?[4,n.renderTemplates(c,e,r)]:[3,5];case 4:return t.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return h=t.sent(),p={error:h},[3,9];case 8:try{s&&!s.done&&(f=i.return)&&f.call(i)}finally{if(p)throw p.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},break:{render:function(t,e){e.break=!0}},continue:{render:function(t,e){e.continue=!0}}},gn={"&":"&","<":"<",">":">",'"':""","'":"'"},yn={"&":"&","<":"<",">":">",""":'"',"'":"'"};function mn(t){return l(t).replace(/&|<|>|"|'/g,function(t){return gn[t]})}var wn=Math.abs,bn=Math.max,Tn=Math.min,kn=Math.ceil,xn=Math.floor;var qn=Object.freeze({escape:mn,escapeOnce:function(t){return mn(function(t){return String(t).replace(/&(amp|lt|gt|#34|#39);/g,function(t){return yn[t]})}(t))},newlineToBr:function(t){return t.replace(/\n/g,"<br />\n")},stripHtml:function(t){return t.replace(/<script.*?<\/script>|<!--.*?-->|<style.*?<\/style>|<.*?>/g,"")},abs:wn,atLeast:bn,atMost:Tn,ceil:kn,dividedBy:function(t,e){return t/e},floor:xn,minus:function(t,e){return t-e},modulo:function(t,e){return t%e},times:function(t,e){return t*e},round:function(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return Math.round(t*r)/r},plus:function(t,e){return Number(t)+Number(e)},sortNatural:function(t,r){return t&&t.sort?void 0!==r?w(t).sort(function(t,e){return R(t[r],e[r])}):w(t).sort(R):[]},urlDecode:function(t){return t.split("+").map(decodeURIComponent).join(" ")},urlEncode:function(t){return t.split(" ").map(encodeURIComponent).join("+")},join:function(t,e){return t.join(void 0===e?" ":e)},last:function(t){return v(t)?y(t):""},first:function(t){return v(t)?t[0]:""},reverse:function(t){return w(t).reverse()},sort:function(t,e){function r(t){return e?n.context.getFromScope(t,e.split(".")):t}var n=this;return jr(t).sort(function(t,e){return(t=r(t))<(e=r(e))?-1:e<t?1:0})},size:function(t){return t&&t.length||0},map:function(t,e){var r=this;return jr(t).map(function(t){return r.context.getFromScope(t,e.split("."))})},compact:function(t){return jr(t).filter(function(t){return!d(t)})},concat:function(t,e){return jr(t).concat(e)},slice:function(t,e,r){return void 0===r&&(r=1),e=e<0?t.length+e:e,t.slice(e,e+r)},where:function(t,r,n){var i=this;return jr(t).filter(function(t){var e=i.context.getFromScope(t,String(r).split("."));return void 0===n?M(e,i.context):e===n})},uniq:function(t){var e={};return(t||[]).filter(function(t){return!e.hasOwnProperty(String(t))&&(e[String(t)]=!0)})},date:function(t,e){var r;return function(t){return t instanceof Date&&!isNaN(t.getTime())}(r="now"===t||"today"===t?new Date:h(t)?new Date(1e3*t):u(t)?/^\d+$/.test(t)?new Date(1e3*+t):this.context.opts.preserveTimezones?function(t){var e=t.match(H);if(e&&"Z"===e[1])return new Date(+new Date(t)+6e4*z);if(e&&e[2]&&e[3]&&e[4]){var r=m(e,5),n=r[2],i=r[3],s=r[4],o=("+"===n?1:-1)*(60*parseInt(i,10)+parseInt(s,10));return new Date(+new Date(t)+6e4*(z+o))}return new Date(t)}(t):new Date(t):t)?function(t,e){for(var r,n="",i=e;r=K.exec(i);)n+=i.slice(0,r.index),i=i.slice(r.index+r[0].length),n+=rt(t,r);return n+i}(r,e):t},Default:function(t,e){return v(t)||u(t)?t.length?t:e:A(f(t),this.context)?e:t},json:function(t){return JSON.stringify(t)},append:function(t,e){return ae(2===arguments.length,function(){return"append expect 2 arguments"}),l(t)+l(e)},prepend:function(t,e){return ae(2===arguments.length,function(){return"prepend expect 2 arguments"}),l(e)+l(t)},lstrip:function(t){return l(t).replace(/^\s+/,"")},downcase:function(t){return l(t).toLowerCase()},upcase:function(t){return l(t).toUpperCase()},remove:function(t,e){return l(t).split(String(e)).join("")},removeFirst:function(t,e){return l(t).replace(String(e),"")},rstrip:function(t){return l(t).replace(/\s+$/,"")},split:function(t,e){return l(t).split(String(e))},strip:function(t){return l(t).trim()},stripNewlines:function(t){return l(t).replace(/\n/g,"")},capitalize:function(t){return(t=l(t)).charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,r){return l(t).split(String(e)).join(r)},replaceFirst:function(t,e,r){return l(t).replace(String(e),r)},truncate:function(t,e,r){return void 0===e&&(e=50),void 0===r&&(r="..."),(t=l(t)).length<=e?t:t.substr(0,e-r.length)+r},truncatewords:function(t,e,r){void 0===e&&(e=15),void 0===r&&(r="...");var n=t.split(/\s+/),i=n.slice(0,e).join(" ");return n.length>=e&&(i+=r),i}}),On=(Sn.prototype.get=function(t){var e=this.impls[t];return ae(e,function(){return'tag "'+t+'" not found'}),e},Sn.prototype.set=function(t,e){this.impls[t]=e},Sn);function Sn(){this.impls={}}var Fn=(Rn.prototype.get=function(t){var e=this.impls[t];return ae(e||!this.strictFilters,function(){return"undefined filter: "+t}),e},Rn.prototype.set=function(t,e){this.impls[t]=e},Rn.prototype.create=function(t,e){return new kr(t,this.get(t),e,this.liquid)},Rn);function Rn(t,e){this.strictFilters=t,this.liquid=e,this.impls={}}var En=(Ln.prototype.parse=function(t,e){return this.parser.parse(t,e)},Ln.prototype._render=function(t,e,r){var n=new Rt(e,this.options,r);return this.renderer.renderTemplates(t,n)},Ln.prototype.render=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this._render(e,r,!1))]})})},Ln.prototype.renderSync=function(t,e){return jt(this._render(t,e,!0))},Ln.prototype.renderToNodeStream=function(t,e){var r=new Rt(e,this.options);return this.renderer.renderTemplatesToNodeStream(t,r)},Ln.prototype._parseAndRender=function(t,e,r){var n=this.parse(t);return this._render(n,e,r)},Ln.prototype.parseAndRender=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this._parseAndRender(e,r,!1))]})})},Ln.prototype.parseAndRenderSync=function(t,e){return jt(this._parseAndRender(t,e,!0))},Ln.prototype._parsePartialFile=function(t,e){return this.parser.parseFile(t,e,St.Partials)},Ln.prototype._parseLayoutFile=function(t,e){return this.parser.parseFile(t,e,St.Layouts)},Ln.prototype.parseFile=function(e){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this.parser.parseFile(e,!1))]})})},Ln.prototype.parseFileSync=function(t){return jt(this.parser.parseFile(t,!0))},Ln.prototype.renderFile=function(r,n){return s(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return[4,this.parseFile(r)];case 1:return e=t.sent(),[2,this.render(e,n)]}})})},Ln.prototype.renderFileSync=function(t,e){var r=this.parseFileSync(t);return this.renderSync(r,e)},Ln.prototype.renderFileToNodeStream=function(r,n){return s(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return[4,this.parseFile(r)];case 1:return e=t.sent(),[2,this.renderToNodeStream(e,n)]}})})},Ln.prototype._evalValue=function(t,e){return new qr(t,this).value(e,!1)},Ln.prototype.evalValue=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this._evalValue(e,r))]})})},Ln.prototype.evalValueSync=function(t,e){return jt(this._evalValue(t,e))},Ln.prototype.registerFilter=function(t,e){this.filters.set(t,e)},Ln.prototype.registerTag=function(t,e){this.tags.set(t,e)},Ln.prototype.plugin=function(t){return t.call(this,Ln)},Ln.prototype.express=function(){var i=this,s=!0;return function(t,e,r){var n;s&&(s=!1,(n=i.options.root).unshift.apply(n,w(it(this.root)))),i.renderFile(t,e).then(function(t){return r(null,t)},r)}},Ln);function Ln(t){var r=this;void 0===t&&(t={}),this.options=function(t){var e=i({},nt,t);return e.partials===nt.partials&&(e.partials=e.root),e.layouts===nt.layouts&&(e.layouts=e.root),e}(function(t){if((t=t||{}).hasOwnProperty("root")&&(t.root=it(t.root)),t.hasOwnProperty("partials")&&(t.partials=it(t.partials)),t.hasOwnProperty("layouts")&&(t.layouts=it(t.layouts)),t.hasOwnProperty("cache")){var e=void 0;e="number"==typeof t.cache?0<t.cache?new L(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new L(1024):void 0,t.cache=e}return t.hasOwnProperty("operators")&&(t.operatorsTrie=C(t.operators)),t}(t)),this.parser=new Ar(this),this.renderer=new Ht,this.filters=new Fn(this.options.strictFilters,this),this.tags=new On,g(vn,function(t,e){return r.registerTag(F(e),t)}),g(qn,function(t,e){return r.registerFilter(F(e),t)})}p.AssertionError=qt,p.Context=Rt,p.Drop=o,p.Expression=qe,p.Hash=br,p.InternalUndefinedVariableError=Tt,p.Liquid=En,p.LiquidError=ot,p.ParseError=pt,p.ParseStream=ie,p.RenderError=vt,p.TagToken=mr,p.Token=Re,p.TokenizationError=ct,p.Tokenizer=vr,p.TypeGuards=ne,p.UndefinedVariableError=mt,p.Value=qr,p.assert=ae,p.createTrie=C,p.defaultOperators=I,p.evalQuotedToken=Fe,p.evalToken=Se,p.isFalsy=A,p.isTruthy=M,p.toPromise=Vt,p.toThenable=_t,p.toValue=f,Object.defineProperty(p,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t=t||self).liquidjs={})}(this,function(p){"use strict";var n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)};function t(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var i=function(){return(i=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function s(s,o,a,u){return new(a=a||Promise)(function(t,e){function r(t){try{i(u.next(t))}catch(t){e(t)}}function n(t){try{i(u.throw(t))}catch(t){e(t)}}function i(e){e.done?t(e.value):new a(function(t){t(e.value)}).then(r,n)}i((u=u.apply(s,o||[])).next())})}function T(r,n){var i,s,o,t,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(e){return function(t){return function(e){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,s&&(o=2&e[0]?s.return:e[0]?s.throw||((o=s.return)&&o.call(s),0):s.next)&&!(o=o.call(s,e[1])).done)return o;switch(s=0,o&&(e=[2&e[0],o.value]),e[0]){case 0:case 1:o=e;break;case 4:return a.label++,{value:e[1],done:!1};case 5:a.label++,s=e[1],e=[0];continue;case 7:e=a.ops.pop(),a.trys.pop();continue;default:if(!(o=0<(o=a.trys).length&&o[o.length-1])&&(6===e[0]||2===e[0])){a=0;continue}if(3===e[0]&&(!o||e[1]>o[0]&&e[1]<o[3])){a.label=e[1];break}if(6===e[0]&&a.label<o[1]){a.label=o[1],o=e;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(e);break}o[2]&&a.ops.pop(),a.trys.pop();continue}e=n.call(r,a)}catch(t){e=[6,t],s=0}finally{i=o=0}if(5&e[0])throw e[1];return{value:e[0]?e[1]:void 0,done:!0}}([e,t])}}}function k(t){var e="function"==typeof Symbol&&t[Symbol.iterator],r=0;return e?e.call(t):{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}}}function m(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,s=r.call(t),o=[];try{for(;(void 0===e||0<e--)&&!(n=s.next()).done;)o.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function w(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(m(arguments[e]));return t}var o=(e.prototype.valueOf=function(){},e.prototype.liquidMethodMissing=function(t){},e);function e(){}var r=Object.prototype.toString,a=String.prototype.toLowerCase;function u(t){return"string"==typeof t}function c(t){return"function"==typeof t}function l(t){return u(t=f(t))?t:d(t)?"":String(t)}function f(t){return t instanceof o?t.valueOf():t}function h(t){return"number"==typeof t}function d(t){return null==t}function v(t){return"[object Array]"===r.call(t)}function g(t,e){for(var r in t=t||{})if(t.hasOwnProperty(r)&&!1===e(t[r],r,t))break;return t}function y(t){return t[t.length-1]}function b(t){var e=typeof t;return null!==t&&("object"==e||"function"==e)}function x(t,e,r){void 0===r&&(r=1);for(var n=[],i=t;i<e;i+=r)n.push(i);return n}function q(t,e,r){return void 0===r&&(r=" "),O(t,e,r,function(t,e){return e+t})}function O(t,e,r,n){for(var i=e-(t=String(t)).length;0<i--;)t=n(t,r);return t}function S(t){return t}function F(t){return t.replace(/(\w?)([A-Z])/g,function(t,e,r){return(e?e+"_":"")+r.toLowerCase()})}function R(t,e){return null==t&&null==e?0:null==t?1:null==e?-1:(t=a.call(t))<(e=a.call(e))?-1:e<t?1:0}var E=function(t,e,r,n){this.key=t,this.value=e,this.next=r,this.prev=n},L=(P.prototype.write=function(t,e){if(this.cache[t])this.cache[t].value=e;else{var r=new E(t,e,this.head.next,this.head);this.head.next.prev=r,this.head.next=r,this.cache[t]=r,this.size++,this.ensureLimit()}},P.prototype.read=function(t){if(this.cache[t]){var e=this.cache[t].value;return this.remove(t),this.write(t,e),e}},P.prototype.remove=function(t){var e=this.cache[t];e.prev.next=e.next,e.next.prev=e.prev,delete this.cache[t],this.size--},P.prototype.clear=function(){this.head.next=this.tail,this.tail.prev=this.head,this.size=0,this.cache={}},P.prototype.ensureLimit=function(){this.size>this.limit&&this.remove(this.tail.prev.key)},P);function P(t,e){void 0===e&&(e=0),this.limit=t,this.size=e,this.cache={},this.head=new E("HEAD",null,null,null),this.tail=new E("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}var D=Object.freeze({resolve:function(t,e,i){return t.length&&"/"!==y(t)&&(t+="/"),function(t,e){var r=document.createElement("base");r.href=t;var n=document.getElementsByTagName("head")[0];n.insertBefore(r,n.firstChild);var i=document.createElement("a");i.href=e;var s=i.href;return n.removeChild(r),s}(t,e).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,function(t,e,r){var n=r.split("/").pop();return/\.\w+$/.test(n)?t:e+r+i})},readFile:function(n){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,new Promise(function(t,e){var r=new XMLHttpRequest;r.onload=function(){200<=r.status&&r.status<300?t(r.responseText):e(new Error(r.statusText))},r.onerror=function(){e(new Error("An error occurred whilst receiving the response."))},r.open("GET",n),r.send()})]})})},readFileSync:function(t){var e=new XMLHttpRequest;if(e.open("GET",t,!1),e.send(),e.status<200||300<=e.status)throw new Error(e.statusText);return e.responseText},exists:function(t){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,!0]})})},existsSync:function(t){return!0}});function N(t){return t&&c(t.equals)}function M(t,e){return!A(t,e)}function A(t,e){return e.opts.jsTruthy?!t:!1===t||null==t}var I={"==":function(t,e){return N(t)?t.equals(e):N(e)?e.equals(t):t===e},"!=":function(t,e){return N(t)?!t.equals(e):N(e)?!e.equals(t):t!==e},">":function(t,e){return N(t)?t.gt(e):N(e)?e.lt(t):e<t},"<":function(t,e){return N(t)?t.lt(e):N(e)?e.gt(t):t<e},">=":function(t,e){return N(t)?t.geq(e):N(e)?e.leq(t):e<=t},"<=":function(t,e){return N(t)?t.leq(e):N(e)?e.geq(t):t<=e},contains:function(t,e){return!(!t||!c(t.indexOf))&&-1<t.indexOf(e)},and:function(t,e,r){return M(t,r)&&M(e,r)},or:function(t,e,r){return M(t,r)||M(e,r)}},_=[0,0,0,0,0,0,0,0,0,20,4,4,4,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,20,2,8,0,0,0,0,8,0,0,0,64,0,65,0,0,33,33,33,33,33,33,33,33,33,33,0,0,2,2,2,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0],V=1,j=4,B=16;function C(t){var e,r,n={};try{for(var i=k(Object.entries(t)),s=i.next();!s.done;s=i.next()){for(var o=m(s.value,2),a=o[0],u=o[1],c=n,l=0;l<a.length;l++){var h=a[l];c[h]=c[h]||{},l===a.length-1&&_[a.charCodeAt(l)]&V&&(c[h].needBoundary=!0),c=c[h]}c.handler=u,c.end=!0}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}return n}_[160]=_[5760]=_[6158]=_[8192]=_[8193]=_[8194]=_[8195]=_[8196]=_[8197]=_[8198]=_[8199]=_[8200]=_[8201]=_[8202]=_[8232]=_[8233]=_[8239]=_[8287]=_[12288]=j;var z=(new Date).getTimezoneOffset(),H=/([zZ]|([+-])(\d{2}):(\d{2}))$/,K=/%([-_0^#:]+)?(\d+)?([EO])?(.)/,U=["January","February","March","April","May","June","July","August","September","October","November","December"],Q=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],W=U.map($),J=Q.map($),Y={1:"st",2:"nd",3:"rd",default:"th"};function $(t){return t.slice(0,3)}function G(t){for(var e=0,r=0;r<t.getMonth();++r)e+=[31,function(t){var e=t.getFullYear();return!(0!=(3&e)||!(e%100||e%400==0&&e))}(t)?29:28,31,30,31,30,31,31,30,31,30,31][r];return e+t.getDate()}function X(t,e){var r=G(t)+(e-t.getDay()),n=7-new Date(t.getFullYear(),0,1).getDay()+e;return String(Math.floor((r-n)/7)+1)}var Z={d:2,e:2,H:2,I:2,j:3,k:2,l:2,L:3,m:2,M:2,S:2,U:2,W:2},tt={a:" ",A:" ",b:" ",B:" ",c:" ",e:" ",k:" ",l:" ",p:" ",P:" "},et={a:function(t){return J[t.getDay()]},A:function(t){return Q[t.getDay()]},b:function(t){return W[t.getMonth()]},B:function(t){return U[t.getMonth()]},c:function(t){return t.toLocaleString()},C:function(t){return function(t){return parseInt(t.getFullYear().toString().substring(0,2),10)}(t)},d:function(t){return t.getDate()},e:function(t){return t.getDate()},H:function(t){return t.getHours()},I:function(t){return String(t.getHours()%12||12)},j:function(t){return G(t)},k:function(t){return t.getHours()},l:function(t){return String(t.getHours()%12||12)},L:function(t){return t.getMilliseconds()},m:function(t){return t.getMonth()+1},M:function(t){return t.getMinutes()},N:function(t,e){var r=Number(e.width)||9;return function(t,e,r){return void 0===r&&(r=" "),O(t,e,r,function(t,e){return t+e})}(String(t.getMilliseconds()).substr(0,r),r,"0")},p:function(t){return t.getHours()<12?"AM":"PM"},P:function(t){return t.getHours()<12?"am":"pm"},q:function(t){return function(t){var e=t.getDate().toString(),r=parseInt(e.slice(-1));return Y[r]||Y.default}(t)},s:function(t){return Math.round(t.valueOf()/1e3)},S:function(t){return t.getSeconds()},u:function(t){return t.getDay()||7},U:function(t){return X(t,0)},w:function(t){return t.getDay()},W:function(t){return X(t,1)},x:function(t){return t.toLocaleDateString()},X:function(t){return t.toLocaleTimeString()},y:function(t){return t.getFullYear().toString().substring(2,4)},Y:function(t){return t.getFullYear()},z:function(t,e){var r=Math.abs(z),n=Math.floor(r/60),i=r%60;return(0<z?"-":"+")+q(n,2,"0")+(e.flags[":"]?":":"")+q(i,2,"0")},t:function(){return"\t"},n:function(){return"\n"},"%":function(){return"%"}};function rt(t,e){var r,n,i=m(e,5),s=i[0],o=i[1],a=void 0===o?"":o,u=i[2],c=i[3],l=i[4],h=et[l];if(!h)return s;var p={};try{for(var f=k(a),d=f.next();!d.done;d=f.next()){p[d.value]=!0}}catch(t){r={error:t}}finally{try{d&&!d.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}var v=String(h(t,{flags:p,width:u,modifier:c})),g=tt[l]||"0",y=u||Z[l]||0;return p["^"]?v=v.toUpperCase():p["#"]&&(v=function(t){return w(t).some(function(t){return"a"<=t&&t<="z"})?t.toUpperCase():t.toLowerCase()}(v)),p._?g=" ":p[0]&&(g="0"),p["-"]&&(y=0),q(v,y,g)}et.h=et.b;var nt={root:["."],layouts:["."],partials:["."],cache:void 0,extname:"",fs:D,dynamicPartials:!0,jsTruthy:!1,trimTagRight:!1,trimTagLeft:!1,trimOutputRight:!1,trimOutputLeft:!1,greedy:!0,tagDelimiterLeft:"{%",tagDelimiterRight:"%}",outputDelimiterLeft:"{{",outputDelimiterRight:"}}",preserveTimezones:!1,strictFilters:!1,strictVariables:!1,lenientIf:!1,globals:{},keepOutputType:!1,timezoneOffset:z,operators:I,operatorsTrie:C(I)};function it(t){return v(t)?t:u(t)?[t]:[]}var st,ot=(t(at,st=Error),at.prototype.update=function(){var t=this.originalError;this.context=function(t){var e=m(t.getPosition(),1)[0],r=t.input.split("\n"),n=Math.max(e-2,1),i=Math.min(e+3,r.length);return x(n,i+1).map(function(t){return(t===e?">> ":" ")+q(String(t),String(i).length)+"| "+r[t-1]}).join("\n")}(this.token),this.message=function(t,e){e.file&&(t+=", file:"+e.file);var r=m(e.getPosition(),2),n=r[0],i=r[1];return t+=", line:"+n+", col:"+i}(t.message,this.token),this.stack=this.message+"\n"+this.context+"\n"+this.stack+"\nFrom "+t.stack},at);function at(t,e){var r=st.call(this,t.message)||this;return r.originalError=t,r.token=e,r.context="",r}var ut,ct=(t(lt,ut=ot),lt);function lt(t,e){var r=ut.call(this,new Error(t),e)||this;return r.name="TokenizationError",ut.prototype.update.call(r),r}var ht,pt=(t(ft,ht=ot),ft);function ft(t,e){var r=ht.call(this,t,e)||this;return r.name="ParseError",r.message=t.message,ht.prototype.update.call(r),r}var dt,vt=(t(gt,dt=ot),gt.is=function(t){return"RenderError"===t.name},gt);function gt(t,e){var r=dt.call(this,t,e.token)||this;return r.name="RenderError",r.message=t.message,dt.prototype.update.call(r),r}var yt,mt=(t(wt,yt=ot),wt);function wt(t,e){var r=yt.call(this,t,e)||this;return r.name="UndefinedVariableError",r.message=t.message,yt.prototype.update.call(r),r}var bt,Tt=(t(kt,bt=Error),kt);function kt(t){var e=bt.call(this,"undefined variable: "+t)||this;return e.name="InternalUndefinedVariableError",e.variableName=t,e}var xt,qt=(t(Ot,xt=Error),Ot);function Ot(t){var e=xt.call(this,t)||this;return e.name="AssertionError",e.message=t+"",e}var St,Ft,Rt=(Et.prototype.getRegister=function(t){return this.registers[t]=this.registers[t]||{}},Et.prototype.setRegister=function(t,e){return this.registers[t]=e},Et.prototype.saveRegister=function(){for(var e=this,t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return t.map(function(t){return[t,e.getRegister(t)]})},Et.prototype.restoreRegister=function(t){var i=this;return t.forEach(function(t){var e=m(t,2),r=e[0],n=e[1];return i.setRegister(r,n)})},Et.prototype.getAll=function(){return w([this.globals,this.environments],this.scopes).reduce(function(t,e){return i(t,e)},{})},Et.prototype.get=function(t){var e=this.findScope(t[0]);return this.getFromScope(e,t)},Et.prototype.getFromScope=function(t,e){var r=this;return"string"==typeof e&&(e=e.split(".")),e.reduce(function(t,e){if(d(t=function(t,e){return d(t)?t:c((t=function t(e){return e&&c(e.toLiquid)?t(e.toLiquid()):e}(t))[e])?t[e]():t instanceof o?t.hasOwnProperty(e)?t[e]:t.liquidMethodMissing(e):"size"===e?function(t){return v(t)||u(t)?t.length:t.size}(t):"first"===e?function(t){return v(t)?t[0]:t.first}(t):"last"===e?function(t){return v(t)?t[t.length-1]:t.last}(t):t[e]}(t,e))&&r.opts.strictVariables)throw new Tt(e);return t},t)},Et.prototype.push=function(t){return this.scopes.push(t)},Et.prototype.pop=function(){return this.scopes.pop()},Et.prototype.bottom=function(){return this.scopes[0]},Et.prototype.findScope=function(t){for(var e=this.scopes.length-1;0<=e;e--){var r=this.scopes[e];if(t in r)return r}return t in this.environments?this.environments:this.globals},Et);function Et(t,e,r){void 0===t&&(t={}),void 0===e&&(e=nt),void 0===r&&(r=!1),this.scopes=[{}],this.registers={},this.sync=r,this.opts=e,this.globals=e.globals,this.environments=t}(Ft=St=St||{}).Partials="partials",Ft.Layouts="layouts",Ft.Root="root";var Lt=(Pt.prototype.lookup=function(e,r,n){var i,s,o,a,u,c,l,h,p;return T(this,function(t){switch(t.label){case 0:i=this.options.fs,s=this.options[r],t.label=1;case 1:t.trys.push([1,8,9,10]),o=k(this.candidates(e,s)),a=o.next(),t.label=2;case 2:return a.done?[3,7]:(u=a.value,n?(c=i.existsSync(u),[3,5]):[3,3]);case 3:return[4,i.exists(u)];case 4:c=t.sent(),t.label=5;case 5:if(c)return[2,u];t.label=6;case 6:return a=o.next(),[3,2];case 7:return[3,10];case 8:return l=t.sent(),h={error:l},[3,10];case 9:try{a&&!a.done&&(p=o.return)&&p.call(o)}finally{if(h)throw h.error}return[7];case 10:throw this.lookupError(e,s)}})},Pt.prototype.candidates=function(e,r){var n,i,s,o,a,u,c,l,h,p;return T(this,function(t){switch(t.label){case 0:n=this.options,i=n.fs,s=n.extname,t.label=1;case 1:t.trys.push([1,6,7,8]),o=k(r),a=o.next(),t.label=2;case 2:return a.done?[3,5]:(u=a.value,[4,i.resolve(u,e,s)]);case 3:t.sent(),t.label=4;case 4:return a=o.next(),[3,2];case 5:return[3,8];case 6:return c=t.sent(),h={error:c},[3,8];case 7:try{a&&!a.done&&(p=o.return)&&p.call(o)}finally{if(h)throw h.error}return[7];case 8:return void 0===i.fallback?[3,10]:void 0===(l=i.fallback(e))?[3,10]:[4,l];case 9:t.sent(),t.label=10;case 10:return[2]}})},Pt.prototype.lookupError=function(t,e){var r=new Error("ENOENT");return r.message='ENOENT: Failed to lookup "'+t+'" in "'+e+'"',r.code="ENOENT",r},Pt);function Pt(t){this.options=t}var Dt=(Nt.prototype.write=function(t){this.buffer+=l(t)},Nt);function Nt(){this.buffer=""}var Mt=function(){throw this.buffer="",this.stream=null,new Error("streaming not supported in browser")};function At(e){var t={then:function(t){return t(e)},catch:function(){return t}};return t}function It(r){var n={then:function(t,e){return e?e(r):n},catch:function(t){return t(r)}};return n}function _t(n){return function(t){return t&&c(t.then)}(n)?n:function(t){return t&&c(t.next)&&c(t.throw)&&c(t.return)}(n)?function r(t){var e;try{e=n.next(t)}catch(t){return It(t)}if(e.done)return At(e.value);return _t(e.value).then(r,function(t){var e;try{e=n.throw(t)}catch(t){return It(t)}return e.done?At(e.value):r(e.value)})}():At(n)}function Vt(t){return Promise.resolve(_t(t))}function jt(t){var e;return _t(t).then(function(t){return At(e=t)}).catch(function(t){throw t}),e}var Bt=(Ct.prototype.write=function(t){"string"!=typeof(t=f(t))&&""===this.buffer?this.buffer=t:this.buffer=l(this.buffer)+l(t)},Ct);function Ct(){this.buffer=""}var zt,Ht=(Kt.prototype.renderTemplatesToNodeStream=function(t,e){var r=this,n=new Mt;return Promise.resolve().then(function(){return _t(r.renderTemplates(t,e,n))}).then(function(){return n.end()},function(t){return n.error(t)}),n.stream},Kt.prototype.renderTemplates=function(e,r,n){var i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:n=n||(r.opts.keepOutputType?new Bt:new Dt),t.label=1;case 1:t.trys.push([1,8,9,10]),i=k(e),s=i.next(),t.label=2;case 2:if(s.done)return[3,7];o=s.value,t.label=3;case 3:return t.trys.push([3,5,,6]),[4,o.render(r,n)];case 4:return(a=t.sent())&&n.write(a),n.break||n.continue?[3,7]:[3,6];case 5:throw u=t.sent(),vt.is(u)?u:new vt(u,o);case 6:return s=i.next(),[3,2];case 7:return[3,10];case 8:return c=t.sent(),l={error:c},[3,10];case 9:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(l)throw l.error}return[7];case 10:return[2,n.buffer]}})},Kt);function Kt(){}function Ut(t){return!!(re(t)&p.TokenKind.Delimited)}function Qt(t){return re(t)===p.TokenKind.Operator}function Wt(t){return re(t)===p.TokenKind.HTML}function Jt(t){return re(t)===p.TokenKind.Output}function Yt(t){return re(t)===p.TokenKind.Tag}function $t(t){return re(t)===p.TokenKind.Quoted}function Gt(t){return re(t)===p.TokenKind.Literal}function Xt(t){return re(t)===p.TokenKind.Number}function Zt(t){return re(t)===p.TokenKind.PropertyAccess}function te(t){return re(t)===p.TokenKind.Word}function ee(t){return re(t)===p.TokenKind.Range}function re(t){return t?t.kind:-1}(zt=p.TokenKind||(p.TokenKind={}))[zt.Number=1]="Number",zt[zt.Literal=2]="Literal",zt[zt.Tag=4]="Tag",zt[zt.Output=8]="Output",zt[zt.HTML=16]="HTML",zt[zt.Filter=32]="Filter",zt[zt.Hash=64]="Hash",zt[zt.PropertyAccess=128]="PropertyAccess",zt[zt.Word=256]="Word",zt[zt.Range=512]="Range",zt[zt.Quoted=1024]="Quoted",zt[zt.Operator=2048]="Operator",zt[zt.Delimited=12]="Delimited";var ne=Object.freeze({isDelimitedToken:Ut,isOperatorToken:Qt,isHTMLToken:Wt,isOutputToken:Jt,isTagToken:Yt,isQuotedToken:$t,isLiteralToken:Gt,isNumberToken:Xt,isPropertyAccessToken:Zt,isWordToken:te,isRangeToken:ee}),ie=(se.prototype.on=function(t,e){return this.handlers[t]=e,this},se.prototype.trigger=function(t,e){var r=this.handlers[t];return!!r&&(r.call(this,e),!0)},se.prototype.start=function(){var t;for(this.trigger("start");!this.stopRequested&&(t=this.tokens.shift());)if(!(this.trigger("token",t)||Yt(t)&&this.trigger("tag:"+t.name,t))){var e=this.parseToken(t,this.tokens);this.trigger("template",e)}return this.stopRequested||this.trigger("end"),this},se.prototype.stop=function(){return this.stopRequested=!0,this},se);function se(t,e){this.handlers={},this.stopRequested=!1,this.tokens=t,this.parseToken=e}function oe(t){this.token=t}function ae(t,e){if(!t){var r=e?e():"expect "+t+" to be true";throw new qt(r)}}var ue,ce=(t(le,ue=o),le.prototype.equals=function(t){return d(f(t))},le.prototype.gt=function(){return!1},le.prototype.geq=function(){return!1},le.prototype.lt=function(){return!1},le.prototype.leq=function(){return!1},le.prototype.valueOf=function(){return null},le);function le(){return null!==ue&&ue.apply(this,arguments)||this}var he,pe=(t(fe,he=o),fe.prototype.equals=function(t){return!(t instanceof fe||(u(t=f(t))||v(t)?0!==t.length:!b(t)||0!==Object.keys(t).length))},fe.prototype.gt=function(){return!1},fe.prototype.geq=function(){return!1},fe.prototype.lt=function(){return!1},fe.prototype.leq=function(){return!1},fe.prototype.valueOf=function(){return""},fe);function fe(){return null!==he&&he.apply(this,arguments)||this}var de,ve=(t(ge,de=pe),ge.prototype.equals=function(t){return!1===t||!!d(f(t))||(u(t)?/^\s*$/.test(t):de.prototype.equals.call(this,t))},ge);function ge(){return null!==de&&de.apply(this,arguments)||this}var ye=new ce,me={true:!0,false:!1,nil:ye,null:ye,empty:new pe,blank:new ve},we=/[\da-fA-F]/,be=/[0-7]/,Te={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function ke(t){var e=t.charCodeAt(0);return 97<=e?e-87:65<=e?e-55:e-48}function xe(t){for(var e="",r=1;r<t.length-1;r++)if("\\"===t[r])if(void 0!==Te[t[r+1]])e+=Te[t[++r]];else if("u"===t[r+1]){for(var n=0,i=r+2;i<=r+5&&we.test(t[i]);)n=16*n+ke(t[i++]);r=i-1,e+=String.fromCharCode(n)}else if(be.test(t[r+1])){for(i=r+1,n=0;i<=r+3&&be.test(t[i]);)n=8*n+ke(t[i++]);r=i-1,e+=String.fromCharCode(n)}else e+=t[++r];else e+=t[r];return e}var qe=(Oe.prototype.evaluate=function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return T(this,function(t){switch(t.label){case 0:ae(e,function(){return"unable to evaluate: context not defined"}),n=[],t.label=1;case 1:t.trys.push([1,9,10,11]),i=k(this.postfix),s=i.next(),t.label=2;case 2:return s.done?[3,8]:Qt(o=s.value)?[4,n.pop()]:[3,5];case 3:return a=t.sent(),[4,n.pop()];case 4:return u=t.sent(),c=function(t,e,r,n,i){return(0,t[e.operator])(r,n,i)}(e.opts.operators,o,u,a,e),n.push(c),[3,7];case 5:return h=(l=n).push,[4,Se(o,e,r&&1===this.postfix.length)];case 6:h.apply(l,[t.sent()]),t.label=7;case 7:return s=i.next(),[3,2];case 8:return[3,11];case 9:return p=t.sent(),f={error:p},[3,11];case 10:try{s&&!s.done&&(d=i.return)&&d.call(i)}finally{if(f)throw f.error}return[7];case 11:return[2,n[0]]}})},Oe);function Oe(t){this.postfix=w(function(e){var r,n,i,s,o,a,u;return T(this,function(t){switch(t.label){case 0:r=[],t.label=1;case 1:t.trys.push([1,10,11,12]),n=k(e),i=n.next(),t.label=2;case 2:if(i.done)return[3,9];if(!Qt(s=i.value))return[3,6];t.label=3;case 3:return r.length&&r[r.length-1].getPrecedence()>s.getPrecedence()?[4,r.pop()]:[3,5];case 4:return t.sent(),[3,3];case 5:return r.push(s),[3,8];case 6:return[4,s];case 7:t.sent(),t.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return o=t.sent(),a={error:o},[3,12];case 11:try{i&&!i.done&&(u=n.return)&&u.call(n)}finally{if(a)throw a.error}return[7];case 12:return r.length?[4,r.pop()]:[3,14];case 13:return t.sent(),[3,12];case 14:return[2]}})}(t))}function Se(t,e,r){return void 0===r&&(r=!1),Zt(t)?function(e,r,n){var t=e.props.map(function(t){return Se(t,r,!1)});try{return r.get(w([e.propertyName],t))}catch(t){if(n&&"InternalUndefinedVariableError"===t.name)return null;throw new mt(t,e)}}(t,e,r):ee(t)?function(t,e){var r=Se(t.lhs,e),n=Se(t.rhs,e);return x(+r,+n+1)}(t,e):Gt(t)?function(t){return me[t.literal]}(t):Xt(t)?function(t){var e=t.whole.content+"."+(t.decimal?t.decimal.content:"");return Number(e)}(t):te(t)?t.getText():$t(t)?Fe(t):void 0}function Fe(t){return xe(t.getText())}var Re=(Ee.prototype.getText=function(){return this.input.slice(this.begin,this.end)},Ee.prototype.getPosition=function(){for(var t=m([1,1],2),e=t[0],r=t[1],n=0;n<this.begin;n++)"\n"===this.input[n]?(e++,r=1):r++;return[e,r]},Ee.prototype.size=function(){return this.end-this.begin},Ee);function Ee(t,e,r,n,i){this.kind=t,this.input=e,this.begin=r,this.end=n,this.file=i}var Le,Pe=(t(De,Le=Re),De);function De(t,e,r,n,i,s,o,a){var u=Le.call(this,t,r,n,i,a)||this;u.trimLeft=!1,u.trimRight=!1,u.content=u.getText();var c="-"===e[0],l="-"===y(e);return u.content=e.slice(c?1:0,l?-1:e.length).trim(),u.trimLeft=c||s,u.trimRight=l||o,u}function Ne(t,e){if(t&&Wt(t))for(var r=e?j:B;_[t.input.charCodeAt(t.end-1-t.trimRight)]&r;)t.trimRight++}function Me(t,e){if(t&&Wt(t)){for(var r=e?j:B;_[t.input.charCodeAt(t.begin+t.trimLeft)]&r;)t.trimLeft++;"\n"===t.input.charAt(t.begin+t.trimLeft)&&t.trimLeft++}}var Ae,Ie=(t(_e,Ae=Re),_e);function _e(t,e){var r=Ae.call(this,p.TokenKind.Number,t.input,t.begin,e?e.end:t.end,t.file)||this;return r.whole=t,r.decimal=e,r}var Ve,je=(t(Be,Ve=Re),Be.prototype.isNumber=function(t){void 0===t&&(t=!1);for(var e=t&&64&_[this.input.charCodeAt(this.begin)]?this.begin+1:this.begin;e<this.end;e++)if(!(32&_[this.input.charCodeAt(e)]))return!1;return!0},Be);function Be(t,e,r,n){var i=Ve.call(this,p.TokenKind.Word,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.content=i.getText(),i}var Ce,ze=(t(He,Ce=Re),He);function He(t,e,r,n){var i=Ce.call(this,p.TokenKind.Literal,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.literal=i.getText(),i}var Ke,Ue={"==":1,"!=":1,">":1,"<":1,">=":1,"<=":1,contains:1,and:0,or:0},Qe=(t(We,Ke=Re),We.prototype.getPrecedence=function(){var t=this.getText();return t in Ue?Ue[t]:1},We);function We(t,e,r,n){var i=Ke.call(this,p.TokenKind.Operator,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.operator=i.getText(),i}var Je,Ye=(t($e,Je=Re),$e);function $e(t,e,r){var n=Je.call(this,p.TokenKind.PropertyAccess,t.input,t.begin,r,t.file)||this;return n.variable=t,n.props=e,n.propertyName=n.variable instanceof je?n.variable.getText():xe(n.variable.getText()),n}var Ge,Xe=(t(Ze,Ge=Re),Ze);function Ze(t,e,r,n,i,s){var o=Ge.call(this,p.TokenKind.Filter,r,n,i,s)||this;return o.name=t,o.args=e,o}var tr,er=(t(rr,tr=Re),rr);function rr(t,e,r,n,i,s){var o=tr.call(this,p.TokenKind.Hash,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.name=n,o.value=i,o.file=s,o}var nr,ir=(t(sr,nr=Re),sr);function sr(t,e,r,n){var i=nr.call(this,p.TokenKind.Quoted,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i}var or,ar=(t(ur,or=Re),ur.prototype.getContent=function(){return this.input.slice(this.begin+this.trimLeft,this.end-this.trimRight)},ur);function ur(t,e,r,n){var i=or.call(this,p.TokenKind.HTML,t,e,r,n)||this;return i.input=t,i.begin=e,i.end=r,i.file=n,i.trimLeft=0,i.trimRight=0,i}var cr,lr=(t(hr,cr=Re),hr);function hr(t,e,r,n,i,s){var o=cr.call(this,p.TokenKind.Range,t,e,r,s)||this;return o.input=t,o.begin=e,o.end=r,o.lhs=n,o.rhs=i,o.file=s,o}var pr,fr=(t(dr,pr=Pe),dr);function dr(t,e,r,n,i){var s=n.trimOutputLeft,o=n.trimOutputRight,a=n.outputDelimiterLeft,u=n.outputDelimiterRight,c=t.slice(e+a.length,r-u.length);return pr.call(this,p.TokenKind.Output,c,t,e,r,s,o,i)||this}var vr=(gr.prototype.readExpression=function(){return new qe(this.readExpressionTokens())},gr.prototype.readExpressionTokens=function(){var e,r,n;return T(this,function(t){switch(t.label){case 0:return(e=this.readValue())?[4,e]:[2];case 1:t.sent(),t.label=2;case 2:return this.p<this.N?(r=this.readOperator())&&(n=this.readValue())?[4,r]:[2]:[3,5];case 3:return t.sent(),[4,n];case 4:return t.sent(),[3,2];case 5:return[2]}})},gr.prototype.readOperator=function(){this.skipBlank();var t=function(t,e,r,n){void 0===n&&(n=t.length);for(var i,s=r,o=e;s[t[o]]&&o<n;)(s=s[t[o++]]).end&&(i=s);return i?i.needBoundary&&_[t.charCodeAt(o)]&V?-1:o:-1}(this.input,this.p,this.trie,this.p+8);if(-1!==t)return new Qe(this.input,this.p,this.p=t,this.file)},gr.prototype.readFilters=function(){for(var t=[];;){var e=this.readFilter();if(!e)return t;t.push(e)}},gr.prototype.readFilter=function(){var t=this;if(this.skipBlank(),this.end())return null;ae("|"===this.peek(),function(){return"unexpected token at "+t.snapshot()}),this.p++;var e=this.p,r=this.readIdentifier();if(!r.size())return null;var n=[];if(this.skipBlank(),":"===this.peek())do{++this.p;var i=this.readFilterArg();for(i&&n.push(i);this.p<this.N&&","!==this.peek()&&"|"!==this.peek();)++this.p}while(","===this.peek());return new Xe(r.getText(),n,this.input,e,this.p,this.file)},gr.prototype.readFilterArg=function(){var t=this.readValue();if(t){if(this.skipBlank(),":"!==this.peek())return t;++this.p;var e=this.readValue();return[t.getText(),e]}},gr.prototype.readTopLevelTokens=function(t){void 0===t&&(t=nt);for(var e=[];this.p<this.N;){var r=this.readTopLevelToken(t);e.push(r)}return function(t,e){for(var r=!1,n=0;n<t.length;n++){var i=t[n];Ut(i)&&(!r&&i.trimLeft&&Ne(t[n-1],e.greedy),Yt(i)&&("raw"===i.name?r=!0:"endraw"===i.name&&(r=!1)),!r&&i.trimRight&&Me(t[n+1],e.greedy))}}(e,t),e},gr.prototype.readTopLevelToken=function(t){var e=t.tagDelimiterLeft,r=t.outputDelimiterLeft;return-1<this.rawBeginAt?this.readEndrawOrRawContent(t):this.match(e)?this.readTagToken(t):this.match(r)?this.readOutputToken(t):this.readHTMLToken(t)},gr.prototype.readHTMLToken=function(t){for(var e=this.p;this.p<this.N;){var r=t.tagDelimiterLeft,n=t.outputDelimiterLeft;if(this.match(r))break;if(this.match(n))break;++this.p}return new ar(this.input,e,this.p,this.file)},gr.prototype.readTagToken=function(t){void 0===t&&(t=nt);var e=this.file,r=this.input,n=this.p;if(-1===this.readToDelimiter(t.tagDelimiterRight))throw this.mkError("tag "+this.snapshot(n)+" not closed",n);var i=new mr(r,n,this.p,t,e);return"raw"===i.name&&(this.rawBeginAt=n),i},gr.prototype.readToDelimiter=function(t){for(;this.p<this.N;)if(8&this.peekType())this.readQuoted();else if(++this.p,this.rmatch(t))return this.p;return-1},gr.prototype.readOutputToken=function(t){void 0===t&&(t=nt);var e=this.file,r=this.input,n=t.outputDelimiterRight,i=this.p;if(-1===this.readToDelimiter(n))throw this.mkError("output "+this.snapshot(i)+" not closed",i);return new fr(r,i,this.p,t,e)},gr.prototype.readEndrawOrRawContent=function(t){for(var e=t.tagDelimiterLeft,r=t.tagDelimiterRight,n=this.p,i=this.readTo(e)-e.length;this.p<this.N;)if("endraw"===this.readIdentifier().getText())for(;this.p<=this.N;){if(this.rmatch(r)){var s=this.p;return n===i?(this.rawBeginAt=-1,new mr(this.input,n,s,t,this.file)):(this.p=i,new ar(this.input,n,i,this.file))}if(this.rmatch(e))break;this.p++}else i=this.readTo(e)-e.length;throw this.mkError("raw "+this.snapshot(this.rawBeginAt)+" not closed",n)},gr.prototype.mkError=function(t,e){return new ct(t,new je(this.input,e,this.N,this.file))},gr.prototype.snapshot=function(t){return void 0===t&&(t=this.p),JSON.stringify(function(t,e){return t.length>e?t.substr(0,e-3)+"...":t}(this.input.slice(t),16))},gr.prototype.readWord=function(){return console.warn("Tokenizer#readWord() will be removed, use #readIdentifier instead"),this.readIdentifier()},gr.prototype.readIdentifier=function(){this.skipBlank();for(var t=this.p;this.peekType()&V;)++this.p;return new je(this.input,t,this.p,this.file)},gr.prototype.readHashes=function(){for(var t=[];;){var e=this.readHash();if(!e)return t;t.push(e)}},gr.prototype.readHash=function(){this.skipBlank(),","===this.peek()&&++this.p;var t,e=this.p,r=this.readIdentifier();if(r.size())return this.skipBlank(),":"===this.peek()&&(++this.p,t=this.readValue()),new er(this.input,e,this.p,r,t,this.file)},gr.prototype.remaining=function(){return this.input.slice(this.p)},gr.prototype.advance=function(t){void 0===t&&(t=1),this.p+=t},gr.prototype.end=function(){return this.p>=this.N},gr.prototype.readTo=function(t){for(;this.p<this.N;)if(++this.p,this.rmatch(t))return this.p;return-1},gr.prototype.readValue=function(){var t=this.readQuoted()||this.readRange();if(t)return t;if("["===this.peek()){if(this.p++,!(i=this.readQuoted()))return;if("]"!==this.peek())return;return this.p++,new Ye(i,[],this.p)}var e=this.readIdentifier();if(e.size()){for(var r=e.isNumber(!0),n=[];;)if("["===this.peek()){r=!1,this.p++;var i=this.readValue()||new je(this.input,this.p,this.p,this.file);this.readTo("]"),n.push(i)}else{if("."!==this.peek()||"."===this.peek(1))break;if(this.p++,!(i=this.readIdentifier()).size())break;i.isNumber()||(r=!1),n.push(i)}return!n.length&&me.hasOwnProperty(e.content)?new ze(this.input,e.begin,e.end,this.file):r?new Ie(e,n[0]):new Ye(e,n,this.p)}},gr.prototype.readRange=function(){this.skipBlank();var t=this.p;if("("===this.peek()){++this.p;var e=this.readValueOrThrow();this.p+=2;var r=this.readValueOrThrow();return++this.p,new lr(this.input,t,this.p,e,r,this.file)}},gr.prototype.readValueOrThrow=function(){var t=this,e=this.readValue();return ae(e,function(){return"unexpected token "+t.snapshot()+", value expected"}),e},gr.prototype.readQuoted=function(){this.skipBlank();var t=this.p;if(8&this.peekType()){++this.p;for(var e=!1;this.p<this.N&&(++this.p,this.input[this.p-1]!==this.input[t]||e);)e?e=!1:"\\"===this.input[this.p-1]&&(e=!0);return new ir(this.input,t,this.p,this.file)}},gr.prototype.readFileName=function(){for(var t=this.p;!(this.peekType()&j)&&","!==this.peek()&&this.p<this.N;)this.p++;return new je(this.input,t,this.p,this.file)},gr.prototype.match=function(t){for(var e=0;e<t.length;e++)if(t[e]!==this.input[this.p+e])return!1;return!0},gr.prototype.rmatch=function(t){for(var e=0;e<t.length;e++)if(t[t.length-1-e]!==this.input[this.p-1-e])return!1;return!0},gr.prototype.peekType=function(t){return void 0===t&&(t=0),_[this.input.charCodeAt(this.p+t)]},gr.prototype.peek=function(t){return void 0===t&&(t=0),this.input[this.p+t]},gr.prototype.skipBlank=function(){for(;this.peekType()&j;)++this.p},gr);function gr(t,e,r){void 0===r&&(r=""),this.input=t,this.trie=e,this.file=r,this.p=0,this.rawBeginAt=-1,this.N=t.length}var yr,mr=(t(wr,yr=Pe),wr);function wr(t,e,r,n,i){var s=this,o=n.trimTagLeft,a=n.trimTagRight,u=n.tagDelimiterLeft,c=n.tagDelimiterRight,l=t.slice(e+u.length,r-c.length);s=yr.call(this,p.TokenKind.Tag,l,t,e,r,o,a,i)||this;var h=new vr(s.content,n.operatorsTrie);if(s.name=h.readIdentifier().getText(),!s.name)throw new ct("illegal tag syntax",s);return h.skipBlank(),s.args=h.remaining(),s}var br=(Tr.prototype.render=function(e){var r,n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:r={},t.label=1;case 1:t.trys.push([1,8,9,10]),n=k(Object.keys(this.hash)),i=n.next(),t.label=2;case 2:return i.done?[3,7]:(s=i.value,o=r,a=s,void 0!==this.hash[s]?[3,3]:(u=!0,[3,5]));case 3:return[4,Se(this.hash[s],e)];case 4:u=t.sent(),t.label=5;case 5:o[a]=u,t.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return c=t.sent(),l={error:c},[3,10];case 9:try{i&&!i.done&&(h=n.return)&&h.call(n)}finally{if(l)throw l.error}return[7];case 10:return[2,r]}})},Tr);function Tr(t){var e,r;this.hash={};var n=new vr(t,{});try{for(var i=k(n.readHashes()),s=i.next();!s.done;s=i.next()){var o=s.value;this.hash[o.name.content]=o.value}}catch(t){e={error:t}}finally{try{s&&!s.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}}var kr=(xr.prototype.render=function(t,e){var r,n,i=[];try{for(var s=k(this.args),o=s.next();!o.done;o=s.next()){var a=o.value;v(a)?i.push([a[0],Se(a[1],e)]):i.push(Se(a,e))}}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return this.impl.apply({context:e,liquid:this.liquid},w([t],i))},xr);function xr(t,e,r,n){this.name=t,this.impl=e||S,this.args=r,this.liquid=n}var qr=(Or.prototype.value=function(e,r){var n,i,s,o,a,u;return T(this,function(t){switch(t.label){case 0:return r=r||e.opts.lenientIf&&0<this.filters.length&&"default"===this.filters[0].name,[4,this.initial.evaluate(e,r)];case 1:n=t.sent(),t.label=2;case 2:t.trys.push([2,7,8,9]),i=k(this.filters),s=i.next(),t.label=3;case 3:return s.done?[3,6]:[4,s.value.render(n,e)];case 4:n=t.sent(),t.label=5;case 5:return s=i.next(),[3,3];case 6:return[3,9];case 7:return o=t.sent(),a={error:o},[3,9];case 8:try{s&&!s.done&&(u=i.return)&&u.call(i)}finally{if(a)throw a.error}return[7];case 9:return[2,n]}})},Or);function Or(t,n){this.filters=[];var e=new vr(t,n.options.operatorsTrie);this.initial=e.readExpression(),this.filters=e.readFilters().map(function(t){var e=t.name,r=t.args;return new kr(e,n.filters.get(e),r,n)})}var Sr,Fr=(t(Rr,Sr=oe),Rr.prototype.render=function(e,r){var n,i;return T(this,function(t){switch(t.label){case 0:return[4,new br(this.token.args).render(e)];case 1:return n=t.sent(),c((i=this.impl).render)?[4,i.render(e,r,n)]:[3,3];case 2:return[2,t.sent()];case 3:return[2]}})},Rr);function Rr(t,e,r){var n=Sr.call(this,t)||this;n.name=t.name;var i=r.tags.get(t.name);return n.impl=Object.create(i),n.impl.liquid=r,n.impl.parse&&n.impl.parse(t,e),n}var Er,Lr=(t(Pr,Er=oe),Pr.prototype.render=function(e,r){var n;return T(this,function(t){switch(t.label){case 0:return[4,this.value.value(e,!1)];case 1:return n=t.sent(),r.write(n),[2]}})},Pr);function Pr(t,e){var r=Er.call(this,t)||this;return r.value=new qr(t.content,e),r}var Dr,Nr=(t(Mr,Dr=oe),Mr.prototype.render=function(t,e){return T(this,function(t){return e.write(this.str),[2]})},Mr);function Mr(t){var e=Dr.call(this,t)||this;return e.str=t.getContent(),e}var Ar=(Ir.prototype.parse=function(t,e){var r=new vr(t,this.liquid.options.operatorsTrie,e).readTopLevelTokens(this.liquid.options);return this.parseTokens(r)},Ir.prototype.parseTokens=function(t){for(var e,r=[];e=t.shift();)r.push(this.parseToken(e,t));return r},Ir.prototype.parseToken=function(e,t){try{return Yt(e)?new Fr(e,t,this.liquid):Jt(e)?new Lr(e,this.liquid):new Nr(e)}catch(t){throw new pt(t,e)}},Ir.prototype.parseStream=function(t){var r=this;return new ie(t,function(t,e){return r.parseToken(t,e)})},Ir.prototype._parseFileCached=function(e,r,n){var i,s;return void 0===n&&(n=St.Root),T(this,function(t){switch(t.label){case 0:return i=n+":"+e,[4,this.cache.read(i)];case 1:return(s=t.sent())?[2,s]:[4,this._parseFile(e,r)];case 2:return s=t.sent(),this.cache.write(i,s),[2,s]}})},Ir.prototype._parseFile=function(e,r,n){var i,s,o,a;return void 0===n&&(n=St.Root),T(this,function(t){switch(t.label){case 0:return[4,this.loader.lookup(e,n,r)];case 1:return i=t.sent(),o=(s=this.liquid).parse,r?(a=this.fs.readFileSync(i),[3,4]):[3,2];case 2:return[4,this.fs.readFile(i)];case 3:a=t.sent(),t.label=4;case 4:return[2,o.apply(s,[a,i])]}})},Ir);function Ir(t){this.liquid=t,this.cache=this.liquid.options.cache,this.fs=this.liquid.options.fs,this.parseFile=this.cache?this._parseFileCached:this._parseFile,this.loader=new Lt(this.liquid.options)}var _r={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie);this.key=e.readIdentifier().content,e.skipBlank(),ae("="===e.peek(),function(){return"illegal token "+t.getText()}),e.advance(),this.value=e.remaining()},render:function(e){var r,n;return T(this,function(t){switch(t.label){case 0:return r=e.bottom(),n=this.key,[4,this.liquid._evalValue(this.value,e)];case 1:return r[n]=t.sent(),[2]}})}};function Vr(e){return v(e)?e:u(e)&&0<e.length?[e]:b(e)?Object.keys(e).map(function(t){return[t,e[t]]}):[]}function jr(t){return v(t)?t:[t]}var Br,Cr=(t(zr,Br=o),zr.prototype.next=function(){this.i++},zr.prototype.index0=function(){return this.i},zr.prototype.index=function(){return this.i+1},zr.prototype.first=function(){return 0===this.i},zr.prototype.last=function(){return this.i===this.length-1},zr.prototype.rindex=function(){return this.length-this.i},zr.prototype.rindex0=function(){return this.length-this.i-1},zr.prototype.valueOf=function(){return JSON.stringify(this)},zr);function zr(t){var e=Br.call(this)||this;return e.i=0,e.length=t,e}var Hr=["offset","limit","reversed"],Kr={type:"block",parse:function(t,e){var r,n=this,i=new vr(t.args,this.liquid.options.operatorsTrie),s=i.readIdentifier(),o=i.readIdentifier(),a=i.readValue();ae(s.size()&&"in"===o.content&&a,function(){return"illegal tag: "+t.getText()}),this.variable=s.content,this.collection=a,this.hash=new br(i.remaining()),this.templates=[],this.elseTemplates=[];var u=this.liquid.parser.parseStream(e).on("start",function(){return r=n.templates}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endfor",function(){return u.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});u.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d;return T(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=Vr,[4,Se(this.collection,e)];case 1:return(i=s.apply(void 0,[t.sent()])).length?[3,3]:[4,n.renderTemplates(this.elseTemplates,e,r)];case 2:return t.sent(),[2];case 3:return[4,this.hash.render(e)];case 4:o=t.sent(),a=this.liquid.options.orderedFilterParameters?Object.keys(o).filter(function(t){return Hr.includes(t)}):Hr.filter(function(t){return void 0!==o[t]}),i=a.reduce(function(t,e){return"offset"===e?function(t,e){return t.slice(e)}(t,o.offset):"limit"===e?function(t,e){return t.slice(0,e)}(t,o.limit):function(t){return w(t).reverse()}(t)},i),u={forloop:new Cr(i.length)},e.push(u),t.label=5;case 5:t.trys.push([5,10,11,12]),c=k(i),l=c.next(),t.label=6;case 6:return l.done?[3,9]:(h=l.value,u[this.variable]=h,[4,n.renderTemplates(this.templates,e,r)]);case 7:if(t.sent(),r.break)return r.break=!1,[3,9];r.continue=!1,u.forloop.next(),t.label=8;case 8:return l=c.next(),[3,6];case 9:return[3,12];case 10:return p=t.sent(),f={error:p},[3,12];case 11:try{l&&!l.done&&(d=c.return)&&d.call(c)}finally{if(f)throw f.error}return[7];case 12:return e.pop(),[2]}})}};var Ur={parse:function(t,e){var r=this,n=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=function(t){var e=t.readIdentifier().content;if(e)return e;var r=t.readQuoted();if(r)return Fe(r)}(n),ae(this.variable,function(){return t.args+" not valid identifier"}),this.templates=[];var i=this.liquid.parser.parseStream(e);i.on("tag:endcapture",function(){return i.stop()}).on("template",function(t){return r.templates.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),i.start()},render:function(e){var r;return T(this,function(t){switch(t.label){case 0:return[4,this.liquid.renderer.renderTemplates(this.templates,e)];case 1:return r=t.sent(),e.bottom()[this.variable]=r,[2]}})}};var Qr,Wr,Jr={parse:function(t,e){var n=this;this.cond=new qr(t.args,this.liquid),this.cases=[],this.elseTemplates=[];var i=[],r=this.liquid.parser.parseStream(e).on("tag:when",function(t){i=[];for(var e=new vr(t.args,n.liquid.options.operatorsTrie);!e.end();){var r=e.readValue();n.cases.push({val:r,templates:i}),e.readTo(",")}}).on("tag:else",function(){return i=n.elseTemplates}).on("tag:endcase",function(){return r.stop()}).on("template",function(t){return i.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});r.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:return n=this.liquid.renderer,s=f,[4,this.cond.value(e,e.opts.lenientIf)];case 1:i=s.apply(void 0,[t.sent()]),t.label=2;case 2:t.trys.push([2,7,8,9]),o=k(this.cases),a=o.next(),t.label=3;case 3:return a.done?[3,6]:(u=a.value,Se(u.val,e,e.opts.lenientIf)!==i?[3,5]:[4,n.renderTemplates(u.templates,e,r)]);case 4:return t.sent(),[2];case 5:return a=o.next(),[3,3];case 6:return[3,9];case 7:return c=t.sent(),l={error:c},[3,9];case 8:try{a&&!a.done&&(h=o.return)&&h.call(o)}finally{if(l)throw l.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},Yr={parse:function(t,e){var r=this.liquid.parser.parseStream(e);r.on("token",function(t){"endcomment"===t.name&&r.stop()}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),r.start()}};(Wr=Qr=Qr||{})[Wr.OUTPUT=0]="OUTPUT",Wr[Wr.STORE=1]="STORE";var $r=Qr,Gr={parseFilePath:Xr,renderFilePath:Zr,parse:function(t){var e=t.args,r=new vr(e,this.liquid.options.operatorsTrie);for(this.file=this.parseFilePath(r,this.liquid);!r.end();){r.skipBlank();var n=r.p,i=r.readIdentifier();if(("with"===i.content||"for"===i.content)&&(r.skipBlank(),":"!==r.peek())){var s=r.readValue();if(s){var o=r.p,a=void 0;"as"===r.readIdentifier().content?a=r.readIdentifier():r.p=o,this[i.content]={value:s,alias:a&&a.content},r.skipBlank(),","===r.peek()&&r.advance();continue}}r.p=n;break}this.hash=new br(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f,d,v,g,y,m,w,b;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,[4,this.renderFilePath(this.file,e,i)];case 1:return ae(o=t.sent(),function(){return'illegal filename "'+o+'"'}),a=new Rt({},e.opts,e.sync),[4,s.render(e)];case 2:if(u=t.sent(),this.with&&(c=this.with,h=c.value,p=c.alias,u[p||o]=Se(h,e)),a.push(u),!this.for)return[3,12];l=this.for,h=l.value,p=l.alias,f=Vr(f=Se(h,e)),u.forloop=new Cr(f.length),t.label=3;case 3:t.trys.push([3,9,10,11]),d=k(f),v=d.next(),t.label=4;case 4:return v.done?[3,8]:(g=v.value,u[p]=g,[4,i._parsePartialFile(o,a.sync)]);case 5:return m=t.sent(),[4,i.renderer.renderTemplates(m,a,r)];case 6:t.sent(),u.forloop.next(),t.label=7;case 7:return v=d.next(),[3,4];case 8:return[3,11];case 9:return y=t.sent(),w={error:y},[3,11];case 10:try{v&&!v.done&&(b=d.return)&&b.call(d)}finally{if(w)throw w.error}return[7];case 11:return[3,15];case 12:return[4,i._parsePartialFile(o,a.sync)];case 13:return m=t.sent(),[4,i.renderer.renderTemplates(m,a,r)];case 14:t.sent(),t.label=15;case 15:return[2]}})}};function Xr(t,e){if(e.options.dynamicPartials){var r=t.readValue();if(void 0===r)throw new TypeError('illegal argument "'+t.input+'"');if("none"===r.getText())return null;if($t(r)){var n=e.parse(Fe(r));return 1===n.length&&Wt(n[0].token)?n[0].token.getContent():n}return r}var i=t.readFileName().getText();return"none"===i?null:i}function Zr(t,e,r){return"string"==typeof t?t:Array.isArray(t)?r.renderer.renderTemplates(t,e):Se(t,e)}var tn,en={parseFilePath:Xr,renderFilePath:Zr,parse:function(t){var e=t.args,r=new vr(e,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(r,this.liquid);var n=r.p;"with"===r.readIdentifier().content?(r.skipBlank(),":"!==r.peek()?this.withVar=r.readValue():r.p=n):r.p=n,this.hash=new br(r.remaining())},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.withVar,a=i.renderer,[4,this.renderFilePath(this.file,e,i)];case 1:return ae(u=t.sent(),function(){return'illegal filename "'+u+'"'}),c=e.saveRegister("blocks","blockMode"),e.setRegister("blocks",{}),e.setRegister("blockMode",$r.OUTPUT),[4,s.render(e)];case 2:return l=t.sent(),o&&(l[u]=Se(o,e)),[4,i._parsePartialFile(u,e.sync)];case 3:return h=t.sent(),e.push(l),[4,a.renderTemplates(h,e,r)];case 4:return t.sent(),e.pop(),e.restoreRegister(c),[2]}})}},rn={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;h(r[this.variable])||(r[this.variable]=0),e.write(l(--r[this.variable]))}},nn={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie),r=e.readValue();for(e.skipBlank(),this.candidates=[],r&&(":"===e.peek()?(this.group=r,e.advance()):this.candidates.push(r));!e.end();){var n=e.readValue();n&&this.candidates.push(n),e.readTo(",")}ae(this.candidates.length,function(){return"empty candidates: "+t.getText()})},render:function(t,e){var r="cycle:"+Se(this.group,t)+":"+this.candidates.join(","),n=t.getRegister("cycle"),i=n[r];void 0===i&&(i=n[r]=0);var s=this.candidates[i];i=(i+1)%this.candidates.length,n[r]=i;var o=Se(s,t);e.write(o)}},sn={parse:function(t,e){var r,n=this;this.branches=[],this.elseTemplates=[],this.liquid.parser.parseStream(e).on("start",function(){return n.branches.push({predicate:new qr(t.args,n.liquid),templates:r=[]})}).on("tag:elsif",function(t){return n.branches.push({predicate:new qr(t.args,n.liquid),templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endif",function(){this.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n,i,s,o,a,u,c,l,h;return T(this,function(t){switch(t.label){case 0:n=this.liquid.renderer,t.label=1;case 1:t.trys.push([1,7,8,9]),i=k(this.branches),s=i.next(),t.label=2;case 2:return s.done?[3,6]:(o=s.value,a=o.predicate,u=o.templates,[4,a.value(e,e.opts.lenientIf)]);case 3:return M(t.sent(),e)?[4,n.renderTemplates(u,e,r)]:[3,5];case 4:return t.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return c=t.sent(),l={error:c},[3,9];case 8:try{s&&!s.done&&(h=i.return)&&h.call(i)}finally{if(l)throw l.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},on={parse:function(t){var e=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=e.readIdentifier().content},render:function(t,e){var r=t.environments;h(r[this.variable])||(r[this.variable]=0);var n=r[this.variable];r[this.variable]++,e.write(l(n))}},an={parseFilePath:Xr,renderFilePath:Zr,parse:function(t,e){var r=new vr(t.args,this.liquid.options.operatorsTrie);this.file=this.parseFilePath(r,this.liquid),this.hash=new br(r.remaining()),this.tpls=this.liquid.parser.parseTokens(e)},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f;return T(this,function(t){switch(t.label){case 0:return i=(n=this).liquid,s=n.hash,o=n.file,a=i.renderer,null!==o?[3,2]:(e.setRegister("blockMode",$r.OUTPUT),[4,a.renderTemplates(this.tpls,e,r)]);case 1:return t.sent(),[2];case 2:return[4,this.renderFilePath(this.file,e,i)];case 3:return ae(u=t.sent(),function(){return'illegal filename "'+u+'"'}),[4,i._parseLayoutFile(u,e.sync)];case 4:return c=t.sent(),e.setRegister("blockMode",$r.STORE),[4,a.renderTemplates(this.tpls,e)];case 5:return l=t.sent(),void 0===(h=e.getRegister("blocks"))[""]&&(h[""]=function(t,e){return e.write(l)}),e.setRegister("blockMode",$r.OUTPUT),f=(p=e).push,[4,s.render(e)];case 6:return f.apply(p,[t.sent()]),[4,a.renderTemplates(c,e,r)];case 7:return t.sent(),e.pop(),[2]}})}},un=(t(cn,tn=o),cn.prototype.super=function(){return this.superBlockRender()},cn);function cn(t){void 0===t&&(t=function(){return""});var e=tn.call(this)||this;return e.superBlockRender=t,e}var ln,hn={parse:function(t,e){var r=this,n=/\w+/.exec(t.args);this.block=n?n[0]:"",this.tpls=[],this.liquid.parser.parseStream(e).on("tag:endblock",function(){this.stop()}).on("template",function(t){return r.tpls.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n;return T(this,function(t){switch(t.label){case 0:return n=this.getBlockRender(e),e.getRegister("blockMode")!==$r.STORE?[3,1]:(e.getRegister("blocks")[this.block]=n,[3,3]);case 1:return[4,n(new un,r)];case 2:t.sent(),t.label=3;case 3:return[2]}})},getBlockRender:function(n){function r(e,r){return T(this,function(t){switch(t.label){case 0:return n.push({block:e}),[4,i.renderer.renderTemplates(s,n,r)];case 1:return t.sent(),n.pop(),[2]}})}var i=this.liquid,s=this.tpls,o=n.getRegister("blocks")[this.block];return o?function(t,e){return o(new un(function(){return r(t,e)}),e)}:r}},pn={parse:function(t,e){var r=this;this.tokens=[];var n=this.liquid.parser.parseStream(e);n.on("token",function(t){"endraw"===t.name?n.stop():r.tokens.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}),n.start()},render:function(){return this.tokens.map(function(t){return t.getText()}).join("")}},fn=(t(dn,ln=Cr),dn.prototype.row=function(){return Math.floor(this.i/this.cols)+1},dn.prototype.col0=function(){return this.i%this.cols},dn.prototype.col=function(){return this.col0()+1},dn.prototype.col_first=function(){return 0===this.col0()},dn.prototype.col_last=function(){return this.col()===this.cols},dn);function dn(t,e){var r=ln.call(this,t)||this;return r.length=t,r.cols=e,r}var vn={assign:_r,for:Kr,capture:Ur,case:Jr,comment:Yr,include:en,render:Gr,decrement:rn,increment:on,cycle:nn,if:sn,layout:an,block:hn,raw:pn,tablerow:{parse:function(t,e){var r=this,n=new vr(t.args,this.liquid.options.operatorsTrie);this.variable=n.readIdentifier(),n.skipBlank();var i,s=n.readIdentifier();ae(s&&"in"===s.content,function(){return"illegal tag: "+t.getText()}),this.collection=n.readValue(),this.hash=new br(n.remaining()),this.templates=[];var o=this.liquid.parser.parseStream(e).on("start",function(){return i=r.templates}).on("tag:endtablerow",function(){return o.stop()}).on("template",function(t){return i.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")});o.start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p;return T(this,function(t){switch(t.label){case 0:return i=Vr,[4,Se(this.collection,e)];case 1:return n=i.apply(void 0,[t.sent()]),[4,this.hash.render(e)];case 2:s=t.sent(),o=s.offset||0,a=void 0===s.limit?n.length:s.limit,n=n.slice(o,o+a),u=s.cols||n.length,c=this.liquid.renderer,l=new fn(n.length,u),h={tablerowloop:l},e.push(h),p=0,t.label=3;case 3:return p<n.length?(h[this.variable.content]=n[p],0===l.col0()&&(1!==l.row()&&r.write("</tr>"),r.write('<tr class="row'+l.row()+'">')),r.write('<td class="col'+l.col()+'">'),[4,c.renderTemplates(this.templates,e,r)]):[3,6];case 4:t.sent(),r.write("</td>"),t.label=5;case 5:return p++,l.next(),[3,3];case 6:return n.length&&r.write("</tr>"),e.pop(),[2]}})}},unless:{parse:function(t,e){var r,n=this;this.branches=[],this.elseTemplates=[],this.liquid.parser.parseStream(e).on("start",function(){return n.branches.push({predicate:new qr(t.args,n.liquid),test:A,templates:r=[]})}).on("tag:elsif",function(t){return n.branches.push({predicate:new qr(t.args,n.liquid),test:M,templates:r=[]})}).on("tag:else",function(){return r=n.elseTemplates}).on("tag:endunless",function(){this.stop()}).on("template",function(t){return r.push(t)}).on("end",function(){throw new Error("tag "+t.getText()+" not closed")}).start()},render:function(e,r){var n,i,s,o,a,u,c,l,h,p,f;return T(this,function(t){switch(t.label){case 0:n=this.liquid.renderer,t.label=1;case 1:t.trys.push([1,7,8,9]),i=k(this.branches),s=i.next(),t.label=2;case 2:return s.done?[3,6]:(o=s.value,a=o.predicate,u=o.test,c=o.templates,[4,a.value(e,e.opts.lenientIf)]);case 3:return l=t.sent(),u(l,e)?[4,n.renderTemplates(c,e,r)]:[3,5];case 4:return t.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return h=t.sent(),p={error:h},[3,9];case 8:try{s&&!s.done&&(f=i.return)&&f.call(i)}finally{if(p)throw p.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,e,r)];case 10:return t.sent(),[2]}})}},break:{render:function(t,e){e.break=!0}},continue:{render:function(t,e){e.continue=!0}}},gn={"&":"&","<":"<",">":">",'"':""","'":"'"},yn={"&":"&","<":"<",">":">",""":'"',"'":"'"};function mn(t){return l(t).replace(/&|<|>|"|'/g,function(t){return gn[t]})}var wn=Math.abs,bn=Math.max,Tn=Math.min,kn=Math.ceil,xn=Math.floor;var qn=Object.freeze({escape:mn,escapeOnce:function(t){return mn(function(t){return String(t).replace(/&(amp|lt|gt|#34|#39);/g,function(t){return yn[t]})}(t))},newlineToBr:function(t){return t.replace(/\n/g,"<br />\n")},stripHtml:function(t){return t.replace(/<script.*?<\/script>|<!--.*?-->|<style.*?<\/style>|<.*?>/g,"")},abs:wn,atLeast:bn,atMost:Tn,ceil:kn,dividedBy:function(t,e){return t/e},floor:xn,minus:function(t,e){return t-e},modulo:function(t,e){return t%e},times:function(t,e){return t*e},round:function(t,e){void 0===e&&(e=0);var r=Math.pow(10,e);return Math.round(t*r)/r},plus:function(t,e){return Number(t)+Number(e)},sortNatural:function(t,r){return t&&t.sort?void 0!==r?w(t).sort(function(t,e){return R(t[r],e[r])}):w(t).sort(R):[]},urlDecode:function(t){return t.split("+").map(decodeURIComponent).join(" ")},urlEncode:function(t){return t.split(" ").map(encodeURIComponent).join("+")},join:function(t,e){return t.join(void 0===e?" ":e)},last:function(t){return v(t)?y(t):""},first:function(t){return v(t)?t[0]:""},reverse:function(t){return w(t).reverse()},sort:function(t,e){function r(t){return e?n.context.getFromScope(t,e.split(".")):t}var n=this;return jr(t).sort(function(t,e){return(t=r(t))<(e=r(e))?-1:e<t?1:0})},size:function(t){return t&&t.length||0},map:function(t,e){var r=this;return jr(t).map(function(t){return r.context.getFromScope(t,e.split("."))})},compact:function(t){return jr(t).filter(function(t){return!d(t)})},concat:function(t,e){return jr(t).concat(e)},slice:function(t,e,r){return void 0===r&&(r=1),e=e<0?t.length+e:e,t.slice(e,e+r)},where:function(t,r,n){var i=this;return jr(t).filter(function(t){var e=i.context.getFromScope(t,String(r).split("."));return void 0===n?M(e,i.context):e===n})},uniq:function(t){var e={};return(t||[]).filter(function(t){return!e.hasOwnProperty(String(t))&&(e[String(t)]=!0)})},date:function(t,e){var r;return function(t){return t instanceof Date&&!isNaN(t.getTime())}(r="now"===t||"today"===t?new Date:h(t)?new Date(1e3*t):u(t)?/^\d+$/.test(t)?new Date(1e3*+t):this.context.opts.preserveTimezones?function(t){var e=t.match(H);if(e&&"Z"===e[1])return new Date(+new Date(t)+6e4*z);if(e&&e[2]&&e[3]&&e[4]){var r=m(e,5),n=r[2],i=r[3],s=r[4],o=("+"===n?1:-1)*(60*parseInt(i,10)+parseInt(s,10));return new Date(+new Date(t)+6e4*(z+o))}return new Date(t)}(t):new Date(t):t)?function(t,e){for(var r,n="",i=e;r=K.exec(i);)n+=i.slice(0,r.index),i=i.slice(r.index+r[0].length),n+=rt(t,r);return n+i}(r,e):t},Default:function(t,e){return v(t)||u(t)?t.length?t:e:A(f(t),this.context)?e:t},json:function(t){return JSON.stringify(t)},append:function(t,e){return ae(2===arguments.length,function(){return"append expect 2 arguments"}),l(t)+l(e)},prepend:function(t,e){return ae(2===arguments.length,function(){return"prepend expect 2 arguments"}),l(e)+l(t)},lstrip:function(t){return l(t).replace(/^\s+/,"")},downcase:function(t){return l(t).toLowerCase()},upcase:function(t){return l(t).toUpperCase()},remove:function(t,e){return l(t).split(String(e)).join("")},removeFirst:function(t,e){return l(t).replace(String(e),"")},rstrip:function(t){return l(t).replace(/\s+$/,"")},split:function(t,e){return l(t).split(String(e))},strip:function(t){return l(t).trim()},stripNewlines:function(t){return l(t).replace(/\n/g,"")},capitalize:function(t){return(t=l(t)).charAt(0).toUpperCase()+t.slice(1).toLowerCase()},replace:function(t,e,r){return l(t).split(String(e)).join(r)},replaceFirst:function(t,e,r){return l(t).replace(String(e),r)},truncate:function(t,e,r){return void 0===e&&(e=50),void 0===r&&(r="..."),(t=l(t)).length<=e?t:t.substr(0,e-r.length)+r},truncatewords:function(t,e,r){void 0===e&&(e=15),void 0===r&&(r="...");var n=t.split(/\s+/),i=n.slice(0,e).join(" ");return n.length>=e&&(i+=r),i}}),On=(Sn.prototype.get=function(t){var e=this.impls[t];return ae(e,function(){return'tag "'+t+'" not found'}),e},Sn.prototype.set=function(t,e){this.impls[t]=e},Sn);function Sn(){this.impls={}}var Fn=(Rn.prototype.get=function(t){var e=this.impls[t];return ae(e||!this.strictFilters,function(){return"undefined filter: "+t}),e},Rn.prototype.set=function(t,e){this.impls[t]=e},Rn.prototype.create=function(t,e){return new kr(t,this.get(t),e,this.liquid)},Rn);function Rn(t,e){this.strictFilters=t,this.liquid=e,this.impls={}}var En=(Ln.prototype.parse=function(t,e){return this.parser.parse(t,e)},Ln.prototype._render=function(t,e,r){var n=new Rt(e,this.options,r);return this.renderer.renderTemplates(t,n)},Ln.prototype.render=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this._render(e,r,!1))]})})},Ln.prototype.renderSync=function(t,e){return jt(this._render(t,e,!0))},Ln.prototype.renderToNodeStream=function(t,e){var r=new Rt(e,this.options);return this.renderer.renderTemplatesToNodeStream(t,r)},Ln.prototype._parseAndRender=function(t,e,r){var n=this.parse(t);return this._render(n,e,r)},Ln.prototype.parseAndRender=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this._parseAndRender(e,r,!1))]})})},Ln.prototype.parseAndRenderSync=function(t,e){return jt(this._parseAndRender(t,e,!0))},Ln.prototype._parsePartialFile=function(t,e){return this.parser.parseFile(t,e,St.Partials)},Ln.prototype._parseLayoutFile=function(t,e){return this.parser.parseFile(t,e,St.Layouts)},Ln.prototype.parseFile=function(e){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this.parser.parseFile(e,!1))]})})},Ln.prototype.parseFileSync=function(t){return jt(this.parser.parseFile(t,!0))},Ln.prototype.renderFile=function(r,n){return s(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return[4,this.parseFile(r)];case 1:return e=t.sent(),[2,this.render(e,n)]}})})},Ln.prototype.renderFileSync=function(t,e){var r=this.parseFileSync(t);return this.renderSync(r,e)},Ln.prototype.renderFileToNodeStream=function(r,n){return s(this,void 0,void 0,function(){var e;return T(this,function(t){switch(t.label){case 0:return[4,this.parseFile(r)];case 1:return e=t.sent(),[2,this.renderToNodeStream(e,n)]}})})},Ln.prototype._evalValue=function(t,e){return new qr(t,this).value(e,!1)},Ln.prototype.evalValue=function(e,r){return s(this,void 0,void 0,function(){return T(this,function(t){return[2,Vt(this._evalValue(e,r))]})})},Ln.prototype.evalValueSync=function(t,e){return jt(this._evalValue(t,e))},Ln.prototype.registerFilter=function(t,e){this.filters.set(t,e)},Ln.prototype.registerTag=function(t,e){this.tags.set(t,e)},Ln.prototype.plugin=function(t){return t.call(this,Ln)},Ln.prototype.express=function(){var i=this,s=!0;return function(t,e,r){var n;s&&(s=!1,(n=i.options.root).unshift.apply(n,w(it(this.root)))),i.renderFile(t,e).then(function(t){return r(null,t)},r)}},Ln);function Ln(t){var r=this;void 0===t&&(t={}),this.options=function(t){var e=i({},nt,t);return e.partials===nt.partials&&(e.partials=e.root),e.layouts===nt.layouts&&(e.layouts=e.root),e}(function(t){if((t=t||{}).hasOwnProperty("root")&&(t.root=it(t.root)),t.hasOwnProperty("partials")&&(t.partials=it(t.partials)),t.hasOwnProperty("layouts")&&(t.layouts=it(t.layouts)),t.hasOwnProperty("cache")){var e=void 0;e="number"==typeof t.cache?0<t.cache?new L(t.cache):void 0:"object"==typeof t.cache?t.cache:t.cache?new L(1024):void 0,t.cache=e}return t.hasOwnProperty("operators")&&(t.operatorsTrie=C(t.operators)),t}(t)),this.parser=new Ar(this),this.renderer=new Ht,this.filters=new Fn(this.options.strictFilters,this),this.tags=new On,g(vn,function(t,e){return r.registerTag(F(e),t)}),g(qn,function(t,e){return r.registerFilter(F(e),t)})}p.AssertionError=qt,p.Context=Rt,p.Drop=o,p.Expression=qe,p.Hash=br,p.InternalUndefinedVariableError=Tt,p.Liquid=En,p.LiquidError=ot,p.ParseError=pt,p.ParseStream=ie,p.RenderError=vt,p.TagToken=mr,p.Token=Re,p.TokenizationError=ct,p.Tokenizer=vr,p.TypeGuards=ne,p.UndefinedVariableError=mt,p.Value=qr,p.assert=ae,p.createTrie=C,p.defaultOperators=I,p.evalQuotedToken=Fe,p.evalToken=Se,p.isFalsy=A,p.isTruthy=M,p.toPromise=Vt,p.toThenable=_t,p.toValue=f,Object.defineProperty(p,"__esModule",{value:!0})}); | ||
//# sourceMappingURL=liquid.browser.min.js.map |
{ | ||
"name": "liquidjs", | ||
"version": "9.27.0", | ||
"version": "9.27.1", | ||
"description": "A simple, expressive and safe Shopify / Github Pages compatible template engine in pure JavaScript.", | ||
@@ -5,0 +5,0 @@ "main": "dist/liquid.node.cjs.js", |
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 too big to display
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 too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1048252