!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 j=function(e,t){return(j=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 o(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}j(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;ra[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 d(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||0> ":" ",r=Z(String(e),String(s).length),t="".concat(t).concat(r,"| "),r=e===n?"\n"+Z("^",i+t.length):"";return t+o[e-1]+r}).join("\n")),enumerable:!1}),this.message=(e=this.message,(t=this.token).file&&(e+=", file:".concat(t.file)),t=d(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)},ie.is=function(e){return"LiquidError"===(null==e?void 0:e[re])},ie);function ie(e,t){var r=te.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,re,{value:"LiquidError",enumerable:!1}),r}o(ae,oe=ne);var oe,se=ae;function ae(e,t){e=oe.call(this,e,t)||this;return e.name="TokenizationError",oe.prototype.update.call(e),e}o(le,ue=ne);var ue,ce=le;function le(e,t){t=ue.call(this,e,t)||this;return t.name="ParseError",t.message=e.message,ue.prototype.update.call(t),t}o(fe,he=ne),fe.is=function(e){return"RenderError"===e.name};var he,pe=fe;function fe(e,t){t=he.call(this,e,t.token)||this;return t.name="RenderError",t.message=e.message,he.prototype.update.call(t),t}o(me,de=ne),me.is=function(e){return"LiquidErrors"===e.name};var de,ge=me;function me(e){var t=de.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},Rt={"==":0,"!=":0,">":0,"<":0,">=":0,"<=":0,contains:0,not:1,and:0,or:0},Et=(o(qt,Ot=e),qt.prototype.getPrecedence=function(){var e=this.getText();return e in zt?zt[e]:1},qt);function qt(e,t,r,n){var i=Ot.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}o(Mt,Nt=e);var Nt,Dt=Mt;function Mt(e,t,r,n,i,o){r=Nt.call(this,l.TokenKind.PropertyAccess,r,n,i,o)||this;return r.variable=e,r.props=t,r}o(Pt,jt=e);var jt,Vt=Pt;function Pt(e,t,r,n,i,o){r=jt.call(this,l.TokenKind.Filter,r,n,i,o)||this;return r.name=e,r.args=t,r}o(Bt,At=e);var At,It=Bt;function Bt(e,t,r,n,i,o){var s=At.call(this,l.TokenKind.Hash,e,t,r,o)||this;return s.input=e,s.begin=t,s.end=r,s.name=n,s.value=i,s.file=o,s}var Ct=/[\da-fA-F]/,Ht=/[0-7]/,Ut={b:"\b",f:"\f",n:"\n",r:"\r",t:"\t",v:"\v"};function Kt(e){e=e.charCodeAt(0);return 97<=e?e-87:65<=e?e-55:e-48}o($t,Yt=e);var Yt,Wt=$t;function $t(e,t,r,n){var i=Yt.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;ro.getPrecedence()?[4,r.pop()]:[3,5];case 4:return e.sent(),[3,3];case 5:return r.push(o),[3,8];case 6:return[4,o];case 7:e.sent(),e.label=8;case 8:return i=n.next(),[3,2];case 9:return[3,12];case 10:return s=e.sent(),s={error:s},[3,12];case 11:try{i&&!i.done&&(a=n.return)&&a.call(n)}finally{if(s)throw s.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 O(t,r,n){return void 0===n&&(n=!1),x(this,function(e){switch(e.label){case 0:return t?"content"in t?[2,t.content]:un(t)?[4,function(t,r,n){var i,o,s,a,u,c,l,h,p;return x(this,function(e){switch(e.label){case 0:i=[],e.label=1;case 1:e.trys.push([1,6,7,8]),o=L(t.props),s=o.next(),e.label=2;case 2:return s.done?[3,5]:(c=s.value,u=(a=i).push,[4,O(c,r,!1)]);case 3:u.apply(a,[e.sent()]),e.label=4;case 4:return s=o.next(),[3,2];case 5:return[3,8];case 6:return c=e.sent(),h={error:c},[3,8];case 7:try{s&&!s.done&&(p=o.return)&&p.call(o)}finally{if(h)throw h.error}return[7];case 8:return(e.trys.push([8,14,,15]),t.variable)?[4,O(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 ve(l,t);case 15:return[2]}})}(t,r,n)]:[3,2]:[2];case 1:return[2,e.sent()];case 2:return cn(t)?[4,function(t,r){var n,i;return x(this,function(e){switch(e.label){case 0:return[4,O(t.lhs,r)];case 1:return n=e.sent(),[4,O(t.rhs,r)];case 2:return i=e.sent(),[2,Q(+n,+i+1)]}})}(t,r)]:[3,4];case 3:return[2,e.sent()];case 4:return[2]}})}function gr(e){return e.content}function mr(e,t){return!yr(e,t)}function yr(e,t){return e=v(e),t.opts.jsTruthy?!e:!1===e||null==e}De={"==":vr,"!=":function(e,t){return!vr(e,t)},">":function(e,t){return b(e)?e.gt(t):b(t)?t.lt(e):v(e)>v(t)},"<":function(e,t){return b(e)?e.lt(t):b(t)?t.gt(e):v(e)=":function(e,t){return b(e)?e.geq(t):b(t)?t.leq(e):v(e)>=v(t)},"<=":function(e,t){return b(e)?e.leq(t):b(t)?t.geq(e):v(e)<=v(t)},contains:function(e,t){return w(e=v(e))?e.some(function(e){return vr(e,t)}):!!c(null==e?void 0:e.indexOf)&&-1this.limit&&this.remove(this.tail.prev.key)},kr);function kr(e,t){void 0===t&&(t=0),this.limit=e,this.size=t,this.cache={},this.head=new wr("HEAD",null,null,null),this.tail=new wr("TAIL",null,null,null),this.head.next=this.tail,this.tail.prev=this.head}function Tr(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}i=Object.freeze({__proto__:null,resolve:function(e,t,i){return e.length&&"/"!==W(e)&&(e+="/"),Tr(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 a(this,void 0,void 0,function(){return x(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 a(this,void 0,void 0,function(){return x(this,function(e){return[2,!0]})})},existsSync:function(e){return!0},dirname:function(e){return Tr(e,".")},sep:"/"});function xr(e,t){return void 0===t&&(t=0),JSON.stringify(e,null,t)}var Lr={default:function(e,t){for(var r=[],n=2;n":">",'"':""","'":"'"},_r={"&":"&","<":"<",">":">",""":'"',"'":"'"};function Sr(e){return e=m(e),this.context.memoryLimit.use(e.length),e.replace(/&|<|>|"|'/g,function(e){return Fr[e]})}var r=Object.freeze({__proto__:null,escape:Sr,xml_escape:function(e){return Sr.call(this,e)},escape_once:function(e){return Sr.call(this,function(e){return e=m(e),this.context.memoryLimit.use(e.length),e.replace(/&(amp|lt|gt|#34|#39);/g,function(e){return _r[e]})}.call(this,e))},newline_to_br:function(e){return e=m(e),this.context.memoryLimit.use(e.length),e.replace(/\r?\n/gm,"
\n")},strip_html:function(e){return e=m(e),this.context.memoryLimit.use(e.length),e.replace(/||<.*?>|/g,"")}}),Or=(zr.prototype.exists=function(t){return a(this,void 0,void 0,function(){return x(this,function(e){return[2,this.existsSync(t)]})})},zr.prototype.existsSync=function(e){return!h(this.mapping[e])},zr.prototype.readFile=function(t){return a(this,void 0,void 0,function(){return x(this,function(e){return[2,this.readFileSync(t)]})})},zr.prototype.readFileSync=function(e){var t=this.mapping[e];if(h(t))throw new Error("ENOENT: ".concat(e));return t},zr.prototype.dirname=function(e){e=e.split(this.sep);return e.pop(),e.join(this.sep)},zr.prototype.resolve=function(e,t,r){var n,i;if(t+=r,"."===e)return t;var o=e.split(/\/+/);try{for(var s=L(t.split(this.sep)),a=s.next();!a.done;a=s.next()){var u=a.value;"."!==u&&""!==u&&(".."===u?(1t?e.slice(0,t-3)+"...":e));var t},R.prototype.readWord=function(){return this.readIdentifier()},R.prototype.readIdentifier=function(){this.skipBlank();for(var e=this.p;!this.end()&&ze(this.peek());)++this.p;return new xt(this.input,e,this.p,this.file)},R.prototype.readNonEmptyIdentifier=function(){var e=this.readIdentifier();return e.size()?e:void 0},R.prototype.readTagName=function(){return this.skipBlank(),"#"===this.input[this.p]?this.input.slice(this.p,++this.p):this.readIdentifier().getText()},R.prototype.readHashes=function(e){for(var t=[];;){var r=this.readHash(e);if(!r)return t;t.push(r)}},R.prototype.readHash=function(e){this.skipBlank(),","===this.peek()&&++this.p;var t,r=this.p,n=this.readNonEmptyIdentifier();if(n)return this.skipBlank(),e=u(e)?e:e?"=":":",this.peek()===e&&(++this.p,t=this.readValue()),new It(this.input,r,this.p,n,t,this.file)},R.prototype.remaining=function(){return this.input.slice(this.p,this.N)},R.prototype.advance=function(e){this.p+=e=void 0===e?1:e},R.prototype.end=function(){return this.p>=this.N},R.prototype.readTo=function(e){for(;this.p=this.N?0:p[this.input.charCodeAt(this.p+e)]},R.prototype.peek=function(e){return this.p+(e=void 0===e?0:e)>=this.N?"":this.input[this.p+e]},R.prototype.skipBlank=function(){for(;this.peekType()&Se;)++this.p};var z=R;function R(e,t,r,n){void 0===t&&(t=Rr.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=He(t),this.literalTrie=He(Ce)}Mr.prototype.on=function(e,t){return this.handlers[e]=t,this},Mr.prototype.trigger=function(e,t){e=this.handlers[e];return!!e&&(e.call(this,t),!0)},Mr.prototype.start=function(){var e,t;for(this.trigger("start");!this.stopRequested&&(e=this.tokens.shift());)this.trigger("token",e)||sn(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},Mr.prototype.stop=function(){return this.stopRequested=!0,this};var Dr=Mr;function Mr(e,t){this.handlers={},this.stopRequested=!1,this.tokens=e,this.parseToken=t}function jr(e){this.token=e}o(Pr,Vr=jr);var Vr,E=Pr;function Pr(e,t,r){var n=Vr.call(this,e)||this;return n.name=e.name,n.liquid=r,n.tokenizer=e.tokenizer,n}Ir.prototype.render=function(t){var r,n,i,o,s,a,u,c,l;return x(this,function(e){switch(e.label){case 0:r={},e.label=1;case 1:e.trys.push([1,8,9,10]),n=L(Object.keys(this.hash)),i=n.next(),e.label=2;case 2:return i.done?[3,7]:(o=i.value,s=r,a=o,void 0!==this.hash[o]?[3,3]:(u=!0,[3,5]));case 3:return[4,O(this.hash[o],t)];case 4:u=e.sent(),e.label=5;case 5:s[a]=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 Ar=Ir;function Ir(e,t){this.hash={};var r,n,e=new z(e,{});try{for(var i=L(e.readHashes(t)),o=i.next();!o.done;o=i.next()){var s=o.value;this.hash[s.name.content]=s.value}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}Cr.prototype.render=function(t,r){var n,i,o,s,a,u,c,l,h,p,f;return x(this,function(e){switch(e.label){case 0:n=[],e.label=1;case 1:e.trys.push([1,8,9,10]),i=L(this.args),o=i.next(),e.label=2;case 2:return o.done?[3,7]:w(s=o.value)?(u=(a=n).push,c=[s[0]],[4,O(s[1],r)]):[3,4];case 3:return u.apply(a,[c.concat([e.sent()])]),[3,6];case 4:return h=(l=n).push,[4,O(s,r)];case 5:h.apply(l,[e.sent()]),e.label=6;case 6:return o=i.next(),[3,2];case 7:return[3,10];case 8:return p=e.sent(),p={error:p},[3,10];case 9:try{o&&!o.done&&(f=i.return)&&f.call(i)}finally{if(p)throw p.error}return[7];case 10:return[4,this.handler.apply({context:r,liquid:this.liquid},g([t],d(n),!1))];case 11:return[2,e.sent()]}})};var Br=Cr;function Cr(e,t,r,n){this.name=e,this.handler=c(t)?t:c(null==t?void 0:t.handler)?t.handler:G,this.raw=!c(t)&&!(null==t||!t.raw),this.args=r,this.liquid=n}Hr.prototype.value=function(t,r){var n,i,o,s,a;return x(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=m(e),this.context.memoryLimit.use(e.length),e.replace(/\s+/g," ")},number_of_words:function(e,t){var r=m(e);if(this.context.memoryLimit.use(r.length),!(e=r.trim()))return 0;switch(t){case"cjk":return(e.match(_n)||[]).length+(e.match(Sn)||[]).length;case"auto":return _n.test(e)?e.match(_n).length+(e.match(Sn)||[]).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])}}}),zn=T(T(T(T(T(T(T({},r),pn),dn),wn),bn),fn),Lr),gn=(o(Rn,On=E),Rn.prototype.render=function(t){var r,n;return x(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]}})},Rn);function Rn(e,t,r){e=On.call(this,e,t,r)||this;return e.key=e.tokenizer.readIdentifier().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 q(e.tokenizer.readFilteredValue(),e.liquid),e}var En,qn=["offset","limit","reversed"],mn=(o(Nn,En=E),Nn.prototype.render=function(t,r){var n,i,o,s,a,u,c,l,h,p,f;return x(this,function(e){switch(e.label){case 0:return n=this.liquid.renderer,o=H,[4,O(this.collection,t)];case 1:return(i=o.apply(void 0,[e.sent()])).length?[3,3]:[4,n.renderTemplates(this.elseTemplates,t,r)];case 2:return e.sent(),[2];case 3:return s="continue-"+this.variable+"-"+this.collection.getText(),t.push({continue:t.getRegister(s)}),[4,this.hash.render(t)];case 4:a=e.sent(),t.pop(),u=this.liquid.options.orderedFilterParameters?Object.keys(a).filter(function(e){return qn.includes(e)}):qn.filter(function(e){return void 0!==a[e]}),i=u.reduce(function(e,t){var r;return"offset"===t?(r=a.offset,e.slice(r)):"limit"===t?(r=a.limit,e.slice(0,r)):g([],d(e),!1).reverse()},i),t.setRegister(s,(a.offset||0)+i.length),u={forloop:new Pe(i.length,this.collection.getText(),this.variable)},t.push(u),e.label=5;case 5:e.trys.push([5,10,11,12]),c=L(i),l=c.next(),e.label=6;case 6:return l.done?[3,9]:(h=l.value,u[this.variable]=h,[4,n.renderTemplates(this.templates,t,r)]);case 7:if(e.sent(),r.break)return r.break=!1,[3,9];r.continue=!1,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.pop(),[2]}})},Nn);function Nn(e,t,r,n){var i,o=En.call(this,e,t,r)||this,s=o.tokenizer.readIdentifier(),a=o.tokenizer.readIdentifier(),u=o.tokenizer.readValue();if(!s.size()||"in"!==a.content||!u)throw new Error("illegal tag: ".concat(e.getText()));o.variable=s.content,o.collection=u,o.hash=new Ar(o.tokenizer.remaining(),r.options.keyValueSeparator),o.templates=[],o.elseTemplates=[];var c=n.parseStream(t).on("start",function(){return i=o.templates}).on("tag:else",function(e){Re(e.args),i=o.elseTemplates}).on("tag:endfor",function(e){Re(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(),o}o(Mn,Dn=E),Mn.prototype.render=function(t){var r;return x(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]}})},Mn.prototype.readVariableName=function(){var e=this.tokenizer.readIdentifier().content;if(e)return e;e=this.tokenizer.readQuoted();if(e)return gr(e);throw this.tokenizer.error("invalid capture name")};var Dn,yn=Mn;function Mn(e,t,r,n){var i=Dn.call(this,e,t,r)||this;for(i.templates=[],i.variable=i.readVariableName();t.length;){var o=t.shift();if(sn(o)&&"endcapture"===o.name)return i;i.templates.push(n.parseToken(o,t))}throw new Error("tag ".concat(e.getText()," not closed"))}o(Vn,jn=E),Vn.prototype.render=function(t,r){var n,i,o,s,a,u,c,l,h,p,f,d,g,m;return x(this,function(e){switch(e.label){case 0:return n=this.liquid.renderer,o=v,[4,this.value.value(t,t.opts.lenientIf)];case 1:i=o.apply(void 0,[e.sent()]),s=!1,e.label=2;case 2:e.trys.push([2,14,15,16]),a=L(this.branches),u=a.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]),g=void 0,l=L(c.values),h=l.next(),e.label=5;case 5:return h.done?[3,9]:[4,O(h.value,t,t.opts.lenientIf)];case 6:return(p=e.sent(),vr(i,p))?[4,n.renderTemplates(c.templates,t,r)]:[3,8];case 7:return e.sent(),s=!0,[3,9];case 8:return h=l.next(),[3,5];case 9:return[3,12];case 10:return p=e.sent(),g={error:p},[3,12];case 11:try{h&&!h.done&&(m=l.return)&&m.call(l)}finally{if(g)throw g.error}return[7];case 12:return u=a.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=a.return)&&d.call(a)}finally{if(f)throw f.error}return[7];case 16:return s?[3,18]:[4,n.renderTemplates(this.elseTemplates,t,r)];case 17:e.sent(),e.label=18;case 18:return[2]}})};var jn,vn=Vn;function Vn(e,t,r,n){var i=jn.call(this,e,t,r)||this,o=(i.branches=[],i.elseTemplates=[],i.value=new q(i.tokenizer.readFilteredValue(),i.liquid),i.elseTemplates=[],[]),s=0,a=n.parseStream(t).on("tag:when",function(e){if(!(0"),r.write(''))),r.write('')),[4,o.renderTemplates(this.templates,t,r)]):[3,6];case 4:e.sent(),r.write(""),e.label=5;case 5:return u++,s.next(),[3,3];case 6:return n.length&&r.write(""),t.pop(),[2]}})};var di,gi=mi;function mi(e,t,r,n){var i,o=di.call(this,e,t,r)||this,s=o.tokenizer.readIdentifier(),a=(o.tokenizer.skipBlank(),o.tokenizer.readIdentifier()),u=o.tokenizer.readValue();if("in"!==a.content||!u)throw new Error("illegal tag: ".concat(e.getText()));o.variable=s.content,o.collection=u,o.args=new Ar(o.tokenizer.remaining(),r.options.keyValueSeparator),o.templates=[];var c=n.parseStream(t).on("start",function(){return i=o.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(),o}o(wi,yi=E),wi.prototype.render=function(t,r){var n,i,o,s,a,u,c,l;return x(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=L(this.branches),o=i.next(),e.label=2;case 2:return o.done?[3,6]:(a=o.value,u=a.value,s=a.test,a=a.templates,[4,u.value(t,t.opts.lenientIf)]);case 3:return(u=e.sent(),s(u,t))?[4,n.renderTemplates(a,t,r)]:[3,5];case 4:return e.sent(),[2];case 5:return o=i.next(),[3,2];case 6:return[3,9];case 7:return c=e.sent(),c={error:c},[3,9];case 8:try{o&&!o.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]}})};var yi,vi=wi;function wi(e,t,r,n){var i=yi.call(this,e,t,r)||this,o=(i.branches=[],i.elseTemplates=[],[]),s=0;return n.parseStream(t).on("start",function(){return i.branches.push({value:new q(e.args,i.liquid),test:yr,templates:o=[]})}).on("tag:elsif",function(e){0