UNPKG

@shopify/prettier-plugin-liquid

Version:
232 lines (191 loc) 337 kB
/*! For license information please see standalone.js.LICENSE.txt */ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("prettier")):"function"==typeof define&&define.amd?define(["prettier/standalone"],t):"object"==typeof exports?exports.prettierPluginLiquid=t(require("prettier")):e.prettierPluginLiquid=t(e.prettier)}(this,(e=>{return t={852:(e,t,r)=>{e.exports=r(127)},815:e=>{var t={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==t.call(e)}},537:(e,t,r)=>{"use strict";var i=r(815);e.exports=function(e){return null!=e&&"object"==typeof e&&!1===i(e)}},638:(e,t,r)=>{"use strict";var i=r(815),n=r(537);function s(e,t){if(!(this instanceof s))return"number"==typeof t?new s(e).fromIndex(t):new s(e,t);this.str=e||"",this.lineToIndex=function(e){for(var t=e.split("\n"),r=new Array(t.length),i=0,n=0,s=t.length;n<s;n++)r[n]=i,i+=t[n].length+1;return r}(this.str),t=t||{},this.origin=void 0===t.origin?1:t.origin}Array.prototype.slice,e.exports=s,s.prototype.fromIndex=function(e){if(e<0||e>=this.str.length||isNaN(e))return null;var t=function(e,t){if(e>=t[t.length-1])return t.length-1;for(var r,i=0,n=t.length-2;i<n;)if(e<t[r=i+(n-i>>1)])n=r-1;else{if(!(e>=t[r+1])){i=r;break}i=r+1}return i}(e,this.lineToIndex);return{line:t+this.origin,col:e-this.lineToIndex[t]+this.origin}},s.prototype.toIndex=function(e,t){if(void 0===t)return i(e)&&e.length>=2?this.toIndex(e[0],e[1]):n(e)&&"line"in e&&("col"in e||"column"in e)?this.toIndex(e.line,"col"in e?e.col:e.column):-1;if(isNaN(e)||isNaN(t))return-1;if(e-=this.origin,t-=this.origin,e>=0&&t>=0&&e<this.lineToIndex.length){var r=this.lineToIndex[e];if(t<(e===this.lineToIndex.length-1?this.str.length:this.lineToIndex[e+1])-r)return r+t}return-1}},369:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getConditionalComment=void 0;const r=/(<!--\[if[^\]]*]>)((.|\n)*)(<!\[endif\]-->)$/;t.getConditionalComment=e=>{const t=e.match(r);if(t)return{startTag:t[1],body:t[2].trim(),endTag:t[4]}}},62:function(e,t,r){"use strict";var i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidHTMLASTParsingError=t.LiquidHTMLCSTParsingError=void 0;const n=i(r(638));class s extends SyntaxError{constructor(e){super(e.shortMessage),this.name="LiquidHTMLParsingError";const t=e.input,r=e._rightmostFailurePosition,i=(0,n.default)(t).fromIndex(Math.min(r,t.length-1));i&&(this.loc={start:{line:i.line,column:i.col},end:{line:i.line,column:i.col}})}}t.LiquidHTMLCSTParsingError=s;class a extends SyntaxError{constructor(e,t,r,i,s){super(e),this.name="LiquidHTMLParsingError",this.unclosed=null!=s?s:null;const a=(0,n.default)(t),o=a.fromIndex(r),l=a.fromIndex(Math.min(i,t.length-1));this.loc={start:{line:o.line,column:o.col},end:{line:l.line,column:l.col}}}}t.LiquidHTMLASTParsingError=a},504:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.TAGS_WITHOUT_MARKUP=t.VOID_ELEMENTS=t.RAW_TAGS=t.BLOCKS=t.placeholderGrammars=t.tolerantGrammars=t.strictGrammars=t.LiquidDocGrammar=t.TextNodeGrammar=t.liquidHtmlGrammars=void 0;const i=r(939);t.liquidHtmlGrammars=(0,i.grammars)(r(512)),t.TextNodeGrammar=t.liquidHtmlGrammars.Helpers,t.LiquidDocGrammar=t.liquidHtmlGrammars.LiquidDoc,t.strictGrammars={Liquid:t.liquidHtmlGrammars.StrictLiquid,LiquidHTML:t.liquidHtmlGrammars.StrictLiquidHTML,LiquidStatement:t.liquidHtmlGrammars.StrictLiquidStatement},t.tolerantGrammars={Liquid:t.liquidHtmlGrammars.Liquid,LiquidHTML:t.liquidHtmlGrammars.LiquidHTML,LiquidStatement:t.liquidHtmlGrammars.LiquidStatement},t.placeholderGrammars={Liquid:t.liquidHtmlGrammars.WithPlaceholderLiquid,LiquidHTML:t.liquidHtmlGrammars.WithPlaceholderLiquidHTML,LiquidStatement:t.liquidHtmlGrammars.WithPlaceholderLiquidStatement},t.BLOCKS=t.strictGrammars.LiquidHTML.rules.blockName.body.factors[0].terms.map((e=>e.obj)),t.RAW_TAGS=t.strictGrammars.LiquidHTML.rules.liquidRawTag.body.terms.map((e=>e.args[0].obj)).concat("comment"),t.VOID_ELEMENTS=t.strictGrammars.LiquidHTML.rules.voidElementName.body.factors[0].terms.map((e=>e.args[0].obj)),t.TAGS_WITHOUT_MARKUP=["style","schema","javascript","else","break","continue","comment","raw","doc"]},849:function(e,t,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(e,t,r,i){void 0===i&&(i=r);var n=Object.getOwnPropertyDescriptor(t,r);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,i,n)}:function(e,t,r,i){void 0===i&&(i=r),e[i]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||i(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.getConditionalComment=t.BLOCKS=t.VOID_ELEMENTS=t.RAW_TAGS=t.TAGS_WITHOUT_MARKUP=void 0,n(r(265),t),n(r(336),t),n(r(62),t);var s=r(504);Object.defineProperty(t,"TAGS_WITHOUT_MARKUP",{enumerable:!0,get:function(){return s.TAGS_WITHOUT_MARKUP}}),Object.defineProperty(t,"RAW_TAGS",{enumerable:!0,get:function(){return s.RAW_TAGS}}),Object.defineProperty(t,"VOID_ELEMENTS",{enumerable:!0,get:function(){return s.VOID_ELEMENTS}}),Object.defineProperty(t,"BLOCKS",{enumerable:!0,get:function(){return s.BLOCKS}});var a=r(369);Object.defineProperty(t,"getConditionalComment",{enumerable:!0,get:function(){return a.getConditionalComment}})},778:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LiquidLiteralValues=t.ConcreteNodeTypes=void 0,t.toLiquidHtmlCST=function(e,t={mode:"tolerant"}){const r=c[t.mode];return p(e,r,r.LiquidHTML,["HelperMappings","LiquidMappings","LiquidHTMLMappings"])},t.toLiquidCST=function(e,t={mode:"tolerant"}){const r=c[t.mode];return p(e,r,r.Liquid,["HelperMappings","LiquidMappings"])};const i=r(609),n=r(504),s=r(62),a=r(336);var o;!function(e){e.HtmlDoctype="HtmlDoctype",e.HtmlComment="HtmlComment",e.HtmlRawTag="HtmlRawTag",e.HtmlVoidElement="HtmlVoidElement",e.HtmlSelfClosingElement="HtmlSelfClosingElement",e.HtmlTagOpen="HtmlTagOpen",e.HtmlTagClose="HtmlTagClose",e.AttrSingleQuoted="AttrSingleQuoted",e.AttrDoubleQuoted="AttrDoubleQuoted",e.AttrUnquoted="AttrUnquoted",e.AttrEmpty="AttrEmpty",e.LiquidVariableOutput="LiquidVariableOutput",e.LiquidRawTag="LiquidRawTag",e.LiquidTag="LiquidTag",e.LiquidTagOpen="LiquidTagOpen",e.LiquidTagClose="LiquidTagClose",e.TextNode="TextNode",e.YAMLFrontmatter="YAMLFrontmatter",e.LiquidVariable="LiquidVariable",e.LiquidFilter="LiquidFilter",e.NamedArgument="NamedArgument",e.LiquidLiteral="LiquidLiteral",e.VariableLookup="VariableLookup",e.BooleanExpression="BooleanExpression",e.String="String",e.Number="Number",e.Range="Range",e.Comparison="Comparison",e.Condition="Condition",e.AssignMarkup="AssignMarkup",e.ContentForMarkup="ContentForMarkup",e.CycleMarkup="CycleMarkup",e.ForMarkup="ForMarkup",e.RenderMarkup="RenderMarkup",e.PaginateMarkup="PaginateMarkup",e.RenderVariableExpression="RenderVariableExpression",e.RenderAliasExpression="RenderAliasExpression",e.ContentForNamedArgument="ContentForNamedArgument",e.LiquidDocParamNode="LiquidDocParamNode",e.LiquidDocParamNameNode="LiquidDocParamNameNode",e.LiquidDocDescriptionNode="LiquidDocDescriptionNode",e.LiquidDocExampleNode="LiquidDocExampleNode",e.LiquidDocPromptNode="LiquidDocPromptNode"}(o||(t.ConcreteNodeTypes=o={})),t.LiquidLiteralValues={nil:null,null:null,true:!0,false:!1,blank:"",empty:""};const l=e=>t=>t[e].sourceString.trim(),u=e=>t=>t[e].sourceString.trimEnd(),c={strict:n.strictGrammars,tolerant:n.tolerantGrammars,completion:n.placeholderGrammars};function p(e,r,c,d,m=e,h=0){const g=e=>h+e[0].source.startIdx,f=e=>h+e[e.length-1].source.endIdx,y=e=>h+e[e.length-2].source.endIdx,S={type:o.TextNode,value:function(){return this.sourceString},locStart:g,locEnd:f,source:e},v=c.match(m,"Node");if(v.failed())throw new s.LiquidHTMLCSTParsingError(v);const b={Node:0,TextNode:S,orderedListOf:0,empty:()=>null,nonemptyOrderedListOf:0,nonemptyOrderedListOfBoth(e,t,r){return e.toAST(this.args.mapping).concat(r.toAST(this.args.mapping))}},x={liquidNode:0,liquidRawTag:0,liquidRawTagImpl:{type:o.LiquidRawTag,name:3,body:9,children:t=>{const i=t[3],s=t[9];switch(i.sourceString){case"schema":case"raw":return p(e,r,n.TextNodeGrammar,["HelperMappings"],s.sourceString,h+s.source.startIdx);default:return p(e,r,r.Liquid,["HelperMappings","LiquidMappings"],s.sourceString,h+s.source.startIdx)}},markup:6,whitespaceStart:1,whitespaceEnd:7,delimiterWhitespaceStart:11,delimiterWhitespaceEnd:17,locStart:g,locEnd:f,source:e,blockStartLocStart:e=>e[0].source.startIdx,blockStartLocEnd:e=>e[8].source.endIdx,blockEndLocStart:e=>e[10].source.startIdx,blockEndLocEnd:e=>e[18].source.endIdx},liquidBlockComment:{type:o.LiquidRawTag,name:"comment",body:e=>e[1].sourceString,children:t=>p(e,r,n.TextNodeGrammar,["HelperMappings"],t[1].sourceString,h+t[1].source.startIdx),whitespaceStart:e=>e[0].children[1].sourceString,whitespaceEnd:e=>e[0].children[7].sourceString,delimiterWhitespaceStart:e=>e[2].children[1].sourceString,delimiterWhitespaceEnd:e=>e[2].children[7].sourceString,locStart:g,locEnd:f,source:e,blockStartLocStart:e=>e[0].source.startIdx,blockStartLocEnd:e=>e[0].source.endIdx,blockEndLocStart:e=>e[2].source.startIdx,blockEndLocEnd:e=>e[2].source.endIdx},liquidDoc:{type:o.LiquidRawTag,name:"doc",body:e=>e[1].sourceString,children:t=>{const r=t[1];return function(e,t,r){const a=e=>r+e[0].source.startIdx,l=e=>r+e[e.length-1].source.endIdx,u=n.LiquidDocGrammar.match(t,"Node");if(u.failed())throw new s.LiquidHTMLCSTParsingError(u);const c=()=>({type:o.TextNode,value:function(){return this.sourceString},locStart:a,locEnd:l,source:e}),p={Node(e,t){return(0===e.sourceString.length?[]:[e.toAST(this.args.mapping)]).concat(t.toAST(this.args.mapping))},ImplicitDescription:{type:o.LiquidDocDescriptionNode,name:"description",locStart:a,locEnd:l,source:e,content:0,isImplicit:!0,isInline:!0},TextNode:c(),paramNode:{type:o.LiquidDocParamNode,name:"param",locStart:a,locEnd:l,source:e,paramType:2,paramName:4,paramDescription:8},descriptionNode:{type:o.LiquidDocDescriptionNode,name:"description",locStart:a,locEnd:l,source:e,content:2,isImplicit:!1,isInline:function(){return!this.children[1].sourceString.includes("\n")}},descriptionContent:c(),paramType:2,paramTypeContent:c(),paramName:{type:o.LiquidDocParamNameNode,content:0,locStart:a,locEnd:l,source:e,required:!0},optionalParamName:{type:o.LiquidDocParamNameNode,content:2,locStart:a,locEnd:l,source:e,required:!1},paramDescription:c(),exampleNode:{type:o.LiquidDocExampleNode,name:"example",locStart:a,locEnd:l,source:e,content:2,isInline:function(){return!this.children[1].sourceString.includes("\n")}},promptNode:{type:o.LiquidDocPromptNode,name:"prompt",locStart:a,locEnd:l,source:e,content:1},multilineTextContent:c(),textValue:c(),fallbackNode:c()};return(0,i.toAST)(u,p)}(e,r.sourceString,h+r.source.startIdx)},whitespaceStart:e=>e[0].children[1].sourceString,whitespaceEnd:e=>e[0].children[7].sourceString,delimiterWhitespaceStart:e=>{var t;return(null===(t=e[2].children[1])||void 0===t?void 0:t.sourceString)||""},delimiterWhitespaceEnd:e=>{var t;return(null===(t=e[2].children[7])||void 0===t?void 0:t.sourceString)||""},locStart:g,locEnd:f,source:e,blockStartLocStart:e=>e[0].source.startIdx,blockStartLocEnd:e=>e[0].source.endIdx,blockEndLocStart:e=>e[2].source.startIdx,blockEndLocEnd:e=>e[2].source.endIdx},liquidInlineComment:{type:o.LiquidTag,name:3,markup:u(5),whitespaceStart:1,whitespaceEnd:6,locStart:g,locEnd:f,source:e},liquidTagOpen:0,liquidTagOpenStrict:0,liquidTagOpenBaseCase:0,liquidTagOpenRule:{type:o.LiquidTagOpen,name:3,markup(e){const t=e[6],r=e[3];return a.NamedTags.hasOwnProperty(r.sourceString)?t.toAST(this.args.mapping):t.sourceString.trim()},whitespaceStart:1,whitespaceEnd:7,locStart:g,locEnd:f,source:e},liquidTagOpenCapture:0,liquidTagOpenForm:0,liquidTagOpenFormMarkup:0,liquidTagOpenFor:0,liquidTagOpenForMarkup:{type:o.ForMarkup,variableName:0,collection:4,reversed:6,args:8,locStart:g,locEnd:f,source:e},liquidTagBreak:0,liquidTagContinue:0,liquidTagOpenTablerow:0,liquidTagOpenPaginate:0,liquidTagOpenPaginateMarkup:{type:o.PaginateMarkup,collection:0,pageSize:4,args:6,locStart:g,locEnd:f,source:e},liquidTagOpenCase:0,liquidTagOpenCaseMarkup:0,liquidTagWhen:0,liquidTagWhenMarkup:0,liquidTagOpenIf:0,liquidTagOpenUnless:0,liquidTagElsif:0,liquidTagElse:0,liquidTagOpenConditionalMarkup:0,condition:{type:o.Condition,relation:0,expression:2,locStart:g,locEnd:f,source:e},comparison:{type:o.Comparison,comparator:2,left:0,right:4,locStart:g,locEnd:f,source:e},liquidTagClose:{type:o.LiquidTagClose,name:4,whitespaceStart:1,whitespaceEnd:7,locStart:g,locEnd:f,source:e},liquidTag:0,liquidTagStrict:0,liquidTagBaseCase:0,liquidTagAssign:0,liquidTagEcho:0,liquidTagContentFor:0,liquidTagCycle:0,liquidTagIncrement:0,liquidTagDecrement:0,liquidTagRender:0,liquidTagInclude:0,liquidTagSection:0,liquidTagSections:0,liquidTagLayout:0,liquidTagRule:{type:o.LiquidTag,name:3,markup(e){const t=e[6],r=e[3];return a.NamedTags.hasOwnProperty(r.sourceString)?t.toAST(this.args.mapping):t.sourceString.trim()},whitespaceStart:1,whitespaceEnd:7,source:e,locStart:g,locEnd:f},liquidTagLiquid:0,liquidTagLiquidMarkup:t=>p(e,r,r.LiquidStatement,["HelperMappings","LiquidMappings","LiquidStatement"],t.sourceString,h+t.source.startIdx),liquidTagEchoMarkup:0,liquidTagSectionMarkup:0,liquidTagSectionsMarkup:0,liquidTagLayoutMarkup:0,liquidTagAssignMarkup:{type:o.AssignMarkup,name:0,value:4,locStart:g,locEnd:f,source:e},liquidTagCycleMarkup:{type:o.CycleMarkup,groupName:0,args:3,locStart:g,locEnd:f,source:e},liquidTagContentForMarkup:{type:o.ContentForMarkup,contentForType:0,args:2,locStart:g,locEnd:f,source:e},contentForType:0,liquidTagRenderMarkup:{type:o.RenderMarkup,snippet:0,variable:1,alias:2,renderArguments:3,locStart:g,locEnd:f,source:e},renderArguments:1,completionModeRenderArguments:function(e,t,r,i,n,s,a,o){return t.toAST(this.args.mapping).concat(""===a.sourceString?[]:a.toAST(this.args.mapping))},snippetExpression:0,renderVariableExpression:{type:o.RenderVariableExpression,kind:1,name:3,locStart:g,locEnd:f,source:e},renderAliasExpression:{type:o.RenderAliasExpression,value:3,locStart:g,locEnd:f,source:e},liquidDrop:{type:o.LiquidVariableOutput,markup:3,whitespaceStart:1,whitespaceEnd:4,locStart:g,locEnd:f,source:e},liquidDropCases:0,liquidExpression:0,liquidComplexExpression:0,liquidDropBaseCase:e=>e.sourceString.trimEnd(),liquidVariable:{type:o.LiquidVariable,expression:0,filters:1,rawSource:t=>e.slice(g(t),t[t.length-2].source.endIdx).trimEnd(),locStart:g,locEnd:y,source:e},liquidFilter:{type:o.LiquidFilter,name:3,locStart:g,locEnd:f,source:e,args(e){return""===e[7].sourceString?[]:e[7].toAST(this.args.mapping)}},filterArguments:0,arguments:0,complexArguments:function(e,t,r,i,n){return e.toAST(this.args.mapping).concat(""===n.sourceString?[]:n.toAST(this.args.mapping))},simpleArgument:0,tagArguments:0,contentForTagArgument:0,completionModeContentForTagArgument:function(e,t,r){return e.toAST(this.args.mapping).concat(""===r.sourceString?[]:r.toAST(this.args.mapping))},positionalArgument:0,namedArgument:{type:o.NamedArgument,name:0,value:4,locStart:g,locEnd:f,source:e},contentForNamedArgument:{type:o.NamedArgument,name:e=>e[0].sourceString+e[1].sourceString,value:6,locStart:g,locEnd:f,source:e},liquidBooleanExpression(t,r){const i=t.toAST(this.args.mapping),n=r.toAST(this.args.mapping);if(0===n.length&&i.expression.type!==o.Comparison)return i.expression;const s=[i,...n];return{type:o.BooleanExpression,conditions:s,locStart:s.at(0).locStart,locEnd:s.at(-1).locEnd,source:e}},booleanExpressionCondition:{type:o.Condition,relation:null,expression:0,locStart:g,locEnd:f,source:e},booleanExpressionSubsequentCondition:{type:o.Condition,relation:1,expression:3,locStart:g,locEnd:f,source:e},liquidString:0,liquidDoubleQuotedString:{type:o.String,single:()=>!1,value:1,locStart:g,locEnd:f,source:e},liquidSingleQuotedString:{type:o.String,single:()=>!0,value:1,locStart:g,locEnd:f,source:e},liquidNumber:{type:o.Number,value:0,locStart:g,locEnd:f,source:e},liquidLiteral:{type:o.LiquidLiteral,value:e=>{const r=e[0].sourceString;return t.LiquidLiteralValues[r]},keyword:0,locStart:g,locEnd:f,source:e},liquidRange:{type:o.Range,start:2,end:6,locStart:g,locEnd:f,source:e},liquidVariableLookup:{type:o.VariableLookup,name:0,lookups:1,locStart:g,locEnd:f,source:e},variableSegmentAsLookupMarkup:0,variableSegmentAsLookup:{type:o.VariableLookup,name:0,lookups:()=>[],locStart:g,locEnd:f,source:e},lookup:0,indexLookup:3,dotLookup:{type:o.String,value:3,locStart:e=>h+e[2].source.startIdx,locEnd:e=>h+e[e.length-1].source.endIdx,source:e},tagMarkup:e=>e.sourceString.trim()},T={LiquidStatement:0,liquidTagOpenRule:{type:o.LiquidTagOpen,name:0,markup(e){const t=e[2],r=e[0];return a.NamedTags.hasOwnProperty(r.sourceString)?t.toAST(this.args.mapping):t.sourceString.trim()},whitespaceStart:null,whitespaceEnd:null,locStart:g,locEnd:y,source:e},liquidTagClose:{type:o.LiquidTagClose,name:1,whitespaceStart:null,whitespaceEnd:null,locStart:g,locEnd:y,source:e},liquidTagRule:{type:o.LiquidTag,name:0,markup(e){const t=e[2],r=e[0];return a.NamedTags.hasOwnProperty(r.sourceString)?t.toAST(this.args.mapping):t.sourceString.trim()},whitespaceStart:null,whitespaceEnd:null,locStart:g,locEnd:y,source:e},liquidRawTagImpl:{type:o.LiquidRawTag,name:0,body:4,children:t=>p(e,r,n.TextNodeGrammar,["HelperMappings"],t[4].sourceString,h+t[4].source.startIdx),whitespaceStart:null,whitespaceEnd:null,delimiterWhitespaceStart:null,delimiterWhitespaceEnd:null,locStart:g,locEnd:y,source:e,blockStartLocStart:e=>h+e[0].source.startIdx,blockStartLocEnd:e=>h+e[2].source.endIdx,blockEndLocStart:e=>h+e[5].source.startIdx,blockEndLocEnd:e=>h+e[5].source.endIdx},liquidBlockComment:{type:o.LiquidRawTag,name:"comment",body:e=>e[1].sourceString.slice(1)+e[2].sourceString,children(t){const i=t[1].sourceString.slice(1)+t[2].sourceString;return p(e,r,n.TextNodeGrammar,["HelperMappings"],i,h+t[1].source.startIdx+1)},whitespaceStart:"",whitespaceEnd:"",delimiterWhitespaceStart:"",delimiterWhitespaceEnd:"",locStart:g,locEnd:f,source:e,blockStartLocStart:e=>h+e[0].source.startIdx,blockStartLocEnd:e=>h+e[0].source.endIdx,blockEndLocStart:e=>h+e[4].source.startIdx,blockEndLocEnd:e=>h+e[4].source.endIdx},liquidInlineComment:{type:o.LiquidTag,name:0,markup:u(2),whitespaceStart:null,whitespaceEnd:null,locStart:g,locEnd:y,source:e}},I={HelperMappings:b,LiquidMappings:x,LiquidHTMLMappings:{Node(e,t){return(0===e.sourceString.length?[]:[e.toAST(this.args.mapping)]).concat(t.toAST(this.args.mapping))},yamlFrontmatter:{type:o.YAMLFrontmatter,body:2,locStart:g,locEnd:f,source:e},HtmlDoctype:{type:o.HtmlDoctype,legacyDoctypeString:4,locStart:g,locEnd:f,source:e},HtmlComment:{type:o.HtmlComment,body:l(1),locStart:g,locEnd:f,source:e},HtmlRawTagImpl:{type:o.HtmlRawTag,name:e=>e[0].children[1].sourceString,attrList(e){const t=this.args.mapping;return e[0].children[2].toAST(t)},body:t=>e.slice(t[0].source.endIdx,t[2].source.startIdx),children:t=>{const i=e.slice(t[0].source.endIdx,t[2].source.startIdx);return p(e,r,r.Liquid,["HelperMappings","LiquidMappings"],i,t[0].source.endIdx)},locStart:g,locEnd:f,source:e,blockStartLocStart:e=>e[0].source.startIdx,blockStartLocEnd:e=>e[0].source.endIdx,blockEndLocStart:e=>e[2].source.startIdx,blockEndLocEnd:e=>e[2].source.endIdx},HtmlVoidElement:{type:o.HtmlVoidElement,name:1,attrList:3,locStart:g,locEnd:f,source:e},HtmlSelfClosingElement:{type:o.HtmlSelfClosingElement,name:1,attrList:2,locStart:g,locEnd:f,source:e},HtmlTagOpen:{type:o.HtmlTagOpen,name:1,attrList:2,locStart:g,locEnd:f,source:e},HtmlTagClose:{type:o.HtmlTagClose,name:1,locStart:g,locEnd:f,source:e},leadingTagNamePart:0,leadingTagNameTextNode:S,trailingTagNamePart:0,trailingTagNameTextNode:S,tagName(e,t){const r=this.args.mapping;return[e.toAST(r)].concat(t.toAST(r))},AttrUnquoted:{type:o.AttrUnquoted,name:0,value:2,locStart:g,locEnd:f,source:e},AttrSingleQuoted:{type:o.AttrSingleQuoted,name:0,value:3,locStart:g,locEnd:f,source:e},AttrDoubleQuoted:{type:o.AttrDoubleQuoted,name:0,value:3,locStart:g,locEnd:f,source:e},attrEmpty:{type:o.AttrEmpty,name:0,locStart:g,locEnd:f,source:e},attrName:0,attrNameTextNode:S,attrDoubleQuotedValue:0,attrSingleQuotedValue:0,attrUnquotedValue:0,attrDoubleQuotedTextNode:S,attrSingleQuotedTextNode:S,attrUnquotedTextNode:S},LiquidStatement:T},N=d.reduce(((e,t)=>({...e,...I[t]})),{});return(0,i.toAST)(v,N)}},265:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RawMarkupKinds=void 0,t.isBranchedTag=c,t.toLiquidAST=function(e,t={allowUnclosedDocumentNode:!0,mode:"tolerant"}){const r=(0,l.toLiquidCST)(e,{mode:t.mode});return{type:n.NodeTypes.Document,source:e,_source:e,children:m(r,t),name:"#document",position:{start:0,end:e.length}}},t.toLiquidHtmlAST=function(e,t={allowUnclosedDocumentNode:!1,mode:"tolerant"}){const r=(0,i.toLiquidHtmlCST)(e,{mode:t.mode});return{type:n.NodeTypes.Document,source:e,_source:e,children:m(r,t),name:"#document",position:{start:0,end:e.length}}},t.getName=d,t.cstToAst=m,t.walk=function e(t,r,i){for(const i of Object.keys(t)){if(n.nonTraversableProperties.has(i))continue;const s=t[i];Array.isArray(s)?s.filter(Y).forEach((i=>e(i,r,t))):Y(s)&&e(s,r,t)}r(t,i)},t.isLiquidHtmlNode=Y;const i=r(778),n=r(336),s=r(428),a=r(62),o=r(504),l=r(778);var u;function c(e){return e.type===n.NodeTypes.LiquidTag&&["if","for","unless","case"].includes(e.name)}!function(e){e.css="css",e.html="html",e.javascript="javascript",e.json="json",e.markdown="markdown",e.typescript="typescript",e.text="text"}(u||(t.RawMarkupKinds=u={}));class p{constructor(e){this.ast=[],this.cursor=[],this.source=e}get current(){return(0,s.deepGet)(this.cursor,this.ast)}get currentPosition(){return(this.current||[]).length-1}get parent(){if(0!=this.cursor.length)return(0,s.deepGet)((0,s.dropLast)(1,this.cursor),this.ast)}get grandparent(){if(!(this.cursor.length<4))return(0,s.deepGet)((0,s.dropLast)(3,this.cursor),this.ast)}open(e){var t;this.current.push(e),this.cursor.push(this.currentPosition),this.cursor.push("children"),c(e)&&this.open((t=e,{type:n.NodeTypes.LiquidBranch,name:null,markup:"",position:{start:t.position.end,end:t.position.end},blockStartPosition:{start:t.position.end,end:t.position.end},blockEndPosition:{start:-1,end:-1},children:[],whitespaceStart:"",whitespaceEnd:"",source:t.source}))}push(e){if(e.type===n.NodeTypes.LiquidBranch){const t=this.findCloseableParentBranch(e);if(t){for(t.blockEndPosition={start:e.position.start,end:e.position.start};this.parent&&this.parent!==t&&this.parent.type===n.NodeTypes.HtmlElement;)this.parent.blockEndPosition={start:e.position.start,end:e.position.start},this.closeParentWith(e);this.closeParentWith(e)}this.open(e)}else this.current.push(e)}close(e,t){var r,s;if(function(e){return!!e&&e.type===n.NodeTypes.LiquidBranch}(this.parent)&&(this.parent.blockEndPosition={start:e.locStart,end:e.locStart},this.closeParentWith(e)),!this.parent)throw new a.LiquidHTMLASTParsingError(`Attempting to close ${t} '${d(e)}' before it was opened`,this.source,e.locStart,e.locEnd);if(d(this.parent)!==d(e)||this.parent.type!==t){const r=this.findCloseableParentNode(e);if(this.parent.type!==n.NodeTypes.HtmlElement||!r)throw new a.LiquidHTMLASTParsingError(`Attempting to close ${t} '${d(e)}' before ${this.parent.type} '${d(this.parent)}' was closed`,this.source,this.parent.position.start,e.locEnd,J(this.parent));for(;this.parent!==r;)this.parent.blockEndPosition={start:e.locStart,end:e.locStart},this.closeParentWith(e)}this.parent.position.end=e.locEnd,this.parent.blockEndPosition=Q(e),this.parent.type==n.NodeTypes.LiquidTag&&e.type==i.ConcreteNodeTypes.LiquidTagClose&&(this.parent.delimiterWhitespaceStart=null!==(r=e.whitespaceStart)&&void 0!==r?r:"",this.parent.delimiterWhitespaceEnd=null!==(s=e.whitespaceEnd)&&void 0!==s?s:""),this.cursor.pop(),this.cursor.pop()}findCloseableParentBranch(e){for(let t=this.cursor.length-1;t>0;t-=2){const r=(0,s.deepGet)(this.cursor.slice(0,t),this.ast),i=this.cursor[t],o=r.type===n.NodeTypes.HtmlElement&&"children"===i;if(r.type===n.NodeTypes.LiquidBranch)return r;if(!o)throw new a.LiquidHTMLASTParsingError(`Attempting to open LiquidBranch '${e.name}' before ${r.type} '${d(r)}' was closed`,this.source,r.position.start,e.position.end)}return null}findCloseableParentNode(e){for(let t=this.cursor.length-1;t>0;t-=2){const r=(0,s.deepGet)(this.cursor.slice(0,t),this.ast);if(d(r)===d(e)&&r.type===n.NodeTypes.LiquidTag&&["if","unless","case"].includes(r.name))return r;if(r.type===n.NodeTypes.LiquidTag)return null}return null}closeParentWith(e){this.parent&&(this.parent.position.end="locStart"in e?e.locStart:e.position.start),this.cursor.pop(),this.cursor.pop()}}function d(e){if(!e)return null;switch(e.type){case n.NodeTypes.HtmlElement:case n.NodeTypes.HtmlDanglingMarkerClose:case n.NodeTypes.HtmlSelfClosingElement:case i.ConcreteNodeTypes.HtmlTagClose:return e.name.map((e=>e.type===n.NodeTypes.TextNode||e.type==i.ConcreteNodeTypes.TextNode?e.value:"string"==typeof e.markup?`{{${e.markup.trim()}}}`:`{{${e.markup.rawSource}}}`)).join("");case n.NodeTypes.AttrEmpty:case n.NodeTypes.AttrUnquoted:case n.NodeTypes.AttrDoubleQuoted:case n.NodeTypes.AttrSingleQuoted:return e.name.map((e=>"string"==typeof e?e:e.source.slice(e.position.start,e.position.end))).join("");default:return e.name}}function m(e,t){var r;if(0===e.length)return[];const o=function(e,t){var r,a,o,l;const u=new p(e[0].source);for(let c=0;c<e.length;c++){const p=e[c];switch(p.type){case i.ConcreteNodeTypes.TextNode:u.push($(p));break;case i.ConcreteNodeTypes.LiquidVariableOutput:u.push(R(p));break;case i.ConcreteNodeTypes.LiquidTagOpen:u.open(b(p,{...t,isBlockTag:!0}));break;case i.ConcreteNodeTypes.LiquidTagClose:u.close(p,n.NodeTypes.LiquidTag);break;case i.ConcreteNodeTypes.LiquidTag:u.push(b(p,{...t,isBlockTag:!1}));break;case i.ConcreteNodeTypes.LiquidRawTag:u.push({type:n.NodeTypes.LiquidRawTag,markup:K(p.name,p.markup),name:p.name,body:L(p,t),whitespaceStart:null!==(r=p.whitespaceStart)&&void 0!==r?r:"",whitespaceEnd:null!==(a=p.whitespaceEnd)&&void 0!==a?a:"",delimiterWhitespaceStart:null!==(o=p.delimiterWhitespaceStart)&&void 0!==o?o:"",delimiterWhitespaceEnd:null!==(l=p.delimiterWhitespaceEnd)&&void 0!==l?l:"",position:Q(p),blockStartPosition:{start:p.blockStartLocStart,end:p.blockStartLocEnd},blockEndPosition:{start:p.blockEndLocStart,end:p.blockEndLocEnd},source:p.source});break;case i.ConcreteNodeTypes.HtmlTagOpen:u.open(B(p,t));break;case i.ConcreteNodeTypes.HtmlTagClose:z(u,e,c,t.mode)?u.push(G(p,t)):u.close(p,n.NodeTypes.HtmlElement);break;case i.ConcreteNodeTypes.HtmlVoidElement:u.push(W(p,t));break;case i.ConcreteNodeTypes.HtmlSelfClosingElement:u.push(V(p,t));break;case i.ConcreteNodeTypes.HtmlDoctype:u.push({type:n.NodeTypes.HtmlDoctype,legacyDoctypeString:p.legacyDoctypeString,position:Q(p),source:p.source});break;case i.ConcreteNodeTypes.HtmlComment:u.push({type:n.NodeTypes.HtmlComment,body:p.body,position:Q(p),source:p.source});break;case i.ConcreteNodeTypes.HtmlRawTag:u.push({type:n.NodeTypes.HtmlRawNode,name:p.name,body:L(p,t),attributes:y(p.attrList||[],t),position:Q(p),source:p.source,blockStartPosition:{start:p.blockStartLocStart,end:p.blockStartLocEnd},blockEndPosition:{start:p.blockEndLocStart,end:p.blockEndLocEnd}});break;case i.ConcreteNodeTypes.AttrEmpty:u.push({type:n.NodeTypes.AttrEmpty,name:m(p.name,t),position:Q(p),source:p.source});break;case i.ConcreteNodeTypes.AttrSingleQuoted:case i.ConcreteNodeTypes.AttrDoubleQuoted:case i.ConcreteNodeTypes.AttrUnquoted:{const e={type:p.type,name:m(p.name,t),position:Q(p),source:p.source,attributePosition:{start:-1,end:-1},value:[]},r=f(p.value,t);e.value=r,e.attributePosition=g(p,r),u.push(e);break}case i.ConcreteNodeTypes.YAMLFrontmatter:u.push({type:n.NodeTypes.YAMLFrontmatter,body:p.body,position:Q(p),source:p.source});break;case i.ConcreteNodeTypes.LiquidDocParamNode:u.push({type:n.NodeTypes.LiquidDocParamNode,name:p.name,position:Q(p),source:p.source,paramName:$(p.paramName.content),paramDescription:U(p.paramDescription),paramType:U(p.paramType),required:p.paramName.required});break;case i.ConcreteNodeTypes.LiquidDocDescriptionNode:u.push({type:n.NodeTypes.LiquidDocDescriptionNode,name:p.name,position:Q(p),source:p.source,content:$(p.content),isImplicit:p.isImplicit,isInline:p.isInline});break;case i.ConcreteNodeTypes.LiquidDocExampleNode:u.push({type:n.NodeTypes.LiquidDocExampleNode,name:p.name,position:Q(p),source:p.source,content:$(p.content),isInline:p.isInline});break;case i.ConcreteNodeTypes.LiquidDocPromptNode:u.push({type:n.NodeTypes.LiquidDocPromptNode,name:p.name,position:Q(p),source:p.source,content:$(p.content)});break;default:(0,s.assertNever)(p)}}return u}(e,t);if(!t.allowUnclosedDocumentNode&&0!==o.cursor.length)throw new a.LiquidHTMLASTParsingError(`Attempting to end parsing before ${null===(r=o.parent)||void 0===r?void 0:r.type} '${d(o.parent)}' was closed`,o.source,o.source.length-1,o.source.length,J(o.parent,o.grandparent));return o.ast}function h(e){const t=e.at(0);return e.at(-1).locEnd-t.locStart}function g(e,t){return 0===t.length?{start:e.locStart+h(e.name)+1+1,end:e.locStart+h(e.name)+1+1}:{start:t[0].position.start,end:t[t.length-1].position.end}}function f(e,t){return m(e,t)}function y(e,t){return m(e,t)}function S(e){var t,r;return{type:n.NodeTypes.LiquidTag,position:Q(e),whitespaceStart:null!==(t=e.whitespaceStart)&&void 0!==t?t:"",whitespaceEnd:null!==(r=e.whitespaceEnd)&&void 0!==r?r:"",blockStartPosition:Q(e),source:e.source}}function v(e){var t,r;return{type:n.NodeTypes.LiquidBranch,children:[],position:Q(e),whitespaceStart:null!==(t=e.whitespaceStart)&&void 0!==t?t:"",whitespaceEnd:null!==(r=e.whitespaceEnd)&&void 0!==r?r:"",blockStartPosition:Q(e),blockEndPosition:{start:-1,end:-1},source:e.source}}function b(e,t){return"string"!=typeof e.markup?function(e,t){switch(e.name){case n.NamedTags.echo:return{...S(e),name:n.NamedTags.echo,markup:P(e.markup)};case n.NamedTags.assign:return{...S(e),name:n.NamedTags.assign,markup:x(e.markup)};case n.NamedTags.cycle:return{...S(e),name:e.name,markup:T(e.markup)};case n.NamedTags.increment:case n.NamedTags.decrement:return{...S(e),name:e.name,markup:M(e.markup)};case n.NamedTags.capture:return{...S(e),name:e.name,markup:M(e.markup),children:[]};case n.NamedTags.content_for:return{...S(e),name:e.name,markup:E(e.markup)};case n.NamedTags.include:case n.NamedTags.render:return{...S(e),name:e.name,markup:A(e.markup)};case n.NamedTags.layout:case n.NamedTags.section:case n.NamedTags.sections:return{...S(e),name:e.name,markup:M(e.markup)};case n.NamedTags.form:return{...S(e),name:e.name,markup:e.markup.map(H),children:[]};case n.NamedTags.tablerow:case n.NamedTags.for:return{...S(e),name:e.name,markup:I(e.markup),children:[]};case n.NamedTags.paginate:return{...S(e),name:e.name,markup:N(e.markup),children:[]};case n.NamedTags.if:case n.NamedTags.unless:return{...S(e),name:e.name,markup:q(e.markup),blockEndPosition:{start:-1,end:-1},children:[]};case n.NamedTags.elsif:return{...v(e),name:e.name,markup:q(e.markup)};case n.NamedTags.case:return{...S(e),name:e.name,markup:M(e.markup),children:[]};case n.NamedTags.when:return{...v(e),name:e.name,markup:e.markup.map(M)};case n.NamedTags.liquid:return{...S(e),name:e.name,markup:m(e.markup,t)};default:return(0,s.assertNever)(e)}}(e,t):function(e){return e.type===i.ConcreteNodeTypes.LiquidTag&&["else","elsif","when"].includes(e.name)}(e)?function(e){var t,r;return{name:e.name,type:n.NodeTypes.LiquidBranch,markup:"else"!==e.name?e.markup:"",position:{start:e.locStart,end:e.locEnd},children:[],blockStartPosition:{start:e.locStart,end:e.locEnd},blockEndPosition:{start:-1,end:-1},whitespaceStart:null!==(t=e.whitespaceStart)&&void 0!==t?t:"",whitespaceEnd:null!==(r=e.whitespaceEnd)&&void 0!==r?r:"",source:e.source}}(e):t.isBlockTag?{name:e.name,markup:K(e.name,e.markup),children:t.isBlockTag?[]:void 0,...S(e)}:{name:e.name,markup:K(e.name,e.markup),...S(e)}}function x(e){return{type:n.NodeTypes.AssignMarkup,name:e.name,value:P(e.value),position:Q(e),source:e.source}}function T(e){return{type:n.NodeTypes.CycleMarkup,groupName:e.groupName?M(e.groupName):null,args:e.args.map(M),position:Q(e),source:e.source}}function I(e){return{type:n.NodeTypes.ForMarkup,variableName:e.variableName,collection:M(e.collection),args:e.args.map(j),reversed:!!e.reversed,position:Q(e),source:e.source}}function N(e){return{type:n.NodeTypes.PaginateMarkup,collection:M(e.collection),pageSize:M(e.pageSize),position:Q(e),args:e.args?e.args.map(j):[],source:e.source}}function L(e,t){return{type:n.NodeTypes.RawMarkup,kind:w(e),nodes:m(e.children,t),value:e.body,position:{start:e.blockStartLocEnd,end:e.blockEndLocStart},source:e.source}}function w(e){switch(e.type){case i.ConcreteNodeTypes.HtmlRawTag:return function(e){var t;switch(e.name){case"script":{const r=null===(t=e.attrList)||void 0===t?void 0:t.find((e=>"name"in e&&"string"!=typeof e.name&&1===e.name.length&&e.name[0].type===i.ConcreteNodeTypes.TextNode&&"type"===e.name[0].value));if(!r||!("value"in r)||0===r.value.length||r.value[0].type!==i.ConcreteNodeTypes.TextNode)return u.javascript;const n=r.value[0].value;return"text/markdown"===n?u.markdown:"application/x-typescript"===n?u.typescript:"text/html"===n?u.html:n&&(n.endsWith("json")||n.endsWith("importmap"))||"speculationrules"===n?u.json:u.javascript}case"style":return C.test(e.body)?u.text:u.css;default:return u.text}}(e);case i.ConcreteNodeTypes.LiquidRawTag:return function(e){switch(e.name){case"javascript":return u.javascript;case"stylesheet":case"style":return C.test(e.body)?u.text:u.css;case"schema":return u.json;default:return u.text}}(e);default:return(0,s.assertNever)(e)}}const C=/(\{%|\{\{)-?/g;function E(e){return{type:n.NodeTypes.ContentForMarkup,contentForType:M(e.contentForType),args:e.args.map(H),position:Q(e),source:e.source}}function A(e){return{type:n.NodeTypes.RenderMarkup,snippet:M(e.snippet),alias:k(e.alias),variable:_(e.variable),args:e.renderArguments.map(H),position:Q(e),source:e.source}}function _(e){return e?{type:n.NodeTypes.RenderVariableExpression,kind:e.kind,name:M(e.name),position:Q(e),source:e.source}:null}function k(e){return e?{type:n.NodeTypes.RenderAliasExpression,value:e.value,position:Q(e),source:e.source}:null}function q(e){if(1===e.length)return O(e[0]);const[t,r]=e,[,...i]=e;return{type:n.NodeTypes.LogicalExpression,relation:r.relation,left:O(t),right:q(i),position:{start:t.locStart,end:e[e.length-1].locEnd},source:t.source}}function O(e){const t=e.expression;return t.type===i.ConcreteNodeTypes.Comparison?function(e){return{type:n.NodeTypes.Comparison,comparator:e.comparator,left:M(e.left),right:M(e.right),position:Q(e),source:e.source}}(t):M(t)}function R(e){var t,r;return{type:n.NodeTypes.LiquidVariableOutput,markup:"string"==typeof e.markup?e.markup:P(e.markup),whitespaceStart:null!==(t=e.whitespaceStart)&&void 0!==t?t:"",whitespaceEnd:null!==(r=e.whitespaceEnd)&&void 0!==r?r:"",position:Q(e),source:e.source}}function P(e){return{type:n.NodeTypes.LiquidVariable,expression:D(e.expression),filters:e.filters.map(F),position:Q(e),rawSource:e.rawSource,source:e.source}}function D(e){return e.type===i.ConcreteNodeTypes.BooleanExpression?{type:n.NodeTypes.BooleanExpression,position:Q(e),condition:q(e.conditions),source:e.source}:M(e)}function M(e){switch(e.type){case i.ConcreteNodeTypes.String:return{type:n.NodeTypes.String,position:Q(e),single:e.single,value:e.value,source:e.source};case i.ConcreteNodeTypes.Number:return{type:n.NodeTypes.Number,position:Q(e),value:e.value,source:e.source};case i.ConcreteNodeTypes.LiquidLiteral:return{type:n.NodeTypes.LiquidLiteral,position:Q(e),value:e.value,keyword:e.keyword,source:e.source};case i.ConcreteNodeTypes.Range:return{type:n.NodeTypes.Range,start:M(e.start),end:M(e.end),position:Q(e),source:e.source};case i.ConcreteNodeTypes.VariableLookup:return{type:n.NodeTypes.VariableLookup,name:e.name,lookups:e.lookups.map(M),position:Q(e),source:e.source};default:return(0,s.assertNever)(e)}}function F(e){return{type:n.NodeTypes.LiquidFilter,name:e.name,args:e.args.map(H),position:Q(e),source:e.source}}function H(e){return e.type===i.ConcreteNodeTypes.NamedArgument?j(e):M(e)}function j(e){return{type:n.NodeTypes.NamedArgument,name:e.name,value:M(e.value),position:Q(e),source:e.source}}function B(e,t){return{type:n.NodeTypes.HtmlElement,name:m(e.name,t),attributes:y(e.attrList||[],t),position:Q(e),blockStartPosition:Q(e),blockEndPosition:{start:-1,end:-1},children:[],source:e.source}}function G(e,t){return{type:n.NodeTypes.HtmlDanglingMarkerClose,name:m(e.name,t),position:Q(e),blockStartPosition:Q(e),source:e.source}}function W(e,t){return{type:n.NodeTypes.HtmlVoidElement,name:e.name,attributes:y(e.attrList||[],t),position:Q(e),blockStartPosition:Q(e),source:e.source}}function V(e,t){return{type:n.NodeTypes.HtmlSelfClosingElement,name:m(e.name,t),attributes:y(e.attrList||[],t),position:Q(e),blockStartPosition:Q(e),source:e.source}}function U(e){return e&&""!==e.value?$(e):null}function $(e){return{type:n.NodeTypes.TextNode,value:e.value,position:Q(e),source:e.source}}function z(e,t,r,i){if("completion"===i){const i=t[r];return!(e.parent&&e.parent.type===n.NodeTypes.HtmlElement&&d(e.parent)===d(i))}return function(e){const{parent:t,grandparent:r}=e;return!(!t||!r)&&t.type===n.NodeTypes.LiquidBranch&&r.type===n.NodeTypes.LiquidTag&&["if","unless","case"].includes(r.name)}(e)}function K(e,t){return o.TAGS_WITHOUT_MARKUP.includes(e)?"":t}function Q(e){return{start:e.locStart,end:e.locEnd}}function Y(e){return null!==e&&"object"==typeof e&&"type"in e&&n.NodeTypes.hasOwnProperty(e.type)}function J(e,t){var r;if(e)return null===d(e)&&t&&(e=t),{type:e.type,name:null!==(r=d(e))&&void 0!==r?r:"",blockStartPosition:"blockStartPosition"in e?e.blockStartPosition:e.position}}},336:(e,t)=>{"use strict";var r,i,n;Object.defineProperty(t,"__esModule",{value:!0}),t.nonTraversableProperties=t.LoopNamedTags=t.LiquidNodeTypes=t.HtmlNodeTypes=t.Comparators=t.NamedTags=t.NodeTypes=void 0,function(e){e.Document="Document",e.LiquidRawTag="LiquidRawTag",e.LiquidTag="LiquidTag",e.LiquidBranch="LiquidBranch",e.LiquidVariableOutput="LiquidVariableOutput",e.HtmlSelfClosingElement="HtmlSelfClosingElement",e.HtmlVoidElement="HtmlVoidElement",e.HtmlDoctype="HtmlDoctype",e.HtmlComment="HtmlComment",e.HtmlElement="HtmlElement",e.HtmlDanglingMarkerClose="HtmlDanglingMarkerClose",e.HtmlRawNode="HtmlRawNode",e.AttrSingleQuoted="AttrSingleQuoted",e.AttrDoubleQuoted="AttrDoubleQuoted",e.AttrUnquoted="AttrUnquoted",e.AttrEmpty="AttrEmpty",e.TextNode="TextNode",e.YAMLFrontmatter="YAMLFrontmatter",e.LiquidVariable="LiquidVariable",e.LiquidFilter="LiquidFilter",e.NamedArgument="NamedArgument",e.LiquidLiteral="LiquidLiteral",e.BooleanExpression="BooleanExpression",e.String="String",e.Number="Number",e.Range="Range",e.VariableLookup="VariableLookup",e.Comparison="Comparison",e.LogicalExpression="LogicalExpression",e.AssignMarkup="AssignMarkup",e.ContentForMarkup="ContentForMarkup",e.CycleMarkup="CycleMarkup",e.ForMarkup="ForMarkup",e.PaginateMarkup="PaginateMarkup",e.RawMarkup="RawMarkup",e.RenderMarkup="RenderMarkup",e.RenderVariableExpression="RenderVariableExpression",e.RenderAliasExpression="RenderAliasExpression",e.LiquidDocDescriptionNode="LiquidDocDescriptionNode",e.LiquidDocParamNode="LiquidDocParamNode",e.LiquidDocExampleNode="LiquidDocExampleNode",e.LiquidDocPromptNode="LiquidDocPromptNode"}(r||(t.NodeTypes=r={})),function(e){e.assign="assign",e.capture="capture",e.case="case",e.content_for="content_for",e.cycle="cycle",e.decrement="decrement",e.echo="echo",e.elsif="elsif",e.for="for",e.form="form",e.if="if",e.include="include",e.increment="increment",e.layout="layout",e.liquid="liquid",e.paginate="paginate",e.render="render",e.section="section",e.sections="sections",e.tablerow="tablerow",e.unless="unless",e.when="when"}(i||(t.NamedTags=i={})),function(e){e.CONTAINS="contains",e.EQUAL="==",e.GREATER_THAN=">",e.GREATER_THAN_OR_EQUAL=">=",e.LESS_THAN="<",e.LESS_THAN_OR_EQUAL="<=",e.NOT_EQUAL="!="}(n||(t.Comparators=n={})),t.HtmlNodeTypes=[r.HtmlElement,r.HtmlDanglingMarkerClose,r.HtmlRawNode,r.HtmlVoidElement,r.HtmlSelfClosingElement],t.LiquidNodeTypes=[r.LiquidTag,r.LiquidVariableOutput,r.LiquidBranch,r.LiquidRawTag],t.LoopNamedTags=[i.for,i.tablerow],t.nonTraversableProperties=new Set(["parentNode","prev","next","firstChild","lastChild"])},428:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assertNever=function(e){throw new Error(`Unexpected object: ${e.type}`)},t.locStart=function(e){return e.position.start},t.locEnd=function(e){return e.position.end},t.deepGet=function(e,t){return e.reduce(((e,t)=>{if(e&&void 0!==e[t])return e[t]}),t)},t.dropLast=function(e,t){const r=[...t];for(let t=0;t<e;t++)r.pop();return r}},512:e=>{e.exports=String.raw`Helpers { Node = TextNode* TextNode = AnyExceptPlus<openControl> openControl = end empty = /* nothing */ anyExcept<lit> = (~ lit any) anyExceptStar<lit> = (~ lit any)* anyExceptPlus<lit> = (~ lit any)+ AnyExcept<lit> = (~ lit any) AnyExceptPlus<lit> = (~ lit any)+ AnyExceptStar<lit> = (~ lit any)* identifierCharacter = alnum | "_" | "-" orderedListOf<a, b, sep> = | nonemptyOrderedListOf<a, b, sep> | emptyListOf<a, sep> nonemptyOrderedListOf<a, b, sep> = | nonemptyListOf<b, sep> | nonemptyOrderedListOfBoth<a, b, sep> | nonemptyListOf<a, sep> nonemptyOrderedListOfBoth<a, b, sep> = nonemptyListOf<a, sep> (sep nonemptyListOf<b, sep>) singleQuote = "'" | "‘" | "’" doubleQuote = "\"" | "“" | "”" controls = "\u{007F}".."\u{009F}" noncharacters = "\u{FDD0}".."\u{FDEF}" newline = "\r"? "\n" } Liquid <: Helpers { Node := (liquidNode | TextNode)* openControl := "{{" | "{%" endOfTagName = &("-%}" | "-}}" | "%}" | "}}") endOfVarName = ~identifierCharacter endOfIdentifier = endOfTagName | endOfVarName liquidNode = | liquidDoc | liquidBlockComment | liquidRawTag | liquidDrop | liquidTagClose | liquidTagOpen | liquidTag | liquidInlineComment liquidTagStrict = | liquidTagAssign | liquidTagBreak | liquidTagContinue | liquidTagCycle | liquidTagContentFor | liquidTagDecrement | liquidTagEcho | liquidTagElse | liquidTagElsif | liquidTagInclude | liquidTagIncrement | liquidTagLayout | liquidTagLiquid | liquidTagRender | liquidTagSection | liquidTagSections | liquidTagWhen liquidTag = | liquidTagStrict | liquidTagBaseCase liquidTagOpenStrict = | liquidTagOpenCase | liquidTagOpenCapture | liquidTagOpenForm | liquidTagOpenFor | liquidTagOpenTablerow | liquidTagOpenIf | liquidTagOpenPaginate | liquidTagOpenUnless liquidTagOpen = | liquidTagOpenStrict | liquidTagOpenBaseCase liquidTagClose = "{%" "-"? space* "end" blockName space* tagMarkup "-"? "%}" // These two are the same but transformed differently liquidTagRule<name, markup> = "{%" "-"? space* (name endOfIdentifier) space* markup "-"? "%}" liquidTagOpenRule<name, markup> = "{%" "-"? space* (name endOfIdentifier) space* markup "-"? "%}" liquidTagBaseCase = liquidTagRule<liquidTagName, tagMarkup> liquidTagEcho = liquidTagRule<"echo", liquidTagEchoMarkup> liquidTagEchoMarkup = liquidVariable<delimTag> liquidTagAssign = liquidTagRule<"assign", liquidTagAssignMarkup> liquidTagAssignMarkup = variableSegment space* "=" space* liquidVariable<delimTag> liquidTagCycle = liquidTagRule<"cycle", liquidTagCycleMarkup> liquidTagCycleMarkup = (liquidExpression<delimTag> ":")? space* nonemptyListOf<liquidExpression<delimTag>, argumentSeparator> space* liquidTagIncrement = liquidTagRule<"increment", variableSegmentAsLookupMarkup> liquidTagDecrement = liquidTagRule<"decrement", variableSegmentAsLookupMarkup> liquidTagOpenCapture = liquidTagOpenRule<"capture", variableSegmentAsLookupMarkup> variableSegmentAsLookupMarkup = variableSegmentAsLookup space* liquidTagSection = liquidTagRule<"section", liquidTagSectionMarkup> liquidTagSectionMarkup = liquidString<delimTag> space* liquidTagSections = liquidTagRule<"sections", liquidTagSectionsMarkup> liquidTagSectionsMarkup = liquidString<delimTag> space* liquidTagLayout = liquidTagRule<"layout", liquidTagLayoutMarkup> liquidTagLayoutMarkup = liquidExpression<delimTag> space* // We'll black hole the statement and switch parser in the cst builder // We do this because it's technically the same grammar (with minor redefinitions) // and it would be a huge chore and maintenance hell to rewrite all the rules with // hspace = " " | "\t" // // The alternative is that this grammar parses the {% liquid tagMarkup %} as its own string, // and then we switch to the LiquidStatement grammar that // redefines liquidTagOpenRule, liquidTagRule, and space. liquidTagLiquid = liquidTagRule<"liquid", liquidTagLiquidMarkup> liquidTagLiquidMarkup = tagMarkup liquidTagContentFor = liquidTagRule<"content_for", liquidTagContentForMarkup> liquidTagContentForMarkup = contentForType (argumentSeparatorOptionalComma contentForTagArgument) (space* ",")? space* contentForTagArgument = listOf<contentForNamedArgument<delimTag>, argumentSeparatorOptionalComma> completionModeContentForTagArgument = listOf<contentForNamedArgument<delimTag>, argumentSeparatorOptionalComma> (argumentSeparator? (liquidVariableLookup<delimTag>))? contentForNamedArgument<delim> = (variableSegment ("." variableSegment)*) space* ":" space* (liquidExpression<delim>) contentForType = liquidString<delimTag> liquidTagInclude = liquidTagRule<"include", liquidTagRenderMarkup> liquidTagRender = liquidTagRule<"render", liquidTagRenderMarkup> liquidTagRenderMarkup = snippetExpression renderVariableExpression? renderAliasExpression? renderArguments renderArguments = (argumentSeparatorOptionalComma tagArguments) (space* ",")? space* completionModeRenderArguments = (argumentSeparatorOptionalComma tagArguments) (space* ",")? space* (argumentSeparator? liquidVariableLookup<delimTag> space*)? snippetExpression = liquidString<delimTag> | variableSegmentAsLookup renderVariableExpression = space+ ("for" | "with") space+ liquidExpression<delimTag> renderAliasExpression = space+ "as" space+ variableSegment liquidTagOpenBaseCase = liquidTagOpenRule<blockName, tagMarkup> liquidTagOpenForm = liquidTagOpenRule<"form", liquidTagOpenFormMarkup> liquidTagOpenFormMarkup = arguments<delimTag> (space* ",")? space* liquidTagOpenFor = liquidTagOpenRule<"for", liquidTagOpenForMarkup> liquidTagOpenForMarkup = variableSegment space* "in" space* liquidExpression<delimTag> (space* "reversed")? argumentSeparatorOptionalComma tagArguments (space* ",")? space* // It's the same, the difference is support for different named arguments<delim> liquidTagOpenTablerow = liquidTagOpenRule<"tablerow", liquidTagOpenForMarkup> liquidTagOpenCase = liquidTagOpenRule<"case", liquidTagOpenCaseMarkup> liquidTagOpenCaseMarkup = liquidExpression<delimTag> space* liquidTagWhen = liquidTagRule<"when", liquidTagWhenMarkup> liquidTagWhenMarkup = nonemptyListOf<liquidExpression<delimTag>, whenMarkupSep> space* whenMarkupSep = space* ("," | "or" ~identifier) space* liquidTagOpenIf = liquidTagOpenRule<"if", liquidTagOpenConditionalMarkup> liquidTagOpenUnless = liquidTagOpenRule<"unless", liquidTagOpenConditionalMarkup> liquidTagElsif = liquidTagRule<"elsif", liquidTagOpenConditionalMarkup> liquidTagBreak = liquidTagRule<"break", empty> liquidTagContinue = liquidTagRule<"continue", empty> liquidTagElse = liquidTagRule<"else", empty> liquidTagOpenConditionalMarkup = nonemptyListOf<condition<delimTag>, conditionSeparator> space* conditionSeparator = &logicalOperator condition<delim> = logicalOperator? space* (comparison<delim> | liquidExpression<delim>) space* logicalOperator = ("and" | "or") ~identifier comparison<delim> = liquidExpression<delim> space* comparator space* liquidExpression<delim> comparator = ( "==" | "!=" | ">=" | "<=" | ">" | "<") | ("contains" ~identifier) liquidTagOpenPaginate = liquidTagOpenRule<"paginate", liquidTagOpenPaginateMarkup> liquidTagOpenPaginateMarkup = liquidExpression<delimTag> space+ "by" space+ liquidExpression<delimTag> argumentSeparatorOptionalComma tagArguments (space* ",")? space* liquidDrop = "{{" "-"? space* liquidDropCases "-"? "}}" liquidDropCases = liquidVariable<delimVO> | liquidDropBaseCase liquidDropBaseCase = anyExceptStar<delimVO> liquidInlineComment = "{%" "-"? space* "#" space? tagMarkup "-"? "%}" liquidRawTag = | liquidRawTagImpl<"raw"> | liquidRawTagImpl<"javascript"> | liquidRawTagImpl<"schema"> | liquidRawTagImpl<"stylesheet"> | liquidRawTagImpl<"style"> liquidRawTagImpl<name> = "{%" "-"? space* (name endOfIdentifier) space* tagMarkup "-"? "%}" anyExceptStar<liquidRawTagClose<name>> "{%" "-"? space* "end" (name endOfIdentifier) space* "-"? "%}" liquidRawTagClose<name> = "{%" "-"? space* "end" (name endOfIdentifier) space* "-"? "%}" liquidBlockComment = commentBlockStart (liquidBlockComment | anyExceptPlus<(commentBlockStart | commentBlockEnd)>)* commentBlockEnd commentBlockStart = "{%" "-"? space* ("comment" endOfIdentifier) space* tagMarkup "-"? "%}" commentBlockEnd = "{%" "-"? space* ("endcomment" endOfIdentifier) space* tagMarkup "-"? "%}" liquidDoc = liquidDocStart liquidDocBody liquidDocEnd liquidDocStart = "{%" "-"? space* ("doc" endOfIdentifier) space* tagMarkup "-"? "%}" liquidDocEnd = "{%" "-"? space* ("enddoc" endOfIdentifier) space* tagMarkup "-"? "%}" liquidDocBody = anyExceptSt