7 | `||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","typeParameters","predicate"],ClassBody:["body"],ClassExpression:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ClassDeclaration:["id","body","superClass","mixins","typeParameters","superTypeParameters","implements","decorators","superTypeArguments"],ExportAllDeclaration:["source","attributes","exported"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source","attributes"],ExportSpecifier:["local","exported"],ForOfStatement:["left","right","body"],ImportDeclaration:["specifiers","source","attributes"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["local","imported"],ImportExpression:["source","options","attributes"],MetaProperty:["meta","property"],ClassMethod:["key","params","body","decorators","returnType","typeParameters"],ObjectPattern:["properties","typeAnnotation","decorators"],SpreadElement:["argument"],Super:[],TaggedTemplateExpression:["tag","quasi","typeParameters","typeArguments"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],YieldExpression:["argument"],AwaitExpression:["argument"],Import:[],BigIntLiteral:[],ExportNamespaceSpecifier:["exported"],OptionalMemberExpression:["object","property"],OptionalCallExpression:["callee","arguments","typeParameters","typeArguments"],ClassProperty:["key","value","typeAnnotation","decorators","variance"],ClassAccessorProperty:["key","value","typeAnnotation","decorators"],ClassPrivateProperty:["key","value","decorators","typeAnnotation","variance"],ClassPrivateMethod:["key","params","body","decorators","returnType","typeParameters"],PrivateName:["id"],StaticBlock:["body"],AnyTypeAnnotation:[],ArrayTypeAnnotation:["elementType"],BooleanTypeAnnotation:[],BooleanLiteralTypeAnnotation:[],NullLiteralTypeAnnotation:[],ClassImplements:["id","typeParameters"],DeclareClass:["id","typeParameters","extends","mixins","implements","body"],DeclareFunction:["id","predicate"],DeclareInterface:["id","typeParameters","extends","body"],DeclareModule:["id","body"],DeclareModuleExports:["typeAnnotation"],DeclareTypeAlias:["id","typeParameters","right"],DeclareOpaqueType:["id","typeParameters","supertype"],DeclareVariable:["id"],DeclareExportDeclaration:["declaration","specifiers","source"],DeclareExportAllDeclaration:["source"],DeclaredPredicate:["value"],ExistsTypeAnnotation:[],FunctionTypeAnnotation:["typeParameters","params","rest","returnType","this"],FunctionTypeParam:["name","typeAnnotation"],GenericTypeAnnotation:["id","typeParameters"],InferredPredicate:[],InterfaceExtends:["id","typeParameters"],InterfaceDeclaration:["id","typeParameters","extends","body"],InterfaceTypeAnnotation:["extends","body"],IntersectionTypeAnnotation:["types"],MixedTypeAnnotation:[],EmptyTypeAnnotation:[],NullableTypeAnnotation:["typeAnnotation"],NumberLiteralTypeAnnotation:[],NumberTypeAnnotation:[],ObjectTypeAnnotation:["properties","indexers","callProperties","internalSlots"],ObjectTypeInternalSlot:["id","value","optional","static","method"],ObjectTypeCallProperty:["value"],ObjectTypeIndexer:["id","key","value","variance"],ObjectTypeProperty:["key","value","variance"],ObjectTypeSpreadProperty:["argument"],OpaqueType:["id","typeParameters","supertype","impltype"],QualifiedTypeIdentifier:["id","qualification"],StringLiteralTypeAnnotation:[],StringTypeAnnotation:[],SymbolTypeAnnotation:[],ThisTypeAnnotation:[],TupleTypeAnnotation:["types","elementTypes"],TypeofTypeAnnotation:["argument","typeArguments"],TypeAlias:["id","typeParameters","right"],TypeAnnotation:["typeAnnotation"],TypeCastExpression:["expression","typeAnnotation"],TypeParameter:["bound","default","variance"],TypeParameterDeclaration:["params"],TypeParameterInstantiation:["params"],UnionTypeAnnotation:["types"],Variance:[],VoidTypeAnnotation:[],EnumDeclaration:["id","body"],EnumBooleanBody:["members"],EnumNumberBody:["members"],EnumStringBody:["members"],EnumSymbolBody:["members"],EnumBooleanMember:["id","init"],EnumNumberMember:["id","init"],EnumStringMember:["id","init"],EnumDefaultedMember:["id"],IndexedAccessType:["objectType","indexType"],OptionalIndexedAccessType:["objectType","indexType"],JSXAttribute:["name","value"],JSXClosingElement:["name"],JSXElement:["openingElement","children","closingElement"],JSXEmptyExpression:[],JSXExpressionContainer:["expression"],JSXSpreadChild:["expression"],JSXIdentifier:[],JSXMemberExpression:["object","property"],JSXNamespacedName:["namespace","name"],JSXOpeningElement:["name","attributes","typeArguments","typeParameters"],JSXSpreadAttribute:["argument"],JSXText:[],JSXFragment:["openingFragment","children","closingFragment"],JSXOpeningFragment:[],JSXClosingFragment:[],Noop:[],Placeholder:[],V8IntrinsicIdentifier:[],ArgumentPlaceholder:[],BindExpression:["object","callee"],ImportAttribute:["key","value"],Decorator:["expression"],DoExpression:["body"],ExportDefaultSpecifier:["exported"],RecordExpression:["properties"],TupleExpression:["elements"],DecimalLiteral:[],ModuleExpression:["body"],TopicReference:[],PipelineTopicExpression:["expression"],PipelineBareFunction:["callee"],PipelinePrimaryTopicReference:[],TSParameterProperty:["parameter","decorators"],TSDeclareFunction:["id","typeParameters","params","returnType","body"],TSDeclareMethod:["decorators","key","typeParameters","params","returnType"],TSQualifiedName:["left","right"],TSCallSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructSignatureDeclaration:["typeParameters","parameters","typeAnnotation","params","returnType"],TSPropertySignature:["key","typeAnnotation"],TSMethodSignature:["key","typeParameters","parameters","typeAnnotation","params","returnType"],TSIndexSignature:["parameters","typeAnnotation"],TSAnyKeyword:[],TSBooleanKeyword:[],TSBigIntKeyword:[],TSIntrinsicKeyword:[],TSNeverKeyword:[],TSNullKeyword:[],TSNumberKeyword:[],TSObjectKeyword:[],TSStringKeyword:[],TSSymbolKeyword:[],TSUndefinedKeyword:[],TSUnknownKeyword:[],TSVoidKeyword:[],TSThisType:[],TSFunctionType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSConstructorType:["typeParameters","parameters","typeAnnotation","params","returnType"],TSTypeReference:["typeName","typeParameters","typeArguments"],TSTypePredicate:["parameterName","typeAnnotation"],TSTypeQuery:["exprName","typeParameters","typeArguments"],TSTypeLiteral:["members"],TSArrayType:["elementType"],TSTupleType:["elementTypes"],TSOptionalType:["typeAnnotation"],TSRestType:["typeAnnotation"],TSNamedTupleMember:["label","elementType"],TSUnionType:["types"],TSIntersectionType:["types"],TSConditionalType:["checkType","extendsType","trueType","falseType"],TSInferType:["typeParameter"],TSParenthesizedType:["typeAnnotation"],TSTypeOperator:["typeAnnotation"],TSIndexedAccessType:["objectType","indexType"],TSMappedType:["typeParameter","typeAnnotation","nameType"],TSLiteralType:["literal"],TSExpressionWithTypeArguments:["expression","typeParameters"],TSInterfaceDeclaration:["id","typeParameters","extends","body"],TSInterfaceBody:["body"],TSTypeAliasDeclaration:["id","typeParameters","typeAnnotation"],TSInstantiationExpression:["expression","typeParameters","typeArguments"],TSAsExpression:["expression","typeAnnotation"],TSSatisfiesExpression:["expression","typeAnnotation"],TSTypeAssertion:["typeAnnotation","expression"],TSEnumDeclaration:["id","members"],TSEnumMember:["id","initializer"],TSModuleDeclaration:["id","body"],TSModuleBlock:["body"],TSImportType:["argument","qualifier","typeParameters","typeArguments"],TSImportEqualsDeclaration:["id","moduleReference"],TSExternalModuleReference:["expression"],TSNonNullExpression:["expression"],TSExportAssignment:["expression"],TSNamespaceExportDeclaration:["id"],TSTypeAnnotation:["typeAnnotation"],TSTypeParameterInstantiation:["params"],TSTypeParameterDeclaration:["params"],TSTypeParameter:["constraint","default","name"],ChainExpression:["expression"],ExperimentalRestProperty:["argument"],ExperimentalSpreadProperty:["argument"],Literal:[],MethodDefinition:["decorators","key","value"],PrivateIdentifier:[],Property:["key","value"],PropertyDefinition:["decorators","key","typeAnnotation","value","variance"],AccessorProperty:["decorators","key","typeAnnotation","value"],TSAbstractAccessorProperty:["decorators","key","typeAnnotation"],TSAbstractKeyword:[],TSAbstractMethodDefinition:["key","value"],TSAbstractPropertyDefinition:["decorators","key","typeAnnotation"],TSAsyncKeyword:[],TSClassImplements:["expression","typeArguments","typeParameters"],TSDeclareKeyword:[],TSEmptyBodyFunctionExpression:["id","typeParameters","params","returnType"],TSExportKeyword:[],TSInterfaceHeritage:["expression","typeArguments","typeParameters"],TSPrivateKeyword:[],TSProtectedKeyword:[],TSPublicKeyword:[],TSReadonlyKeyword:[],TSStaticKeyword:[],TSTemplateLiteralType:["quasis","types"],AsExpression:["expression","typeAnnotation"],BigIntLiteralTypeAnnotation:[],BigIntTypeAnnotation:[],ConditionalTypeAnnotation:["checkType","extendsType","trueType","falseType"],DeclareEnum:["id","body"],InferTypeAnnotation:["typeParameter"],KeyofTypeAnnotation:["argument"],ObjectTypeMappedTypeProperty:["keyTparam","propType","sourceType","variance"],QualifiedTypeofIdentifier:["qualification","id"],TupleTypeLabeledElement:["label","elementType","variance"],TupleTypeSpreadElement:["label","typeAnnotation"],TypeOperator:["typeAnnotation"],TypePredicate:["parameterName","typeAnnotation","asserts"],NGRoot:["node"],NGPipeExpression:["left","right","arguments"],NGChainedExpression:["expressions"],NGEmptyExpression:[],NGMicrosyntax:["body"],NGMicrosyntaxKey:[],NGMicrosyntaxExpression:["expression","alias"],NGMicrosyntaxKeyedExpression:["key","expression"],NGMicrosyntaxLet:["key","value"],NGMicrosyntaxAs:["key","alias"],JsExpressionRoot:["node"],JsonRoot:["node"],TSJSDocAllType:[],TSJSDocUnknownType:[],TSJSDocNullableType:["typeAnnotation"],TSJSDocNonNullableType:["typeAnnotation"],NeverTypeAnnotation:[],UndefinedTypeAnnotation:[],UnknownTypeAnnotation:[],AsConstExpression:["expression"],SatisfiesExpression:["expression","typeAnnotation"]};var lo=Sr(au),Br=lo;function mo(e){let t=new Set(e);return r=>t.has(r==null?void 0:r.type)}var M=mo;var Do=M(["Block","CommentBlock","MultiLine"]),ee=Do;var yo=M(["AnyTypeAnnotation","ThisTypeAnnotation","NumberTypeAnnotation","VoidTypeAnnotation","BooleanTypeAnnotation","BigIntTypeAnnotation","SymbolTypeAnnotation","StringTypeAnnotation","NeverTypeAnnotation","UndefinedTypeAnnotation","UnknownTypeAnnotation","EmptyTypeAnnotation","MixedTypeAnnotation"]),br=yo;function fo(e,t){let r=t.split(".");for(let n=r.length-1;n>=0;n--){let s=r[n];if(n===0)return e.type==="Identifier"&&e.name===s;if(e.type!=="MemberExpression"||e.optional||e.computed||e.property.type!=="Identifier"||e.property.name!==s)return!1;e=e.object}}function Eo(e,t){return t.some(r=>fo(e,r))}var ou=Eo;function Fo({type:e}){return e.startsWith("TS")&&e.endsWith("Keyword")}var Pr=Fo;function tr(e,t){return t(e)||zs(e,{getVisitorKeys:Br,predicate:t})}function jt(e){return e.type==="AssignmentExpression"||e.type==="BinaryExpression"||e.type==="LogicalExpression"||e.type==="NGPipeExpression"||e.type==="ConditionalExpression"||w(e)||q(e)||e.type==="SequenceExpression"||e.type==="TaggedTemplateExpression"||e.type==="BindExpression"||e.type==="UpdateExpression"&&!e.prefix||Ae(e)||e.type==="TSNonNullExpression"||e.type==="ChainExpression"}function lu(e){return e.expressions?e.expressions[0]:e.left??e.test??e.callee??e.object??e.tag??e.argument??e.expression}function Ir(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.")}var Rt=M(["Line","CommentLine","SingleLine","HashbangComment","HTMLOpen","HTMLClose","Hashbang","InterpreterDirective"]),mu=M(["ExportDefaultDeclaration","DeclareExportDeclaration","ExportNamedDeclaration","ExportAllDeclaration","DeclareExportAllDeclaration"]),G=M(["ArrayExpression","TupleExpression"]),se=M(["ObjectExpression","RecordExpression"]);function Pe(e){return e.type==="NumericLiteral"||e.type==="Literal"&&typeof e.value=="number"}function qn(e){return e.type==="UnaryExpression"&&(e.operator==="+"||e.operator==="-")&&Pe(e.argument)}function te(e){return e.type==="StringLiteral"||e.type==="Literal"&&typeof e.value=="string"}function Wn(e){return e.type==="RegExpLiteral"||e.type==="Literal"&&!!e.regex}var rr=M(["Literal","BooleanLiteral","BigIntLiteral","DecimalLiteral","DirectiveLiteral","NullLiteral","NumericLiteral","RegExpLiteral","StringLiteral"]),Du=M(["Identifier","ThisExpression","Super","PrivateName","PrivateIdentifier","Import"]),Le=M(["ObjectTypeAnnotation","TSTypeLiteral","TSMappedType"]),Mt=M(["FunctionExpression","ArrowFunctionExpression"]);function Co(e){return e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&e.body.type==="BlockStatement"}function _n(e){return w(e)&&e.callee.type==="Identifier"&&["async","inject","fakeAsync","waitForAsync"].includes(e.callee.name)}var U=M(["JSXElement","JSXFragment"]);function ht(e){return e.method&&e.kind==="init"||e.kind==="get"||e.kind==="set"}function Lr(e){return(e.type==="ObjectTypeProperty"||e.type==="ObjectTypeInternalSlot")&&!e.static&&!e.method&&e.kind!=="get"&&e.kind!=="set"&&e.value.type==="FunctionTypeAnnotation"}function yu(e){return(e.type==="TypeAnnotation"||e.type==="TSTypeAnnotation")&&e.typeAnnotation.type==="FunctionTypeAnnotation"&&!e.static&&!gt(e,e.typeAnnotation)}var me=M(["BinaryExpression","LogicalExpression","NGPipeExpression"]);function Et(e){return q(e)||e.type==="BindExpression"&&!!e.object}var Ao=M(["TSThisType","NullLiteralTypeAnnotation","BooleanLiteralTypeAnnotation","StringLiteralTypeAnnotation","BigIntLiteralTypeAnnotation","NumberLiteralTypeAnnotation","TSLiteralType","TSTemplateLiteralType"]);function Jt(e){return Pr(e)||br(e)||Ao(e)||(e.type==="GenericTypeAnnotation"||e.type==="TSTypeReference")&&!e.typeParameters}function To(e){let t=/^(?:before|after)(?:Each|All)$/;return e.callee.type==="Identifier"&&e.arguments.length===1&&t.test(e.callee.name)}var xo=["it","it.only","it.skip","describe","describe.only","describe.skip","test","test.only","test.skip","test.step","test.describe","test.describe.only","test.describe.parallel","test.describe.parallel.only","test.describe.serial","test.describe.serial.only","skip","xit","xdescribe","xtest","fit","fdescribe","ftest"];function go(e){return ou(e,xo)}function St(e,t){if(e.type!=="CallExpression")return!1;if(e.arguments.length===1){if(_n(e)&&t&&St(t))return Mt(e.arguments[0]);if(To(e))return _n(e.arguments[0])}else if((e.arguments.length===2||e.arguments.length===3)&&(e.arguments[0].type==="TemplateLiteral"||te(e.arguments[0]))&&go(e.callee))return e.arguments[2]&&!Pe(e.arguments[2])?!1:(e.arguments.length===2?Mt(e.arguments[1]):Co(e.arguments[1])&&$(e.arguments[1]).length<=1)||_n(e.arguments[1]);return!1}var fu=e=>t=>((t==null?void 0:t.type)==="ChainExpression"&&(t=t.expression),e(t)),w=fu(M(["CallExpression","OptionalCallExpression"])),q=fu(M(["MemberExpression","OptionalMemberExpression"]));function Eu(e){let t="expressions";e.type==="TSTemplateLiteralType"&&(t="types");let r=e[t];return r.length===0?!1:r.every(n=>{if(Rn(n)||Fu(n))return!0})}function Fu(e,{maxDepth:t=Number.POSITIVE_INFINITY}={}){if(A(e))return!1;if(e.type==="ChainExpression")return Fu(e.expression,{maxDepth:t});if(!q(e))return!1;let r=e,n=0;for(;q(r)&&n++<=t;)if(!Rn(r.property)||(r=r.object,A(r)))return!1;return Rn(r)}function Rn(e){return A(e)?!1:rr(e)||Du(e)}function Nn(e,t=5){return Cu(e,t)<=t}function Cu(e,t){let r=0;for(let n in e){let s=e[n];if(s&&typeof s=="object"&&typeof s.type=="string"&&(r++,r+=Cu(s,t-r)),r>t)return r}return r}var ho=.25;function nr(e,t){let{printWidth:r}=t;if(A(e))return!1;let n=r*ho;if(e.type==="ThisExpression"||e.type==="Identifier"&&e.name.length<=n||qn(e)&&!A(e.argument))return!0;let s=e.type==="Literal"&&"regex"in e&&e.regex.pattern||e.type==="RegExpLiteral"&&e.pattern;return s?s.length<=n:te(e)?at(De(e),t).length<=n:e.type==="TemplateLiteral"?e.expressions.length===0&&e.quasis[0].value.raw.length<=n&&!e.quasis[0].value.raw.includes(`
|
36 | `)),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){var h;let{node:u}=e;if(!me(u))return[D(t())];let i=[];sr(u.operator,u.left.operator)?i=e.call(g=>Fs(g,t,r,!0,s),"left"):i.push(D(t("left")));let a=Ut(u),o=(u.operator==="|>"||u.type==="NGPipeExpression"||Oc(e,r))&&!we(r.originalText,u.right),p=u.type==="NGPipeExpression"?"|":u.operator,m=u.type==="NGPipeExpression"&&u.arguments.length>0?D(E([F,": ",P([d,": "],e.map(()=>ge(2,D(t())),"arguments"))])):"",y;if(a)y=[p," ",t("right"),m];else{let S=p==="|>"&&((h=e.root.extra)==null?void 0:h.__isUsingHackPipeline)?e.call(B=>Fs(B,t,r,!0,s),"right"):t("right");y=[o?d:"",p,o?" ":d,S,m]}let{parent:c}=e,f=A(u.left,x.Trailing|x.Line),l=f||!(s&&u.type==="LogicalExpression")&&c.type!==u.type&&u.left.type!==u.type&&u.right.type!==u.type;if(i.push(o?"":" ",l?D(y,{shouldBreak:f}):y),n&&A(u)){let g=Nt(le(e,i,r));return Array.isArray(g)||g.type===de?qr(g):[g]}return i}function Ut(e){return e.type!=="LogicalExpression"?!1:!!(se(e.right)&&e.right.properties.length>0||G(e.right)&&e.right.elements.length>0||U(e.right))}var Si=e=>e.type==="BinaryExpression"&&e.operator==="|";function Oc(e,t){return(t.parser==="__vue_expression"||t.parser==="__vue_ts_expression")&&Si(e.node)&&!e.hasAncestor(r=>!Si(r)&&r.type!=="JsExpressionRoot")}function bi(e,t,r){let{node:n}=e;if(n.type.startsWith("NG"))switch(n.type){case"NGRoot":return[r("node"),A(n.node)?" //"+ot(n.node)[0].value.trimEnd():""];case"NGPipeExpression":return Hr(e,t,r);case"NGChainedExpression":return D(P([";",d],e.map(()=>_c(e)?r():["(",r(),")"],"expressions")));case"NGEmptyExpression":return"";case"NGMicrosyntax":return e.map(()=>[e.isFirst?"":Bi(e)?" ":[";",d],r()],"body");case"NGMicrosyntaxKey":return/^[$_a-z][\w$]*(?:-[$_a-z][\w$])*$/i.test(n.name)?n.name:JSON.stringify(n.name);case"NGMicrosyntaxExpression":return[r("expression"),n.alias===null?"":[" as ",r("alias")]];case"NGMicrosyntaxKeyedExpression":{let{index:s,parent:u}=e,i=Bi(e)||(s===1&&(n.key.name==="then"||n.key.name==="else"||n.key.name==="as")||(s===2||s===3)&&(n.key.name==="else"&&u.body[s-1].type==="NGMicrosyntaxKeyedExpression"&&u.body[s-1].key.name==="then"||n.key.name==="track"))&&u.body[0].type==="NGMicrosyntaxExpression";return[r("key"),i?" ":": ",r("expression")]}case"NGMicrosyntaxLet":return["let ",r("key"),n.value===null?"":[" = ",r("value")]];case"NGMicrosyntaxAs":return[r("key")," as ",r("alias")];default:throw new _e(n,"Angular")}}function Bi({node:e,index:t}){return e.type==="NGMicrosyntaxKeyedExpression"&&e.key.name==="of"&&t===1}var vc=M(["CallExpression","OptionalCallExpression","AssignmentExpression"]);function _c({node:e}){return tr(e,vc)}function Cs(e,t,r){let{node:n}=e;return D([P(d,e.map(r,"decorators")),Ii(n,t)?C:d])}function Pi(e,t,r){return Li(e.node)?[P(C,e.map(r,"declaration","decorators")),C]:""}function ki(e,t,r){let{node:n,parent:s}=e,{decorators:u}=n;if(!L(u)||Li(s)||$r(e))return"";let i=n.type==="ClassExpression"||n.type==="ClassDeclaration"||Ii(n,t);return[e.key==="declaration"&&mu(s)?C:i?Ee:"",P(d,e.map(r,"decorators")),d]}function Ii(e,t){return e.decorators.some(r=>Z(t.originalText,I(r)))}function Li(e){var r;if(e.type!=="ExportDefaultDeclaration"&&e.type!=="ExportNamedDeclaration"&&e.type!=="DeclareExportDeclaration")return!1;let t=(r=e.declaration)==null?void 0:r.decorators;return L(t)&>(e,t[0])}var mt=class extends Error{name="ArgExpansionBailout"};function Mc(e,t,r){let{node:n}=e,s=ae(n);if(s.length===0)return["(",J(e,t),")"];if(Jc(s))return["(",r(["arguments",0]),", ",r(["arguments",1]),")"];let u=!1,i=s.length-1,a=[];ur(e,({node:c},f)=>{let l=r();f===i||(fe(c,t)?(u=!0,l=[l,",",C,C]):l=[l,",",d]),a.push(l)});let p=!(n.type==="ImportExpression"||n.callee.type==="Import")&&ye(t,"all")?",":"";function m(){return D(["(",E([d,...a]),p,d,")"],{shouldBreak:!0})}if(u||e.parent.type!=="Decorator"&&Au(s))return m();if(Rc(s)){let c=a.slice(1);if(c.some(re))return m();let f;try{f=r(Yn(n,0),{expandFirstArg:!0})}catch(l){if(l instanceof mt)return m();throw l}return re(f)?[Ee,He([["(",D(f,{shouldBreak:!0}),", ",...c,")"],m()])]:He([["(",f,", ",...c,")"],["(",D(f,{shouldBreak:!0}),", ",...c,")"],m()])}if(jc(s,a,t)){let c=a.slice(0,-1);if(c.some(re))return m();let f;try{f=r(Yn(n,-1),{expandLastArg:!0})}catch(l){if(l instanceof mt)return m();throw l}return re(f)?[Ee,He([["(",...c,D(f,{shouldBreak:!0}),")"],m()])]:He([["(",...c,f,")"],["(",...c,D(f,{shouldBreak:!0}),")"],m()])}let y=["(",E([F,...a]),b(p),F,")"];return vr(e)?y:D(y,{shouldBreak:a.some(re)||u})}function mr(e,t=!1){return se(e)&&(e.properties.length>0||A(e))||G(e)&&(e.elements.length>0||A(e))||e.type==="TSTypeAssertion"&&mr(e.expression)||Ae(e)&&mr(e.expression)||e.type==="FunctionExpression"||e.type==="ArrowFunctionExpression"&&(!e.returnType||!e.returnType.typeAnnotation||e.returnType.typeAnnotation.type!=="TSTypeReference"||qc(e.body))&&(e.body.type==="BlockStatement"||e.body.type==="ArrowFunctionExpression"&&mr(e.body,!0)||se(e.body)||G(e.body)||!t&&(w(e.body)||e.body.type==="ConditionalExpression")||U(e.body))||e.type==="DoExpression"||e.type==="ModuleExpression"}function jc(e,t,r){var u,i;let n=v(!1,e,-1);if(e.length===1){let a=v(!1,t,-1);if((u=a.label)!=null&&u.embed&&((i=a.label)==null?void 0:i.hug)!==!1)return!0}let s=v(!1,e,-2);return!A(n,x.Leading)&&!A(n,x.Trailing)&&mr(n)&&(!s||s.type!==n.type)&&(e.length!==2||s.type!=="ArrowFunctionExpression"||!G(n))&&!(e.length>1&&As(n,r))}function Rc(e){if(e.length!==2)return!1;let[t,r]=e;return t.type==="ModuleExpression"&&Wc(r)?!0:!A(t)&&(t.type==="FunctionExpression"||t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement")&&r.type!=="FunctionExpression"&&r.type!=="ArrowFunctionExpression"&&r.type!=="ConditionalExpression"&&wi(r)&&!mr(r)}function wi(e){var t;if(e.type==="ParenthesizedExpression")return wi(e.expression);if(Ae(e)||e.type==="TypeCastExpression"){let{typeAnnotation:r}=e;return r.type==="TypeAnnotation"&&(r=r.typeAnnotation),r.type==="TSArrayType"&&(r=r.elementType,r.type==="TSArrayType"&&(r=r.elementType)),(r.type==="GenericTypeAnnotation"||r.type==="TSTypeReference")&&((t=r.typeParameters)==null?void 0:t.params.length)===1&&(r=r.typeParameters.params[0]),Jt(r)&&be(e.expression,1)}return pt(e)&&ae(e).length>1?!1:me(e)?be(e.left,1)&&be(e.right,1):Wn(e)||be(e)}function Jc(e){return e.length===2&&e[0].type==="ArrowFunctionExpression"&&$(e[0]).length===0&&e[0].body.type==="BlockStatement"&&e[1].type==="ArrayExpression"&&!e.some(t=>A(t))}function qc(e){return e.type==="BlockStatement"&&(e.body.some(t=>t.type!=="EmptyStatement")||A(e,x.Dangling))}function Wc(e){return e.type==="ObjectExpression"&&e.properties.length===1&&Ce(e.properties[0])&&e.properties[0].key.type==="Identifier"&&e.properties[0].key.name==="type"&&te(e.properties[0].value)&&e.properties[0].value.value==="module"}var Dr=Mc;var Nc=e=>((e.type==="ChainExpression"||e.type==="TSNonNullExpression")&&(e=e.expression),w(e)&&ae(e).length>0);function Oi(e,t,r){var p;let n=r("object"),s=ds(e,t,r),{node:u}=e,i=e.findAncestor(m=>!(q(m)||m.type==="TSNonNullExpression")),a=e.findAncestor(m=>!(m.type==="ChainExpression"||m.type==="TSNonNullExpression")),o=i&&(i.type==="NewExpression"||i.type==="BindExpression"||i.type==="AssignmentExpression"&&i.left.type!=="Identifier")||u.computed||u.object.type==="Identifier"&&u.property.type==="Identifier"&&!q(a)||(a.type==="AssignmentExpression"||a.type==="VariableDeclarator")&&(Nc(u.object)||((p=n.label)==null?void 0:p.memberChain));return st(n.label,[n,o?s:D(E([F,s]))])}function ds(e,t,r){let n=r("property"),{node:s}=e,u=V(e);return s.computed?!s.property||Pe(s.property)?[u,"[",n,"]"]:D([u,"[",E([F,n]),F,"]"]):[u,".",n]}function vi(e,t,r){if(e.node.type==="ChainExpression")return e.call(()=>vi(e,t,r),"expression");let{parent:n}=e,s=!n||n.type==="ExpressionStatement",u=[];function i(k){let{originalText:N}=t,Q=lt(N,I(k));return N.charAt(Q)===")"?Q!==!1&&_t(N,Q+1):fe(k,t)}function a(k){let{node:N}=k;if(N.type==="ChainExpression")return k.call(()=>a(k),"expression");if(w(N)&&(Et(N.callee)||w(N.callee))){let Q=i(N);u.unshift({node:N,hasTrailingEmptyLine:Q,printed:[le(k,[V(k),ze(k,t,r),Dr(k,t,r)],t),Q?C:""]}),k.call(je=>a(je),"callee")}else Et(N)?(u.unshift({node:N,needsParens:Be(k,t),printed:le(k,q(N)?ds(k,t,r):Kr(k,t,r),t)}),k.call(Q=>a(Q),"object")):N.type==="TSNonNullExpression"?(u.unshift({node:N,printed:le(k,"!",t)}),k.call(Q=>a(Q),"expression")):u.unshift({node:N,printed:r()})}let{node:o}=e;u.unshift({node:o,printed:[V(e),ze(e,t,r),Dr(e,t,r)]}),o.callee&&e.call(k=>a(k),"callee");let p=[],m=[u[0]],y=1;for(;y<u.length&&(u[y].node.type==="TSNonNullExpression"||w(u[y].node)||q(u[y].node)&&u[y].node.computed&&Pe(u[y].node.property));++y)m.push(u[y]);if(!w(u[0].node))for(;y+1<u.length&&(Et(u[y].node)&&Et(u[y+1].node));++y)m.push(u[y]);p.push(m),m=[];let c=!1;for(;y<u.length;++y){if(c&&Et(u[y].node)){if(u[y].node.computed&&Pe(u[y].node.property)){m.push(u[y]);continue}p.push(m),m=[],c=!1}(w(u[y].node)||u[y].node.type==="ImportExpression")&&(c=!0),m.push(u[y]),A(u[y].node,x.Trailing)&&(p.push(m),m=[],c=!1)}m.length>0&&p.push(m);function f(k){return/^[A-Z]|^[$_]+$/.test(k)}function l(k){return k.length<=t.tabWidth}function h(k){var je;let N=(je=k[1][0])==null?void 0:je.node.computed;if(k[0].length===1){let xt=k[0][0].node;return xt.type==="ThisExpression"||xt.type==="Identifier"&&(f(xt.name)||s&&l(xt.name)||N)}let Q=v(!1,k[0],-1).node;return q(Q)&&Q.property.type==="Identifier"&&(f(Q.property.name)||N)}let g=p.length>=2&&!A(p[1][0].node)&&h(p);function S(k){let N=k.map(Q=>Q.printed);return k.length>0&&v(!1,k,-1).needsParens?["(",...N,")"]:N}function B(k){return k.length===0?"":E([C,P(C,k.map(S))])}let O=p.map(S),R=O,_=g?3:2,T=p.flat(),W=T.slice(1,-1).some(k=>A(k.node,x.Leading))||T.slice(0,-1).some(k=>A(k.node,x.Trailing))||p[_]&&A(p[_][0].node,x.Leading);if(p.length<=_&&!W&&!p.some(k=>v(!1,k,-1).hasTrailingEmptyLine))return vr(e)?R:D(R);let Fe=v(!1,p[g?1:0],-1).node,X=!w(Fe)&&i(Fe),ue=[S(p[0]),g?p.slice(1,2).map(S):"",X?C:"",B(p.slice(g?2:1))],z=u.map(({node:k})=>k).filter(w);function wt(){let k=v(!1,v(!1,p,-1),-1).node,N=v(!1,O,-1);return w(k)&&re(N)&&z.slice(0,-1).some(Q=>Q.arguments.some(Mt))}let Ht;return W||z.length>2&&z.some(k=>!k.arguments.every(N=>be(N)))||O.slice(0,-1).some(re)||wt()?Ht=D(ue):Ht=[re(R)||X?Ee:"",He([R,ue])],st({memberChain:!0},Ht)}var _i=vi;function zr(e,t,r){var y;let{node:n,parent:s}=e,u=n.type==="NewExpression",i=n.type==="ImportExpression",a=V(e),o=ae(n),p=o.length===1&&wr(o[0],t.originalText);if(p||o.length>0&&!u&&!i&&(Uc(n,s)||St(n,s))){let c=[];if(ur(e,()=>{c.push(r())}),!(p&&((y=c[0].label)!=null&&y.embed)))return[u?"new ":"",r("callee"),a,ze(e,t,r),"(",P(", ",c),")"]}if(!i&&!u&&Et(n.callee)&&!e.call(c=>Be(c,t),"callee",...n.callee.type==="ChainExpression"?["expression"]:[]))return _i(e,t,r);let m=[u?"new ":"",i?Gc(n):r("callee"),a,ze(e,t,r),Dr(e,t,r)];return i||w(n.callee)?D(m):m}function Gc(e){return e.phase?`import.${e.phase}`:"import"}function Uc(e,t){if(e.callee.type!=="Identifier")return!1;if(e.callee.name==="require"){let r=ae(e);return r.length===1&&te(r[0])||r.length>1}if(e.callee.name==="define"){let r=ae(e);return t.type==="ExpressionStatement"&&(r.length===1||r.length===2&&r[0].type==="ArrayExpression"||r.length===3&&te(r[0])&&r[1].type==="ArrayExpression")}return!1}function dt(e,t,r,n,s,u){let i=Yc(e,t,r,n,u),a=u?r(u,{assignmentLayout:i}):"";switch(i){case"break-after-operator":return D([D(n),s,D(E([d,a]))]);case"never-break-after-operator":return D([D(n),s," ",a]);case"fluid":{let o=Symbol("assignment");return D([D(n),s,D(E(d),{id:o}),ke,Ct(a,{groupId:o})])}case"break-lhs":return D([n,s," ",D(a)]);case"chain":return[D(n),s,d,a];case"chain-tail":return[D(n),s,E([d,a])];case"chain-tail-arrow-chain":return[D(n),s,a];case"only-left":return n}}function ji(e,t,r){let{node:n}=e;return dt(e,t,r,r("left"),[" ",n.operator],"right")}function Ri(e,t,r){return dt(e,t,r,r("id")," =","init")}function Yc(e,t,r,n,s){let{node:u}=e,i=u[s];if(!i)return"only-left";let a=!Qr(i);if(e.match(Qr,Ji,c=>!a||c.type!=="ExpressionStatement"&&c.type!=="VariableDeclaration"))return a?i.type==="ArrowFunctionExpression"&&i.body.type==="ArrowFunctionExpression"?"chain-tail-arrow-chain":"chain-tail":"chain";if(!a&&Qr(i.right)||we(t.originalText,i))return"break-after-operator";if(i.type==="CallExpression"&&i.callee.name==="require"||t.parser==="json5"||t.parser==="jsonc"||t.parser==="json")return"never-break-after-operator";let m=vu(n);if(Vc(u)||zc(u)||Ts(u)&&m)return"break-lhs";let y=Zc(u,n,t);return e.call(()=>Xc(e,t,r,y),s)?"break-after-operator":$c(u)?"break-lhs":!m&&(y||i.type==="TemplateLiteral"||i.type==="TaggedTemplateExpression"||i.type==="BooleanLiteral"||Pe(i)||i.type==="ClassExpression")?"never-break-after-operator":"fluid"}function Xc(e,t,r,n){let s=e.node;if(me(s)&&!Ut(s))return!0;switch(s.type){case"StringLiteralTypeAnnotation":case"SequenceExpression":return!0;case"TSConditionalType":case"ConditionalTypeAnnotation":if(!t.experimentalTernaries&&!rl(s))break;return!0;case"ConditionalExpression":{if(!t.experimentalTernaries){let{test:p}=s;return me(p)&&!Ut(p)}let{consequent:a,alternate:o}=s;return a.type==="ConditionalExpression"||o.type==="ConditionalExpression"}case"ClassExpression":return L(s.decorators)}if(n)return!1;let u=s,i=[];for(;;)if(u.type==="UnaryExpression"||u.type==="AwaitExpression"||u.type==="YieldExpression"&&u.argument!==null)u=u.argument,i.push("argument");else if(u.type==="TSNonNullExpression")u=u.expression,i.push("expression");else break;return!!(te(u)||e.call(()=>qi(e,t,r),...i))}function Vc(e){if(Ji(e)){let t=e.left||e.id;return t.type==="ObjectPattern"&&t.properties.length>2&&t.properties.some(r=>{var n;return Ce(r)&&(!r.shorthand||((n=r.value)==null?void 0:n.type)==="AssignmentPattern")})}return!1}function Qr(e){return e.type==="AssignmentExpression"}function Ji(e){return Qr(e)||e.type==="VariableDeclarator"}function $c(e){let t=Kc(e);if(L(t)){let r=e.type==="TSTypeAliasDeclaration"?"constraint":"bound";if(t.length>1&&t.some(n=>n[r]||n.default))return!0}return!1}var Hc=M(["TSTypeAliasDeclaration","TypeAlias"]);function Kc(e){var t;if(Hc(e))return(t=e.typeParameters)==null?void 0:t.params}function zc(e){if(e.type!=="VariableDeclarator")return!1;let{typeAnnotation:t}=e.id;if(!t||!t.typeAnnotation)return!1;let r=Mi(t.typeAnnotation);return L(r)&&r.length>1&&r.some(n=>L(Mi(n))||n.type==="TSConditionalType")}function Ts(e){var t;return e.type==="VariableDeclarator"&&((t=e.init)==null?void 0:t.type)==="ArrowFunctionExpression"}var Qc=M(["TSTypeReference","GenericTypeAnnotation"]);function Mi(e){var t;if(Qc(e))return(t=e.typeParameters)==null?void 0:t.params}function qi(e,t,r,n=!1){var i;let{node:s}=e,u=()=>qi(e,t,r,!0);if(s.type==="ChainExpression"||s.type==="TSNonNullExpression")return e.call(u,"expression");if(w(s)){if((i=zr(e,t,r).label)!=null&&i.memberChain)return!1;let o=ae(s);return!(o.length===0||o.length===1&&nr(o[0],t))||el(s,r)?!1:e.call(u,"callee")}return q(s)?e.call(u,"object"):n&&(s.type==="Identifier"||s.type==="ThisExpression")}function Zc(e,t,r){return Ce(e)?(t=Nt(t),typeof t=="string"&&Ze(t)<r.tabWidth+3):!1}function el(e,t){let r=tl(e);if(L(r)){if(r.length>1)return!0;if(r.length===1){let s=r[0];if(We(s)||_r(s)||s.type==="TSTypeLiteral"||s.type==="ObjectTypeAnnotation")return!0}let n=e.typeParameters?"typeParameters":"typeArguments";if(re(t(n)))return!0}return!1}function tl(e){var t;return(t=e.typeParameters??e.typeArguments)==null?void 0:t.params}function rl(e){function t(r){switch(r.type){case"FunctionTypeAnnotation":case"GenericTypeAnnotation":case"TSFunctionType":case"TSTypeReference":return!!r.typeParameters;default:return!1}}return t(e.checkType)||t(e.extendsType)}function Dt(e,t,r,n,s){let u=e.node,i=$(u),a=s?ze(e,r,t):"";if(i.length===0)return[a,"(",J(e,r,{filter:l=>Ke(r.originalText,I(l))===")"}),")"];let{parent:o}=e,p=St(o),m=xs(u),y=[];if(gu(e,(l,h)=>{let g=h===i.length-1;g&&u.rest&&y.push("..."),y.push(t()),!g&&(y.push(","),p||m?y.push(" "):fe(i[h],r)?y.push(C,C):y.push(d))}),n&&!sl(e)){if(re(a)||re(y))throw new mt;return D([ar(a),"(",ar(y),")"])}let c=i.every(l=>!L(l.decorators));return m&&c?[a,"(",...y,")"]:p?[a,"(",...y,")"]:(Lr(o)||yu(o)||o.type==="TypeAlias"||o.type==="UnionTypeAnnotation"||o.type==="IntersectionTypeAnnotation"||o.type==="FunctionTypeAnnotation"&&o.returnType===u)&&i.length===1&&i[0].name===null&&u.this!==i[0]&&i[0].typeAnnotation&&u.typeParameters===null&&Jt(i[0].typeAnnotation)&&!u.rest?r.arrowParens==="always"?["(",...y,")"]:y:[a,"(",E([F,...y]),b(!xu(u)&&ye(r,"all")?",":""),F,")"]}function xs(e){if(!e)return!1;let t=$(e);if(t.length!==1)return!1;let[r]=t;return!A(r)&&(r.type==="ObjectPattern"||r.type==="ArrayPattern"||r.type==="Identifier"&&r.typeAnnotation&&(r.typeAnnotation.type==="TypeAnnotation"||r.typeAnnotation.type==="TSTypeAnnotation")&&Le(r.typeAnnotation.typeAnnotation)||r.type==="FunctionTypeParam"&&Le(r.typeAnnotation)&&r!==e.rest||r.type==="AssignmentPattern"&&(r.left.type==="ObjectPattern"||r.left.type==="ArrayPattern")&&(r.right.type==="Identifier"||se(r.right)&&r.right.properties.length===0||G(r.right)&&r.right.elements.length===0))}function nl(e){let t;return e.returnType?(t=e.returnType,t.typeAnnotation&&(t=t.typeAnnotation)):e.typeAnnotation&&(t=e.typeAnnotation),t}function kt(e,t){var s;let r=nl(e);if(!r)return!1;let n=(s=e.typeParameters)==null?void 0:s.params;if(n){if(n.length>1)return!1;if(n.length===1){let u=n[0];if(u.constraint||u.default)return!1}}return $(e).length===1&&(Le(r)||re(t))}function sl(e){return e.match(t=>t.type==="ArrowFunctionExpression"&&t.body.type==="BlockStatement",(t,r)=>{if(t.type==="CallExpression"&&r==="arguments"&&t.arguments.length===1&&t.callee.type==="CallExpression"){let n=t.callee.callee;return n.type==="Identifier"||n.type==="MemberExpression"&&!n.computed&&n.object.type==="Identifier"&&n.property.type==="Identifier"}return!1},(t,r)=>t.type==="VariableDeclarator"&&r==="init"||t.type==="ExportDefaultDeclaration"&&r==="declaration"||t.type==="TSExportAssignment"&&r==="expression"||t.type==="AssignmentExpression"&&r==="right"&&t.left.type==="MemberExpression"&&t.left.object.type==="Identifier"&&t.left.object.name==="module"&&t.left.property.type==="Identifier"&&t.left.property.name==="exports",t=>t.type!=="VariableDeclaration"||t.kind==="const"&&t.declarations.length===1)}function Wi(e){let t=$(e);return t.length>1&&t.some(r=>r.type==="TSParameterProperty")}var ul=M(["VoidTypeAnnotation","TSVoidKeyword","NullLiteralTypeAnnotation","TSNullKeyword"]),il=M(["ObjectTypeAnnotation","TSTypeLiteral","GenericTypeAnnotation","TSTypeReference"]);function al(e){let{types:t}=e;if(t.some(n=>A(n)))return!1;let r=t.find(n=>il(n));return r?t.every(n=>n===r||ul(n)):!1}function gs(e){return Jt(e)||Le(e)?!0:We(e)?al(e):!1}function Ni(e,t,r){let n=t.semi?";":"",{node:s}=e,u=[ne(e),"opaque type ",r("id"),r("typeParameters")];return s.supertype&&u.push(": ",r("supertype")),s.impltype&&u.push(" = ",r("impltype")),u.push(n),u}function Zr(e,t,r){let n=t.semi?";":"",{node:s}=e,u=[ne(e)];u.push("type ",r("id"),r("typeParameters"));let i=s.type==="TSTypeAliasDeclaration"?"typeAnnotation":"right";return[dt(e,t,r,u," =",i),n]}function en(e,t,r){let n=!1;return D(e.map(({isFirst:s,previous:u,node:i,index:a})=>{let o=r();if(s)return o;let p=Le(i),m=Le(u);return m&&p?[" & ",n?E(o):o]:!m&&!p?E([" &",d,o]):(a>1&&(n=!0),[" & ",a>1?E(o):o])},"types"))}function tn(e,t,r){let{node:n}=e,{parent:s}=e,u=s.type!=="TypeParameterInstantiation"&&(s.type!=="TSConditionalType"||!t.experimentalTernaries)&&(s.type!=="ConditionalTypeAnnotation"||!t.experimentalTernaries)&&s.type!=="TSTypeParameterInstantiation"&&s.type!=="GenericTypeAnnotation"&&s.type!=="TSTypeReference"&&s.type!=="TSTypeAssertion"&&s.type!=="TupleTypeAnnotation"&&s.type!=="TSTupleType"&&!(s.type==="FunctionTypeParam"&&!s.name&&e.grandparent.this!==s)&&!((s.type==="TypeAlias"||s.type==="VariableDeclarator"||s.type==="TSTypeAliasDeclaration")&&we(t.originalText,n)),i=gs(n),a=e.map(m=>{let y=r();return i||(y=ge(2,y)),le(m,y,t)},"types");if(i)return P(" | ",a);let o=u&&!we(t.originalText,n),p=[b([o?d:"","| "]),P([d,"| "],a)];return Be(e,t)?D([E(p),F]):(s.type==="TupleTypeAnnotation"||s.type==="TSTupleType")&&s[s.type==="TupleTypeAnnotation"&&s.types?"types":"elementTypes"].length>1?D([E([b(["(",F]),p]),F,b(")")]):D(u?E(p):p)}function ol(e){var n;let{node:t,parent:r}=e;return t.type==="FunctionTypeAnnotation"&&(Lr(r)||!((r.type==="ObjectTypeProperty"||r.type==="ObjectTypeInternalSlot")&&!r.variance&&!r.optional&>(r,t)||r.type==="ObjectTypeCallProperty"||((n=e.getParentNode(2))==null?void 0:n.type)==="DeclareFunction"))}function rn(e,t,r){let{node:n}=e,s=[Yt(e)];(n.type==="TSConstructorType"||n.type==="TSConstructSignatureDeclaration")&&s.push("new ");let u=Dt(e,r,t,!1,!0),i=[];return n.type==="FunctionTypeAnnotation"?i.push(ol(e)?" => ":": ",r("returnType")):i.push(Y(e,r,n.returnType?"returnType":"typeAnnotation")),kt(n,i)&&(u=D(u)),s.push(u,i),D(s)}function nn(e,t,r){return[r("objectType"),V(e),"[",r("indexType"),"]"]}function sn(e,t,r){return["infer ",r("typeParameter")]}function hs(e,t,r){let{node:n}=e;return[n.postfix?"":r,Y(e,t),n.postfix?r:""]}function un(e,t,r){let{node:n}=e;return["...",...n.type==="TupleTypeSpreadElement"&&n.label?[r("label"),": "]:[],r("typeAnnotation")]}function an(e,t,r){let{node:n}=e;return[n.variance?r("variance"):"",r("label"),n.optional?"?":"",": ",r("elementType")]}var pl=new WeakSet;function Y(e,t,r="typeAnnotation"){let{node:{[r]:n}}=e;if(!n)return"";let s=!1;if(n.type==="TSTypeAnnotation"||n.type==="TypeAnnotation"){let u=e.call(Gi,r);(u==="=>"||u===":"&&A(n,x.Leading))&&(s=!0),pl.add(n)}return s?[" ",t(r)]:t(r)}var Gi=e=>e.match(t=>t.type==="TSTypeAnnotation",(t,r)=>(r==="returnType"||r==="typeAnnotation")&&(t.type==="TSFunctionType"||t.type==="TSConstructorType"))?"=>":e.match(t=>t.type==="TSTypeAnnotation",(t,r)=>r==="typeAnnotation"&&(t.type==="TSJSDocNullableType"||t.type==="TSJSDocNonNullableType"||t.type==="TSTypePredicate"))||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="typeAnnotation"&&t.type==="Identifier",(t,r)=>r==="id"&&t.type==="DeclareFunction")||e.match(t=>t.type==="TypeAnnotation",(t,r)=>r==="bound"&&t.type==="TypeParameter"&&t.usesExtendsBound)?"":":";function on(e,t,r){let n=Gi(e);return n?[n," ",r("typeAnnotation")]:r("typeAnnotation")}function pn(e){return[e("elementType"),"[]"]}function cn({node:e},t){let r=e.type==="TSTypeQuery"?"exprName":"argument",n=e.type==="TSTypeQuery"?"typeParameters":"typeArguments";return["typeof ",t(r),t(n)]}function ln(e,t){let{node:r}=e;return[r.asserts?"asserts ":"",t("parameterName"),r.typeAnnotation?[" is ",Y(e,t)]:""]}function V(e){let{node:t}=e;return!t.optional||t.type==="Identifier"&&t===e.parent.key?"":w(t)||q(t)&&t.computed||t.type==="OptionalIndexedAccessType"?"?.":"?"}function mn(e){return e.node.definite||e.match(void 0,(t,r)=>r==="id"&&t.type==="VariableDeclarator"&&t.definite)?"!":""}var cl=new Set(["DeclareClass","DeclareFunction","DeclareVariable","DeclareExportDeclaration","DeclareExportAllDeclaration","DeclareOpaqueType","DeclareTypeAlias","DeclareEnum","DeclareInterface"]);function ne(e){let{node:t}=e;return t.declare||cl.has(t.type)&&e.parent.type!=="DeclareExportDeclaration"?"declare ":""}var ll=new Set(["TSAbstractMethodDefinition","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function Yt({node:e}){return e.abstract||ll.has(e.type)?"abstract ":""}function ze(e,t,r){let n=e.node;return n.typeArguments?r("typeArguments"):n.typeParameters?r("typeParameters"):""}function Kr(e,t,r){return["::",r("callee")]}function yt(e,t,r){return e.type==="EmptyStatement"?";":e.type==="BlockStatement"||r?[" ",t]:E([d,t])}function Dn(e,t){return["...",t("argument"),Y(e,t)]}function Xt(e){return e.accessibility?e.accessibility+" ":""}function ml(e,t,r,n){let{node:s}=e;return A(s,x.Dangling)?D([r,J(e,t,{indent:!0}),F,n]):[r,n]}function Vt(e,t,r){let{node:n}=e,s=[],u=n.type==="TupleExpression"?"#[":"[",i="]",a=n.type==="TupleTypeAnnotation"&&n.types?"types":n.type==="TSTupleType"||n.type==="TupleTypeAnnotation"?"elementTypes":"elements",o=n[a];if(o.length===0)s.push(ml(e,t,u,i));else{let p=v(!1,o,-1),m=(p==null?void 0:p.type)!=="RestElement",y=p===null,c=Symbol("array"),f=!t.__inJestEach&&o.length>1&&o.every((g,S,B)=>{let O=g==null?void 0:g.type;if(!G(g)&&!se(g))return!1;let R=B[S+1];if(R&&O!==R.type)return!1;let _=G(g)?"elements":"properties";return g[_]&&g[_].length>1}),l=As(n,t),h=m?y?",":ye(t)?l?b(",","",{groupId:c}):b(","):"":"";s.push(D([u,E([F,l?yl(e,t,r,h):[Dl(e,t,a,r),h],J(e,t)]),F,i],{shouldBreak:f,id:c}))}return s.push(V(e),Y(e,r)),s}function As(e,t){return G(e)&&e.elements.length>1&&e.elements.every(r=>r&&(Pe(r)||qn(r)&&!A(r.argument))&&!A(r,x.Trailing|x.Line,n=>!Z(t.originalText,j(n),{backwards:!0})))}function Ui({node:e},{originalText:t}){let r=s=>Ot(t,vt(t,s)),n=s=>t[s]===","?s:n(r(s+1));return _t(t,n(I(e)))}function Dl(e,t,r,n){let s=[];return e.each(({node:u,isLast:i})=>{s.push(u?D(n()):""),i||s.push([",",d,u&&Ui(e,t)?F:""])},r),s}function yl(e,t,r,n){let s=[];return e.each(({isLast:u,next:i})=>{s.push([r(),u?n:","]),u||s.push(Ui(e,t)?[C,C]:A(i,x.Leading|x.Line)?C:d)},"elements"),Wt(s)}var Yi=new Proxy(()=>{},{get:()=>Yi}),yn=Yi;function fl(e){return e.toLowerCase().replace(/^([+-]?[\d.]+e)(?:\+|(-))?0*(?=\d)/,"$1$2").replace(/^([+-]?[\d.]+)e[+-]?0+$/,"$1").replace(/^([+-])?\./,"$10.").replace(/(\.\d+?)0+(?=e|$)/,"$1").replace(/\.(?=e|$)/,"")}var Qe=fl;var fn=new WeakMap;function ft(e,t,r){let{node:n}=e;if(n.computed)return["[",r("key"),"]"];let{parent:s}=e,{key:u}=n;if(t.quoteProps==="consistent"&&!fn.has(s)){let i=(s.properties||s.body||s.members).some(a=>!a.computed&&a.key&&te(a.key)&&!Gn(a,t));fn.set(s,i)}if((u.type==="Identifier"||Pe(u)&&Un(Qe(De(u)))&&String(u.value)===Qe(De(u))&&!(t.parser==="typescript"||t.parser==="babel-ts"))&&(t.parser==="json"||t.parser==="jsonc"||t.quoteProps==="consistent"&&fn.get(s))){let i=at(JSON.stringify(u.type==="Identifier"?u.name:u.value.toString()),t);return e.call(a=>le(a,i,t),"key")}return Gn(n,t)&&(t.quoteProps==="as-needed"||t.quoteProps==="consistent"&&!fn.get(s))?e.call(i=>le(i,/^\d/.test(u.value)?Qe(u.value):u.value,t),"key"):r("key")}function Ss(e,t,r){let{node:n}=e;return n.shorthand?r("value"):dt(e,t,r,ft(e,t,r),":","value")}var El=({node:e,key:t,parent:r})=>t==="value"&&e.type==="FunctionExpression"&&(r.type==="ObjectMethod"||r.type==="ClassMethod"||r.type==="ClassPrivateMethod"||r.type==="MethodDefinition"||r.type==="TSAbstractMethodDefinition"||r.type==="TSDeclareMethod"||r.type==="Property"&&ht(r));function En(e,t,r,n){if(El(e))return Fn(e,r,t);let{node:s}=e,u=!1;if((s.type==="FunctionDeclaration"||s.type==="FunctionExpression")&&(n!=null&&n.expandLastArg)){let{parent:m}=e;w(m)&&(ae(m).length>1||$(s).every(y=>y.type==="Identifier"&&!y.typeAnnotation))&&(u=!0)}let i=[ne(e),s.async?"async ":"",`function${s.generator?"*":""} `,s.id?t("id"):""],a=Dt(e,t,r,u),o=An(e,t),p=kt(s,o);return i.push(ze(e,r,t),D([p?D(a):a,o]),s.body?" ":"",t("body")),r.semi&&(s.declare||!s.body)&&i.push(";"),i}function yr(e,t,r){let{node:n}=e,{kind:s}=n,u=n.value||n,i=[];return!s||s==="init"||s==="method"||s==="constructor"?u.async&&i.push("async "):(yn.ok(s==="get"||s==="set"),i.push(s," ")),u.generator&&i.push("*"),i.push(ft(e,t,r),n.optional||n.key.optional?"?":"",n===u?Fn(e,t,r):r("value")),i}function Fn(e,t,r){let{node:n}=e,s=Dt(e,r,t),u=An(e,r),i=Wi(n),a=kt(n,u),o=[ze(e,t,r),D([i?D(s,{shouldBreak:!0}):a?D(s):s,u])];return n.body?o.push(" ",r("body")):o.push(t.semi?";":""),o}function Fl(e){let t=$(e);return t.length===1&&!e.typeParameters&&!A(e,x.Dangling)&&t[0].type==="Identifier"&&!t[0].typeAnnotation&&!A(t[0])&&!t[0].optional&&!e.predicate&&!e.returnType}function Cn(e,t){if(t.arrowParens==="always")return!1;if(t.arrowParens==="avoid"){let{node:r}=e;return Fl(r)}return!1}function An(e,t){let{node:r}=e,s=[Y(e,t,"returnType")];return r.predicate&&s.push(t("predicate")),s}function Xi(e,t,r){let{node:n}=e,s=t.semi?";":"",u=[];if(n.argument){let o=r("argument");Cl(t,n.argument)?o=["(",E([C,o]),C,")"]:(me(n.argument)||n.argument.type==="SequenceExpression"||t.experimentalTernaries&&n.argument.type==="ConditionalExpression"&&(n.argument.consequent.type==="ConditionalExpression"||n.argument.alternate.type==="ConditionalExpression"))&&(o=D([b("("),E([F,o]),F,b(")")])),u.push(" ",o)}let i=A(n,x.Dangling),a=s&&i&&A(n,x.Last|x.Line);return a&&u.push(s),i&&u.push(" ",J(e,t)),a||u.push(s),u}function Vi(e,t,r){return["return",Xi(e,t,r)]}function $i(e,t,r){return["throw",Xi(e,t,r)]}function Cl(e,t){if(we(e.originalText,t)||A(t,x.Leading,r=>Te(e.originalText,j(r),I(r)))&&!U(t))return!0;if(jt(t)){let r=t,n;for(;n=lu(r);)if(r=n,we(e.originalText,r))return!0}return!1}var Bs=new WeakMap;function Hi(e){return Bs.has(e)||Bs.set(e,e.type==="ConditionalExpression"&&!ie(e,t=>t.type==="ObjectExpression")),Bs.get(e)}var Ki=e=>e.type==="SequenceExpression";function zi(e,t,r,n={}){let s=[],u,i=[],a=!1,o=!n.expandLastArg&&e.node.body.type==="ArrowFunctionExpression",p;(function g(){let{node:S}=e,B=Al(e,t,r,n);if(s.length===0)s.push(B);else{let{leading:O,trailing:R}=ms(e,t);s.push([O,B]),i.unshift(R)}o&&(a||(a=S.returnType&&$(S).length>0||S.typeParameters||$(S).some(O=>O.type!=="Identifier"))),!o||S.body.type!=="ArrowFunctionExpression"?(u=r("body",n),p=S.body):e.call(g,"body")})();let m=!we(t.originalText,p)&&(Ki(p)||dl(p,u,t)||!a&&Hi(p)),y=e.key==="callee"&&pt(e.parent),c=Symbol("arrow-chain"),f=Tl(e,n,{signatureDocs:s,shouldBreak:a}),l,h=!1;return o&&(y||n.assignmentLayout)&&(h=!0,l=n.assignmentLayout==="chain-tail-arrow-chain"||y&&!m),u=xl(e,t,n,{bodyDoc:u,bodyComments:i,functionBody:p,shouldPutBodyOnSameLine:m}),D([D(h?E([F,f]):f,{shouldBreak:l,id:c})," =>",o?Ct(u,{groupId:c}):D(u),o&&y?b(F,"",{groupId:c}):""])}function Al(e,t,r,n){let{node:s}=e,u=[];if(s.async&&u.push("async "),Cn(e,t))u.push(r(["params",0]));else{let a=n.expandLastArg||n.expandFirstArg,o=An(e,r);if(a){if(re(o))throw new mt;o=D(ar(o))}u.push(D([Dt(e,r,t,a,!0),o]))}let i=J(e,t,{filter(a){let o=lt(t.originalText,I(a));return o!==!1&&t.originalText.slice(o,o+2)==="=>"}});return i&&u.push(" ",i),u}function dl(e,t,r){var n,s;return G(e)||se(e)||e.type==="ArrowFunctionExpression"||e.type==="DoExpression"||e.type==="BlockStatement"||U(e)||((n=t.label)==null?void 0:n.hug)!==!1&&(((s=t.label)==null?void 0:s.embed)||wr(e,r.originalText))}function Tl(e,t,{signatureDocs:r,shouldBreak:n}){if(r.length===1)return r[0];let{parent:s,key:u}=e;return u!=="callee"&&pt(s)||me(s)?D([r[0]," =>",E([d,P([" =>",d],r.slice(1))])],{shouldBreak:n}):u==="callee"&&pt(s)||t.assignmentLayout?D(P([" =>",d],r),{shouldBreak:n}):D(E(P([" =>",d],r)),{shouldBreak:n})}function xl(e,t,r,{bodyDoc:n,bodyComments:s,functionBody:u,shouldPutBodyOnSameLine:i}){let{node:a,parent:o}=e,p=r.expandLastArg&&ye(t,"all")?b(","):"",m=(r.expandLastArg||o.type==="JSXExpressionContainer")&&!A(a)?F:"";return i&&Hi(u)?[" ",D([b("","("),E([F,n]),b("",")"),p,m]),s]:(Ki(u)&&(n=D(["(",E([F,n]),F,")"])),i?[" ",n,s]:[E([d,n,s]),p,m])}var gl=(e,t,r)=>{if(!(e&&t==null)){if(t.findLast)return t.findLast(r);for(let n=t.length-1;n>=0;n--){let s=t[n];if(r(s,n,t))return s}}},Qi=gl;function fr(e,t,r,n){let{node:s}=e,u=[],i=Qi(!1,s[n],a=>a.type!=="EmptyStatement");return e.each(({node:a})=>{a.type!=="EmptyStatement"&&(u.push(r()),a!==i&&(u.push(C),fe(a,t)&&u.push(C)))},n),u}function dn(e,t,r){let{node:n}=e,s=[];n.type==="StaticBlock"&&s.push("static "),s.push("{");let u=bs(e,t,r);if(u)s.push(E([C,u]),C);else{let{parent:i}=e,a=e.grandparent;i.type==="ArrowFunctionExpression"||i.type==="FunctionExpression"||i.type==="FunctionDeclaration"||i.type==="ObjectMethod"||i.type==="ClassMethod"||i.type==="ClassPrivateMethod"||i.type==="ForStatement"||i.type==="WhileStatement"||i.type==="DoWhileStatement"||i.type==="DoExpression"||i.type==="CatchClause"&&!a.finalizer||i.type==="TSModuleDeclaration"||i.type==="TSDeclareFunction"||n.type==="StaticBlock"||s.push(C)}return s.push("}"),s}function bs(e,t,r){var o;let{node:n}=e,s=L(n.directives),u=n.body.some(p=>p.type!=="EmptyStatement"),i=A(n,x.Dangling);if(!s&&!u&&!i)return"";let a=[];return s&&(a.push(fr(e,t,r,"directives")),(u||i)&&(a.push(C),fe(v(!1,n.directives,-1),t)&&a.push(C))),u&&a.push(fr(e,t,r,"body")),i&&a.push(J(e,t)),n.type==="Program"&&((o=e.parent)==null?void 0:o.type)!=="ModuleExpression"&&a.push(C),a}function hl(e){let t=new WeakMap;return function(r){return t.has(r)||t.set(r,Symbol(e)),t.get(r)}}var Tn=hl;function Sl(e){switch(e){case null:return"";case"PlusOptional":return"+?";case"MinusOptional":return"-?";case"Optional":return"?"}}function Zi(e,t,r){let{node:n}=e;return D([n.variance?r("variance"):"","[",E([r("keyTparam")," in ",r("sourceType")]),"]",Sl(n.optional),": ",r("propType")])}function Ps(e,t){return e==="+"||e==="-"?e+t:t}function ea(e,t,r){let{node:n}=e,s=Te(t.originalText,j(n),j(n.typeParameter));return D(["{",E([t.bracketSpacing?d:F,D([r("typeParameter"),n.optional?Ps(n.optional,"?"):"",n.typeAnnotation?": ":"",r("typeAnnotation")]),t.semi?b(";"):""]),J(e,t),t.bracketSpacing?d:F,"}"],{shouldBreak:s})}var Er=Tn("typeParameters");function Bl(e,t,r){let{node:n}=e;return $(n).length===1&&n.type.startsWith("TS")&&!n[r][0].constraint&&e.parent.type==="ArrowFunctionExpression"&&!(t.filepath&&/\.ts$/.test(t.filepath))}function It(e,t,r,n){let{node:s}=e;if(!s[n])return"";if(!Array.isArray(s[n]))return r(n);let u=e.getNode(2),i=u&&St(u),a=e.match(m=>!(m[n].length===1&&Le(m[n][0])),void 0,(m,y)=>y==="typeAnnotation",m=>m.type==="Identifier",Ts);if(s[n].length===0||!a&&(i||s[n].length===1&&(s[n][0].type==="NullableTypeAnnotation"||gs(s[n][0]))))return["<",P(", ",e.map(r,n)),bl(e,t),">"];let p=s.type==="TSTypeParameterInstantiation"?"":Bl(e,t,n)?",":ye(t)?b(","):"";return D(["<",E([F,P([",",d],e.map(r,n))]),p,F,">"],{id:Er(s)})}function bl(e,t){let{node:r}=e;if(!A(r,x.Dangling))return"";let n=!A(r,x.Line),s=J(e,t,{indent:!n});return n?s:[s,C]}function xn(e,t,r){let{node:n,parent:s}=e,u=[n.type==="TSTypeParameter"&&n.const?"const ":""],i=n.type==="TSTypeParameter"?r("name"):n.name;if(s.type==="TSMappedType")return s.readonly&&u.push(Ps(s.readonly,"readonly")," "),u.push("[",i),n.constraint&&u.push(" in ",r("constraint")),s.nameType&&u.push(" as ",e.callParent(()=>r("nameType"))),u.push("]"),u;if(n.variance&&u.push(r("variance")),n.in&&u.push("in "),n.out&&u.push("out "),u.push(i),n.bound&&(n.usesExtendsBound&&u.push(" extends "),u.push(Y(e,r,"bound"))),n.constraint){let a=Symbol("constraint");u.push(" extends",D(E(d),{id:a}),ke,Ct(r("constraint"),{groupId:a}))}return n.default&&u.push(" = ",r("default")),D(u)}var ta=M(["ClassProperty","PropertyDefinition","ClassPrivateProperty","ClassAccessorProperty","AccessorProperty","TSAbstractPropertyDefinition","TSAbstractAccessorProperty"]);function gn(e,t,r){let{node:n}=e,s=[ne(e),Yt(e),"class"],u=A(n.id,x.Trailing)||A(n.typeParameters,x.Trailing)||A(n.superClass)||L(n.extends)||L(n.mixins)||L(n.implements),i=[],a=[];if(n.id&&i.push(" ",r("id")),i.push(r("typeParameters")),n.superClass){let o=[kl(e,t,r),r("superTypeParameters")],p=e.call(m=>["extends ",le(m,o,t)],"superClass");u?a.push(d,D(p)):a.push(" ",p)}else a.push(ks(e,t,r,"extends"));if(a.push(ks(e,t,r,"mixins"),ks(e,t,r,"implements")),u){let o;na(n)?o=[...i,E(a)]:o=E([...i,a]),s.push(D(o,{id:ra(n)}))}else s.push(...i,...a);return s.push(" ",r("body")),s}var ra=Tn("heritageGroup");function Is(e){return b(C,"",{groupId:ra(e)})}function Pl(e){return["extends","mixins","implements"].reduce((t,r)=>t+(Array.isArray(e[r])?e[r].length:0),e.superClass?1:0)>1}function na(e){return e.typeParameters&&!A(e.typeParameters,x.Trailing|x.Line)&&!Pl(e)}function ks(e,t,r,n){let{node:s}=e;if(!L(s[n]))return"";let u=J(e,t,{marker:n});return[na(s)?b(" ",d,{groupId:Er(s.typeParameters)}):d,u,u&&C,n,D(E([d,P([",",d],e.map(r,n))]))]}function kl(e,t,r){let n=r("superClass"),{parent:s}=e;return s.type==="AssignmentExpression"?D(b(["(",E([F,n]),F,")"],n)):n}function hn(e,t,r){let{node:n}=e,s=[];return L(n.decorators)&&s.push(Cs(e,t,r)),s.push(Xt(n)),n.static&&s.push("static "),s.push(Yt(e)),n.override&&s.push("override "),s.push(yr(e,t,r)),s}function Sn(e,t,r){let{node:n}=e,s=[],u=t.semi?";":"";L(n.decorators)&&s.push(Cs(e,t,r)),s.push(Xt(n),ne(e)),n.static&&s.push("static "),s.push(Yt(e)),n.override&&s.push("override "),n.readonly&&s.push("readonly "),n.variance&&s.push(r("variance")),(n.type==="ClassAccessorProperty"||n.type==="AccessorProperty"||n.type==="TSAbstractAccessorProperty")&&s.push("accessor "),s.push(ft(e,t,r),V(e),mn(e),Y(e,r));let i=n.type==="TSAbstractPropertyDefinition"||n.type==="TSAbstractAccessorProperty";return[dt(e,t,r,s," =",i?void 0:"value"),u]}function sa(e,t,r){let{node:n}=e,s=[];return e.each(({node:u,next:i,isLast:a})=>{s.push(r()),!t.semi&&ta(u)&&Il(u,i)&&s.push(";"),a||(s.push(C),fe(u,t)&&s.push(C))},"body"),A(n,x.Dangling)&&s.push(J(e,t)),[L(n.body)?Is(e.parent):"","{",s.length>0?[E([C,s]),C]:"","}"]}function Il(e,t){var s;let{type:r,name:n}=e.key;if(!e.computed&&r==="Identifier"&&(n==="static"||n==="get"||n==="set")&&!e.value&&!e.typeAnnotation)return!0;if(!t||t.static||t.accessibility)return!1;if(!t.computed){let u=(s=t.key)==null?void 0:s.name;if(u==="in"||u==="instanceof")return!0}if(ta(t)&&t.variance&&!t.static&&!t.declare)return!0;switch(t.type){case"ClassProperty":case"PropertyDefinition":case"TSAbstractPropertyDefinition":return t.computed;case"MethodDefinition":case"TSAbstractMethodDefinition":case"ClassMethod":case"ClassPrivateMethod":{if((t.value?t.value.async:t.async)||t.kind==="get"||t.kind==="set")return!1;let i=t.value?t.value.generator:t.generator;return!!(t.computed||i)}case"TSIndexSignature":return!0}return!1}function ua(e,t){if(t.semi||Ls(e,t)||Os(e,t))return!1;let{node:r,key:n,parent:s}=e;return!!(r.type==="ExpressionStatement"&&(n==="body"&&(s.type==="Program"||s.type==="BlockStatement"||s.type==="StaticBlock"||s.type==="TSModuleBlock")||n==="consequent"&&s.type==="SwitchCase")&&e.call(()=>ia(e,t),"expression"))}function ia(e,t){let{node:r}=e;switch(r.type){case"ParenthesizedExpression":case"TypeCastExpression":case"ArrayExpression":case"ArrayPattern":case"TemplateLiteral":case"TemplateElement":case"RegExpLiteral":return!0;case"ArrowFunctionExpression":if(!Cn(e,t))return!0;break;case"UnaryExpression":{let{prefix:n,operator:s}=r;if(n&&(s==="+"||s==="-"))return!0;break}case"BindExpression":if(!r.object)return!0;break;case"Literal":if(r.regex)return!0;break;default:if(U(r))return!0}return Be(e,t)?!0:jt(r)?e.call(()=>ia(e,t),...Ir(r)):!1}function Ls({node:e,parent:t},r){return(r.parentParser==="markdown"||r.parentParser==="mdx")&&e.type==="ExpressionStatement"&&U(e.expression)&&t.type==="Program"&&t.body.length===1}function ws(e){switch(e.type){case"MemberExpression":switch(e.property.type){case"Identifier":case"NumericLiteral":case"StringLiteral":return ws(e.object)}return!1;case"Identifier":return!0;default:return!1}}function Os({node:e,parent:t},r){return(r.parser==="__vue_event_binding"||r.parser==="__vue_ts_event_binding")&&e.type==="ExpressionStatement"&&t.type==="Program"&&t.body.length===1}function aa(e,t,r){let n=[r("expression")];return Os(e,t)?ws(e.node.expression)&&n.push(";"):Ls(e,t)||t.semi&&n.push(";"),n}function oa(e,t,r){if(t.__isVueBindings||t.__isVueForBindingLeft){let n=e.map(r,"program","body",0,"params");if(n.length===1)return n[0];let s=P([",",d],n);return t.__isVueForBindingLeft?["(",E([F,D(s)]),F,")"]:s}if(t.__isEmbeddedTypescriptGenericParameters){let n=e.map(r,"program","body",0,"typeParameters","params");return P([",",d],n)}}function la(e,t){let{node:r}=e;switch(r.type){case"RegExpLiteral":return pa(r);case"BigIntLiteral":return Bn(r.extra.raw);case"NumericLiteral":return Qe(r.extra.raw);case"StringLiteral":return Ie(at(r.extra.raw,t));case"NullLiteral":return"null";case"BooleanLiteral":return String(r.value);case"DecimalLiteral":return Qe(r.value)+"m";case"DirectiveLiteral":return ca(r.extra.raw,t);case"Literal":{if(r.regex)return pa(r.regex);if(r.bigint)return Bn(r.raw);if(r.decimal)return Qe(r.decimal)+"m";let{value:n}=r;return typeof n=="number"?Qe(r.raw):typeof n=="string"?Ll(e)?ca(r.raw,t):Ie(at(r.raw,t)):String(n)}}}function Ll(e){if(e.key!=="expression")return;let{parent:t}=e;return t.type==="ExpressionStatement"&&t.directive}function Bn(e){return e.toLowerCase()}function pa({pattern:e,flags:t}){return t=[...t].sort().join(""),`/${e}/${t}`}function ca(e,t){let r=e.slice(1,-1);if(r.includes('"')||r.includes("'"))return e;let n=t.singleQuote?"'":'"';return n+r+n}function wl(e,t,r){let n=e.originalText.slice(t,r);for(let s of e[Symbol.for("comments")]){let u=j(s);if(u>r)break;let i=I(s);if(i<t)continue;let a=i-u;n=n.slice(0,u-t)+" ".repeat(a)+n.slice(i-t)}return n}var Fr=wl;function ma(e,t,r){let{node:n}=e;return["import",n.module?" module":"",n.phase?` ${n.phase}`:"",_s(n),fa(e,t,r),ya(e,t,r),Fa(e,t,r),t.semi?";":""]}var Da=e=>e.type==="ExportDefaultDeclaration"||e.type==="DeclareExportDeclaration"&&e.default;function bn(e,t,r){let{node:n}=e,s=[Pi(e,t,r),ne(e),"export",Da(n)?" default":""],{declaration:u,exported:i}=n;return A(n,x.Dangling)&&(s.push(" ",J(e,t)),Or(n)&&s.push(C)),u?s.push(" ",r("declaration")):(s.push(_l(n)),n.type==="ExportAllDeclaration"||n.type==="DeclareExportAllDeclaration"?(s.push(" *"),i&&s.push(" as ",r("exported"))):s.push(fa(e,t,r)),s.push(ya(e,t,r),Fa(e,t,r))),s.push(vl(n,t)),s}var Ol=M(["ClassDeclaration","FunctionDeclaration","TSInterfaceDeclaration","DeclareClass","DeclareFunction","TSDeclareFunction","EnumDeclaration"]);function vl(e,t){return t.semi&&(!e.declaration||Da(e)&&!Ol(e.declaration))?";":""}function vs(e,t=!0){return e&&e!=="value"?`${t?" ":""}${e}${t?"":" "}`:""}function _s(e,t){return vs(e.importKind,t)}function _l(e){return vs(e.exportKind)}function ya(e,t,r){let{node:n}=e;if(!n.source)return"";let s=[];return Ea(n,t)&&s.push(" from"),s.push(" ",r("source")),s}function fa(e,t,r){let{node:n}=e;if(!Ea(n,t))return"";let s=[" "];if(L(n.specifiers)){let u=[],i=[];e.each(()=>{let a=e.node.type;if(a==="ExportNamespaceSpecifier"||a==="ExportDefaultSpecifier"||a==="ImportNamespaceSpecifier"||a==="ImportDefaultSpecifier")u.push(r());else if(a==="ExportSpecifier"||a==="ImportSpecifier")i.push(r());else throw new _e(n,"specifier")},"specifiers"),s.push(P(", ",u)),i.length>0&&(u.length>0&&s.push(", "),i.length>1||u.length>0||n.specifiers.some(o=>A(o))?s.push(D(["{",E([t.bracketSpacing?d:F,P([",",d],i)]),b(ye(t)?",":""),t.bracketSpacing?d:F,"}"])):s.push(["{",t.bracketSpacing?" ":"",...i,t.bracketSpacing?" ":"","}"]))}else s.push("{}");return s}function Ea(e,t){return e.type!=="ImportDeclaration"||L(e.specifiers)||e.importKind==="type"?!0:Fr(t,j(e),j(e.source)).trimEnd().endsWith("from")}function Ml(e,t){var n,s;if((n=e.extra)!=null&&n.deprecatedAssertSyntax)return"assert";let r=Fr(t,I(e.source),(s=e.attributes)!=null&&s[0]?j(e.attributes[0]):I(e)).trimStart();return r.startsWith("assert")?"assert":r.startsWith("with")||L(e.attributes)?"with":void 0}function Fa(e,t,r){let{node:n}=e;if(!n.source)return"";let s=Ml(n,t);if(!s)return"";let u=[` ${s} {`];return L(n.attributes)&&(t.bracketSpacing&&u.push(" "),u.push(P(", ",e.map(r,"attributes"))),t.bracketSpacing&&u.push(" ")),u.push("}"),u}function Ca(e,t,r){let{node:n}=e,{type:s}=n,u=s.startsWith("Import"),i=u?"imported":"local",a=u?"local":"exported",o=n[i],p=n[a],m="",y="";return s==="ExportNamespaceSpecifier"||s==="ImportNamespaceSpecifier"?m="*":o&&(m=r(i)),p&&!jl(n)&&(y=r(a)),[vs(s==="ImportSpecifier"?n.importKind:n.exportKind,!1),m,m&&y?" as ":"",y]}function jl(e){if(e.type!=="ImportSpecifier"&&e.type!=="ExportSpecifier")return!1;let{local:t,[e.type==="ImportSpecifier"?"imported":"exported"]:r}=e;if(t.type!==r.type||!iu(t,r))return!1;if(te(t))return t.value===r.value&&De(t)===De(r);switch(t.type){case"Identifier":return t.name===r.name;default:return!1}}function Tt(e,t,r){var _;let n=t.semi?";":"",{node:s}=e,u=s.type==="ObjectTypeAnnotation",i=s.type==="TSEnumDeclaration"||s.type==="EnumBooleanBody"||s.type==="EnumNumberBody"||s.type==="EnumStringBody"||s.type==="EnumSymbolBody",a=[s.type==="TSTypeLiteral"||i?"members":s.type==="TSInterfaceBody"?"body":"properties"];u&&a.push("indexers","callProperties","internalSlots");let o=a.flatMap(T=>e.map(({node:W})=>({node:W,printed:r(),loc:j(W)}),T));a.length>1&&o.sort((T,W)=>T.loc-W.loc);let{parent:p,key:m}=e,y=u&&m==="body"&&(p.type==="InterfaceDeclaration"||p.type==="DeclareInterface"||p.type==="DeclareClass"),c=s.type==="TSInterfaceBody"||i||y||s.type==="ObjectPattern"&&p.type!=="FunctionDeclaration"&&p.type!=="FunctionExpression"&&p.type!=="ArrowFunctionExpression"&&p.type!=="ObjectMethod"&&p.type!=="ClassMethod"&&p.type!=="ClassPrivateMethod"&&p.type!=="AssignmentPattern"&&p.type!=="CatchClause"&&s.properties.some(T=>T.value&&(T.value.type==="ObjectPattern"||T.value.type==="ArrayPattern"))||s.type!=="ObjectPattern"&&o.length>0&&Te(t.originalText,j(s),o[0].loc),f=y?";":s.type==="TSInterfaceBody"||s.type==="TSTypeLiteral"?b(n,";"):",",l=s.type==="RecordExpression"?"#{":s.exact?"{|":"{",h=s.exact?"|}":"}",g=[],S=o.map(T=>{let W=[...g,D(T.printed)];return g=[f,d],(T.node.type==="TSPropertySignature"||T.node.type==="TSMethodSignature"||T.node.type==="TSConstructSignatureDeclaration"||T.node.type==="TSCallSignatureDeclaration")&&A(T.node,x.PrettierIgnore)&&g.shift(),fe(T.node,t)&&g.push(C),W});if(s.inexact||s.hasUnknownMembers){let T;if(A(s,x.Dangling)){let W=A(s,x.Line);T=[J(e,t),W||Z(t.originalText,I(v(!1,ot(s),-1)))?C:d,"..."]}else T=["..."];S.push([...g,...T])}let B=(_=v(!1,o,-1))==null?void 0:_.node,O=!(s.inexact||s.hasUnknownMembers||B&&(B.type==="RestElement"||(B.type==="TSPropertySignature"||B.type==="TSCallSignatureDeclaration"||B.type==="TSMethodSignature"||B.type==="TSConstructSignatureDeclaration")&&A(B,x.PrettierIgnore))),R;if(S.length===0){if(!A(s,x.Dangling))return[l,h,Y(e,r)];R=D([l,J(e,t,{indent:!0}),F,h,V(e),Y(e,r)])}else R=[y&&L(s.properties)?Is(p):"",l,E([t.bracketSpacing?d:F,...S]),b(O&&(f!==","||ye(t))?f:""),t.bracketSpacing?d:F,h,V(e),Y(e,r)];return e.match(T=>T.type==="ObjectPattern"&&!L(T.decorators),Ms)||Le(s)&&(e.match(void 0,(T,W)=>W==="typeAnnotation",(T,W)=>W==="typeAnnotation",Ms)||e.match(void 0,(T,W)=>T.type==="FunctionTypeParam"&&W==="typeAnnotation",Ms))||!c&&e.match(T=>T.type==="ObjectPattern",T=>T.type==="AssignmentExpression"||T.type==="VariableDeclarator")?R:D(R,{shouldBreak:c})}function Ms(e,t){return(t==="params"||t==="parameters"||t==="this"||t==="rest")&&xs(e)}function Rl(e){let t=[e];for(let r=0;r<t.length;r++){let n=t[r];for(let s of["test","consequent","alternate"]){let u=n[s];if(U(u))return!0;u.type==="ConditionalExpression"&&t.push(u)}}return!1}function Jl(e,t,r){let{node:n}=e,s=n.type==="ConditionalExpression",u=s?"alternate":"falseType",{parent:i}=e,a=s?r("test"):[r("checkType")," ","extends"," ",r("extendsType")];return i.type===n.type&&i[u]===n?ge(2,a):a}var ql=new Map([["AssignmentExpression","right"],["VariableDeclarator","init"],["ReturnStatement","argument"],["ThrowStatement","argument"],["UnaryExpression","argument"],["YieldExpression","argument"],["AwaitExpression","argument"]]);function Wl(e){let{node:t}=e;if(t.type!=="ConditionalExpression")return!1;let r,n=t;for(let s=0;!r;s++){let u=e.getParentNode(s);if(u.type==="ChainExpression"&&u.expression===n||w(u)&&u.callee===n||q(u)&&u.object===n||u.type==="TSNonNullExpression"&&u.expression===n){n=u;continue}u.type==="NewExpression"&&u.callee===n||Ae(u)&&u.expression===n?(r=e.getParentNode(s+1),n=u):r=u}return n===t?!1:r[ql.get(r.type)]===n}function Aa(e,t,r){let{node:n}=e,s=n.type==="ConditionalExpression",u=s?"consequent":"trueType",i=s?"alternate":"falseType",a=s?["test"]:["checkType","extendsType"],o=n[u],p=n[i],m=[],y=!1,{parent:c}=e,f=c.type===n.type&&a.some(X=>c[X]===n),l=c.type===n.type&&!f,h,g,S=0;do g=h||n,h=e.getParentNode(S),S++;while(h&&h.type===n.type&&a.every(X=>h[X]!==g));let B=h||c,O=g;if(s&&(U(n[a[0]])||U(o)||U(p)||Rl(O))){y=!0,l=!0;let X=z=>[b("("),E([F,z]),F,b(")")],ue=z=>z.type==="NullLiteral"||z.type==="Literal"&&z.value===null||z.type==="Identifier"&&z.name==="undefined";m.push(" ? ",ue(o)?r(u):X(r(u))," : ",p.type===n.type||ue(p)?r(i):X(r(i)))}else{let X=z=>t.useTabs?E(r(z)):ge(2,r(z)),ue=[d,"? ",o.type===n.type?b("","("):"",X(u),o.type===n.type?b("",")"):"",d,": ",X(i)];m.push(c.type!==n.type||c[i]===n||f?ue:t.useTabs?Rr(E(ue)):ge(Math.max(0,t.tabWidth-2),ue))}let R=[u,i,...a].some(X=>A(n[X],ue=>ee(ue)&&Te(t.originalText,j(ue),I(ue)))),_=X=>c===B?D(X,{shouldBreak:R}):R?[X,Ee]:X,T=!y&&(q(c)||c.type==="NGPipeExpression"&&c.left===n)&&!c.computed,W=Wl(e),Fe=_([Jl(e,t,r),l?m:E(m),s&&T&&!W?F:""]);return f||W?D([E([F,Fe]),F]):Fe}function Nl(e,t){return(q(t)||t.type==="NGPipeExpression"&&t.left===e)&&!t.computed}function Gl(e,t,r,n){return[...e.map(u=>ot(u)),ot(t),ot(r)].flat().some(u=>ee(u)&&Te(n.originalText,j(u),I(u)))}var Ul=new Map([["AssignmentExpression","right"],["VariableDeclarator","init"],["ReturnStatement","argument"],["ThrowStatement","argument"],["UnaryExpression","argument"],["YieldExpression","argument"],["AwaitExpression","argument"]]);function Yl(e){let{node:t}=e;if(t.type!=="ConditionalExpression")return!1;let r,n=t;for(let s=0;!r;s++){let u=e.getParentNode(s);if(u.type==="ChainExpression"&&u.expression===n||w(u)&&u.callee===n||q(u)&&u.object===n||u.type==="TSNonNullExpression"&&u.expression===n){n=u;continue}u.type==="NewExpression"&&u.callee===n||Ae(u)&&u.expression===n?(r=e.getParentNode(s+1),n=u):r=u}return n===t?!1:r[Ul.get(r.type)]===n}var js=e=>[b("("),E([F,e]),F,b(")")];function $t(e,t,r,n){if(!t.experimentalTernaries)return Aa(e,t,r);let{node:s}=e,u=s.type==="ConditionalExpression",i=s.type==="TSConditionalType"||s.type==="ConditionalTypeAnnotation",a=u?"consequent":"trueType",o=u?"alternate":"falseType",p=u?["test"]:["checkType","extendsType"],m=s[a],y=s[o],c=p.map(Re=>s[Re]),{parent:f}=e,l=f.type===s.type,h=l&&p.some(Re=>f[Re]===s),g=l&&f[o]===s,S=m.type===s.type,B=y.type===s.type,O=B||g,R=t.tabWidth>2||t.useTabs,_,T,W=0;do T=_||s,_=e.getParentNode(W),W++;while(_&&_.type===s.type&&p.every(Re=>_[Re]!==T));let Fe=_||f,X=n&&n.assignmentLayout&&n.assignmentLayout!=="break-after-operator"&&(f.type==="AssignmentExpression"||f.type==="VariableDeclarator"||f.type==="ClassProperty"||f.type==="PropertyDefinition"||f.type==="ClassPrivateProperty"||f.type==="ObjectProperty"||f.type==="Property"),ue=(f.type==="ReturnStatement"||f.type==="ThrowStatement")&&!(S||B),z=u&&Fe.type==="JSXExpressionContainer"&&e.grandparent.type!=="JSXAttribute",wt=Yl(e),Ht=Nl(s,f),k=i&&Be(e,t),N=R?t.useTabs?" ":" ".repeat(t.tabWidth-1):"",Q=Gl(c,m,y,t)||S||B,je=!O&&!l&&!i&&(z?m.type==="NullLiteral"||m.type==="Literal"&&m.value===null:nr(m,t)&&Nn(s.test,3)),xt=O||g||i&&!l||l&&u&&Nn(s.test,1)||je,Ws=[];!S&&A(m,x.Dangling)&&e.call(Re=>{Ws.push(J(Re,t),C)},"consequent");let Kt=[];A(s.test,x.Dangling)&&e.call(Re=>{Kt.push(J(Re,t))},"test"),!B&&A(y,x.Dangling)&&e.call(Re=>{Kt.push(J(Re,t))},"alternate"),A(s,x.Dangling)&&Kt.push(J(e,t));let Ns=Symbol("test"),wa=Symbol("consequent"),Ar=Symbol("test-and-consequent"),Oa=u?[js(r("test")),s.test.type==="ConditionalExpression"?Ee:""]:[r("checkType")," ","extends"," ",s.extendsType.type==="TSConditionalType"||s.extendsType.type==="ConditionalTypeAnnotation"||s.extendsType.type==="TSMappedType"?r("extendsType"):D(js(r("extendsType")))],Gs=D([Oa," ?"],{id:Ns}),va=r(a),dr=E([S||z&&(U(m)||l||O)?C:d,Ws,va]),_a=xt?D([Gs,O?dr:b(dr,D(dr,{id:wa}),{groupId:Ns})],{id:Ar}):[Gs,dr],wn=r(o),Us=je?b(wn,Rr(js(wn)),{groupId:Ar}):wn,zt=[_a,Kt.length>0?[E([C,Kt]),C]:B?C:je?b(d," ",{groupId:Ar}):d,":",B?" ":R?xt?b(N,b(O||je?" ":N," "),{groupId:Ar}):b(N," "):" ",B?Us:D([E(Us),z&&!je?F:""]),Ht&&!wt?F:"",Q?Ee:""];return X&&!Q?D(E([F,D(zt)])):X||ue?D(E(zt)):wt||i&&h?D([E([F,zt]),k?F:""]):f===Fe?D(zt):zt}function da(e,t,r,n){let{node:s}=e;if(rr(s))return la(e,t);let u=t.semi?";":"",i=[];switch(s.type){case"JsExpressionRoot":return r("node");case"JsonRoot":return[r("node"),C];case"File":return oa(e,t,r)??r("program");case"Program":return bs(e,t,r);case"EmptyStatement":return"";case"ExpressionStatement":return aa(e,t,r);case"ChainExpression":return r("expression");case"ParenthesizedExpression":return!A(s.expression)&&(se(s.expression)||G(s.expression))?["(",r("expression"),")"]:D(["(",E([F,r("expression")]),F,")"]);case"AssignmentExpression":return ji(e,t,r);case"VariableDeclarator":return Ri(e,t,r);case"BinaryExpression":case"LogicalExpression":return Hr(e,t,r);case"AssignmentPattern":return[r("left")," = ",r("right")];case"OptionalMemberExpression":case"MemberExpression":return Oi(e,t,r);case"MetaProperty":return[r("meta"),".",r("property")];case"BindExpression":return s.object&&i.push(r("object")),i.push(D(E([F,Kr(e,t,r)]))),i;case"Identifier":return[s.name,V(e),mn(e),Y(e,r)];case"V8IntrinsicIdentifier":return["%",s.name];case"SpreadElement":case"SpreadElementPattern":case"SpreadPropertyPattern":case"RestElement":return Dn(e,r);case"FunctionDeclaration":case"FunctionExpression":return En(e,r,t,n);case"ArrowFunctionExpression":return zi(e,t,r,n);case"YieldExpression":return i.push("yield"),s.delegate&&i.push("*"),s.argument&&i.push(" ",r("argument")),i;case"AwaitExpression":if(i.push("await"),s.argument){i.push(" ",r("argument"));let{parent:a}=e;if(w(a)&&a.callee===s||q(a)&&a.object===s){i=[E([F,...i]),F];let o=e.findAncestor(p=>p.type==="AwaitExpression"||p.type==="BlockStatement");if((o==null?void 0:o.type)!=="AwaitExpression"||!ie(o.argument,p=>p===s))return D(i)}}return i;case"ExportDefaultDeclaration":case"ExportNamedDeclaration":case"ExportAllDeclaration":return bn(e,t,r);case"ImportDeclaration":return ma(e,t,r);case"ImportSpecifier":case"ExportSpecifier":case"ImportNamespaceSpecifier":case"ExportNamespaceSpecifier":case"ImportDefaultSpecifier":case"ExportDefaultSpecifier":return Ca(e,t,r);case"ImportAttribute":return[r("key"),": ",r("value")];case"Import":return"import";case"BlockStatement":case"StaticBlock":return dn(e,t,r);case"ClassBody":return sa(e,t,r);case"ThrowStatement":return $i(e,t,r);case"ReturnStatement":return Vi(e,t,r);case"NewExpression":case"ImportExpression":case"OptionalCallExpression":case"CallExpression":return zr(e,t,r);case"ObjectExpression":case"ObjectPattern":case"RecordExpression":return Tt(e,t,r);case"Property":return ht(s)?yr(e,t,r):Ss(e,t,r);case"ObjectProperty":return Ss(e,t,r);case"ObjectMethod":return yr(e,t,r);case"Decorator":return["@",r("expression")];case"ArrayExpression":case"ArrayPattern":case"TupleExpression":return Vt(e,t,r);case"SequenceExpression":{let{parent:a}=e;if(a.type==="ExpressionStatement"||a.type==="ForStatement"){let o=[];return e.each(({isFirst:p})=>{p?o.push(r()):o.push(",",E([d,r()]))},"expressions"),D(o)}return D(P([",",d],e.map(r,"expressions")))}case"ThisExpression":return"this";case"Super":return"super";case"Directive":return[r("value"),u];case"UnaryExpression":return i.push(s.operator),/[a-z]$/.test(s.operator)&&i.push(" "),A(s.argument)?i.push(D(["(",E([F,r("argument")]),F,")"])):i.push(r("argument")),i;case"UpdateExpression":return i.push(r("argument"),s.operator),s.prefix&&i.reverse(),i;case"ConditionalExpression":return $t(e,t,r,n);case"VariableDeclaration":{let a=e.map(r,"declarations"),o=e.parent,p=o.type==="ForStatement"||o.type==="ForInStatement"||o.type==="ForOfStatement",m=s.declarations.some(c=>c.init),y;return a.length===1&&!A(s.declarations[0])?y=a[0]:a.length>0&&(y=E(a[0])),i=[ne(e),s.kind,y?[" ",y]:"",E(a.slice(1).map(c=>[",",m&&!p?C:d,c]))],p&&o.body!==s||i.push(u),D(i)}case"WithStatement":return D(["with (",r("object"),")",yt(s.body,r("body"))]);case"IfStatement":{let a=yt(s.consequent,r("consequent")),o=D(["if (",D([E([F,r("test")]),F]),")",a]);if(i.push(o),s.alternate){let p=A(s.consequent,x.Trailing|x.Line)||Or(s),m=s.consequent.type==="BlockStatement"&&!p;i.push(m?" ":C),A(s,x.Dangling)&&i.push(J(e,t),p?C:" "),i.push("else",D(yt(s.alternate,r("alternate"),s.alternate.type==="IfStatement")))}return i}case"ForStatement":{let a=yt(s.body,r("body")),o=J(e,t),p=o?[o,F]:"";return!s.init&&!s.test&&!s.update?[p,D(["for (;;)",a])]:[p,D(["for (",D([E([F,r("init"),";",d,r("test"),";",d,r("update")]),F]),")",a])]}case"WhileStatement":return D(["while (",D([E([F,r("test")]),F]),")",yt(s.body,r("body"))]);case"ForInStatement":return D(["for (",r("left")," in ",r("right"),")",yt(s.body,r("body"))]);case"ForOfStatement":return D(["for",s.await?" await":""," (",r("left")," of ",r("right"),")",yt(s.body,r("body"))]);case"DoWhileStatement":{let a=yt(s.body,r("body"));return i=[D(["do",a])],s.body.type==="BlockStatement"?i.push(" "):i.push(C),i.push("while (",D([E([F,r("test")]),F]),")",u),i}case"DoExpression":return[s.async?"async ":"","do ",r("body")];case"BreakStatement":case"ContinueStatement":return i.push(s.type==="BreakStatement"?"break":"continue"),s.label&&i.push(" ",r("label")),i.push(u),i;case"LabeledStatement":return s.body.type==="EmptyStatement"?[r("label"),":;"]:[r("label"),": ",r("body")];case"TryStatement":return["try ",r("block"),s.handler?[" ",r("handler")]:"",s.finalizer?[" finally ",r("finalizer")]:""];case"CatchClause":if(s.param){let a=A(s.param,p=>!ee(p)||p.leading&&Z(t.originalText,I(p))||p.trailing&&Z(t.originalText,j(p),{backwards:!0})),o=r("param");return["catch ",a?["(",E([F,o]),F,") "]:["(",o,") "],r("body")]}return["catch ",r("body")];case"SwitchStatement":return[D(["switch (",E([F,r("discriminant")]),F,")"])," {",s.cases.length>0?E([C,P(C,e.map(({node:a,isLast:o})=>[r(),!o&&fe(a,t)?C:""],"cases"))]):"",C,"}"];case"SwitchCase":{s.test?i.push("case ",r("test"),":"):i.push("default:"),A(s,x.Dangling)&&i.push(" ",J(e,t));let a=s.consequent.filter(o=>o.type!=="EmptyStatement");if(a.length>0){let o=fr(e,t,r,"consequent");i.push(a.length===1&&a[0].type==="BlockStatement"?[" ",o]:E([C,o]))}return i}case"DebuggerStatement":return["debugger",u];case"ClassDeclaration":case"ClassExpression":return gn(e,t,r);case"ClassMethod":case"ClassPrivateMethod":case"MethodDefinition":return hn(e,t,r);case"ClassProperty":case"PropertyDefinition":case"ClassPrivateProperty":case"ClassAccessorProperty":case"AccessorProperty":return Sn(e,t,r);case"TemplateElement":return Ie(s.value.raw);case"TemplateLiteral":return Gr(e,r,t);case"TaggedTemplateExpression":return zu(r);case"PrivateIdentifier":return["#",s.name];case"PrivateName":return["#",r("id")];case"TopicReference":return"%";case"ArgumentPlaceholder":return"?";case"ModuleExpression":{i.push("module {");let a=r("body");return a&&i.push(E([C,a]),C),i.push("}"),i}case"InterpreterDirective":default:throw new _e(s,"ESTree")}}function Pn(e,t,r){let{parent:n,node:s,key:u}=e,i=[r("expression")];switch(s.type){case"AsConstExpression":i.push(" as const");break;case"AsExpression":case"TSAsExpression":i.push(" as ",r("typeAnnotation"));break;case"SatisfiesExpression":case"TSSatisfiesExpression":i.push(" satisfies ",r("typeAnnotation"));break}return u==="callee"&&w(n)||u==="object"&&q(n)?D([E([F,...i]),F]):i}function Ta(e,t,r){return Tt(e,r,t)}function kn(e,t){let{node:r}=e,n=t("id");r.computed&&(n=["[",n,"]"]);let s="";return r.initializer&&(s=t("initializer")),r.init&&(s=t("init")),s?[n," = ",s]:n}function xa(e,t,r){let{node:n}=e,s;if(n.type==="EnumSymbolBody"||n.explicitType)switch(n.type){case"EnumBooleanBody":s="boolean";break;case"EnumNumberBody":s="number";break;case"EnumStringBody":s="string";break;case"EnumSymbolBody":s="symbol";break}return[s?`of ${s} `:"",Ta(e,t,r)]}function In(e,t,r){let{node:n}=e;return[ne(e),n.const?"const ":"","enum ",t("id")," ",n.type==="TSEnumDeclaration"?Ta(e,t,r):t("body")]}function Ln(e,t,r){let{node:n}=e,s=[ne(e),"interface"],u=[],i=[];n.type!=="InterfaceTypeAnnotation"&&u.push(" ",r("id"),r("typeParameters"));let a=n.typeParameters&&!A(n.typeParameters,x.Trailing|x.Line);return L(n.extends)&&i.push(a?b(" ",d,{groupId:Er(n.typeParameters)}):d,"extends ",(n.extends.length===1?du:E)(P([",",d],e.map(r,"extends")))),A(n.id,x.Trailing)||L(n.extends)?a?s.push(D([...u,E(i)])):s.push(D(E([...u,...i]))):s.push(...u,...i),s.push(" ",r("body")),D(s)}function ga(e,t,r){let{node:n}=e;if(br(n))return n.type.slice(0,-14).toLowerCase();let s=t.semi?";":"";switch(n.type){case"DeclareClass":return gn(e,t,r);case"DeclareFunction":return[ne(e),"function ",r("id"),r("predicate"),s];case"DeclareModule":return["declare module ",r("id")," ",r("body")];case"DeclareModuleExports":return["declare module.exports",Y(e,r),s];case"DeclareVariable":return[ne(e),n.kind??"var"," ",r("id"),s];case"DeclareExportDeclaration":case"DeclareExportAllDeclaration":return bn(e,t,r);case"DeclareOpaqueType":case"OpaqueType":return Ni(e,t,r);case"DeclareTypeAlias":case"TypeAlias":return Zr(e,t,r);case"IntersectionTypeAnnotation":return en(e,t,r);case"UnionTypeAnnotation":return tn(e,t,r);case"ConditionalTypeAnnotation":return $t(e,t,r);case"InferTypeAnnotation":return sn(e,t,r);case"FunctionTypeAnnotation":return rn(e,t,r);case"TupleTypeAnnotation":return Vt(e,t,r);case"TupleTypeLabeledElement":return an(e,t,r);case"TupleTypeSpreadElement":return un(e,t,r);case"GenericTypeAnnotation":return[r("id"),It(e,t,r,"typeParameters")];case"IndexedAccessType":case"OptionalIndexedAccessType":return nn(e,t,r);case"TypeAnnotation":return on(e,t,r);case"TypeParameter":return xn(e,t,r);case"TypeofTypeAnnotation":return cn(e,r);case"ExistsTypeAnnotation":return"*";case"ArrayTypeAnnotation":return pn(r);case"DeclareEnum":case"EnumDeclaration":return In(e,r,t);case"EnumBooleanBody":case"EnumNumberBody":case"EnumStringBody":case"EnumSymbolBody":return xa(e,r,t);case"EnumBooleanMember":case"EnumNumberMember":case"EnumStringMember":case"EnumDefaultedMember":return kn(e,r);case"FunctionTypeParam":{let u=n.name?r("name"):e.parent.this===n?"this":"";return[u,V(e),u?": ":"",r("typeAnnotation")]}case"DeclareInterface":case"InterfaceDeclaration":case"InterfaceTypeAnnotation":return Ln(e,t,r);case"ClassImplements":case"InterfaceExtends":return[r("id"),r("typeParameters")];case"NullableTypeAnnotation":return["?",r("typeAnnotation")];case"Variance":{let{kind:u}=n;return yn.ok(u==="plus"||u==="minus"),u==="plus"?"+":"-"}case"KeyofTypeAnnotation":return["keyof ",r("argument")];case"ObjectTypeCallProperty":return[n.static?"static ":"",r("value")];case"ObjectTypeMappedTypeProperty":return Zi(e,t,r);case"ObjectTypeIndexer":return[n.static?"static ":"",n.variance?r("variance"):"","[",r("id"),n.id?": ":"",r("key"),"]: ",r("value")];case"ObjectTypeProperty":{let u="";return n.proto?u="proto ":n.static&&(u="static "),[u,n.kind!=="init"?n.kind+" ":"",n.variance?r("variance"):"",ft(e,t,r),V(e),ht(n)?"":": ",r("value")]}case"ObjectTypeAnnotation":return Tt(e,t,r);case"ObjectTypeInternalSlot":return[n.static?"static ":"","[[",r("id"),"]]",V(e),n.method?"":": ",r("value")];case"ObjectTypeSpreadProperty":return Dn(e,r);case"QualifiedTypeofIdentifier":case"QualifiedTypeIdentifier":return[r("qualification"),".",r("id")];case"NullLiteralTypeAnnotation":return"null";case"BooleanLiteralTypeAnnotation":return String(n.value);case"StringLiteralTypeAnnotation":return Ie(at(De(n),t));case"NumberLiteralTypeAnnotation":return Qe(n.raw??n.extra.raw);case"BigIntLiteralTypeAnnotation":return Bn(n.raw??n.extra.raw);case"TypeCastExpression":return["(",r("expression"),Y(e,r),")"];case"TypePredicate":return ln(e,r);case"TypeParameterDeclaration":case"TypeParameterInstantiation":return It(e,t,r,"params");case"InferredPredicate":case"DeclaredPredicate":return[e.key==="predicate"&&e.parent.type!=="DeclareFunction"&&!e.parent.returnType?": ":" ","%checks",...n.type==="DeclaredPredicate"?["(",r("value"),")"]:[]];case"AsExpression":case"AsConstExpression":case"SatisfiesExpression":return Pn(e,t,r)}}function ha(e,t,r){var i;let{node:n}=e;if(!n.type.startsWith("TS"))return;if(Pr(n))return n.type.slice(2,-7).toLowerCase();let s=t.semi?";":"",u=[];switch(n.type){case"TSThisType":return"this";case"TSTypeAssertion":{let a=!(G(n.expression)||se(n.expression)),o=D(["<",E([F,r("typeAnnotation")]),F,">"]),p=[b("("),E([F,r("expression")]),F,b(")")];return a?He([[o,r("expression")],[o,D(p,{shouldBreak:!0})],[o,r("expression")]]):D([o,r("expression")])}case"TSDeclareFunction":return En(e,r,t);case"TSExportAssignment":return["export = ",r("expression"),s];case"TSModuleBlock":return dn(e,t,r);case"TSInterfaceBody":case"TSTypeLiteral":return Tt(e,t,r);case"TSTypeAliasDeclaration":return Zr(e,t,r);case"TSQualifiedName":return[r("left"),".",r("right")];case"TSAbstractMethodDefinition":case"TSDeclareMethod":return hn(e,t,r);case"TSAbstractAccessorProperty":case"TSAbstractPropertyDefinition":return Sn(e,t,r);case"TSInterfaceHeritage":case"TSClassImplements":case"TSExpressionWithTypeArguments":case"TSInstantiationExpression":return[r("expression"),r("typeParameters")];case"TSTemplateLiteralType":return Gr(e,r,t);case"TSNamedTupleMember":return an(e,t,r);case"TSRestType":return un(e,t,r);case"TSOptionalType":return[r("typeAnnotation"),"?"];case"TSInterfaceDeclaration":return Ln(e,t,r);case"TSTypeParameterDeclaration":case"TSTypeParameterInstantiation":return It(e,t,r,"params");case"TSTypeParameter":return xn(e,t,r);case"TSAsExpression":case"TSSatisfiesExpression":return Pn(e,t,r);case"TSArrayType":return pn(r);case"TSPropertySignature":return[n.readonly?"readonly ":"",ft(e,t,r),V(e),Y(e,r)];case"TSParameterProperty":return[Xt(n),n.static?"static ":"",n.override?"override ":"",n.readonly?"readonly ":"",r("parameter")];case"TSTypeQuery":return cn(e,r);case"TSIndexSignature":{let a=n.parameters.length>1?b(ye(t)?",":""):"",o=D([E([F,P([", ",F],e.map(r,"parameters"))]),a,F]),p=e.parent.type==="ClassBody"&&e.key==="body";return[p&&n.static?"static ":"",n.readonly?"readonly ":"","[",n.parameters?o:"","]",Y(e,r),p?s:""]}case"TSTypePredicate":return ln(e,r);case"TSNonNullExpression":return[r("expression"),"!"];case"TSImportType":return[n.isTypeOf?"typeof ":"","import(",r("argument"),")",n.qualifier?[".",r("qualifier")]:"",It(e,t,r,n.typeArguments?"typeArguments":"typeParameters")];case"TSLiteralType":return r("literal");case"TSIndexedAccessType":return nn(e,t,r);case"TSTypeOperator":return[n.operator," ",r("typeAnnotation")];case"TSMappedType":return ea(e,t,r);case"TSMethodSignature":{let a=n.kind&&n.kind!=="method"?`${n.kind} `:"";u.push(Xt(n),a,n.computed?"[":"",r("key"),n.computed?"]":"",V(e));let o=Dt(e,r,t,!1,!0),p=n.returnType?"returnType":"typeAnnotation",m=n[p],y=m?Y(e,r,p):"",c=kt(n,y);return u.push(c?D(o):o),m&&u.push(D(y)),D(u)}case"TSNamespaceExportDeclaration":return["export as namespace ",r("id"),t.semi?";":""];case"TSEnumDeclaration":return In(e,r,t);case"TSEnumMember":return kn(e,r);case"TSImportEqualsDeclaration":return[n.isExport?"export ":"","import ",_s(n,!1),r("id")," = ",r("moduleReference"),t.semi?";":""];case"TSExternalModuleReference":return["require(",r("expression"),")"];case"TSModuleDeclaration":{let{parent:a}=e,o=a.type==="TSModuleDeclaration",p=((i=n.body)==null?void 0:i.type)==="TSModuleDeclaration";if(o)u.push(".");else if(u.push(ne(e)),!(n.kind==="global"||n.global)){let y=n.kind??(te(n.id)||Fr(t,j(n),j(n.id)).trim().endsWith("module")?"module":"namespace");u.push(y," ")}return u.push(r("id")),p?u.push(r("body")):n.body?u.push(" ",D(r("body"))):u.push(s),u}case"TSConditionalType":return $t(e,t,r);case"TSInferType":return sn(e,t,r);case"TSIntersectionType":return en(e,t,r);case"TSUnionType":return tn(e,t,r);case"TSFunctionType":case"TSCallSignatureDeclaration":case"TSConstructorType":case"TSConstructSignatureDeclaration":return rn(e,t,r);case"TSTupleType":return Vt(e,t,r);case"TSTypeReference":return[r("typeName"),It(e,t,r,"typeParameters")];case"TSTypeAnnotation":return on(e,t,r);case"TSEmptyBodyFunctionExpression":return Fn(e,t,r);case"TSJSDocAllType":return"*";case"TSJSDocUnknownType":return"?";case"TSJSDocNullableType":return hs(e,r,"?");case"TSJSDocNonNullableType":return hs(e,r,"!");case"TSParenthesizedType":default:throw new _e(n,"TypeScript")}}function Xl(e,t,r,n){if($r(e))return Fi(e,t);for(let s of[bi,gi,ga,ha,da]){let u=s(e,t,r,n);if(u!==void 0)return u}}var Vl=M(["ClassMethod","ClassPrivateMethod","ClassProperty","ClassAccessorProperty","AccessorProperty","TSAbstractAccessorProperty","PropertyDefinition","TSAbstractPropertyDefinition","ClassPrivateProperty","MethodDefinition","TSAbstractMethodDefinition","TSDeclareMethod"]);function $l(e,t,r,n){var y;e.isRoot&&((y=t.__onHtmlBindingRoot)==null||y.call(t,e.node,t));let s=Xl(e,t,r,n);if(!s)return"";let{node:u}=e;if(Vl(u))return s;let i=L(u.decorators),a=ki(e,t,r),o=u.type==="ClassExpression";if(i&&!o)return or(s,c=>D([a,c]));let p=Be(e,t),m=ua(e,t);return!a&&!p&&!m?s:or(s,c=>[m?";":"",p?"(":"",p&&o&&i?[E([d,a,c]),d]:[a,c],p?")":""])}var Sa=$l;var Hl={avoidAstMutation:!0};var Ba=[{linguistLanguageId:174,name:"JSON.stringify",type:"data",color:"#292929",tmScope:"source.json",aceMode:"json",codemirrorMode:"javascript",codemirrorMimeType:"application/json",aliases:["geojson","jsonl","topojson"],extensions:[".importmap"],filenames:["package.json","package-lock.json","composer.json"],parsers:["json-stringify"],vscodeLanguageIds:["json"]},{linguistLanguageId:174,name:"JSON",type:"data",color:"#292929",tmScope:"source.json",aceMode:"json",codemirrorMode:"javascript",codemirrorMimeType:"application/json",aliases:["geojson","jsonl","topojson"],extensions:[".json",".4DForm",".4DProject",".avsc",".geojson",".gltf",".har",".ice",".JSON-tmLanguage",".mcmeta",".tfstate",".tfstate.backup",".topojson",".webapp",".webmanifest",".yy",".yyp"],filenames:[".all-contributorsrc",".arcconfig",".auto-changelog",".c8rc",".htmlhintrc",".imgbotconfig",".nycrc",".tern-config",".tern-project",".watchmanconfig","Pipfile.lock","composer.lock","flake.lock","mcmod.info",".babelrc",".jscsrc",".jshintrc",".jslintrc",".swcrc"],parsers:["json"],vscodeLanguageIds:["json"]},{linguistLanguageId:423,name:"JSON with Comments",type:"data",color:"#292929",group:"JSON",tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"text/javascript",aliases:["jsonc"],extensions:[".jsonc",".code-snippets",".code-workspace",".sublime-build",".sublime-commands",".sublime-completions",".sublime-keymap",".sublime-macro",".sublime-menu",".sublime-mousemap",".sublime-project",".sublime-settings",".sublime-theme",".sublime-workspace",".sublime_metrics",".sublime_session"],filenames:[],parsers:["jsonc"],vscodeLanguageIds:["jsonc"]},{linguistLanguageId:175,name:"JSON5",type:"data",color:"#267CB9",extensions:[".json5"],tmScope:"source.js",aceMode:"javascript",codemirrorMode:"javascript",codemirrorMimeType:"application/json",parsers:["json5"],vscodeLanguageIds:["json5"]}];var Js={};Tr(Js,{getVisitorKeys:()=>Pa,massageAstNode:()=>Ia,print:()=>Ql});var Kl={JsonRoot:["node"],ArrayExpression:["elements"],ObjectExpression:["properties"],ObjectProperty:["key","value"],UnaryExpression:["argument"],NullLiteral:[],BooleanLiteral:[],StringLiteral:[],NumericLiteral:[],Identifier:[],TemplateLiteral:["quasis"],TemplateElement:[]},ba=Kl;var zl=Sr(ba),Pa=zl;function Ql(e,t,r){let{node:n}=e;switch(n.type){case"JsonRoot":return[r("node"),C];case"ArrayExpression":{if(n.elements.length===0)return"[]";let s=e.map(()=>e.node===null?"null":r(),"elements");return["[",E([C,P([",",C],s)]),C,"]"]}case"ObjectExpression":return n.properties.length===0?"{}":["{",E([C,P([",",C],e.map(r,"properties"))]),C,"}"];case"ObjectProperty":return[r("key"),": ",r("value")];case"UnaryExpression":return[n.operator==="+"?"":n.operator,r("argument")];case"NullLiteral":return"null";case"BooleanLiteral":return n.value?"true":"false";case"StringLiteral":return JSON.stringify(n.value);case"NumericLiteral":return ka(e)?JSON.stringify(String(n.value)):JSON.stringify(n.value);case"Identifier":return ka(e)?JSON.stringify(n.name):n.name;case"TemplateLiteral":return r(["quasis",0]);case"TemplateElement":return JSON.stringify(n.value.cooked);default:throw new _e(n,"JSON")}}function ka(e){return e.key==="key"&&e.parent.type==="ObjectProperty"}var Zl=new Set(["start","end","extra","loc","comments","leadingComments","trailingComments","innerComments","errors","range","tokens"]);function Ia(e,t){let{type:r}=e;if(r==="ObjectProperty"){let{key:n}=e;n.type==="Identifier"?t.key={type:"StringLiteral",value:n.name}:n.type==="NumericLiteral"&&(t.key={type:"StringLiteral",value:String(n.value)});return}if(r==="UnaryExpression"&&e.operator==="+")return t.argument;if(r==="ArrayExpression"){for(let[n,s]of e.elements.entries())s===null&&t.elements.splice(n,0,{type:"NullLiteral"});return}if(r==="TemplateLiteral")return{type:"StringLiteral",value:e.quasis[0].value.cooked}}Ia.ignoredProperties=Zl;var Cr={bracketSpacing:{category:"Common",type:"boolean",default:!0,description:"Print spaces between brackets.",oppositeDescription:"Do not print spaces between brackets."},singleQuote:{category:"Common",type:"boolean",default:!1,description:"Use single quotes instead of double quotes."},proseWrap:{category:"Common",type:"choice",default:"preserve",description:"How to wrap prose.",choices:[{value:"always",description:"Wrap prose if it exceeds the print width."},{value:"never",description:"Do not wrap prose."},{value:"preserve",description:"Wrap prose as-is."}]},bracketSameLine:{category:"Common",type:"boolean",default:!1,description:"Put > of opening tags on the last line instead of on a new line."},singleAttributePerLine:{category:"Common",type:"boolean",default:!1,description:"Enforce single attribute per line in HTML, Vue and JSX."}};var Lt="JavaScript",em={arrowParens:{category:Lt,type:"choice",default:"always",description:"Include parentheses around a sole arrow function parameter.",choices:[{value:"always",description:"Always include parens. Example: `(x) => x`"},{value:"avoid",description:"Omit parens when possible. Example: `x => x`"}]},bracketSameLine:Cr.bracketSameLine,bracketSpacing:Cr.bracketSpacing,jsxBracketSameLine:{category:Lt,type:"boolean",description:"Put > on the last line instead of at a new line.",deprecated:"2.4.0"},semi:{category:Lt,type:"boolean",default:!0,description:"Print semicolons.",oppositeDescription:"Do not print semicolons, except at the beginning of lines which may need them."},experimentalTernaries:{category:Lt,type:"boolean",default:!1,description:"Use curious ternaries, with the question mark after the condition.",oppositeDescription:"Default behavior of ternaries; keep question marks on the same line as the consequent."},singleQuote:Cr.singleQuote,jsxSingleQuote:{category:Lt,type:"boolean",default:!1,description:"Use single quotes in JSX."},quoteProps:{category:Lt,type:"choice",default:"as-needed",description:"Change when properties in objects are quoted.",choices:[{value:"as-needed",description:"Only add quotes around object properties where required."},{value:"consistent",description:"If at least one property in an object requires quotes, quote all properties."},{value:"preserve",description:"Respect the input use of quotes in object properties."}]},trailingComma:{category:Lt,type:"choice",default:"all",description:"Print trailing commas wherever possible when multi-line.",choices:[{value:"all",description:"Trailing commas wherever possible (including function arguments)."},{value:"es5",description:"Trailing commas where valid in ES5 (objects, arrays, etc.)"},{value:"none",description:"No trailing commas."}]},singleAttributePerLine:Cr.singleAttributePerLine},La=em;var tm={estree:Rs,"estree-json":Js},rm=[...$s,...Ba];var LT=qs;export{LT as default,rm as languages,La as options,tm as printers};
|