tildefriends/deps/prettier/estree.mjs

37 lines
190 KiB
JavaScript
Raw Permalink Normal View History

var Ma=Object.create;var On=Object.defineProperty;var ja=Object.getOwnPropertyDescriptor;var Ra=Object.getOwnPropertyNames;var Ja=Object.getPrototypeOf,qa=Object.prototype.hasOwnProperty;var Wa=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Tr=(e,t)=>{for(var r in t)On(e,r,{get:t[r],enumerable:!0})},Na=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ra(t))!qa.call(e,s)&&s!==r&&On(e,s,{get:()=>t[s],enumerable:!(n=ja(t,s))||n.enumerable});return e};var Ga=(e,t,r)=>(r=e!=null?Ma(Ja(e)):{},Na(t||!e||!e.__esModule?On(r,"default",{value:e,enumerable:!0}):r,e));var Ys=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)};var it=(e,t,r)=>(Ys(e,t,"read from private field"),r?r.call(e):t.get(e)),Xs=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},Vs=(e,t,r,n)=>(Ys(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r);var yi=Wa(Pt=>{"use strict";Object.defineProperty(Pt,"__esModule",{value:!0});Pt.extract=Zp;Pt.parse=tc;Pt.parseWithComments=Di;Pt.print=rc;Pt.strip=ec;var $p=/\*\/$/,Hp=/^\/\*\*?/,li=/^\s*(\/\*\*?(.|\r?\n)*?\*\/)/,Kp=/(^|\s+)\/\/([^\r\n]*)/g,oi=/^(\r?\n)+/,zp=/(?:^|\r?\n) *(@[^\r\n]*?) *\r?\n *(?![^@\r\n]*\/\/[^]*)([^@\r\n\s][^@\r\n]+?) *\r?\n/g,pi=/(?:^|\r?\n) *@(\S+) *([^\r\n]*)/g,Qp=/(\r?\n|^) *\* ?/g,mi=[];function Zp(e){let t=e.match(li);return t?t[0].trimLeft():""}function ec(e){let t=e.match(li);return t&&t[0]?e.substring(t[0].length):e}function tc(e){return Di(e).pragmas}function Di(e){let t=`
`;e=e.replace(Hp,"").replace($p,"").replace(Qp,"$1");let r="";for(;r!==e;)r=e,e=e.replace(zp,`${t}$1 $2${t}`);e=e.replace(oi,"").trimRight();let n=Object.create(null),s=e.replace(pi,"").replace(oi,"").trimRight(),u;for(;u=pi.exec(e);){let i=u[2].replace(Kp,"");typeof n[u[1]]=="string"||Array.isArray(n[u[1]])?n[u[1]]=mi.concat(n[u[1]],i):n[u[1]]=i}return{comments:s,pragmas:n}}function rc({comments:e="",pragmas:t={}}){let r=`
`,n="/**",s=" *",u=" */",i=Object.keys(t),a=i.flatMap(p=>ci(p,t[p])).map(p=>`${s} ${p}${r}`).join("");if(!e){if(i.length===0)return"";if(i.length===1&&!Array.isArray(t[i[0]])){let p=t[i[0]];return`${n} ${ci(i[0],p)[0]}${u}`}}let o=e.split(r).map(p=>`${s} ${p}`).join(r)+r;return n+r+(e?o:"")+(e&&i.length?s+r:"")+a+u}function ci(e,t){return mi.concat(t).map(r=>`@${e} ${r}`.trim())}});var qs={};Tr(qs,{languages:()=>rm,options:()=>La,printers:()=>tm});var $s=[{linguistLanguageId:183,name:"JavaScript",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:["js","node"],extensions:[".js","._js",".bones",".cjs",".es",".es6",".frag",".gs",".jake",".javascript",".jsb",".jscad",".jsfl",".jslib",".jsm",".jspre",".jss",".mjs",".njs",".pac",".sjs",".ssjs",".xsjs",".xsjslib",".wxs"],filenames:["Jakefile"],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell","zx"],parsers:["babel","acorn","espree","meriyah","babel-flow","babel-ts","flow","typescript"],vscodeLanguageIds:["javascript","mongo"]},{linguistLanguageId:183,name:"Flow",type:"programming",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",color:"#f1e05a",aliases:[],extensions:[".js.flow"],filenames:[],interpreters:["chakra","d8","gjs","js","node","nodejs","qjs","rhino","v8","v8-shell"],parsers:["flow","babel-flow"],vscodeLanguageIds:["javascript"]},{linguistLanguageId:183,name:"JSX",type:"programming",tmScope:"source.js.jsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",color:void 0,aliases:void 0,extensions:[".jsx"],filenames:void 0,interpreters:void 0,parsers:["babel","babel-flow","babel-ts","flow","typescript","espree","meriyah"],vscodeLanguageIds:["javascriptreact"],group:"JavaScript"},{linguistLanguageId:378,name:"TypeScript",type:"programming",color:"#3178c6",aliases:["ts"],interpreters:["deno","ts-node"],extensions:[".ts",".cts",".mts"],tmScope:"source.ts",aceMode:"typescript",codemirrorMode:"javascript",codemirrorMimeType:"application/typescript",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescript"]},{linguistLanguageId:94901924,name:"TSX",type:"programming",color:"#3178c6",group:"TypeScript",extensions:[".tsx"],tmScope:"source.tsx",aceMode:"javascript",codemirrorMode:"jsx",codemirrorMimeType:"text/jsx",parsers:["typescript","babel-ts"],vscodeLanguageIds:["typescriptreact"]}];var Rs={};Tr(Rs,{canAttachComment:()=>Fp,embed:()=>ai,experimentalFeatures:()=>Hl,getCommentChildNodes:()=>Cp,getVisitorKeys:()=>Br,handleComments:()=>ns,insertPragma:()=>Ei,isBlockComment:()=>ee,isGap:()=>Ap,massageAstNode:()=>Bu,print:()=>Sa,printComment:()=>Mu,willPrintOwnComments:()=>ss});var Ua=(e,t,r,n)=>{if(!(e&&t==null))return t.replaceAll?t.replaceAll(r,n):r.global?t.replace(r,n):t.split(r).join(n)},H=Ua;var Ya=(e,t,r)=>{if(!(e&&t==null))return Array.isArray(t)||typeof t=="string"?t[r<0?t.length+r:r]:t.at(r)},v=Ya;var Xa=/^[\$A-Z_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B
`)return t-2;if(s===`
`||s==="\r"||s==="\u2028"||s==="\u2029")return t-1}else{if(s==="\r"&&e.charAt(t+1)===`
`)return t+2;if(s===`
`||s==="\r"||s==="\u2028"||s==="\u2029")return t+1}return t}var qe=Za;function eo(e,t,r={}){let n=Je(e,r.backwards?t-1:t,r),s=qe(e,n,r);return n!==s}var Z=eo;function to(e,t){if(t===!1)return!1;if(e.charAt(t)==="/"&&e.charAt(t+1)==="*"){for(let r=t+2;r<e.length;++r)if(e.charAt(r)==="*"&&e.charAt(r+1)==="/")return r+2}return t}var Ot=to;function ro(e,t){return t===!1?!1:e.charAt(t)==="/"&&e.charAt(t+1)==="/"?nu(e,t):t}var vt=ro;function no(e,t){let r=null,n=t;for(;n!==r;)r=n,n=ru(e,n),n=Ot(e,n),n=Je(e,n);return n=vt(e,n),n=qe(e,n),n!==!1&&Z(e,n)}var _t=no;function so(e){return Array.isArray(e)&&e.length>0}var L=so;var gr="'",su='"';function uo(e,t){let r=t===!0||t===gr?gr:su,n=r===gr?su:gr,s=0,u=0;for(let i of e)i===r?s++:i===n&&u++;return s>u?n:r}var hr=uo;function io(e,t,r){let n=t==='"'?"'":'"',u=H(!1,e,/\\(.)|(["'])/gs,(i,a,o)=>a===n?a:o===t?"\\"+o:o||(r&&/^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/.test(a)?a:"\\"+a));return t+u+t}var uu=io;function ao(e,t){let r=e.slice(1,-1),n=t.parser==="json"||t.parser==="jsonc"||t.parser==="json5"&&t.quoteProps==="preserve"&&!t.singleQuote?'"':t.__isInHtmlAttribute?"'":hr(r,t.singleQuote);return uu(r,n,!(t.parser==="css"||t.parser==="less"||t.parser==="scss"||t.__embeddedInHtml))}var at=ao;function j(e){var n,s,u;let t=((n=e.range)==null?void 0:n[0])??e.start,r=(u=((s=e.declaration)==null?void 0:s.decorators)??e.decorators)==null?void 0:u[0];return r?Math.min(j(r),t):t}function I(e){var t;return((t=e.range)==null?void 0:t[1])??e.end}function gt(e,t){let r=j(e);return Number.isInteger(r)&&r===j(t)}function oo(e,t){let r=I(e);return Number.isInteger(r)&&r===I(t)}function iu(e,t){return gt(e,t)&&oo(e,t)}var Qt=null;function Zt(e){if(Qt!==null&&typeof Qt.property){let t=Qt;return Qt=Zt.prototype=null,t}return Qt=Zt.prototype=e??Object.create(null),new Zt}var po=10;for(let e=0;e<=po;e++)Zt();function vn(e){return Zt(e)}function co(e,t="type"){vn(e);function r(n){let s=n[t],u=e[s];if(!Array.isArray(u))throw Object.assign(new Error(`Missing visitor keys for '${s}'.`),{node:n});return u}return r}var Sr=co;var au={ArrayExpression:["elements"],AssignmentExpression:["left","right"],BinaryExpression:["left","right"],InterpreterDirective:[],Directive:["value"],DirectiveLiteral:[],BlockStatement:["directives","body"],BreakStatement:["label"],CallExpression:["callee","arguments","typeParameters","typeArguments"],CatchClause:["param","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DoWhileStatement:["test","body"],EmptyStatement:[],ExpressionStatement:["expression"],File:["program"],ForInStatement:["left","right","body"],ForStatement:["init","test","update","body"],FunctionDeclaration:["id","params","body","returnType","typeParameters","predicate"],FunctionExpression:["id","params","body","returnType","typeParameters"],Identifier:["typeAnnotation","decorators"],IfStatement:["test","consequent","alternate"],LabeledStatement:["label","body"],StringLiteral:[],NumericLiteral:[],NullLiteral:[],BooleanLiteral:[],RegExpLiteral:[],LogicalExpression:["left","right"],MemberExpression:["object","property"],NewExpression:["callee","arguments","typeParameters","typeArguments"],Program:["directives","body"],ObjectExpression:["properties"],ObjectMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectProperty:["key","value","decorators"],RestElement:["argument","typeAnnotation","decorators"],ReturnStatement:["argument"],SequenceExpression:["expressions"],ParenthesizedExpression:["expression"],SwitchCase:["test","consequent"],SwitchStatement:["discriminant","cases"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],AssignmentPattern:["left","right","decorators","typeAnnotation"],ArrayPattern:["elements","typeAnnotation","decorators"],ArrowFunctionExpression:["params","body","returnType","typeParameter
`):e.type==="UnaryExpression"?nr(e.argument,{printWidth:r}):e.type==="CallExpression"&&e.arguments.length===0&&e.callee.type==="Identifier"?e.callee.name.length<=n-2:rr(e)}function we(e,t){return U(t)?Bt(t):A(t,x.Leading,r=>Z(e,I(r)))}function Gn(e,t){return t.parser!=="json"&&t.parser!=="jsonc"&&te(e.key)&&De(e.key).slice(1,-1)===e.key.value&&(Hs(e.key.value)&&!(t.parser==="babel-ts"&&e.type==="ClassProperty"||t.parser==="typescript"&&e.type==="PropertyDefinition")||Un(e.key.value)&&String(Number(e.key.value))===e.key.value&&(t.parser==="babel"||t.parser==="acorn"||t.parser==="espree"||t.parser==="meriyah"||t.parser==="__babel_estree"))}function Un(e){return/^(?:\d+|\d+\.\d+)$/.test(e)}function pu(e){return e.quasis.some(t=>t.value.raw.includes(`
`))}function wr(e,t){return(e.type==="TemplateLiteral"&&pu(e)||e.type==="TaggedTemplateExpression"&&pu(e.quasi))&&!Z(t,j(e),{backwards:!0})}function Or(e){if(!A(e))return!1;let t=v(!1,ot(e,x.Dangling),-1);return t&&!ee(t)}function Au(e){if(e.length<=1)return!1;let t=0;for(let r of e)if(Mt(r)){if(t+=1,t>1)return!0}else if(w(r)){for(let n of ae(r))if(Mt(n))return!0}return!1}function vr(e){let{node:t,parent:r,key:n}=e;return n==="callee"&&w(t)&&w(r)&&r.arguments.length>0&&t.arguments.length>r.arguments.length}var So=new Set(["!","-","+","~"]);function be(e,t=2){if(t<=0)return!1;if(e.type==="ChainExpression"||e.type==="TSNonNullExpression")return be(e.expression,t);let r=n=>be(n,t-1);if(Wn(e))return Ze(e.pattern??e.regex.pattern)<=5;if(rr(e)||Du(e)||e.type==="ArgumentPlaceholder")return!0;if(e.type==="TemplateLiteral")return e.quasis.every(n=>!n.value.raw.includes(`
`))&&e.expressions.every(r);if(se(e))return e.properties.every(n=>!n.computed&&(n.shorthand||n.value&&r(n.value)));if(G(e))return e.elements.every(n=>n===null||r(n));if(pt(e)){if(e.type==="ImportExpression"||be(e.callee,t)){let n=ae(e);return n.length<=t&&n.every(r)}return!1}return q(e)?be(e.object,t)&&be(e.property,t):e.type==="UnaryExpression"&&So.has(e.operator)||e.type==="UpdateExpression"?be(e.argument,t):!1}function De(e){var t;return((t=e.extra)==null?void 0:t.raw)??e.raw}function du(e){return e}function ye(e,t="es5"){return e.trailingComma==="es5"&&t==="es5"||e.trailingComma==="all"&&(t==="all"||t==="es5")}function ie(e,t){switch(e.type){case"BinaryExpression":case"LogicalExpression":case"AssignmentExpression":case"NGPipeExpression":return ie(e.left,t);case"MemberExpression":case"OptionalMemberExpression":return ie(e.object,t);case"TaggedTemplateExpression":return e.tag.type==="FunctionExpression"?!1:ie(e.tag,t);case"CallExpression":case"OptionalCallExpression":return e.callee.type==="FunctionExpression"?!1:ie(e.callee,t);case"ConditionalExpression":return ie(e.test,t);case"UpdateExpression":return!e.prefix&&ie(e.argument,t);case"BindExpression":return e.object&&ie(e.object,t);case"SequenceExpression":return ie(e.expressions[0],t);case"ChainExpression":case"TSSatisfiesExpression":case"TSAsExpression":case"TSNonNullExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return ie(e.expression,t);default:return t(e)}}var cu={"==":!0,"!=":!0,"===":!0,"!==":!0},kr={"*":!0,"/":!0,"%":!0},Jn={">>":!0,">>>":!0,"<<":!0};function sr(e,t){return!(er(t)!==er(e)||e==="**"||cu[e]&&cu[t]||t==="%"&&kr[e]||e==="%"&&kr[t]||t!==e&&kr[t]&&kr[e]||Jn[e]&&Jn[t])}var Bo=new Map([["|>"],["??"],["||"],["&&"],["|"],["^"],["&"],["==","===","!=","!=="],["<",">","<=",">=","in","instanceof"],[">>","<<",">>>"],["+","-"],["*","/","%"],["**"]].flatMap((e,t)=>e.map(r=>[r,t])));function er(e){return Bo.get(e)}function Tu(e){return!!Jn[e]||e==="|"||e==="^"||e==="&"}function xu(e){var r;if(e.rest)return!0;let t=$(e);return((r=v(!1,t,-1))==null?void 0:r.type)==="RestElement"}var Mn=new WeakMap;function $(e){if(Mn.has(e))return Mn.get(e);let t=[];return e.this&&t.push(e.this),Array.isArray(e.parameters)?t.push(...e.parameters):Array.isArray(e.params)&&t.push(...e.params),e.rest&&t.push(e.rest),Mn.set(e,t),t}function gu(e,t){let{node:r}=e,n=0,s=u=>t(u,n++);r.this&&e.call(s,"this"),Array.isArray(r.parameters)?e.each(s,"parameters"):Array.isArray(r.params)&&e.each(s,"params"),r.rest&&e.call(s,"rest")}var jn=new WeakMap;function ae(e){if(jn.has(e))return jn.get(e);if(e.type==="ChainExpression")return ae(e.expression);let t=e.arguments;return e.type==="ImportExpression"&&(t=[e.source],e.attributes&&t.push(e.attributes),e.options&&t.push(e.options)),jn.set(e,t),t}function ur(e,t){let{node:r}=e;if(r.type==="ChainExpression")return e.call(()=>ur(e,t),"expression");r.type==="ImportExpression"?(e.call(n=>t(n,0),"source"),r.attributes&&e.call(n=>t(n,1),"attributes"),r.options&&e.call(n=>t(n,1),"options")):e.each(t,"arguments")}function Yn(e,t){let r=[];if(e.type==="ChainExpression"&&r.push("expression"),e.type==="ImportExpression"){if(t===0||t===(e.attributes||e.options?-2:-1))return[...r,"source"];if(e.attributes&&(t===1||t===-1))return[...r,"attributes"];if(e.options&&(t===1||t===-1))return[...r,"options"];throw new RangeError("Invalid argument index")}if(t<0&&(t=e.arguments.length+t),t<0||t>=e.arguments.length)throw new RangeError("Invalid argument index");return[...r,"arguments",t]}function ir(e){return e.value.trim()==="prettier-ignore"&&!e.unignore}function Bt(e){return(e==null?void 0:e.prettierIgnore)||A(e,x.PrettierIgnore)}var x={Leading:2,Trailing:4,Dangling:8,Block:16,Line:32,PrettierIgnore:64,First:128,Last:256},hu=(e,t)=>{if(typeof e=="function"&&(t=e,e=0),e||t)return(r,n,s)=>!(e&x.Leading&&!r.leading||e&x.Trailing&&!r.trailing||e&x.Dangling&&(r.leading||r.trailing)||e&x.Block&&!ee(r)||e&x.Line&&!Rt(r)||e&x.First&&n!==0||e&x.Last&&n!==s.length-1||e&x.PrettierIgnore&&!ir(r)||t&&!t(r))};function A(e,t,r){if(!L(e==null?void 0:e
Expected it to be 'string' or 'object'.`;if(nt(e))throw new Error("doc is valid.");let r=Object.prototype.toString.call(e);if(r!=="[object Object]")return`Unexpected doc '${r}'.`;let n=ko([...Mr].map(s=>`'${s}'`));return`Unexpected doc.type '${e.type}'.
Expected it to be ${n}.`}var Xn=class extends Error{name="InvalidDocError";constructor(t){super(Io(t)),this.doc=t}},Ft=Xn;var bu={};function Lo(e,t,r,n){let s=[e];for(;s.length>0;){let u=s.pop();if(u===bu){r(s.pop());continue}r&&s.push(u,bu);let i=nt(u);if(!i)throw new Ft(u);if((t==null?void 0:t(u))!==!1)switch(i){case Ne:case de:{let a=i===Ne?u:u.parts;for(let o=a.length,p=o-1;p>=0;--p)s.push(a[p]);break}case xe:s.push(u.flatContents,u.breakContents);break;case pe:if(n&&u.expandedStates)for(let a=u.expandedStates.length,o=a-1;o>=0;--o)s.push(u.expandedStates[o]);else s.push(u.contents);break;case Ue:case Ge:case Ye:case Oe:case Xe:s.push(u.contents);break;case et:case tt:case rt:case Ve:case ce:case ve:break;default:throw new Ft(u)}}}var Vn=Lo;var Pu=()=>{},$e=Pu,jr=Pu;function E(e){return $e(e),{type:Ge,contents:e}}function ge(e,t){return $e(t),{type:Ue,contents:t,n:e}}function D(e,t={}){return $e(e),jr(t.expandedStates,!0),{type:pe,id:t.id,contents:e,break:!!t.shouldBreak,expandedStates:t.expandedStates}}function ku(e){return ge(Number.NEGATIVE_INFINITY,e)}function Rr(e){return ge(-1,e)}function He(e,t){return D(e[0],{...t,expandedStates:e})}function Wt(e){return jr(e),{type:de,parts:e}}function b(e,t="",r={}){return $e(e),t!==""&&$e(t),{type:xe,breakContents:e,flatContents:t,groupId:r.groupId}}function Ct(e,t){return $e(e),{type:Ye,contents:e,groupId:t.groupId,negate:t.negate}}function $n(e){return $e(e),{type:Xe,contents:e}}var ke={type:Ve},Ee={type:ve};var Hn={type:ce,hard:!0},wo={type:ce,hard:!0,literal:!0},d={type:ce},F={type:ce,soft:!0},C=[Hn,Ee],Jr=[wo,Ee],Kn={type:tt};function P(e,t){$e(e),jr(t);let r=[];for(let n=0;n<t.length;n++)n!==0&&r.push(e),r.push(t[n]);return r}function Iu(e,t,r){$e(e);let n=e;if(t>0){for(let s=0;s<Math.floor(t/r);++s)n=E(n);n=ge(t%r,n),n=ge(Number.NEGATIVE_INFINITY,n)}return n}function st(e,t){return $e(t),e?{type:Oe,label:e,contents:t}:t}var qr=e=>{if(Array.isArray(e))return e;if(e.type!==de)throw new Error(`Expect doc to be 'array' or '${de}'.`);return e.parts};function ct(e,t){if(typeof e=="string")return t(e);let r=new Map;return n(e);function n(u){if(r.has(u))return r.get(u);let i=s(u);return r.set(u,i),i}function s(u){switch(nt(u)){case Ne:return t(u.map(n));case de:return t({...u,parts:u.parts.map(n)});case xe:return t({...u,breakContents:n(u.breakContents),flatContents:n(u.flatContents)});case pe:{let{expandedStates:i,contents:a}=u;return i?(i=i.map(n),a=i[0]):a=n(a),t({...u,contents:a,expandedStates:i})}case Ue:case Ge:case Ye:case Oe:case Xe:return t({...u,contents:n(u.contents)});case et:case tt:case rt:case Ve:case ce:case ve:return t(u);default:throw new Ft(u)}}}function wu(e,t,r){let n=r,s=!1;function u(i){if(s)return!1;let a=t(i);a!==void 0&&(s=!0,n=a)}return Vn(e,u),n}function Oo(e){if(e.type===pe&&e.break||e.type===ce&&e.hard||e.type===ve)return!0}function re(e){return wu(e,Oo,!1)}function Lu(e){if(e.length>0){let t=v(!1,e,-1);!t.expandedStates&&!t.break&&(t.break="propagated")}return null}function Ou(e){let t=new Set,r=[];function n(u){if(u.type===ve&&Lu(r),u.type===pe){if(r.push(u),t.has(u))return!1;t.add(u)}}function s(u){u.type===pe&&r.pop().break&&Lu(r)}Vn(e,n,s,!0)}function vo(e){return e.type===ce&&!e.hard?e.soft?"":" ":e.type===xe?e.flatContents:e}function ar(e){return ct(e,vo)}function _o(e){switch(nt(e)){case de:if(e.parts.every(t=>t===""))return"";break;case pe:if(!e.contents&&!e.id&&!e.break&&!e.expandedStates)return"";if(e.contents.type===pe&&e.contents.id===e.id&&e.contents.break===e.break&&e.contents.expandedStates===e.expandedStates)return e.contents;break;case Ue:case Ge:case Ye:case Xe:if(!e.contents)return"";break;case xe:if(!e.flatContents&&!e.breakContents)return"";break;case Ne:{let t=[];for(let r of e){if(!r)continue;let[n,...s]=Array.isArray(r)?r:[r];typeof n=="string"&&typeof v(!1,t,-1)=="string"?t[t.length-1]+=n:t.push(n),t.push(...s)}return t.length===0?"":t.length===1?t[0]:t}case et:case tt:case rt:case Ve:case ce:case Oe:case ve:break;default:throw new Ft(e)}return e}function Nt(e){return ct(e,t=>_o(t))}function Ie(e,t=Jr){return ct(e,r=>
`)):r)}function Mo(e){if(e.type===ce)return!0}function vu(e){return wu(e,Mo,!1)}function or(e,t){return e.type===Oe?{...e,contents:t(e.contents)}:t(e)}function jo(e){let t=`*${e.value}*`.split(`
`);return t.length>1&&t.every(r=>r.trimStart()[0]==="*")}var _u=jo;function Mu(e,t){let r=e.node;if(Rt(r))return t.originalText.slice(j(r),I(r)).trimEnd();if(ee(r))return _u(r)?Ro(r):["/*",Ie(r.value),"*/"];throw new Error("Not a comment: "+JSON.stringify(r))}function Ro(e){let t=e.value.split(`
`);return["/*",P(C,t.map((r,n)=>n===0?r.trimEnd():" "+(n<t.length-1?r.trim():r.trimStart()))),"*/"]}var ns={};Tr(ns,{endOfLine:()=>Yo,ownLine:()=>Uo,remaining:()=>Xo});function Jo(e){let t=e.type||e.kind||"(unknown type)",r=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 r.length>20&&(r=r.slice(0,19)+"\u2026"),t+(r?" "+r:"")}function zn(e,t){(e.comments??(e.comments=[])).push(t),t.printed=!1,t.nodeDescription=Jo(e)}function oe(e,t){t.leading=!0,t.trailing=!1,zn(e,t)}function he(e,t,r){t.leading=!1,t.trailing=!1,r&&(t.marker=r),zn(e,t)}function K(e,t){t.leading=!1,t.trailing=!0,zn(e,t)}function qo(e,t){let r=null,n=t;for(;n!==r;)r=n,n=Je(e,n),n=Ot(e,n),n=vt(e,n),n=qe(e,n);return n}var lt=qo;function Wo(e,t){let r=lt(e,t);return r===!1?"":e.charAt(r)}var Ke=Wo;function No(e,t,r){for(let n=t;n<r;++n)if(e.charAt(n)===`
`)return!0;return!1}var Te=No;function Go(e){return ee(e)&&e.value[0]==="*"&&/@(?:type|satisfies)\b/.test(e.value)}var ju=Go;function Uo(e){return[Yu,Ju,Nu,$o,Zn,es,Ru,qu,ip,sp,rs,Uu,ap,Wu,Gu,ts,Ho,fp].some(t=>t(e))}function Yo(e){return[Vo,Nu,Ju,Uu,Zn,es,Ru,qu,Gu,np,up,rs,cp,ts,Dp,yp].some(t=>t(e))}function Xo(e){return[Yu,Zn,es,Ko,rp,Wu,rs,tp,ep,mp,ts,lp].some(t=>t(e))}function bt(e,t){let r=(e.body||e.properties).find(({type:n})=>n!=="EmptyStatement");r?oe(r,t):he(e,t)}function Qn(e,t){e.type==="BlockStatement"?bt(e,t):oe(e,t)}function Vo({comment:e,followingNode:t}){return t&&ju(e)?(oe(t,e),!0):!1}function Zn({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){if((r==null?void 0:r.type)!=="IfStatement"||!n)return!1;if(Ke(s,I(e))===")")return K(t,e),!0;if(t===r.consequent&&n===r.alternate){if(t.type==="BlockStatement")K(t,e);else{let i=Rt(e)||e.loc.start.line===e.loc.end.line,a=e.loc.start.line===t.loc.start.line;i&&a?K(t,e):he(r,e)}return!0}return n.type==="BlockStatement"?(bt(n,e),!0):n.type==="IfStatement"?(Qn(n.consequent,e),!0):r.consequent===n?(oe(n,e),!0):!1}function es({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s}){return(r==null?void 0:r.type)!=="WhileStatement"||!n?!1:Ke(s,I(e))===")"?(K(t,e),!0):n.type==="BlockStatement"?(bt(n,e),!0):r.body===n?(oe(n,e),!0):!1}function Ru({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){return(r==null?void 0:r.type)!=="TryStatement"&&(r==null?void 0:r.type)!=="CatchClause"||!n?!1:r.type==="CatchClause"&&t?(K(t,e),!0):n.type==="BlockStatement"?(bt(n,e),!0):n.type==="TryStatement"?(Qn(n.finalizer,e),!0):n.type==="CatchClause"?(Qn(n.body,e),!0):!1}function $o({comment:e,enclosingNode:t,followingNode:r}){return q(t)&&(r==null?void 0:r.type)==="Identifier"?(oe(t,e),!0):!1}function Ho({comment:e,enclosingNode:t,followingNode:r,options:n}){return!n.experimentalTernaries||!((t==null?void 0:t.type)==="ConditionalExpression"||(t==null?void 0:t.type)==="ConditionalTypeAnnotation"||(t==null?void 0:t.type)==="TSConditionalType")?!1:(r==null?void 0:r.type)==="ConditionalExpression"||(r==null?void 0:r.type)==="ConditionalTypeAnnotation"||(r==null?void 0:r.type)==="TSConditionalType"?(he(t,e),!0):!1}function Ju({comment:e,precedingNode:t,enclosingNode:r,followingNode:n,text:s,options:u}){let i=t&&!Te(s,I(t),j(e));return(!t||!i)&&((r==null?void 0:r.type)==="ConditionalExpression"||(r==null?void 0:r.type)==="ConditionalTypeAnnotation"||(r==null?void 0:r.type)==="TSConditionalType")&&n?u.experimentalTernaries&&r.alternate===n&&!(ee(e)&&!Te(u.originalText,j(e),I(e)))?(he(r,e),!0):(oe(n,e),!0):!1}function Ko({comment:e,precedingNode:t,enclosingNode:r}){return Ce(r)&&r.shorthand&&r.key===t&&r.value.type==="AssignmentPattern"?(K(r.value.left,e),!0):!1}var zo=new Set(["ClassDeclaration","ClassExpression","DeclareClass","DeclareInterface","InterfaceDeclaration","TSInterfaceDeclaration"]);function qu({comment:e,precedingNode:t,enclosingNode:r,followingNode:n}){if(zo.has(r==null?void 0:r.type)){if(L(r.decorators)&&(n==null?void 0:n.type)!=="Decorator")return K(v(!1,r.decorators,-1),e),!0;if(r.body&&n===r.body)return bt(r.body,e),!0;if(n){if(r.superClass&&n===r.superClass&&t&&(t===r.id||t===r.typeParameters))return K(t,e),!0;for(let s of["implements","extends","mixins"])if(r[s]&&n===r[s][0])return t&&(t===r.id||t===r.typeParameters||t===r.superClass)?K(t,e):he(r,e,s),!0}}return!1}var Qo=new Set(["ClassMethod","ClassProperty","PropertyDefinition","TSAbstractPropertyDefinition","TSAbstractMethodDefinition","TSDeclareMethod","MethodDefinition","ClassAccessorProperty","AccessorProperty","TSAbstractAccessorProperty"]);function Wu({comment:e,precedingNode:t,enclosingNode:r,text:n}){return r&&t&&Ke(n,I(e))==="("&&(r.type==="Property"||r.type==="TSDeclareMethod"||r.type==="TSAbstractMethodDefinition")&&t.type==="Identifier"&&r.key===t&&Ke(n,I(t))!==":"?(K(t,e),!0):(t==null?void 0:t.type)==="Decorator"&&Qo.has(r==null?void 0:r.type)?(K(t,e),!0):!1}var Zo=new Set(["FunctionDeclaration","FunctionExpression","ClassMethod","MethodDefinition","ObjectMethod"]);functi
`;default:return`
`}}var Se=Symbol("MODE_BREAK"),ut=Symbol("MODE_FLAT"),pr=Symbol("cursor");function $u(){return{value:"",length:0,queue:[]}}function dp(e,t){return us(e,{type:"indent"},t)}function Tp(e,t,r){return t===Number.NEGATIVE_INFINITY?e.root||$u():t<0?us(e,{type:"dedent"},r):t?t.type==="root"?{...e,root:e}:us(e,{type:typeof t=="string"?"stringAlign":"numberAlign",n:t},r):e}function us(e,t,r){let n=t.type==="dedent"?e.queue.slice(0,-1):[...e.queue,t],s="",u=0,i=0,a=0;for(let l of n)switch(l.type){case"indent":m(),r.useTabs?o(1):p(r.tabWidth);break;case"stringAlign":m(),s+=l.n,u+=l.n.length;break;case"numberAlign":i+=1,a+=l.n;break;default:throw new Error(`Unexpected type '${l.type}'`)}return c(),{...e,value:s,length:u,queue:n};function o(l){s+=" ".repeat(l),u+=r.tabWidth*l}function p(l){s+=" ".repeat(l),u+=l}function m(){r.useTabs?y():c()}function y(){i>0&&o(i),f()}function c(){a>0&&p(a),f()}function f(){i=0,a=0}}function is(e){let t=0,r=0,n=e.length;e:for(;n--;){let s=e[n];if(s===pr){r++;continue}for(let u=s.length-1;u>=0;u--){let i=s[u];if(i===" "||i===" ")t++;else{e[n]=s.slice(0,u+1);break e}}}if(t>0||r>0)for(e.length=n+1;r-- >0;)e.push(pr);return t}function Wr(e,t,r,n,s,u){if(r===Number.POSITIVE_INFINITY)return!0;let i=t.length,a=[e],o=[];for(;r>=0;){if(a.length===0){if(i===0)return!0;a.push(t[--i]);continue}let{mode:p,doc:m}=a.pop();switch(nt(m)){case et:o.push(m),r-=Ze(m);break;case Ne:case de:{let y=qr(m);for(let c=y.length-1;c>=0;c--)a.push({mode:p,doc:y[c]});break}case Ge:case Ue:case Ye:case Oe:a.push({mode:p,doc:m.contents});break;case rt:r+=is(o);break;case pe:{if(u&&m.break)return!1;let y=m.break?Se:p,c=m.expandedStates&&y===Se?v(!1,m.expandedStates,-1):m.contents;a.push({mode:y,doc:c});break}case xe:{let c=(m.groupId?s[m.groupId]||ut:p)===Se?m.breakContents:m.flatContents;c&&a.push({mode:p,doc:c});break}case ce:if(p===Se||m.hard)return!0;m.soft||(o.push(" "),r--);break;case Xe:n=!0;break;case Ve:if(n)return!1;break}}return!1}function Nr(e,t){let r={},n=t.printWidth,s=Vu(t.endOfLine),u=0,i=[{ind:$u(),mode:Se,doc:e}],a=[],o=!1,p=[],m=0;for(Ou(e);i.length>0;){let{ind:c,mode:f,doc:l}=i.pop();switch(nt(l)){case et:{let h=s!==`
`?H(!1,l,`
`,s):l;a.push(h),i.length>0&&(u+=Ze(h));break}case Ne:for(let h=l.length-1;h>=0;h--)i.push({ind:c,mode:f,doc:l[h]});break;case tt:if(m>=2)throw new Error("There are too many 'cursor' in doc.");a.push(pr),m++;break;case Ge:i.push({ind:dp(c,t),mode:f,doc:l.contents});break;case Ue:i.push({ind:Tp(c,l.n,t),mode:f,doc:l.contents});break;case rt:u-=is(a);break;case pe:switch(f){case ut:if(!o){i.push({ind:c,mode:l.break?Se:ut,doc:l.contents});break}case Se:{o=!1;let h={ind:c,mode:ut,doc:l.contents},g=n-u,S=p.length>0;if(!l.break&&Wr(h,i,g,S,r))i.push(h);else if(l.expandedStates){let B=v(!1,l.expandedStates,-1);if(l.break){i.push({ind:c,mode:Se,doc:B});break}else for(let O=1;O<l.expandedStates.length+1;O++)if(O>=l.expandedStates.length){i.push({ind:c,mode:Se,doc:B});break}else{let R=l.expandedStates[O],_={ind:c,mode:ut,doc:R};if(Wr(_,i,g,S,r)){i.push(_);break}}}else i.push({ind:c,mode:Se,doc:l.contents});break}}l.id&&(r[l.id]=v(!1,i,-1).mode);break;case de:{let h=n-u,{parts:g}=l;if(g.length===0)break;let[S,B]=g,O={ind:c,mode:ut,doc:S},R={ind:c,mode:Se,doc:S},_=Wr(O,[],h,p.length>0,r,!0);if(g.length===1){_?i.push(O):i.push(R);break}let T={ind:c,mode:ut,doc:B},W={ind:c,mode:Se,doc:B};if(g.length===2){_?i.push(T,O):i.push(W,R);break}g.splice(0,2);let Fe={ind:c,mode:f,doc:Wt(g)},X=g[0];Wr({ind:c,mode:ut,doc:[S,B,X]},[],h,p.length>0,r,!0)?i.push(Fe,T,O):_?i.push(Fe,W,O):i.push(Fe,W,R);break}case xe:case Ye:{let h=l.groupId?r[l.groupId]:f;if(h===Se){let g=l.type===xe?l.breakContents:l.negate?l.contents:E(l.contents);g&&i.push({ind:c,mode:f,doc:g})}if(h===ut){let g=l.type===xe?l.flatContents:l.negate?E(l.contents):l.contents;g&&i.push({ind:c,mode:f,doc:g})}break}case Xe:p.push({ind:c,mode:f,doc:l.contents});break;case Ve:p.length>0&&i.push({ind:c,mode:f,doc:Hn});break;case ce:switch(f){case ut:if(l.hard)o=!0;else{l.soft||(a.push(" "),u+=1);break}case Se:if(p.length>0){i.push({ind:c,mode:f,doc:l},...p.reverse()),p.length=0;break}l.literal?c.root?(a.push(s,c.root.value),u=c.root.length):(a.push(s),u=0):(u-=is(a),a.push(s+c.value),u=c.length);break}break;case Oe:i.push({ind:c,mode:f,doc:l.contents});break;case ve:break;default:throw new Ft(l)}i.length===0&&p.length>0&&(i.push(...p.reverse()),p.length=0)}let y=a.indexOf(pr);if(y!==-1){let c=a.indexOf(pr,y+1),f=a.slice(0,y).join(""),l=a.slice(y+1,c).join(""),h=a.slice(c+1).join("");return{formatted:f+l+h,cursorNodeStart:f.length,cursorNodeText:l}}return{formatted:a.join("")}}function xp(e,t,r=0){let n=0;for(let s=r;s<e.length;++s)e[s]===" "?n=n+t-n%t:n++;return n}var Hu=xp;function gp(e,t){let r=e.lastIndexOf(`
`);return r===-1?0:Hu(e.slice(r+1).match(/^[\t ]*/)[0],t)}var Ku=gp;function Gr(e,t,r){let{node:n}=e;if(n.type==="TemplateLiteral"&&Bp(e)){let m=hp(e,r,t);if(m)return m}let u="expressions";n.type==="TSTemplateLiteralType"&&(u="types");let i=[],a=e.map(t,u),o=Eu(n);o&&(a=a.map(m=>Nr(m,{...r,printWidth:Number.POSITIVE_INFINITY}).formatted)),i.push(ke,"`");let p=0;return e.each(({index:m,node:y})=>{if(i.push(t()),y.tail)return;let{tabWidth:c}=r,f=y.value.raw,l=f.includes(`
`)?Ku(f,c):p;p=l;let h=a[m];if(!o){let S=n[u][m],B=Te(r.originalText,I(y),j(n.quasis[m+1]));if(!B){let O=Nr(h,{...r,printWidth:Number.POSITIVE_INFINITY}).formatted;O.includes(`
`)?B=!0:h=O}B&&(A(S)||q(S)||S.type==="ConditionalExpression"||S.type==="SequenceExpression"||Ae(S)||me(S))&&(h=[E([F,h]),F])}let g=l===0&&f.endsWith(`
`)?ge(Number.NEGATIVE_INFINITY,h):Iu(h,l,c);i.push(D(["${",g,ke,"}"]))},"quasis"),i.push("`"),i}function zu(e){let t=e("quasi");return st(t.label&&{tagged:!0,...t.label},[e("tag"),e("typeParameters"),ke,t])}function hp(e,t,r){let{node:n}=e,s=n.quasis[0].value.raw.trim().split(/\s*\|\s*/);if(s.length>1||s.some(u=>u.length>0)){t.__inJestEach=!0;let u=e.map(r,"expressions");t.__inJestEach=!1;let i=[],a=u.map(c=>"${"+Nr(c,{...t,printWidth:Number.POSITIVE_INFINITY,endOfLine:"lf"}).formatted+"}"),o=[{hasLineBreak:!1,cells:[]}];for(let c=1;c<n.quasis.length;c++){let f=v(!1,o,-1),l=a[c-1];f.cells.push(l),l.includes(`
`)&&(f.hasLineBreak=!0),n.quasis[c].value.raw.includes(`
`)&&o.push({hasLineBreak:!1,cells:[]})}let p=Math.max(s.length,...o.map(c=>c.cells.length)),m=Array.from({length:p}).fill(0),y=[{cells:s},...o.filter(c=>c.cells.length>0)];for(let{cells:c}of y.filter(f=>!f.hasLineBreak))for(let[f,l]of c.entries())m[f]=Math.max(m[f],Ze(l));return i.push(ke,"`",E([C,P(C,y.map(c=>P(" | ",c.cells.map((f,l)=>c.hasLineBreak?f:f+" ".repeat(m[l]-Ze(f))))))]),C,"`"),i}}function Sp(e,t){let{node:r}=e,n=t();return A(r)&&(n=D([E([F,n]),F])),["${",n,ke,"}"]}function Gt(e,t){return e.map(r=>Sp(r,t),"expressions")}function Ur(e,t){return ct(e,r=>typeof r=="string"?t?H(!1,r,/(\\*)`/g,"$1$1\\`"):as(r):r)}function as(e){return H(!1,e,/([\\`]|\${)/g,"\\$1")}function Bp({node:e,parent:t}){let r=/^[fx]?(?:describe|it|test)$/;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"&&r.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"&&r.test(t.tag.object.object.name))}var os=[(e,t)=>e.type==="ObjectExpression"&&t==="properties",(e,t)=>e.type==="CallExpression"&&e.callee.type==="Identifier"&&e.callee.name==="Component"&&t==="arguments",(e,t)=>e.type==="Decorator"&&t==="expression"];function Zu(e){let t=n=>n.type==="TemplateLiteral",r=(n,s)=>Ce(n)&&!n.computed&&n.key.type==="Identifier"&&n.key.name==="styles"&&s==="value";return e.match(t,(n,s)=>G(n)&&s==="elements",r,...os)||e.match(t,r,...os)}function ei(e){return e.match(t=>t.type==="TemplateLiteral",(t,r)=>Ce(t)&&!t.computed&&t.key.type==="Identifier"&&t.key.name==="template"&&r==="value",...os)}function Qu(e,t){return A(e,x.Block|x.Leading,({value:r})=>r===` ${t} `)}function Yr({node:e,parent:t},r){return Qu(e,r)||bp(t)&&Qu(t,r)}function bp(e){return e.type==="AsConstExpression"||e.type==="TSAsExpression"&&e.typeAnnotation.type==="TSTypeReference"&&e.typeAnnotation.typeName.type==="Identifier"&&e.typeAnnotation.typeName.name==="const"}async function Pp(e,t,r){let{node:n}=r,s=n.quasis.map(m=>m.value.raw),u=0,i=s.reduce((m,y,c)=>c===0?y:m+"@prettier-placeholder-"+u+++"-id"+y,""),a=await e(i,{parser:"scss"}),o=Gt(r,t),p=kp(a,o);if(!p)throw new Error("Couldn't insert all the expressions");return["`",E([C,p]),F,"`"]}function kp(e,t){if(!L(t))return e;let r=0,n=ct(Nt(e),s=>typeof s!="string"||!s.includes("@prettier-placeholder")?s:s.split(/@prettier-placeholder-(\d+)-id/).map((u,i)=>i%2===0?Ie(u):(r++,t[u])));return t.length===r?n:null}function Ip({node:e,parent:t,grandparent:r}){return r&&e.quasis&&t.type==="JSXExpressionContainer"&&r.type==="JSXElement"&&r.openingElement.name.name==="style"&&r.openingElement.attributes.some(n=>n.type==="JSXAttribute"&&n.name.name==="jsx")||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="css"||(t==null?void 0:t.type)==="TaggedTemplateExpression"&&t.tag.type==="MemberExpression"&&t.tag.object.name==="css"&&(t.tag.property.name==="global"||t.tag.property.name==="resolve")}function Xr(e){return e.type==="Identifier"&&e.name==="styled"}function ti(e){return/^[A-Z]/.test(e.object.name)&&e.property.name==="extend"}function Lp({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 Xr(t.object)||ti(t);case"CallExpression":return Xr(t.callee)||t.callee.type==="MemberExpression"&&(t.callee.object.type==="MemberExpression"&&(Xr(t.callee.object.object)||ti(t.callee.object))||t.callee.object.type==="CallExpression"&&Xr(t.callee.object.callee));case"Identifier":return t.name==="css";default:return!1}}function wp({parent:e,grandparent:t}){return(t==null?void 0:t.type)==="JSXAttribute"&&e.type==="JSXExpressionContainer"&&t.name.type==="JSXIdentifier"&&t.name.name==="css"}function Op(e){if(Ip(e)||Lp(e)||wp(e)||Zu(e))return Pp}var ri=Op;async function vp(e,t,r){let{node:n}=r,s=
`),f=c.length,l=u[a],h=f>2&&c[0].trim()===""&&c[1].trim()==="",g=f>2&&c[f-1].trim()===""&&c[f-2].trim()==="",S=c.every(O=>/^\s*(?:#[^\n\r]*)?$/.test(O));if(!m&&/#[^\n\r]*$/.test(c[f-1]))return null;let B=null;S?B=_p(c):B=await e(y,{parser:"graphql"}),B?(B=Ur(B,!1),!p&&h&&i.push(""),i.push(B),!m&&g&&i.push("")):!p&&!m&&h&&i.push(""),l&&i.push(l)}return["`",E([C,P(C,i)]),C,"`"]}function _p(e){let t=[],r=!1,n=e.map(s=>s.trim());for(let[s,u]of n.entries())u!==""&&(n[s-1]===""&&r?t.push([C,u]):t.push(u),r=!0);return t.length===0?null:P(C,t)}function Mp({node:e,parent:t}){return Yr({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")}function jp(e){if(Mp(e))return vp}var ni=jp;var ps=0;async function si(e,t,r,n,s){let{node:u}=n,i=ps;ps=ps+1>>>0;let a=S=>`PRETTIER_HTML_PLACEHOLDER_${S}_${i}_IN_JS`,o=u.quasis.map((S,B,O)=>B===O.length-1?S.value.cooked:S.value.cooked+a(B)).join(""),p=Gt(n,r),m=new RegExp(a("(\\d+)"),"g"),y=0,c=await t(o,{parser:e,__onHtmlRoot(S){y=S.children.length}}),f=ct(c,S=>{if(typeof S!="string")return S;let B=[],O=S.split(m);for(let R=0;R<O.length;R++){let _=O[R];if(R%2===0){_&&(_=as(_),s.__embeddedInHtml&&(_=H(!1,_,/<\/(?=script\b)/gi,"<\\/")),B.push(_));continue}let T=Number(_);B.push(p[T])}return B}),l=/^\s/.test(o)?" ":"",h=/\s$/.test(o)?" ":"",g=s.htmlWhitespaceSensitivity==="ignore"?C:l&&h?d:null;return g?D(["`",E([g,D(f)]),g,"`"]):st({hug:!1},D(["`",l,y>1?E(D(f)):D(f),h,"`"]))}function Rp(e){return Yr(e,"HTML")||e.match(t=>t.type==="TemplateLiteral",(t,r)=>t.type==="TaggedTemplateExpression"&&t.tag.type==="Identifier"&&t.tag.name==="html"&&r==="quasi")}var Jp=si.bind(void 0,"html"),qp=si.bind(void 0,"angular");function Wp(e){if(Rp(e))return Jp;if(ei(e))return qp}var ui=Wp;async function Np(e,t,r){let{node:n}=r,s=H(!1,n.quasis[0].value.raw,/((?:\\\\)*)\\`/g,(o,p)=>"\\".repeat(p.length/2)+"`"),u=Gp(s),i=u!=="";i&&(s=H(!1,s,new RegExp(`^${u}`,"gm"),""));let a=Ur(await e(s,{parser:"markdown",__inJsTemplate:!0}),!0);return["`",i?E([F,a]):[Jr,ku(a)],F,"`"]}function Gp(e){let t=e.match(/^([^\S\n]*)\S/m);return t===null?"":t[1]}function Up(e){if(Yp(e))return Np}function Yp({node:e,parent:t}){return(t==null?void 0:t.type)==="TaggedTemplateExpression"&&e.quasis.length===1&&t.tag.type==="Identifier"&&(t.tag.name==="md"||t.tag.name==="markdown")}var ii=Up;function Xp(e){let{node:t}=e;if(t.type!=="TemplateLiteral"||Vp(t))return;let r;for(let n of[ri,ni,ui,ii])if(r=n(e),!!r)return t.quasis.length===1&&t.quasis[0].value.raw.trim()===""?"``":async(...s)=>{let u=await r(...s);return u&&st({embed:!0,...u.label},u)}}function Vp({quasis:e}){return e.some(({value:{cooked:t}})=>t===null)}var ai=Xp;var At=Ga(yi(),1);function nc(e){if(!e.startsWith("#!"))return"";let t=e.indexOf(`
`);return t===-1?e:e.slice(0,t)}var fi=nc;function sc(e){let t=fi(e);t&&(e=e.slice(t.length+1));let r=(0,At.extract)(e),{pragmas:n,comments:s}=(0,At.parseWithComments)(r);return{shebang:t,text:e,pragmas:n,comments:s}}function Ei(e){let{shebang:t,text:r,pragmas:n,comments:s}=sc(e),u=(0,At.strip)(r),i=(0,At.print)({pragmas:{format:"",...n},comments:s.trimStart()});return(t?`${t}
`:"")+i+(u.startsWith(`
`)?`
`:`
`)+u}function uc(e,t){let{originalText:r,[Symbol.for("comments")]:n,locStart:s,locEnd:u,[Symbol.for("printedComments")]:i}=t,{node:a}=e,o=s(a),p=u(a);for(let m of n)s(m)>=o&&u(m)<=p&&i.add(m);return r.slice(o,p)}var Fi=uc;function cs(e,t){var u,i,a,o,p,m,y;if(e.isRoot)return!1;let{node:r,key:n,parent:s}=e;if(t.__isInHtmlInterpolation&&!t.bracketSpacing&&pc(r)&&cr(e))return!0;if(ic(r))return!1;if(r.type==="Identifier"){if((u=r.extra)!=null&&u.parenthesized&&/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/.test(r.name)||n==="left"&&(r.name==="async"&&!s.await||r.name==="let")&&s.type==="ForOfStatement")return!0;if(r.name==="let"){let c=(i=e.findAncestor(f=>f.type==="ForOfStatement"))==null?void 0:i.left;if(c&&ie(c,f=>f===r))return!0}if(n==="object"&&r.name==="let"&&s.type==="MemberExpression"&&s.computed&&!s.optional){let c=e.findAncestor(l=>l.type==="ExpressionStatement"||l.type==="ForStatement"||l.type==="ForInStatement"),f=c?c.type==="ExpressionStatement"?c.expression:c.type==="ForStatement"?c.init:c.left:void 0;if(f&&ie(f,l=>l===r))return!0}if(n==="expression")switch(r.name){case"await":case"interface":case"module":case"using":case"yield":case"let":case"type":{let c=e.findAncestor(f=>!Ae(f));if(c!==s&&c.type==="ExpressionStatement")return!0}}return!1}if(r.type==="ObjectExpression"||r.type==="FunctionExpression"||r.type==="ClassExpression"||r.type==="DoExpression"){let c=(a=e.findAncestor(f=>f.type==="ExpressionStatement"))==null?void 0:a.expression;if(c&&ie(c,f=>f===r))return!0}if(r.type==="ObjectExpression"){let c=(o=e.findAncestor(f=>f.type==="ArrowFunctionExpression"))==null?void 0:o.body;if(c&&c.type!=="SequenceExpression"&&c.type!=="AssignmentExpression"&&ie(c,f=>f===r))return!0}switch(s.type){case"ParenthesizedExpression":return!1;case"ClassDeclaration":case"ClassExpression":if(n==="superClass"&&(r.type==="ArrowFunctionExpression"||r.type==="AssignmentExpression"||r.type==="AwaitExpression"||r.type==="BinaryExpression"||r.type==="ConditionalExpression"||r.type==="LogicalExpression"||r.type==="NewExpression"||r.type==="ObjectExpression"||r.type==="SequenceExpression"||r.type==="TaggedTemplateExpression"||r.type==="UnaryExpression"||r.type==="UpdateExpression"||r.type==="YieldExpression"||r.type==="TSNonNullExpression"||r.type==="ClassExpression"&&L(r.decorators)))return!0;break;case"ExportDefaultDeclaration":return Ci(e,t)||r.type==="SequenceExpression";case"Decorator":if(n==="expression"){if(q(r)&&r.computed)return!0;let c=!1,f=!1,l=r;for(;l;)switch(l.type){case"MemberExpression":f=!0,l=l.object;break;case"CallExpression":if(f||c)return t.parser!=="typescript";c=!0,l=l.callee;break;case"Identifier":return!1;case"TaggedTemplateExpression":return t.parser!=="typescript";default:return!0}return!0}break;case"TypeAnnotation":if(e.match(void 0,void 0,(c,f)=>f==="returnType"&&c.type==="ArrowFunctionExpression")&&oc(r))return!0;break;case"BinaryExpression":if(n==="left"&&(s.operator==="in"||s.operator==="instanceof")&&r.type==="UnaryExpression")return!0;break}switch(r.type){case"UpdateExpression":if(s.type==="UnaryExpression")return r.prefix&&(r.operator==="++"&&s.operator==="+"||r.operator==="--"&&s.operator==="-");case"UnaryExpression":switch(s.type){case"UnaryExpression":return r.operator===s.operator&&(r.operator==="+"||r.operator==="-");case"BindExpression":return!0;case"MemberExpression":case"OptionalMemberExpression":return n==="object";case"TaggedTemplateExpression":return!0;case"NewExpression":case"CallExpression":case"OptionalCallExpression":return n==="callee";case"BinaryExpression":return n==="left"&&s.operator==="**";case"TSNonNullExpression":return!0;default:return!1}case"BinaryExpression":if(s.type==="UpdateExpression"||r.operator==="in"&&ac(e))return!0;if(r.operator==="|>"&&((p=r.extra)!=null&&p.parenthesized)){let c=e.grandparent;if(c.type==="BinaryExpression"&&c.operator==="|>")return!0}case"TSTypeAssertion":case"TSAsExpression":case"TSSatisfiesExpression":case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":case"LogicalExpression":switch(s.type){case"TSAsExpression":case"TSSatisfiesExpressi
\r `),Es=e=>e===""||e===d||e===C||e===F;function fc(e,t,r){var O,R,_;let{node:n}=e;if(n.type==="JSXElement"&&kc(n))return[r("openingElement"),r("closingElement")];let s=n.type==="JSXElement"?r("openingElement"):r("openingFragment"),u=n.type==="JSXElement"?r("closingElement"):r("closingFragment");if(n.children.length===1&&n.children[0].type==="JSXExpressionContainer"&&(n.children[0].expression.type==="TemplateLiteral"||n.children[0].expression.type==="TaggedTemplateExpression"))return[s,...e.map(r,"children"),u];n.children=n.children.map(T=>Ic(T)?{type:"JSXText",value:" ",raw:" "}:T);let i=n.children.some(U),a=n.children.filter(T=>T.type==="JSXExpressionContainer").length>1,o=n.type==="JSXElement"&&n.openingElement.attributes.length>1,p=re(s)||i||o||a,m=e.parent.rootMarker==="mdx",y=t.singleQuote?"{' '}":'{" "}',c=m?" ":b([y,F]," "),f=((R=(O=n.openingElement)==null?void 0:O.name)==null?void 0:R.name)==="fbt",l=Ec(e,t,r,c,f),h=n.children.some(T=>lr(T));for(let T=l.length-2;T>=0;T--){let W=l[T]===""&&l[T+1]==="",Fe=l[T]===C&&l[T+1]===""&&l[T+2]===C,X=(l[T]===F||l[T]===C)&&l[T+1]===""&&l[T+2]===c,ue=l[T]===c&&l[T+1]===""&&(l[T+2]===F||l[T+2]===C),z=l[T]===c&&l[T+1]===""&&l[T+2]===c,wt=l[T]===F&&l[T+1]===""&&l[T+2]===C||l[T]===C&&l[T+1]===""&&l[T+2]===F;Fe&&h||W||X||z||wt?l.splice(T,2):ue&&l.splice(T+1,2)}for(;l.length>0&&Es(v(!1,l,-1));)l.pop();for(;l.length>1&&Es(l[0])&&Es(l[1]);)l.shift(),l.shift();let g=[];for(let[T,W]of l.entries()){if(W===c){if(T===1&&l[T-1]===""){if(l.length===2){g.push(y);continue}g.push([y,C]);continue}else if(T===l.length-1){g.push(y);continue}else if(l[T-1]===""&&l[T-2]===C){g.push(y);continue}}g.push(W),re(W)&&(p=!0)}let S=h?Wt(g):D(g,{shouldBreak:!0});if(((_=t.cursorNode)==null?void 0:_.type)==="JSXText"&&n.children.includes(t.cursorNode)&&(S=[Kn,S,Kn]),m)return S;let B=D([s,E([C,S]),C,u]);return p?B:He([D([s,...l,u]),B])}function Ec(e,t,r,n,s){let u=[];return e.each(({node:i,next:a})=>{if(i.type==="JSXText"){let o=De(i);if(lr(i)){let p=Vr.split(o,!0);p[0]===""&&(u.push(""),p.shift(),/\n/.test(p[0])?u.push(xi(s,p[1],i,a)):u.push(n),p.shift());let m;if(v(!1,p,-1)===""&&(p.pop(),m=p.pop()),p.length===0)return;for(let[y,c]of p.entries())y%2===1?u.push(d):u.push(c);m!==void 0?/\n/.test(m)?u.push(xi(s,v(!1,u,-1),i,a)):u.push(n):u.push(Ti(s,v(!1,u,-1),i,a))}else/\n/.test(o)?o.match(/\n/g).length>1&&u.push("",C):u.push("",n)}else{let o=r();if(u.push(o),a&&lr(a)){let m=Vr.trim(De(a)),[y]=Vr.split(m);u.push(Ti(s,y,i,a))}else u.push(C)}},"children"),u}function Ti(e,t,r,n){return e?"":r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?t.length===1?F:C:F}function xi(e,t,r,n){return e?C:t.length===1?r.type==="JSXElement"&&!r.closingElement||(n==null?void 0:n.type)==="JSXElement"&&!n.closingElement?C:F:C}var Fc=new Set(["ArrayExpression","TupleExpression","JSXAttribute","JSXElement","JSXExpressionContainer","JSXFragment","ExpressionStatement","CallExpression","OptionalCallExpression","ConditionalExpression","JsExpressionRoot"]);function Cc(e,t,r){let{parent:n}=e;if(Fc.has(n.type))return t;let s=e.match(void 0,i=>i.type==="ArrowFunctionExpression",w,i=>i.type==="JSXExpressionContainer"),u=Be(e,r);return D([u?"":b("("),E([F,t]),F,u?"":b(")")],{shouldBreak:s})}function Ac(e,t,r){let{node:n}=e,s=[];if(s.push(r("name")),n.value){let u;if(te(n.value)){let i=De(n.value),a=H(!1,H(!1,i.slice(1,-1),"&apos;","'"),"&quot;",'"'),o=hr(a,t.jsxSingleQuote);a=o==='"'?H(!1,a,'"',"&quot;"):H(!1,a,"'","&apos;"),u=e.call(()=>le(e,Ie(o+a+o),t),"value")}else u=r("value");s.push("=",u)}return s}function dc(e,t,r){let{node:n}=e,s=(u,i)=>u.type==="JSXEmptyExpression"||!A(u)&&(G(u)||se(u)||u.type==="ArrowFunctionExpression"||u.type==="AwaitExpression"&&(s(u.argument,u)||u.argument.type==="JSXElement")||w(u)||u.type==="ChainExpression"&&w(u.expression)||u.type==="FunctionExpression"||u.type==="TemplateLiteral"||u.type==="TaggedTemplateExpression"||u.type==="DoExpression"||U(i)&&(u.type==="ConditionalExpression"||me(u)));return s(n.expression,e.parent)?D(["{",r("expression"),ke,"}"]):D(["{
`)&&!s&&!A(n.attributes[0]))return D(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters")," ",...e.map(r,"attributes"),n.selfClosing?" />":">"]);let u=(o=n.attributes)==null?void 0:o.some(p=>p.value&&te(p.value)&&p.value.value.includes(`
`)),i=t.singleAttributePerLine&&n.attributes.length>1?C:d;return D(["<",r("name"),n.typeArguments?r("typeArguments"):r("typeParameters"),E(e.map(()=>[i,r()],"attributes")),...xc(n,t,s)],{shouldBreak:u})}function xc(e,t,r){return e.selfClosing?[d,"/>"]:gc(e,t,r)?[">"]:[F,">"]}function gc(e,t,r){let n=e.attributes.length>0&&A(v(!1,e.attributes,-1),x.Trailing);return e.attributes.length===0&&!r||(t.bracketSameLine||t.jsxBracketSameLine)&&(!r||e.attributes.length>0)&&!n}function hc(e,t,r){let{node:n}=e,s=[];s.push("</");let u=r("name");return A(n.name,x.Leading|x.Line)?s.push(E([C,u]),C):A(n.name,x.Leading|x.Block)?s.push(" ",u):s.push(u),s.push(">"),s}function Sc(e,t){let{node:r}=e,n=A(r),s=A(r,x.Line),u=r.type==="JSXOpeningFragment";return[u?"<":"</",E([s?C:n&&!u?" ":"",J(e,t)]),s?C:"",">"]}function Bc(e,t,r){let n=le(e,fc(e,t,r),t);return Cc(e,n,t)}function bc(e,t){let{node:r}=e,n=A(r,x.Line);return[J(e,t,{indent:n}),n?C:""]}function Pc(e,t,r){let{node:n}=e;return["{",e.call(({node:s})=>{let u=["...",r()];return!A(s)||!ss(e)?u:[E([F,le(e,u,t)]),F]},n.type==="JSXSpreadAttribute"?"argument":"expression"),"}"]}function gi(e,t,r){let{node:n}=e;if(n.type.startsWith("JSX"))switch(n.type){case"JSXAttribute":return Ac(e,t,r);case"JSXIdentifier":return n.name;case"JSXNamespacedName":return P(":",[r("namespace"),r("name")]);case"JSXMemberExpression":return P(".",[r("object"),r("property")]);case"JSXSpreadAttribute":case"JSXSpreadChild":return Pc(e,t,r);case"JSXExpressionContainer":return dc(e,t,r);case"JSXFragment":case"JSXElement":return Bc(e,t,r);case"JSXOpeningElement":return Tc(e,t,r);case"JSXClosingElement":return hc(e,t,r);case"JSXOpeningFragment":case"JSXClosingFragment":return Sc(e,t);case"JSXEmptyExpression":return bc(e,t);case"JSXText":throw new Error("JSXText should be handled by JSXElement");default:throw new _e(n,"JSX")}}function kc(e){if(e.children.length===0)return!0;if(e.children.length>1)return!1;let t=e.children[0];return t.type==="JSXText"&&!lr(t)}function lr(e){return e.type==="JSXText"&&(Vr.hasNonWhitespaceCharacter(De(e))||!/\n/.test(De(e)))}function Ic(e){return e.type==="JSXExpressionContainer"&&te(e.expression)&&e.expression.value===" "&&!A(e.expression)}function hi(e){let{node:t,parent:r}=e;if(!U(t)||!U(r))return!1;let{index:n,siblings:s}=e,u;for(let i=n;i>0;i--){let a=s[i-1];if(!(a.type==="JSXText"&&!lr(a))){u=a;break}}return(u==null?void 0:u.type)==="JSXExpressionContainer"&&u.expression.type==="JSXEmptyExpression"&&Bt(u.expression)}function Lc(e){return Bt(e.node)||hi(e)}var $r=Lc;var wc=0;function Hr(e,t,r){var R;let{node:n,parent:s,grandparent:u,key:i}=e,a=i!=="body"&&(s.type==="IfStatement"||s.type==="WhileStatement"||s.type==="SwitchStatement"||s.type==="DoWhileStatement"),o=n.operator==="|>"&&((R=e.root.extra)==null?void 0:R.__isUsingHackPipeline),p=Fs(e,r,t,!1,a);if(a)return p;if(o)return D(p);if(w(s)&&s.callee===n||s.type==="UnaryExpression"||q(s)&&!s.computed)return D([E([F,...p]),F]);let m=s.type==="ReturnStatement"||s.type==="ThrowStatement"||s.type==="JSXExpressionContainer"&&u.type==="JSXAttribute"||n.operator!=="|"&&s.type==="JsExpressionRoot"||n.type!=="NGPipeExpression"&&(s.type==="NGRoot"&&t.parser==="__ng_binding"||s.type==="NGMicrosyntaxExpression"&&u.type==="NGMicrosyntax"&&u.body.length===1)||n===s.body&&s.type==="ArrowFunctionExpression"||n!==s.body&&s.type==="ForStatement"||s.type==="ConditionalExpression"&&u.type!=="ReturnStatement"&&u.type!=="ThrowStatement"&&!w(u)||s.type==="TemplateLiteral",y=s.type==="AssignmentExpression"||s.type==="VariableDeclarator"||s.type==="ClassProperty"||s.type==="PropertyDefinition"||s.type==="TSAbstractPropertyDefinition"||s.type==="ClassPrivateProperty"||Ce(s),c=me(n.left)&&sr(n.operator,n.left.operator);if(m||Ut(n)&&!c||!Ut(n)&&y)return D(p);if(p.length===0)return"";let f=U(n.right),l=p.findIndex(_=>typeof _!="string"&&!Array.isArray(_)&&_.type===pe),h=p.slice(0,l===-1?1:l+1),g=p.slice(h.length,f?-1:void 0),S=Symbol("logicalChain-"+ ++wc),B=D([...h,E(g)],{id:S});if(!f)return B;let O=v(!1,p,-1);return D([B,Ct(O,{groupId:S})])}function Fs(e,t,r,n,s