!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e=e||self).liquidjs={})}(this,function(l){"use strict";var q=function(e,t){return(q=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}))(e,t)};function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}q(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var T=function(){return(T=Object.assign||function(e){for(var t,r=1,n=arguments.length;ro[0]&&t[1]=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ee(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),a=[];try{for(;(void 0===t||0> ":" ",r=$(String(e),String(a).length),t="".concat(t).concat(r,"| "),r=e===n?"\n"+$("^",i+t.length):"";return t+s[e-1]+r}).join("\n")),enumerable:!1}),this.message=(e=this.message,(t=this.token).file&&(e+=", file:".concat(t.file)),t=ee(t.getPosition(),2),r=t[0],t=t[1],e+=", line:".concat(r,", col:").concat(t)),this.stack=this.message+"\n"+this.context+"\n"+this.stack,this.originalError&&(this.stack+="\nFrom "+this.originalError.stack)},ue.is=function(e){return"LiquidError"===(null==e?void 0:e[ae])},ue);function ue(e,t){var r=se.call(this,"string"==typeof e?e:e.message)||this;return r.context="","string"!=typeof e&&Object.defineProperty(r,"originalError",{value:e,enumerable:!1}),Object.defineProperty(r,"token",{value:t,enumerable:!1}),Object.defineProperty(r,ae,{value:"LiquidError",enumerable:!1}),r}s(he,ce=oe);var ce,le=he;function he(e,t){e=ce.call(this,e,t)||this;return e.name="TokenizationError",ce.prototype.update.call(e),e}s(de,pe=oe);var pe,fe=de;function de(e,t){t=pe.call(this,e,t)||this;return t.name="ParseError",t.message=e.message,pe.prototype.update.call(t),t}s(ge,ye=oe),ge.is=function(e){return"RenderError"===e.name};var ye,ve=ge;function ge(e,t){t=ye.call(this,e,t.token)||this;return t.name="RenderError",t.message=e.message,ye.prototype.update.call(t),t}s(we,me=oe),we.is=function(e){return"LiquidErrors"===e.name};var me,be=we;function we(e){var t=me.call(this,e[0],e[0].token)||this,r=(t.errors=e,t.name="LiquidErrors",1":2,"<":2,">=":2,"<=":2,contains:2,not:1,and:0,or:0},Ct={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0},It=(s(Bt,Vt=e),Bt.prototype.getPrecedence=function(){var e=this.getText();return e in Pt?Pt[e]:1},Bt);function Bt(e,t,r,n){var i=Vt.call(this,l.TokenKind.Operator,e,t,r,n)||this;return i.input=e,i.begin=t,i.end=r,i.file=n,i.operator=i.getText(),i}s(Kt,Ht=e);var Ht,Ut=Kt;function Kt(e,t,r,n,i,s){r=Ht.call(this,l.TokenKind.PropertyAccess,r,n,i,s)||this;return r.variable=e,r.props=t,r}s($t,Wt=e);var Wt,Yt=$t;function $t(e,t,r,n,i,s){r=Wt.call(this,l.TokenKind.Filter,r,n,i,s)||this;return r.name=e,r.args=t,r}s(Qt,Zt=e);var Zt,Jt=Qt;function Qt(e,t,r,n,i,s){var a=Zt.call(this,l.TokenKind.Hash,e,t,r,s)||this;return a.input=e,a.begin=t,a.end=r,a.name=n,a.value=i,a.file=s,a}var Gt=/[\da-fA-F]/,Xt=/[0-7]/,er={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function tr(e){e=e.charCodeAt(0);return 97<=e?e-87:65<=e?e-55:e-48}s(ir,rr=e);var rr,nr=ir;function ir(e,t,r,n){var i=rr.call(this,l.TokenKind.Quoted,e,t,r,n)||this;return i.input=e,i.begin=t,i.end=r,i.file=n,i.content=function(e){for(var t="",r=1;rs.getPrecedence()?[4,r.pop()]:[3,5];case 4:return e.sent(),[3,3];case 5:return r.push(s),[3,8];case 6:return[4,s];case 7:e.sent(),e.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return a=e.sent(),a={error:a},[3,12];case 11:try{i&&!i.done&&(o=n.return)&&o.call(n)}finally{if(a)throw a.error}return[7];case 12:return r.length?[4,r.pop()]:[3,14];case 13:return e.sent(),[3,12];case 14:return[2]}})}(e)),!1)}function S(t,r,n){return void 0===n&&(n=!1),G(this,function(e){switch(e.label){case 0:return t?"content"in t?[2,t.content]:zn(t)?[4,function(t,r,n){var i,s,a,o,u,c,l,h,p;return G(this,function(e){switch(e.label){case 0:i=[],e.label=1;case 1:e.trys.push([1,6,7,8]),s=X(t.props),a=s.next(),e.label=2;case 2:return a.done?[3,5]:(c=a.value,u=(o=i).push,[4,S(c,r,!1)]);case 3:u.apply(o,[e.sent()]),e.label=4;case 4:return a=s.next(),[3,2];case 5:return[3,8];case 6:return c=e.sent(),h={error:c},[3,8];case 7:try{a&&!a.done&&(p=s.return)&&p.call(s)}finally{if(h)throw h.error}return[7];case 8:return(e.trys.push([8,14,,15]),t.variable)?[4,S(t.variable,r,n)]:[3,11];case 9:return l=e.sent(),[4,r._getFromScope(l,i)];case 10:return[2,e.sent()];case 11:return[4,r._get(i)];case 12:return[2,e.sent()];case 13:return[3,15];case 14:if(l=e.sent(),n&&"InternalUndefinedVariableError"===l.name)return[2,null];throw new Te(l,t);case 15:return[2]}})}(t,r,n)]:[3,2]:[2];case 1:return[2,e.sent()];case 2:return jn(t)?[4,function(t,r){var n,i;return G(this,function(e){switch(e.label){case 0:return[4,S(t.lhs,r)];case 1:return n=e.sent(),[4,S(t.rhs,r)];case 2:return i=e.sent(),r.memoryLimit.use(i-n+1),[2,Y(+n,+i+1)]}})}(t,r)]:[3,4];case 3:return[2,e.sent()];case 4:return[2]}})}function wr(e){return e.content}function kr(e,t){return!Tr(e,t)}function Tr(e,t){return e=g(e),t.opts.jsTruthy?!e:!1===e||null==e}Ce={"==":xr,"!=":function(e,t){return!xr(e,t)},">":function(e,t){return p(e)?e.gt(t):p(t)?t.lt(e):g(e)>g(t)},"<":function(e,t){return p(e)?e.lt(t):p(t)?t.gt(e):g(e)=":function(e,t){return p(e)?e.geq(t):p(t)?t.leq(e):g(e)>=g(t)},"<=":function(e,t){return p(e)?e.leq(t):p(t)?t.geq(e):g(e)<=g(t)},contains:function(e,t){return a(e=g(e))?e.some(function(e){return xr(e,t)}):!!u(null==e?void 0:e.indexOf)&&-1this.limit&&this.remove(this.tail.prev.key)},Fr);function Fr(e,t){void 0===t&&(t=0),this.limit=e,this.size=t,this.cache={},this.head=new Sr("HEAD",null,null,null),this.tail=new Sr("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}function Or(e,t){var r=document.createElement("base"),e=(r.href=e,document.getElementsByTagName("head")[0]),n=(e.insertBefore(r,e.firstChild),document.createElement("a")),t=(n.href=t,n.href);return e.removeChild(r),t}r=Object.freeze({__proto__:null,resolve:function(e,t,i){return e.length&&"/"!==K(e)&&(e+="/"),Or(e,t).replace(/^(\w+:\/\/[^/]+)(\/[^?]+)/,function(e,t,r){var n=r.split("/").pop();return/\.\w+$/.test(n)?e:t+r+i})},readFile:function(n){return o(this,void 0,void 0,function(){return G(this,function(e){return[2,new Promise(function(e,t){var r=new XMLHttpRequest;r.onload=function(){200<=r.status&&r.status<300?e(r.responseText):t(new Error(r.statusText))},r.onerror=function(){t(new Error("An error occurred whilst receiving the response."))},r.open("GET",n),r.send()})]})})},readFileSync:function(e){var t=new XMLHttpRequest;if(t.open("GET",e,!1),t.send(),t.status<200||300<=t.status)throw new Error(t.statusText);return t.responseText},exists:function(e){return o(this,void 0,void 0,function(){return G(this,function(e){return[2,!0]})})},existsSync:function(e){return!0},dirname:function(e){return Or(e,".")},sep:"/"});function _r(e,t){return void 0===t&&(t=0),JSON.stringify(e,null,t)}var zr={default:function(e,t){for(var r=[],n=2;n":">",'"':""","'":"'"},jr={"&":"&","<":"<",">":">",""":'"',"'":"'"};function qr(e){return e=y(e),this.context.memoryLimit.use(e.length),e.replace(/&|<|>|"|'/g,function(e){return Rr[e]})}var Er=Object.freeze({__proto__:null,escape:qr,xml_escape:function(e){return qr.call(this,e)},escape_once:function(e){return qr.call(this,function(e){return e=y(e),this.context.memoryLimit.use(e.length),e.replace(/&(amp|lt|gt|#34|#39);/g,function(e){return jr[e]})}.call(this,e))},newline_to_br:function(e){return e=y(e),this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"
\n")},strip_html:function(e){return e=y(e),this.context.memoryLimit.use(e.length),e.replace(/||<.*?>|/g,"")}}),Ar=(Mr.prototype.exists=function(t){return o(this,void 0,void 0,function(){return G(this,function(e){return[2,this.existsSync(t)]})})},Mr.prototype.existsSync=function(e){return!i(this.mapping[e])},Mr.prototype.readFile=function(t){return o(this,void 0,void 0,function(){return G(this,function(e){return[2,this.readFileSync(t)]})})},Mr.prototype.readFileSync=function(e){var t=this.mapping[e];if(i(t))throw new Error("ENOENT: ".concat(e));return t},Mr.prototype.dirname=function(e){e=e.split(this.sep);return e.pop(),e.join(this.sep)},Mr.prototype.resolve=function(e,t,r){var n,i;if(t+=r,"."===e)return t;var s=e.split(/\/+/);try{for(var a=X(t.split(this.sep)),o=a.next();!o.done;o=a.next()){var u=o.value;"."!==u&&""!==u&&(".."===u?(1t?e.slice(0,t-3)+"...":e));var t},k.prototype.readWord=function(){return this.readIdentifier()},k.prototype.readIdentifier=function(){this.skipBlank();for(var e=this.p;!this.end()&&Ee(this.peek());)++this.p;return new Et(this.input,e,this.p,this.file)},k.prototype.readNonEmptyIdentifier=function(){var e=this.readIdentifier();return e.size()?e:void 0},k.prototype.readTagName=function(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()},k.prototype.readHashes=function(e){for(var t=[];;){var r=this.readHash(e);if(!r)return t;t.push(r)}},k.prototype.readHash=function(e){this.skipBlank(),","===this.peek()&&++this.p;var t,r=this.p,n=this.readNonEmptyIdentifier();if(n)return this.skipBlank(),e=te(e)?e:e?"=":":",this.peek()===e&&(++this.p,t=this.readValue()),new Jt(this.input,r,this.p,n,t,this.file)},k.prototype.remaining=function(){return this.input.slice(this.p,this.N)},k.prototype.advance=function(e){this.p+=e=void 0===e?1:e},k.prototype.end=function(){return this.p>=this.N},k.prototype.read=function(){return this.input[this.p++]},k.prototype.readTo=function(e){for(;this.p=this.N?0:h[this.input.charCodeAt(this.p+e)]},k.prototype.peek=function(e){return this.p+(e=void 0===e?0:e)>=this.N?"":this.input[this.p+e]},k.prototype.skipBlank=function(){for(;this.peekType()&je;)++this.p};var w=k;function k(e,t,r,n){void 0===t&&(t=Dr.operators),this.input=e,this.file=r,this.rawBeginAt=-1,this.p=n?n[0]:0,this.N=n?n[1]:e.length,this.opTrie=Xe(t),this.literalTrie=Xe(Ge)}Ir.prototype.on=function(e,t){return this.handlers[e]=t,this},Ir.prototype.trigger=function(e,t){e=this.handlers[e];return!!e&&(e.call(this,t),!0)},Ir.prototype.start=function(){var e,t;for(this.trigger("start");!this.stopRequested&&(e=this.tokens.shift());)this.trigger("token",e)||Fn(e)&&this.trigger("tag:".concat(e.name),e)||(t=this.parseToken(e,this.tokens),this.trigger("template",t));return this.stopRequested||this.trigger("end"),this},Ir.prototype.stop=function(){return this.stopRequested=!0,this};var Cr=Ir;function Ir(e,t){this.handlers={},this.stopRequested=!1,this.tokens=e,this.parseToken=t}function Br(e){this.token=e}s(Ur,Hr=Br);var Hr,L=Ur;function Ur(e,t,r){var n=Hr.call(this,e)||this;return n.name=e.name,n.liquid=r,n.tokenizer=e.tokenizer,n}Wr.prototype.render=function(t){var r,n,i,s,a,o,u,c,l;return G(this,function(e){switch(e.label){case 0:r={},e.label=1;case 1:e.trys.push([1,8,9,10]),n=X(Object.keys(this.hash)),i=n.next(),e.label=2;case 2:return i.done?[3,7]:(s=i.value,a=r,o=s,void 0!==this.hash[s]?[3,3]:(u=!0,[3,5]));case 3:return[4,S(this.hash[s],t)];case 4:u=e.sent(),e.label=5;case 5:a[o]=u,e.label=6;case 6:return i=n.next(),[3,2];case 7:return[3,10];case 8:return c=e.sent(),c={error:c},[3,10];case 9:try{i&&!i.done&&(l=n.return)&&l.call(n)}finally{if(c)throw c.error}return[7];case 10:return[2,r]}})};var Kr=Wr;function Wr(e,t){this.hash={};var r,n,e=e instanceof w?e:new w(e,{});try{for(var i=X(e.readHashes(t)),s=i.next();!s.done;s=i.next()){var a=s.value;this.hash[a.name.content]=a.value}}catch(e){r={error:e}}finally{try{s&&!s.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}function Yr(e){return a(e)}Zr.prototype.render=function(t,r){var n,i,s,a,o,u,c,l,h,p,f;return G(this,function(e){switch(e.label){case 0:n=[],e.label=1;case 1:e.trys.push([1,8,9,10]),i=X(this.args),s=i.next(),e.label=2;case 2:return s.done?[3,7]:Yr(a=s.value)?(u=(o=n).push,c=[a[0]],[4,S(a[1],r)]):[3,4];case 3:return u.apply(o,[c.concat([e.sent()])]),[3,6];case 4:return h=(l=n).push,[4,S(a,r)];case 5:h.apply(l,[e.sent()]),e.label=6;case 6:return s=i.next(),[3,2];case 7:return[3,10];case 8:return p=e.sent(),p={error:p},[3,10];case 9:try{s&&!s.done&&(f=i.return)&&f.call(i)}finally{if(p)throw p.error}return[7];case 10:return[4,this.handler.apply({context:r,token:this.token,liquid:this.liquid},d([t],ee(n),!1))];case 11:return[2,e.sent()]}})};var $r=Zr;function Zr(e,t,r){this.token=e,this.name=e.name,this.handler=u(t)?t:u(null==t?void 0:t.handler)?t.handler:J,this.raw=!u(t)&&!(null==t||!t.raw),this.args=e.args,this.liquid=r}Jr.prototype.value=function(t,r){var n,i,s,a,o;return G(this,function(e){switch(e.label){case 0:return r=r||t.opts.lenientIf&&0=t&&(n+=r),n},normalize_whitespace:function(e){return e=y(e),this.context.memoryLimit.use(e.length),e.replace(/\s+/g," ")},number_of_words:function(e,t){var r=y(e);if(this.context.memoryLimit.use(r.length),!(e=r.trim()))return 0;switch(t){case"cjk":return(e.match(ei)||[]).length+(e.match(ti)||[]).length;case"auto":return ei.test(e)?e.match(ei).length+(e.match(ti)||[]).length:e.split(/\s+/).length;default:return e.split(/\s+/).length}},array_to_sentence_string:function(e,t){switch(void 0===t&&(t="and"),this.context.memoryLimit.use(e.length),e.length){case 0:return"";case 1:return e[0];case 2:return"".concat(e[0]," ").concat(t," ").concat(e[1]);default:return"".concat(e.slice(0,-1).join(", "),", ").concat(t," ").concat(e[e.length-1])}}}),ni=T(T(T(T(T(T(T({},Er),An),Dn),In),Bn),Hn),zr),Mn=(s(ii,ri=L),ii.prototype.render=function(t){var r,n;return G(this,function(e){switch(e.label){case 0:return r=t.bottom(),n=this.key,[4,this.value.value(t,this.liquid.options.lenientIf)];case 1:return r[n]=e.sent(),[2]}})},ii.prototype.arguments=function(){return G(this,function(e){switch(e.label){case 0:return[4,this.value];case 1:return e.sent(),[2]}})},ii.prototype.localScope=function(){return G(this,function(e){switch(e.label){case 0:return[4,this.identifier];case 1:return e.sent(),[2]}})},ii);function ii(e,t,r){e=ri.call(this,e,t,r)||this;return e.identifier=e.tokenizer.readIdentifier(),e.key=e.identifier.content,e.tokenizer.assert(e.key,"expected variable name"),e.tokenizer.skipBlank(),e.tokenizer.assert("="===e.tokenizer.peek(),'expected "="'),e.tokenizer.advance(),e.value=new F(e.tokenizer.readFilteredValue(),e.liquid),e}var si,ai=["offset","limit","reversed"],Nn=(s(oi,si=L),oi.prototype.render=function(t,r){var n,i,s,a,o,u,c,l,h,p,f;return G(this,function(e){switch(e.label){case 0:return n=this.liquid.renderer,s=C,[4,S(this.collection,t)];case 1:return(i=s.apply(void 0,[e.sent()])).length?[3,3]:[4,n.renderTemplates(this.elseTemplates,t,r)];case 2:return e.sent(),[2];case 3:return a="continue-"+this.variable+"-"+this.collection.getText(),t.push({continue:t.getRegister(a)}),[4,this.hash.render(t)];case 4:o=e.sent(),t.pop(),u=this.liquid.options.orderedFilterParameters?Object.keys(o).filter(function(e){return ai.includes(e)}):ai.filter(function(e){return void 0!==o[e]}),i=u.reduce(function(e,t){var r;return"offset"===t?(r=o.offset,e.slice(r)):"limit"===t?(r=o.limit,e.slice(0,r)):d([],ee(e),!1).reverse()},i),t.setRegister(a,(o.offset||0)+i.length),u={forloop:new He(i.length,this.collection.getText(),this.variable)},t.push(u),e.label=5;case 5:e.trys.push([5,10,11,12]),c=X(i),l=c.next(),e.label=6;case 6:return l.done?[3,9]:(h=l.value,u[this.variable]=h,t.continueCalled=t.breakCalled=!1,[4,n.renderTemplates(this.templates,t,r)]);case 7:if(e.sent(),t.breakCalled)return[3,9];u.forloop.next(),e.label=8;case 8:return l=c.next(),[3,6];case 9:return[3,12];case 10:return h=e.sent(),p={error:h},[3,12];case 11:try{l&&!l.done&&(f=c.return)&&f.call(c)}finally{if(p)throw p.error}return[7];case 12:return t.continueCalled=t.breakCalled=!1,t.pop(),[2]}})},oi.prototype.children=function(){var t;return G(this,function(e){return t=this.templates.slice(),this.elseTemplates&&t.push.apply(t,d([],ee(this.elseTemplates),!1)),[2,t]})},oi.prototype.arguments=function(){var t,r,n,i,s;return G(this,function(e){switch(e.label){case 0:return[4,this.collection];case 1:e.sent(),e.label=2;case 2:e.trys.push([2,7,8,9]),t=X(Object.values(this.hash.hash)),r=t.next(),e.label=3;case 3:return r.done?[3,6]:_(n=r.value)?[4,n]:[3,5];case 4:e.sent(),e.label=5;case 5:return r=t.next(),[3,3];case 6:return[3,9];case 7:return n=e.sent(),i={error:n},[3,9];case 8:try{r&&!r.done&&(s=t.return)&&s.call(t)}finally{if(i)throw i.error}return[7];case 9:return[2]}})},oi.prototype.blockScope=function(){return[this.variable,"forloop"]},oi);function oi(e,t,r,n){var i,s=si.call(this,e,t,r)||this,a=s.tokenizer.readIdentifier(),o=s.tokenizer.readIdentifier(),u=s.tokenizer.readValue();if(!a.size()||"in"!==o.content||!u)throw new Error("illegal tag: ".concat(e.getText()));s.variable=a.content,s.collection=u,s.hash=new Kr(s.tokenizer,r.options.keyValueSeparator),s.templates=[],s.elseTemplates=[];var c=n.parseStream(t).on("start",function(){return i=s.templates}).on("tag:else",function(e){Ae(e.args),i=s.elseTemplates}).on("tag:endfor",function(e){Ae(e.args),c.stop()}).on("template",function(e){return i.push(e)}).on("end",function(){throw new Error("tag ".concat(e.getText()," not closed"))});return c.start(),s}s(ci,ui=L),ci.prototype.readVariable=function(){var e=this.tokenizer.readIdentifier();if(e.content)return e;if(e=this.tokenizer.readQuoted())return e;throw this.tokenizer.error("invalid capture name")},ci.prototype.render=function(t){var r;return G(this,function(e){switch(e.label){case 0:return[4,this.liquid.renderer.renderTemplates(this.templates,t)];case 1:return r=e.sent(),t.bottom()[this.variable]=r,[2]}})},ci.prototype.children=function(){return G(this,function(e){return[2,this.templates]})},ci.prototype.localScope=function(){return G(this,function(e){switch(e.label){case 0:return[4,this.identifier];case 1:return e.sent(),[2]}})};var ui,Vn=ci;function ci(e,t,r,n){var i=ui.call(this,e,t,r)||this;for(i.templates=[],i.identifier=i.readVariable(),i.variable=i.identifier.content;t.length;){var s=t.shift();if(Fn(s)&&"endcapture"===s.name)return i;i.templates.push(n.parseToken(s,t))}throw new Error("tag ".concat(e.getText()," not closed"))}s(hi,li=L),hi.prototype.render=function(t,r){var n,i,s,a,o,u,c,l,h,p,f,d,y,v;return G(this,function(e){switch(e.label){case 0:return n=this.liquid.renderer,s=g,[4,this.value.value(t,t.opts.lenientIf)];case 1:i=s.apply(void 0,[e.sent()]),a=!1,e.label=2;case 2:e.trys.push([2,14,15,16]),o=X(this.branches),u=o.next(),e.label=3;case 3:if(u.done)return[3,13];c=u.value,e.label=4;case 4:e.trys.push([4,10,11,12]),y=void 0,l=X(c.values),h=l.next(),e.label=5;case 5:return h.done?[3,9]:[4,S(h.value,t,t.opts.lenientIf)];case 6:return(p=e.sent(),xr(i,p))?[4,n.renderTemplates(c.templates,t,r)]:[3,8];case 7:return e.sent(),a=!0,[3,9];case 8:return h=l.next(),[3,5];case 9:return[3,12];case 10:return p=e.sent(),y={error:p},[3,12];case 11:try{h&&!h.done&&(v=l.return)&&v.call(l)}finally{if(y)throw y.error}return[7];case 12:return u=o.next(),[3,3];case 13:return[3,16];case 14:return f=e.sent(),f={error:f},[3,16];case 15:try{u&&!u.done&&(d=o.return)&&d.call(o)}finally{if(f)throw f.error}return[7];case 16:return a?[3,18]:[4,n.renderTemplates(this.elseTemplates,t,r)];case 17:e.sent(),e.label=18;case 18:return[2]}})},hi.prototype.arguments=function(){return G(this,function(e){switch(e.label){case 0:return[4,this.value];case 1:return e.sent(),[5,X(this.branches.flatMap(function(e){return e.values}))];case 2:return e.sent(),[2]}})},hi.prototype.children=function(){var t;return G(this,function(e){return t=this.branches.flatMap(function(e){return e.templates}),this.elseTemplates&&t.push.apply(t,d([],ee(this.elseTemplates),!1)),[2,t]})};var li,Pn=hi;function hi(e,t,r,n){var i=li.call(this,e,t,r)||this,s=(i.branches=[],i.elseTemplates=[],i.value=new F(i.tokenizer.readFilteredValue(),i.liquid),i.elseTemplates=[],[]),a=0,o=n.parseStream(t).on("tag:when",function(e){if(!(0"),r.write(''))),r.write('')),[4,s.renderTemplates(this.templates,t,r)]):[3,6];case 4:e.sent(),r.write(""),e.label=5;case 5:return u++,a.next(),[3,3];case 6:return n.length&&r.write(""),t.pop(),[2]}})},Hi.prototype.children=function(){return G(this,function(e){return[2,this.templates]})},Hi.prototype.arguments=function(){var t,r,n,i,s;return G(this,function(e){switch(e.label){case 0:return[4,this.collection];case 1:e.sent(),e.label=2;case 2:e.trys.push([2,7,8,9]),t=X(Object.values(this.args.hash)),r=t.next(),e.label=3;case 3:return r.done?[3,6]:_(n=r.value)?[4,n]:[3,5];case 4:e.sent(),e.label=5;case 5:return r=t.next(),[3,3];case 6:return[3,9];case 7:return n=e.sent(),i={error:n},[3,9];case 8:try{r&&!r.done&&(s=t.return)&&s.call(t)}finally{if(i)throw i.error}return[7];case 9:return[2]}})},Hi.prototype.blockScope=function(){return[this.variable,"tablerowloop"]};var Ii,Bi=Hi;function Hi(e,t,r,n){var i,s=Ii.call(this,e,t,r)||this,a=s.tokenizer.readIdentifier(),o=(s.tokenizer.skipBlank(),s.tokenizer.readIdentifier()),u=s.tokenizer.readValue();if("in"!==o.content||!u)throw new Error("illegal tag: ".concat(e.getText()));s.variable=a.content,s.collection=u,s.args=new Kr(s.tokenizer,r.options.keyValueSeparator),s.templates=[];var c=n.parseStream(t).on("start",function(){return i=s.templates}).on("tag:endtablerow",function(){return c.stop()}).on("template",function(e){return i.push(e)}).on("end",function(){throw new Error("tag ".concat(e.getText()," not closed"))});return c.start(),s}s(Wi,Ui=L),Wi.prototype.render=function(t,r){var n,i,s,a,o,u,c,l;return G(this,function(e){switch(e.label){case 0:n=this.liquid.renderer,e.label=1;case 1:e.trys.push([1,7,8,9]),i=X(this.branches),s=i.next(),e.label=2;case 2:return s.done?[3,6]:(o=s.value,u=o.value,a=o.test,o=o.templates,[4,u.value(t,t.opts.lenientIf)]);case 3:return(u=e.sent(),a(u,t))?[4,n.renderTemplates(o,t,r)]:[3,5];case 4:return e.sent(),[2];case 5:return s=i.next(),[3,2];case 6:return[3,9];case 7:return c=e.sent(),c={error:c},[3,9];case 8:try{s&&!s.done&&(l=i.return)&&l.call(i)}finally{if(c)throw c.error}return[7];case 9:return[4,n.renderTemplates(this.elseTemplates,t,r)];case 10:return e.sent(),[2]}})},Wi.prototype.children=function(){var t;return G(this,function(e){return t=this.branches.flatMap(function(e){return e.templates}),this.elseTemplates&&t.push.apply(t,d([],ee(this.elseTemplates),!1)),[2,t]})},Wi.prototype.arguments=function(){return this.branches.map(function(e){return e.value})};var Ui,Ki=Wi;function Wi(e,t,r,n){var i=Ui.call(this,e,t,r)||this,s=(i.branches=[],i.elseTemplates=[],[]),a=0;return n.parseStream(t).on("start",function(){return i.branches.push({value:new F(e.tokenizer.readFilteredValue(),i.liquid),test:Tr,templates:s=[]})}).on("tag:elsif",function(e){0