@shopify/cli
Version:
A CLI tool to build for the Shopify platform
35 lines (34 loc) • 205 kB
JavaScript
import{b as mo,g as Sr}from"./chunk-VPRTJUIN.js";function Co(e){return this[e<0?this.length+e:e]}function xo(e){return e!==null&&typeof e=="object"}function*To(e,t){let{getVisitorKeys:n,filter:r=()=>!0}=t,u=a=>ru(a)&&r(a);for(let a of n(e)){let o=e[a];if(Array.isArray(o))for(let i of o)u(i)&&(yield i);else u(o)&&(yield o)}}function*So(e,t){let n=[e];for(let r=0;r<n.length;r++){let u=n[r];for(let a of To(u,t))yield a,n.push(a)}}function bo(e,{getVisitorKeys:t,predicate:n}){for(let r of So(e,{getVisitorKeys:t}))if(n(r))return!0;return!1}function vo(e){return e===12288||e>=65281&&e<=65376||e>=65504&&e<=65510}function Po(e){return e>=4352&&e<=4447||e===8986||e===8987||e===9001||e===9002||e>=9193&&e<=9196||e===9200||e===9203||e===9725||e===9726||e===9748||e===9749||e>=9776&&e<=9783||e>=9800&&e<=9811||e===9855||e>=9866&&e<=9871||e===9875||e===9889||e===9898||e===9899||e===9917||e===9918||e===9924||e===9925||e===9934||e===9940||e===9962||e===9970||e===9971||e===9973||e===9978||e===9981||e===9989||e===9994||e===9995||e===10024||e===10060||e===10062||e>=10067&&e<=10069||e===10071||e>=10133&&e<=10135||e===10160||e===10175||e===11035||e===11036||e===11088||e===11093||e>=11904&&e<=11929||e>=11931&&e<=12019||e>=12032&&e<=12245||e>=12272&&e<=12287||e>=12289&&e<=12350||e>=12353&&e<=12438||e>=12441&&e<=12543||e>=12549&&e<=12591||e>=12593&&e<=12686||e>=12688&&e<=12773||e>=12783&&e<=12830||e>=12832&&e<=12871||e>=12880&&e<=42124||e>=42128&&e<=42182||e>=43360&&e<=43388||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65040&&e<=65049||e>=65072&&e<=65106||e>=65108&&e<=65126||e>=65128&&e<=65131||e>=94176&&e<=94180||e>=94192&&e<=94198||e>=94208&&e<=101589||e>=101631&&e<=101662||e>=101760&&e<=101874||e>=110576&&e<=110579||e>=110581&&e<=110587||e===110589||e===110590||e>=110592&&e<=110882||e===110898||e>=110928&&e<=110930||e===110933||e>=110948&&e<=110951||e>=110960&&e<=111355||e>=119552&&e<=119638||e>=119648&&e<=119670||e===126980||e===127183||e===127374||e>=127377&&e<=127386||e>=127488&&e<=127490||e>=127504&&e<=127547||e>=127552&&e<=127560||e===127568||e===127569||e>=127584&&e<=127589||e>=127744&&e<=127776||e>=127789&&e<=127797||e>=127799&&e<=127868||e>=127870&&e<=127891||e>=127904&&e<=127946||e>=127951&&e<=127955||e>=127968&&e<=127984||e===127988||e>=127992&&e<=128062||e===128064||e>=128066&&e<=128252||e>=128255&&e<=128317||e>=128331&&e<=128334||e>=128336&&e<=128359||e===128378||e===128405||e===128406||e===128420||e>=128507&&e<=128591||e>=128640&&e<=128709||e===128716||e>=128720&&e<=128722||e>=128725&&e<=128728||e>=128732&&e<=128735||e===128747||e===128748||e>=128756&&e<=128764||e>=128992&&e<=129003||e===129008||e>=129292&&e<=129338||e>=129340&&e<=129349||e>=129351&&e<=129535||e>=129648&&e<=129660||e>=129664&&e<=129674||e>=129678&&e<=129734||e===129736||e>=129741&&e<=129756||e>=129759&&e<=129770||e>=129775&&e<=129784||e>=131072&&e<=196605||e>=196608&&e<=262141}function No(e){if(!e)return 0;if(!wo.test(e))return e.length;e=e.replace(Bo(),n=>Io.has(n)?" ":" ");let t=0;for(let n of e){let r=n.codePointAt(0);r<=31||r>=127&&r<=159||r>=768&&r<=879||r>=65024&&r<=65039||(t+=vo(r)||Po(r)?2:1)}return t}function un(e){return(t,n,r)=>{let u=!!r?.backwards;if(n===!1)return!1;let{length:a}=t,o=n;for(;o>=0&&o<a;){let i=t.charAt(o);if(e instanceof RegExp){if(!e.test(i))return o}else if(!e.includes(i))return o;u?o--:o++}return o===-1||o===a?o:!1}}function Lo(e,t,n){let r=!!n?.backwards;if(t===!1)return!1;let u=e.charAt(t);if(r){if(e.charAt(t-1)==="\r"&&u===`
`)return t-2;if(br(u))return t-1}else{if(u==="\r"&&e.charAt(t+1)===`
`)return t+2;if(br(u))return t+1}return t}function Oo(e,t,n={}){let r=ct(e,n.backwards?t-1:t,n),u=Dt(e,r,n);return r!==u}function Jo(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let n=t+2;n<e.length;++n)if(e.charAt(n)==="*"&&e.charAt(n+1)==="/")return n+2}return t}function qo(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?Mo(e,t):t}function Xo(e,t){let n=null,r=t;for(;r!==n;)n=r,r=jo(e,r),r=Un(e,r),r=ct(e,r);return r=Gn(e,r),r=Dt(e,r),r!==!1&&ie(e,r)}function Ro(e){return Array.isArray(e)&&e.length>0}function Uo(e,t){let{preferred:n,alternate:r}=t===!0||t==="'"?Wo:$o,{length:u}=e,a=0,o=0;for(let i=0;i<u;i++){let p=e.charCodeAt(i);p===n.codePoint?a++:p===r.codePoint&&o++}return(a>o?r:n).character}function Vo(e,t){let n=t==='"'?"'":'"',r=z(0,e,Go,(u,a,o)=>a?a===n?n:u:o===t?"\\"+o:o);return t+r+t}function Ho(e,t){Qe(/^(?<quote>["']).*\k<quote>$/su.test(e));let n=e.slice(1,-1),r=t.parser==="json"||t.parser==="jsonc"||t.parser==="json5"&&t.quoteProps==="preserve"&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":ou(n,t.singleQuote);return e.charAt(0)===r?e:Ko(n,r)}function j(e){let t=e.range?.[0]??e.start,n=(e.declaration?.decorators??e.decorators)?.[0];return n?Math.min(j(n),t):t}function N(e){return e.range?.[1]??e.end}function an(e,t){let n=j(e);return iu(n)&&n===j(t)}function zo(e,t){let n=N(e);return iu(n)&&n===N(t)}function Yo(e,t){return an(e,t)&&zo(e,t)}function vt(e){if(St!==null&&typeof St.property){let t=St;return St=vt.prototype=null,t}return St=vt.prototype=e??Object.create(null),new vt}function Zo(e){return vt(e)}function ei(e,t="type"){Zo(e);function n(r){let u=r[t],a=e[u];if(!Array.isArray(a))throw Object.assign(new Error(`Missing visitor keys for '${u}'.`),{node:r});return a}return n}function ri(e){let t=new Set(e);return n=>t.has(n?.type)}function ui(e){return e.extra?.raw??e.raw}function si(e,t){let n=t.split(".");for(let r=n.length-1;r>=0;r--){let u=n[r];if(r===0)return e.type==="Identifier"&&e.name===u;if(r===1&&e.type==="MetaProperty"&&e.property.type==="Identifier"&&e.property.name===u){e=e.meta;continue}if(e.type==="MemberExpression"&&!e.optional&&!e.computed&&e.property.type==="Identifier"&&e.property.name===u){e=e.object;continue}return!1}}function pi(e,t){return t.some(n=>si(e,n))}function li({type:e}){return e.startsWith("TS")&&e.endsWith("Keyword")}function ci({node:e,parent:t}){return e?.type!=="EmptyStatement"?!1:t.type==="IfStatement"?t.consequent===e||t.alternate===e:t.type==="DoWhileStatement"||t.type==="ForInStatement"||t.type==="ForOfStatement"||t.type==="ForStatement"||t.type==="LabeledStatement"||t.type==="WithStatement"||t.type==="WhileStatement"?t.body===e:!1}function vn(e,t){return t(e)||bo(e,{getVisitorKeys:pu,predicate:t})}function zn(e){return e.type==="AssignmentExpression"||e.type==="BinaryExpression"||e.type==="LogicalExpression"||e.type==="NGPipeExpression"||e.type==="ConditionalExpression"||L(e)||R(e)||e.type==="SequenceExpression"||e.type==="TaggedTemplateExpression"||e.type==="BindExpression"||e.type==="UpdateExpression"&&!e.prefix||Fe(e)||e.type==="TSNonNullExpression"||e.type==="ChainExpression"}function Di(e){return e.expressions?e.expressions[0]:e.left??e.test??e.callee??e.object??e.tag??e.argument??e.expression}function Du(e){if(e.expressions)return["expressions",0];if(e.left)return["left"];if(e.test)return["test"];if(e.object)return["object"];if(e.callee)return["callee"];if(e.tag)return["tag"];if(e.argument)return["argument"];if(e.expression)return["expression"];throw new Error("Unexpected node has no left side.")}function di(e){return e.type==="LogicalExpression"&&e.operator==="??"}function be(e){return e.type==="NumericLiteral"||e.type==="Literal"&&typeof e.value=="number"}function mi(e){return e.type==="BooleanLiteral"||e.type==="Literal"&&typeof e.value=="boolean"}function yu(e){return e.type==="UnaryExpression"&&(e.operator==="+"||e.operator==="-")&&be(e.argument)}function Q(e){return!!(e&&(e.type==="StringLiteral"||e.type==="Literal"&&typeof e.value=="string"))}function du(e){return e.type==="RegExpLiteral"||e.type==="Literal"&&!!e.regex}function Fi(e){return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement"}function mn(e){return L(e)&&e.callee.type==="Identifier"&&["async","inject","fakeAsync","waitForAsync"].includes(e.callee.name)}function Jt(e){return e.method&&e.kind==="init"||e.kind==="get"||e.kind==="set"}function mu(e){return(e.type==="ObjectTypeProperty"||e.type==="ObjectTypeInternalSlot")&&!e.static&&!e.method&&e.kind!=="get"&&e.kind!=="set"&&e.value.type==="FunctionTypeAnnotation"}function Ei(e){return(e.type==="TypeAnnotation"||e.type==="TSTypeAnnotation")&&e.typeAnnotation.type==="FunctionTypeAnnotation"&&!e.static&&!an(e,e.typeAnnotation)}function pt(e){return R(e)||e.type==="BindExpression"&&!!e.object}function Qn(e){return cu(e)||lu(e)||Ai(e)||e.type==="GenericTypeAnnotation"&&!e.typeParameters||e.type==="TSTypeReference"&&!e.typeArguments}function gi(e){return e.type==="Identifier"&&(e.name==="beforeEach"||e.name==="beforeAll"||e.name==="afterEach"||e.name==="afterAll")}function hi(e){return Kn(e,Ci)}function on(e,t){if(e?.type!=="CallExpression"||e.optional)return!1;let n=ye(e);if(n.length===1){if(mn(e)&&on(t))return It(n[0]);if(gi(e.callee))return mn(n[0])}else if((n.length===2||n.length===3)&&(n[0].type==="TemplateLiteral"||Q(n[0]))&&hi(e.callee))return n[2]&&!be(n[2])?!1:(n.length===2?It(n[1]):Fi(n[1])&&te(n[1]).length<=1)||mn(n[1]);return!1}function Br(e,t=5){return Fu(e,t)<=t}function Fu(e,t){let n=0;for(let r in e){let u=e[r];if(ru(u)&&typeof u.type=="string"&&(n++,n+=Fu(u,t-n)),n>t)return n}return n}function Zn(e,t){let{printWidth:n}=t;if(g(e))return!1;let r=n*xi;if(e.type==="ThisExpression"||e.type==="Identifier"&&e.name.length<=r||yu(e)&&!g(e.argument))return!0;let u=e.type==="Literal"&&"regex"in e&&e.regex.pattern||e.type==="RegExpLiteral"&&e.pattern;return u?u.length<=r:Q(e)?yt(se(e),t).length<=r:e.type==="TemplateLiteral"?e.expressions.length===0&&e.quasis[0].value.raw.length<=r&&!e.quasis[0].value.raw.includes(`
`):e.type==="UnaryExpression"?Zn(e.argument,{printWidth:n}):e.type==="CallExpression"&&e.arguments.length===0&&e.callee.type==="Identifier"?e.callee.name.length<=r-2:Yn(e)}function Ee(e,t){return Y(t)?sn(t):g(t,b.Leading,n=>ie(e,N(n)))}function vr(e){return e.quasis.some(t=>t.value.raw.includes(`
`))}function Eu(e,t){return(e.type==="TemplateLiteral"&&vr(e)||e.type==="TaggedTemplateExpression"&&vr(e.quasi))&&!ie(t,j(e),{backwards:!0})}function Au(e){if(!g(e))return!1;let t=O(0,ze(e,b.Dangling),-1);return t&&!he(t)}function Ti(e){if(e.length<=1)return!1;let t=0;for(let n of e)if(It(n)){if(t+=1,t>1)return!0}else if(L(n)){for(let r of ye(n))if(It(r))return!0}return!1}function gu(e){let{node:t,parent:n,key:r}=e;return r==="callee"&&L(t)&&L(n)&&n.arguments.length>0&&t.arguments.length>n.arguments.length}function fe(e,t=2){if(t<=0)return!1;if(e.type==="ChainExpression"||e.type==="TSNonNullExpression")return fe(e.expression,t);let n=r=>fe(r,t-1);if(du(e))return lt(e.pattern??e.regex.pattern)<=5;if(Yn(e)||fi(e)||e.type==="ArgumentPlaceholder")return!0;if(e.type==="TemplateLiteral")return e.quasis.every(r=>!r.value.raw.includes(`
`))&&e.expressions.every(n);if(Ae(e))return e.properties.every(r=>!r.computed&&(r.shorthand||r.value&&n(r.value)));if(ee(e))return e.elements.every(r=>r===null||n(r));if(mt(e)){if(e.type==="ImportExpression"||fe(e.callee,t)){let r=ye(e);return r.length<=t&&r.every(n)}return!1}return R(e)?fe(e.object,t)&&fe(e.property,t):e.type==="UnaryExpression"&&Si.has(e.operator)||e.type==="UpdateExpression"?fe(e.argument,t):!1}function ke(e,t="es5"){return e.trailingComma==="es5"&&t==="es5"||e.trailingComma==="all"&&(t==="all"||t==="es5")}function ne(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return ne(e.left,t);case"MemberExpression":case"OptionalMemberExpression":return ne(e.object,t);case"TaggedTemplateExpression":return e.tag.type==="FunctionExpression"?!1:ne(e.tag,t);case"CallExpression":case"OptionalCallExpression":return e.callee.type==="FunctionExpression"?!1:ne(e.callee,t);case"ConditionalExpression":return ne(e.test,t);case"UpdateExpression":return!e.prefix&&ne(e.argument,t);case"BindExpression":return e.object&&ne(e.object,t);case"SequenceExpression":return ne(e.expressions[0],t);case"ChainExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return ne(e.expression,t);default:return t(e)}}function er(e,t){return!(Zt(t)!==Zt(e)||e==="**"||Pr[e]&&Pr[t]||t==="%"&&Gt[e]||e==="%"&&Gt[t]||t!==e&&Gt[t]&&Gt[e]||Pn[e]&&Pn[t])}function Zt(e){return bi.get(e)}function Bi(e){return!!Pn[e]||e==="|"||e==="^"||e==="&"}function vi(e){if(e.rest)return!0;let t=te(e);return O(0,t,-1)?.type==="RestElement"}function te(e){if(fn.has(e))return fn.get(e);let t=[];return e.this&&t.push(e.this),t.push(...e.params),e.rest&&t.push(e.rest),fn.set(e,t),t}function Pi(e,t){let{node:n}=e,r=0,u=()=>t(e,r++);n.this&&e.call(u,"this"),e.each(u,"params"),n.rest&&e.call(u,"rest")}function ye(e){if(Fn.has(e))return Fn.get(e);if(e.type==="ChainExpression")return ye(e.expression);let t;return e.type==="ImportExpression"||e.type==="TSImportType"?(t=[e.source],e.options&&t.push(e.options)):e.type==="TSExternalModuleReference"?t=[e.expression]:t=e.arguments,Fn.set(e,t),t}function en(e,t){let{node:n}=e;if(n.type==="ChainExpression")return e.call(()=>en(e,t),"expression");n.type==="ImportExpression"||n.type==="TSImportType"?(e.call(()=>t(e,0),"source"),n.options&&e.call(()=>t(e,1),"options")):n.type==="TSExternalModuleReference"?e.call(()=>t(e,0),"expression"):e.each(t,"arguments")}function kr(e,t){let n=[];if(e.type==="ChainExpression"&&(e=e.expression,n.push("expression")),e.type==="ImportExpression"||e.type==="TSImportType"){if(t===0||t===(e.options?-2:-1))return[...n,"source"];if(e.options&&(t===1||t===-1))return[...n,"options"];throw new RangeError("Invalid argument index")}else if(e.type==="TSExternalModuleReference"){if(t===0||t===-1)return[...n,"expression"]}else if(t<0&&(t=e.arguments.length+t),t>=0&&t<e.arguments.length)return[...n,"arguments",t];throw new RangeError("Invalid argument index")}function dt(e){return e.value.trim()==="prettier-ignore"&&!e.unignore}function sn(e){return e?.prettierIgnore||g(e,b.PrettierIgnore)}function g(e,t,n){if(!_(e?.comments))return!1;let r=Cu(t,n);return r?e.comments.some(r):!0}function ze(e,t,n){if(!Array.isArray(e?.comments))return[];let r=Cu(t,n);return r?e.comments.filter(r):e.comments}function mt(e){return L(e)||e.type==="NewExpression"||e.type==="ImportExpression"}function We(e){return e&&(e.type==="ObjectProperty"||e.type==="Property"&&!Jt(e))}function hu({key:e,parent:t}){return!(e==="types"&&Be(t)||e==="types"&&qt(t))}function xu(e,t,n){if(e.type==="Program"&&delete t.sourceType,(e.type==="BigIntLiteral"||e.type==="Literal")&&e.bigint&&(t.bigint=e.bigint.toLowerCase()),e.type==="EmptyStatement"&&!Hn({node:e,parent:n})||e.type==="JSXText"||e.type==="JSXExpressionContainer"&&(e.expression.type==="Literal"||e.expression.type==="StringLiteral")&&e.expression.value===" ")return null;if((e.type==="Property"||e.type==="ObjectProperty"||e.type==="MethodDefinition"||e.type==="ClassProperty"||e.type==="ClassMethod"||e.type==="PropertyDefinition"||e.type==="TSDeclareMethod"||e.type==="TSPropertySignature"||e.type==="ObjectTypeProperty"||e.type==="ImportAttribute")&&e.key&&!e.computed){let{key:u}=e;Q(u)||be(u)?t.key=String(u.value):u.type==="Identifier"&&(t.key=u.name)}if(e.type==="JSXElement"&&e.openingElement.name.name==="style"&&e.openingElement.attributes.some(u=>u.type==="JSXAttribute"&&u.name.name==="jsx"))for(let{type:u,expression:a}of t.children)u==="JSXExpressionContainer"&&a.type==="TemplateLiteral"&&it(a);e.type==="JSXAttribute"&&e.name.name==="css"&&e.value.type==="JSXExpressionContainer"&&e.value.expression.type==="TemplateLiteral"&&it(t.value.expression),e.type==="JSXAttribute"&&e.value?.type==="Literal"&&/["']|"|'/u.test(e.value.value)&&(t.value.value=z(0,e.value.value,/["']|"|'/gu,'"'));let r=e.expression||e.callee;if(e.type==="Decorator"&&r.type==="CallExpression"&&r.callee.name==="Component"&&r.arguments.length===1){let u=e.expression.arguments[0].properties;for(let[a,o]of t.expression.arguments[0].properties.entries())switch(u[a].key.name){case"styles":ee(o.value)&&it(o.value.elements[0]);break;case"template":o.value.type==="TemplateLiteral"&&it(o.value);break}}e.type==="TaggedTemplateExpression"&&(e.tag.type==="MemberExpression"||e.tag.type==="Identifier"&&(e.tag.name==="gql"||e.tag.name==="graphql"||e.tag.name==="css"||e.tag.name==="md"||e.tag.name==="markdown"||e.tag.name==="html")||e.tag.type==="CallExpression")&&it(t.quasi),e.type==="TemplateLiteral"&&it(t),e.type==="ChainExpression"&&e.expression.type==="TSNonNullExpression"&&(t.type="TSNonNullExpression",t.expression.type="ChainExpression")}function Oi(e,t){return Ni(e)||ji(e,t)||Mi(e,t)?!1:e.type==="EmptyStatement"?Hn({node:e,parent:t[0]}):!(Li(e,t)||e.type==="TSTypeAnnotation"&&t[0].type==="TSPropertySignature")}function qi(e){let t=e.type||e.kind||"(unknown type)",n=String(e.name||e.id&&(typeof e.id=="object"?e.id.name:e.id)||e.key&&(typeof e.key=="object"?e.key.name:e.key)||e.value&&(typeof e.value=="object"?"":String(e.value))||e.operator||"");return n.length>20&&(n=n.slice(0,19)+"\u2026"),t+(n?" "+n:"")}function tr(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=qi(e)}function V(e,t){t.leading=!0,t.trailing=!1,tr(e,t)}function le(e,t,n){t.leading=!1,t.trailing=!1,n&&(t.marker=n),tr(e,t)}function W(e,t){t.leading=!1,t.trailing=!0,tr(e,t)}function Xi(e,t){let n=null,r=t;for(;r!==n;)n=r,r=ct(e,r),r=Un(e,r),r=Gn(e,r),r=Dt(e,r);return r}function Ri(e,t){let n=Ft(e,t);return n===!1?"":e.charAt(n)}function _i(e,t,n){for(let r=t;r<n;++r)if(e.charAt(r)===`
`)return!0;return!1}function Wi(e){return En.has(e)||En.set(e,he(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/u.test(e.value)),En.get(e)}function $i(e){return[Nu,bu,ku,ts,Ki,rr,ur,Su,Bu,os,rs,us,or,Iu,is,vu,wu,ar,Hi,ds,ju,ir].some(t=>t(e))}function Ui(e){return[Vi,ku,bu,Iu,rr,ur,Su,Bu,wu,ns,as,or,ls,ar,Ds,ys,ms,ju,Fs,fs,ir].some(t=>t(e))}function Gi(e){return[Nu,rr,ur,es,vu,or,Zi,Qi,ar,cs,ir].some(t=>t(e))}function Ze(e,t){let n=(e.body||e.properties).find(({type:r})=>r!=="EmptyStatement");n?V(n,t):le(e,t)}function wn(e,t){e.type==="BlockStatement"?Ze(e,t):V(e,t)}function Vi({comment:e,followingNode:t}){return t&&Tu(e)?(V(t,e),!0):!1}function rr({comment:e,precedingNode:t,enclosingNode:n,followingNode:r,text:u}){if(n?.type!=="IfStatement"||!r)return!1;if(ge(u,N(e))===")")return W(t,e),!0;if(r.type==="BlockStatement"&&r===n.consequent&&j(e)>=N(t)&&N(e)<=j(r))return V(r,e),!0;if(t===n.consequent&&r===n.alternate){let a=Ft(u,N(n.consequent));if(r.type==="BlockStatement"&&j(e)>=a&&N(e)<=j(r))return V(r,e),!0;if(j(e)<a||n.alternate.type==="BlockStatement")return t.type==="BlockStatement"||nr(e,u)&&!ce(u,j(t),j(e))?(W(t,e),!0):(le(n,e),!0)}return r.type==="BlockStatement"?(Ze(r,e),!0):r.type==="IfStatement"?(wn(r.consequent,e),!0):n.consequent===r?(V(r,e),!0):!1}function ur({comment:e,precedingNode:t,enclosingNode:n,followingNode:r,text:u}){return n?.type!=="WhileStatement"||!r?!1:ge(u,N(e))===")"?(W(t,e),!0):r.type==="BlockStatement"?(Ze(r,e),!0):n.body===r?(V(r,e),!0):!1}function Su({comment:e,precedingNode:t,enclosingNode:n,followingNode:r}){return n?.type!=="TryStatement"&&n?.type!=="CatchClause"||!r?!1:n.type==="CatchClause"&&t?(W(t,e),!0):r.type==="BlockStatement"?(Ze(r,e),!0):r.type==="TryStatement"?(wn(r.finalizer,e),!0):r.type==="CatchClause"?(wn(r.body,e),!0):!1}function Ki({comment:e,enclosingNode:t,followingNode:n}){return R(t)&&n?.type==="Identifier"?(V(t,e),!0):!1}function Hi({comment:e,enclosingNode:t,followingNode:n,options:r}){return!r.experimentalTernaries||!(t?.type==="ConditionalExpression"||_e(t))?!1:n?.type==="ConditionalExpression"||_e(n)?(le(t,e),!0):!1}function bu({comment:e,precedingNode:t,enclosingNode:n,followingNode:r,text:u,options:a}){let o=t&&!ce(u,N(t),j(e));return(!t||!o)&&(n?.type==="ConditionalExpression"||_e(n))&&r?a.experimentalTernaries&&n.alternate===r&&!(he(e)&&!ce(a.originalText,j(e),N(e)))?(le(n,e),!0):(V(r,e),!0):!1}function Bu({comment:e,precedingNode:t,enclosingNode:n,followingNode:r}){if(zi(n)){if(_(n.decorators)&&r?.type!=="Decorator")return W(O(0,n.decorators,-1),e),!0;if(n.body&&r===n.body)return Ze(n.body,e),!0;if(r){if(n.superClass&&r===n.superClass&&t&&(t===n.id||t===n.typeParameters))return W(t,e),!0;for(let u of["implements","extends","mixins"])if(n[u]&&r===n[u][0])return t&&(t===n.id||t===n.typeParameters||t===n.superClass)?W(t,e):le(n,e,u),!0}}return!1}function vu({comment:e,precedingNode:t,enclosingNode:n,text:r}){return n&&t&&ge(r,N(e))==="("&&(n.type==="Property"||n.type==="TSDeclareMethod"||n.type==="TSAbstractMethodDefinition")&&t.type==="Identifier"&&n.key===t&&ge(r,N(t))!==":"||t?.type==="Decorator"&&Yi(n)&&(Ot(e)||e.placement==="ownLine")?(W(t,e),!0):!1}function Qi({comment:e,precedingNode:t,enclosingNode:n,text:r}){return ge(r,N(e))!=="("?!1:t&&Pu(n)?(W(t,e),!0):!1}function Zi({comment:e,enclosingNode:t,text:n}){if(t?.type!=="ArrowFunctionExpression")return!1;let r=Ft(n,N(e));return r!==!1&&n.slice(r,r+2)==="=>"?(le(t,e),!0):!1}function es({comment:e,enclosingNode:t,text:n}){return ge(n,N(e))!==")"?!1:t&&(Mu(t)&&te(t).length===0||mt(t)&&ye(t).length===0)?(le(t,e),!0):(t?.type==="MethodDefinition"||t?.type==="TSAbstractMethodDefinition")&&te(t.value).length===0?(le(t.value,e),!0):!1}function ts({comment:e,precedingNode:t,enclosingNode:n,followingNode:r,text:u}){return t?.type==="ComponentTypeParameter"&&(n?.type==="DeclareComponent"||n?.type==="ComponentTypeAnnotation")&&r?.type!=="ComponentTypeParameter"||(t?.type==="ComponentParameter"||t?.type==="RestElement")&&n?.type==="ComponentDeclaration"&&ge(u,N(e))===")"?(W(t,e),!0):!1}function ku({comment:e,precedingNode:t,enclosingNode:n,followingNode:r,text:u}){return t?.type==="FunctionTypeParam"&&n?.type==="FunctionTypeAnnotation"&&r?.type!=="FunctionTypeParam"||(t?.type==="Identifier"||t?.type==="AssignmentPattern"||t?.type==="ObjectPattern"||t?.type==="ArrayPattern"||t?.type==="RestElement"||t?.type==="TSParameterProperty")&&Mu(n)&&ge(u,N(e))===")"?(W(t,e),!0):!he(e)&&r?.type==="BlockStatement"&&Pu(n)&&(n.type==="MethodDefinition"?n.value.body:n.body)===r&&Ft(u,N(e))===j(r)?(Ze(r,e),!0):!1}function wu({comment:e,enclosingNode:t}){return t?.type==="LabeledStatement"?(V(t,e),!0):!1}function ar({comment:e,enclosingNode:t}){return(t?.type==="ContinueStatement"||t?.type==="BreakStatement")&&!t.label?(W(t,e),!0):!1}function ns({comment:e,precedingNode:t,enclosingNode:n}){return L(n)&&t&&n.callee===t&&n.arguments.length>0?(V(n.arguments[0],e),!0):!1}function rs({comment:e,precedingNode:t,enclosingNode:n,followingNode:r}){return Be(n)?(dt(e)&&(r.prettierIgnore=!0,e.unignore=!0),t?(W(t,e),!0):!1):(Be(r)&&dt(e)&&(r.types[0].prettierIgnore=!0,e.unignore=!0),!1)}function us({comment:e,precedingNode:t,enclosingNode:n,followingNode:r}){return n&&n.type==="MatchOrPattern"?(dt(e)&&(r.prettierIgnore=!0,e.unignore=!0),t?(W(t,e),!0):!1):(r&&r.type==="MatchOrPattern"&&dt(e)&&(r.types[0].prettierIgnore=!0,e.unignore=!0),!1)}function as({comment:e,enclosingNode:t}){return We(t)?(V(t,e),!0):!1}function or({comment:e,enclosingNode:t,ast:n,isLastComment:r}){return n?.body?.length===0?(r?le(n,e):V(n,e),!0):t?.type==="Program"&&t.body.length===0&&!_(t.directives)?(r?le(t,e):V(t,e),!0):!1}function os({comment:e,enclosingNode:t,followingNode:n}){return(t?.type==="ForInStatement"||t?.type==="ForOfStatement")&&n!==t.body?(V(t,e),!0):!1}function Iu({comment:e,precedingNode:t,enclosingNode:n,text:r}){if(n?.type==="ImportSpecifier"||n?.type==="ExportSpecifier")return V(n,e),!0;let u=t?.type==="ImportSpecifier"&&n?.type==="ImportDeclaration",a=t?.type==="ExportSpecifier"&&n?.type==="ExportNamedDeclaration";return(u||a)&&ie(r,N(e))?(W(t,e),!0):!1}function is({comment:e,enclosingNode:t}){return t?.type==="AssignmentPattern"?(V(t,e),!0):!1}function ls({comment:e,enclosingNode:t,followingNode:n}){return ss(t)&&n&&(ps(n)||he(e))?(V(n,e),!0):!1}function cs({comment:e,enclosingNode:t,precedingNode:n,followingNode:r,text:u}){return!r&&(t?.type==="TSMethodSignature"||t?.type==="TSDeclareFunction"||t?.type==="TSAbstractMethodDefinition")&&(!n||n!==t.returnType)&&ge(u,N(e))===";"?(W(t,e),!0):!1}function Nu({comment:e,enclosingNode:t,followingNode:n}){if(dt(e)&&t?.type==="TSMappedType"&&n===t.key)return t.prettierIgnore=!0,e.unignore=!0,!0}function ju({comment:e,precedingNode:t,enclosingNode:n}){if(n?.type==="TSMappedType"&&!t)return le(n,e),!0}function Ds({comment:e,enclosingNode:t,followingNode:n}){return!t||t.type!=="SwitchCase"||t.test||!n||n!==t.consequent[0]?!1:(n.type==="BlockStatement"&&Ot(e)?Ze(n,e):le(t,e),!0)}function ys({comment:e,precedingNode:t,enclosingNode:n,followingNode:r}){return Be(t)&&((n.type==="TSArrayType"||n.type==="ArrayTypeAnnotation")&&!r||qt(n))?(W(O(0,t.types,-1),e),!0):!1}function ds({comment:e,enclosingNode:t,precedingNode:n,followingNode:r}){if((t?.type==="ObjectPattern"||t?.type==="ArrayPattern")&&r?.type==="TSTypeAnnotation")return n?W(n,e):le(t,e),!0}function ms({comment:e,precedingNode:t,enclosingNode:n,followingNode:r,text:u}){return!r&&n?.type==="UnaryExpression"&&(t?.type==="LogicalExpression"||t?.type==="BinaryExpression")&&ce(u,j(n.argument),j(t.right))&&nr(e,u)&&!ce(u,j(t.right),j(e))?(W(t.right,e),!0):!1}function fs({enclosingNode:e,followingNode:t,comment:n}){if(e&&(e.type==="TSPropertySignature"||e.type==="ObjectTypeProperty")&&(Be(t)||qt(t)))return V(t,n),!0}function ir({enclosingNode:e,precedingNode:t,followingNode:n,comment:r,text:u}){if(Fe(e)&&t===e.expression&&!nr(r,u))return n?V(n,r):W(e,r),!0}function Fs({comment:e,enclosingNode:t,followingNode:n,precedingNode:r}){return t&&n&&r&&t.type==="ArrowFunctionExpression"&&t.returnType===r&&(r.type==="TSTypeAnnotation"||r.type==="TypeAnnotation")?(V(n,e),!0):!1}function gs(e,{parser:t}){if(t==="flow"||t==="hermes"||t==="babel-flow")return e=z(0,e,/[\s(]/gu,""),e===""||e==="/*"||e==="/*::"}function xs(e){let{key:t,parent:n}=e;if(t==="types"&&Be(n)||t==="argument"&&n.type==="JSXSpreadAttribute"||t==="expression"&&n.type==="JSXSpreadChild"||t==="superClass"&&(n.type==="ClassDeclaration"||n.type==="ClassExpression")||(t==="id"||t==="typeParameters")&&hs(n)||t==="patterns"&&n.type==="MatchOrPattern")return!0;let{node:r}=e;return sn(r)?!1:Be(r)?hu(e):!!Y(r)}function Ss(e){if(typeof e=="string")return et;if(Array.isArray(e))return Me;if(!e)return;let{type:t}=e;if(Lu.has(t))return t}function Bs(e){let t=e===null?"null":typeof e;if(t!=="string"&&t!=="object")return`Unexpected doc '${t}',
Expected it to be 'string' or 'object'.`;if(Ge(e))throw new Error("doc is valid.");let n=Object.prototype.toString.call(e);if(n!=="[object Object]")return`Unexpected doc '${n}'.`;let r=bs([...Lu].map(u=>`'${u}'`));return`Unexpected doc.type '${e.type}'.
Expected it to be ${r}.`}function Ps(e,t,n,r){let u=[e];for(;u.length>0;){let a=u.pop();if(a===Ir){n(u.pop());continue}n&&u.push(a,Ir);let o=Ge(a);if(!o)throw new Nt(a);if(t?.(a)!==!1)switch(o){case Me:case $e:{let i=o===Me?a:a.parts;for(let p=i.length,l=p-1;l>=0;--l)u.push(i[l]);break}case Se:u.push(a.flatContents,a.breakContents);break;case me:if(r&&a.expandedStates)for(let i=a.expandedStates.length,p=i-1;p>=0;--p)u.push(a.expandedStates[p]);else u.push(a.contents);break;case nt:case tt:case ut:case Oe:case at:u.push(a.contents);break;case et:case Et:case rt:case Ue:case pe:case Je:break;default:throw new Nt(a)}}}function At(e,t){if(typeof e=="string")return t(e);let n=new Map;return r(e);function r(a){if(n.has(a))return n.get(a);let o=u(a);return n.set(a,o),o}function u(a){switch(Ge(a)){case Me:return t(a.map(r));case $e:return t({...a,parts:a.parts.map(r)});case Se:return t({...a,breakContents:r(a.breakContents),flatContents:r(a.flatContents)});case me:{let{expandedStates:o,contents:i}=a;return o?(o=o.map(r),i=o[0]):i=r(i),t({...a,contents:i,expandedStates:o})}case nt:case tt:case ut:case Oe:case at:return t({...a,contents:r(a.contents)});case et:case Et:case rt:case Ue:case pe:case Je:return t(a);default:throw new Nt(a)}}}function Ou(e,t,n){let r=n,u=!1;function a(o){if(u)return!1;let i=t(o);i!==void 0&&(u=!0,r=i)}return sr(e,a),r}function ks(e){if(e.type===me&&e.break||e.type===pe&&e.hard||e.type===Je)return!0}function re(e){return Ou(e,ks,!1)}function Nr(e){if(e.length>0){let t=O(0,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function ws(e){let t=new Set,n=[];function r(a){if(a.type===Je&&Nr(n),a.type===me){if(n.push(a),t.has(a))return!1;t.add(a)}}function u(a){a.type===me&&n.pop().break&&Nr(n)}sr(e,r,u,!0)}function Is(e){return e.type===pe&&!e.hard?e.soft?"":" ":e.type===Se?e.flatContents:e}function tn(e){return At(e,Is)}function Ns(e){switch(Ge(e)){case $e:if(e.parts.every(t=>t===""))return"";break;case me:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===me&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case nt:case tt:case ut:case at:if(!e.contents)return"";break;case Se:if(!e.flatContents&&!e.breakContents)return"";break;case Me:{let t=[];for(let n of e){if(!n)continue;let[r,...u]=Array.isArray(n)?n:[n];typeof r=="string"&&typeof O(0,t,-1)=="string"?t[t.length-1]+=r:t.push(r),t.push(...u)}return t.length===0?"":t.length===1?t[0]:t}case et:case Et:case rt:case Ue:case pe:case Oe:case Je:break;default:throw new Nt(e)}return e}function pr(e){return At(e,t=>Ns(t))}function Ye(e,t=_u){return At(e,n=>typeof n=="string"?M(t,n.split(`
`)):n)}function js(e){if(e.type===pe)return!0}function Ms(e){return Ou(e,js,!1)}function In(e,t){return e.type===Oe?{...e,contents:t(e.contents)}:t(e)}function Ls(e){let t=!0;return sr(e,n=>{switch(Ge(n)){case et:if(n==="")break;case rt:case Ue:case pe:case Je:return t=!1,!1}}),t}function E(e){return ve(e),{type:tt,contents:e}}function Ce(e,t){return Js(e),ve(t),{type:nt,contents:t,n:e}}function qs(e){return Ce(Number.NEGATIVE_INFINITY,e)}function qu(e){return Ce(-1,e)}function Xs(e,t,n){ve(e);let r=e;if(t>0){for(let u=0;u<Math.floor(t/n);++u)r=E(r);r=Ce(t%n,r),r=Ce(Number.NEGATIVE_INFINITY,r)}return r}function Xu(e){return Os(e),{type:$e,parts:e}}function c(e,t={}){return ve(e),Ju(t.expandedStates,!0),{type:me,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function He(e,t){return c(e[0],{...t,expandedStates:e})}function k(e,t="",n={}){return ve(e),t!==""&&ve(t),{type:Se,breakContents:e,flatContents:t,groupId:n.groupId}}function jt(e,t){return ve(e),{type:ut,contents:e,groupId:t.groupId,negate:t.negate}}function M(e,t){ve(e),Ju(t);let n=[];for(let r=0;r<t.length;r++)r!==0&&n.push(e),n.push(t[r]);return n}function Xt(e,t){return ve(t),e?{type:Oe,label:e,contents:t}:t}function jr(e){return ve(e),{type:at,contents:e}}function Ks(e){return e===_s?$s:e===Ws?Us:Vs}function $u(e,t,n){let r=t.type===1?e.queue.slice(0,-1):[...e.queue,t],u="",a=0,o=0,i=0;for(let F of r)switch(F.type){case 0:y(),n.useTabs?p(1):l(n.tabWidth);break;case 3:{let{string:B}=F;y(),u+=B,a+=B.length;break}case 2:{let{width:B}=F;o+=1,i+=B;break}default:throw new Error(`Unexpected indent comment '${F.type}'.`)}return d(),{...e,value:u,length:a,queue:r};function p(F){u+=" ".repeat(F),a+=n.tabWidth*F}function l(F){u+=" ".repeat(F),a+=F}function y(){n.useTabs?D():d()}function D(){o>0&&p(o),m()}function d(){i>0&&l(i),m()}function m(){o=0,i=0}}function Ys(e,t,n){if(!t)return e;if(t.type==="root")return{...e,root:e};if(t===Number.NEGATIVE_INFINITY)return e.root;let r;return typeof t=="number"?t<0?r=zs:r={type:2,width:t}:r={type:3,string:t},$u(e,r,n)}function Qs(e,t){return $u(e,Hs,t)}function Zs(e){let t=0;for(let n=e.length-1;n>=0;n--){let r=e[n];if(r===" "||r===" ")t++;else break}return t}function Uu(e){let t=Zs(e);return{text:t===0?e:e.slice(0,e.length-t),count:t}}function Kt(e,t,n,r,u,a){if(n===Number.POSITIVE_INFINITY)return!0;let o=t.length,i=!1,p=[e],l="";for(;n>=0;){if(p.length===0){if(o===0)return!0;p.push(t[--o]);continue}let{mode:y,doc:D}=p.pop(),d=Ge(D);switch(d){case et:D&&(i&&(l+=" ",n-=1,i=!1),l+=D,n-=lt(D));break;case Me:case $e:{let m=d===Me?D:D.parts,F=D[Nn]??0;for(let B=m.length-1;B>=F;B--)p.push({mode:y,doc:m[B]});break}case tt:case nt:case ut:case Oe:p.push({mode:y,doc:D.contents});break;case rt:{let{text:m,count:F}=Uu(l);l=m,n+=F;break}case me:{if(a&&D.break)return!1;let m=D.break?oe:y,F=D.expandedStates&&m===oe?O(0,D.expandedStates,-1):D.contents;p.push({mode:m,doc:F});break}case Se:{let m=(D.groupId?u[D.groupId]||Te:y)===oe?D.breakContents:D.flatContents;m&&p.push({mode:y,doc:m});break}case pe:if(y===oe||D.hard)return!0;D.soft||(i=!0);break;case at:r=!0;break;case Ue:if(r)return!1;break}}return!1}function Gu(e,t){let n=Object.create(null),r=t.printWidth,u=Ks(t.endOfLine),a=0,o=[{indent:Wu,mode:oe,doc:e}],i="",p=!1,l=[],y=[],D=[],d=[],m=0;for(ws(e);o.length>0;){let{indent:S,mode:h,doc:T}=o.pop();switch(Ge(T)){case et:{let I=u!==`
`?z(0,T,`
`,u):T;I&&(i+=I,o.length>0&&(a+=lt(I)));break}case Me:for(let I=T.length-1;I>=0;I--)o.push({indent:S,mode:h,doc:T[I]});break;case Et:if(y.length>=2)throw new Error("There are too many 'cursor' in doc.");y.push(m+i.length);break;case tt:o.push({indent:Qs(S,t),mode:h,doc:T.contents});break;case nt:o.push({indent:Ys(S,T.n,t),mode:h,doc:T.contents});break;case rt:v();break;case me:switch(h){case Te:if(!p){o.push({indent:S,mode:T.break?oe:Te,doc:T.contents});break}case oe:{p=!1;let I={indent:S,mode:Te,doc:T.contents},J=r-a,H=l.length>0;if(!T.break&&Kt(I,o,J,H,n))o.push(I);else if(T.expandedStates){let q=O(0,T.expandedStates,-1);if(T.break){o.push({indent:S,mode:oe,doc:q});break}else for(let $=1;$<T.expandedStates.length+1;$++)if($>=T.expandedStates.length){o.push({indent:S,mode:oe,doc:q});break}else{let U=T.expandedStates[$],ae={indent:S,mode:Te,doc:U};if(Kt(ae,o,J,H,n)){o.push(ae);break}}}else o.push({indent:S,mode:oe,doc:T.contents});break}}T.id&&(n[T.id]=O(0,o,-1).mode);break;case $e:{let I=r-a,J=T[Nn]??0,{parts:H}=T,q=H.length-J;if(q===0)break;let $=H[J+0],U=H[J+1],ae={indent:S,mode:Te,doc:$},xe={indent:S,mode:oe,doc:$},P=Kt(ae,[],I,l.length>0,n,!0);if(q===1){P?o.push(ae):o.push(xe);break}let G={indent:S,mode:Te,doc:U},K={indent:S,mode:oe,doc:U};if(q===2){P?o.push(G,ae):o.push(K,xe);break}let Ie=H[J+2],Ke={indent:S,mode:h,doc:{...T,[Nn]:J+2}},Wt=Kt({indent:S,mode:Te,doc:[$,U,Ie]},[],I,l.length>0,n,!0);o.push(Ke),Wt?o.push(G,ae):P?o.push(K,ae):o.push(K,xe);break}case Se:case ut:{let I=T.groupId?n[T.groupId]:h;if(I===oe){let J=T.type===Se?T.breakContents:T.negate?T.contents:E(T.contents);J&&o.push({indent:S,mode:h,doc:J})}if(I===Te){let J=T.type===Se?T.flatContents:T.negate?E(T.contents):T.contents;J&&o.push({indent:S,mode:h,doc:J})}break}case at:l.push({indent:S,mode:h,doc:T.contents});break;case Ue:l.length>0&&o.push({indent:S,mode:h,doc:Ru});break;case pe:switch(h){case Te:if(T.hard)p=!0;else{T.soft||(i+=" ",a+=1);break}case oe:if(l.length>0){o.push({indent:S,mode:h,doc:T},...l.reverse()),l.length=0;break}T.literal?(i+=u,a=0,S.root&&(S.root.value&&(i+=S.root.value),a=S.root.length)):(v(),i+=u+S.value,a=S.length);break}break;case Oe:o.push({indent:S,mode:h,doc:T.contents});break;case Je:break;default:throw new Nt(T)}o.length===0&&l.length>0&&(o.push(...l.reverse()),l.length=0)}let F=D.join("")+i,B=[...d,...y];if(B.length!==2)return{formatted:F};let C=B[0];return{formatted:F,cursorNodeStart:C,cursorNodeText:F.slice(C,O(0,B,-1))};function v(){let{text:S,count:h}=Uu(i);S&&(D.push(S),m+=S.length),i="",a-=h,y.length>0&&(d.push(...y.map(T=>Math.min(T,m))),y.length=0)}}function ep(e,t,n=0){let r=0;for(let u=n;u<e.length;++u)e[u]===" "?r=r+t-r%t:r++;return r}function np(e,t){let n=e.lastIndexOf(`
`);return n===-1?0:tp(e.slice(n+1).match(/^[\t ]*/u)[0],t)}function Vu(e,t,n){let{node:r}=e;if(r.type==="TemplateLiteral"&&ip(e)){let p=ap(e,t,n);if(p)return p}let u="expressions";r.type==="TSTemplateLiteralType"&&(u="types");let a=[],o=e.map(n,u);a.push(Pe,"`");let i=0;return e.each(({index:p,node:l})=>{if(a.push(n()),l.tail)return;let{tabWidth:y}=t,D=l.value.raw,d=D.includes(`
`)?rp(D,y):i;i=d;let m=o[p],F=r[u][p],B=ce(t.originalText,N(l),j(r.quasis[p+1]));if(!B){let v=Gu(m,{...t,printWidth:Number.POSITIVE_INFINITY}).formatted;v.includes(`
`)?B=!0:m=v}B&&(g(F)||F.type==="Identifier"||R(F)||F.type==="ConditionalExpression"||F.type==="SequenceExpression"||Fe(F)||je(F))&&(m=[E([f,m]),f]);let C=d===0&&D.endsWith(`
`)?Ce(Number.NEGATIVE_INFINITY,m):Xs(m,d,y);a.push(c(["${",C,Pe,"}"]))},"quasis"),a.push("`"),a}function up(e,t,n){let r=n("quasi"),{node:u}=e,a="",o=ze(u.quasi,b.Leading)[0];return o&&(ce(t.originalText,N(u.typeArguments??u.tag),j(o))?a=f:a=" "),Xt(r.label&&{tagged:!0,...r.label},[n("tag"),n("typeArguments"),a,Pe,r])}function ap(e,t,n){let{node:r}=e,u=r.quasis[0].value.raw.trim().split(/\s*\|\s*/u);if(u.length>1||u.some(a=>a.length>0)){t.__inJestEach=!0;let a=e.map(n,"expressions");t.__inJestEach=!1;let o=a.map(D=>"${"+Gu(D,{...t,printWidth:Number.POSITIVE_INFINITY,endOfLine:"lf"}).formatted+"}"),i=[{hasLineBreak:!1,cells:[]}];for(let D=1;D<r.quasis.length;D++){let d=O(0,i,-1),m=o[D-1];d.cells.push(m),m.includes(`
`)&&(d.hasLineBreak=!0),r.quasis[D].value.raw.includes(`
`)&&i.push({hasLineBreak:!1,cells:[]})}let p=Math.max(u.length,...i.map(D=>D.cells.length)),l=Array.from({length:p}).fill(0),y=[{cells:u},...i.filter(D=>D.cells.length>0)];for(let{cells:D}of y.filter(d=>!d.hasLineBreak))for(let[d,m]of D.entries())l[d]=Math.max(l[d],lt(m));return[Pe,"`",E([A,M(A,y.map(D=>M(" | ",D.cells.map((d,m)=>D.hasLineBreak?d:d+" ".repeat(l[m]-lt(d))))))]),A,"`"]}}function op(e,t){let{node:n}=e,r=t();return g(n)&&(r=c([E([f,r]),f])),["${",r,Pe,"}"]}function lr(e,t){return e.map(()=>op(e,t),"expressions")}function Ku(e,t){return At(e,n=>typeof n=="string"?t?z(0,n,/(\\*)`/gu,"$1$1\\`"):Hu(n):n)}function Hu(e){return z(0,e,/([\\`]|\$\{)/gu,"\\$1")}function ip({node:e,parent:t}){let n=/^[fx]?(?:describe|it|test)$/u;return t.type==="TaggedTemplateExpression"&&t.quasi===e&&t.tag.type==="MemberExpression"&&t.tag.property.type==="Identifier"&&t.tag.property.name==="each"&&(t.tag.object.type==="Identifier"&&n.test(t.tag.object.name)||t.tag.object.type==="MemberExpression"&&t.tag.object.property.type==="Identifier"&&(t.tag.object.property.name==="only"||t.tag.object.property.name==="skip")&&t.tag.object.object.type==="Identifier"&&n.test(t.tag.object.object.name))}function sp(e){let t=r=>r.type==="TemplateLiteral",n=(r,u)=>We(r)&&!r.computed&&r.key.type==="Identifier"&&r.key.name==="styles"&&u==="value";return e.match(t,(r,u)=>ee(r)&&u==="elements",n,...jn)||e.match(t,n,...jn)}function pp(e){return e.match(t=>t.type==="TemplateLiteral",(t,n)=>We(t)&&!t.computed&&t.key.type==="Identifier"&&t.key.name==="template"&&n==="value",...jn)}function An(e,t){return g(e,b.Block|b.Leading,({value:n})=>n===` ${t} `)}function zu({node:e,parent:t},n){return An(e,n)||lp(t)&&An(t,n)||t.type==="ExpressionStatement"&&An(t,n)}function lp(e){return e.type==="AsConstExpression"||e.type==="TSAsExpression"&&e.typeAnnotation.type==="TSTypeReference"&&e.typeAnnotation.typeName.type==="Identifier"&&e.typeAnnotation.typeName.name==="const"}async function cp(e,t,n){let{node:r}=n,u="";for(let[p,l]of r.quasis.entries()){let{raw:y}=l.value;p>0&&(u+="@prettier-placeholder-"+(p-1)+"-id"),u+=y}let a=await e(u,{parser:"scss"}),o=lr(n,t),i=Dp(a,o);if(!i)throw new Error("Couldn't insert all the expressions");return["`",E([A,i]),f,"`"]}function Dp(e,t){if(!_(t))return e;let n=0,r=At(pr(e),u=>typeof u!="string"||!u.includes("@prettier-placeholder")?u:u.split(/@prettier-placeholder-(\d+)-id/u).map((a,o)=>o%2===0?Ye(a):(n++,t[a])));return t.length===n?r:null}function yp(e){return e.match(void 0,(t,n)=>n==="quasi"&&t.type==="TaggedTemplateExpression"&&Kn(t.tag,["css","css.global","css.resolve"]))||e.match(void 0,(t,n)=>n==="expression"&&t.type==="JSXExpressionContainer",(t,n)=>n==="children"&&t.type==="JSXElement"&&t.openingElement.name.type==="JSXIdentifier"&&t.openingElement.name.name==="style"&&t.openingElement.attributes.some(r=>r.type==="JSXAttribute"&&r.name.type==="JSXIdentifier"&&r.name.name==="jsx"))}function Ht(e){return e.type==="Identifier"&&e.name==="styled"}function Mr(e){return/^[A-Z]/u.test(e.object.name)&&e.property.name==="extend"}function dp({parent:e}){if(!e||e.type!=="TaggedTemplateExpression")return!1;let t=e.tag.type==="ParenthesizedExpression"?e.tag.expression:e.tag;switch(t.type){case"MemberExpression":return Ht(t.object)||Mr(t);case"CallExpression":return Ht(t.callee)||t.callee.type==="MemberExpression"&&(t.callee.object.type==="MemberExpression"&&(Ht(t.callee.object.object)||Mr(t.callee.object))||t.callee.object.type==="CallExpression"&&Ht(t.callee.object.callee));case"Identifier":return t.name==="css";default:return!1}}function mp({parent:e,grandparent:t}){return t?.type==="JSXAttribute"&&e.type==="JSXExpressionContainer"&&t.name.type==="JSXIdentifier"&&t.name.name==="css"}async function Fp(e,t,n){let{node:r}=n,u=r.quasis.length,a=lr(n,t),o=[];for(let i=0;i<u;i++){let p=r.quasis[i],l=i===0,y=i===u-1,D=p.value.cooked,d=D.split(`
`),m=d.length,F=a[i],B=m>2&&d[0].trim()===""&&d[1].trim()==="",C=m>2&&d[m-1].trim()===""&&d[m-2].trim()==="",v=d.every(h=>/^\s*(?:#[^\n\r]*)?$/u.test(h));if(!y&&/#[^\n\r]*$/u.test(d[m-1]))return null;let S=null;v?S=Ep(d):S=await e(D,{parser:"graphql"}),S?(S=Ku(S,!1),!l&&B&&o.push(""),o.push(S),!y&&C&&o.push("")):!l&&!y&&B&&o.push(""),F&&o.push(F)}return["`",E([A,M(A,o)]),A,"`"]}function Ep(e){let t=[],n=!1,r=e.map(u=>u.trim());for(let[u,a]of r.entries())a!==""&&(r[u-1]===""&&n?t.push([A,a]):t.push(a),n=!0);return t.length===0?null:M(A,t)}function Ap({node:e,parent:t}){return zu({node:e,parent:t},"GraphQL")||t&&(t.type==="TaggedTemplateExpression"&&(t.tag.type==="MemberExpression"&&t.tag.object.name==="graphql"&&t.tag.property.name==="experimental"||t.tag.type==="Identifier"&&(t.tag.name==="gql"||t.tag.name==="graphql"))||t.type==="CallExpression"&&t.callee.type==="Identifier"&&t.callee.name==="graphql")}async function Yu(e,t,n,r,u){let{node:a}=r,o=gn;gn=gn+1>>>0;let i=v=>`PRETTIER_HTML_PLACEHOLDER_${v}_${o}_IN_JS`,p=a.quasis.map((v,S,h)=>S===h.length-1?v.value.cooked:v.value.cooked+i(S)).join(""),l=lr(r,n),y=new RegExp(i("(\\d+)"),"gu"),D=0,d=await t(p,{parser:e,__onHtmlRoot(v){D=v.children.length}}),m=At(d,v=>{if(typeof v!="string")return v;let S=[],h=v.split(y);for(let T=0;T<h.length;T++){let I=h[T];if(T%2===0){I&&(I=Hu(I),u.__embeddedInHtml&&(I=z(0,I,/<\/(?=script\b)/giu,"<\\/")),S.push(I));continue}let J=Number(I);S.push(l[J])}return S}),F=/^\s/u.test(p)?" ":"",B=/\s$/u.test(p)?" ":"",C=u.htmlWhitespaceSensitivity==="ignore"?A:F&&B?x:null;return C?c(["`",E([C,c(m)]),C,"`"]):Xt({hug:!1},c(["`",F,D>1?E(c(m)):c(m),B,"`"]))}function gp(e){return zu(e,"HTML")||e.match(t=>t.type==="TemplateLiteral",(t,n)=>t.type==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="html"&&n==="quasi")}async function xp(e,t,n){let{node:r}=n,u=z(0,r.quasis[0].value.raw,/((?:\\\\)*)\\`/gu,(p,l)=>"\\".repeat(l.length/2)+"`"),a=Tp(u),o=a!=="";o&&(u=z(0,u,new RegExp(`^${a}`,"gmu"),""));let i=Ku(await e(u,{parser:"markdown",__inJsTemplate:!0}),!0);return["`",o?E([f,i]):[_u,qs(i)],f,"`"]}function Tp(e){let t=e.match(/^([^\S\n]*)\S/mu);return t===null?"":t[1]}function Sp({node:e,parent:t}){return t?.type==="TaggedTemplateExpression"&&e.quasis.length===1&&t.tag.type==="Identifier"&&(t.tag.name==="md"||t.tag.name==="markdown")}function Bp(e){let{node:t}=e;if(t.type!=="TemplateLiteral"||Pp(t))return;let n=bp.find(({test:r})=>r(e));if(n)return t.quasis.length===1&&t.quasis[0].value.raw.trim()===""?"``":n.print}function vp(e){return async(...t)=>{let n=await e(...t);return n&&Xt({embed:!0,...n.label},n)}}function Pp({quasis:e}){return e.some(({value:{cooked:t}})=>t===null)}function Lp(e){let t=e.match(Qu);return t?t[0].trimStart():""}function Op(e){let t=e.match(Qu)?.[0];return t==null?e:e.slice(t.length)}function Jp(e){e=z(0,e.replace(Ip,"").replace(wp,""),Mp,"$1");let t="";for(;t!==e;)t=e,e=z(0,e,jp,`
$1 $2
`);e=e.replace(Lr,"").trimEnd();let n=Object.create(null),r=z(0,e,Or,"").replace(Lr,"").trimEnd(),u;for(;u=Or.exec(e);){let a=z(0,u[2],Np,"");if(typeof n[u[1]]=="string"||Array.isArray(n[u[1]])){let o=n[u[1]];n[u[1]]=[...Zu,...Array.isArray(o)?o:[o],a]}else n[u[1]]=a}return{comments:r,pragmas:n}}function qp({comments:e="",pragmas:t={}}){let n=Object.keys(t),r=n.flatMap(a=>Jr(a,t[a])).map(a=>` * ${a}
`).join("");if(!e){if(n.length===0)return"";if(n.length===1&&!Array.isArray(t[n[0]])){let a=t[n[0]];return`/** ${Jr(n[0],a)[0]} */`}}let u=e.split(`
`).map(a=>` * ${a}`).join(`
`)+`
`;return`/**
`+(e?u:"")+(e&&n.length>0?` *
`:"")+r+" */"}function Jr(e,t){return[...Zu,...Array.isArray(t)?t:[t]].map(n=>`@${e} ${n}`.trim())}function Rp(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(`
`);return t===-1?e:e.slice(0,t)}function Wp(e){let t=_p(e);t&&(e=e.slice(t.length+1));let n=Lp(e),{pragmas:r,comments:u}=Jp(n);return{shebang:t,text:e,pragmas:r,comments:u}}function $p(e){let{shebang:t,text:n,pragmas:r,comments:u}=Wp(e),a=Op(n),o=qp({pragmas:{[Xp]:"",...r},comments:u.trimStart()});return(t?`${t}
`:"")+o+(a.startsWith(`
`)?`
`:`
`)+a}function Up(e){if(!he(e))return!1;let t=`*${e.value}*`.split(`
`);return t.length>1&&t.every(n=>n.trimStart()[0]==="*")}function Gp(e){return Cn.has(e)||Cn.set(e,Up(e)),Cn.get(e)}function Kp(e,t){let n=e.node;if(Ot(n))return t.originalText.slice(j(n),N(n)).trimEnd();if(Vp(n))return Hp(n);if(he(n))return["/*",Ye(n.value),"*/"];throw new Error("Not a comment: "+JSON.stringify(n))}function Hp(e){let t=e.value.split(`
`);return["/*",M(A,t.map((n,r)=>r===0?n.trimEnd():" "+(r<t.length-1?n.trim():n.trimStart()))),"*/"]}function Mn(e,t){if(e.isRoot)return!1;let{node:n,key:r,parent:u}=e;if(t.__isInHtmlInterpolation&&!t.bracketSpacing&&Zp(n)&&Bt(e))return!0;if(zp(n))return!1;if(n.type==="Identifier"){if(n.extra?.parenthesized&&/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/u.test(n.name)||r==="left"&&(n.name==="async"&&!u.await||n.name==="let")&&u.type==="ForOfStatement")return!0;if(n.name==="let"){let a=e.findAncestor(o=>o.type==="ForOfStatement")?.left;if(a&&ne(a,o=>o===n))return!0}if(r==="object"&&n.name==="let"&&u.type==="MemberExpression"&&u.computed&&!u.optional){let a=e.findAncestor(i=>i.type==="ExpressionStatement"||i.type==="ForStatement"||i.type==="ForInStatement"),o=a?a.type==="ExpressionStatement"?a.expression:a.type==="ForStatement"?a.init:a.left:void 0;if(o&&ne(o,i=>i===n))return!0}if(r==="expression")switch(n.name){case"await":case"interface":case"module":case"using":case"yield":case"let":case"component":case"hook":case"type":{let a=e.findAncestor(o=>!Fe(o));if(a!==u&&a.type==="ExpressionStatement")return!0}}return!1}if(n.type==="ObjectExpression"||n.type==="FunctionExpression"||n.type==="ClassExpression"||n.type==="DoExpression"){let a=e.findAncestor(o=>o.type==="ExpressionStatement")?.expression;if(a&&ne(a,o=>o===n))return!0}if(n.type==="ObjectExpression"){let a=e.findAncestor(o=>o.type==="ArrowFunctionExpression")?.body;if(a&&a.type!=="SequenceExpression"&&a.type!=="AssignmentExpression"&&ne(a,o=>o===n))return!0}switch(u.type){case"ParenthesizedExpression":return!1;case"ClassDeclaration":case"ClassExpression":if(r==="superClass"&&(n.type==="ArrowFunctionExpression"||n.type==="AssignmentExpression"||n.type==="AwaitExpression"||n.type==="BinaryExpression"||n.type==="ConditionalExpression"||n.type==="LogicalExpression"||n.type==="NewExpression"||n.type==="ObjectExpression"||n.type==="SequenceExpression"||n.type==="TaggedTemplateExpression"||n.type==="UnaryExpression"||n.type==="UpdateExpression"||n.type==="YieldExpression"||n.type==="TSNonNullExpression"||n.type==="ClassExpression"&&_(n.decorators)))return!0;break;case"ExportDefaultDeclaration":return ea(e,t)||n.type==="SequenceExpression";case"Decorator":if(r==="expression"&&!tl(n))return!0;break;case"TypeAnnotation":if(e.match(void 0,void 0,(a,o)=>o==="returnType"&&a.type==="ArrowFunctionExpression")&&Qp(n))return!0;break;case"BinaryExpression":if(r==="left"&&(u.operator==="in"||u.operator==="instanceof")&&n.type==="UnaryExpression")return!0;break;case"VariableDeclarator":if(r==="init"&&e.match(void 0,void 0,(a,o)=>o==="declarations"&&a.type==="VariableDeclaration",(a,o)=>o==="left"&&a.type==="ForInStatement"))return!0;break}switch(n.type){case"UpdateExpression":if(u.type==="UnaryExpression")return n.prefix&&(n.operator==="++"&&u.operator==="+"||n.operator==="--"&&u.operator==="-");case"UnaryExpression":switch(u.type){case"UnaryExpression":return n.operator===u.operator&&(n.operator==="+"||n.operator==="-");case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return r==="object";case"TaggedTemplateExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return r==="callee";case"BinaryExpression":return r==="left"&&u.operator==="**";case"TSNonNullExpression":return!0;default:return!1}case"BinaryExpression":if(u.type==="UpdateExpression"||n.operator==="in"&&Yp(e))return!0;if(n.operator==="|>"&&n.extra?.parenthesized){let a=e.grandparent;if(a.type==="BinaryExpression"&&a.operator==="|>")return!0}case"TSTypeAssertion":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"LogicalExpression":switch(u.type){case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return!Fe(n);case"ConditionalExpression":return Fe(n)||di(n);case"CallExpression":case"NewExpression":case"OptionalCallExpression":return r==="callee";case"ClassExpression":case"ClassDeclaration":return r==="superClass";case"TSTypeAssertion":case"TaggedTemplateExpression":case"UnaryExpression":case"JSXSpreadAttribute":case"SpreadElement":case"BindExpression":case"AwaitExpression":case"TSNonNullExpression":case"UpdateExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return r==="object";case"AssignmentExpression":case"AssignmentPattern":return r==="left"&&(n.type==="TSTypeAssertion"||Fe(n));case"LogicalExpression":if(n.type==="