zenstack 0.1.51 → 0.1.52

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4249,7 +4249,7 @@ Node text: ${this._forgottenText}`),new b.errors.InvalidOperationError(r)}return
4249
4249
  `)&&(p=p.replace(/\r?\n$/,"")));let f=Ufe(r,this,this.getChildren());qa({insertPos:f,newText:p,parent:this});let m=this.getChildren();return af(i,m,r,!0)}};function Zfe(e,r,n){if(b.errors.throwIfWhitespaceOrNotString(r,"newName"),e.getText()===r)return;let i=e._context.languageService.findRenameLocations(e,n),a=new b.KeyValueCache;for(let s of i)a.getOrCreate(s.getSourceFile(),()=>[]).push(s);for(let[s,u]of a.getEntries())h7e({sourceFile:s,renameLocations:u,newName:r})}function epe(e,r){let n=Qfe(e._getWriterWithIndentation(),r),i=e.getFirstChildByKindOrThrow(b.SyntaxKind.OpenBraceToken),a=e.getFirstChildByKindOrThrow(b.SyntaxKind.CloseBraceToken);qa({insertPos:i.getEnd(),newText:n,parent:e,replacing:{textLength:a.getStart()-i.getEnd()}})}function H6(e){return class extends e{getBody(){let r=this.compilerNode.body;if(r==null)throw new b.errors.InvalidOperationError("Bodied node should have a body.");return this._getNodeFromCompilerNode(r)}setBodyText(r){let n=this.getBody();return epe(n,r),this}getBodyText(){return zH(this.getBody())}}}function HT(e){return class extends e{getBodyOrThrow(){return b.errors.throwIfNullOrUndefined(this.getBody(),"Expected to find the node's body.")}getBody(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.body)}getBodyText(){let r=this.getBody();return r==null?void 0:zH(r)}setBodyText(r){return this.addBody(),epe(this.getBodyOrThrow(),r),this}hasBody(){return this.compilerNode.body!=null}addBody(){var r;if(this.hasBody())return this;let n=this.getLastChildByKind(b.SyntaxKind.SemicolonToken);return qa({parent:this,insertPos:n==null?this.getEnd():n.getStart(),newText:this._getWriterWithQueuedIndentation().space().block().toString(),replacing:{textLength:(r=n?.getFullWidth())!==null&&r!==void 0?r:0}}),this}removeBody(){let r=this.getBody();return r==null?this:(qa({parent:this,insertPos:r.getPos(),newText:";",replacing:{textLength:r.getFullWidth()}}),this)}}}function Nm(e){return class extends e{setOrder(r){let n=this.getChildIndex(),i=this.getParentSyntaxList()||this.getParentSyntaxListOrThrow();return b.errors.throwIfOutOfRange(r,[0,i.getChildCount()-1],"order"),n===r?this:(d7e({parent:i,getSiblingFormatting:VBe,oldIndex:n,newIndex:r}),this)}}}function qT(e){return class extends e{getDecorator(r){return ic(this.getDecorators(),r)}getDecoratorOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getDecorator(r),()=>Ou("decorator",r))}getDecorators(){return nj(this.compilerNode).map(r=>this._getNodeFromCompilerNode(r))}addDecorator(r){return this.insertDecorator(ad(nj(this.compilerNode)),r)}addDecorators(r){return this.insertDecorators(ad(nj(this.compilerNode)),r)}insertDecorator(r,n){return this.insertDecorators(r,[n])[0]}insertDecorators(r,n){var i,a,s,u;if(b.ArrayUtils.isNullOrEmpty(n))return[];let p=T7e(this,n),f=this.getDecorators();r=ku(r,f.length);let m=x7e(this,f),g=f[r-1],D=jBe({structures:n,newCodes:p,parent:this,indentationText:this.getIndentationText(),getSeparator:()=>m,previousFormattingKind:g==null?El.None:m,nextFormattingKind:g==null?m:El.None});return qa({parent:(u=(a=(i=f[0])===null||i===void 0?void 0:i.getParentSyntaxListOrThrow())!==null&&a!==void 0?a:(s=this.getModifiers()[0])===null||s===void 0?void 0:s.getParentSyntaxListOrThrow())!==null&&u!==void 0?u:this,insertPos:f[r-1]==null?this.getStart():f[r-1].getEnd(),newText:D}),af(f,this.getDecorators(),r,!1)}set(r){return io(e.prototype,this,r),r.decorators!=null&&(this.getDecorators().forEach(n=>n.remove()),this.addDecorators(r.decorators)),this}getStructure(){return uo(e.prototype,this,{decorators:this.getDecorators().map(r=>r.getStructure())})}}}function nj(e){var r;return b.ts.canHaveDecorators(e)?(r=b.ts.getDecorators(e))!==null&&r!==void 0?r:[]:[]}function T7e(e,r){let n=[];for(let i of r){let a=e._getWriter();e._context.structurePrinterFactory.forDecorator().printText(a,i),n.push(a.toString())}return n}function x7e(e,r){return D7e(e,r)?El.Space:El.Newline}function D7e(e,r){if(r.length<=1)return e.getKind()===b.SyntaxKind.Parameter;let n=r[0].getStartLinePos();for(let i=1;i<r.length;i++)if(r[i].getStartLinePos()!==n)return!1;return!0}function bL(e){return class extends e{getDotDotDotTokenOrThrow(){return b.errors.throwIfNullOrUndefined(this.getDotDotDotToken(),"Expected to find a dot dot dot token (...).")}getDotDotDotToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.dotDotDotToken)}}}function $H(e){return class extends e{hasExclamationToken(){return this.compilerNode.exclamationToken!=null}getExclamationTokenNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.exclamationToken)}getExclamationTokenNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getExclamationTokenNode(),"Expected to find an exclamation token.")}setHasExclamationToken(r){let n=this.getExclamationTokenNode(),i=n!=null;if(r===i)return this;if(r){Tr.isQuestionTokenable(this)&&this.setHasQuestionToken(!1);let a=this.getFirstChildByKind(b.SyntaxKind.ColonToken);if(a==null)throw new b.errors.InvalidOperationError("Cannot add an exclamation token to a node that does not have a type.");qa({insertPos:a.getStart(),parent:this,newText:"!"})}else Bs({children:[n]});return this}set(r){return io(e.prototype,this,r),r.hasExclamationToken!=null&&this.setHasExclamationToken(r.hasExclamationToken),this}getStructure(){return uo(e.prototype,this,{hasExclamationToken:this.hasExclamationToken()})}}}function XH(e){return class extends e{hasExportKeyword(){return this.getExportKeyword()!=null}getExportKeyword(){if(Tr.isVariableDeclaration(this)){let r=this.getVariableStatement();return r?.getExportKeyword()}return Tr.isModifierable(this)?this.getFirstModifierByKind(b.SyntaxKind.ExportKeyword):lfe()}getExportKeywordOrThrow(){return b.errors.throwIfNullOrUndefined(this.getExportKeyword(),"Expected to find an export keyword.")}hasDefaultKeyword(){return this.getDefaultKeyword()!=null}getDefaultKeyword(){if(Tr.isVariableDeclaration(this)){let r=this.getVariableStatement();return r?.getDefaultKeyword()}return Tr.isModifierable(this)?this.getFirstModifierByKind(b.SyntaxKind.DefaultKeyword):lfe()}getDefaultKeywordOrThrow(){return b.errors.throwIfNullOrUndefined(this.getDefaultKeyword(),"Expected to find a default keyword.")}isExported(){if(this.hasExportKeyword())return!0;let r=this.getSymbol(),n=this.getSourceFile().getSymbol();return r==null||n==null?!1:n.getExports().some(i=>i===r||i.getAliasedSymbol()===r)}isDefaultExport(){if(this.hasDefaultKeyword())return!0;let r=this.getSymbol();if(r==null)return!1;let n=this.getSourceFile().getDefaultExportSymbol();if(n==null)return!1;if(r===n)return!0;let i=n.getAliasedSymbol();return r===i}isNamedExport(){let r=this.getSymbol(),n=this.getSourceFile().getSymbol();if(r==null||n==null)return!1;return!i()&&n.getExports().some(a=>a===r||a.getAliasedSymbol()===r);function i(){let a=n.getExport("default");return a==null?!1:r===a||r===a.getAliasedSymbol()}}}}function lfe(){throw new b.errors.NotImplementedError("Not implemented situation where node was not a ModifierableNode.")}function BE(e){return C7e(XH(e))}function C7e(e){return class extends e{setIsDefaultExport(r){if(r===this.isDefaultExport())return this;if(r&&!Tr.isSourceFile(this.getParentOrThrow()))throw new b.errors.InvalidOperationError("The parent must be a source file in order to set this node as a default export.");let n=this.getSourceFile(),i=n.getDefaultExportSymbol();if(i!=null&&n.removeDefaultExport(i),!r)return this;if(Tr.hasName(this)&&a.call(this)){let s=this.getFirstAncestorByKindOrThrow(b.SyntaxKind.SyntaxList),u=this.getName();s.insertChildText(this.getChildIndex()+1,p=>{p.newLine().write(`export default ${u};`)})}else this.addModifier("export"),this.addModifier("default");return this;function a(){return!!(Tr.isEnumDeclaration(this)||Tr.isModuleDeclaration(this)||Tr.isTypeAliasDeclaration(this)||Tr.isAmbientable(this)&&this.isAmbient())}}setIsExported(r){return Tr.isSourceFile(this.getParentOrThrow())&&this.toggleModifier("default",!1),this.toggleModifier("export",r),this}set(r){return io(e.prototype,this,r),r.isExported!=null&&this.setIsExported(r.isExported),r.isDefaultExport!=null&&this.setIsDefaultExport(r.isDefaultExport),this}getStructure(){return uo(e.prototype,this,{isExported:this.hasExportKeyword(),isDefaultExport:this.hasDefaultKeyword()})}}}var of=class{printTextOrWriterFunc(r,n){typeof n=="string"?r.write(n):n?.(r)}getNewWriter(r){return new KR.default(r.getOptions())}getNewWriterWithQueuedChildIndentation(r){let n=new KR.default(r.getOptions());return n.queueIndentationLevel(1),n}getText(r,n){let i=this.getNewWriter(r);return this.printTextOrWriterFunc(i,n),i.toString()}getTextWithQueuedChildIndentation(r,n){let i=this.getNewWriterWithQueuedChildIndentation(r);return this.printTextOrWriterFunc(i,n),i.toString()}},Pj=class extends of{printText(r,n){let{initializer:i}=n;if(i==null)return;let a=this.getText(r,i);b.StringUtils.isNullOrWhitespace(a)||r.hangingIndent(()=>{r.spaceIfLastNot(),r.write(`= ${a}`)})}},Oj=class extends of{printText(r,n){let i=n.scope;n.isDefaultExport?r.write("export default "):n.isExported&&r.write("export "),n.hasDeclareKeyword&&r.write("declare "),i!=null&&r.write(`${i} `),n.isStatic&&r.write("static "),n.hasOverrideKeyword&&r.write("override "),n.isAbstract&&r.write("abstract "),n.isAsync&&r.write("async "),n.isReadonly&&r.write("readonly ")}},kj=class extends of{constructor(r=!1){super(),this.alwaysWrite=r}printText(r,n){let{returnType:i}=n;if(i==null&&this.alwaysWrite===!1)return;i=i??"void";let a=this.getText(r,i);b.StringUtils.isNullOrWhitespace(a)||r.hangingIndent(()=>{r.write(`: ${a}`)})}},Rj=class extends of{constructor(r,n=!1){super(),this.separator=r,this.alwaysWrite=n}printText(r,n){let{type:i}=n;if(i==null&&this.alwaysWrite===!1)return;i=i??"any";let a=this.getText(r,i);b.StringUtils.isNullOrWhitespace(a)||r.hangingIndent(()=>{r.write(`${this.separator} ${a}`)})}},uS=class extends of{constructor(r){super(),this.printer=r}printText(r,n){if(n!=null)for(let i=0;i<n.length;i++)r.conditionalBlankLine(i>0),this.printer.printText(r,n[i])}},Ih=class extends of{constructor(r){super(),this.printer=r}printText(r,n){rpe(this.printer,r,n,()=>r.spaceIfLastNot())}};function rpe(e,r,n,i){if(n!=null)if(n instanceof Function||typeof n=="string")e.printText(r,n);else{let a=new Array(n.length);for(let u=0;u<n.length;u++){u>0&&i();let p=n[u],f=r.getLength();e.printText(r,p);let m=wfe(fj.getLastCharactersToPos(r,f));a[u]=m===-1?!1:m+f}let s=!1;for(let u=a.length-1;u>=0;u--){let p=a[u];p!==!1&&(s?r.unsafeInsert(p,","):s=!0)}}}var GT=class extends of{constructor(r){super(),this.printer=r}printText(r,n){rpe(this.printer,r,n,()=>r.newLineIfLastNot())}},H_=class extends of{constructor(r){super(),this.printer=r}printText(r,n){if(n!=null)for(let i=0;i<n.length;i++)r.conditionalNewLine(i>0),this.printer.printText(r,n[i])}},Mj=class extends of{constructor(r){super(),this.printer=r}printText(r,n){if(n!=null)for(let i=0;i<n.length;i++)r.conditionalWrite(i>0," "),this.printer.printText(r,n[i])}},Ns=class extends of{constructor(r){super(),this.factory=r}printTextWithoutTrivia(r,n){this.printTextInternal(r,n)}printText(r,n){this.printLeadingTrivia(r,n),r.closeComment(),this.printTextInternal(r,n),this.printTrailingTrivia(r,n)}printLeadingTrivia(r,n){let i=n.leadingTrivia;i!=null&&(this.printTrivia(r,i),r.isInComment()&&r.closeComment())}printTrailingTrivia(r,n){let i=n.trailingTrivia;i!=null&&this.printTrivia(r,i)}printTrivia(r,n){if(n instanceof Array)for(let i=0;i<n.length;i++)this.printTextOrWriterFunc(r,n[i]),i!==n.length-1&&r.newLineIfLastNot();else this.printTextOrWriterFunc(r,n)}},wj=class extends Ns{constructor(r,n){super(r),this.options=n,this.multipleWriter=new uS(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){let i=n.hasDeclareKeyword||this.options.isAmbient;this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forDecorator().printTexts(r,n.decorators),this.printHeader(r,n),r.inlineBlock(()=>{this.factory.forPropertyDeclaration().printTexts(r,n.properties),this.printCtors(r,n,i),this.printGetAndSet(r,n,i),b.ArrayUtils.isNullOrEmpty(n.methods)||(this.conditionalSeparator(r,i),this.factory.forMethodDeclaration({isAmbient:i}).printTexts(r,n.methods))})}printHeader(r,n){this.factory.forModifierableNode().printText(r,n),r.write("class"),b.StringUtils.isNullOrWhitespace(n.name)||r.space().write(n.name),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(r,n.typeParameters),r.space(),r.hangingIndent(()=>{if(n.extends!=null){let i=this.getText(r,n.extends);b.StringUtils.isNullOrWhitespace(i)||r.write(`extends ${i} `)}if(n.implements!=null){let i=n.implements instanceof Array?n.implements.map(a=>this.getText(r,a)).join(", "):this.getText(r,n.implements);b.StringUtils.isNullOrWhitespace(i)||r.write(`implements ${i} `)}})}printCtors(r,n,i){if(!b.ArrayUtils.isNullOrEmpty(n.ctors))for(let a of n.ctors)this.conditionalSeparator(r,i),this.factory.forConstructorDeclaration({isAmbient:i}).printText(r,a)}printGetAndSet(r,n,i){var a,s;let u=[...(a=n.getAccessors)!==null&&a!==void 0?a:[]],p=[...(s=n.setAccessors)!==null&&s!==void 0?s:[]],f=this.factory.forGetAccessorDeclaration({isAmbient:i}),m=this.factory.forSetAccessorDeclaration({isAmbient:i});for(let g of u){this.conditionalSeparator(r,i),f.printText(r,g);let D=p.findIndex(P=>P.name===g.name);D>=0&&(this.conditionalSeparator(r,i),m.printText(r,p[D]),p.splice(D,1))}for(let g of p)this.conditionalSeparator(r,i),m.printText(r,g)}conditionalSeparator(r,n){r.isAtStartOfFirstLineOfBlock()||(n?r.newLine():r.blankLine())}};Oe.StructureKind=void 0;(function(e){e[e.AssertEntry=0]="AssertEntry",e[e.CallSignature=1]="CallSignature",e[e.Class=2]="Class",e[e.ClassStaticBlock=3]="ClassStaticBlock",e[e.ConstructSignature=4]="ConstructSignature",e[e.Constructor=5]="Constructor",e[e.ConstructorOverload=6]="ConstructorOverload",e[e.Decorator=7]="Decorator",e[e.Enum=8]="Enum",e[e.EnumMember=9]="EnumMember",e[e.ExportAssignment=10]="ExportAssignment",e[e.ExportDeclaration=11]="ExportDeclaration",e[e.ExportSpecifier=12]="ExportSpecifier",e[e.Function=13]="Function",e[e.FunctionOverload=14]="FunctionOverload",e[e.GetAccessor=15]="GetAccessor",e[e.ImportDeclaration=16]="ImportDeclaration",e[e.ImportSpecifier=17]="ImportSpecifier",e[e.IndexSignature=18]="IndexSignature",e[e.Interface=19]="Interface",e[e.JsxAttribute=20]="JsxAttribute",e[e.JsxSpreadAttribute=21]="JsxSpreadAttribute",e[e.JsxElement=22]="JsxElement",e[e.JsxSelfClosingElement=23]="JsxSelfClosingElement",e[e.JSDoc=24]="JSDoc",e[e.JSDocTag=25]="JSDocTag",e[e.Method=26]="Method",e[e.MethodOverload=27]="MethodOverload",e[e.MethodSignature=28]="MethodSignature",e[e.Module=29]="Module",e[e.Parameter=30]="Parameter",e[e.Property=31]="Property",e[e.PropertyAssignment=32]="PropertyAssignment",e[e.PropertySignature=33]="PropertySignature",e[e.SetAccessor=34]="SetAccessor",e[e.ShorthandPropertyAssignment=35]="ShorthandPropertyAssignment",e[e.SourceFile=36]="SourceFile",e[e.SpreadAssignment=37]="SpreadAssignment",e[e.TypeAlias=38]="TypeAlias",e[e.TypeParameter=39]="TypeParameter",e[e.VariableDeclaration=40]="VariableDeclaration",e[e.VariableStatement=41]="VariableStatement"})(Oe.StructureKind||(Oe.StructureKind={}));var rL={hasName(e){return typeof e.name=="string"},isAssertEntry(e){return e?.kind===Oe.StructureKind.AssertEntry},isAssertionKeyNamed(e){return e?.kind===Oe.StructureKind.AssertEntry},isCallSignature(e){return e?.kind===Oe.StructureKind.CallSignature},isJSDocable(e){switch(e?.kind){case Oe.StructureKind.CallSignature:case Oe.StructureKind.Class:case Oe.StructureKind.ClassStaticBlock:case Oe.StructureKind.ConstructorOverload:case Oe.StructureKind.Constructor:case Oe.StructureKind.ConstructSignature:case Oe.StructureKind.Enum:case Oe.StructureKind.EnumMember:case Oe.StructureKind.FunctionOverload:case Oe.StructureKind.Function:case Oe.StructureKind.GetAccessor:case Oe.StructureKind.IndexSignature:case Oe.StructureKind.Interface:case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:case Oe.StructureKind.MethodSignature:case Oe.StructureKind.Module:case Oe.StructureKind.Property:case Oe.StructureKind.PropertySignature:case Oe.StructureKind.SetAccessor:case Oe.StructureKind.TypeAlias:case Oe.StructureKind.VariableStatement:return!0;default:return!1}},isSignatured(e){switch(e?.kind){case Oe.StructureKind.CallSignature:case Oe.StructureKind.ConstructorOverload:case Oe.StructureKind.Constructor:case Oe.StructureKind.ConstructSignature:case Oe.StructureKind.FunctionOverload:case Oe.StructureKind.Function:case Oe.StructureKind.GetAccessor:case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:case Oe.StructureKind.MethodSignature:case Oe.StructureKind.SetAccessor:return!0;default:return!1}},isParametered(e){switch(e?.kind){case Oe.StructureKind.CallSignature:case Oe.StructureKind.ConstructorOverload:case Oe.StructureKind.Constructor:case Oe.StructureKind.ConstructSignature:case Oe.StructureKind.FunctionOverload:case Oe.StructureKind.Function:case Oe.StructureKind.GetAccessor:case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:case Oe.StructureKind.MethodSignature:case Oe.StructureKind.SetAccessor:return!0;default:return!1}},isReturnTyped(e){switch(e?.kind){case Oe.StructureKind.CallSignature:case Oe.StructureKind.ConstructorOverload:case Oe.StructureKind.Constructor:case Oe.StructureKind.ConstructSignature:case Oe.StructureKind.FunctionOverload:case Oe.StructureKind.Function:case Oe.StructureKind.GetAccessor:case Oe.StructureKind.IndexSignature:case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:case Oe.StructureKind.MethodSignature:case Oe.StructureKind.SetAccessor:return!0;default:return!1}},isTypeParametered(e){switch(e?.kind){case Oe.StructureKind.CallSignature:case Oe.StructureKind.Class:case Oe.StructureKind.ConstructorOverload:case Oe.StructureKind.Constructor:case Oe.StructureKind.ConstructSignature:case Oe.StructureKind.FunctionOverload:case Oe.StructureKind.Function:case Oe.StructureKind.GetAccessor:case Oe.StructureKind.Interface:case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:case Oe.StructureKind.MethodSignature:case Oe.StructureKind.SetAccessor:case Oe.StructureKind.TypeAlias:return!0;default:return!1}},isClass(e){return e?.kind===Oe.StructureKind.Class},isClassLikeDeclarationBase(e){return e?.kind===Oe.StructureKind.Class},isNameable(e){switch(e?.kind){case Oe.StructureKind.Class:case Oe.StructureKind.Function:return!0;default:return!1}},isImplementsClauseable(e){return e?.kind===Oe.StructureKind.Class},isDecoratable(e){switch(e?.kind){case Oe.StructureKind.Class:case Oe.StructureKind.GetAccessor:case Oe.StructureKind.Method:case Oe.StructureKind.Parameter:case Oe.StructureKind.Property:case Oe.StructureKind.SetAccessor:return!0;default:return!1}},isAbstractable(e){switch(e?.kind){case Oe.StructureKind.Class:case Oe.StructureKind.GetAccessor:case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:case Oe.StructureKind.Property:case Oe.StructureKind.SetAccessor:return!0;default:return!1}},isAmbientable(e){switch(e?.kind){case Oe.StructureKind.Class:case Oe.StructureKind.Enum:case Oe.StructureKind.FunctionOverload:case Oe.StructureKind.Function:case Oe.StructureKind.Interface:case Oe.StructureKind.Module:case Oe.StructureKind.Property:case Oe.StructureKind.TypeAlias:case Oe.StructureKind.VariableStatement:return!0;default:return!1}},isExportable(e){switch(e?.kind){case Oe.StructureKind.Class:case Oe.StructureKind.Enum:case Oe.StructureKind.FunctionOverload:case Oe.StructureKind.Function:case Oe.StructureKind.Interface:case Oe.StructureKind.Module:case Oe.StructureKind.TypeAlias:case Oe.StructureKind.VariableStatement:return!0;default:return!1}},isClassStaticBlock(e){return e?.kind===Oe.StructureKind.ClassStaticBlock},isStatemented(e){switch(e?.kind){case Oe.StructureKind.ClassStaticBlock:case Oe.StructureKind.Constructor:case Oe.StructureKind.Function:case Oe.StructureKind.GetAccessor:case Oe.StructureKind.Method:case Oe.StructureKind.Module:case Oe.StructureKind.SetAccessor:case Oe.StructureKind.SourceFile:return!0;default:return!1}},isConstructorDeclarationOverload(e){return e?.kind===Oe.StructureKind.ConstructorOverload},isScoped(e){switch(e?.kind){case Oe.StructureKind.ConstructorOverload:case Oe.StructureKind.Constructor:case Oe.StructureKind.GetAccessor:case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:case Oe.StructureKind.Property:case Oe.StructureKind.SetAccessor:return!0;default:return!1}},isConstructor(e){return e?.kind===Oe.StructureKind.Constructor},isFunctionLike(e){switch(e?.kind){case Oe.StructureKind.Constructor:case Oe.StructureKind.Function:case Oe.StructureKind.GetAccessor:case Oe.StructureKind.Method:case Oe.StructureKind.SetAccessor:return!0;default:return!1}},isConstructSignature(e){return e?.kind===Oe.StructureKind.ConstructSignature},isDecorator(e){return e?.kind===Oe.StructureKind.Decorator},isEnum(e){return e?.kind===Oe.StructureKind.Enum},isNamed(e){switch(e?.kind){case Oe.StructureKind.Enum:case Oe.StructureKind.Interface:case Oe.StructureKind.JsxAttribute:case Oe.StructureKind.ShorthandPropertyAssignment:case Oe.StructureKind.TypeAlias:case Oe.StructureKind.TypeParameter:return!0;default:return!1}},isEnumMember(e){return e?.kind===Oe.StructureKind.EnumMember},isPropertyNamed(e){switch(e?.kind){case Oe.StructureKind.EnumMember:case Oe.StructureKind.GetAccessor:case Oe.StructureKind.Method:case Oe.StructureKind.MethodSignature:case Oe.StructureKind.PropertyAssignment:case Oe.StructureKind.Property:case Oe.StructureKind.PropertySignature:case Oe.StructureKind.SetAccessor:return!0;default:return!1}},isInitializerExpressionable(e){switch(e?.kind){case Oe.StructureKind.EnumMember:case Oe.StructureKind.Parameter:case Oe.StructureKind.Property:case Oe.StructureKind.PropertySignature:case Oe.StructureKind.VariableDeclaration:return!0;default:return!1}},isExportAssignment(e){return e?.kind===Oe.StructureKind.ExportAssignment},isExportDeclaration(e){return e?.kind===Oe.StructureKind.ExportDeclaration},isExportSpecifier(e){return e?.kind===Oe.StructureKind.ExportSpecifier},isFunctionDeclarationOverload(e){return e?.kind===Oe.StructureKind.FunctionOverload},isAsyncable(e){switch(e?.kind){case Oe.StructureKind.FunctionOverload:case Oe.StructureKind.Function:case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:return!0;default:return!1}},isGeneratorable(e){switch(e?.kind){case Oe.StructureKind.FunctionOverload:case Oe.StructureKind.Function:case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:return!0;default:return!1}},isFunction(e){return e?.kind===Oe.StructureKind.Function},isGetAccessor(e){return e?.kind===Oe.StructureKind.GetAccessor},isStaticable(e){switch(e?.kind){case Oe.StructureKind.GetAccessor:case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:case Oe.StructureKind.Property:case Oe.StructureKind.SetAccessor:return!0;default:return!1}},isImportDeclaration(e){return e?.kind===Oe.StructureKind.ImportDeclaration},isImportSpecifier(e){return e?.kind===Oe.StructureKind.ImportSpecifier},isIndexSignature(e){return e?.kind===Oe.StructureKind.IndexSignature},isReadonlyable(e){switch(e?.kind){case Oe.StructureKind.IndexSignature:case Oe.StructureKind.Parameter:case Oe.StructureKind.Property:case Oe.StructureKind.PropertySignature:return!0;default:return!1}},isInterface(e){return e?.kind===Oe.StructureKind.Interface},isExtendsClauseable(e){return e?.kind===Oe.StructureKind.Interface},isTypeElementMembered(e){return e?.kind===Oe.StructureKind.Interface},isJSDoc(e){return e?.kind===Oe.StructureKind.JSDoc},isJSDocTag(e){return e?.kind===Oe.StructureKind.JSDocTag},isJsxAttribute(e){return e?.kind===Oe.StructureKind.JsxAttribute},isJsxElement(e){return e?.kind===Oe.StructureKind.JsxElement},isJsxSelfClosingElement(e){return e?.kind===Oe.StructureKind.JsxSelfClosingElement},isJsxTagNamed(e){return e?.kind===Oe.StructureKind.JsxSelfClosingElement},isJsxAttributed(e){return e?.kind===Oe.StructureKind.JsxSelfClosingElement},isJsxSpreadAttribute(e){return e?.kind===Oe.StructureKind.JsxSpreadAttribute},isMethodDeclarationOverload(e){return e?.kind===Oe.StructureKind.MethodOverload},isQuestionTokenable(e){switch(e?.kind){case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:case Oe.StructureKind.MethodSignature:case Oe.StructureKind.Parameter:case Oe.StructureKind.Property:case Oe.StructureKind.PropertySignature:return!0;default:return!1}},isOverrideable(e){switch(e?.kind){case Oe.StructureKind.MethodOverload:case Oe.StructureKind.Method:case Oe.StructureKind.Parameter:case Oe.StructureKind.Property:return!0;default:return!1}},isMethod(e){return e?.kind===Oe.StructureKind.Method},isMethodSignature(e){return e?.kind===Oe.StructureKind.MethodSignature},isModule(e){return e?.kind===Oe.StructureKind.Module},isModuleNamed(e){return e?.kind===Oe.StructureKind.Module},isParameter(e){return e?.kind===Oe.StructureKind.Parameter},isBindingNamed(e){switch(e?.kind){case Oe.StructureKind.Parameter:case Oe.StructureKind.VariableDeclaration:return!0;default:return!1}},isTyped(e){switch(e?.kind){case Oe.StructureKind.Parameter:case Oe.StructureKind.Property:case Oe.StructureKind.PropertySignature:case Oe.StructureKind.TypeAlias:case Oe.StructureKind.VariableDeclaration:return!0;default:return!1}},isScopeable(e){return e?.kind===Oe.StructureKind.Parameter},isPropertyAssignment(e){return e?.kind===Oe.StructureKind.PropertyAssignment},isProperty(e){return e?.kind===Oe.StructureKind.Property},isExclamationTokenable(e){switch(e?.kind){case Oe.StructureKind.Property:case Oe.StructureKind.VariableDeclaration:return!0;default:return!1}},isPropertySignature(e){return e?.kind===Oe.StructureKind.PropertySignature},isSetAccessor(e){return e?.kind===Oe.StructureKind.SetAccessor},isShorthandPropertyAssignment(e){return e?.kind===Oe.StructureKind.ShorthandPropertyAssignment},isSourceFile(e){return e?.kind===Oe.StructureKind.SourceFile},isSpreadAssignment(e){return e?.kind===Oe.StructureKind.SpreadAssignment},isExpressioned(e){return e?.kind===Oe.StructureKind.SpreadAssignment},isTypeAlias(e){return e?.kind===Oe.StructureKind.TypeAlias},isTypeParameter(e){return e?.kind===Oe.StructureKind.TypeParameter},isVariableDeclaration(e){return e?.kind===Oe.StructureKind.VariableDeclaration},isVariableStatement(e){return e?.kind===Oe.StructureKind.VariableStatement}};function A7e(e,r){if(b.ArrayUtils.isReadonlyArray(e)){for(let n of e){let i=r(n);if(i)return i}return}switch(e.kind){case Oe.StructureKind.CallSignature:return L7e(e,r);case Oe.StructureKind.Class:return I7e(e,r);case Oe.StructureKind.ClassStaticBlock:return O7e(e,r);case Oe.StructureKind.ConstructorOverload:return k7e(e,r);case Oe.StructureKind.Constructor:return R7e(e,r);case Oe.StructureKind.ConstructSignature:return M7e(e,r);case Oe.StructureKind.Enum:return w7e(e,r);case Oe.StructureKind.EnumMember:return F7e(e,r);case Oe.StructureKind.ExportDeclaration:return G7e(e,r);case Oe.StructureKind.FunctionOverload:return B7e(e,r);case Oe.StructureKind.Function:return U7e(e,r);case Oe.StructureKind.GetAccessor:return K7e(e,r);case Oe.StructureKind.ImportDeclaration:return W7e(e,r);case Oe.StructureKind.IndexSignature:return V7e(e,r);case Oe.StructureKind.Interface:return j7e(e,r);case Oe.StructureKind.JSDoc:return q7e(e,r);case Oe.StructureKind.JsxElement:return J7e(e,r);case Oe.StructureKind.JsxSelfClosingElement:return z7e(e,r);case Oe.StructureKind.MethodOverload:return X7e(e,r);case Oe.StructureKind.Method:return Y7e(e,r);case Oe.StructureKind.MethodSignature:return Q7e(e,r);case Oe.StructureKind.Module:return Z7e(e,r);case Oe.StructureKind.Parameter:return e9e(e,r);case Oe.StructureKind.Property:return r9e(e,r);case Oe.StructureKind.PropertySignature:return t9e(e,r);case Oe.StructureKind.SetAccessor:return n9e(e,r);case Oe.StructureKind.SourceFile:return i9e(e,r);case Oe.StructureKind.TypeAlias:return a9e(e,r);case Oe.StructureKind.VariableStatement:return o9e(e,r);default:return}}function L7e(e,r){return Pf(e,r)||JT(e,r)||Oh(e,r)}function Pf(e,r){return J6(e.docs,r,Oe.StructureKind.JSDoc)}function JT(e,r){return N7e(e,r)}function N7e(e,r){return kd(e.parameters,r,Oe.StructureKind.Parameter)}function Oh(e,r){return J6(e.typeParameters,r,Oe.StructureKind.TypeParameter)}function I7e(e,r){return P7e(e,r)}function P7e(e,r){return BD(e,r)||Oh(e,r)||Pf(e,r)||kd(e.ctors,r,Oe.StructureKind.Constructor)||kd(e.properties,r,Oe.StructureKind.Property)||kd(e.getAccessors,r,Oe.StructureKind.GetAccessor)||kd(e.setAccessors,r,Oe.StructureKind.SetAccessor)||kd(e.methods,r,Oe.StructureKind.Method)}function BD(e,r){return kd(e.decorators,r,Oe.StructureKind.Decorator)}function O7e(e,r){return Pf(e,r)||q6(e,r)}function q6(e,r){return QR(e.statements,r)}function k7e(e,r){return JT(e,r)||Oh(e,r)||Pf(e,r)}function R7e(e,r){return SL(e,r)||kd(e.overloads,r,Oe.StructureKind.ConstructorOverload)}function SL(e,r){return JT(e,r)||Oh(e,r)||Pf(e,r)||q6(e,r)}function M7e(e,r){return Pf(e,r)||JT(e,r)||Oh(e,r)}function w7e(e,r){return Pf(e,r)||kd(e.members,r,Oe.StructureKind.EnumMember)}function F7e(e,r){return Pf(e,r)}function G7e(e,r){return J6(e.namedExports,r,Oe.StructureKind.ExportSpecifier)||kd(e.assertElements,r,Oe.StructureKind.AssertEntry)}function B7e(e,r){return JT(e,r)||Oh(e,r)||Pf(e,r)}function U7e(e,r){return SL(e,r)||kd(e.overloads,r,Oe.StructureKind.FunctionOverload)}function K7e(e,r){return BD(e,r)||SL(e,r)}function W7e(e,r){return J6(e.namedImports,r,Oe.StructureKind.ImportSpecifier)||kd(e.assertElements,r,Oe.StructureKind.AssertEntry)}function V7e(e,r){return Pf(e,r)}function j7e(e,r){return Oh(e,r)||Pf(e,r)||H7e(e,r)}function H7e(e,r){return kd(e.callSignatures,r,Oe.StructureKind.CallSignature)||kd(e.constructSignatures,r,Oe.StructureKind.ConstructSignature)||kd(e.indexSignatures,r,Oe.StructureKind.IndexSignature)||kd(e.methods,r,Oe.StructureKind.MethodSignature)||kd(e.properties,r,Oe.StructureKind.PropertySignature)}function q7e(e,r){return kd(e.tags,r,Oe.StructureKind.JSDocTag)}function J7e(e,r){return QR(e.attributes,r)||QR(e.children,r)}function z7e(e,r){return $7e(e,r)}function $7e(e,r){return QR(e.attributes,r)}function X7e(e,r){return JT(e,r)||Oh(e,r)||Pf(e,r)}function Y7e(e,r){return BD(e,r)||SL(e,r)||kd(e.overloads,r,Oe.StructureKind.MethodOverload)}function Q7e(e,r){return Pf(e,r)||JT(e,r)||Oh(e,r)}function Z7e(e,r){return Pf(e,r)||q6(e,r)}function e9e(e,r){return BD(e,r)}function r9e(e,r){return Pf(e,r)||BD(e,r)}function t9e(e,r){return Pf(e,r)}function n9e(e,r){return BD(e,r)||SL(e,r)}function i9e(e,r){return q6(e,r)}function a9e(e,r){return Oh(e,r)||Pf(e,r)}function o9e(e,r){return Pf(e,r)||kd(e.declarations,r,Oe.StructureKind.VariableDeclaration)}function kd(e,r,n){if(e!=null)for(let i of e){let a=r(tpe(i,n));if(a)return a}}function J6(e,r,n){if(!(e==null||!(e instanceof Array))){for(let i of e)if(npe(i)){let a=r(tpe(i,n));if(a)return a}}}function QR(e,r){if(!(e==null||!(e instanceof Array))){for(let n of e)if(npe(n)){let i=r(n);if(i)return i}}}function tpe(e,r){return e.kind==null&&(e.kind=r),e}function npe(e){return e!=null&&typeof e.kind=="number"}function YH(e){return e.iterateLastCharCodes(r=>r===ac.CLOSE_BRACE?!0:b.StringUtils.isWhitespaceCharCode(r)?void 0:!1)||!1}var Fj=class extends of{constructor(r,n){super(),this.factory=r,this.options=n}printTexts(r,n){if(n!=null)if(typeof n=="string"||n instanceof Function)this.printText(r,n);else for(let i of n)YH(r)?r.blankLineIfLastNot():r.isAtStartOfFirstLineOfBlock()||r.newLineIfLastNot(),this.printText(r,i)}printText(r,n){if(typeof n=="string"||n instanceof Function||n==null){this.printTextOrWriterFunc(r,n);return}switch(n.kind){case Oe.StructureKind.Method:this.options.isAmbient||i(),this.factory.forMethodDeclaration(this.options).printText(r,n);break;case Oe.StructureKind.Property:this.factory.forPropertyDeclaration().printText(r,n);break;case Oe.StructureKind.GetAccessor:this.options.isAmbient||i(),this.factory.forGetAccessorDeclaration(this.options).printText(r,n);break;case Oe.StructureKind.SetAccessor:this.options.isAmbient||i(),this.factory.forSetAccessorDeclaration(this.options).printText(r,n);break;case Oe.StructureKind.Constructor:this.options.isAmbient||i(),this.factory.forConstructorDeclaration(this.options).printText(r,n);break;case Oe.StructureKind.ClassStaticBlock:i(),this.factory.forClassStaticBlockDeclaration().printText(r,n);break;default:b.errors.throwNotImplementedForNeverValueError(n)}function i(){r.isAtStartOfFirstLineOfBlock()||r.blankLineIfLastNot()}}},Gj=class extends Ns{constructor(r){super(r)}printTexts(r,n){if(n!=null)for(let i=0;i<n.length;i++)i>0&&r.blankLine(),this.printText(r,n[i])}printTextInternal(r,n){r.write("static"),r.space().inlineBlock(()=>{this.factory.forStatementedNode({isAmbient:!1}).printText(r,n)})}},Bj=class extends Ns{constructor(r,n){super(r),this.options=n}printTexts(r,n){if(n!=null)for(let i=0;i<n.length;i++)i>0&&(this.options.isAmbient?r.newLine():r.blankLine()),this.printText(r,n[i])}printTextInternal(r,n){this.printOverloads(r,i()),this.printHeader(r,n),this.options.isAmbient?r.write(";"):r.space().inlineBlock(()=>{this.factory.forStatementedNode(this.options).printText(r,n)});function i(){let a=b.ObjectUtils.clone(n.overloads);if(!(a==null||a.length===0)){for(let s of a)mu(s,"scope",n.scope);return a}}}printOverloads(r,n){if(!(n==null||n.length===0))for(let i of n)this.printOverload(r,i),r.newLine()}printOverload(r,n){this.printLeadingTrivia(r,n),this.printHeader(r,n),r.write(";"),this.printTrailingTrivia(r,n)}printHeader(r,n){this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forModifierableNode().printText(r,n),r.write("constructor"),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(r,n.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(r,n.parameters)}},Uj=class extends Ns{constructor(r,n){super(r),this.options=n,this.blankLineWriter=new uS(this)}printTexts(r,n){this.blankLineWriter.printText(r,n)}printTextInternal(r,n){this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forDecorator().printTexts(r,n.decorators),this.factory.forModifierableNode().printText(r,n),r.write(`get ${n.name}`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(r,n.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(r,n.parameters),this.factory.forReturnTypedNode().printText(r,n),this.options.isAmbient||n.isAbstract?r.write(";"):r.spaceIfLastNot().inlineBlock(()=>{this.factory.forStatementedNode(this.options).printText(r,n)})}},Kj=class extends Ns{constructor(r,n){super(r),this.options=n}printTexts(r,n){if(n!=null)for(let i=0;i<n.length;i++)i>0&&(this.options.isAmbient?r.newLine():r.blankLine()),this.printText(r,n[i])}printTextInternal(r,n){this.printOverloads(r,n.name,i()),this.printHeader(r,n.name,n),this.options.isAmbient||n.isAbstract?r.write(";"):r.spaceIfLastNot().inlineBlock(()=>{this.factory.forStatementedNode(this.options).printText(r,n)});function i(){let a=b.ObjectUtils.clone(n.overloads);if(!(a==null||a.length===0)){for(let s of a)mu(s,"scope",n.scope),mu(s,"isStatic",n.isStatic),mu(s,"isAbstract",n.isAbstract),mu(s,"hasQuestionToken",n.hasQuestionToken);return a}}}printOverloads(r,n,i){if(!(i==null||i.length===0))for(let a of i)this.printOverload(r,n,a),r.newLine()}printOverload(r,n,i){this.printLeadingTrivia(r,i),this.printHeader(r,n,i),r.write(";"),this.printTrailingTrivia(r,i)}printHeader(r,n,i){this.factory.forJSDoc().printDocs(r,i.docs),i.decorators!=null&&this.factory.forDecorator().printTexts(r,i.decorators),this.factory.forModifierableNode().printText(r,i),r.write(n),r.conditionalWrite(i.hasQuestionToken,"?"),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(r,i.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(r,i.parameters),this.factory.forReturnTypedNode().printText(r,i)}},Wj=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new H_(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forDecorator().printTexts(r,n.decorators),this.factory.forModifierableNode().printText(r,n),r.write(n.name),r.conditionalWrite(n.hasQuestionToken,"?"),r.conditionalWrite(n.hasExclamationToken&&!n.hasQuestionToken,"!"),this.factory.forTypedNode(":").printText(r,n),this.factory.forInitializerExpressionableNode().printText(r,n),r.write(";")}},Vj=class extends Ns{constructor(r,n){super(r),this.options=n,this.multipleWriter=new uS(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forDecorator().printTexts(r,n.decorators),this.factory.forModifierableNode().printText(r,n),r.write(`set ${n.name}`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(r,n.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(r,n.parameters),this.factory.forReturnTypedNode().printText(r,n),this.options.isAmbient||n.isAbstract?r.write(";"):r.spaceIfLastNot().inlineBlock(()=>{this.factory.forStatementedNode(this.options).printText(r,n)})}},iL=class extends of{printText(r,n){typeof n=="string"?r.write(n):n(r)}},jj=class extends Ns{printTexts(r,n){this.printMultiple(r,n,()=>r.newLine())}printTextsInline(r,n){this.printMultiple(r,n,()=>r.space())}printTextInternal(r,n){r.write(`@${n.name}`),this.printTypeArguments(r,n),this.printArguments(r,n)}printTypeArguments(r,n){if(!(n.typeArguments==null||n.typeArguments.length===0)){r.write("<");for(let i=0;i<n.typeArguments.length;i++)r.conditionalWrite(i>0,", "),r.write(this.getTextWithQueuedChildIndentation(r,n.typeArguments[i]));r.write(">")}}printArguments(r,n){if(n.arguments==null)return;r.write("(");let i=n.arguments instanceof Array?n.arguments:[n.arguments];for(let a=0;a<i.length;a++)r.conditionalWrite(a>0,", "),r.write(this.getTextWithQueuedChildIndentation(r,i[a]));r.write(")")}printMultiple(r,n,i){if(!(n==null||n.length===0))for(let a of n)this.printText(r,a),i()}},Hj=class extends Ns{printDocs(r,n){if(n!=null)for(let i of n)this.printText(r,i),r.newLine()}printTextInternal(r,n){let a=f(this).split(/\r?\n/),s=a[0].length===0,u=a.length<=1,p=s?1:0;if(r.write("/**"),u?r.space():r.newLine(),u)r.write(a[p]);else for(let m=p;m<a.length;m++)r.write(" *"),a[m].length>0&&r.write(` ${a[m]}`),r.newLine();r.spaceIfLastNot(),r.write("*/");function f(m){if(typeof n=="string")return n;let g=m.getNewWriter(r);return typeof n=="function"?n(g):(n.description&&GE(g,n.description),n.tags&&n.tags.length>0&&(g.getLength()>0&&g.newLine(),m.factory.forJSDocTag({printStarsOnNewLine:!1}).printTexts(g,n.tags))),g.toString()}}},qj=class extends Ns{constructor(r,n){super(r),this.options=n}printTexts(r,n){if(n!=null)for(let i=0;i<n.length;i++)i>0&&(r.newLine(),r.conditionalWrite(this.options.printStarsOnNewLine," * ")),this.printText(r,n[i])}printTextInternal(r,n){let a=s(this).split(/\r?\n/);for(let u=0;u<a.length;u++)u>0&&(r.newLine(),this.options.printStarsOnNewLine&&r.write(" *")),a[u].length>0&&(this.options.printStarsOnNewLine&&u>0&&r.space(),r.write(a[u]));function s(u){if(typeof n=="string")return n;let p=u.getNewWriter(r);if(typeof n=="function")n(p);else{n.text&&GE(p,n.text);let f=p.toString();p.unsafeInsert(0,`@${n.tagName}`+(f.length>0&&!b.StringUtils.startsWithNewLine(f)?" ":""))}return p.toString()}}},Jj=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new uS(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forModifierableNode().printText(r,n),r.conditionalWrite(n.isConst,"const "),r.write(`enum ${n.name} `).inlineBlock(()=>{this.factory.forEnumMember().printTexts(r,n.members)})}},zj=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new GT(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){if(n instanceof Function){n(r);return}else if(typeof n=="string"){r.write(n);return}if(this.factory.forJSDoc().printDocs(r,n.docs),wBe(n.name)||b.StringUtils.isQuoted(n.name)?r.write(n.name):r.quote(n.name),typeof n.value=="string"){let{value:i}=n;r.hangingIndent(()=>r.write(" = ").quote(i))}else typeof n.value=="number"?r.write(` = ${n.value}`):this.factory.forInitializerExpressionableNode().printText(r,n)}},$j=class extends of{constructor(r){super(),this.factory=r,this.multipleWriter=new GT(this),this.options={isAmbient:!1}}printTexts(r,n){this.multipleWriter.printText(r,n)}printText(r,n){if(typeof n=="string"||n instanceof Function||n==null){this.printTextOrWriterFunc(r,n);return}switch(n.kind){case Oe.StructureKind.PropertyAssignment:this.factory.forPropertyAssignment().printText(r,n);break;case Oe.StructureKind.ShorthandPropertyAssignment:this.factory.forShorthandPropertyAssignment().printText(r,n);break;case Oe.StructureKind.SpreadAssignment:this.factory.forSpreadAssignment().printText(r,n);break;case Oe.StructureKind.Method:this.factory.forMethodDeclaration(this.options).printText(r,n);break;case Oe.StructureKind.GetAccessor:this.factory.forGetAccessorDeclaration(this.options).printText(r,n);break;case Oe.StructureKind.SetAccessor:this.factory.forSetAccessorDeclaration(this.options).printText(r,n);break;default:b.errors.throwNotImplementedForNeverValueError(n)}}},Xj=class extends Ns{printTextInternal(r,n){r.hangingIndent(()=>{r.write(`${n.name}: `),GE(r,n.initializer)})}},Yj=class extends Ns{printTextInternal(r,n){r.write(`${n.name}`)}},Qj=class extends Ns{printTextInternal(r,n){r.hangingIndent(()=>{r.write("..."),GE(r,n.expression)})}},Zj=class extends Ns{constructor(r,n){super(r),this.options=n}printTexts(r,n){if(n!=null)for(let i=0;i<n.length;i++){let a=n[i];if(i>0){let s=n[i-1];this.options.isAmbient||s.hasDeclareKeyword&&a.hasDeclareKeyword?r.newLine():r.blankLine()}this.printText(r,a)}}printTextInternal(r,n){this.printOverloads(r,n.name,i()),this.printHeader(r,n.name,n),this.options.isAmbient||n.hasDeclareKeyword?r.write(";"):r.space().inlineBlock(()=>{this.factory.forStatementedNode({isAmbient:!1}).printText(r,n)});function i(){let a=b.ObjectUtils.clone(n.overloads);if(!(a==null||a.length===0)){for(let s of a)mu(s,"hasDeclareKeyword",n.hasDeclareKeyword),mu(s,"isExported",n.isExported),mu(s,"isDefaultExport",n.isDefaultExport);return a}}}printOverloads(r,n,i){if(!(i==null||i.length===0))for(let a of i)this.printOverload(r,n,a),r.newLine()}printOverload(r,n,i){this.printLeadingTrivia(r,i),this.printHeader(r,n,i),r.write(";"),this.printTrailingTrivia(r,i)}printHeader(r,n,i){this.factory.forJSDoc().printDocs(r,i.docs),this.factory.forModifierableNode().printText(r,i),r.write("function"),r.conditionalWrite(i.isGenerator,"*"),b.StringUtils.isNullOrWhitespace(n)||r.write(` ${n}`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(r,i.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(r,i.parameters),this.factory.forReturnTypedNode().printText(r,i)}},eH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new Ih(this)}printTextsWithParenthesis(r,n){r.write("("),n!=null&&this.factory.forParameterDeclaration().printTexts(r,n),r.write(")")}printTexts(r,n){n==null||n.length===0||r.hangingIndent(()=>{this.multipleWriter.printText(r,n)})}printTextInternal(r,n){if(n.name==null)throw new b.errors.NotImplementedError("Not implemented scenario where parameter declaration structure doesn't have a name. Please open an issue if you need this.");this.factory.forDecorator().printTextsInline(r,n.decorators),this.factory.forModifierableNode().printText(r,n),r.conditionalWrite(n.isRestParameter,"..."),r.write(n.name),r.conditionalWrite(n.hasQuestionToken,"?"),this.factory.forTypedNode(":",n.hasQuestionToken).printText(r,n),this.factory.forInitializerExpressionableNode().printText(r,n)}},rH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new H_(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(r,n.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(r,n.parameters),this.factory.forReturnTypedNode(!0).printText(r,n),r.write(";")}},tH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new H_(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){this.factory.forJSDoc().printDocs(r,n.docs),r.write("new"),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(r,n.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(r,n.parameters),this.factory.forReturnTypedNode().printText(r,n),r.write(";")}},nH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new H_(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forModifierableNode().printText(r,n),r.write(`[${n.keyName||"key"}: ${n.keyType||"string"}]`),this.factory.forReturnTypedNode().printText(r,n),r.write(";")}},iH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new uS(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){if(this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forModifierableNode().printText(r,n),r.write(`interface ${n.name}`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(r,n.typeParameters),r.space(),n.extends!=null){let i=n.extends instanceof Array?n.extends.map(a=>this.getText(r,a)).join(", "):this.getText(r,n.extends);b.StringUtils.isNullOrWhitespace(i)||r.hangingIndent(()=>r.write(`extends ${i} `))}r.inlineBlock(()=>{this.factory.forTypeElementMemberedNode().printText(r,n)})}},aH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new H_(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){this.factory.forJSDoc().printDocs(r,n.docs),r.write(n.name),r.conditionalWrite(n.hasQuestionToken,"?"),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(r,n.typeParameters),this.factory.forParameterDeclaration().printTextsWithParenthesis(r,n.parameters),this.factory.forReturnTypedNode().printText(r,n),r.write(";")}},oH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new H_(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forModifierableNode().printText(r,n),r.write(n.name),r.conditionalWrite(n.hasQuestionToken,"?"),this.factory.forTypedNode(":").printText(r,n),this.factory.forInitializerExpressionableNode().printText(r,n),r.write(";")}},sH=class extends of{constructor(r){super(),this.factory=r}printText(r,n){this.factory.forCallSignatureDeclaration().printTexts(r,n.callSignatures),this.conditionalSeparator(r,n.constructSignatures),this.factory.forConstructSignatureDeclaration().printTexts(r,n.constructSignatures),this.conditionalSeparator(r,n.indexSignatures),this.factory.forIndexSignatureDeclaration().printTexts(r,n.indexSignatures),this.conditionalSeparator(r,n.properties),this.factory.forPropertySignature().printTexts(r,n.properties),this.conditionalSeparator(r,n.methods),this.factory.forMethodSignature().printTexts(r,n.methods)}conditionalSeparator(r,n){!b.ArrayUtils.isNullOrEmpty(n)&&!r.isAtStartOfFirstLineOfBlock()&&r.newLine()}},lH=class extends of{constructor(r){super(),this.factory=r}printTexts(r,n){if(n!=null)if(typeof n=="string"||n instanceof Function)this.printText(r,n);else for(let i of n)YH(r)?r.blankLineIfLastNot():r.isAtStartOfFirstLineOfBlock()||r.newLineIfLastNot(),this.printText(r,i)}printText(r,n){if(typeof n=="string"||n instanceof Function||n==null){this.printTextOrWriterFunc(r,n);return}switch(n.kind){case Oe.StructureKind.PropertySignature:this.factory.forPropertySignature().printText(r,n);break;case Oe.StructureKind.MethodSignature:this.factory.forMethodSignature().printText(r,n);break;case Oe.StructureKind.CallSignature:this.factory.forCallSignatureDeclaration().printText(r,n);break;case Oe.StructureKind.IndexSignature:this.factory.forIndexSignatureDeclaration().printText(r,n);break;case Oe.StructureKind.ConstructSignature:this.factory.forConstructSignatureDeclaration().printText(r,n);break;default:b.errors.throwNotImplementedForNeverValueError(n)}}},uH=class extends Ns{printTextInternal(r,n){if(i())this.factory.forJsxAttribute().printTextWithoutTrivia(r,n);else if(n.kind===Oe.StructureKind.JsxSpreadAttribute)this.factory.forJsxSpreadAttribute().printTextWithoutTrivia(r,n);else throw b.errors.throwNotImplementedForNeverValueError(n);function i(a){return n.kind==null||n.kind===Oe.StructureKind.JsxAttribute}}},cH=class extends Ns{printTextInternal(r,n){r.write(n.name),n.initializer!=null&&r.write("=").write(n.initializer)}},dH=class extends Ns{printTextInternal(r,n){i(n)?this.factory.forJsxElement().printText(r,n):n.kind===Oe.StructureKind.JsxSelfClosingElement?this.factory.forJsxSelfClosingElement().printText(r,n):b.errors.throwNotImplementedForNeverValueError(n);function i(a){return a.kind==null||a.kind===Oe.StructureKind.JsxElement}}},fH=class extends Ns{printTextInternal(r,n){r.hangingIndent(()=>{r.write(`<${n.name}`),n.attributes&&this.printAttributes(r,n.attributes),r.write(">")}),this.printChildren(r,n.children),r.write(`</${n.name}>`)}printAttributes(r,n){let i=this.factory.forJsxAttributeDecider();for(let a of n)r.space(),i.printText(r,a)}printChildren(r,n){n!=null&&(r.newLine(),r.indent(()=>{for(let i of n)this.factory.forJsxChildDecider().printText(r,i),r.newLine()}))}},pH=class extends Ns{printTextInternal(r,n){r.hangingIndent(()=>{r.write(`<${n.name}`),n.attributes&&this.printAttributes(r,n.attributes),r.write(" />")})}printAttributes(r,n){let i=this.factory.forJsxAttributeDecider();for(let a of n)r.space(),i.printText(r,a)}},mH=class extends Ns{printTextInternal(r,n){r.hangingIndent(()=>{r.write("{"),r.write("..."),r.write(n.expression),r.write("}")})}},_H=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new GT(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printAssertClause(r,n){!n||(r.write("assert "),r.inlineBlock(()=>{this.printTexts(r,n)}))}printTextInternal(r,n){r.write(n.name),r.write(": "),r.quote(n.value)}},gH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new H_(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){r.write("export"),n.isExportEquals!==!1?r.write(" = "):r.write(" default "),r.write(this.getTextWithQueuedChildIndentation(r,n.expression)).write(";")}},yH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new H_(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){let i=n.moduleSpecifier!=null&&n.moduleSpecifier.length>0;if(n.namedExports!=null&&n.namedExports.length>0&&n.namespaceExport!=null)throw new b.errors.InvalidOperationError("An export declaration cannot have both a namespace export and a named export.");r.write("export"),n.isTypeOnly&&r.write(" type"),n.namedExports!=null&&n.namedExports.length>0?(r.space(),this.factory.forNamedImportExportSpecifier().printTextsWithBraces(r,n.namedExports)):n.namespaceExport!=null?(r.write(" *"),b.StringUtils.isNullOrWhitespace(n.namespaceExport)||r.write(` as ${n.namespaceExport}`)):i?r.write(" *"):r.write(" {").conditionalWrite(this.factory.getFormatCodeSettings().insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces," ").write("}"),i&&(r.write(" from "),r.quote(n.moduleSpecifier)),n.assertElements&&(r.space(),this.factory.forAssertEntry().printAssertClause(r,n.assertElements)),r.write(";")}},vH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new H_(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){let i=n.namedImports!=null&&n.namedImports.length>0;if(i&&n.namespaceImport!=null)throw new b.errors.InvalidOperationError("An import declaration cannot have both a namespace import and a named import.");r.write("import"),n.isTypeOnly&&r.write(" type"),n.defaultImport!=null&&(r.write(` ${n.defaultImport}`),r.conditionalWrite(i||n.namespaceImport!=null,",")),n.namespaceImport!=null&&r.write(` * as ${n.namespaceImport}`),n.namedImports!=null&&n.namedImports.length>0&&(r.space(),this.factory.forNamedImportExportSpecifier().printTextsWithBraces(r,n.namedImports)),r.conditionalWrite(n.defaultImport!=null||i||n.namespaceImport!=null," from"),r.write(" "),r.quote(n.moduleSpecifier),n.assertElements&&(r.space(),this.factory.forAssertEntry().printAssertClause(r,n.assertElements)),r.write(";")}},hH=class extends Ns{constructor(r,n){super(r),this.options=n,this.blankLineFormattingWriter=new uS(this)}printTexts(r,n){this.blankLineFormattingWriter.printText(r,n)}printTextInternal(r,n){n=this.validateAndGetStructure(n),this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forModifierableNode().printText(r,n),n.declarationKind==null||n.declarationKind!==Oe.ModuleDeclarationKind.Global?r.write(`${n.declarationKind||"namespace"} ${n.name}`):r.write("global"),n.hasDeclareKeyword&&b.StringUtils.isQuoted(n.name.trim())&&n.hasOwnProperty(b.nameof(n,"statements"))&&n.statements==null?r.write(";"):(r.write(" "),r.inlineBlock(()=>{this.factory.forStatementedNode({isAmbient:n.hasDeclareKeyword||this.options.isAmbient}).printText(r,n)}))}validateAndGetStructure(r){if(b.StringUtils.isQuoted(r.name.trim())){if(r.declarationKind===Oe.ModuleDeclarationKind.Namespace)throw new b.errors.InvalidOperationError(`Cannot print a namespace with quotes for namespace with name ${r.name}. Use ModuleDeclarationKind.Module instead.`);r=b.ObjectUtils.clone(r),mu(r,"hasDeclareKeyword",!0),mu(r,"declarationKind",Oe.ModuleDeclarationKind.Module)}return r}},EH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new Ih(this)}printTextsWithBraces(r,n){let i=this.factory.getFormatCodeSettings();r.write("{");let a=this.getNewWriter(r);this.printTexts(a,n);let s=a.toString();i.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces&&!b.StringUtils.startsWithNewLine(s)&&r.space(),r.write(s),i.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces&&!b.StringUtils.endsWithNewLine(s)&&r.space(),r.write("}")}printTexts(r,n){n instanceof Function?this.printText(r,n):this.multipleWriter.printText(r,n)}printTextInternal(r,n){let i=this.getNewWriterWithQueuedChildIndentation(r);typeof n=="string"?i.write(n):n instanceof Function?n(i):(i.write(n.name),b.StringUtils.isNullOrWhitespace(n.alias)||(i.isLastNewLine()||i.space(),i.write(`as ${n.alias}`))),r.write(i.toString())}},bH=class extends Ns{constructor(r,n){super(r),this.options=n}printTextInternal(r,n){this.factory.forStatementedNode(this.options).printText(r,n),r.conditionalNewLine(!r.isAtStartOfFirstLineOfBlock()&&!r.isLastNewLine())}},SH=class extends of{constructor(r,n){super(),this.factory=r,this.options=n}printText(r,n){this.factory.forStatement(this.options).printTexts(r,n.statements)}},TH=class extends of{constructor(r,n){super(),this.factory=r,this.options=n}printTexts(r,n){if(n!=null)if(typeof n=="string"||n instanceof Function)this.printText(r,n);else for(let i of n)YH(r)?r.blankLineIfLastNot():r.isAtStartOfFirstLineOfBlock()||r.newLineIfLastNot(),this.printText(r,i)}printText(r,n){if(typeof n=="string"||n instanceof Function||n==null){this.printTextOrWriterFunc(r,n);return}switch(n.kind){case Oe.StructureKind.Function:this.options.isAmbient||i(),this.factory.forFunctionDeclaration(this.options).printText(r,n);break;case Oe.StructureKind.Class:i(),this.factory.forClassDeclaration(this.options).printText(r,n);break;case Oe.StructureKind.Interface:i(),this.factory.forInterfaceDeclaration().printText(r,n);break;case Oe.StructureKind.TypeAlias:this.factory.forTypeAliasDeclaration().printText(r,n);break;case Oe.StructureKind.VariableStatement:this.factory.forVariableStatement().printText(r,n);break;case Oe.StructureKind.ImportDeclaration:this.factory.forImportDeclaration().printText(r,n);break;case Oe.StructureKind.Module:i(),this.factory.forModuleDeclaration(this.options).printText(r,n);break;case Oe.StructureKind.Enum:i(),this.factory.forEnumDeclaration().printText(r,n);break;case Oe.StructureKind.ExportDeclaration:this.factory.forExportDeclaration().printText(r,n);break;case Oe.StructureKind.ExportAssignment:this.factory.forExportAssignment().printText(r,n);break;default:b.errors.throwNotImplementedForNeverValueError(n)}function i(){r.isAtStartOfFirstLineOfBlock()||r.blankLineIfLastNot()}}};Oe.VariableDeclarationKind=void 0;(function(e){e.Var="var",e.Let="let",e.Const="const"})(Oe.VariableDeclarationKind||(Oe.VariableDeclarationKind={}));var xH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new H_(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){this.factory.forJSDoc().printDocs(r,n.docs),r.hangingIndent(()=>{this.factory.forModifierableNode().printText(r,n),r.write(`${n.declarationKind||Oe.VariableDeclarationKind.Let} `),this.factory.forVariableDeclaration().printTexts(r,n.declarations),r.write(";")})}},DH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new H_(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){this.factory.forJSDoc().printDocs(r,n.docs),this.factory.forModifierableNode().printText(r,n),r.write(`type ${n.name}`),this.factory.forTypeParameterDeclaration().printTextsWithBrackets(r,n.typeParameters),this.factory.forTypedNode(" =").printText(r,n),r.write(";")}},CH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new Ih(this)}printTextsWithBrackets(r,n){n==null||n.length===0||(r.write("<"),this.printTexts(r,n),r.write(">"))}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){if(typeof n=="string"){r.write(n);return}r.hangingIndent(()=>{if(n.variance!=null&&((n.variance&Oe.TypeParameterVariance.In)!==0&&r.write("in "),(n.variance&Oe.TypeParameterVariance.Out)!==0&&r.write("out ")),r.write(n.name),n.constraint!=null){let i=this.getText(r,n.constraint);b.StringUtils.isNullOrWhitespace(i)||r.write(` extends ${i}`)}if(n.default!=null){let i=this.getText(r,n.default);b.StringUtils.isNullOrWhitespace(i)||r.write(` = ${i}`)}})}},AH=class extends Ns{constructor(){super(...arguments),this.multipleWriter=new Ih(this)}printTexts(r,n){this.multipleWriter.printText(r,n)}printTextInternal(r,n){r.write(n.name),r.conditionalWrite(n.hasExclamationToken,"!"),this.factory.forTypedNode(":").printText(r,n),this.factory.forInitializerExpressionableNode().printText(r,n)}};function ipe(e){return class extends e{getExtends(){var r;let n=this.getHeritageClauseByKind(b.SyntaxKind.ExtendsKeyword);return(r=n?.getTypeNodes())!==null&&r!==void 0?r:[]}addExtends(r){return this.insertExtends(this.getExtends().length,r)}insertExtends(r,n){let i=this.getExtends(),a=typeof n=="string";if(typeof n=="string")b.errors.throwIfWhitespaceOrNotString(n,"texts"),n=[n];else if(n.length===0)return[];let s=this._getWriterWithQueuedChildIndentation();if(new Ih(new iL).printText(s,n),r=ku(r,i.length),i.length>0){let f=this.getHeritageClauseByKindOrThrow(b.SyntaxKind.ExtendsKeyword);j_({parent:f.getFirstChildByKindOrThrow(b.SyntaxKind.SyntaxList),currentNodes:i,insertIndex:r,newText:s.toString(),useTrailingCommas:!1})}else{let m=this.getFirstChildByKindOrThrow(b.SyntaxKind.OpenBraceToken).getStart(),g=/\s/.test(this.getSourceFile().getFullText()[m-1]),D=`extends ${s.toString()} `;g||(D=" "+D),qa({parent:this,insertPos:m,newText:D})}let p=this.getExtends();return a?p[r]:af(i,p,r,!1)}removeExtends(r){let n=this.getHeritageClauseByKind(b.SyntaxKind.ExtendsKeyword);if(n==null)throw new b.errors.InvalidOperationError("Cannot remove an extends when none exist.");return n.removeExpression(r),this}set(r){return io(e.prototype,this,r),r.extends!=null&&(this.getExtends().forEach(n=>this.removeExtends(n)),this.addExtends(r.extends)),this}getStructure(){return uo(e.prototype,this,{extends:this.getExtends().map(r=>r.getText())})}}}function zT(e){return class extends e{isGenerator(){return this.compilerNode.asteriskToken!=null}getAsteriskToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.asteriskToken)}getAsteriskTokenOrThrow(){return b.errors.throwIfNullOrUndefined(this.getAsteriskToken(),"Expected to find an asterisk token.")}setIsGenerator(r){let n=this.getAsteriskToken();return n!=null===r?this:(n==null?qa({insertPos:s9e(this),parent:this,newText:"*"}):Nh({children:[n],getSiblingFormatting:()=>El.Space}),this)}set(r){return io(e.prototype,this,r),r.isGenerator!=null&&this.setIsGenerator(r.isGenerator),this}getStructure(){return uo(e.prototype,this,{isGenerator:this.isGenerator()})}}}function s9e(e){if(e.getKind()===b.SyntaxKind.FunctionDeclaration)return e.getFirstChildByKindOrThrow(b.SyntaxKind.FunctionKeyword).getEnd();let r=e;if(r.getName==null)throw new b.errors.NotImplementedError("Expected a name node for a non-function declaration.");return r.getNameNode().getStart()}function QH(e){return class extends e{getHeritageClauses(){var r;let n=this.compilerNode.heritageClauses;return(r=n?.map(i=>this._getNodeFromCompilerNode(i)))!==null&&r!==void 0?r:[]}getHeritageClauseByKindOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getHeritageClauseByKind(r),`Expected to have heritage clause of kind ${b.getSyntaxKindName(r)}.`)}getHeritageClauseByKind(r){return this.getHeritageClauses().find(n=>n.compilerNode.token===r)}}}function ape(e){return class extends e{getImplements(){var r;let n=this.getHeritageClauseByKind(b.SyntaxKind.ImplementsKeyword);return(r=n?.getTypeNodes())!==null&&r!==void 0?r:[]}addImplements(r){return this.insertImplements(this.getImplements().length,r)}insertImplements(r,n){let i=this.getImplements(),a=typeof n=="string";if(typeof n=="string")b.errors.throwIfWhitespaceOrNotString(n,"texts"),n=[n];else if(n.length===0)return[];let s=this._getWriterWithQueuedChildIndentation();new Ih(new iL).printText(s,n);let p=this.getHeritageClauses();if(r=ku(r,i.length),i.length>0){let m=this.getHeritageClauseByKindOrThrow(b.SyntaxKind.ImplementsKeyword);j_({parent:m.getFirstChildByKindOrThrow(b.SyntaxKind.SyntaxList),currentNodes:i,insertIndex:r,newText:s.toString(),useTrailingCommas:!1})}else{let g=this.getFirstChildByKindOrThrow(b.SyntaxKind.OpenBraceToken).getStart(),D=/\s/.test(this.getSourceFile().getFullText()[g-1]),P=`implements ${s.toString()} `;D||(P=" "+P),qa({parent:p.length===0?this:p[0].getParentSyntaxListOrThrow(),insertPos:g,newText:P})}let f=this.getImplements();return a?f[0]:af(i,f,r,!1)}removeImplements(r){let n=this.getHeritageClauseByKind(b.SyntaxKind.ImplementsKeyword);if(n==null)throw new b.errors.InvalidOperationError("Cannot remove an implements when none exist.");return n.removeExpression(r),this}set(r){return io(e.prototype,this,r),r.implements!=null&&(this.getImplements().forEach(n=>this.removeImplements(n)),this.addImplements(r.implements)),this}getStructure(){return uo(e.prototype,this,{implements:this.getImplements().map(r=>r.getText())})}}}function z6(e){return class extends e{hasInitializer(){return this.compilerNode.initializer!=null}getInitializerIfKindOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getInitializerIfKind(r),`Expected to find an initializer of kind '${b.getSyntaxKindName(r)}'.`)}getInitializerIfKind(r){let n=this.getInitializer();if(!(n!=null&&n.getKind()!==r))return n}getInitializerOrThrow(){return b.errors.throwIfNullOrUndefined(this.getInitializer(),"Expected to find an initializer.")}getInitializer(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.initializer)}}}function $T(e){return l9e(z6(e))}function l9e(e){return class extends e{removeInitializer(){let r=this.getInitializer();if(r==null)return this;let n=r.getPreviousSiblingIfKindOrThrow(b.SyntaxKind.EqualsToken);return Bs({children:[n,r],removePrecedingSpaces:!0}),this}setInitializer(r){let n=$g(this._getWriterWithQueuedChildIndentation(),r);b.errors.throwIfWhitespaceOrNotString(n,"textOrWriterFunction"),this.hasInitializer()&&this.removeInitializer();let i=this.getLastChildIfKind(b.SyntaxKind.SemicolonToken);return qa({insertPos:i!=null?i.getPos():this.getEnd(),parent:this,newText:` = ${n}`}),this}set(r){return io(e.prototype,this,r),r.initializer!=null?this.setInitializer(r.initializer):r.hasOwnProperty(b.nameof(r,"initializer"))&&this.removeInitializer(),this}getStructure(){let r=this.getInitializer();return uo(e.prototype,this,{initializer:r?r.getText():void 0})}}}function sc(e){return class extends e{getJsDocs(){var r;let n=this.compilerNode.jsDoc;return(r=n?.map(i=>this._getNodeFromCompilerNode(i)))!==null&&r!==void 0?r:[]}addJsDoc(r){return this.addJsDocs([r])[0]}addJsDocs(r){return this.insertJsDocs(ad(this.compilerNode.jsDoc),r)}insertJsDoc(r,n){return this.insertJsDocs(r,[n])[0]}insertJsDocs(r,n){if(b.ArrayUtils.isNullOrEmpty(n))return[];let i=this._getWriterWithQueuedIndentation();this._context.structurePrinterFactory.forJSDoc().printDocs(i,n),i.write("");let s=i.toString(),u=this.getJsDocs();r=ku(r,u.length);let p=r===u.length?this.getStart():u[r].getStart();return qa({insertPos:p,parent:this,newText:s}),af(u,this.getJsDocs(),r,!1)}set(r){return io(e.prototype,this,r),r.docs!=null&&(this.getJsDocs().forEach(n=>n.remove()),this.addJsDocs(r.docs)),this}getStructure(){return uo(e.prototype,this,{docs:this.getJsDocs().map(r=>r.getStructure())})}}}function UD(e){return class extends e{getLiteralText(){return this.compilerNode.text}isTerminated(){return!this.compilerNode.isUnterminated}hasExtendedUnicodeEscape(){return this.compilerNode.hasExtendedUnicodeEscape||!1}}}function sf(e){return class extends e{getModifiers(){return this.getCompilerModifiers().map(r=>this._getNodeFromCompilerNode(r))}getFirstModifierByKindOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getFirstModifierByKind(r),`Expected a modifier of syntax kind: ${b.getSyntaxKindName(r)}`)}getFirstModifierByKind(r){for(let n of this.getCompilerModifiers())if(n.kind===r)return this._getNodeFromCompilerNode(n)}hasModifier(r){return typeof r=="string"?this.getModifiers().some(n=>n.getText()===r):this.getCompilerModifiers().some(n=>n.kind===r)}toggleModifier(r,n){return n==null&&(n=!this.hasModifier(r)),n?this.addModifier(r):this.removeModifier(r),this}addModifier(r){let n=this.getModifiers(),i=this.getModifiers().filter(g=>g.getKind()!==b.SyntaxKind.Decorator),a=i.find(g=>g.getText()===r);if(a!=null)return a;let s=m(this),u,p;return i.length===0||s===i[0].getStart()?(p=r+" ",u=s):(p=" "+r,u=s+1),qa({parent:n.length===0?this:n[0].getParentSyntaxListOrThrow(),insertPos:s,newText:p}),this.getModifiers().find(g=>g.getStart()===u);function m(g){let D=P();for(let B of u9e(r))for(let K=0;K<i.length;K++){let h=i[K];if(h.getText()===B){D<h.getEnd()&&(D=h.getEnd());break}}return D;function P(){if(i.length>0)return i[0].getStart();for(let B of g._getChildrenIterator())if(!(B.getKind()===b.SyntaxKind.SyntaxList||b.ts.isJSDocCommentContainingNode(B.compilerNode)))return B.getStart();return g.getStart()}}}removeModifier(r){let n=this.getModifiers(),i=n.find(a=>a.getText()===r);return i==null?!1:(Bs({children:[n.length===1?i.getParentSyntaxListOrThrow():i],removeFollowingSpaces:!0}),!0)}getCompilerModifiers(){return this.compilerNode.modifiers||[]}}}function u9e(e){switch(e){case"export":return[];case"public":case"protected":case"private":return[];case"default":return["export"];case"const":return["export"];case"declare":return["export","default"];case"static":return["public","protected","private"];case"override":return["public","private","protected","static"];case"abstract":return["export","default","declare","public","private","protected","static","override"];case"async":return["export","default","declare","public","private","protected","static","override","abstract"];case"readonly":return["export","default","declare","public","private","protected","static","override","abstract"];case"out":return["in"];case"in":return[];default:b.errors.throwNotImplementedForNeverValueError(e)}}function ZH(e){return class extends e{addImportDeclaration(r){return this.addImportDeclarations([r])[0]}addImportDeclarations(r){let n=this._getCompilerStatementsWithComments();return this.insertImportDeclarations(i(),r);function i(){let a=0,s=!0;for(let u=0;u<n.length;u++){let p=n[u];s&&p.kind===b.SyntaxKind.MultiLineCommentTrivia?a=u+1:(s=!1,p.kind===b.SyntaxKind.ImportDeclaration&&(a=u+1))}return a}}insertImportDeclaration(r,n){return this.insertImportDeclarations(r,[n])[0]}insertImportDeclarations(r,n){return this._insertChildren({expectedKind:b.SyntaxKind.ImportDeclaration,index:r,structures:n,write:(i,a)=>{this._standardWrite(i,a,()=>{this._context.structurePrinterFactory.forImportDeclaration().printTexts(i,n)},{previousNewLine:s=>Tr.isImportDeclaration(s)||ej(s.compilerNode),nextNewLine:s=>Tr.isImportDeclaration(s)})}})}getImportDeclaration(r){return this.getImportDeclarations().find(n());function n(){return typeof r=="string"?i=>i.getModuleSpecifierValue()===r:r}}getImportDeclarationOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getImportDeclaration(r),"Expected to find an import with the provided condition.")}getImportDeclarations(){return this.getStatements().filter(Tr.isImportDeclaration)}addExportDeclaration(r){return this.addExportDeclarations([r])[0]}addExportDeclarations(r){return this.insertExportDeclarations(this.getChildSyntaxListOrThrow().getChildCount(),r)}insertExportDeclaration(r,n){return this.insertExportDeclarations(r,[n])[0]}insertExportDeclarations(r,n){return this._insertChildren({expectedKind:b.SyntaxKind.ExportDeclaration,index:r,structures:n,write:(i,a)=>{this._standardWrite(i,a,()=>{this._context.structurePrinterFactory.forExportDeclaration().printTexts(i,n)},{previousNewLine:s=>Tr.isExportDeclaration(s)||ej(s.compilerNode),nextNewLine:s=>Tr.isExportDeclaration(s)})}})}getExportDeclaration(r){return this.getExportDeclarations().find(n());function n(){return typeof r=="string"?i=>i.getModuleSpecifierValue()===r:r}}getExportDeclarationOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getExportDeclaration(r),"Expected to find an export declaration with the provided condition.")}getExportDeclarations(){return this.getStatements().filter(Tr.isExportDeclaration)}addExportAssignment(r){return this.addExportAssignments([r])[0]}addExportAssignments(r){return this.insertExportAssignments(this.getChildSyntaxListOrThrow().getChildCount(),r)}insertExportAssignment(r,n){return this.insertExportAssignments(r,[n])[0]}insertExportAssignments(r,n){return this._insertChildren({expectedKind:b.SyntaxKind.ExportAssignment,index:r,structures:n,write:(i,a)=>{this._standardWrite(i,a,()=>{this._context.structurePrinterFactory.forExportAssignment().printTexts(i,n)},{previousNewLine:s=>Tr.isExportAssignment(s)||ej(s.compilerNode),nextNewLine:s=>Tr.isExportAssignment(s)})}})}getExportAssignment(r){return this.getExportAssignments().find(r)}getExportAssignmentOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getExportAssignment(r),"Expected to find an export assignment with the provided condition.")}getExportAssignments(){return this.getStatements().filter(Tr.isExportAssignment)}getDefaultExportSymbol(){let r=this.getSymbol();if(r!=null)return r.getExport("default")}getDefaultExportSymbolOrThrow(){return b.errors.throwIfNullOrUndefined(this.getDefaultExportSymbol(),"Expected to find a default export symbol")}getExportSymbols(){let r=this.getSymbol();return r==null?[]:this._context.typeChecker.getExportsOfModule(r)}getExportedDeclarations(){let r=new Map,n=this.getExportSymbols();for(let a of n)for(let s of a.getDeclarations()){let u=Array.from(i(s)),p=a.getName(),f=r.get(p);f!=null?f.push(...u):r.set(a.getName(),u)}return r;function*i(a){if(Tr.isExportSpecifier(a))for(let u of a.getLocalTargetDeclarations())yield*i(u);else if(Tr.isExportAssignment(a)){let u=a.getExpression();if(u==null||u.getKind()!==b.SyntaxKind.Identifier){yield u;return}yield*s(u.getSymbol())}else if(Tr.isImportSpecifier(a)){let p=a.getNameNode().getSymbol();if(p==null)return;yield*s(p.getAliasedSymbol()||p)}else if(Tr.isImportClause(a)){let u=a.getDefaultImport();if(u==null)return;let p=u.getSymbol();if(p==null)return;yield*s(p.getAliasedSymbol()||p)}else if(Tr.isNamespaceImport(a)||Tr.isNamespaceExport(a)){let u=a.getNameNode().getSymbol();if(u==null)return;yield*s(u.getAliasedSymbol()||u)}else yield a;function*s(u){if(u!=null)for(let p of u.getDeclarations())yield*i(p)}}}removeDefaultExport(r){if(r=r||this.getDefaultExportSymbol(),r==null)return this;let n=r.getDeclarations()[0];return n.compilerNode.kind===b.SyntaxKind.ExportAssignment?Nh({children:[n],getSiblingFormatting:()=>El.Newline}):Tr.isModifierable(n)&&(n.toggleModifier("default",!1),n.toggleModifier("export",!1)),this}}}function KD(e){return class extends e{getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}getName(){return this.getNameNode().getText()}set(r){return io(e.prototype,this,r),r.name!=null&&this.getNameNode().replaceWithText(r.name),this}getStructure(){return uo(e.prototype,this,{name:this.getName()})}}}function kh(e){return class extends e{findReferences(){return this._context.languageService.findReferences(ufe(this))}findReferencesAsNodes(){return this._context.languageService.findReferencesAsNodes(ufe(this))}}}function ufe(e){if(Tr.isIdentifier(e)||Tr.isStringLiteral(e))return e;let r=e.getNodeProperty("name");return r??(Tr.isExportable(e)&&e.getDefaultKeyword()||e)}function pv(e){return class extends e{rename(r,n){return Zfe(i(this),r,n),this;function i(a){if(Tr.isIdentifier(a)||Tr.isPrivateIdentifier(a)||Tr.isStringLiteral(a))return a;if(a.getNameNode!=null){let s=a.getNameNode();if(b.errors.throwIfNullOrUndefined(s,"Expected to find a name node when renaming."),Tr.isArrayBindingPattern(s)||Tr.isObjectBindingPattern(s))throw new b.errors.NotImplementedError(`Not implemented renameable scenario for ${s.getKindName()}.`);return s}else throw new b.errors.NotImplementedError(`Not implemented renameable scenario for ${a.getKindName()}`)}}}}function ope(e){let r=kh(pv(e));return KD(r)}function $6(e){let r=kh(pv(e));return KD(r)}function spe(e){let r=kh(pv(e));return KD(r)}function X6(e){return c9e(kh(pv(e)))}function c9e(e){return class extends e{getNameNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.name)}getNameNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getNameNode(),"Expected to have a name node.")}getName(){var r,n;return(n=(r=this.getNameNode())===null||r===void 0?void 0:r.getText())!==null&&n!==void 0?n:void 0}getNameOrThrow(){return b.errors.throwIfNullOrUndefined(this.getName(),"Expected to have a name.")}rename(r){return r===this.getName()?this:b.StringUtils.isNullOrWhitespace(r)?(this.removeName(),this):(this.getNameNode()==null?cfe(this,r):e.prototype.rename.call(this,r),this)}removeName(){let r=this.getNameNode();return r==null?this:(Bs({children:[r],removePrecedingSpaces:!0}),this)}set(r){if(io(e.prototype,this,r),r.name!=null){b.errors.throwIfWhitespaceOrNotString(r.name,"structure.name");let n=this.getNameNode();n==null?cfe(this,r.name):n.replaceWithText(r.name)}else r.hasOwnProperty(b.nameof(r,"name"))&&this.removeName();return this}getStructure(){return uo(e.prototype,this,{name:this.getName()})}}}function cfe(e,r){if(Tr.isClassDeclaration(e)||Tr.isClassExpression(e)){let n=e.getFirstChildByKindOrThrow(b.SyntaxKind.ClassKeyword);qa({insertPos:n.getEnd(),newText:" "+r,parent:e})}else{let n=e.getFirstChildByKindOrThrow(b.SyntaxKind.OpenParenToken);qa({insertPos:n.getStart(),newText:" "+r,parent:e})}}function mv(e){let r=pv(kh(e));return KD(r)}function UE(e){let r=kh(pv(e));return KD(r)}function TL(e){return class extends e{hasOverrideKeyword(){return this.hasModifier(b.SyntaxKind.OverrideKeyword)}getOverrideKeyword(){return this.getFirstModifierByKind(b.SyntaxKind.OverrideKeyword)}getOverrideKeywordOrThrow(){return b.errors.throwIfNullOrUndefined(this.getOverrideKeyword(),"Expected to find an override keyword.")}setHasOverrideKeyword(r){return this.toggleModifier("override",r),this}set(r){return io(e.prototype,this,r),r.hasOverrideKeyword!=null&&this.setHasOverrideKeyword(r.hasOverrideKeyword),this}getStructure(){return uo(e.prototype,this,{hasOverrideKeyword:this.hasOverrideKeyword()})}}}function lpe(e){return class extends e{getParameter(r){return ic(this.getParameters(),r)}getParameterOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getParameter(r),()=>Ou("parameter",r))}getParameters(){return this.compilerNode.parameters.map(r=>this._getNodeFromCompilerNode(r))}addParameter(r){return this.addParameters([r])[0]}addParameters(r){return this.insertParameters(ad(this.compilerNode.parameters),r)}insertParameter(r,n){return this.insertParameters(r,[n])[0]}insertParameters(r,n){if(b.ArrayUtils.isNullOrEmpty(n))return[];let i=this.getParameters(),a=this.getFirstChildByKindOrThrow(b.SyntaxKind.OpenParenToken).getNextSiblingIfKindOrThrow(b.SyntaxKind.SyntaxList);r=ku(r,i.length);let s=this._getWriterWithQueuedChildIndentation();return this._context.structurePrinterFactory.forParameterDeclaration().printTexts(s,n),j_({parent:a,currentNodes:i,insertIndex:r,newText:s.toString(),useTrailingCommas:!1}),af(i,this.getParameters(),r,!1)}set(r){return io(e.prototype,this,r),r.parameters!=null&&(this.getParameters().forEach(n=>n.remove()),this.addParameters(r.parameters)),this}getStructure(){return uo(e.prototype,this,{parameters:this.getParameters().map(r=>r.getStructure())})}}}function Y6(e){return class extends e{hasQuestionDotToken(){return this.compilerNode.questionDotToken!=null}getQuestionDotTokenNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.questionDotToken)}getQuestionDotTokenNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getQuestionDotTokenNode(),"Expected to find a question dot token.")}setHasQuestionDotToken(r){let n=this.getQuestionDotTokenNode(),i=n!=null;if(r===i)return this;return r?Tr.isPropertyAccessExpression(this)?this.getFirstChildByKindOrThrow(b.SyntaxKind.DotToken).replaceWithText("?."):qa({insertPos:a.call(this),parent:this,newText:"?."}):Tr.isPropertyAccessExpression(this)?n.replaceWithText("."):Bs({children:[n]}),this;function a(){if(Tr.isCallExpression(this))return this.getFirstChildByKindOrThrow(b.SyntaxKind.OpenParenToken).getStart();if(Tr.isElementAccessExpression(this))return this.getFirstChildByKindOrThrow(b.SyntaxKind.OpenBracketToken).getStart();b.errors.throwNotImplementedForSyntaxKindError(this.compilerNode.kind)}}set(r){return io(e.prototype,this,r),r.hasQuestionDotToken!=null&&this.setHasQuestionDotToken(r.hasQuestionDotToken),this}getStructure(){return uo(e.prototype,this,{hasQuestionDotToken:this.hasQuestionDotToken()})}}}function Rh(e){return class extends e{hasQuestionToken(){return this.compilerNode.questionToken!=null}getQuestionTokenNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.questionToken)}getQuestionTokenNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getQuestionTokenNode(),"Expected to find a question token.")}setHasQuestionToken(r){let n=this.getQuestionTokenNode(),i=n!=null;if(r===i)return this;return r?(Tr.isExclamationTokenable(this)&&this.setHasExclamationToken(!1),qa({insertPos:a.call(this),parent:this,newText:"?"})):Bs({children:[n]}),this;function a(){if(Tr.hasName(this))return this.getNameNode().getEnd();let s=this.getFirstChildByKind(b.SyntaxKind.ColonToken);if(s!=null)return s.getStart();let u=this.getLastChildByKind(b.SyntaxKind.SemicolonToken);return u!=null?u.getStart():this.getEnd()}}set(r){return io(e.prototype,this,r),r.hasQuestionToken!=null&&this.setHasQuestionToken(r.hasQuestionToken),this}getStructure(){return uo(e.prototype,this,{hasQuestionToken:this.hasQuestionToken()})}}}function xL(e){return class extends e{isReadonly(){return this.getReadonlyKeyword()!=null}getReadonlyKeyword(){return this.getFirstModifierByKind(b.SyntaxKind.ReadonlyKeyword)}getReadonlyKeywordOrThrow(){return b.errors.throwIfNullOrUndefined(this.getReadonlyKeyword(),"Expected to find a readonly keyword.")}setIsReadonly(r){return this.toggleModifier("readonly",r),this}set(r){return io(e.prototype,this,r),r.isReadonly!=null&&this.setIsReadonly(r.isReadonly),this}getStructure(){return uo(e.prototype,this,{isReadonly:this.isReadonly()})}}}function eq(e){return class extends e{getReturnType(){return this.getSignature().getReturnType()}getReturnTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getReturnTypeNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getReturnTypeNode(),"Expected to find a return type node.")}setReturnType(r){let n=$g(this._getWriterWithQueuedChildIndentation(),r);if(b.StringUtils.isNullOrWhitespace(n))return this.removeReturnType();let i=this.getReturnTypeNode();if(i!=null)return i.getText()!==n&&i.replaceWithText(n),this;return qa({parent:this,insertPos:a(this).getEnd(),newText:`: ${n}`}),this;function a(s){return s.getKind()===b.SyntaxKind.IndexSignature?s.getFirstChildByKindOrThrow(b.SyntaxKind.CloseBracketToken):s.getFirstChildByKindOrThrow(b.SyntaxKind.CloseParenToken)}}removeReturnType(){let r=this.getReturnTypeNode();if(r==null)return this;let n=r.getPreviousSiblingIfKindOrThrow(b.SyntaxKind.ColonToken);return Bs({children:[n,r],removePrecedingSpaces:!0}),this}getSignature(){let r=this._context.typeChecker.getSignatureFromNode(this);if(r==null)throw new b.errors.NotImplementedError("Expected the node to have a signature.");return r}set(r){return io(e.prototype,this,r),r.returnType!=null?this.setReturnType(r.returnType):r.hasOwnProperty(b.nameof(r,"returnType"))&&this.removeReturnType(),this}getStructure(){let r=this.getReturnTypeNode();return uo(e.prototype,this,{returnType:r?r.getText({trimLeadingIndentation:!0}):void 0})}}}function upe(e){return class extends e{getScope(){let r=ZR(this);if(r!=null)return r;if(Tr.isParameterDeclaration(this)&&this.isReadonly())return Oe.Scope.Public}setScope(r){return rq(this,r),this}getScopeKeyword(){return this.getModifiers().find(r=>{let n=r.getText();return n==="public"||n==="protected"||n==="private"})}hasScopeKeyword(){return this.getScopeKeyword()!=null}set(r){return io(e.prototype,this,r),r.hasOwnProperty(b.nameof(r,"scope"))&&this.setScope(r.scope),this}getStructure(){return uo(e.prototype,this,{scope:this.getScope()})}}}function ZR(e){let r=e.getCombinedModifierFlags();return(r&b.ts.ModifierFlags.Private)!==0?Oe.Scope.Private:(r&b.ts.ModifierFlags.Protected)!==0?Oe.Scope.Protected:(r&b.ts.ModifierFlags.Public)!==0?Oe.Scope.Public:void 0}function rq(e,r){e.toggleModifier("public",r===Oe.Scope.Public),e.toggleModifier("protected",r===Oe.Scope.Protected),e.toggleModifier("private",r===Oe.Scope.Private)}function _S(e){return class extends e{getScope(){return ZR(this)||Oe.Scope.Public}setScope(r){return rq(this,r),this}hasScopeKeyword(){return ZR(this)!=null}set(r){return io(e.prototype,this,r),r.hasOwnProperty(b.nameof(r,"scope"))&&this.setScope(r.scope),this}getStructure(){return uo(e.prototype,this,{scope:this.hasScopeKeyword()?this.getScope():void 0})}}}function _v(e){return eq(lpe(e))}function WD(e){return class extends e{isStatic(){return this.hasModifier(b.SyntaxKind.StaticKeyword)}getStaticKeyword(){return this.getFirstModifierByKind(b.SyntaxKind.StaticKeyword)}getStaticKeywordOrThrow(){return b.errors.throwIfNullOrUndefined(this.getStaticKeyword(),"Expected to find a static keyword.")}setIsStatic(r){return this.toggleModifier("static",r),this}set(r){return io(e.prototype,this,r),r.isStatic!=null&&this.setIsStatic(r.isStatic),this}getStructure(){return uo(e.prototype,this,{isStatic:this.isStatic()})}}}function ld(e){return class extends e{insertText(r,n){return this.replaceText([r,r],n),this}removeText(r,n){return r==null?this.replaceText(dfe(this),""):this.replaceText([r,n],""),this}replaceText(r,n){let i=this.getChildSyntaxListOrThrow(),a=dfe(this),s=r[0],u=r[1];return p(),qa({insertPos:s,newText:$g(this._getWriter(),n),parent:i.getParentOrThrow(),replacing:{textLength:u-s,nodes:[i]}}),this;function p(){if(f(s),f(u),s>u)throw new b.errors.ArgumentError("range","Cannot specify a start position greater than the end position.")}function f(m){if(!(m>=a[0]&&m<=a[1]))throw new b.errors.InvalidOperationError(`Cannot insert or replace text outside the bounds of the node. Expected a position between [${a[0]}, ${a[1]}], but received ${m}.`)}}}}function dfe(e){let r=a(),n=Tr.isSourceFile(r)?void 0:r.getPreviousSiblingIfKind(b.SyntaxKind.OpenBraceToken),i=n==null?void 0:r.getNextSiblingIfKind(b.SyntaxKind.CloseBraceToken);if(n!=null&&i!=null)return[n.getEnd(),i.getStart()];return[r.getPos(),r.getEnd()];function a(){return Tr.isSourceFile(e)?e:e.getChildSyntaxListOrThrow()}}function Q6(e){return class extends e{getTypeArguments(){return this.compilerNode.typeArguments==null?[]:this.compilerNode.typeArguments.map(r=>this._getNodeFromCompilerNode(r))}addTypeArgument(r){return this.addTypeArguments([r])[0]}addTypeArguments(r){return this.insertTypeArguments(this.getTypeArguments().length,r)}insertTypeArgument(r,n){return this.insertTypeArguments(r,[n])[0]}insertTypeArguments(r,n){if(b.ArrayUtils.isNullOrEmpty(n))return[];let i=this.getTypeArguments();if(r=ku(r,i.length),i.length===0){let a=this.getFirstChildByKindOrThrow(b.SyntaxKind.Identifier);qa({insertPos:a.getEnd(),parent:this,newText:`<${n.join(", ")}>`})}else j_({parent:this.getFirstChildByKindOrThrow(b.SyntaxKind.LessThanToken).getNextSiblingIfKindOrThrow(b.SyntaxKind.SyntaxList),currentNodes:i,insertIndex:r,newText:n.join(", "),useTrailingCommas:!1});return af(i,this.getTypeArguments(),r,!1)}removeTypeArgument(r){let n=this.getTypeArguments();if(n.length===0)throw new b.errors.InvalidOperationError("Cannot remove a type argument when none exist.");let i=typeof r=="number"?a(r):r;if(n.length===1){let s=n[0].getParentSyntaxListOrThrow();Bs({children:[s.getPreviousSiblingIfKindOrThrow(b.SyntaxKind.LessThanToken),s,s.getNextSiblingIfKindOrThrow(b.SyntaxKind.GreaterThanToken)]})}else fv(i);return this;function a(s){return n[ku(s,n.length-1)]}}}}function KE(e){return class extends e{getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getTypeNode(),"Expected to find a type node.")}setType(r){let n=$g(this._getWriterWithQueuedChildIndentation(),r);if(b.StringUtils.isNullOrWhitespace(n))return this.removeType();let i=this.getTypeNode();if(i!=null&&i.getText()===n)return this;let a=ffe(this),s=this.getFirstChildByKind(a),u,p;return s==null?(u=f(this),p=(a===b.SyntaxKind.EqualsToken?" = ":": ")+n):(u=i.getStart(),p=n),qa({parent:this,insertPos:u,newText:p,replacing:{textLength:i==null?0:i.getWidth()}}),this;function f(g){let D=g.getFirstChildByKindOrThrow(b.SyntaxKind.Identifier),P=D.getNextSibling();return(m(P)?P:D).getEnd()}function m(g){if(g==null)return!1;let D=g.getKind();return D===b.SyntaxKind.QuestionToken||D===b.SyntaxKind.ExclamationToken}}set(r){return io(e.prototype,this,r),r.type!=null?this.setType(r.type):r.hasOwnProperty(b.nameof(r,"type"))&&this.removeType(),this}removeType(){if(this.getKind()===b.SyntaxKind.TypeAliasDeclaration)throw new b.errors.NotSupportedError(`Cannot remove the type of a type alias. Use ${b.nameof("setType")} instead.`);let r=this.getTypeNode();if(r==null)return this;let n=r.getPreviousSiblingIfKindOrThrow(ffe(this));return Bs({children:[n,r],removePrecedingSpaces:!0}),this}getStructure(){let r=this.getTypeNode();return uo(e.prototype,this,{type:r?r.getText({trimLeadingIndentation:!0}):void 0})}}}function ffe(e){switch(e.getKind()){case b.SyntaxKind.TypeAliasDeclaration:return b.SyntaxKind.EqualsToken;default:return b.SyntaxKind.ColonToken}}function tq(e){return class extends e{addMember(r){return this.addMembers([r])[0]}addMembers(r){return this.insertMembers(ad(this.getMembersWithComments()),r)}insertMember(r,n){return this.insertMembers(r,[n])[0]}insertMembers(r,n){return qfe({getIndexedChildren:()=>this.getMembersWithComments(),index:r,parent:this,write:i=>{i.newLineIfLastNot();let a=this._getWriter();this._context.structurePrinterFactory.forTypeElementMember().printTexts(a,n),i.write(a.toString()),i.newLineIfLastNot()}})}addConstructSignature(r){return this.addConstructSignatures([r])[0]}addConstructSignatures(r){return this.insertConstructSignatures(ad(this.getMembersWithComments()),r)}insertConstructSignature(r,n){return this.insertConstructSignatures(r,[n])[0]}insertConstructSignatures(r,n){return eL({thisNode:this,index:r,structures:n,expectedKind:b.SyntaxKind.ConstructSignature,createStructurePrinter:()=>this._context.structurePrinterFactory.forConstructSignatureDeclaration()})}getConstructSignature(r){return this.getConstructSignatures().find(r)}getConstructSignatureOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getConstructSignature(r),"Expected to find a construct signature with the provided condition.")}getConstructSignatures(){return this.compilerNode.members.filter(r=>r.kind===b.SyntaxKind.ConstructSignature).map(r=>this._getNodeFromCompilerNode(r))}addCallSignature(r){return this.addCallSignatures([r])[0]}addCallSignatures(r){return this.insertCallSignatures(ad(this.getMembersWithComments()),r)}insertCallSignature(r,n){return this.insertCallSignatures(r,[n])[0]}insertCallSignatures(r,n){return eL({thisNode:this,index:r,structures:n,expectedKind:b.SyntaxKind.CallSignature,createStructurePrinter:()=>this._context.structurePrinterFactory.forCallSignatureDeclaration()})}getCallSignature(r){return this.getCallSignatures().find(r)}getCallSignatureOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getCallSignature(r),"Expected to find a call signature with the provided condition.")}getCallSignatures(){return this.compilerNode.members.filter(r=>r.kind===b.SyntaxKind.CallSignature).map(r=>this._getNodeFromCompilerNode(r))}addIndexSignature(r){return this.addIndexSignatures([r])[0]}addIndexSignatures(r){return this.insertIndexSignatures(ad(this.getMembersWithComments()),r)}insertIndexSignature(r,n){return this.insertIndexSignatures(r,[n])[0]}insertIndexSignatures(r,n){return eL({thisNode:this,index:r,structures:n,expectedKind:b.SyntaxKind.IndexSignature,createStructurePrinter:()=>this._context.structurePrinterFactory.forIndexSignatureDeclaration()})}getIndexSignature(r){return this.getIndexSignatures().find(r)}getIndexSignatureOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getIndexSignature(r),"Expected to find a index signature with the provided condition.")}getIndexSignatures(){return this.compilerNode.members.filter(r=>r.kind===b.SyntaxKind.IndexSignature).map(r=>this._getNodeFromCompilerNode(r))}addMethod(r){return this.addMethods([r])[0]}addMethods(r){return this.insertMethods(ad(this.getMembersWithComments()),r)}insertMethod(r,n){return this.insertMethods(r,[n])[0]}insertMethods(r,n){return eL({thisNode:this,index:r,structures:n,expectedKind:b.SyntaxKind.MethodSignature,createStructurePrinter:()=>this._context.structurePrinterFactory.forMethodSignature()})}getMethod(r){return ic(this.getMethods(),r)}getMethodOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getMethod(r),()=>Ou("interface method signature",r))}getMethods(){return this.compilerNode.members.filter(r=>r.kind===b.SyntaxKind.MethodSignature).map(r=>this._getNodeFromCompilerNode(r))}addProperty(r){return this.addProperties([r])[0]}addProperties(r){return this.insertProperties(ad(this.getMembersWithComments()),r)}insertProperty(r,n){return this.insertProperties(r,[n])[0]}insertProperties(r,n){return eL({thisNode:this,index:r,structures:n,expectedKind:b.SyntaxKind.PropertySignature,createStructurePrinter:()=>this._context.structurePrinterFactory.forPropertySignature()})}getProperty(r){return ic(this.getProperties(),r)}getPropertyOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getProperty(r),()=>Ou("interface property signature",r))}getProperties(){return this.compilerNode.members.filter(r=>r.kind===b.SyntaxKind.PropertySignature).map(r=>this._getNodeFromCompilerNode(r))}getMembers(){return this.compilerNode.members.map(r=>this._getNodeFromCompilerNode(r))}getMembersWithComments(){let r=this.compilerNode;return od.getContainerArray(r,this._sourceFile.compilerNode).map(n=>this._getNodeFromCompilerNode(n))}set(r){return io(e.prototype,this,r),r.callSignatures!=null&&(this.getCallSignatures().forEach(n=>n.remove()),this.addCallSignatures(r.callSignatures)),r.constructSignatures!=null&&(this.getConstructSignatures().forEach(n=>n.remove()),this.addConstructSignatures(r.constructSignatures)),r.indexSignatures!=null&&(this.getIndexSignatures().forEach(n=>n.remove()),this.addIndexSignatures(r.indexSignatures)),r.properties!=null&&(this.getProperties().forEach(n=>n.remove()),this.addProperties(r.properties)),r.methods!=null&&(this.getMethods().forEach(n=>n.remove()),this.addMethods(r.methods)),this}getStructure(){return uo(e.prototype,this,{callSignatures:this.getCallSignatures().map(r=>r.getStructure()),constructSignatures:this.getConstructSignatures().map(r=>r.getStructure()),indexSignatures:this.getIndexSignatures().map(r=>r.getStructure()),methods:this.getMethods().map(r=>r.getStructure()),properties:this.getProperties().map(r=>r.getStructure())})}}}function eL(e){return qH({getIndexedChildren:()=>e.thisNode.getMembersWithComments(),parent:e.thisNode,index:e.index,structures:e.structures,expectedKind:e.expectedKind,write:(r,n)=>{r.newLineIfLastNot(),e.createStructurePrinter().printTexts(r,e.structures),r.newLineIfLastNot()}})}function J_(e){return class extends e{getTypeParameter(r){return ic(this.getTypeParameters(),r)}getTypeParameterOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getTypeParameter(r),()=>Ou("type parameter",r))}getTypeParameters(){let r=this.compilerNode.typeParameters;return r==null?[]:r.map(n=>this._getNodeFromCompilerNode(n))}addTypeParameter(r){return this.addTypeParameters([r])[0]}addTypeParameters(r){return this.insertTypeParameters(ad(this.compilerNode.typeParameters),r)}insertTypeParameter(r,n){return this.insertTypeParameters(r,[n])[0]}insertTypeParameters(r,n){if(b.ArrayUtils.isNullOrEmpty(n))return[];let i=this.getTypeParameters(),a=this._getWriterWithQueuedChildIndentation(),s=this._context.structurePrinterFactory.forTypeParameterDeclaration();return r=ku(r,i.length),s.printTexts(a,n),i.length===0?qa({insertPos:d9e(this),parent:this,newText:`<${a.toString()}>`}):j_({parent:this.getFirstChildByKindOrThrow(b.SyntaxKind.LessThanToken).getNextSiblingIfKindOrThrow(b.SyntaxKind.SyntaxList),currentNodes:i,insertIndex:r,newText:a.toString(),useTrailingCommas:!1}),af(i,this.getTypeParameters(),r,!1)}set(r){return io(e.prototype,this,r),r.typeParameters!=null&&(this.getTypeParameters().forEach(n=>n.remove()),this.addTypeParameters(r.typeParameters)),this}getStructure(){return uo(e.prototype,this,{typeParameters:this.getTypeParameters().map(r=>r.getStructure())})}}}function d9e(e){let r=e;if(r.getNameNode!=null)return r.getNameNode().getEnd();if(Tr.isCallSignatureDeclaration(e)||Tr.isFunctionTypeNode(e))return e.getFirstChildByKindOrThrow(b.SyntaxKind.OpenParenToken).getStart();throw new b.errors.NotImplementedError(`Not implemented scenario inserting type parameters for node with kind ${e.getKindName()}.`)}function Z6(e){return class extends e{unwrap(){v7e(this)}}}var eM=class extends Tr{getElements(){return this.compilerNode.elements.map(r=>this._getNodeFromCompilerNode(r))}},f9e=e=>bL($T($6(e))),cpe=f9e(Tr),rM=class extends cpe{getPropertyNameNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getPropertyNameNode(),"Expected to find a property name node.")}getPropertyNameNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.propertyName)}},tM=class extends Tr{getElements(){return this.compilerNode.elements.map(r=>this._getNodeFromCompilerNode(r))}};function gS(e){return class extends e{isAbstract(){return this.getAbstractKeyword()!=null}getAbstractKeyword(){return this.getFirstModifierByKind(b.SyntaxKind.AbstractKeyword)}getAbstractKeywordOrThrow(){return b.errors.throwIfNullOrUndefined(this.getAbstractKeyword(),"Expected to find an abstract keyword.")}setIsAbstract(r){return this.toggleModifier("abstract",r),this}set(r){return io(e.prototype,this,r),r.isAbstract!=null&&this.setIsAbstract(r.isAbstract),this}getStructure(){return uo(e.prototype,this,{isAbstract:this.isAbstract()})}}}var oc=class extends Tr{getContextualType(){return this._context.typeChecker.getContextualType(this)}},dpe=oc,aL=class extends dpe{getLeft(){return this._getNodeFromCompilerNode(this.compilerNode.left)}getOperatorToken(){return this._getNodeFromCompilerNode(this.compilerNode.operatorToken)}getRight(){return this._getNodeFromCompilerNode(this.compilerNode.right)}},fpe=aL,oL=class extends fpe{getOperatorToken(){return this._getNodeFromCompilerNode(this.compilerNode.operatorToken)}},ppe=oL,LH=class extends ppe{getLeft(){return this._getNodeFromCompilerNode(this.compilerNode.left)}},cv=class extends oc{},nM=class extends cv{},RD=class extends nM{},BT=class extends RD{},sd=class extends BT{},iM=class extends sd{getElements(){return this.compilerNode.elements.map(r=>this._getNodeFromCompilerNode(r))}addElement(r,n){return this.addElements([r],n)[0]}addElements(r,n){return this.insertElements(this.compilerNode.elements.length,r,n)}insertElement(r,n,i){return this.insertElements(r,[n],i)[0]}insertElements(r,n,i={}){let a=this.getElements();r=ku(r,a.length);let s=g(this),u=s?this._getWriterWithChildIndentation():this._getWriterWithQueuedChildIndentation(),p=new iL;return(s?new GT(p):new Ih(p)).printText(u,n),m(this);function m(D){j_({parent:D.getFirstChildByKindOrThrow(b.SyntaxKind.SyntaxList),currentNodes:a,insertIndex:r,newText:u.toString(),useNewLines:s,useTrailingCommas:s&&D._context.manipulationSettings.getUseTrailingCommas()});let P=D.getElements();return af(a,P,r,!1)}function g(D){if(i.useNewLines!=null)return i.useNewLines;if(a.length>1)return P();return D.getStartLineNumber()!==D.getEndLineNumber();function P(){let B=a[0].getStartLineNumber();for(let K=1;K<a.length;K++){let h=a[K].getStartLineNumber();if(B===h)return!1;B=h}return!0}}}removeElement(r){let n=this.getElements();if(n.length===0)throw new b.errors.InvalidOperationError("Cannot remove an element when none exist.");let i=typeof r=="number"?a(r):r;fv(i);function a(s){return n[ku(s,n.length-1)]}}};function DL(e){return class extends e{getExpression(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.expression)}getExpressionOrThrow(){return b.errors.throwIfNullOrUndefined(this.getExpression(),"Expected to find an expression.")}getExpressionIfKind(r){let n=this.getExpression();return n?.getKind()===r?n:void 0}getExpressionIfKindOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getExpressionIfKind(r),`An expression with the kind kind ${b.getSyntaxKindName(r)} was expected.`)}}}function VD(e){return class extends e{getExpression(){return this._getNodeFromCompilerNode(this.compilerNode.expression)}getExpressionIfKind(r){let{expression:n}=this.compilerNode;return n.kind===r?this._getNodeFromCompilerNode(n):void 0}getExpressionIfKindOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getExpressionIfKind(r),`An expression of the kind ${b.getSyntaxKindName(r)} was expected.`)}setExpression(r){return this.getExpression().replaceWithText(r,this._getWriterWithQueuedChildIndentation()),this}set(r){return io(e.prototype,this,r),r.expression!=null&&this.setExpression(r.expression),this}}}function ud(e){return VD(e)}function p9e(e){return VD(e)}function XT(e){return VD(e)}function nq(e){return VD(e)}function jD(e){return VD(e)}var m9e=e=>KE(ud(e)),mpe=m9e(oc),aM=class extends mpe{},_pe=jD(cv),oM=class extends _pe{},_9e=e=>Q6(JH(Y6(XT(e)))),gpe=_9e(RD),sM=class extends gpe{getReturnType(){return this._context.typeChecker.getTypeAtLocation(this)}},ype=oc,lM=class extends ype{getElements(){return this.compilerNode.elements.map(r=>this._getNodeFromCompilerNode(r))}},vpe=oc,uM=class extends vpe{getCondition(){return this._getNodeFromCompilerNode(this.compilerNode.condition)}getQuestionToken(){return this._getNodeFromCompilerNode(this.compilerNode.questionToken)}getWhenTrue(){return this._getNodeFromCompilerNode(this.compilerNode.whenTrue)}getColonToken(){return this._getNodeFromCompilerNode(this.compilerNode.colonToken)}getWhenFalse(){return this._getNodeFromCompilerNode(this.compilerNode.whenFalse)}},hpe=jD(cv),cM=class extends hpe{},g9e=e=>Y6(XT(e)),Epe=g9e(BT),sL=class extends Epe{getArgumentExpression(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.argumentExpression)}getArgumentExpressionOrThrow(){return b.errors.throwIfNullOrUndefined(this.getArgumentExpression(),"Expected to find an argument expression.")}},bpe=sd,dM=class extends bpe{},Spe=UD(sd),cS=class extends Spe{},Tpe=mv(sd),fM=class extends Tpe{getKeywordToken(){return this.compilerNode.keywordToken}},y9e=e=>Q6(JH(XT(e))),xpe=y9e(sd),pM=class extends xpe{},Dpe=ud(RD),mM=class extends Dpe{},UT=class extends Tr{remove(){fv(this)}},_M=class extends UT{},Cpe=oL,NH=class extends Cpe{getLeft(){return this._getNodeFromCompilerNode(this.compilerNode.left)}},Ape=sd,gM=class extends Ape{getPropertyOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getProperty(r),()=>Ou("property",r))}getProperty(r){let n;return typeof r=="string"?n=i=>i[b.nameof("getName")]==null?!1:i.getName()===r:n=r,this.getProperties().find(n)}getProperties(){return this.compilerNode.properties.map(r=>this._getNodeFromCompilerNode(r))}getPropertiesWithComments(){return od.getContainerArray(this.compilerNode,this.getSourceFile().compilerNode).map(n=>this._getNodeFromCompilerNode(n))}_getAddIndex(){return od.getContainerArray(this.compilerNode,this.getSourceFile().compilerNode).length}addProperty(r){return this.insertProperties(this._getAddIndex(),[r])[0]}addProperties(r){return this.insertProperties(this._getAddIndex(),r)}insertProperty(r,n){return this.insertProperties(r,[n])[0]}insertProperties(r,n){let i=this.getPropertiesWithComments();r=ku(r,i.length);let a=this._getWriterWithChildIndentation();return this._context.structurePrinterFactory.forObjectLiteralExpressionProperty().printTexts(a,n),j_({parent:this.getChildSyntaxListOrThrow(),currentNodes:i,insertIndex:r,newText:a.toString(),useNewLines:!0,useTrailingCommas:this._context.manipulationSettings.getUseTrailingCommas()}),af(i,this.getPropertiesWithComments(),r,!0)}addPropertyAssignment(r){return this.addPropertyAssignments([r])[0]}addPropertyAssignments(r){return this.insertPropertyAssignments(this._getAddIndex(),r)}insertPropertyAssignment(r,n){return this.insertPropertyAssignments(r,[n])[0]}insertPropertyAssignments(r,n){return this._insertProperty(r,n,()=>this._context.structurePrinterFactory.forPropertyAssignment())}addShorthandPropertyAssignment(r){return this.addShorthandPropertyAssignments([r])[0]}addShorthandPropertyAssignments(r){return this.insertShorthandPropertyAssignments(this._getAddIndex(),r)}insertShorthandPropertyAssignment(r,n){return this.insertShorthandPropertyAssignments(r,[n])[0]}insertShorthandPropertyAssignments(r,n){return this._insertProperty(r,n,()=>this._context.structurePrinterFactory.forShorthandPropertyAssignment())}addSpreadAssignment(r){return this.addSpreadAssignments([r])[0]}addSpreadAssignments(r){return this.insertSpreadAssignments(this._getAddIndex(),r)}insertSpreadAssignment(r,n){return this.insertSpreadAssignments(r,[n])[0]}insertSpreadAssignments(r,n){return this._insertProperty(r,n,()=>this._context.structurePrinterFactory.forSpreadAssignment())}addMethod(r){return this.addMethods([r])[0]}addMethods(r){return this.insertMethods(this._getAddIndex(),r)}insertMethod(r,n){return this.insertMethods(r,[n])[0]}insertMethods(r,n){return this._insertProperty(r,n,()=>this._context.structurePrinterFactory.forMethodDeclaration({isAmbient:!1}))}addGetAccessor(r){return this.addGetAccessors([r])[0]}addGetAccessors(r){return this.insertGetAccessors(this._getAddIndex(),r)}insertGetAccessor(r,n){return this.insertGetAccessors(r,[n])[0]}insertGetAccessors(r,n){return this._insertProperty(r,n,()=>this._context.structurePrinterFactory.forGetAccessorDeclaration({isAmbient:!1}))}addSetAccessor(r){return this.addSetAccessors([r])[0]}addSetAccessors(r){return this.insertSetAccessors(this._getAddIndex(),r)}insertSetAccessor(r,n){return this.insertSetAccessors(r,[n])[0]}insertSetAccessors(r,n){return this._insertProperty(r,n,()=>this._context.structurePrinterFactory.forSetAccessorDeclaration({isAmbient:!1}))}_insertProperty(r,n,i){r=ku(r,this._getAddIndex());let a=this._getWriterWithChildIndentation(),s=new GT(i()),u=this.getPropertiesWithComments();return s.printText(a,n),j_({parent:this.getFirstChildByKindOrThrow(b.SyntaxKind.SyntaxList),currentNodes:u,insertIndex:r,newText:a.toString(),useNewLines:!0,useTrailingCommas:this._context.manipulationSettings.getUseTrailingCommas()}),af(u,this.getPropertiesWithComments(),r,!1)}},v9e=e=>z6(Rh(UE(e))),iR=v9e(UT),yM=class extends iR{removeInitializer(){let r=this.getInitializerOrThrow(),n=r.getPreviousSiblingIfKindOrThrow(b.SyntaxKind.ColonToken),i=this.getChildIndex(),a=this._sourceFile.getFullText(),s=this.getStart(),u=a.substring(s,n.getPos())+a.substring(r.getEnd(),this.getEnd()),p=this.getParentSyntaxList()||this.getParentOrThrow();return qa({insertPos:s,newText:u,parent:p,replacing:{textLength:this.getWidth()}}),p.getChildAtIndexIfKindOrThrow(i,b.SyntaxKind.ShorthandPropertyAssignment)}setInitializer(r){let n=this.getInitializerOrThrow();return qa({insertPos:n.getStart(),newText:$g(this._getWriterWithQueuedChildIndentation(),r),parent:this,replacing:{textLength:n.getWidth()}}),this}set(r){if(io(iR.prototype,this,r),r.initializer!=null)this.setInitializer(r.initializer);else if(r.hasOwnProperty(b.nameof(r,"initializer")))return this.removeInitializer();return this}getStructure(){let r=this.getInitializerOrThrow(),n=uo(iR.prototype,this,{kind:Oe.StructureKind.PropertyAssignment,initializer:r.getText()});return delete n.hasQuestionToken,n}},h9e=e=>z6(Rh(mv(e))),aR=h9e(UT),vM=class extends aR{hasObjectAssignmentInitializer(){return this.compilerNode.objectAssignmentInitializer!=null}getObjectAssignmentInitializerOrThrow(){return b.errors.throwIfNullOrUndefined(this.getObjectAssignmentInitializer(),"Expected to find an object assignment initializer.")}getObjectAssignmentInitializer(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.objectAssignmentInitializer)}getEqualsTokenOrThrow(){return b.errors.throwIfNullOrUndefined(this.getEqualsToken(),"Expected to find an equals token.")}getEqualsToken(){let r=this.compilerNode.equalsToken;if(r!=null)return this._getNodeFromCompilerNode(r)}removeObjectAssignmentInitializer(){return this.hasObjectAssignmentInitializer()?(Bs({children:[this.getEqualsTokenOrThrow(),this.getObjectAssignmentInitializerOrThrow()],removePrecedingSpaces:!0}),this):this}setInitializer(r){let n=this.getParentSyntaxList()||this.getParentOrThrow(),i=this.getChildIndex();return qa({insertPos:this.getStart(),newText:this.getText()+`: ${r}`,parent:n,replacing:{textLength:this.getWidth()}}),n.getChildAtIndexIfKindOrThrow(i,b.SyntaxKind.PropertyAssignment)}set(r){return io(aR.prototype,this,r),this}getStructure(){let r=uo(aR.prototype,this,{kind:Oe.StructureKind.ShorthandPropertyAssignment});return delete r.hasQuestionToken,r}},oR=ud(UT),hM=class extends oR{set(r){return io(oR.prototype,this,r),this}getStructure(){return uo(oR.prototype,this,{kind:Oe.StructureKind.SpreadAssignment,expression:this.getExpression().getText()})}},Lpe=oc,EM=class extends Lpe{},Npe=ud(oc),bM=class extends Npe{},Ipe=ud(oc),SM=class extends Ipe{},Ppe=cv,TM=class extends Ppe{getOperatorToken(){return this.compilerNode.operator}getOperand(){return this._getNodeFromCompilerNode(this.compilerNode.operand)}},Ope=cv,xM=class extends Ope{getOperatorToken(){return this.compilerNode.operator}getOperand(){return this._getNodeFromCompilerNode(this.compilerNode.operand)}},E9e=e=>mv(Y6(XT(e))),kpe=E9e(BT),lL=class extends kpe{},Rpe=ud(oc),DM=class extends Rpe{},Mpe=nq(sL),IH=class extends Mpe{},wpe=sd,CM=class extends wpe{},Fpe=nq(lL),PH=class extends Fpe{},Gpe=sd,AM=class extends Gpe{},b9e=e=>KE(jD(e)),Bpe=b9e(cv),LM=class extends Bpe{},Upe=jD(cv),NM=class extends Upe{},Kpe=jD(cv),IM=class extends Kpe{},Wpe=DL(zT(oc)),PM=class extends Wpe{},Vpe=Nm(Tr),Cl=class extends Vpe{remove(){y7e(this)}};function Mh(e){return class extends e{getStatements(){var r;let n=this._getCompilerStatementsContainer();return((r=n?.statements)!==null&&r!==void 0?r:[]).map(a=>this._getNodeFromCompilerNode(a))}getStatementsWithComments(){return this._getCompilerStatementsWithComments().map(r=>this._getNodeFromCompilerNode(r))}getStatement(r){return this.getStatements().find(r)}getStatementOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getStatement(r),"Expected to find a statement matching the provided condition.")}getStatementByKind(r){let n=this._getCompilerStatementsWithComments().find(i=>i.kind===r);return this._getNodeFromCompilerNodeIfExists(n)}getStatementByKindOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getStatementByKind(r),`Expected to find a statement with syntax kind ${b.getSyntaxKindName(r)}.`)}addStatements(r){return this.insertStatements(this._getCompilerStatementsWithComments().length,r)}insertStatements(r,n){pfe(this);let i=s=>{this._context.structurePrinterFactory.forStatement({isAmbient:d_(this)}).printTexts(s,n)};return a.call(this).insertChildText(r,i);function a(){let s=this.getChildSyntaxListOrThrow();if(Tr.isCaseClause(this)||Tr.isDefaultClause(this)){let u=s.getFirstChildIfKind(b.SyntaxKind.Block);if(u!=null)return u.getChildSyntaxListOrThrow()}return s}}removeStatement(r){return r=ku(r,this._getCompilerStatementsWithComments().length-1),this.removeStatements([r,r])}removeStatements(r){let n=this.getStatementsWithComments();return b.errors.throwIfRangeOutOfRange(r,[0,n.length],"indexRange"),j6(n.slice(r[0],r[1]+1)),this}addClass(r){return this.addClasses([r])[0]}addClasses(r){return this.insertClasses(this._getCompilerStatementsWithComments().length,r)}insertClass(r,n){return this.insertClasses(r,[n])[0]}insertClasses(r,n){return this._insertChildren({expectedKind:b.SyntaxKind.ClassDeclaration,index:r,structures:n,write:(i,a)=>{this._standardWrite(i,a,()=>{this._context.structurePrinterFactory.forClassDeclaration({isAmbient:d_(this)}).printTexts(i,n)})}})}getClasses(){return this.getStatements().filter(Tr.isClassDeclaration)}getClass(r){return ic(this.getClasses(),r)}getClassOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getClass(r),()=>Ou("class",r))}addEnum(r){return this.addEnums([r])[0]}addEnums(r){return this.insertEnums(this._getCompilerStatementsWithComments().length,r)}insertEnum(r,n){return this.insertEnums(r,[n])[0]}insertEnums(r,n){return this._insertChildren({expectedKind:b.SyntaxKind.EnumDeclaration,index:r,structures:n,write:(i,a)=>{this._standardWrite(i,a,()=>{this._context.structurePrinterFactory.forEnumDeclaration().printTexts(i,n)})}})}getEnums(){return this.getStatements().filter(Tr.isEnumDeclaration)}getEnum(r){return ic(this.getEnums(),r)}getEnumOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getEnum(r),()=>Ou("enum",r))}addFunction(r){return this.addFunctions([r])[0]}addFunctions(r){return this.insertFunctions(this._getCompilerStatementsWithComments().length,r)}insertFunction(r,n){return this.insertFunctions(r,[n])[0]}insertFunctions(r,n){return this._insertChildren({expectedKind:b.SyntaxKind.FunctionDeclaration,index:r,structures:n,write:(i,a)=>{this._standardWrite(i,a,()=>{this._context.structurePrinterFactory.forFunctionDeclaration({isAmbient:d_(this)}).printTexts(i,n)},{previousNewLine:s=>n[0].hasDeclareKeyword===!0&&Tr.isFunctionDeclaration(s)&&s.getBody()==null,nextNewLine:s=>n[n.length-1].hasDeclareKeyword===!0&&Tr.isFunctionDeclaration(s)&&s.getBody()==null})}})}getFunctions(){return this.getStatements().filter(Tr.isFunctionDeclaration).filter(r=>r.isAmbient()||r.isImplementation())}getFunction(r){return ic(this.getFunctions(),r)}getFunctionOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getFunction(r),()=>Ou("function",r))}addInterface(r){return this.addInterfaces([r])[0]}addInterfaces(r){return this.insertInterfaces(this._getCompilerStatementsWithComments().length,r)}insertInterface(r,n){return this.insertInterfaces(r,[n])[0]}insertInterfaces(r,n){return this._insertChildren({expectedKind:b.SyntaxKind.InterfaceDeclaration,index:r,structures:n,write:(i,a)=>{this._standardWrite(i,a,()=>{this._context.structurePrinterFactory.forInterfaceDeclaration().printTexts(i,n)})}})}getInterfaces(){return this.getStatements().filter(Tr.isInterfaceDeclaration)}getInterface(r){return ic(this.getInterfaces(),r)}getInterfaceOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getInterface(r),()=>Ou("interface",r))}addModule(r){return this.addModules([r])[0]}addModules(r){return this.insertModules(this._getCompilerStatementsWithComments().length,r)}insertModule(r,n){return this.insertModules(r,[n])[0]}insertModules(r,n){return this._insertChildren({expectedKind:b.SyntaxKind.ModuleDeclaration,index:r,structures:n,write:(i,a)=>{this._standardWrite(i,a,()=>{this._context.structurePrinterFactory.forModuleDeclaration({isAmbient:d_(this)}).printTexts(i,n)})}})}getModules(){return this.getStatements().filter(Tr.isModuleDeclaration)}getModule(r){return ic(this.getModules(),r)}getModuleOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getModule(r),()=>Ou("module",r))}addTypeAlias(r){return this.addTypeAliases([r])[0]}addTypeAliases(r){return this.insertTypeAliases(this._getCompilerStatementsWithComments().length,r)}insertTypeAlias(r,n){return this.insertTypeAliases(r,[n])[0]}insertTypeAliases(r,n){return this._insertChildren({expectedKind:b.SyntaxKind.TypeAliasDeclaration,index:r,structures:n,write:(i,a)=>{this._standardWrite(i,a,()=>{this._context.structurePrinterFactory.forTypeAliasDeclaration().printTexts(i,n)},{previousNewLine:s=>Tr.isTypeAliasDeclaration(s),nextNewLine:s=>Tr.isTypeAliasDeclaration(s)})}})}getTypeAliases(){return this.getStatements().filter(Tr.isTypeAliasDeclaration)}getTypeAlias(r){return ic(this.getTypeAliases(),r)}getTypeAliasOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getTypeAlias(r),()=>Ou("type alias",r))}getVariableStatements(){return this.getStatements().filter(Tr.isVariableStatement)}getVariableStatement(r){return this.getVariableStatements().find(n());function n(){return typeof r=="string"?i=>i.getDeclarations().some(a=>WH(a,r)):r}}getVariableStatementOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getVariableStatement(r),"Expected to find a variable statement that matched the provided condition.")}addVariableStatement(r){return this.addVariableStatements([r])[0]}addVariableStatements(r){return this.insertVariableStatements(this._getCompilerStatementsWithComments().length,r)}insertVariableStatement(r,n){return this.insertVariableStatements(r,[n])[0]}insertVariableStatements(r,n){return this._insertChildren({expectedKind:b.SyntaxKind.VariableStatement,index:r,structures:n,write:(i,a)=>{this._standardWrite(i,a,()=>{this._context.structurePrinterFactory.forVariableStatement().printTexts(i,n)},{previousNewLine:s=>Tr.isVariableStatement(s),nextNewLine:s=>Tr.isVariableStatement(s)})}})}getVariableDeclarations(){let r=[];for(let n of this.getVariableStatements())r.push(...n.getDeclarations());return r}getVariableDeclaration(r){return ic(this.getVariableDeclarations(),r)}getVariableDeclarationOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getVariableDeclaration(r),()=>Ou("variable declaration",r))}getStructure(){let r={};return Tr.isBodyable(this)&&!this.hasBody()?r.statements=void 0:r.statements=this.getStatements().map(n=>Tr._hasStructure(n)?n.getStructure():n.getText({trimLeadingIndentation:!0})),uo(e.prototype,this,r)}set(r){if(Tr.isBodyable(this)&&r.statements==null&&r.hasOwnProperty(b.nameof(r,"statements")))this.removeBody();else if(r.statements!=null){let n=this._getCompilerStatementsWithComments().length;n>0&&this.removeStatements([0,n-1])}return io(e.prototype,this,r),r.statements!=null&&this.addStatements(r.statements),this}_getCompilerStatementsWithComments(){let r=this._getCompilerStatementsContainer();return r==null?[]:od.getContainerArray(r,this._sourceFile.compilerNode)}_getCompilerStatementsContainer(){var r;if(Tr.isSourceFile(this)||Tr.isCaseClause(this)||Tr.isDefaultClause(this))return this.compilerNode;if(Tr.isModuleDeclaration(this)){let n=this._getInnerBody();return n?.compilerNode}else{if(Tr.isBodyable(this)||Tr.isBodied(this))return(r=this.getBody())===null||r===void 0?void 0:r.compilerNode;if(Tr.isBlock(this)||Tr.isModuleBlock(this))return this.compilerNode;throw new b.errors.NotImplementedError(`Could not find the statements for node kind: ${this.getKindName()}, text: ${this.getText()}`)}}_insertChildren(r){return pfe(this),qH({expectedKind:r.expectedKind,getIndexedChildren:()=>this.getStatementsWithComments(),index:r.index,parent:this,structures:r.structures,write:(n,i)=>r.write(n,i)})}_standardWrite(r,n,i,a={}){n.previousMember!=null&&(a.previousNewLine==null||!a.previousNewLine(n.previousMember))&&!Tr.isCommentNode(n.previousMember)?r.blankLine():n.isStartOfFile||r.newLineIfLastNot(),i(),n.nextMember!=null&&(a.nextNewLine==null||!a.nextNewLine(n.nextMember))?r.blankLine():r.newLineIfLastNot()}}}function pfe(e){Tr.isBodyable(e)&&!e.hasBody()&&e.addBody()}var S9e=e=>ld(Mh(e)),jpe=S9e(Cl),OM=class extends jpe{},kM=class extends Cl{getLabel(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.label)}getLabelOrThrow(){return b.errors.throwIfNullOrUndefined(this.getLabel(),"Expected to find a label.")}},Hpe=ld(Tr),RM=class extends Hpe{getClauses(){return(this.compilerNode.clauses||[]).map(n=>this._getNodeFromCompilerNode(n))}removeClause(r){return r=ku(r,this.getClauses().length-1),this.removeClauses([r,r])}removeClauses(r){let n=this.getClauses();return b.errors.throwIfRangeOutOfRange(r,[0,n.length],"indexRange"),zfe(n.slice(r[0],r[1]+1)),this}},T9e=e=>sc(ud(ld(Mh(e)))),qpe=T9e(Tr),MM=class extends qpe{remove(){Jfe(this)}},Jpe=Tr,wM=class extends Jpe{getBlock(){return this._getNodeFromCompilerNode(this.compilerNode.block)}getVariableDeclaration(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.variableDeclaration)}getVariableDeclarationOrThrow(){return b.errors.throwIfNullOrUndefined(this.getVariableDeclaration(),"Expected to find a variable declaration.")}},FM=class extends Cl{},GM=class extends Cl{getLabel(){return this.compilerNode.label==null?void 0:this._getNodeFromCompilerNode(this.compilerNode.label)}getLabelOrThrow(){return b.errors.throwIfNullOrUndefined(this.getLabel(),"Expected to find a label.")}},zpe=Cl,BM=class extends zpe{},x9e=e=>ld(Mh(e)),$pe=x9e(Tr),UM=class extends $pe{remove(){Jfe(this)}},dS=class extends Cl{getStatement(){return this._getNodeFromCompilerNode(this.compilerNode.statement)}},Xpe=ud(dS),KM=class extends Xpe{},Ype=Cl,WM=class extends Ype{},Qpe=ud(sc(Cl)),VM=class extends Qpe{},Zpe=ud(dS),jM=class extends Zpe{getInitializer(){return this._getNodeFromCompilerNode(this.compilerNode.initializer)}},eme=ud(Yfe(dS)),HM=class extends eme{getInitializer(){return this._getNodeFromCompilerNode(this.compilerNode.initializer)}},rme=dS,qM=class extends rme{getInitializer(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.initializer)}getInitializerOrThrow(){return b.errors.throwIfNullOrUndefined(this.getInitializer(),"Expected to find an initializer.")}getCondition(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.condition)}getConditionOrThrow(){return b.errors.throwIfNullOrUndefined(this.getCondition(),"Expected to find a condition.")}getIncrementor(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.incrementor)}getIncrementorOrThrow(){return b.errors.throwIfNullOrUndefined(this.getIncrementor(),"Expected to find an incrementor.")}},tme=ud(Cl),JM=class extends tme{getThenStatement(){return this._getNodeFromCompilerNode(this.compilerNode.thenStatement)}getElseStatement(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.elseStatement)}remove(){let r=[];Tr.isIfStatement(this.getParentOrThrow())&&r.push(this.getPreviousSiblingIfKindOrThrow(b.SyntaxKind.ElseKeyword)),r.push(this),j6(r)}},nme=sc(Cl),zM=class extends nme{getLabel(){return this._getNodeFromCompilerNode(this.compilerNode.label)}getStatement(){return this._getNodeFromCompilerNode(this.compilerNode.statement)}},ime=Cl,$M=class extends ime{},ame=DL(Cl),XM=class extends ame{},ome=ud(Cl),YM=class extends ome{getCaseBlock(){return this._getNodeFromCompilerNode(this.compilerNode.caseBlock)}getClauses(){return this.getCaseBlock().getClauses()}removeClause(r){return this.getCaseBlock().removeClause(r)}removeClauses(r){return this.getCaseBlock().removeClauses(r)}},sme=ud(Cl),QM=class extends sme{},lme=Cl,ZM=class extends lme{getTryBlock(){return this._getNodeFromCompilerNode(this.compilerNode.tryBlock)}getCatchClause(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.catchClause)}getCatchClauseOrThrow(){return b.errors.throwIfNullOrUndefined(this.getCatchClause(),"Expected to find a catch clause.")}getFinallyBlock(){if(!(this.compilerNode.finallyBlock==null||this.compilerNode.finallyBlock.getFullWidth()===0))return this._getNodeFromCompilerNode(this.compilerNode.finallyBlock)}getFinallyBlockOrThrow(){return b.errors.throwIfNullOrUndefined(this.getFinallyBlock(),"Expected to find a finally block.")}},ume=Tr,ew=class extends ume{setElements(r){return this.replaceWithText(n=>{this._context.structurePrinterFactory.forAssertEntry().printAssertClause(n,r)}),this}getElements(){return this.compilerNode.elements.map(r=>this._getNodeFromCompilerNode(r))}remove(){Bs({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}},sR=ope(Tr),rw=class extends sR{getValue(){return this._getNodeFromCompilerNode(this.compilerNode.value)}set(r){return io(sR.prototype,this,r),r.value&&this.getValue().replaceWithText(r.value),this}getStructure(){return uo(sR.prototype,this,{kind:Oe.StructureKind.AssertEntry,value:this.getValue().getText()})}},OH=ud(Cl),tw=class extends OH{isExportEquals(){return this.compilerNode.isExportEquals||!1}setIsExportEquals(r){return this.isExportEquals()===r?this:(r?this.getFirstChildByKindOrThrow(b.SyntaxKind.DefaultKeyword).replaceWithText("="):this.getFirstChildByKindOrThrow(b.SyntaxKind.EqualsToken).replaceWithText("default"),this)}set(r){return io(OH.prototype,this,r),r.expression!=null&&this.setExpression(r.expression),r.isExportEquals!=null&&this.setIsExportEquals(r.isExportEquals),this}getStructure(){return uo(Cl.prototype,this,{kind:Oe.StructureKind.ExportAssignment,expression:this.getExpression().getText(),isExportEquals:this.isExportEquals()})}},lR=Cl,nw=class extends lR{isTypeOnly(){return this.compilerNode.isTypeOnly}setIsTypeOnly(r){var n;if(this.isTypeOnly()===r)return this;if(r)qa({parent:this,insertPos:((n=this.getNodeProperty("exportClause"))!==null&&n!==void 0?n:this.getFirstChildByKindOrThrow(b.SyntaxKind.AsteriskToken)).getStart(),newText:"type "});else{let i=this.getFirstChildByKindOrThrow(b.ts.SyntaxKind.TypeKeyword);Bs({children:[i],removeFollowingSpaces:!0})}return this}getNamespaceExport(){let r=this.getNodeProperty("exportClause");return r!=null&&Tr.isNamespaceExport(r)?r:void 0}getNamespaceExportOrThrow(){return b.errors.throwIfNullOrUndefined(this.getNamespaceExport(),"Expected to find a namespace export.")}setNamespaceExport(r){let n=this.getNodeProperty("exportClause"),i=b.StringUtils.isNullOrWhitespace(r)?"*":`* as ${r}`;if(n==null){let a=this.getFirstChildByKindOrThrow(b.SyntaxKind.AsteriskToken);qa({insertPos:a.getStart(),parent:this,newText:i,replacing:{textLength:1}})}else Tr.isNamespaceExport(n)?n.getNameNode().replaceWithText(r):qa({insertPos:n.getStart(),parent:this,newText:i,replacing:{textLength:n.getWidth()}});return this}setModuleSpecifier(r){let n=typeof r=="string"?r:this._sourceFile.getRelativePathAsModuleSpecifierTo(r);if(b.StringUtils.isNullOrEmpty(n))return this.removeModuleSpecifier(),this;let i=this.getModuleSpecifier();if(i==null){let a=this.getLastChildIfKind(b.SyntaxKind.SemicolonToken),s=this._context.manipulationSettings.getQuoteKind();qa({insertPos:a!=null?a.getPos():this.getEnd(),parent:this,newText:` from ${s}${n}${s}`})}else i.setLiteralValue(n);return this}getModuleSpecifier(){let r=this._getNodeFromCompilerNodeIfExists(this.compilerNode.moduleSpecifier);if(r!=null){if(!Tr.isStringLiteral(r))throw new b.errors.InvalidOperationError("Expected the module specifier to be a string literal.");return r}}getModuleSpecifierValue(){let r=this.getModuleSpecifier();return r?.getLiteralValue()}getModuleSpecifierSourceFileOrThrow(){return b.errors.throwIfNullOrUndefined(this.getModuleSpecifierSourceFile(),"A module specifier source file was expected.")}getModuleSpecifierSourceFile(){let r=this.getLastChildByKind(b.SyntaxKind.StringLiteral);if(r==null)return;let n=r.getSymbol();if(n==null)return;let i=n.getDeclarations()[0];return i!=null&&Tr.isSourceFile(i)?i:void 0}isModuleSpecifierRelative(){let r=this.getModuleSpecifierValue();return r==null?!1:RE.isModuleSpecifierRelative(r)}removeModuleSpecifier(){let r=this.getModuleSpecifier();if(r==null)return this;if(!this.hasNamedExports())throw new b.errors.InvalidOperationError("Cannot remove the module specifier from an export declaration that has no named exports.");return Bs({children:[this.getFirstChildByKindOrThrow(b.SyntaxKind.FromKeyword),r],removePrecedingNewLines:!0,removePrecedingSpaces:!0}),this}hasModuleSpecifier(){return this.getLastChildByKind(b.SyntaxKind.StringLiteral)!=null}isNamespaceExport(){return!this.hasNamedExports()}hasNamedExports(){var r;return((r=this.compilerNode.exportClause)===null||r===void 0?void 0:r.kind)===b.SyntaxKind.NamedExports}addNamedExport(r){return this.addNamedExports([r])[0]}addNamedExports(r){return this.insertNamedExports(this.getNamedExports().length,r)}insertNamedExport(r,n){return this.insertNamedExports(r,[n])[0]}insertNamedExports(r,n){if(!(n instanceof Function)&&b.ArrayUtils.isNullOrEmpty(n))return[];let i=this.getNamedExports(),a=this._getWriterWithIndentation(),s=this._context.structurePrinterFactory.forNamedImportExportSpecifier();r=ku(r,i.length);let u=this.getNodeProperty("exportClause");if(u==null){s.printTextsWithBraces(a,n);let f=this.getFirstChildByKindOrThrow(b.SyntaxKind.AsteriskToken);qa({insertPos:f.getStart(),parent:this,newText:a.toString(),replacing:{textLength:1}})}else u.getKind()===b.SyntaxKind.NamespaceExport?(s.printTextsWithBraces(a,n),qa({insertPos:u.getStart(),parent:this,newText:a.toString(),replacing:{textLength:u.getWidth()}})):(s.printTexts(a,n),j_({parent:this.getFirstChildByKindOrThrow(b.SyntaxKind.NamedExports).getFirstChildByKindOrThrow(b.SyntaxKind.SyntaxList),currentNodes:i,insertIndex:r,newText:a.toString(),surroundWithSpaces:this._context.getFormatCodeSettings().insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces,useTrailingCommas:!1}));let p=this.getNamedExports();return af(i,p,r,!1)}getNamedExports(){let r=this.compilerNode.exportClause;return r==null||b.ts.isNamespaceExport(r)?[]:r.elements.map(n=>this._getNodeFromCompilerNode(n))}toNamespaceExport(){if(!this.hasModuleSpecifier())throw new b.errors.InvalidOperationError("Cannot change to a namespace export when no module specifier exists.");let r=this.getNodeProperty("exportClause");return r==null?this:(qa({parent:this,newText:"*",insertPos:r.getStart(),replacing:{textLength:r.getWidth()}}),this)}setAssertElements(r){let n=this.getAssertClause();if(n)r?n.setElements(r):n.remove();else if(r){let i=this._context.structurePrinterFactory.forAssertEntry(),a=this._context.createWriter();a.space(),i.printAssertClause(a,r),qa({parent:this,newText:a.toString(),insertPos:this.getSourceFile().getFullText()[this.getEnd()-1]===";"?this.getEnd()-1:this.getEnd()})}return this}getAssertClause(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.assertClause)}set(r){return io(lR.prototype,this,r),r.namedExports!=null?(D9e(this),this.addNamedExports(r.namedExports)):r.hasOwnProperty(b.nameof(r,"namedExports"))&&r.moduleSpecifier==null&&this.toNamespaceExport(),r.moduleSpecifier!=null?this.setModuleSpecifier(r.moduleSpecifier):r.hasOwnProperty(b.nameof(r,"moduleSpecifier"))&&this.removeModuleSpecifier(),r.namedExports==null&&r.hasOwnProperty(b.nameof(r,"namedExports"))&&this.toNamespaceExport(),r.namespaceExport!=null&&this.setNamespaceExport(r.namespaceExport),r.isTypeOnly!=null&&this.setIsTypeOnly(r.isTypeOnly),r.hasOwnProperty(b.nameof(r,"assertElements"))&&this.setAssertElements(r.assertElements),this}getStructure(){var r;let n=this.getModuleSpecifier(),i=this.getAssertClause();return uo(lR.prototype,this,{kind:Oe.StructureKind.ExportDeclaration,isTypeOnly:this.isTypeOnly(),moduleSpecifier:n?.getLiteralText(),namedExports:this.getNamedExports().map(a=>a.getStructure()),namespaceExport:(r=this.getNamespaceExport())===null||r===void 0?void 0:r.getName(),assertElements:i?i.getElements().map(a=>a.getStructure()):void 0})}};function D9e(e){let r=e.getNodeProperty("exportClause"),n;if(r!=null){if(e.getNamedExports().length===0)return;n=r}else n=e.getFirstChildByKindOrThrow(b.SyntaxKind.AsteriskToken);qa({parent:e,newText:"{ }",insertPos:n.getStart(),replacing:{textLength:n.getWidth()}})}var kH=Tr,iw=class extends kH{setName(r){let n=this.getNameNode();return n.getText()===r?this:(n.replaceWithText(r),this)}getName(){return this.getNameNode().getText()}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.propertyName||this.compilerNode.name)}renameAlias(r){if(b.StringUtils.isNullOrWhitespace(r))return this.removeAliasWithRename(),this;let n=this.getAliasNode();return n==null&&(this.setAlias(this.getName()),n=this.getAliasNode()),n.rename(r),this}setAlias(r){if(b.StringUtils.isNullOrWhitespace(r))return this.removeAlias(),this;let n=this.getAliasNode();return n==null?qa({insertPos:this.getNameNode().getEnd(),parent:this,newText:` as ${r}`}):n.replaceWithText(r),this}removeAlias(){let r=this.getAliasNode();return r==null?this:(Bs({children:[this.getFirstChildByKindOrThrow(b.SyntaxKind.AsKeyword),r],removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this)}removeAliasWithRename(){let r=this.getAliasNode();return r==null?this:(r.rename(this.getName()),this.removeAlias(),this)}getAliasNode(){if(this.compilerNode.propertyName!=null)return this._getNodeFromCompilerNode(this.compilerNode.name)}isTypeOnly(){return this.compilerNode.isTypeOnly}setIsTypeOnly(r){return this.isTypeOnly()===r?this:(r?qa({insertPos:this.getStart(),parent:this,newText:"type "}):Bs({children:[this.getFirstChildByKindOrThrow(b.ts.SyntaxKind.TypeKeyword)],removeFollowingSpaces:!0}),this)}getExportDeclaration(){return this.getFirstAncestorByKindOrThrow(b.SyntaxKind.ExportDeclaration)}getLocalTargetSymbolOrThrow(){return b.errors.throwIfNullOrUndefined(this.getLocalTargetSymbol(),"The export specifier's local target symbol was expected.")}getLocalTargetSymbol(){return this._context.typeChecker.getExportSpecifierLocalTargetSymbol(this)}getLocalTargetDeclarations(){var r,n;return(n=(r=this.getLocalTargetSymbol())===null||r===void 0?void 0:r.getDeclarations())!==null&&n!==void 0?n:[]}remove(){let r=this.getExportDeclaration();r.getNamedExports().length>1?fv(this):r.hasModuleSpecifier()?r.toNamespaceExport():r.remove()}set(r){return io(kH.prototype,this,r),r.name!=null&&this.setName(r.name),r.alias!=null?this.setAlias(r.alias):r.hasOwnProperty(b.nameof(r,"alias"))&&this.removeAlias(),this}getStructure(){let r=this.getAliasNode();return uo(Tr.prototype,this,{kind:Oe.StructureKind.ExportSpecifier,alias:r?r.getText():void 0,name:this.getNameNode().getText()})}},cme=DL(Tr),aw=class extends cme{getReferencedSourceFileOrThrow(){return b.errors.throwIfNullOrUndefined(this.getReferencedSourceFile(),"Expected to find the referenced source file.")}isRelative(){let r=this.getExpression();return r==null||!Tr.isStringLiteral(r)?!1:RE.isModuleSpecifierRelative(r.getLiteralText())}getReferencedSourceFile(){let r=this.getExpression();if(r==null)return;let n=r.getSymbol();if(n!=null)return RE.getReferencedSourceFileFromSymbol(n)}},dme=Tr,ow=class extends dme{isTypeOnly(){return this.compilerNode.isTypeOnly}setIsTypeOnly(r){if(this.isTypeOnly()===r)return this;if(r)qa({parent:this,insertPos:this.getStart(),newText:"type "});else{let n=this.getFirstChildByKindOrThrow(b.ts.SyntaxKind.TypeKeyword);Bs({children:[n],removeFollowingSpaces:!0})}return this}getDefaultImportOrThrow(){return b.errors.throwIfNullOrUndefined(this.getDefaultImport(),"Expected to find a default import.")}getDefaultImport(){return this.getNodeProperty("name")}getNamedBindingsOrThrow(){return b.errors.throwIfNullOrUndefined(this.getNamedBindings(),"Expected to find an import declaration's named bindings.")}getNamedBindings(){return this.getNodeProperty("namedBindings")}getNamespaceImportOrThrow(){return b.errors.throwIfNullOrUndefined(this.getNamespaceImport(),"Expected to find a namespace import.")}getNamespaceImport(){let r=this.getNamedBindings();if(!(r==null||!Tr.isNamespaceImport(r)))return r.getNameNode()}getNamedImports(){let r=this.getNamedBindings();return r==null||!Tr.isNamedImports(r)?[]:r.getElements()}},uR=Cl,sw=class extends uR{isTypeOnly(){var r,n;return(n=(r=this.getImportClause())===null||r===void 0?void 0:r.isTypeOnly())!==null&&n!==void 0?n:!1}setIsTypeOnly(r){let n=this.getImportClause();if(n==null){if(r)throw new b.errors.InvalidOperationError("Cannot set an import as type only when there is no import clause.");return this}return n.setIsTypeOnly(r),this}setModuleSpecifier(r){let n=typeof r=="string"?r:this._sourceFile.getRelativePathAsModuleSpecifierTo(r);return this.getModuleSpecifier().setLiteralValue(n),this}getModuleSpecifier(){let r=this._getNodeFromCompilerNode(this.compilerNode.moduleSpecifier);if(!Tr.isStringLiteral(r))throw new b.errors.InvalidOperationError("Expected the module specifier to be a string literal.");return r}getModuleSpecifierValue(){return this.getModuleSpecifier().getLiteralValue()}getModuleSpecifierSourceFileOrThrow(){return b.errors.throwIfNullOrUndefined(this.getModuleSpecifierSourceFile(),"A module specifier source file was expected.")}getModuleSpecifierSourceFile(){let r=this.getModuleSpecifier().getSymbol();if(r!=null)return RE.getReferencedSourceFileFromSymbol(r)}isModuleSpecifierRelative(){return RE.isModuleSpecifierRelative(this.getModuleSpecifierValue())}setDefaultImport(r){if(b.StringUtils.isNullOrWhitespace(r))return this.removeDefaultImport();let n=this.getDefaultImport();if(n!=null)return n.replaceWithText(r),this;let i=this.getFirstChildByKindOrThrow(b.SyntaxKind.ImportKeyword),a=this.getImportClause();return a==null?(qa({insertPos:i.getEnd(),parent:this,newText:` ${r} from`}),this):(qa({insertPos:i.getEnd(),parent:a,newText:` ${r},`}),this)}renameDefaultImport(r){if(b.StringUtils.isNullOrWhitespace(r))return this.removeDefaultImport();let n=this.getDefaultImport();return n!=null?(n.rename(r),this):(this.setDefaultImport(r),this)}getDefaultImportOrThrow(){return b.errors.throwIfNullOrUndefined(this.getDefaultImport(),"Expected to find a default import.")}getDefaultImport(){var r,n;return(n=(r=this.getImportClause())===null||r===void 0?void 0:r.getDefaultImport())!==null&&n!==void 0?n:void 0}setNamespaceImport(r){if(b.StringUtils.isNullOrWhitespace(r))return this.removeNamespaceImport();let n=this.getNamespaceImport();if(n!=null)return n.rename(r),this;if(this.getNamedImports().length>0)throw new b.errors.InvalidOperationError("Cannot add a namespace import to an import declaration that has named imports.");let i=this.getDefaultImport();return i!=null?(qa({insertPos:i.getEnd(),parent:this.getImportClause(),newText:`, * as ${r}`}),this):(qa({insertPos:this.getFirstChildByKindOrThrow(b.SyntaxKind.ImportKeyword).getEnd(),parent:this,newText:` * as ${r} from`}),this)}removeNamespaceImport(){let r=this.getNamespaceImport();if(r==null)return this;return Bs({children:n.call(this),removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this;function n(){let i=this.getDefaultImport();return i==null?[this.getImportClauseOrThrow(),this.getLastChildByKindOrThrow(b.SyntaxKind.FromKeyword)]:[i.getNextSiblingIfKindOrThrow(b.SyntaxKind.CommaToken),r]}}removeDefaultImport(){let r=this.getImportClause();if(r==null)return this;let n=r.getDefaultImport();if(n==null)return this;let i=r.getChildCount()===1;return Bs(i?{children:[r,r.getNextSiblingIfKindOrThrow(b.SyntaxKind.FromKeyword)],removePrecedingSpaces:!0,removePrecedingNewLines:!0}:{children:[n,n.getNextSiblingIfKindOrThrow(b.SyntaxKind.CommaToken)],removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this}getNamespaceImportOrThrow(){return b.errors.throwIfNullOrUndefined(this.getNamespaceImport(),"Expected to find a namespace import.")}getNamespaceImport(){var r,n;return(n=(r=this.getImportClause())===null||r===void 0?void 0:r.getNamespaceImport())!==null&&n!==void 0?n:void 0}addNamedImport(r){return this.addNamedImports([r])[0]}addNamedImports(r){return this.insertNamedImports(this.getNamedImports().length,r)}insertNamedImport(r,n){return this.insertNamedImports(r,[n])[0]}insertNamedImports(r,n){if(!(n instanceof Function)&&b.ArrayUtils.isNullOrEmpty(n))return[];let i=this.getNamedImports(),a=this._getWriterWithQueuedIndentation(),s=this._context.structurePrinterFactory.forNamedImportExportSpecifier(),u=this.getImportClause();if(r=ku(r,i.length),i.length===0)if(s.printTextsWithBraces(a,n),u==null)qa({insertPos:this.getFirstChildByKindOrThrow(b.SyntaxKind.ImportKeyword).getEnd(),parent:this,newText:` ${a.toString()} from`});else{if(this.getNamespaceImport()!=null)throw fme();if(u.getNamedBindings()!=null){let f=u.getNamedBindingsOrThrow();qa({insertPos:f.getStart(),replacing:{textLength:f.getWidth()},parent:u,newText:a.toString()})}else qa({insertPos:this.getDefaultImport().getEnd(),parent:u,newText:`, ${a.toString()}`})}else{if(u==null)throw new b.errors.NotImplementedError("Expected to have an import clause.");s.printTexts(a,n),j_({parent:u.getFirstChildByKindOrThrow(b.SyntaxKind.NamedImports).getFirstChildByKindOrThrow(b.SyntaxKind.SyntaxList),currentNodes:i,insertIndex:r,newText:a.toString(),surroundWithSpaces:this._context.getFormatCodeSettings().insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces,useTrailingCommas:!1})}let p=this.getNamedImports();return af(i,p,r,!1)}getNamedImports(){var r,n;return(n=(r=this.getImportClause())===null||r===void 0?void 0:r.getNamedImports())!==null&&n!==void 0?n:[]}removeNamedImports(){let r=this.getImportClause();if(r==null)return this;let n=r.getNamedBindings();if(n==null||n.getKind()!==b.SyntaxKind.NamedImports)return this;let i=this.getDefaultImport();if(i!=null){let s=i.getNextSiblingIfKindOrThrow(b.SyntaxKind.CommaToken);return Bs({children:[s,n]}),this}let a=r.getNextSiblingIfKindOrThrow(b.SyntaxKind.FromKeyword);return Bs({children:[r,a],removePrecedingSpaces:!0}),this}getImportClauseOrThrow(){return b.errors.throwIfNullOrUndefined(this.getImportClause(),"Expected to find an import clause.")}getImportClause(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.importClause)}setAssertElements(r){let n=this.getAssertClause();if(n)r?n.setElements(r):n.remove();else if(r){let i=this._context.structurePrinterFactory.forAssertEntry(),a=this._context.createWriter();a.space(),i.printAssertClause(a,r),qa({parent:this,newText:a.toString(),insertPos:this.getSourceFile().getFullText()[this.getEnd()-1]===";"?this.getEnd()-1:this.getEnd()})}return this}getAssertClause(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.assertClause)}set(r){return io(uR.prototype,this,r),r.defaultImport!=null?this.setDefaultImport(r.defaultImport):r.hasOwnProperty(b.nameof(r,"defaultImport"))&&this.removeDefaultImport(),r.hasOwnProperty(b.nameof(r,"namedImports"))&&this.removeNamedImports(),r.namespaceImport!=null?this.setNamespaceImport(r.namespaceImport):r.hasOwnProperty(b.nameof(r,"namespaceImport"))&&this.removeNamespaceImport(),r.namedImports!=null&&(C9e(this),this.addNamedImports(r.namedImports)),r.moduleSpecifier!=null&&this.setModuleSpecifier(r.moduleSpecifier),r.isTypeOnly!=null&&this.setIsTypeOnly(r.isTypeOnly),r.hasOwnProperty(b.nameof(r,"assertElements"))&&this.setAssertElements(r.assertElements),this}getStructure(){let r=this.getNamespaceImport(),n=this.getDefaultImport(),i=this.getAssertClause();return uo(uR.prototype,this,{kind:Oe.StructureKind.ImportDeclaration,isTypeOnly:this.isTypeOnly(),defaultImport:n?n.getText():void 0,moduleSpecifier:this.getModuleSpecifier().getLiteralText(),namedImports:this.getNamedImports().map(a=>a.getStructure()),namespaceImport:r?r.getText():void 0,assertElements:i?i.getElements().map(a=>a.getStructure()):void 0})}};function C9e(e){let r=e.getNodeProperty("importClause"),n=e._getWriterWithQueuedChildIndentation();e._context.structurePrinterFactory.forNamedImportExportSpecifier().printTextsWithBraces(n,[]);let a=n.toString();if(e.getNamespaceImport()!=null)throw fme();if(r==null){qa({insertPos:e.getFirstChildByKindOrThrow(b.SyntaxKind.ImportKeyword).getEnd(),parent:e,newText:` ${a} from`});return}let s=r.getNamedBindings();if(s!=null){qa({parent:r,newText:a,insertPos:s.getStart(),replacing:{textLength:s.getWidth()}});return}let u=r.getDefaultImport();if(u!=null){qa({insertPos:u.getEnd(),parent:r,newText:`, ${a}`});return}}function fme(){return new b.errors.InvalidOperationError("Cannot add a named import to an import declaration that has a namespace import.")}var A9e=e=>sc(mv(e)),pme=A9e(Cl),lw=class extends pme{isTypeOnly(){var r;return(r=this.compilerNode.isTypeOnly)!==null&&r!==void 0?r:!1}setIsTypeOnly(r){if(this.isTypeOnly()===r)return this;if(r)qa({parent:this,insertPos:this.getNameNode().getStart(),newText:"type "});else{let n=this.getFirstChildByKindOrThrow(b.ts.SyntaxKind.TypeKeyword);Bs({children:[n],removeFollowingSpaces:!0})}return this}getModuleReference(){return this._getNodeFromCompilerNode(this.compilerNode.moduleReference)}isExternalModuleReferenceRelative(){let r=this.getModuleReference();return Tr.isExternalModuleReference(r)?r.isRelative():!1}setExternalModuleReference(r){let n=typeof r=="string"?r:this._sourceFile.getRelativePathAsModuleSpecifierTo(r),i=this.getModuleReference();return Tr.isExternalModuleReference(i)&&i.getExpression()!=null?i.getExpressionOrThrow().replaceWithText(a=>a.quote(n)):i.replaceWithText(a=>a.write("require(").quote(n).write(")")),this}getExternalModuleReferenceSourceFileOrThrow(){return b.errors.throwIfNullOrUndefined(this.getExternalModuleReferenceSourceFile(),"Expected to find an external module reference's referenced source file.")}getExternalModuleReferenceSourceFile(){let r=this.getModuleReference();if(!!Tr.isExternalModuleReference(r))return r.getReferencedSourceFile()}},cR=Tr,uw=class extends cR{setName(r){let n=this.getNameNode();return n.getText()===r?this:(n.replaceWithText(r),this)}getName(){return this.getNameNode().getText()}getNameNode(){var r;return this._getNodeFromCompilerNode((r=this.compilerNode.propertyName)!==null&&r!==void 0?r:this.compilerNode.name)}renameAlias(r){if(b.StringUtils.isNullOrWhitespace(r))return this.removeAliasWithRename(),this;let n=this.getAliasNode();return n==null&&(this.setAlias(this.getName()),n=this.getAliasNode()),n.rename(r),this}setAlias(r){if(b.StringUtils.isNullOrWhitespace(r))return this.removeAlias(),this;let n=this.getAliasNode();return n==null?qa({insertPos:this.getNameNode().getEnd(),parent:this,newText:` as ${r}`}):n.replaceWithText(r),this}removeAlias(){let r=this.getAliasNode();return r==null?this:(Bs({children:[this.getFirstChildByKindOrThrow(b.SyntaxKind.AsKeyword),r],removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this)}removeAliasWithRename(){let r=this.getAliasNode();return r==null?this:(r.rename(this.getName()),this.removeAlias(),this)}getAliasNode(){if(this.compilerNode.propertyName!=null)return this._getNodeFromCompilerNode(this.compilerNode.name)}isTypeOnly(){return this.compilerNode.isTypeOnly}setIsTypeOnly(r){return this.isTypeOnly()===r?this:(r?qa({insertPos:this.getStart(),parent:this,newText:"type "}):Bs({children:[this.getFirstChildByKindOrThrow(b.ts.SyntaxKind.TypeKeyword)],removeFollowingSpaces:!0}),this)}getImportDeclaration(){return this.getFirstAncestorByKindOrThrow(b.SyntaxKind.ImportDeclaration)}remove(){let r=this.getImportDeclaration();r.getNamedImports().length>1?fv(this):r.removeNamedImports()}set(r){return io(cR.prototype,this,r),r.name!=null&&this.setName(r.name),r.alias!=null?this.setAlias(r.alias):r.hasOwnProperty(b.nameof(r,"alias"))&&this.removeAlias(),this}getStructure(){let r=this.getAliasNode();return uo(cR.prototype,this,{kind:Oe.StructureKind.ImportSpecifier,name:this.getName(),alias:r?r.getText():void 0})}},mme=Mh(Cl),cw=class extends mme{};function yS(e){return class extends e{getParentModuleOrThrow(){return b.errors.throwIfNullOrUndefined(this.getParentModule(),"Expected to find the parent module declaration.")}getParentModule(){let r=this.getParentOrThrow();if(!!Tr.isModuleBlock(r)){for(;r.getParentOrThrow().getKind()===b.SyntaxKind.ModuleDeclaration;)r=r.getParentOrThrow();return r}}}}Oe.ModuleDeclarationKind=void 0;(function(e){e.Namespace="namespace",e.Module="module",e.Global="global"})(Oe.ModuleDeclarationKind||(Oe.ModuleDeclarationKind={}));var L9e=e=>ZH(Z6(ld(HT(yS(Mh(sc(Ph(BE(sf(spe(e))))))))))),dR=L9e(Cl),dw=class extends dR{getName(){let r=this.getNameNodes();return r instanceof Array?r.map(n=>n.getText()).join("."):r.getText()}setName(r){let n="Please open an issue if you really need this and I'll up the priority.";if(r.indexOf(".")>=0)throw new b.errors.NotImplementedError(`Not implemented to set a namespace name to a name containing a period. ${n}`);let i=this.getNameNodes();if(i instanceof Array){if(i.length>1)throw new b.errors.NotImplementedError(`Not implemented to set a namespace name that uses dot notation. ${n}`);r!=="global"&&ij(this),b.StringUtils.isQuoted(r)&&N9e(this),i[0].replaceWithText(r)}else i.replaceWithText(r);return this}rename(r,n){if(r.indexOf(".")>=0)throw new b.errors.NotSupportedError("Cannot rename a namespace name to a name containing a period.");let i=this.getNameNodes();if(i instanceof Array){if(i.length>1)throw new b.errors.NotSupportedError(`Cannot rename a namespace name that uses dot notation. Rename the individual nodes via .${b.nameof(this,"getNameNodes")}()`);r!=="global"&&ij(this),i[0].rename(r,n)}else Zfe(i,b.StringUtils.stripQuotes(r),n);return this}getNameNodes(){let r=this.getNameNode();if(Tr.isStringLiteral(r))return r;{let n=[],i=this;do n.push(this._getNodeFromCompilerNode(i.compilerNode.name)),i=i.getFirstChildByKind(b.SyntaxKind.ModuleDeclaration);while(i!=null);return n}}hasNamespaceKeyword(){return this.getDeclarationKind()===Oe.ModuleDeclarationKind.Namespace}hasModuleKeyword(){return this.getDeclarationKind()===Oe.ModuleDeclarationKind.Module}setDeclarationKind(r){if(this.getDeclarationKind()===r)return this;if(r===Oe.ModuleDeclarationKind.Global){let n=this.getDeclarationKindKeyword();this.getNameNode().replaceWithText("global"),n!=null&&Bs({children:[n],removeFollowingNewLines:!0,removeFollowingSpaces:!0})}else{let n=this.getDeclarationKindKeyword();n!=null?n.replaceWithText(r):qa({parent:this,insertPos:this.getNameNode().getStart(),newText:r+" "})}return this}getDeclarationKind(){let r=this.getFlags();return(r&b.ts.NodeFlags.GlobalAugmentation)!==0?Oe.ModuleDeclarationKind.Global:(r&b.ts.NodeFlags.Namespace)!==0?Oe.ModuleDeclarationKind.Namespace:Oe.ModuleDeclarationKind.Module}getDeclarationKindKeyword(){return this.getFirstChild(r=>r.getKind()===b.SyntaxKind.NamespaceKeyword||r.getKind()===b.SyntaxKind.ModuleKeyword)}set(r){return r.name!=null&&r.name!=="global"&&ij(this),io(dR.prototype,this,r),r.declarationKind!=null&&this.setDeclarationKind(r.declarationKind),this}getStructure(){return uo(dR.prototype,this,{kind:Oe.StructureKind.Module,declarationKind:this.getDeclarationKind()})}_getInnerBody(){let r=this.getBody();for(;r!=null&&Tr.isBodyable(r)&&r.compilerNode.statements==null;)r=r.getBody();return r}};function ij(e){e.getDeclarationKind()===Oe.ModuleDeclarationKind.Global&&e.setDeclarationKind(Oe.ModuleDeclarationKind.Namespace)}function N9e(e){e.hasNamespaceKeyword()&&e.setDeclarationKind(Oe.ModuleDeclarationKind.Module),e.hasDeclareKeyword()||e.setHasDeclareKeyword(!0)}var _me=Tr,fw=class extends _me{getElements(){return this.compilerNode.elements.map(r=>this._getNodeFromCompilerNode(r))}},gme=Tr,pw=class extends gme{getElements(){return this.compilerNode.elements.map(r=>this._getNodeFromCompilerNode(r))}},yme=pv(Tr),mw=class extends yme{setName(r){let n=this.getNameNode();return n.getText()===r?this:(n.replaceWithText(r),this)}getName(){return this.getNameNode().getText()}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}},vme=pv(Tr),_w=class extends vme{setName(r){let n=this.getNameNode();return n.getText()===r?this:(n.replaceWithText(r),this)}getName(){return this.getNameNode().getText()}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}},OD=class extends nL{constructor(r,n){super(r,n)}getFileName(){return this.compilerObject.fileName}};Oe.FileSystemRefreshResult=void 0;(function(e){e[e.NoChange=0]="NoChange",e[e.Updated=1]="Updated",e[e.Deleted=2]="Deleted"})(Oe.FileSystemRefreshResult||(Oe.FileSystemRefreshResult={}));function co(e,r,n,i){var a=arguments.length,s=a<3?r:i===null?i=Object.getOwnPropertyDescriptor(r,n):i,u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(e,r,n,i);else for(var p=e.length-1;p>=0;p--)(u=e[p])&&(s=(a<3?u(s):a>3?u(r,n,s):u(r,n))||s);return a>3&&s&&Object.defineProperty(r,n,s),s}var fR=ZH(ld(Mh(Tr))),kE=class extends fR{constructor(r,n){super(r,n,void 0),this._isSaved=!1,this._modifiedEventContainer=new b.EventContainer,this._preModifiedEventContainer=new b.EventContainer,this._referenceContainer=new dj(this),this.__sourceFile=this;let i=()=>{this.isFromExternalLibrary(),this._preModifiedEventContainer.unsubscribe(i)};this._preModifiedEventContainer.subscribe(i)}_replaceCompilerNodeFromFactory(r){super._replaceCompilerNodeFromFactory(r),this._context.resetProgram(),this._isSaved=!1,this._modifiedEventContainer.fire(this)}_clearInternals(){super._clearInternals(),r(this._referencedFiles),r(this._typeReferenceDirectives),r(this._libReferenceDirectives),delete this._referencedFiles,delete this._typeReferenceDirectives,delete this._libReferenceDirectives;function r(n){n?.forEach(i=>i._forget())}}getFilePath(){return this.compilerNode.fileName}getBaseName(){return b.FileUtils.getBaseName(this.getFilePath())}getBaseNameWithoutExtension(){let r=this.getBaseName(),n=this.getExtension();return r.substring(0,r.length-n.length)}getExtension(){return b.FileUtils.getExtension(this.getFilePath())}getDirectory(){return this._context.compilerFactory.getDirectoryFromCache(this.getDirectoryPath())}getDirectoryPath(){return this._context.fileSystemWrapper.getStandardizedAbsolutePath(b.FileUtils.getDirPath(this.compilerNode.fileName))}getFullText(){return this.compilerNode.text}getLineAndColumnAtPos(r){let n=this.getFullText();return{line:b.StringUtils.getLineNumberAtPos(n,r),column:b.StringUtils.getLengthFromLineStartAtPos(n,r)+1}}getLengthFromLineStartAtPos(r){return b.StringUtils.getLengthFromLineStartAtPos(this.getFullText(),r)}copyToDirectory(r,n){let i=typeof r=="string"?r:r.getPath();return this.copy(b.FileUtils.pathJoin(i,this.getBaseName()),n)}copy(r,n={}){this._throwIfIsInMemoryLibFile();let i=this._copyInternal(r,n);if(i===!1)return this;let a=i;return a.getDirectoryPath()!==this.getDirectoryPath()&&a._updateReferencesForCopyInternal(this._getReferencesForCopyInternal()),a}_copyInternal(r,n={}){let{overwrite:i=!1}=n,{compilerFactory:a,fileSystemWrapper:s}=this._context,u=s.getStandardizedAbsolutePath(r,this.getDirectoryPath());if(u===this.getFilePath())return!1;return p(this);function p(f){try{return a.createSourceFileFromText(u,f.getFullText(),{overwrite:i,markInProject:m()})}catch(g){throw g instanceof b.errors.InvalidOperationError?new b.errors.InvalidOperationError("Did you mean to provide the overwrite option? "+g.message):g}function m(){if(f._isInProject())return!0;let g=a.getSourceFileFromCacheFromFilePath(u);return g!=null&&g._isInProject()}}}_getReferencesForCopyInternal(){return Array.from(this._referenceContainer.getLiteralsReferencingOtherSourceFilesEntries())}_updateReferencesForCopyInternal(r){for(let n of r)n[0]=this.getChildSyntaxListOrThrow().getDescendantAtStartWithWidth(n[0].getStart(),n[0].getWidth());aj(r)}async copyImmediately(r,n){let i=this.copy(r,n);return await i.save(),i}copyImmediatelySync(r,n){let i=this.copy(r,n);return i.saveSync(),i}moveToDirectory(r,n){let i=typeof r=="string"?r:r.getPath();return this.move(b.FileUtils.pathJoin(i,this.getBaseName()),n)}move(r,n={}){this._throwIfIsInMemoryLibFile();let i=this.getDirectoryPath(),a=this._getReferencesForMoveInternal(),s=this.getFilePath();return this._moveInternal(r,n)?(this._context.fileSystemWrapper.queueFileDelete(s),this._updateReferencesForMoveInternal(a,i),this._context.lazyReferenceCoordinator.clearDirtySourceFiles(),this._context.lazyReferenceCoordinator.addDirtySourceFile(this),this):this}_moveInternal(r,n={}){let{overwrite:i=!1}=n,a=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getDirectoryPath());if(a===this.getFilePath())return!1;let s=!1;if(i){let u=this._context.compilerFactory.getSourceFileFromCacheFromFilePath(a);u!=null&&(s=u._isInProject(),u.forget())}else this._context.compilerFactory.throwIfFileExists(a,"Did you mean to provide the overwrite option?");return Xfe({newFilePath:a,sourceFile:this}),s&&this._markAsInProject(),this._isInProject()&&this.getDirectory()._markAsInProject(),!0}_getReferencesForMoveInternal(){return{literalReferences:Array.from(this._referenceContainer.getLiteralsReferencingOtherSourceFilesEntries()),referencingLiterals:Array.from(this._referenceContainer.getReferencingLiteralsInOtherSourceFiles())}}_updateReferencesForMoveInternal(r,n){let{literalReferences:i,referencingLiterals:a}=r;n!==this.getDirectoryPath()&&aj(i),aj(a.map(s=>[s,this]))}async moveImmediately(r,n){let i=this.getFilePath(),a=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getDirectoryPath());return this.move(r,n),i!==a?(await this._context.fileSystemWrapper.moveFileImmediately(i,a,this.getFullText()),this._isSaved=!0):await this.save(),this}moveImmediatelySync(r,n){let i=this.getFilePath(),a=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getDirectoryPath());return this.move(r,n),i!==a?(this._context.fileSystemWrapper.moveFileImmediatelySync(i,a,this.getFullText()),this._isSaved=!0):this.saveSync(),this}delete(){this._throwIfIsInMemoryLibFile();let r=this.getFilePath();this.forget(),this._context.fileSystemWrapper.queueFileDelete(r)}async deleteImmediately(){this._throwIfIsInMemoryLibFile();let r=this.getFilePath();this.forget(),await this._context.fileSystemWrapper.deleteFileImmediately(r)}deleteImmediatelySync(){this._throwIfIsInMemoryLibFile();let r=this.getFilePath();this.forget(),this._context.fileSystemWrapper.deleteFileImmediatelySync(r)}async save(){this._isLibFileInMemory()||(await this._context.fileSystemWrapper.writeFile(this.getFilePath(),this._getTextForSave()),this._isSaved=!0)}saveSync(){this._isLibFileInMemory()||(this._context.fileSystemWrapper.writeFileSync(this.getFilePath(),this._getTextForSave()),this._isSaved=!0)}_getTextForSave(){let r=this.getFullText();return this._hasBom?"\uFEFF"+r:r}getPathReferenceDirectives(){return this._referencedFiles==null&&(this._referencedFiles=(this.compilerNode.referencedFiles||[]).map(r=>new OD(r,this))),this._referencedFiles}getTypeReferenceDirectives(){return this._typeReferenceDirectives==null&&(this._typeReferenceDirectives=(this.compilerNode.typeReferenceDirectives||[]).map(r=>new OD(r,this))),this._typeReferenceDirectives}getLibReferenceDirectives(){return this._libReferenceDirectives==null&&(this._libReferenceDirectives=(this.compilerNode.libReferenceDirectives||[]).map(r=>new OD(r,this))),this._libReferenceDirectives}getReferencingSourceFiles(){return Array.from(this._referenceContainer.getDependentSourceFiles())}getReferencingNodesInOtherSourceFiles(){let r=this.getReferencingLiteralsInOtherSourceFiles();return Array.from(n());function*n(){for(let i of r)yield mfe(i)}}getReferencingLiteralsInOtherSourceFiles(){return Array.from(this._referenceContainer.getReferencingLiteralsInOtherSourceFiles())}getReferencedSourceFiles(){let r=this._referenceContainer.getLiteralsReferencingOtherSourceFilesEntries();return Array.from(new Set(n()).values());function*n(){for(let[,i]of r)yield i}}getNodesReferencingOtherSourceFiles(){let r=this._referenceContainer.getLiteralsReferencingOtherSourceFilesEntries();return Array.from(n());function*n(){for(let[i]of r)yield mfe(i)}}getLiteralsReferencingOtherSourceFiles(){let r=this._referenceContainer.getLiteralsReferencingOtherSourceFilesEntries();return Array.from(n());function*n(){for(let[i]of r)yield i}}getImportStringLiterals(){return this._ensureBound(),(this.compilerNode.imports||[]).filter(n=>n.pos!==-1).map(n=>this._getNodeFromCompilerNode(n))}getLanguageVersion(){return this.compilerNode.languageVersion}getLanguageVariant(){return this.compilerNode.languageVariant}getScriptKind(){return this.compilerNode.scriptKind}isDeclarationFile(){return this.compilerNode.isDeclarationFile}isFromExternalLibrary(){return this._context.program._isCompilerProgramCreated()?this._context.program.compilerObject.isSourceFileFromExternalLibrary(this.compilerNode):!1}isInNodeModules(){return this.getFilePath().indexOf("/node_modules/")>=0}isSaved(){return this._isSaved&&!this._isLibFileInMemory()}_setIsSaved(r){this._isSaved=r}getPreEmitDiagnostics(){return this._context.getPreEmitDiagnostics(this)}unindent(r,n=1){return this.indent(r,n*-1)}indent(r,n=1){if(n===0)return this;let i=this.getFullText(),a=typeof r=="number"?[r,r]:r;b.errors.throwIfRangeOutOfRange(a,[0,i.length],"positionRange");let s=uv(i,a[0],f=>f===ac.NEWLINE),u=V6(i,a[1],f=>f===ac.CARRIAGE_RETURN||f===ac.NEWLINE),p=b.StringUtils.indent(i.substring(s,u),n,{indentText:this._context.manipulationSettings.getIndentationText(),indentSizeInSpaces:this._context.manipulationSettings._getIndentSizeInSpaces(),isInStringAtPos:f=>this.isInStringAtPos(f+s)});return Lj({sourceFile:this,newText:i.substring(0,s)+p+i.substring(u)}),this}emit(r){return this._context.program.emit({targetSourceFile:this,...r})}emitSync(r){return this._context.program.emitSync({targetSourceFile:this,...r})}getEmitOutput(r={}){return this._context.languageService.getEmitOutput(this,r.emitOnlyDtsFiles||!1)}formatText(r={}){Lj({sourceFile:this,newText:this._context.languageService.getFormattedDocumentText(this.getFilePath(),r)})}async refreshFromFileSystem(){let r=await this._context.fileSystemWrapper.readFileOrNotExists(this.getFilePath(),this._context.getEncoding());return this._refreshFromFileSystemInternal(r)}refreshFromFileSystemSync(){let r=this._context.fileSystemWrapper.readFileOrNotExistsSync(this.getFilePath(),this._context.getEncoding());return this._refreshFromFileSystemInternal(r)}getRelativePathTo(r){return this.getDirectory().getRelativePathTo(r)}getRelativePathAsModuleSpecifierTo(r){return this.getDirectory().getRelativePathAsModuleSpecifierTo(r)}onModified(r,n=!0){return n?this._modifiedEventContainer.subscribe(r):this._modifiedEventContainer.unsubscribe(r),this}_doActionPreNextModification(r){let n=()=>{r(),this._preModifiedEventContainer.unsubscribe(n)};return this._preModifiedEventContainer.subscribe(n),this}_firePreModified(){this._preModifiedEventContainer.fire(this)}organizeImports(r={},n={}){return this._context.languageService.organizeImports(this,r,n).forEach(i=>i.applyChanges()),this}fixUnusedIdentifiers(r={},n={}){return this._context.languageService.getCombinedCodeFix(this,"unusedIdentifier_delete",r,n).applyChanges(),this._context.languageService.getCombinedCodeFix(this,"unusedIdentifier_deleteImports",r,n).applyChanges(),this}fixMissingImports(r={},n={}){let i=this._context.languageService.getCombinedCodeFix(this,"fixMissingImport",r,n),a=this;for(let p of i.getChanges()){let f=p.getTextChanges();s(f),u(f)}return this;function s(p){p.sort((f,m)=>f.getSpan().getStart()-m.getSpan().getStart());for(let f=0;f<p.length-1;f++){let{compilerObject:m}=p[f];m.newText=m.newText.replace(/(\r?)\n\r?\n$/,`$1
4250
4250
  `)}}function u(p){let f=b.ArrayUtils.groupBy(p,g=>g.getSpan().getStart()),m=0;for(let g of f){let D=g[0].getSpan().getStart()+m,P=g.map(B=>B.getNewText()).join("");c7e({sourceFile:a,insertPos:D,newText:P}),m+=P.length}}}applyTextChanges(r){return r.length===0?this:(this.forgetDescendants(),mS({sourceFile:this._sourceFile,start:0,replacingLength:this.getFullWidth(),newText:jH(this,r)}),this)}set(r){return io(fR.prototype,this,r),this}getStructure(){return uo(fR.prototype,this,{kind:Oe.StructureKind.SourceFile})}_refreshFromFileSystemInternal(r){if(r===!1)return this.forget(),Oe.FileSystemRefreshResult.Deleted;let n=r;return n===this.getFullText()?Oe.FileSystemRefreshResult.NoChange:(this.replaceText([0,this.getEnd()],n),this._setIsSaved(!0),Oe.FileSystemRefreshResult.Updated)}_isLibFileInMemory(){return this.compilerNode.fileName.startsWith(b.libFolderInMemoryPath)}_throwIfIsInMemoryLibFile(){if(this._isLibFileInMemory())throw new b.errors.InvalidOperationError("This operation is not permitted on an in memory lib folder file.")}_isInProject(){return this._context.inProjectCoordinator.isSourceFileInProject(this)}_markAsInProject(){this._context.inProjectCoordinator.markSourceFileAsInProject(this)}};co([b.Memoize],kE.prototype,"isFromExternalLibrary",null);function aj(e){for(let[r,n]of e)RE.isModuleSpecifierRelative(r.getLiteralText())&&r.setLiteralValue(r._sourceFile.getRelativePathAsModuleSpecifierTo(n))}function mfe(e){let r=e.getParentOrThrow(),n=r.getParent();return n!=null&&Tr.isImportEqualsDeclaration(n)?n:r}var I9e=e=>yS(sc(Ph(BE(sf(e))))),pR=I9e(Cl),gw=class extends pR{getDeclarationList(){return this._getNodeFromCompilerNode(this.compilerNode.declarationList)}getDeclarations(){return this.getDeclarationList().getDeclarations()}getDeclarationKind(){return this.getDeclarationList().getDeclarationKind()}getDeclarationKindKeyword(){return this.getDeclarationList().getDeclarationKindKeyword()}setDeclarationKind(r){return this.getDeclarationList().setDeclarationKind(r)}addDeclaration(r){return this.getDeclarationList().addDeclaration(r)}addDeclarations(r){return this.getDeclarationList().addDeclarations(r)}insertDeclaration(r,n){return this.getDeclarationList().insertDeclaration(r,n)}insertDeclarations(r,n){return this.getDeclarationList().insertDeclarations(r,n)}set(r){if(io(pR.prototype,this,r),r.declarationKind!=null&&this.setDeclarationKind(r.declarationKind),r.declarations!=null){let n=this.getDeclarations();this.addDeclarations(r.declarations),n.forEach(i=>i.remove())}return this}getStructure(){return uo(pR.prototype,this,{kind:Oe.StructureKind.VariableStatement,declarationKind:this.getDeclarationKind(),declarations:this.getDeclarations().map(r=>r.getStructure())})}},hme=ud(dS),yw=class extends hme{},Eme=ud(Cl),vw=class extends Eme{getStatement(){return this._getNodeFromCompilerNode(this.compilerNode.statement)}};function YT(e){return sc(J_(_v(Mh(sf(e)))))}var P9e=e=>ld(H6(jT(YT(e)))),bme=P9e(oc),hw=class extends bme{getEqualsGreaterThan(){return this._getNodeFromCompilerNode(this.compilerNode.equalsGreaterThanToken)}};function eG(e){return class extends e{getOverloads(){return _fe(this).filter(r=>r.isOverload())}getImplementation(){return this.isImplementation()?this:_fe(this).find(r=>r.isImplementation())}getImplementationOrThrow(){return b.errors.throwIfNullOrUndefined(this.getImplementation(),"Expected to find a corresponding implementation for the overload.")}isOverload(){return!this.isImplementation()}isImplementation(){return this.getBody()!=null}}}function _fe(e){let r=e.getParentOrThrow(),n=gfe(e),i=e.getKind();return r.forEachChildAsArray().filter(a=>{let s=gfe(a)===n,u=a.getKind()===i;return s&&u})}function gfe(e){let r=e;if(r.getName instanceof Function)return r.getName()}function rG(e){if(e.structures.length===0)return[];let r=e.node.getParentSyntaxListOrThrow(),n=e.node.getImplementation()||e.node,i=e.node.getOverloads(),a=i.length,s=i.length>0?i[0].getChildIndex():n.getChildIndex(),u=ku(e.index,a),p=s+u,f=e.getThisStructure(n),m=e.structures.map(D=>Object.assign(Object.assign({},f),D)),g=n._getWriterWithQueuedIndentation();for(let D of m)g.getLength()>0&&g.newLine(),e.printStructure(g,D);return g.newLine(),g.write(""),qa({parent:r,insertPos:(i[u]||n).getNonWhitespaceStart(),newText:g.toString()}),Vfe(r.getChildren(),p,m.length,e.expectedSyntaxKind)}var O9e=e=>Z6(ld(eG(HT(jT(zT(Ph(BE(YT(yS(X6(e))))))))))),mR=O9e(Cl),k9e=e=>Z6(ld(jT(zT(_v(Ph(yS(sc(J_(BE(sf(e))))))))))),Sme=k9e(Cl),Ew=class extends mR{addOverload(r){return this.addOverloads([r])[0]}addOverloads(r){return this.insertOverloads(this.getOverloads().length,r)}insertOverload(r,n){return this.insertOverloads(r,[n])[0]}insertOverloads(r,n){let i=this.getName(),a=this._context.structurePrinterFactory.forFunctionDeclaration({isAmbient:this.isAmbient()});return rG({node:this,index:r,structures:n,printStructure:(s,u)=>{a.printOverload(s,i,u)},getThisStructure:t7e,expectedSyntaxKind:b.SyntaxKind.FunctionDeclaration})}remove(){g7e(this)}set(r){return io(mR.prototype,this,r),r.overloads!=null&&(this.getOverloads().forEach(n=>n.remove()),this.addOverloads(r.overloads)),this}getStructure(){let r=this.isOverload(),n=this.getImplementation(),i=r&&n?Sme.prototype:mR.prototype;return uo(i,this,a(this));function a(s){if(n&&r)return u();return p();function u(){return{kind:Oe.StructureKind.FunctionOverload}}function p(){return n?{kind:Oe.StructureKind.Function,overloads:s.getOverloads().map(f=>f.getStructure())}:{kind:Oe.StructureKind.Function}}}}},R9e=e=>sc(ld(H6(jT(zT(Mh(J_(_v(sf(X6(e)))))))))),Tme=R9e(sd),bw=class extends Tme{},M9e=e=>TL(Rh(qT(upe(xL(sf(bL(KE($T($6(e)))))))))),_R=M9e(Tr),Sw=class extends _R{isRestParameter(){return this.compilerNode.dotDotDotToken!=null}isParameterProperty(){return this.getScope()!=null||this.isReadonly()||this.hasOverrideKeyword()}setIsRestParameter(r){return this.isRestParameter()===r?this:(r?(nR(this),qa({insertPos:this.getNameNode().getStart(),parent:this,newText:"..."})):Bs({children:[this.getDotDotDotTokenOrThrow()]}),this)}isOptional(){return this.compilerNode.questionToken!=null||this.isRestParameter()||this.hasInitializer()}remove(){fv(this)}set(r){return io(_R.prototype,this,r),r.isRestParameter!=null&&this.setIsRestParameter(r.isRestParameter),this}getStructure(){return uo(_R.prototype,this,{kind:Oe.StructureKind.Parameter,isRestParameter:this.isRestParameter()})}setHasQuestionToken(r){return r&&nR(this),super.setHasQuestionToken(r),this}setInitializer(r){return nR(this),super.setInitializer(r),this}setType(r){return nR(this),super.setType.call(this,r),this}};function nR(e){let r=e.getParentOrThrow();n()&&i();function n(){return Tr.isArrowFunction(r)&&r.compilerNode.parameters.length===1&&e.getParentSyntaxListOrThrow().getPreviousSiblingIfKind(b.SyntaxKind.OpenParenToken)==null}function i(){let a=e.getText();qa({parent:r,insertPos:e.getStart(),newText:`(${a})`,replacing:{textLength:a.length},customMappings:s=>[{currentNode:e,newNode:s.parameters[0]}]})}}var zg=class extends Tr{remove(){let r=this.getParentOrThrow();Tr.isClassDeclaration(r)||Tr.isClassExpression(r)?p7e(this):Tr.isObjectLiteralExpression(r)?fv(this):b.errors.throwNotImplementedForSyntaxKindError(r.getKind())}},w9e=e=>Nm(ld(TL(eG(HT(qT(gS(_S(Rh(WD(jT(zT(YT(UE(e)))))))))))))),gR=w9e(zg),F9e=e=>sc(Nm(ld(TL(_S(J_(gS(Rh(WD(jT(sf(zT(_v(e))))))))))))),xme=F9e(zg),MD=class extends gR{set(r){return io(gR.prototype,this,r),r.overloads!=null&&(this.getOverloads().forEach(n=>n.remove()),this.addOverloads(r.overloads)),this}addOverload(r){return this.addOverloads([r])[0]}addOverloads(r){return this.insertOverloads(this.getOverloads().length,r)}insertOverload(r,n){return this.insertOverloads(r,[n])[0]}insertOverloads(r,n){let i=this.getName(),a=this._context.structurePrinterFactory.forMethodDeclaration({isAmbient:d_(this)});return rG({node:this,index:r,structures:n,printStructure:(s,u)=>{a.printOverload(s,i,u)},getThisStructure:n7e,expectedSyntaxKind:b.SyntaxKind.MethodDeclaration})}getStructure(){let r=this.getImplementation()!=null,n=this.isOverload(),i=n&&r?xme.prototype:gR.prototype;return uo(i,this,a(this));function a(s){if(r&&n)return u();return p();function u(){return{kind:Oe.StructureKind.MethodOverload}}function p(){return r?{kind:Oe.StructureKind.Method,overloads:s.getOverloads().map(f=>f.getStructure())}:{kind:Oe.StructureKind.Method}}}}};function iq(e){return Dme(X6(ld(ape(QH(gS(sc(J_(qT(sf(e))))))))))}function Dme(e){return class extends e{setExtends(r){if(r=this._getTextWithQueuedChildIndentation(r),b.StringUtils.isNullOrWhitespace(r))return this.removeExtends();let n=this.getHeritageClauseByKind(b.SyntaxKind.ExtendsKeyword);if(n!=null){let i=n.getFirstChildByKindOrThrow(b.SyntaxKind.SyntaxList),a=i.getStart();qa({parent:n,newText:r,insertPos:a,replacing:{textLength:i.getEnd()-a}})}else{let i=this.getHeritageClauseByKind(b.SyntaxKind.ImplementsKeyword),a;i!=null?a=i.getStart():a=this.getFirstChildByKindOrThrow(b.SyntaxKind.OpenBraceToken).getStart();let s=/\s/.test(this.getSourceFile().getFullText()[a-1]),u=`extends ${r} `;s||(u=" "+u),qa({parent:i==null?this:i.getParentSyntaxListOrThrow(),insertPos:a,newText:u})}return this}removeExtends(){let r=this.getHeritageClauseByKind(b.SyntaxKind.ExtendsKeyword);return r==null?this:(r.removeExpression(0),this)}getExtendsOrThrow(){return b.errors.throwIfNullOrUndefined(this.getExtends(),`Expected to find the extends expression for the class ${this.getName()}.`)}getExtends(){let r=this.getHeritageClauseByKind(b.SyntaxKind.ExtendsKeyword);if(r==null)return;let n=r.getTypeNodes();return n.length===0?void 0:n[0]}addMembers(r){return this.insertMembers(ad(this.getMembersWithComments()),r)}addMember(r){return this.insertMember(ad(this.getMembersWithComments()),r)}insertMember(r,n){return this.insertMembers(r,[n])[0]}insertMembers(r,n){let i=d_(this);return qfe({getIndexedChildren:()=>this.getMembersWithComments(),index:r,parent:this,write:(s,u)=>{let p=!i&&u.previousMember!=null&&Tr.isBodyable(u.previousMember)&&u.previousMember.hasBody(),f=!i&&n instanceof Array&&a(n[0]);p||u.previousMember!=null&&f?s.blankLineIfLastNot():s.newLineIfLastNot();let m=this._getWriter();this._context.structurePrinterFactory.forClassMember({isAmbient:i}).printTexts(m,n),s.write(m.toString());let D=!i&&n instanceof Array&&a(n[n.length-1]),P=!i&&u.nextMember!=null&&Tr.isBodyable(u.nextMember)&&u.nextMember.hasBody();u.nextMember!=null&&D||P?s.blankLineIfLastNot():s.newLineIfLastNot()}});function a(s){if(i||s==null||typeof s.kind!="number")return!1;let u=s;return rL.isMethod(u)||rL.isGetAccessor(u)||rL.isSetAccessor(u)||rL.isConstructor(u)}}addConstructor(r={}){return this.insertConstructor(ad(this.getMembersWithComments()),r)}addConstructors(r){return this.insertConstructors(ad(this.getMembersWithComments()),r)}insertConstructor(r,n={}){return this.insertConstructors(r,[n])[0]}insertConstructors(r,n){let i=d_(this);return ND(this,{index:r,structures:n,expectedKind:b.SyntaxKind.Constructor,write:(a,s)=>{!i&&s.previousMember!=null&&!Tr.isCommentNode(s.previousMember)?a.blankLineIfLastNot():a.newLineIfLastNot(),this._context.structurePrinterFactory.forConstructorDeclaration({isAmbient:i}).printTexts(a,n),!i&&s.nextMember!=null?a.blankLineIfLastNot():a.newLineIfLastNot()}})}getConstructors(){return this.getMembers().filter(r=>Tr.isConstructorDeclaration(r))}addStaticBlock(r={}){return this.insertStaticBlock(ad(this.getMembersWithComments()),r)}addStaticBlocks(r){return this.insertStaticBlocks(ad(this.getMembersWithComments()),r)}insertStaticBlock(r,n={}){return this.insertStaticBlocks(r,[n])[0]}insertStaticBlocks(r,n){let i=d_(this);return ND(this,{index:r,structures:n,expectedKind:b.SyntaxKind.ClassStaticBlockDeclaration,write:(a,s)=>{!i&&s.previousMember!=null&&!Tr.isCommentNode(s.previousMember)?a.blankLineIfLastNot():a.newLineIfLastNot(),this._context.structurePrinterFactory.forClassStaticBlockDeclaration().printTexts(a,n),!i&&s.nextMember!=null?a.blankLineIfLastNot():a.newLineIfLastNot()}})}getStaticBlocks(){return this.getMembers().filter(r=>Tr.isClassStaticBlockDeclaration(r))}addGetAccessor(r){return this.addGetAccessors([r])[0]}addGetAccessors(r){return this.insertGetAccessors(ad(this.getMembersWithComments()),r)}insertGetAccessor(r,n){return this.insertGetAccessors(r,[n])[0]}insertGetAccessors(r,n){return ND(this,{index:r,structures:n,expectedKind:b.SyntaxKind.GetAccessor,write:(i,a)=>{a.previousMember!=null&&!Tr.isCommentNode(a.previousMember)?i.blankLineIfLastNot():i.newLineIfLastNot(),this._context.structurePrinterFactory.forGetAccessorDeclaration({isAmbient:d_(this)}).printTexts(i,n),a.nextMember!=null?i.blankLineIfLastNot():i.newLineIfLastNot()}})}addSetAccessor(r){return this.addSetAccessors([r])[0]}addSetAccessors(r){return this.insertSetAccessors(ad(this.getMembersWithComments()),r)}insertSetAccessor(r,n){return this.insertSetAccessors(r,[n])[0]}insertSetAccessors(r,n){return ND(this,{index:r,structures:n,expectedKind:b.SyntaxKind.SetAccessor,write:(i,a)=>{a.previousMember!=null&&!Tr.isCommentNode(a.previousMember)?i.blankLineIfLastNot():i.newLineIfLastNot(),this._context.structurePrinterFactory.forSetAccessorDeclaration({isAmbient:d_(this)}).printTexts(i,n),a.nextMember!=null?i.blankLineIfLastNot():i.newLineIfLastNot()}})}addProperty(r){return this.addProperties([r])[0]}addProperties(r){return this.insertProperties(ad(this.getMembersWithComments()),r)}insertProperty(r,n){return this.insertProperties(r,[n])[0]}insertProperties(r,n){return ND(this,{index:r,structures:n,expectedKind:b.SyntaxKind.PropertyDeclaration,write:(i,a)=>{a.previousMember!=null&&Tr.hasBody(a.previousMember)?i.blankLineIfLastNot():i.newLineIfLastNot(),this._context.structurePrinterFactory.forPropertyDeclaration().printTexts(i,n),a.nextMember!=null&&Tr.hasBody(a.nextMember)?i.blankLineIfLastNot():i.newLineIfLastNot()}})}addMethod(r){return this.addMethods([r])[0]}addMethods(r){return this.insertMethods(ad(this.getMembersWithComments()),r)}insertMethod(r,n){return this.insertMethods(r,[n])[0]}insertMethods(r,n){let i=d_(this);return n=n.map(a=>({...a})),ND(this,{index:r,write:(a,s)=>{!i&&s.previousMember!=null&&!Tr.isCommentNode(s.previousMember)?a.blankLineIfLastNot():a.newLineIfLastNot(),this._context.structurePrinterFactory.forMethodDeclaration({isAmbient:i}).printTexts(a,n),!i&&s.nextMember!=null?a.blankLineIfLastNot():a.newLineIfLastNot()},structures:n,expectedKind:b.SyntaxKind.MethodDeclaration})}getInstanceProperty(r){return ic(this.getInstanceProperties(),r)}getInstancePropertyOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getInstanceProperty(r),()=>Ou("class instance property",r))}getInstanceProperties(){return this.getInstanceMembers().filter(r=>hfe(r))}getStaticProperty(r){return ic(this.getStaticProperties(),r)}getStaticPropertyOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getStaticProperty(r),()=>Ou("class static property",r))}getStaticProperties(){return this.getStaticMembers().filter(r=>hfe(r))}getProperty(r){return ic(this.getProperties(),r)}getPropertyOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getProperty(r),()=>Ou("class property declaration",r))}getProperties(){return this.getMembers().filter(r=>Tr.isPropertyDeclaration(r))}getGetAccessor(r){return ic(this.getGetAccessors(),r)}getGetAccessorOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getGetAccessor(r),()=>Ou("class getAccessor declaration",r))}getGetAccessors(){return this.getMembers().filter(r=>Tr.isGetAccessorDeclaration(r))}getSetAccessor(r){return ic(this.getSetAccessors(),r)}getSetAccessorOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getSetAccessor(r),()=>Ou("class setAccessor declaration",r))}getSetAccessors(){return this.getMembers().filter(r=>Tr.isSetAccessorDeclaration(r))}getMethod(r){return ic(this.getMethods(),r)}getMethodOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getMethod(r),()=>Ou("class method declaration",r))}getMethods(){return this.getMembers().filter(r=>Tr.isMethodDeclaration(r))}getInstanceMethod(r){return ic(this.getInstanceMethods(),r)}getInstanceMethodOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getInstanceMethod(r),()=>Ou("class instance method",r))}getInstanceMethods(){return this.getInstanceMembers().filter(r=>r instanceof MD)}getStaticMethod(r){return ic(this.getStaticMethods(),r)}getStaticMethodOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getStaticMethod(r),()=>Ou("class static method",r))}getStaticMethods(){return this.getStaticMembers().filter(r=>r instanceof MD)}getInstanceMember(r){return ic(this.getInstanceMembers(),r)}getInstanceMemberOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getInstanceMember(r),()=>Ou("class instance member",r))}getInstanceMembers(){return this.getMembersWithParameterProperties().filter(r=>Tr.isConstructorDeclaration(r)?!1:Tr.isParameterDeclaration(r)||!r.isStatic())}getStaticMember(r){return ic(this.getStaticMembers(),r)}getStaticMemberOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getStaticMember(r),()=>Ou("class static member",r))}getStaticMembers(){return this.getMembers().filter(r=>Tr.isConstructorDeclaration(r)?!1:!Tr.isParameterDeclaration(r)&&r.isStatic())}getMembersWithParameterProperties(){let r=this.getMembers(),n=r.filter(i=>Tr.isConstructorDeclaration(i)&&i.isImplementation());for(let i of n){let a=r.indexOf(i)+1;for(let s of i.getParameters())s.isParameterProperty()&&(r.splice(a,0,s),a++)}return r}getMembers(){return yfe(this,this.compilerNode.members).filter(r=>Efe(r))}getMembersWithComments(){let r=this.compilerNode,n=od.getContainerArray(r,this.getSourceFile().compilerNode);return yfe(this,n).filter(i=>Efe(i)||Tr.isCommentClassElement(i))}getMember(r){return ic(this.getMembers(),r)}getMemberOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getMember(r),()=>Ou("class member",r))}getBaseTypes(){return this.getType().getBaseTypes()}getBaseClassOrThrow(){return b.errors.throwIfNullOrUndefined(this.getBaseClass(),`Expected to find the base class of ${this.getName()}.`)}getBaseClass(){let n=b.ArrayUtils.flatten(this.getBaseTypes().map(i=>i.isIntersection()?i.getIntersectionTypes():[i])).map(i=>i.getSymbol()).filter(i=>i!=null).map(i=>i.getDeclarations()).reduce((i,a)=>i.concat(a),[]).filter(i=>i.getKind()===b.SyntaxKind.ClassDeclaration);if(n.length===1)return n[0]}getDerivedClasses(){let r=vfe(this);for(let n=0;n<r.length;n++){let i=vfe(r[n]);for(let a of i)a!==this&&r.indexOf(a)===-1&&r.push(a)}return r}}}function yfe(e,r){let n=d_(e),i=r.map(a=>e._getNodeFromCompilerNode(a));return n?i:i.filter(a=>!(Tr.isConstructorDeclaration(a)||Tr.isMethodDeclaration(a))||Tr.isMethodDeclaration(a)&&a.isAbstract()?!0:a.isImplementation())}function vfe(e){let r=[],n=e.getNameNode();if(n==null)return r;for(let i of n.findReferencesAsNodes()){let a=i.getParentIfKind(b.SyntaxKind.ExpressionWithTypeArguments);if(a==null)continue;let s=a.getParentIfKind(b.SyntaxKind.HeritageClause);if(s==null||s.getToken()!==b.SyntaxKind.ExtendsKeyword)continue;let u=s.getParentIfKind(b.SyntaxKind.ClassDeclaration);u!=null&&r.push(u)}return r}function hfe(e){return Tr.isPropertyDeclaration(e)||Tr.isSetAccessorDeclaration(e)||Tr.isGetAccessorDeclaration(e)||Tr.isParameterDeclaration(e)}function Efe(e){return Tr.isMethodDeclaration(e)||Tr.isPropertyDeclaration(e)||Tr.isGetAccessorDeclaration(e)||Tr.isSetAccessorDeclaration(e)||Tr.isConstructorDeclaration(e)||Tr.isClassStaticBlockDeclaration(e)}function ND(e,r){return qH({getIndexedChildren:()=>e.getMembersWithComments(),parent:e,...r})}var G9e=e=>yS(Ph(BE(iq(e)))),yR=G9e(Cl),Tw=class extends yR{set(r){return io(yR.prototype,this,r),r.extends!=null?this.setExtends(r.extends):r.hasOwnProperty(b.nameof(r,"extends"))&&this.removeExtends(),r.ctors!=null&&(this.getConstructors().forEach(n=>n.remove()),this.addConstructors(r.ctors)),r.properties!=null&&(this.getProperties().forEach(n=>n.remove()),this.addProperties(r.properties)),r.getAccessors!=null&&(this.getGetAccessors().forEach(n=>n.remove()),this.addGetAccessors(r.getAccessors)),r.setAccessors!=null&&(this.getSetAccessors().forEach(n=>n.remove()),this.addSetAccessors(r.setAccessors)),r.methods!=null&&(this.getMethods().forEach(n=>n.remove()),this.addMethods(r.methods)),this}getStructure(){let r=this.getExtends(),n=this.isAmbient();return uo(yR.prototype,this,{kind:Oe.StructureKind.Class,ctors:this.getConstructors().filter(i=>n||!i.isOverload()).map(i=>i.getStructure()),methods:this.getMethods().filter(i=>n||!i.isOverload()).map(i=>i.getStructure()),properties:this.getProperties().map(i=>i.getStructure()),extends:r?r.getText():void 0,getAccessors:this.getGetAccessors().map(i=>i.getStructure()),setAccessors:this.getSetAccessors().map(i=>i.getStructure())})}extractInterface(r){let{constructors:n,properties:i,methods:a,accessors:s}=bfe(this,!1),u=b.ArrayUtils.flatten(n.map(p=>p.getParameters().filter(f=>f.isParameterProperty()))).filter(p=>p.getName()!=null&&p.getScope()===Oe.Scope.Public);return{kind:Oe.StructureKind.Interface,name:Sfe(r,this),docs:this.getJsDocs().map(p=>p.getStructure()),typeParameters:this.getTypeParameters().map(p=>p.getStructure()),properties:[...u.map(p=>{let f=b.ArrayUtils.flatten(p.getParentOrThrow().getJsDocs().map(m=>m.getTags())).filter(Tr.isJSDocParameterTag).filter(m=>m.getTagName()==="param"&&m.getName()===p.getName()&&m.getComment()!=null).map(m=>m.getCommentText().trim())[0];return{kind:Oe.StructureKind.PropertySignature,docs:f==null?[]:[{kind:Oe.StructureKind.JSDoc,description:f}],name:p.getName(),type:p.getType().getText(p),hasQuestionToken:p.hasQuestionToken(),isReadonly:p.isReadonly()}}),...i.map(Tfe),...s.map(xfe)],methods:a.map(Dfe)}}extractStaticInterface(r){let{constructors:n,properties:i,methods:a,accessors:s}=bfe(this,!0),u=Sfe(void 0,this);return{kind:Oe.StructureKind.Interface,name:r,properties:[...i.map(Tfe),...s.map(xfe)],methods:a.map(Dfe),constructSignatures:n.map(p=>({kind:Oe.StructureKind.ConstructSignature,docs:p.getJsDocs().map(f=>f.getStructure()),parameters:p.getParameters().map(f=>({...Cme(f),scope:void 0,isReadonly:!1})),returnType:u}))}}};function bfe(e,r){let n=b.ArrayUtils.flatten(e.getConstructors().map(u=>u.getOverloads().length>0?u.getOverloads():[u])),i=e.getProperties().filter(u=>u.isStatic()===r&&u.getScope()===Oe.Scope.Public),a=b.ArrayUtils.flatten(e.getMethods().filter(u=>u.isStatic()===r&&u.getScope()===Oe.Scope.Public).map(u=>u.getOverloads().length>0?u.getOverloads():[u]));return{constructors:n,properties:i,methods:a,accessors:s()};function s(){let u=new b.KeyValueCache;for(let p of[...e.getGetAccessors(),...e.getSetAccessors()])p.isStatic()===r&&p.getScope()===Oe.Scope.Public&&u.getOrCreate(p.getName(),()=>[]).push(p);return u.getValuesAsArray()}}function Sfe(e,r){return e=b.StringUtils.isNullOrWhitespace(e)?void 0:e,e||r.getName()||r.getSourceFile().getBaseNameWithoutExtension().replace(/[^a-zA-Z0-9_$]/g,"")}function Tfe(e){return{kind:Oe.StructureKind.PropertySignature,docs:e.getJsDocs().map(r=>r.getStructure()),name:e.getName(),type:e.getType().getText(e),hasQuestionToken:e.hasQuestionToken(),isReadonly:e.isReadonly()}}function xfe(e){return{kind:Oe.StructureKind.PropertySignature,docs:e[0].getJsDocs().map(r=>r.getStructure()),name:e[0].getName(),type:e[0].getType().getText(e[0]),hasQuestionToken:!1,isReadonly:e.every(Tr.isGetAccessorDeclaration)}}function Dfe(e){return{kind:Oe.StructureKind.MethodSignature,docs:e.getJsDocs().map(r=>r.getStructure()),name:e.getName(),hasQuestionToken:e.hasQuestionToken(),returnType:e.getReturnType().getText(e),parameters:e.getParameters().map(Cme),typeParameters:e.getTypeParameters().map(r=>r.getStructure())}}function Cme(e){return{...e.getStructure(),decorators:[]}}var Ame=iq(sd),xw=class extends Ame{},B9e=e=>Nm(ld(Mh(sc(H6(e))))),vR=B9e(zg),Dw=class extends vR{getName(){return"static"}isStatic(){return!0}set(r){return io(vR.prototype,this,r),this}getStructure(){return uo(vR.prototype,this,{kind:Oe.StructureKind.ClassStaticBlock})}},Cw=class extends zg{},U9e=e=>kh(Nm(ld(eG(_S(YT(HT(e))))))),hR=U9e(zg),K9e=e=>J_(sc(Nm(ld(_S(sf(_v(e))))))),Lme=K9e(zg),Aw=class extends hR{set(r){return io(hR.prototype,this,r),r.overloads!=null&&(this.getOverloads().forEach(n=>n.remove()),this.addOverloads(r.overloads)),this}addOverload(r){return this.addOverloads([r])[0]}addOverloads(r){return this.insertOverloads(this.getOverloads().length,r)}insertOverload(r,n){return this.insertOverloads(r,[n])[0]}insertOverloads(r,n){let i=this._context.structurePrinterFactory.forConstructorDeclaration({isAmbient:d_(this)});return rG({node:this,index:r,structures:n,printStructure:(a,s)=>{i.printOverload(a,s)},getThisStructure:r7e,expectedSyntaxKind:b.SyntaxKind.Constructor})}getStructure(){let r=this.getImplementation()!=null,n=this.isOverload(),i=n&&r?Lme.prototype:hR.prototype;return uo(i,this,a(this));function a(s){if(r&&n)return u();return p();function u(){return{kind:Oe.StructureKind.ConstructorOverload}}function p(){return r?{kind:Oe.StructureKind.Constructor,overloads:s.getOverloads().map(f=>f.getStructure())}:{kind:Oe.StructureKind.Constructor}}}}},W9e=e=>Nm(ld(qT(gS(_S(WD(YT(HT(UE(e))))))))),ER=W9e(zg),Lw=class extends ER{set(r){return io(ER.prototype,this,r),this}getSetAccessor(){let r=this.getName(),n=this.isStatic();return this.getParentOrThrow().forEachChild(i=>{if(Tr.isSetAccessorDeclaration(i)&&i.getName()===r&&i.isStatic()===n)return i})}getSetAccessorOrThrow(){return b.errors.throwIfNullOrUndefined(this.getSetAccessor(),()=>`Expected to find a corresponding set accessor for ${this.getName()}.`)}getStructure(){return uo(ER.prototype,this,{kind:Oe.StructureKind.GetAccessor})}},V9e=e=>Nm(TL(Ph(qT(gS(_S(WD(sc(xL($H(Rh($T(KE(UE(sf(e))))))))))))))),bR=V9e(zg),Nw=class extends bR{set(r){return io(bR.prototype,this,r),this}remove(){let r=this.getParentOrThrow();switch(r.getKind()){case b.SyntaxKind.ClassDeclaration:super.remove();break;default:throw new b.errors.NotImplementedError(`Not implemented parent syntax kind: ${r.getKindName()}`)}}getStructure(){return uo(bR.prototype,this,{kind:Oe.StructureKind.Property})}},j9e=e=>Nm(ld(qT(gS(_S(WD(YT(HT(UE(e))))))))),SR=j9e(zg),Iw=class extends SR{set(r){return io(SR.prototype,this,r),this}getGetAccessor(){let r=this.getName(),n=this.isStatic();return this.getParentOrThrow().forEachChild(i=>{if(Tr.isGetAccessorDeclaration(i)&&i.getName()===r&&i.isStatic()===n)return i})}getGetAccessorOrThrow(){return b.errors.throwIfNullOrUndefined(this.getGetAccessor(),()=>`Expected to find a corresponding get accessor for ${this.getName()}.`)}getStructure(){return uo(SR.prototype,this,{kind:Oe.StructureKind.SetAccessor})}},TR=XT(Tr),Pw=class extends TR{getName(){return this.getNameNode().getText()}getNameNode(){let r=this.getCallExpression();if(r)return n(r.getExpression());return n(this._getInnerExpression());function n(a){let s=i(a);if(!Tr.isIdentifier(s))throw new b.errors.NotImplementedError(`Expected the decorator expression '${s.getText()}' to be an identifier. Please deal directly with 'getExpression()' on the decorator to handle more complex scenarios.`);return s}function i(a){return Tr.isPropertyAccessExpression(a)?a.getNameNode():a}}getFullName(){let r=this.getSourceFile();return this.isDecoratorFactory()?this.getCallExpression().getExpression().getText():this.compilerNode.expression.getText(r.compilerNode)}isDecoratorFactory(){return Tr.isCallExpression(this._getInnerExpression())}setIsDecoratorFactory(r){if(this.isDecoratorFactory()===r)return this;if(r){let n=this._getInnerExpression(),i=n.getText();qa({parent:this,insertPos:n.getStart(),newText:`${i}()`,replacing:{textLength:i.length},customMappings:a=>[{currentNode:n,newNode:a.expression.expression}]})}else{let n=this.getCallExpressionOrThrow(),i=n.getExpression(),a=i.getText();qa({parent:this,insertPos:n.getStart(),newText:`${a}`,replacing:{textLength:n.getWidth()},customMappings:s=>[{currentNode:i,newNode:s.expression}]})}return this}getCallExpressionOrThrow(){return b.errors.throwIfNullOrUndefined(this.getCallExpression(),"Expected to find a call expression.")}getCallExpression(){let r=this._getInnerExpression();return Tr.isCallExpression(r)?r:void 0}getArguments(){var r,n;return(n=(r=this.getCallExpression())===null||r===void 0?void 0:r.getArguments())!==null&&n!==void 0?n:[]}getTypeArguments(){var r,n;return(n=(r=this.getCallExpression())===null||r===void 0?void 0:r.getTypeArguments())!==null&&n!==void 0?n:[]}addTypeArgument(r){return this.getCallExpressionOrThrow().addTypeArgument(r)}addTypeArguments(r){return this.getCallExpressionOrThrow().addTypeArguments(r)}insertTypeArgument(r,n){return this.getCallExpressionOrThrow().insertTypeArgument(r,n)}insertTypeArguments(r,n){return this.getCallExpressionOrThrow().insertTypeArguments(r,n)}removeTypeArgument(r){let n=this.getCallExpression();if(n==null)throw new b.errors.InvalidOperationError("Cannot remove a type argument from a decorator that has no type arguments.");return n.removeTypeArgument(r),this}addArgument(r){return this.addArguments([r])[0]}addArguments(r){return this.insertArguments(this.getArguments().length,r)}insertArgument(r,n){return this.insertArguments(r,[n])[0]}insertArguments(r,n){return this.setIsDecoratorFactory(!0),this.getCallExpressionOrThrow().insertArguments(r,n)}removeArgument(r){let n=this.getCallExpression();if(n==null)throw new b.errors.InvalidOperationError("Cannot remove an argument from a decorator that has no arguments.");return n.removeArgument(r),this}remove(){let r=this.getStartLinePos(),n=this.getPreviousSiblingIfKind(b.SyntaxKind.Decorator);n!=null&&n.getStartLinePos()===r?Bs({children:[this],removePrecedingSpaces:!0}):f7e({children:[this],getSiblingFormatting:(i,a)=>a.getStartLinePos()===r?El.Space:El.Newline})}_getInnerExpression(){let r=this.getExpression();for(;Tr.isParenthesizedExpression(r);)r=r.getExpression();return r}set(r){return io(TR.prototype,this,r),r.name!=null&&this.getNameNode().replaceWithText(r.name),r.arguments!=null&&(this.setIsDecoratorFactory(!0),this.getArguments().map(n=>this.removeArgument(n)),this.addArguments(r.arguments)),r.typeArguments!=null&&r.typeArguments.length>0&&(this.setIsDecoratorFactory(!0),this.getTypeArguments().map(n=>this.removeTypeArgument(n)),this.addTypeArguments(r.typeArguments)),this}getStructure(){let r=this.isDecoratorFactory();return uo(TR.prototype,this,{kind:Oe.StructureKind.Decorator,name:this.getName(),arguments:r?this.getArguments().map(n=>n.getText()):void 0,typeArguments:r?this.getTypeArguments().map(n=>n.getText()):void 0})}};function aq(e){return class extends e{getTypeExpression(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.typeExpression)}getTypeExpressionOrThrow(){return b.errors.throwIfNullOrUndefined(this.getTypeExpression(),"Expected to find a JS doc type expression.")}getName(){return this.getNameNode().getText()}getNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.name)}isBracketed(){return this.compilerNode.isBracketed}}}function tG(e){return class extends e{getTypeExpression(){let r=this._getNodeFromCompilerNodeIfExists(this.compilerNode.typeExpression);if(!(r!=null&&r.getWidth()===0))return r}getTypeExpressionOrThrow(){return b.errors.throwIfNullOrUndefined(this.getTypeExpression(),"Expected to find the JS doc tag's type expression.")}}}function Nme(e){return class extends e{getTypeParameters(){return this.compilerNode.typeParameters.map(r=>this._getNodeFromCompilerNode(r)).filter(r=>r.getWidth()>0)}}}function RH(e){return e.replace(/^\/\*\*[^\S\n]*\n?/,"").replace(/(\r?\n)?[^\S\n]*\*\/$/,"").split(/\n/).map(i=>{let a=n(i);if(a===-1)return i;let s=i[a+1]===" "?a+2:a+1;return i.substring(s)}).join(`
4251
4251
  `);function n(i){for(let a=0;a<i.length;a++){let s=i.charCodeAt(a);if(s===ac.ASTERISK)return a;if(!b.StringUtils.isWhitespaceCharCode(s))break}return-1}}var xR=Tr,Ow=class extends xR{isMultiLine(){return this.getText().includes(`
4252
- `)}getTags(){var r,n;return(n=(r=this.compilerNode.tags)===null||r===void 0?void 0:r.map(i=>this._getNodeFromCompilerNode(i)))!==null&&n!==void 0?n:[]}getInnerText(){return RH(this.getText())}getComment(){if(this.compilerNode.comment!=null)return typeof this.compilerNode.comment=="string"?this.compilerNode.comment:this.compilerNode.comment.map(r=>this._getNodeFromCompilerNodeIfExists(r))}getCommentText(){return typeof this.compilerNode.comment=="string"?this.compilerNode.comment:b.ts.getTextOfJSDocComment(this.compilerNode.comment)}getDescription(){var r,n;let i=this.getSourceFile().getFullText(),a=(n=(r=this.getTags()[0])===null||r===void 0?void 0:r.getStart())!==null&&n!==void 0?n:this.getEnd()-2,s=u(this);return RH(i.substring(s,Math.max(s,p())));function u(f){let m=f.getStart()+3;return i.charCodeAt(m)===ac.SPACE?m+1:m}function p(){let f=uv(i,a,m=>m===ac.NEWLINE||!b.StringUtils.isWhitespaceCharCode(m)&&m!==ac.ASTERISK);return uv(i,f,m=>m!==ac.NEWLINE&&m!==ac.CARRIAGE_RETURN)}}setDescription(r){let n=this.getTags(),i=this.getStart()+3,a=n.length>0?uv(this._sourceFile.getFullText(),n[0].getStart(),u=>u===ac.ASTERISK)-1:this.getEnd()-2;return E7e({parent:this,newText:s.call(this),replacePos:i,replacingLength:a-i}),this;function s(){var u,p;let f=this.getIndentationText(),m=this._context.manipulationSettings.getNewLineKindAsString(),g=$g(this._getWriter(),r).split(/\r?\n/),D=g[0].length===0,P=g.length===1&&((p=(u=this.compilerNode.tags)===null||u===void 0?void 0:u.length)!==null&&p!==void 0?p:0)===0,B=P?g[0]:g.map(K=>K.length===0?`${f} *`:`${f} * ${K}`).slice(D?1:0).join(m);return P?" "+B+" ":m+B+m+f+" "}}addTag(r){return this.addTags([r])[0]}addTags(r){var n,i;return this.insertTags((i=(n=this.compilerNode.tags)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,r)}insertTag(r,n){return this.insertTags(r,[n])[0]}insertTags(r,n){if(b.ArrayUtils.isNullOrEmpty(n))return[];let i=this._getWriterWithQueuedIndentation(),a=this.getTags();if(r=ku(r,a.length),a.length===0&&!this.isMultiLine()){let p=this._context.structurePrinterFactory.forJSDoc();this.replaceWithText(f=>{p.printText(f,{description:this.getDescription(),tags:n})})}else{let p=this._context.structurePrinterFactory.forJSDocTag({printStarsOnNewLine:!0});i.newLine().write(" * "),p.printTexts(i,n),i.newLine().write(" *"),i.conditionalWrite(r<a.length," ");let f=s.call(this),m=u.call(this);qa({parent:this,insertPos:f,replacing:{textLength:m-f},newText:i.toString()})}return af(a,this.getTags(),r,!1);function s(){let p=r<a.length?a[r].getStart():this.getEnd()-2,f=this.getStart()+3;return Math.max(f,uv(this.getSourceFile().getFullText(),p,m=>!b.StringUtils.isWhitespaceCharCode(m)&&m!==ac.ASTERISK))}function u(){return r<a.length?a[r].getStart():this.getEnd()-1}}remove(){Bs({children:[this],removeFollowingSpaces:!0,removeFollowingNewLines:!0})}set(r){return io(xR.prototype,this,r),r.tags!=null?this.replaceWithText(n=>{var i;this._context.structurePrinterFactory.forJSDoc().printText(n,{description:(i=r.description)!==null&&i!==void 0?i:this.getDescription(),tags:r.tags})}):(r.description!=null&&this.setDescription(r.description),this)}getStructure(){return uo(xR.prototype,this,{kind:Oe.StructureKind.JSDoc,description:this.getDescription(),tags:this.getTags().map(r=>r.getStructure())})}},wc=class extends Tr{},Ime=Q6(wc),KT=class extends Ime{},kw=class extends wc{getElementTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.elementType)}},Rw=class extends wc{getCheckType(){return this._getNodeFromCompilerNode(this.compilerNode.checkType)}getExtendsType(){return this._getNodeFromCompilerNode(this.compilerNode.extendsType)}getTrueType(){return this._getNodeFromCompilerNode(this.compilerNode.trueType)}getFalseType(){return this._getNodeFromCompilerNode(this.compilerNode.falseType)}},Pme=_v(wc),uL=class extends Pme{},Ome=gS(sf(uL)),Mw=class extends Ome{},kme=XT(KT),ww=class extends kme{},Rme=J_(uL),Fw=class extends Rme{},Gw=class extends Tr{getAssertClause(){return this._getNodeFromCompilerNode(this.compilerNode.assertClause)}isMultiline(){var r;return(r=this.compilerNode.multiLine)!==null&&r!==void 0?r:!1}},Bw=class extends KT{setArgument(r){let n=this.getArgument();if(Tr.isLiteralTypeNode(n)){let i=n.getLiteral();if(Tr.isStringLiteral(i))return i.setLiteralValue(r),this}return n.replaceWithText(i=>i.quote(r),this._getWriterWithQueuedChildIndentation()),this}getArgument(){return this._getNodeFromCompilerNode(this.compilerNode.argument)}setQualifier(r){let n=this.getQualifier();if(n!=null)n.replaceWithText(r,this._getWriterWithQueuedChildIndentation());else{let i=this.getFirstChildByKindOrThrow(b.SyntaxKind.CloseParenToken);qa({insertPos:i.getEnd(),parent:this,newText:this._getWriterWithQueuedIndentation().write(".").write(r).toString()})}return this}getQualifierOrThrow(){return b.errors.throwIfNullOrUndefined(this.getQualifier(),()=>`Expected to find a qualifier for the import type: ${this.getText()}`)}getQualifier(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.qualifier)}getAssertions(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.assertions)}getAssertionsOrThrow(){return b.errors.throwIfNullOrUndefined(this._getNodeFromCompilerNodeIfExists(this.compilerNode.assertions),"Could not find import type assertion container.")}},Uw=class extends wc{getObjectTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.objectType)}getIndexTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.indexType)}},Kw=class extends wc{getTypeParameter(){return this._getNodeFromCompilerNode(this.compilerNode.typeParameter)}},Ww=class extends wc{getTypeNodes(){return this.compilerNode.types.map(r=>this._getNodeFromCompilerNode(r))}},Vw=class extends wc{getLiteral(){let r=this.compilerNode.literal;return this._getNodeFromCompilerNode(r)}},jw=class extends wc{getNameTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.nameType)}getNameTypeNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getNameTypeNode(),"Type did not exist.")}getReadonlyToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.readonlyToken)}getReadonlyTokenOrThrow(){return b.errors.throwIfNullOrUndefined(this.getReadonlyToken(),"Readonly token did not exist.")}getQuestionToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.questionToken)}getQuestionTokenOrThrow(){return b.errors.throwIfNullOrUndefined(this.getQuestionToken(),"Question token did not exist.")}getTypeParameter(){return this._getNodeFromCompilerNode(this.compilerNode.typeParameter)}getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getTypeNode(),"Type did not exist, but was expected to exist.")}},H9e=e=>KE(Rh(bL(sc(mv(e))))),Mme=H9e(wc),Hw=class extends Mme{getTypeNode(){return super.getTypeNode()}removeType(){throw new b.errors.InvalidOperationError("Cannot remove the type of a named tuple member.")}},qw=class extends wc{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}setType(r){return this.getTypeNode().replaceWithText(r),this}},Jw=class extends wc{getHead(){return this._getNodeFromCompilerNode(this.compilerNode.head)}getTemplateSpans(){return this.compilerNode.templateSpans.map(r=>this._getNodeFromCompilerNode(r))}setLiteralValue(r){var n;let i=this.getChildIndex(),a=(n=this.getParentSyntaxList())!==null&&n!==void 0?n:this.getParentOrThrow();return mS({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:r}),a.getChildAtIndex(i)}},zw=class extends wc{},$w=class extends wc{getElements(){return this.compilerNode.elements.map(r=>this._getNodeFromCompilerNode(r))}},q9e=e=>J_(KE(sc(Ph(BE(sf(mv(e))))))),DR=q9e(Cl),Xw=class extends DR{set(r){return io(DR.prototype,this,r),this}getStructure(){return uo(DR.prototype,this,{kind:Oe.StructureKind.TypeAlias,type:this.getTypeNodeOrThrow().getText()})}},wme=tq(wc),Yw=class extends wme{},Qw=class extends wc{getOperator(){return this.compilerNode.operator}getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}};Oe.TypeParameterVariance=void 0;(function(e){e[e.None=0]="None",e[e.In=1]="In",e[e.Out=2]="Out",e[e.InOut=3]="InOut"})(Oe.TypeParameterVariance||(Oe.TypeParameterVariance={}));var CR=sf(mv(Tr)),Zw=class extends CR{getConstraint(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.constraint)}getConstraintOrThrow(){return b.errors.throwIfNullOrUndefined(this.getConstraint(),"Expected to find the type parameter's constraint.")}setConstraint(r){if(r=this.getParentOrThrow()._getTextWithQueuedChildIndentation(r),b.StringUtils.isNullOrWhitespace(r))return this.removeConstraint(),this;let n=this.getConstraint();if(n!=null)return n.replaceWithText(r),this;let i=this.getNameNode();return qa({parent:this,insertPos:i.getEnd(),newText:` extends ${r}`}),this}removeConstraint(){return Cfe(this.getConstraint(),b.SyntaxKind.ExtendsKeyword),this}getDefault(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.default)}getDefaultOrThrow(){return b.errors.throwIfNullOrUndefined(this.getDefault(),"Expected to find the type parameter's default.")}setDefault(r){if(r=this.getParentOrThrow()._getTextWithQueuedChildIndentation(r),b.StringUtils.isNullOrWhitespace(r))return this.removeDefault(),this;let n=this.getDefault();if(n!=null)return n.replaceWithText(r),this;let i=this.getConstraint()||this.getNameNode();return qa({parent:this,insertPos:i.getEnd(),newText:` = ${r}`}),this}removeDefault(){return Cfe(this.getDefault(),b.SyntaxKind.EqualsToken),this}setVariance(r){return this.toggleModifier("in",(r&Oe.TypeParameterVariance.In)!==0),this.toggleModifier("out",(r&Oe.TypeParameterVariance.Out)!==0),this}getVariance(){let r=Oe.TypeParameterVariance.None;return this.hasModifier("in")&&(r|=Oe.TypeParameterVariance.In),this.hasModifier("out")&&(r|=Oe.TypeParameterVariance.Out),r}remove(){let r=this.getParentSyntaxListOrThrow();r.getChildrenOfKind(b.SyntaxKind.TypeParameter).length===1?i():fv(this);function i(){let a=[r.getPreviousSiblingIfKindOrThrow(b.SyntaxKind.LessThanToken),r,r.getNextSiblingIfKindOrThrow(b.SyntaxKind.GreaterThanToken)];Bs({children:a})}}set(r){return io(CR.prototype,this,r),r.constraint!=null?this.setConstraint(r.constraint):r.hasOwnProperty(b.nameof(r,"constraint"))&&this.removeConstraint(),r.default!=null?this.setDefault(r.default):r.hasOwnProperty(b.nameof(r,"default"))&&this.removeDefault(),r.variance!=null&&this.setVariance(r.variance),this}getStructure(){let r=this.getConstraint(),n=this.getDefault();return uo(CR.prototype,this,{kind:Oe.StructureKind.TypeParameter,constraint:r?.getText({trimLeadingIndentation:!0}),default:n?n.getText({trimLeadingIndentation:!0}):void 0,variance:this.getVariance()})}};function Cfe(e,r){e!=null&&Bs({children:[e.getPreviousSiblingIfKindOrThrow(r),e],removePrecedingSpaces:!0})}var eF=class extends wc{getParameterNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.parameterName)}hasAssertsModifier(){return this.compilerNode.assertsModifier!=null}getAssertsModifier(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.assertsModifier)}getAssertsModifierOrThrow(){return b.errors.throwIfNullOrUndefined(this.getAssertsModifier(),"Expected to find an asserts modifier.")}getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getTypeNode(),"Expected to find a type node.")}},rF=class extends KT{getExprName(){return this._getNodeFromCompilerNode(this.compilerNode.exprName)}},tF=class extends KT{getTypeName(){return this._getNodeFromCompilerNode(this.compilerNode.typeName)}},nF=class extends wc{getTypeNodes(){return this.compilerNode.types.map(r=>this._getNodeFromCompilerNode(r))}},q_=class extends wc{},iF=class extends q_{},AR=Tr,bc=class extends AR{getTagName(){return this.getTagNameNode().getText()}getTagNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.tagName)}setTagName(r){return this.set({tagName:r})}getComment(){if(this.compilerNode.comment!=null)return typeof this.compilerNode.comment=="string"?this.compilerNode.comment:this.compilerNode.comment.map(r=>this._getNodeFromCompilerNodeIfExists(r))}getCommentText(){return typeof this.compilerNode.comment=="string"?this.compilerNode.comment:b.ts.getTextOfJSDocComment(this.compilerNode.comment)}remove(){let r=this.getParentOrThrow().getStart()+3,n=Bme(this),i=n==null,a=s.call(this);Bs({children:[this],customRemovalPos:a,customRemovalEnd:Gme(this,n),replaceTrivia:u.call(this)});function s(){return Math.max(r,Ume(this,this.getStart()))}function u(){if(a===r&&i)return"";let p=this._context.manipulationSettings.getNewLineKindAsString(),f=this.getParentOrThrow().getIndentationText();return`${p}${f} `+(i?"":"* ")}}set(r){return io(AR.prototype,this,r),r.text!=null||r.tagName!=null?this.replaceWithText(n=>{var i;this._context.structurePrinterFactory.forJSDocTag({printStarsOnNewLine:!0}).printText(n,{tagName:(i=r.tagName)!==null&&i!==void 0?i:this.getTagName(),text:r.text!=null?r.text:Afe(this)})}):this}replaceWithText(r){let n=$g(this._getWriterWithQueuedIndentation(),r),i=this.getParentOrThrow(),a=this.getChildIndex(),s=this.getStart();return qa({parent:i,insertPos:s,newText:n,replacing:{textLength:Fme(this)-s}}),i.getChildren()[a]}getStructure(){let r=Afe(this);return uo(AR.prototype,this,{kind:Oe.StructureKind.JSDocTag,tagName:this.getTagName(),text:r.length===0?void 0:r})}};function Afe(e){let r=e.getSourceFile().getFullText(),n=e.getTagNameNode().getEnd(),i=Fme(e),a=Math.min(r.charCodeAt(n)===ac.SPACE?n+1:n,i);return RH(r.substring(a,i))}function Fme(e){return Ume(e,Gme(e))}function Gme(e,r){return r=r??Bme(e),r!=null?r.getStart():e.getParentOrThrow().getEnd()-2}function Bme(e){let n=e.getParentIfKindOrThrow(b.SyntaxKind.JSDoc).getTags(),i=n.indexOf(e);return n[i+1]}function Ume(e,r){let n=e.getSourceFile().getFullText();return uv(n,r,i=>i!==ac.ASTERISK&&!b.StringUtils.isWhitespaceCharCode(i))}var aF=class extends bc{},oF=class extends bc{},sF=class extends bc{},lF=class extends bc{},uF=class extends bc{},cF=class extends bc{},Kme=_v(q_),dF=class extends Kme{},fF=class extends bc{},pF=class extends Tr{},mF=class extends Tr{},_F=class extends Tr{},gF=class extends Tr{},yF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},vF=class extends Tr{getName(){return this._getNodeFromCompilerNode(this.compilerNode.name)}},hF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}isPostfix(){return this.compilerNode.postfix}},EF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}isPostfix(){return this.compilerNode.postfix}},bF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},SF=class extends bc{},Wme=aq(bc),TF=class extends Wme{},xF=class extends bc{},Vme=aq(bc),DF=class extends Vme{},CF=class extends bc{},AF=class extends bc{},LF=class extends bc{},jme=tG(bc),NF=class extends jme{},Hme=tG(bc),IF=class extends Hme{},PF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}},cL=class{constructor(r){this._compilerObject=r}get compilerObject(){return this._compilerObject}getName(){return this.compilerObject.name}getText(){var r;return(r=this.compilerObject.text)!==null&&r!==void 0?r:[]}},qme=Nme(bc),OF=class extends qme{getConstraint(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.constraint)}getConstraintOrThrow(){return b.errors.throwIfNullOrUndefined(this.getConstraint(),"Expected to find the JS doc template tag's constraint.")}},kF=class extends Tr{},Jme=tG(bc),RF=class extends Jme{},MF=class extends bc{},wF=class extends wc{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},FF=class extends q_{isArrayType(){return this.compilerNode.isArrayType}getPropertyTags(){return this.compilerNode.jsDocPropertyTags?this.compilerNode.jsDocPropertyTags.map(r=>this._getNodeFromCompilerNode(r)):void 0}},GF=class extends bc{getTypeExpression(){let r=this.compilerNode.typeExpression;if(!(r!=null&&r.pos===r.end))return this._getNodeFromCompilerNodeIfExists(this.compilerNode.typeExpression)}},BF=class extends bc{},UF=class extends q_{},KF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},WF=class extends Tr{remove(){Nh({children:[this],getSiblingFormatting:()=>El.Newline})}},J9e=e=>ld(yS(sc(Ph(BE(sf(mv(e))))))),LR=J9e(Cl),VF=class extends LR{set(r){return io(LR.prototype,this,r),r.isConst!=null&&this.setIsConstEnum(r.isConst),r.members!=null&&(this.getMembers().forEach(n=>n.remove()),this.addMembers(r.members)),this}addMember(r){return this.addMembers([r])[0]}addMembers(r){return this.insertMembers(this.getMembers().length,r)}insertMember(r,n){return this.insertMembers(r,[n])[0]}insertMembers(r,n){if(n.length===0)return[];let i=this.getMembersWithComments();r=ku(r,i.length);let a=this._getWriterWithChildIndentation();return this._context.structurePrinterFactory.forEnumMember().printTexts(a,n),j_({parent:this.getChildSyntaxListOrThrow(),currentNodes:i,insertIndex:r,newText:a.toString(),useNewLines:!0,useTrailingCommas:this._context.manipulationSettings.getUseTrailingCommas()}),af(i,this.getMembersWithComments(),r,!u());function u(){return n instanceof Array?n.every(p=>typeof p=="object"):!1}}getMember(r){return ic(this.getMembers(),r)}getMemberOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getMember(r),()=>Ou("enum member",r))}getMembers(){return this.compilerNode.members.map(r=>this._getNodeFromCompilerNode(r))}getMembersWithComments(){let r=this.compilerNode;return od.getContainerArray(r,this.getSourceFile().compilerNode).map(n=>this._getNodeFromCompilerNode(n))}setIsConstEnum(r){return this.toggleModifier("const",r)}isConstEnum(){return this.getConstKeyword()!=null}getConstKeyword(){return this.getFirstModifierByKind(b.SyntaxKind.ConstKeyword)}getStructure(){return uo(LR.prototype,this,{kind:Oe.StructureKind.Enum,isConst:this.isConstEnum(),members:this.getMembers().map(r=>r.getStructure())})}},z9e=e=>sc($T(UE(e))),NR=z9e(Tr),jF=class extends NR{getValue(){return this._context.typeChecker.getConstantValue(this)}setValue(r){let n;if(typeof r=="string"){let i=this._context.manipulationSettings.getQuoteKind();n=i+b.StringUtils.escapeForWithinString(r,i)+i}else n=r.toString();return this.setInitializer(n),this}remove(){let r=[this],n=this.getNextSiblingIfKind(b.SyntaxKind.CommaToken);n!=null&&r.push(n),Nh({children:r,getSiblingFormatting:()=>El.Newline})}set(r){return io(NR.prototype,this,r),r.value!=null?this.setValue(r.value):r.hasOwnProperty(b.nameof(r,"value"))&&r.initializer==null&&this.removeInitializer(),this}getStructure(){return uo(NR.prototype,this,{kind:Oe.StructureKind.EnumMember,value:void 0})}},HF=class extends Tr{getTypeNodes(){var r,n;return(n=(r=this.compilerNode.types)===null||r===void 0?void 0:r.map(i=>this._getNodeFromCompilerNode(i)))!==null&&n!==void 0?n:[]}getToken(){return this.compilerNode.token}removeExpression(r){let n=this.getTypeNodes(),i=typeof r=="number"?a(r):r;if(n.length===1){let s=this.getParentSyntaxListOrThrow().getChildren();s.length===1?Bs({children:[s[0].getParentSyntaxListOrThrow()],removePrecedingSpaces:!0}):Bs({children:[this],removePrecedingSpaces:!0})}else fv(i);return this;function a(s){return n[ku(s,n.length-1)]}}},wE=class extends Tr{remove(){m7e(this)}},$9e=e=>J_(Nm(sc(_v(e)))),IR=$9e(wE),qF=class extends IR{set(r){return io(IR.prototype,this,r),this}getStructure(){return uo(IR.prototype,this,{kind:Oe.StructureKind.CallSignature})}},JF=class extends wE{},X9e=e=>J_(Nm(sc(_v(e)))),PR=X9e(wE),zF=class extends PR{set(r){return io(PR.prototype,this,r),this}getStructure(){return uo(PR.prototype,this,{kind:Oe.StructureKind.ConstructSignature})}},Y9e=e=>eq(Nm(sc(xL(sf(e))))),OR=Y9e(wE),$F=class extends OR{getKeyName(){return this.getKeyNameNode().getText()}setKeyName(r){b.errors.throwIfWhitespaceOrNotString(r,"name"),this.getKeyName()!==r&&this.getKeyNameNode().replaceWithText(r,this._getWriterWithQueuedChildIndentation())}getKeyNameNode(){let r=this.compilerNode.parameters[0];return this._getNodeFromCompilerNode(r.name)}getKeyType(){return this.getKeyNameNode().getType()}setKeyType(r){b.errors.throwIfWhitespaceOrNotString(r,"type");let n=this.getKeyTypeNode();return n.getText()===r?this:(n.replaceWithText(r,this._getWriterWithQueuedChildIndentation()),this)}getKeyTypeNode(){let r=this.compilerNode.parameters[0];return this._getNodeFromCompilerNode(r.type)}set(r){return io(OR.prototype,this,r),r.keyName!=null&&this.setKeyName(r.keyName),r.keyType!=null&&this.setKeyType(r.keyType),this}getStructure(){let r=this.getKeyTypeNode();return uo(OR.prototype,this,{kind:Oe.StructureKind.IndexSignature,keyName:this.getKeyName(),keyType:r.getText()})}},Q9e=e=>tq(ld(ipe(QH(J_(sc(Ph(yS(BE(sf(mv(e))))))))))),kR=Q9e(Cl),XF=class extends kR{getBaseTypes(){return this.getType().getBaseTypes()}getBaseDeclarations(){return b.ArrayUtils.flatten(this.getType().getBaseTypes().map(r=>{var n,i;return(i=(n=r.getSymbol())===null||n===void 0?void 0:n.getDeclarations())!==null&&i!==void 0?i:[]}))}getImplementations(){return this.getNameNode().getImplementations()}set(r){return io(kR.prototype,this,r),this}getStructure(){return uo(kR.prototype,this,{kind:Oe.StructureKind.Interface})}},Z9e=e=>Nm(sc(Rh(J_(_v(UE(e)))))),RR=Z9e(wE),YF=class extends RR{set(r){return io(RR.prototype,this,r),this}getStructure(){return uo(RR.prototype,this,{kind:Oe.StructureKind.MethodSignature})}},eUe=e=>Nm(sc(xL(Rh($T(KE(UE(sf(e)))))))),MR=eUe(wE),QF=class extends MR{set(r){return io(MR.prototype,this,r),this}getStructure(){return uo(MR.prototype,this,{kind:Oe.StructureKind.PropertySignature})}};function oq(e){return class extends e{getAttributes(){return this.compilerNode.attributes.properties.map(r=>this._getNodeFromCompilerNode(r))}getAttributeOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getAttribute(r),()=>Ou("attribute",r))}getAttribute(r){return ic(this.getAttributes(),r)}addAttribute(r){return this.addAttributes([r])[0]}addAttributes(r){return this.insertAttributes(this.compilerNode.attributes.properties.length,r)}insertAttribute(r,n){return this.insertAttributes(r,[n])[0]}insertAttributes(r,n){if(n.length===0)return[];let i=this.compilerNode.attributes.properties.length;r=ku(r,i);let a=r===0?this.getTagNameNode().getEnd():this.getAttributes()[r-1].getEnd(),s=this._getWriterWithQueuedChildIndentation();return new Mj(this._context.structurePrinterFactory.forJsxAttributeDecider()).printText(s,n),qa({insertPos:a,newText:" "+s.toString(),parent:this.getNodeProperty("attributes").getFirstChildByKindOrThrow(b.SyntaxKind.SyntaxList)}),af(i,this.getAttributes(),r,!1)}set(r){return io(e.prototype,this,r),r.attributes!=null&&(this.getAttributes().forEach(n=>n.remove()),this.addAttributes(r.attributes)),this}getStructure(){return uo(e.prototype,this,{attributes:this.getAttributes().map(r=>r.getStructure())})}}}function nG(e){return class extends e{getTagNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.tagName)}set(r){return io(e.prototype,this,r),r.name!=null&&this.getTagNameNode().replaceWithText(r.name),this}getStructure(){return uo(e.prototype,this,{name:this.getTagNameNode().getText()})}}}var wR=mv(Tr),ZF=class extends wR{getInitializerOrThrow(){return b.errors.throwIfNullOrUndefined(this.getInitializer(),`Expected to find an initializer for the JSX attribute '${this.getName()}'`)}getInitializer(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.initializer)}setInitializer(r){let n=$g(this._getWriterWithQueuedIndentation(),r);if(b.StringUtils.isNullOrWhitespace(n))return this.removeInitializer(),this;let i=this.getInitializer();return i!=null?(i.replaceWithText(n),this):(qa({insertPos:this.getNameNode().getEnd(),parent:this,newText:`=${n}`}),this)}removeInitializer(){let r=this.getInitializer();return r==null?this:(Bs({children:[r.getPreviousSiblingIfKindOrThrow(b.SyntaxKind.EqualsToken),r],removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this)}remove(){Bs({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}set(r){return io(wR.prototype,this,r),r.initializer!=null?this.setInitializer(r.initializer):r.hasOwnProperty(b.nameof(r,"initializer"))&&this.removeInitializer(),this}getStructure(){let r=this.getInitializer();return uo(wR.prototype,this,{kind:Oe.StructureKind.JsxAttribute,initializer:r?.getText()})}},rUe=e=>nG(e),zme=rUe(Tr),e6=class extends zme{},r6=class extends oc{},FR=sd,t6=class extends FR{getJsxChildren(){return this.compilerNode.children.map(r=>this._getNodeFromCompilerNode(r))}getOpeningElement(){return this._getNodeFromCompilerNode(this.compilerNode.openingElement)}getClosingElement(){return this._getNodeFromCompilerNode(this.compilerNode.closingElement)}setBodyText(r){let n=Qfe(this._getWriterWithIndentation(),r);return Lfe(this,n),this}setBodyTextInline(r){let n=this._getWriterWithQueuedChildIndentation();return GE(n,r),n.isLastNewLine()&&(n.setIndentationLevel(Math.max(0,this.getIndentationLevel()-1)),n.write("")),Lfe(this,n.toString()),this}set(r){if(io(FR.prototype,this,r),r.attributes!=null){let n=this.getOpeningElement();n.getAttributes().forEach(i=>i.remove()),n.addAttributes(r.attributes)}if(r.children!=null)throw new b.errors.NotImplementedError("Setting JSX children is currently not implemented. Please open an issue if you need this.");return r.bodyText!=null?this.setBodyText(r.bodyText):r.hasOwnProperty(b.nameof(r,"bodyText"))&&this.setBodyTextInline(""),r.name!=null&&(this.getOpeningElement().getTagNameNode().replaceWithText(r.name),this.getClosingElement().getTagNameNode().replaceWithText(r.name)),this}getStructure(){let r=this.getOpeningElement(),n=uo(FR.prototype,this,{kind:Oe.StructureKind.JsxElement,name:r.getTagNameNode().getText(),attributes:r.getAttributes().map(i=>i.getStructure()),children:void 0,bodyText:zH(this)});return delete n.children,n}};function Lfe(e,r){let n=e.getOpeningElement(),i=e.getClosingElement();qa({insertPos:n.getEnd(),newText:r,parent:e.getChildSyntaxListOrThrow(),replacing:{textLength:i.getStart()-n.getEnd()}})}var $me=DL(bL(oc)),n6=class extends $me{},i6=class extends sd{getJsxChildren(){return this.compilerNode.children.map(r=>this._getNodeFromCompilerNode(r))}getOpeningFragment(){return this._getNodeFromCompilerNode(this.compilerNode.openingFragment)}getClosingFragment(){return this._getNodeFromCompilerNode(this.compilerNode.closingFragment)}},tUe=e=>oq(nG(e)),Xme=tUe(oc),a6=class extends Xme{},o6=class extends oc{},nUe=e=>oq(nG(e)),GR=nUe(sd),s6=class extends GR{set(r){return io(GR.prototype,this,r),this}getStructure(){return uo(GR.prototype,this,{kind:Oe.StructureKind.JsxSelfClosingElement})}},BR=ud(Tr),l6=class extends BR{remove(){Bs({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}set(r){return io(BR.prototype,this,r),r.expression!=null&&this.setExpression(r.expression),this}getStructure(){return uo(BR.prototype,this,{kind:Oe.StructureKind.JsxSpreadAttribute,expression:this.getExpression().getText()})}},Yme=UD(Tr),u6=class extends Yme{containsOnlyTriviaWhiteSpaces(){let r=this.compilerNode;return typeof r.containsOnlyWhiteSpaces=="boolean"?r.containsOnlyWhiteSpaces:this.compilerNode.containsOnlyTriviaWhiteSpaces}},Qme=cS,c6=class extends Qme{getLiteralValue(){let r=this.compilerNode.text;if(typeof BigInt>"u")throw new b.errors.InvalidOperationError("Runtime environment does not support BigInts. Perhaps work with the text instead?");let n=r.substring(0,r.length-1);return BigInt(n)}setLiteralValue(r){if(typeof r!="bigint")throw new b.errors.ArgumentTypeError("value","bigint",typeof r);return mS({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:r.toString()+"n"}),this}},Zme=sd,d6=class extends Zme{getLiteralValue(){return sq(this)}setLiteralValue(r){return r_e(this,r)}},e_e=sd,f6=class extends e_e{getLiteralValue(){return sq(this)}setLiteralValue(r){return r_e(this,r)}};function r_e(e,r){if(sq(e)===r)return e;let n=e.getParentSyntaxList()||e.getParentOrThrow(),i=e.getChildIndex();return e.replaceWithText(r?"true":"false"),n.getChildAtIndex(i)}function sq(e){return e.getKind()===b.SyntaxKind.TrueKeyword}var t_e=sd,p6=class extends t_e{},n_e=cS,m6=class extends n_e{getLiteralValue(){let r=this.compilerNode.text;return r.indexOf(".")>=0?parseFloat(r):parseInt(r,10)}setLiteralValue(r){return mS({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:r.toString(10)}),this}};Oe.QuoteKind=void 0;(function(e){e.Single="'",e.Double='"'})(Oe.QuoteKind||(Oe.QuoteKind={}));var i_e=cS,_6=class extends i_e{getLiteralValue(){let r=/^\/(.*)\/([^\/]*)$/,n=this.compilerNode.text,i=r.exec(n);return new RegExp(i[1],i[2])}setLiteralValue(r,n){let i;return typeof r=="string"?i=r:(i=r.source,n=r.flags),mS({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:`/${i}/${n||""}`}),this}},a_e=cS,g6=class extends a_e{getLiteralValue(){return this.compilerNode.text}setLiteralValue(r){return mS({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:b.StringUtils.escapeForWithinString(r,this.getQuoteKind())}),this}getQuoteKind(){return this.getText()[0]==="'"?Oe.QuoteKind.Single:Oe.QuoteKind.Double}},o_e=cS,y6=class extends o_e{getLiteralValue(){return this.compilerNode.text}setLiteralValue(r){let n=this.getChildIndex(),i=this.getParentSyntaxList()||this.getParentOrThrow();return mS({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:r}),i.getChildAtIndex(n)}},v6=class extends BT{getTag(){return this._getNodeFromCompilerNode(this.compilerNode.tag)}getTemplate(){return this._getNodeFromCompilerNode(this.compilerNode.template)}removeTag(){var r;let n=(r=this.getParentSyntaxList())!==null&&r!==void 0?r:this.getParentOrThrow(),i=this.getChildIndex(),a=this.getTemplate();return qa({customMappings:(s,u)=>[{currentNode:a,newNode:s.getChildren(u)[i]}],parent:n,insertPos:this.getStart(),newText:this.getTemplate().getText(),replacing:{textLength:this.getWidth(),nodes:[this]}}),n.getChildAtIndex(i)}},s_e=sd,h6=class extends s_e{getHead(){return this._getNodeFromCompilerNode(this.compilerNode.head)}getTemplateSpans(){return this.compilerNode.templateSpans.map(r=>this._getNodeFromCompilerNode(r))}setLiteralValue(r){var n;let i=this.getChildIndex(),a=(n=this.getParentSyntaxList())!==null&&n!==void 0?n:this.getParentOrThrow();return mS({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:r}),a.getChildAtIndex(i)}},l_e=UD(Tr),E6=class extends l_e{},u_e=UD(Tr),b6=class extends u_e{},c_e=ud(Tr),S6=class extends c_e{getLiteral(){return this._getNodeFromCompilerNode(this.compilerNode.literal)}},d_e=UD(Tr),T6=class extends d_e{};function lq(e){return class extends e{getText(){return this.compilerNode.text}getDefinitionNodes(){return this.getDefinitions().map(r=>r.getDeclarationNode()).filter(r=>r!=null)}getDefinitions(){return this._context.languageService.getDefinitions(this)}}}var f_e=ud(Tr),x6=class extends f_e{},p_e=lq(kh(pv(sd))),D6=class extends p_e{getImplementations(){return this._context.languageService.getImplementations(this)}},m_e=lq(kh(pv(Tr))),C6=class extends m_e{},A6=class extends Tr{getLeft(){return this._getNodeFromCompilerNode(this.compilerNode.left)}getRight(){return this._getNodeFromCompilerNode(this.compilerNode.right)}},iUe=e=>XH($H(KE($T($6(e))))),UR=iUe(Tr),L6=class extends UR{remove(){let r=this.getParentOrThrow();switch(r.getKind()){case b.SyntaxKind.VariableDeclarationList:n(this);break;case b.SyntaxKind.CatchClause:i(this);break;default:throw new b.errors.NotImplementedError(`Not implemented for syntax kind: ${r.getKindName()}`)}function n(a){let s=r.getParentIfKindOrThrow(b.SyntaxKind.VariableStatement);s.getDeclarations().length===1?s.remove():fv(a)}function i(a){Bs({children:[a.getPreviousSiblingIfKindOrThrow(b.SyntaxKind.OpenParenToken),a,a.getNextSiblingIfKindOrThrow(b.SyntaxKind.CloseParenToken)],removePrecedingSpaces:!0})}}getVariableStatementOrThrow(){return b.errors.throwIfNullOrUndefined(this.getVariableStatement(),"Expected the grandparent to be a variable statement.")}getVariableStatement(){let r=this.getParentOrThrow().getParentOrThrow();return Tr.isVariableStatement(r)?r:void 0}set(r){return io(UR.prototype,this,r),this}getStructure(){return uo(UR.prototype,this,{kind:Oe.StructureKind.VariableDeclaration})}},__e=sf(Tr),N6=class extends __e{getDeclarations(){return this.compilerNode.declarations.map(r=>this._getNodeFromCompilerNode(r))}getDeclarationKind(){let r=this.compilerNode.flags;return r&b.ts.NodeFlags.Let?Oe.VariableDeclarationKind.Let:r&b.ts.NodeFlags.Const?Oe.VariableDeclarationKind.Const:Oe.VariableDeclarationKind.Var}getDeclarationKindKeyword(){let r=this.getDeclarationKind();switch(r){case Oe.VariableDeclarationKind.Const:return this.getFirstChildByKindOrThrow(b.SyntaxKind.ConstKeyword);case Oe.VariableDeclarationKind.Let:return this.getFirstChildByKindOrThrow(b.SyntaxKind.LetKeyword);case Oe.VariableDeclarationKind.Var:return this.getFirstChildByKindOrThrow(b.SyntaxKind.VarKeyword);default:return b.errors.throwNotImplementedForNeverValueError(r)}}setDeclarationKind(r){if(this.getDeclarationKind()===r)return this;let n=this.getDeclarationKindKeyword();return qa({insertPos:n.getStart(),newText:r,parent:this,replacing:{textLength:n.getWidth()}}),this}addDeclaration(r){return this.addDeclarations([r])[0]}addDeclarations(r){return this.insertDeclarations(this.getDeclarations().length,r)}insertDeclaration(r,n){return this.insertDeclarations(r,[n])[0]}insertDeclarations(r,n){let i=this._getWriterWithQueuedChildIndentation(),a=new Ih(this._context.structurePrinterFactory.forVariableDeclaration()),s=this.compilerNode.declarations.length;return r=ku(r,s),a.printText(i,n),j_({parent:this.getFirstChildByKindOrThrow(b.SyntaxKind.SyntaxList),currentNodes:this.getDeclarations(),insertIndex:r,newText:i.toString(),useTrailingCommas:!1}),af(s,this.getDeclarations(),r,!1)}},I6=class{constructor(r,n){this._context=r,this._compilerSignature=n}get compilerSignature(){return this._compilerSignature}getTypeParameters(){return(this.compilerSignature.typeParameters||[]).map(n=>this._context.compilerFactory.getTypeParameter(n))}getParameters(){return this.compilerSignature.parameters.map(r=>this._context.compilerFactory.getSymbol(r))}getReturnType(){return this._context.compilerFactory.getType(this.compilerSignature.getReturnType())}getDocumentationComments(){return this.compilerSignature.getDocumentationComment(this._context.typeChecker.compilerObject).map(n=>this._context.compilerFactory.getSymbolDisplayPart(n))}getJsDocTags(){return this.compilerSignature.getJsDocTags().map(n=>this._context.compilerFactory.getJSDocTagInfo(n))}getDeclaration(){let{compilerFactory:r}=this._context,n=this.compilerSignature.getDeclaration();return r.getNodeFromCompilerNode(n,r.getSourceFileForNode(n))}},P6=class{constructor(r,n){this._context=r,this._compilerSymbol=n,this.getValueDeclaration(),this.getDeclarations()}get compilerSymbol(){return this._compilerSymbol}getName(){return this.compilerSymbol.getName()}getEscapedName(){return this.compilerSymbol.getEscapedName()}getAliasedSymbolOrThrow(){return b.errors.throwIfNullOrUndefined(this.getAliasedSymbol(),"Expected to find an aliased symbol.")}getImmediatelyAliasedSymbol(){return this._context.typeChecker.getImmediatelyAliasedSymbol(this)}getImmediatelyAliasedSymbolOrThrow(){return b.errors.throwIfNullOrUndefined(this.getImmediatelyAliasedSymbol(),"Expected to find an immediately aliased symbol.")}getAliasedSymbol(){return this._context.typeChecker.getAliasedSymbol(this)}getExportSymbol(){return this._context.typeChecker.getExportSymbolOfSymbol(this)}isAlias(){return(this.getFlags()&b.SymbolFlags.Alias)===b.SymbolFlags.Alias}isOptional(){return(this.getFlags()&b.SymbolFlags.Optional)===b.SymbolFlags.Optional}getFlags(){return this.compilerSymbol.getFlags()}hasFlags(r){return(this.compilerSymbol.flags&r)===r}getValueDeclarationOrThrow(){return b.errors.throwIfNullOrUndefined(this.getValueDeclaration(),()=>`Expected to find the value declaration of symbol '${this.getName()}'.`)}getValueDeclaration(){let r=this.compilerSymbol.valueDeclaration;if(r!=null)return this._context.compilerFactory.getNodeFromCompilerNode(r,this._context.compilerFactory.getSourceFileForNode(r))}getDeclarations(){var r;return((r=this.compilerSymbol.declarations)!==null&&r!==void 0?r:[]).map(n=>this._context.compilerFactory.getNodeFromCompilerNode(n,this._context.compilerFactory.getSourceFileForNode(n)))}getExportOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getExport(r),`Expected to find export with name: ${r}`)}getExport(r){if(this.compilerSymbol.exports==null)return;let n=this.compilerSymbol.exports.get(b.ts.escapeLeadingUnderscores(r));return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getExports(){return this.compilerSymbol.exports==null?[]:b.ArrayUtils.from(this.compilerSymbol.exports.values()).map(r=>this._context.compilerFactory.getSymbol(r))}getGlobalExportOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getGlobalExport(r),`Expected to find global export with name: ${r}`)}getGlobalExport(r){if(this.compilerSymbol.globalExports==null)return;let n=this.compilerSymbol.globalExports.get(b.ts.escapeLeadingUnderscores(r));return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getGlobalExports(){return this.compilerSymbol.globalExports==null?[]:b.ArrayUtils.from(this.compilerSymbol.globalExports.values()).map(r=>this._context.compilerFactory.getSymbol(r))}getMemberOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getMember(r),`Expected to find member with name: ${r}`)}getMember(r){if(this.compilerSymbol.members==null)return;let n=this.compilerSymbol.members.get(b.ts.escapeLeadingUnderscores(r));return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getMembers(){return this.compilerSymbol.members==null?[]:b.ArrayUtils.from(this.compilerSymbol.members.values()).map(r=>this._context.compilerFactory.getSymbol(r))}getDeclaredType(){return this._context.typeChecker.getDeclaredTypeOfSymbol(this)}getTypeAtLocation(r){return this._context.typeChecker.getTypeOfSymbolAtLocation(this,r)}getFullyQualifiedName(){return this._context.typeChecker.getFullyQualifiedName(this)}getJsDocTags(){return this.compilerSymbol.getJsDocTags(this._context.typeChecker.compilerObject).map(r=>new cL(r))}},wD=class{constructor(r){this._compilerObject=r}get compilerObject(){return this._compilerObject}getStart(){return this.compilerObject.start}getEnd(){return this.compilerObject.start+this.compilerObject.length}getLength(){return this.compilerObject.length}},FE=class{constructor(r){this._compilerObject=r}get compilerObject(){return this._compilerObject}getSpan(){return new wD(this.compilerObject.span)}getNewText(){return this.compilerObject.newText}};co([b.Memoize],FE.prototype,"getSpan",null);var fS=class{constructor(r,n){this._context=r,this._compilerObject=n;let i=r.compilerFactory.addOrGetSourceFileFromFilePath(r.fileSystemWrapper.getStandardizedAbsolutePath(n.fileName),{markInProject:!1,scriptKind:void 0});this._existingFileExists=i!=null,n.isNewFile||(this._sourceFile=i)}getFilePath(){return this._compilerObject.fileName}getSourceFile(){return this._sourceFile}getTextChanges(){return this._compilerObject.textChanges.map(r=>new FE(r))}applyChanges(r={}){if(this._isApplied)return;if(this.isNewFile()&&this._existingFileExists&&!r.overwrite)throw new b.errors.InvalidOperationError(`Cannot apply file text change for creating a new file when the file exists at path ${this.getFilePath()}. Did you mean to provide the overwrite option?`);let n;if(this.isNewFile()?n=this._context.project.createSourceFile(this.getFilePath(),"",{overwrite:r.overwrite}):n=this.getSourceFile(),n==null)throw new b.errors.InvalidOperationError(`Cannot apply file text change to modify existing file that doesn't exist at path: ${this.getFilePath()}`);return n.applyTextChanges(this.getTextChanges()),n._markAsInProject(),this._isApplied=!0,this}isNewFile(){return!!this._compilerObject.isNewFile}};co([b.Memoize],fS.prototype,"getTextChanges",null);var O6=class{constructor(r,n){this._context=r,this._compilerObject=n}get compilerObject(){return this._compilerObject}getDescription(){return this.compilerObject.description}getChanges(){return this.compilerObject.changes.map(r=>new fS(this._context,r))}},k6=class extends O6{getFixName(){return this.compilerObject.fixName}getFixId(){return this.compilerObject.fixId}getFixAllDescription(){return this.compilerObject.fixAllDescription}},dL=class{constructor(r,n){this._context=r,this._compilerObject=n}get compilerObject(){return this._compilerObject}getChanges(){return this.compilerObject.changes.map(r=>new fS(this._context,r))}applyChanges(r){for(let n of this.getChanges())n.applyChanges(r);return this}};co([b.Memoize],dL.prototype,"getChanges",null);var dv=class{constructor(r,n){this._context=r,this._compilerObject=n,this._sourceFile=this._context.compilerFactory.addOrGetSourceFileFromFilePath(r.fileSystemWrapper.getStandardizedAbsolutePath(this.compilerObject.fileName),{markInProject:!1,scriptKind:void 0}),this._sourceFile._doActionPreNextModification(()=>this.getNode())}get compilerObject(){return this._compilerObject}getSourceFile(){return this._sourceFile}getTextSpan(){return new wD(this.compilerObject.textSpan)}getNode(){let r=this.getTextSpan(),n=this.getSourceFile(),i=r.getStart(),a=r.getEnd();return s();function s(){let u;return n._context.compilerFactory.forgetNodesCreatedInBlock(p=>{let f,m=n;for(;m!=null;){if(f==null&&(u=m),m.getStart()===i&&m.getWidth()===a)u=f=m;else if(f!=null)break;m=m.getChildAtPos(i)}u!=null&&p(u)}),u}}getOriginalTextSpan(){let{originalTextSpan:r}=this.compilerObject;return r==null?void 0:new wD(r)}getOriginalFileName(){return this.compilerObject.originalFileName}};co([b.Memoize],dv.prototype,"getTextSpan",null);co([b.Memoize],dv.prototype,"getNode",null);co([b.Memoize],dv.prototype,"getOriginalTextSpan",null);var FD=class extends dv{constructor(r,n){super(r,n),this.getSourceFile()._doActionPreNextModification(()=>this.getDeclarationNode())}getKind(){return this.compilerObject.kind}getName(){return this.compilerObject.name}getContainerKind(){return this.compilerObject.containerKind}getContainerName(){return this.compilerObject.containerName}getDeclarationNode(){if(this.getKind()==="module"&&this.getTextSpan().getLength()===this.getSourceFile().getFullWidth())return this.getSourceFile();let r=this.getTextSpan().getStart(),n=i(this.getSourceFile());return n?.getParentOrThrow();function i(a){if(a.getKind()===b.SyntaxKind.Identifier&&a.getStart()===r)return a;for(let s of a._getChildrenIterator())if(s.getPos()<=r&&s.getEnd()>r)return i(s)}}};co([b.Memoize],FD.prototype,"getDeclarationNode",null);var pS=class{constructor(r){this._compilerObject=r}get compilerObject(){return this._compilerObject}getMessageText(){return this.compilerObject.messageText}getNext(){let r=this.compilerObject.next;if(r!=null)return r instanceof Array?r.map(n=>new pS(n)):[new pS(r)]}getCode(){return this.compilerObject.code}getCategory(){return this.compilerObject.category}},WT=class{constructor(r,n){this._context=r,this._compilerObject=n,this.getSourceFile()}get compilerObject(){return this._compilerObject}getSourceFile(){if(this._context==null)return;let r=this.compilerObject.file;return r==null?void 0:this._context.compilerFactory.getSourceFile(r,{markInProject:!1})}getMessageText(){let r=this._compilerObject.messageText;return typeof r=="string"?r:this._context==null?new pS(r):this._context.compilerFactory.getDiagnosticMessageChain(r)}getLineNumber(){let r=this.getSourceFile(),n=this.getStart();if(!(r==null||n==null))return b.StringUtils.getLineNumberAtPos(r.getFullText(),n)}getStart(){return this.compilerObject.start}getLength(){return this.compilerObject.length}getCategory(){return this.compilerObject.category}getCode(){return this.compilerObject.code}getSource(){return this.compilerObject.source}};co([b.Memoize],WT.prototype,"getSourceFile",null);var fL=class extends WT{constructor(r,n){super(r,n)}getLineNumber(){return super.getLineNumber()}getStart(){return super.getStart()}getLength(){return super.getLength()}getSourceFile(){return super.getSourceFile()}},R6=class{constructor(r,n){this._compilerObject=n,this._context=r}get compilerObject(){return this._compilerObject}getFilePath(){return this._context.fileSystemWrapper.getStandardizedAbsolutePath(this.compilerObject.name)}getWriteByteOrderMark(){return this.compilerObject.writeByteOrderMark||!1}getText(){return this.compilerObject.text}},pL=class{constructor(r,n){this._context=r,this._compilerObject=n}get compilerObject(){return this._compilerObject}getEmitSkipped(){return this.compilerObject.emitSkipped}getOutputFiles(){return this.compilerObject.outputFiles.map(r=>new R6(this._context,r))}};co([b.Memoize],pL.prototype,"getOutputFiles",null);var VT=class{constructor(r,n){this._context=r,this._compilerObject=n,this.getDiagnostics()}get compilerObject(){return this._compilerObject}getEmitSkipped(){return this.compilerObject.emitSkipped}getDiagnostics(){return this.compilerObject.diagnostics.map(r=>this._context.compilerFactory.getDiagnostic(r))}};co([b.Memoize],VT.prototype,"getDiagnostics",null);var mL=class extends dv{constructor(r,n){super(r,n)}getKind(){return this.compilerObject.kind}getDisplayParts(){return this.compilerObject.displayParts.map(r=>this._context.compilerFactory.getSymbolDisplayPart(r))}};co([b.Memoize],mL.prototype,"getDisplayParts",null);var M6=class extends VT{constructor(r,n,i){super(r,n),this._files=i}getFiles(){return this._files}saveFiles(){let r=this._context.fileSystemWrapper,n=this._files.map(i=>r.writeFile(i.filePath,i.writeByteOrderMark?"\uFEFF"+i.text:i.text));return Promise.all(n)}saveFilesSync(){let r=this._context.fileSystemWrapper;for(let n of this._files)r.writeFileSync(n.filePath,n.writeByteOrderMark?"\uFEFF"+n.text:n.text)}},_L=class{constructor(r,n){this._context=r,this._compilerObject=n}get compilerObject(){return this._compilerObject}getEdits(){return this.compilerObject.edits.map(r=>new fS(this._context,r))}getRenameFilePath(){return this.compilerObject.renameFilename}getRenameLocation(){return this.compilerObject.renameLocation}applyChanges(r){for(let n of this.getEdits())n.applyChanges(r);return this}};co([b.Memoize],_L.prototype,"getEdits",null);var gL=class{constructor(r,n){this._context=r,this._compilerObject=n,this._references=this.compilerObject.references.map(i=>r.compilerFactory.getReferencedSymbolEntry(i))}get compilerObject(){return this._compilerObject}getDefinition(){return this._context.compilerFactory.getReferencedSymbolDefinitionInfo(this.compilerObject.definition)}getReferences(){return this._references}};co([b.Memoize],gL.prototype,"getDefinition",null);var yL=class extends FD{constructor(r,n){super(r,n)}getDisplayParts(){return this.compilerObject.displayParts.map(r=>this._context.compilerFactory.getSymbolDisplayPart(r))}};co([b.Memoize],yL.prototype,"getDisplayParts",null);var w6=class extends dv{constructor(r,n){super(r,n)}isWriteAccess(){return this.compilerObject.isWriteAccess}isInString(){return this.compilerObject.isInString}},F6=class extends w6{constructor(r,n){super(r,n)}isDefinition(){return this.compilerObject.isDefinition}},G6=class extends dv{getPrefixText(){return this._compilerObject.prefixText}getSuffixText(){return this._compilerObject.suffixText}},B6=class{constructor(r){this._compilerObject=r}get compilerObject(){return this._compilerObject}getText(){return this.compilerObject.text}getKind(){return this.compilerObject.kind}},vL=class{constructor(r){this._context=r}get compilerObject(){return this._getCompilerObject()}_reset(r){this._getCompilerObject=r}getAmbientModules(){return this.compilerObject.getAmbientModules().map(r=>this._context.compilerFactory.getSymbol(r))}getApparentType(r){return this._context.compilerFactory.getType(this.compilerObject.getApparentType(r.compilerType))}getConstantValue(r){return this.compilerObject.getConstantValue(r.compilerNode)}getFullyQualifiedName(r){return this.compilerObject.getFullyQualifiedName(r.compilerSymbol)}getTypeAtLocation(r){return this._context.compilerFactory.getType(this.compilerObject.getTypeAtLocation(r.compilerNode))}getContextualType(r){let n=this.compilerObject.getContextualType(r.compilerNode);return n==null?void 0:this._context.compilerFactory.getType(n)}getTypeOfSymbolAtLocation(r,n){return this._context.compilerFactory.getType(this.compilerObject.getTypeOfSymbolAtLocation(r.compilerSymbol,n.compilerNode))}getDeclaredTypeOfSymbol(r){return this._context.compilerFactory.getType(this.compilerObject.getDeclaredTypeOfSymbol(r.compilerSymbol))}getSymbolAtLocation(r){let n=this.compilerObject.getSymbolAtLocation(r.compilerNode);return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getAliasedSymbol(r){if(!r.hasFlags(b.SymbolFlags.Alias))return;let n=this.compilerObject.getAliasedSymbol(r.compilerSymbol);return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getImmediatelyAliasedSymbol(r){let n=this.compilerObject.getImmediateAliasedSymbol(r.compilerSymbol);return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getExportSymbolOfSymbol(r){return this._context.compilerFactory.getSymbol(this.compilerObject.getExportSymbolOfSymbol(r.compilerSymbol))}getPropertiesOfType(r){return this.compilerObject.getPropertiesOfType(r.compilerType).map(n=>this._context.compilerFactory.getSymbol(n))}getTypeText(r,n,i){return i==null&&(i=this._getDefaultTypeFormatFlags(n)),this.compilerObject.typeToString(r.compilerType,n?.compilerNode,i)}getReturnTypeOfSignature(r){return this._context.compilerFactory.getType(this.compilerObject.getReturnTypeOfSignature(r.compilerSignature))}getSignatureFromNode(r){let n=this.compilerObject.getSignatureFromDeclaration(r.compilerNode);return n==null?void 0:this._context.compilerFactory.getSignature(n)}getExportsOfModule(r){return(this.compilerObject.getExportsOfModule(r.compilerSymbol)||[]).map(i=>this._context.compilerFactory.getSymbol(i))}getExportSpecifierLocalTargetSymbol(r){let n=this.compilerObject.getExportSpecifierLocalTargetSymbol(r.compilerNode);return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getResolvedSignature(r){let n=this.compilerObject.getResolvedSignature(r.compilerNode);if(!(!n||!n.declaration))return this._context.compilerFactory.getSignature(n)}getResolvedSignatureOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getResolvedSignature(r),"Signature could not be resolved.")}getBaseTypeOfLiteralType(r){return this._context.compilerFactory.getType(this.compilerObject.getBaseTypeOfLiteralType(r.compilerType))}getSymbolsInScope(r,n){return this.compilerObject.getSymbolsInScope(r.compilerNode,n).map(i=>this._context.compilerFactory.getSymbol(i))}getTypeArguments(r){return this.compilerObject.getTypeArguments(r.compilerType).map(n=>this._context.compilerFactory.getType(n))}_getDefaultTypeFormatFlags(r){let n=b.TypeFormatFlags.UseTypeOfFunction|b.TypeFormatFlags.NoTruncation|b.TypeFormatFlags.UseFullyQualifiedType|b.TypeFormatFlags.WriteTypeArgumentsOfSignature;return r!=null&&r.getKind()===b.SyntaxKind.TypeAliasDeclaration&&(n|=b.TypeFormatFlags.InTypeAlias),n}},U6=class{constructor(r){this._context=r.context,this._configFileParsingDiagnostics=r.configFileParsingDiagnostics,this._typeChecker=new vL(this._context),this._reset(r.rootNames,r.host)}get compilerObject(){return this._getOrCreateCompilerObject()}_isCompilerProgramCreated(){return this._createdCompilerObject!=null}_reset(r,n){let i=this._context.compilerOptions.get();this._getOrCreateCompilerObject=()=>(this._createdCompilerObject==null&&(this._createdCompilerObject=b.ts.createProgram(r,i,n,this._oldProgram,this._configFileParsingDiagnostics),delete this._oldProgram),this._createdCompilerObject),this._createdCompilerObject!=null&&(this._oldProgram=this._createdCompilerObject,delete this._createdCompilerObject),this._typeChecker._reset(()=>this.compilerObject.getTypeChecker())}getTypeChecker(){return this._typeChecker}async emit(r={}){if(r.writeFile){let s=`Cannot specify a ${b.nameof(r,"writeFile")} option when emitting asynchrously. Use ${b.nameof(this,"emitSync")}() instead.`;throw new b.errors.InvalidOperationError(s)}let{fileSystemWrapper:n}=this._context,i=[],a=this._emit({writeFile:(s,u,p)=>{i.push(n.writeFile(n.getStandardizedAbsolutePath(s),p?"\uFEFF"+u:u))},...r});return await Promise.all(i),new VT(this._context,a)}emitSync(r={}){return new VT(this._context,this._emit(r))}emitToMemory(r={}){let n=[],{fileSystemWrapper:i}=this._context,a=this._emit({writeFile:(s,u,p)=>{n.push({filePath:i.getStandardizedAbsolutePath(s),text:u,writeByteOrderMark:p||!1})},...r});return new M6(this._context,a,n)}_emit(r={}){let n=r.targetSourceFile!=null?r.targetSourceFile.compilerNode:void 0,{emitOnlyDtsFiles:i,customTransformers:a,writeFile:s}=r,u=void 0;return this.compilerObject.emit(n,s,u,i,a)}getSyntacticDiagnostics(r){return this.compilerObject.getSyntacticDiagnostics(r?.compilerNode).map(i=>this._context.compilerFactory.getDiagnosticWithLocation(i))}getSemanticDiagnostics(r){return this.compilerObject.getSemanticDiagnostics(r?.compilerNode).map(i=>this._context.compilerFactory.getDiagnostic(i))}getDeclarationDiagnostics(r){return this.compilerObject.getDeclarationDiagnostics(r?.compilerNode).map(i=>this._context.compilerFactory.getDiagnosticWithLocation(i))}getGlobalDiagnostics(){return this.compilerObject.getGlobalDiagnostics().map(n=>this._context.compilerFactory.getDiagnostic(n))}getConfigFileParsingDiagnostics(){return this.compilerObject.getConfigFileParsingDiagnostics().map(n=>this._context.compilerFactory.getDiagnostic(n))}getEmitModuleResolutionKind(){return b.getEmitModuleResolutionKind(this.compilerObject.getCompilerOptions())}isSourceFileFromExternalLibrary(r){return r.isFromExternalLibrary()}},K6=class{constructor(r){var n;this._projectVersion=0,this._context=r.context;let{languageServiceHost:i,compilerHost:a}=b.createHosts({transactionalFileSystem:this._context.fileSystemWrapper,sourceFileContainer:this._context.getSourceFileContainer(),compilerOptions:this._context.compilerOptions,getNewLine:()=>this._context.manipulationSettings.getNewLineKindAsString(),getProjectVersion:()=>`${this._projectVersion}`,resolutionHost:(n=r.resolutionHost)!==null&&n!==void 0?n:{},libFolderPath:r.libFolderPath,skipLoadingLibFiles:r.skipLoadingLibFiles});this._compilerHost=a,this._compilerObject=b.ts.createLanguageService(i,this._context.compilerFactory.documentRegistry),this._program=new U6({context:this._context,rootNames:Array.from(this._context.compilerFactory.getSourceFilePaths()),host:this._compilerHost,configFileParsingDiagnostics:r.configFileParsingDiagnostics}),this._context.compilerFactory.onSourceFileAdded(s=>{s._isInProject()&&this._reset()}),this._context.compilerFactory.onSourceFileRemoved(()=>this._reset())}get compilerObject(){return this._compilerObject}_reset(){this._projectVersion+=1,this._program._reset(Array.from(this._context.compilerFactory.getSourceFilePaths()),this._compilerHost)}getProgram(){return this._program}getDefinitions(r){return this.getDefinitionsAtPosition(r._sourceFile,r.getStart())}getDefinitionsAtPosition(r,n){return(this.compilerObject.getDefinitionAtPosition(r.getFilePath(),n)||[]).map(a=>this._context.compilerFactory.getDefinitionInfo(a))}getImplementations(r){return this.getImplementationsAtPosition(r._sourceFile,r.getStart())}getImplementationsAtPosition(r,n){return(this.compilerObject.getImplementationAtPosition(r.getFilePath(),n)||[]).map(a=>new mL(this._context,a))}findReferences(r){return this.findReferencesAtPosition(r._sourceFile,r.getStart())}findReferencesAsNodes(r){let n=this.findReferences(r);return Array.from(i());function*i(){for(let a of n){let s=a.getDefinition().getKind()===b.ts.ScriptElementKind.alias,u=a.getReferences();for(let p=0;p<u.length;p++){let f=u[p];(s||!f.isDefinition()||p>0)&&(yield f.getNode())}}}}findReferencesAtPosition(r,n){return(this.compilerObject.findReferences(r.getFilePath(),n)||[]).map(a=>this._context.compilerFactory.getReferencedSymbol(a))}findRenameLocations(r,n={}){let i=n.usePrefixAndSuffixText==null?this._context.manipulationSettings.getUsePrefixAndSuffixTextForRename():n.usePrefixAndSuffixText;return(this.compilerObject.findRenameLocations(r._sourceFile.getFilePath(),r.getStart(),n.renameInStrings||!1,n.renameInComments||!1,i)||[]).map(s=>new G6(this._context,s))}getSuggestionDiagnostics(r){let n=this._getFilePathFromFilePathOrSourceFile(r);return this.compilerObject.getSuggestionDiagnostics(n).map(a=>this._context.compilerFactory.getDiagnosticWithLocation(a))}getFormattingEditsForRange(r,n,i){return(this.compilerObject.getFormattingEditsForRange(r,n[0],n[1],this._getFilledSettings(i))||[]).map(a=>new FE(a))}getFormattingEditsForDocument(r,n){let i=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r);return(this.compilerObject.getFormattingEditsForDocument(i,this._getFilledSettings(n))||[]).map(a=>new FE(a))}getFormattedDocumentText(r,n){let i=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),a=this._context.compilerFactory.getSourceFileFromCacheFromFilePath(i);if(a==null)throw new b.errors.FileNotFoundError(i);n=this._getFilledSettings(n);let s=this.getFormattingEditsForDocument(i,n),u=jH(a,s),p=n.newLineCharacter;return n.ensureNewLineAtEndOfFile&&!u.endsWith(p)&&(u+=p),u.replace(/\r?\n/g,p)}getEmitOutput(r,n){let i=this._getFilePathFromFilePathOrSourceFile(r),a=this.compilerObject;return new pL(this._context,s());function s(){let u=a.getProgram();return u==null||u.getSourceFile(i)==null?{emitSkipped:!0,outputFiles:[]}:a.getEmitOutput(i,n)}}getIdentationAtPosition(r,n,i){let a=this._getFilePathFromFilePathOrSourceFile(r);return i==null?i=this._context.manipulationSettings.getEditorSettings():VH(i,this._context.manipulationSettings),this.compilerObject.getIndentationAtPosition(a,n,i)}organizeImports(r,n={},i={}){let a={type:"file",fileName:this._getFilePathFromFilePathOrSourceFile(r)};return this.compilerObject.organizeImports(a,this._getFilledSettings(n),this._getFilledUserPreferences(i)).map(s=>new fS(this._context,s))}getEditsForRefactor(r,n,i,a,s,u={}){let p=this._getFilePathFromFilePathOrSourceFile(r),f=typeof i=="number"?i:{pos:i.getPos(),end:i.getEnd()},m=this.compilerObject.getEditsForRefactor(p,this._getFilledSettings(n),f,a,s,this._getFilledUserPreferences(u));return m!=null?new _L(this._context,m):void 0}getCombinedCodeFix(r,n,i={},a={}){let s=this.compilerObject.getCombinedCodeFix({type:"file",fileName:this._getFilePathFromFilePathOrSourceFile(r)},n,this._getFilledSettings(i),this._getFilledUserPreferences(a||{}));return new dL(this._context,s)}getCodeFixesAtPosition(r,n,i,a,s={},u={}){let p=this._getFilePathFromFilePathOrSourceFile(r);return this.compilerObject.getCodeFixesAtPosition(p,n,i,a,this._getFilledSettings(s),this._getFilledUserPreferences(u||{})).map(m=>new k6(this._context,m))}_getFilePathFromFilePathOrSourceFile(r){let n=typeof r=="string"?this._context.fileSystemWrapper.getStandardizedAbsolutePath(r):r.getFilePath();if(!this._context.compilerFactory.containsSourceFileAtPath(n))throw new b.errors.FileNotFoundError(n);return n}_getFilledSettings(r){return r._filled||(r=Object.assign(this._context.getFormatCodeSettings(),r),RBe(r,this._context.manipulationSettings),r._filled=!0),r}_getFilledUserPreferences(r){return Object.assign(this._context.getUserPreferences(),r)}},hL=class{constructor(r,n){this._context=r,this._compilerType=n}get compilerType(){return this._compilerType}getText(r,n){return this._context.typeChecker.getTypeText(this,r,n)}getAliasSymbol(){return this.compilerType.aliasSymbol==null?void 0:this._context.compilerFactory.getSymbol(this.compilerType.aliasSymbol)}getAliasSymbolOrThrow(){return b.errors.throwIfNullOrUndefined(this.getAliasSymbol(),"Expected to find an alias symbol.")}getAliasTypeArguments(){return(this.compilerType.aliasTypeArguments||[]).map(n=>this._context.compilerFactory.getType(n))}getApparentType(){return this._context.typeChecker.getApparentType(this)}getArrayElementTypeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getArrayElementType(),"Expected to find an array element type.")}getArrayElementType(){if(!!this.isArray())return this.getTypeArguments()[0]}getBaseTypes(){return(this.compilerType.getBaseTypes()||[]).map(n=>this._context.compilerFactory.getType(n))}getBaseTypeOfLiteralType(){return this._context.typeChecker.getBaseTypeOfLiteralType(this)}getCallSignatures(){return this.compilerType.getCallSignatures().map(r=>this._context.compilerFactory.getSignature(r))}getConstructSignatures(){return this.compilerType.getConstructSignatures().map(r=>this._context.compilerFactory.getSignature(r))}getConstraintOrThrow(){return b.errors.throwIfNullOrUndefined(this.getConstraint(),"Expected to find a constraint.")}getConstraint(){let r=this.compilerType.getConstraint();return r==null?void 0:this._context.compilerFactory.getType(r)}getDefaultOrThrow(){return b.errors.throwIfNullOrUndefined(this.getDefault(),"Expected to find a default type.")}getDefault(){let r=this.compilerType.getDefault();return r==null?void 0:this._context.compilerFactory.getType(r)}getProperties(){return this.compilerType.getProperties().map(r=>this._context.compilerFactory.getSymbol(r))}getPropertyOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getProperty(r),()=>Ou("symbol property",r))}getProperty(r){return Qde(this.getProperties(),r)}getApparentProperties(){return this.compilerType.getApparentProperties().map(r=>this._context.compilerFactory.getSymbol(r))}getApparentProperty(r){return Qde(this.getApparentProperties(),r)}isNullable(){return this.getUnionTypes().some(r=>r.isNull()||r.isUndefined())}getNonNullableType(){return this._context.compilerFactory.getType(this.compilerType.getNonNullableType())}getNumberIndexType(){let r=this.compilerType.getNumberIndexType();return r==null?void 0:this._context.compilerFactory.getType(r)}getStringIndexType(){let r=this.compilerType.getStringIndexType();return r==null?void 0:this._context.compilerFactory.getType(r)}getTargetType(){let r=this.compilerType.target||void 0;return r==null?void 0:this._context.compilerFactory.getType(r)}getTargetTypeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getTargetType(),"Expected to find the target type.")}getTypeArguments(){return this._context.typeChecker.getTypeArguments(this)}getTupleElements(){return this.isTuple()?this.getTypeArguments():[]}getUnionTypes(){return this.isUnion()?this.compilerType.types.map(r=>this._context.compilerFactory.getType(r)):[]}getIntersectionTypes(){return this.isIntersection()?this.compilerType.types.map(r=>this._context.compilerFactory.getType(r)):[]}getLiteralValue(){var r;return(r=this.compilerType)===null||r===void 0?void 0:r.value}getLiteralValueOrThrow(){return b.errors.throwIfNullOrUndefined(this.getLiteralValue(),"Type was not a literal type.")}getLiteralFreshType(){var r;let n=(r=this.compilerType)===null||r===void 0?void 0:r.freshType;return n==null?void 0:this._context.compilerFactory.getType(n)}getLiteralFreshTypeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getLiteralFreshType(),"Type was not a literal type.")}getLiteralRegularType(){var r;let n=(r=this.compilerType)===null||r===void 0?void 0:r.regularType;return n==null?void 0:this._context.compilerFactory.getType(n)}getLiteralRegularTypeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getLiteralRegularType(),"Type was not a literal type.")}getSymbol(){let r=this.compilerType.getSymbol();return r==null?void 0:this._context.compilerFactory.getSymbol(r)}getSymbolOrThrow(){return b.errors.throwIfNullOrUndefined(this.getSymbol(),"Expected to find a symbol.")}isAnonymous(){return this._hasObjectFlag(b.ObjectFlags.Anonymous)}isAny(){return this._hasTypeFlag(b.TypeFlags.Any)}isNever(){return this._hasTypeFlag(b.TypeFlags.Never)}isArray(){let r=this.getSymbol();return r==null?!1:(r.getName()==="Array"||r.getName()==="ReadonlyArray")&&this.getTypeArguments().length===1}isReadonlyArray(){let r=this.getSymbol();return r==null?!1:r.getName()==="ReadonlyArray"&&this.getTypeArguments().length===1}isTemplateLiteral(){return this._hasTypeFlag(b.TypeFlags.TemplateLiteral)}isBoolean(){return this._hasTypeFlag(b.TypeFlags.Boolean)}isString(){return this._hasTypeFlag(b.TypeFlags.String)}isNumber(){return this._hasTypeFlag(b.TypeFlags.Number)}isLiteral(){let r=this.isBooleanLiteral();return this.compilerType.isLiteral()||r}isBooleanLiteral(){return this._hasTypeFlag(b.TypeFlags.BooleanLiteral)}isEnumLiteral(){return this._hasTypeFlag(b.TypeFlags.EnumLiteral)&&!this.isUnion()}isNumberLiteral(){return this._hasTypeFlag(b.TypeFlags.NumberLiteral)}isStringLiteral(){return this.compilerType.isStringLiteral()}isClass(){return this.compilerType.isClass()}isClassOrInterface(){return this.compilerType.isClassOrInterface()}isEnum(){if(this._hasTypeFlag(b.TypeFlags.Enum))return!0;if(this.isEnumLiteral()&&!this.isUnion())return!1;let n=this.getSymbol();if(n==null)return!1;let i=n.getValueDeclaration();return i!=null&&Tr.isEnumDeclaration(i)}isInterface(){return this._hasObjectFlag(b.ObjectFlags.Interface)}isObject(){return this._hasTypeFlag(b.TypeFlags.Object)}isTypeParameter(){return this.compilerType.isTypeParameter()}isTuple(){let r=this.getTargetType();return r==null?!1:r._hasObjectFlag(b.ObjectFlags.Tuple)}isUnion(){return this.compilerType.isUnion()}isIntersection(){return this.compilerType.isIntersection()}isUnionOrIntersection(){return this.compilerType.isUnionOrIntersection()}isUnknown(){return this._hasTypeFlag(b.TypeFlags.Unknown)}isNull(){return this._hasTypeFlag(b.TypeFlags.Null)}isUndefined(){return this._hasTypeFlag(b.TypeFlags.Undefined)}getFlags(){return this.compilerType.flags}getObjectFlags(){return this.isObject()&&this.compilerType.objectFlags||0}_hasTypeFlag(r){return(this.compilerType.flags&r)===r}_hasObjectFlag(r){return(this.getObjectFlags()&r)===r}},W6=class extends hL{getConstraintOrThrow(){return b.errors.throwIfNullOrUndefined(this.getConstraint(),"Expected type parameter to have a constraint.")}getConstraint(){let r=this._getTypeParameterDeclaration();if(r==null)return;let n=r.getConstraint();if(n!=null)return this._context.typeChecker.getTypeAtLocation(n)}getDefaultOrThrow(){return b.errors.throwIfNullOrUndefined(this.getDefault(),"Expected type parameter to have a default type.")}getDefault(){let r=this._getTypeParameterDeclaration();if(r==null)return;let n=r.getDefault();if(n!=null)return this._context.typeChecker.getTypeAtLocation(n)}_getTypeParameterDeclaration(){let r=this.getSymbol();if(r==null)return;let n=r.getDeclarations()[0];if(n!=null&&!!Tr.isTypeParameterDeclaration(n))return n}},EL=class{constructor(r,n){this._skippedFilePaths=r,this._outputFilePaths=n}getSkippedFilePaths(){return this._skippedFilePaths}getOutputFilePaths(){return this._outputFilePaths}},OE=class{constructor(r,n){this.__context=r,this._setPathInternal(n)}_setPathInternal(r){this._path=r,this._pathParts=r.split("/").filter(n=>n.length>0)}get _context(){return this._throwIfDeletedOrRemoved(),this.__context}isAncestorOf(r){return OE._isAncestorOfDir(this,r)}isDescendantOf(r){return OE._isAncestorOfDir(r,this)}_getDepth(){return this._pathParts.length}getPath(){return this._throwIfDeletedOrRemoved(),this._path}getBaseName(){return this._pathParts[this._pathParts.length-1]}getParentOrThrow(){return b.errors.throwIfNullOrUndefined(this.getParent(),()=>`Parent directory of ${this.getPath()} does not exist or was never added.`)}getParent(){if(!b.FileUtils.isRootDirPath(this.getPath()))return this.addDirectoryAtPathIfExists(b.FileUtils.getDirPath(this.getPath()))}getDirectoryOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getDirectory(r),()=>typeof r=="string"?`Could not find a directory at path '${this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath())}'.`:"Could not find child directory that matched condition.")}getDirectory(r){if(typeof r=="string"){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.compilerFactory.getDirectoryFromCache(n)}return this.getDirectories().find(r)}getSourceFileOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getSourceFile(r),()=>typeof r=="string"?`Could not find child source file at path '${this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath())}'.`:"Could not find child source file that matched condition.")}getSourceFile(r){if(typeof r=="string"){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.compilerFactory.getSourceFileFromCacheFromFilePath(n)}for(let n of this._getSourceFilesIterator())if(r(n))return n}getDirectories(){return Array.from(this._getDirectoriesIterator())}_getDirectoriesIterator(){return this._context.compilerFactory.getChildDirectoriesOfDirectory(this.getPath())}getSourceFiles(r){let{compilerFactory:n,fileSystemWrapper:i}=this._context,a=this;if(typeof r=="string"||r instanceof Array){let u=typeof r=="string"?[r]:r;return Array.from(s(u))}else return Array.from(this._getSourceFilesIterator());function*s(u){let p=Array.from(m()),f=b.matchGlobs(p,u,a.getPath());for(let g of f)yield n.getSourceFileFromCacheFromFilePath(i.getStandardizedAbsolutePath(g));function*m(){for(let g of a._getDescendantSourceFilesIterator())yield g.getFilePath()}}}_getSourceFilesIterator(){return this._context.compilerFactory.getChildSourceFilesOfDirectory(this.getPath())}getDescendantSourceFiles(){return Array.from(this._getDescendantSourceFilesIterator())}*_getDescendantSourceFilesIterator(){for(let r of this._getSourceFilesIterator())yield r;for(let r of this._getDirectoriesIterator())yield*r._getDescendantSourceFilesIterator()}getDescendantDirectories(){return Array.from(this._getDescendantDirectoriesIterator())}*_getDescendantDirectoriesIterator(){for(let r of this.getDirectories())yield r,yield*r._getDescendantDirectoriesIterator()}addSourceFilesAtPaths(r){return r=typeof r=="string"?[r]:r,r=r.map(n=>b.FileUtils.pathIsAbsolute(n)?n:b.FileUtils.pathJoin(this.getPath(),n)),this._context.directoryCoordinator.addSourceFilesAtPaths(r,{markInProject:this._isInProject()})}addDirectoryAtPathIfExists(r,n={}){let i=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.directoryCoordinator.addDirectoryAtPathIfExists(i,{...n,markInProject:this._isInProject()})}addDirectoryAtPath(r,n={}){let i=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.directoryCoordinator.addDirectoryAtPath(i,{...n,markInProject:this._isInProject()})}createDirectory(r){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.directoryCoordinator.createDirectoryOrAddIfExists(n,{markInProject:this._isInProject()})}createSourceFile(r,n,i){let a=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.compilerFactory.createSourceFile(a,n||"",{...i||{},markInProject:this._isInProject()})}addSourceFileAtPathIfExists(r){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.directoryCoordinator.addSourceFileAtPathIfExists(n,{markInProject:this._isInProject()})}addSourceFileAtPath(r){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.directoryCoordinator.addSourceFileAtPath(n,{markInProject:this._isInProject()})}async emit(r={}){let{fileSystemWrapper:n}=this._context,i=[],a=[],s=[];for(let u of this._emitInternal(r))Nfe(u)?s.push(u):(i.push(n.writeFile(u.filePath,u.fileText)),a.push(u.filePath));return await Promise.all(i),new EL(s,a)}emitSync(r={}){let{fileSystemWrapper:n}=this._context,i=[],a=[];for(let s of this._emitInternal(r))Nfe(s)?a.push(s):(n.writeFileSync(s.filePath,s.fileText),i.push(s.filePath));return new EL(a,i)}_emitInternal(r={}){let{emitOnlyDtsFiles:n=!1}=r,i=r.outDir==null?void 0:/\.js$/i,a=r.outDir==null?void 0:/\.js\.map$/i,s=r.declarationDir==null&&r.outDir==null?void 0:/\.d\.ts$/i,u=g=>g==null?void 0:this._context.fileSystemWrapper.getStandardizedAbsolutePath(g,this.getPath()),p=(g,D)=>g==null?void 0:b.FileUtils.pathJoin(g,D.getBaseName()),f=this._context.compilerOptions.get().declarationDir!=null||r.declarationDir!=null;return m(this,u(r.outDir),u(r.declarationDir));function*m(g,D,P){for(let B of g.getSourceFiles()){let K=B.getEmitOutput({emitOnlyDtsFiles:n});if(K.getEmitSkipped()){yield B.getFilePath();continue}for(let h of K.getOutputFiles()){let S=h.getFilePath(),U=h.getWriteByteOrderMark()?b.FileUtils.getTextWithByteOrderMark(h.getText()):h.getText();D!=null&&(i.test(S)||a.test(S)||!f&&s.test(S))?S=b.FileUtils.pathJoin(D,b.FileUtils.getBaseName(S)):P!=null&&s.test(S)&&(S=b.FileUtils.pathJoin(P,b.FileUtils.getBaseName(S))),yield{filePath:S,fileText:U}}}for(let B of g.getDirectories())yield*m(B,p(D,B),p(P,B))}}copyToDirectory(r,n){let i=typeof r=="string"?r:r.getPath();return this.copy(b.FileUtils.pathJoin(i,this.getBaseName()),n)}copy(r,n){let i=this.getPath(),a=this._context.fileSystemWrapper,s=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return i===s?this:(n=oj(n),n.includeUntrackedFiles&&a.queueCopyDirectory(i,s),this._copyInternal(s,n))}async copyImmediately(r,n){let i=this._context.fileSystemWrapper,a=this.getPath(),s=i.getStandardizedAbsolutePath(r,a);if(a===s)return await this.save(),this;n=oj(n);let u=this._copyInternal(s,n);return n.includeUntrackedFiles&&await i.copyDirectoryImmediately(a,s),await u.save(),u}copyImmediatelySync(r,n){let i=this._context.fileSystemWrapper,a=this.getPath(),s=i.getStandardizedAbsolutePath(r,a);if(a===s)return this.saveSync(),this;n=oj(n);let u=this._copyInternal(s,n);return n.includeUntrackedFiles&&i.copyDirectoryImmediatelySync(a,s),u.saveSync(),u}_copyInternal(r,n){if(this.getPath()===r)return this;let{fileSystemWrapper:a,compilerFactory:s}=this._context,u=[this,...this.getDescendantDirectories()].map(f=>({newDirPath:f===this?r:a.getStandardizedAbsolutePath(this.getRelativePathTo(f),r)})),p=this.getDescendantSourceFiles().map(f=>({sourceFile:f,newFilePath:a.getStandardizedAbsolutePath(this.getRelativePathTo(f),r),references:this._getReferencesForCopy(f)}));for(let{newDirPath:f}of u)this._context.compilerFactory.createDirectoryOrAddIfExists(f,{markInProject:this._isInProject()});for(let{sourceFile:f,newFilePath:m}of p)f._copyInternal(m,n);for(let{references:f,newFilePath:m}of p)this.getSourceFileOrThrow(m)._updateReferencesForCopyInternal(f);return s.getDirectoryFromCache(r)}moveToDirectory(r,n){let i=typeof r=="string"?r:r.getPath();return this.move(b.FileUtils.pathJoin(i,this.getBaseName()),n)}move(r,n){let i=this._context.fileSystemWrapper,a=this.getPath(),s=i.getStandardizedAbsolutePath(r,a);return a===s?this:this._moveInternal(s,n,()=>i.queueMoveDirectory(a,s))}async moveImmediately(r,n){let i=this._context.fileSystemWrapper,a=this.getPath(),s=i.getStandardizedAbsolutePath(r,a);return a===s?(await this.save(),this):(this._moveInternal(s,n),await i.moveDirectoryImmediately(a,s),await this.save(),this)}moveImmediatelySync(r,n){let i=this._context.fileSystemWrapper,a=this.getPath(),s=i.getStandardizedAbsolutePath(r,a);return a===s?(this.saveSync(),this):(this._moveInternal(s,n),i.moveDirectoryImmediatelySync(a,s),this.saveSync(),this)}_moveInternal(r,n,i){let a=this.getPath();if(a===r)return this;let s=this._context.compilerFactory.getDirectoryFromCacheOnlyIfInCache(r),u=s!=null&&s._isInProject();i&&i();let p=this._context.fileSystemWrapper,f=this._context.compilerFactory,m=[this,...this.getDescendantDirectories()].map(D=>({directory:D,oldPath:D.getPath(),newDirPath:D===this?r:p.getStandardizedAbsolutePath(this.getRelativePathTo(D),r)})),g=this.getDescendantSourceFiles().map(D=>({sourceFile:D,newFilePath:p.getStandardizedAbsolutePath(this.getRelativePathTo(D),r),references:this._getReferencesForMove(D)}));for(let{directory:D,oldPath:P,newDirPath:B}of m){f.removeDirectoryFromCache(P);let K=f.getDirectoryFromCache(B);K?._forgetOnlyThis(),D._setPathInternal(B),f.addDirectoryToCache(D)}for(let{sourceFile:D,newFilePath:P}of g)D._moveInternal(P,n);for(let{sourceFile:D,references:P}of g)D._updateReferencesForMoveInternal(P,a);return u&&this._markAsInProject(),this}clear(){let r=this.getPath();this._deleteDescendants(),this._context.fileSystemWrapper.queueDirectoryDelete(r),this._context.fileSystemWrapper.queueMkdir(r)}async clearImmediately(){let r=this.getPath();this._deleteDescendants(),await this._context.fileSystemWrapper.clearDirectoryImmediately(r)}clearImmediatelySync(){let r=this.getPath();this._deleteDescendants(),this._context.fileSystemWrapper.clearDirectoryImmediatelySync(r)}delete(){let r=this.getPath();this._deleteDescendants(),this._context.fileSystemWrapper.queueDirectoryDelete(r),this.forget()}_deleteDescendants(){for(let r of this.getSourceFiles())r.delete();for(let r of this.getDirectories())r.delete()}async deleteImmediately(){let{fileSystemWrapper:r}=this._context,n=this.getPath();this.forget(),await r.deleteDirectoryImmediately(n)}deleteImmediatelySync(){let{fileSystemWrapper:r}=this._context,n=this.getPath();this.forget(),r.deleteDirectoryImmediatelySync(n)}forget(){if(!this.wasForgotten()){for(let r of this.getSourceFiles())r.forget();for(let r of this.getDirectories())r.forget();this._forgetOnlyThis()}}_forgetOnlyThis(){this.wasForgotten()||(this._context.compilerFactory.removeDirectoryFromCache(this.getPath()),this.__context=void 0)}async save(){await this._context.fileSystemWrapper.saveForDirectory(this.getPath());let r=this.getDescendantSourceFiles().filter(n=>!n.isSaved());await Promise.all(r.map(n=>n.save()))}saveSync(){this._context.fileSystemWrapper.saveForDirectorySync(this.getPath()),this.getDescendantSourceFiles().filter(n=>!n.isSaved()).forEach(n=>n.saveSync())}getRelativePathTo(r){let n=this;return b.FileUtils.getRelativePathTo(this.getPath(),i());function i(){return r instanceof kE?r.getFilePath():r instanceof OE?r.getPath():n._context.fileSystemWrapper.getStandardizedAbsolutePath(r,n.getPath())}}getRelativePathAsModuleSpecifierTo(r){let n=this._context.program.getEmitModuleResolutionKind(),i=this,a=b.FileUtils.getRelativePathTo(this.getPath(),s()).replace(/((\.d\.ts$)|(\.[^/.]+$))/i,"");return a.startsWith("../")?a:"./"+a;function s(){return r instanceof kE?u(r):r instanceof OE?p(r):f(i._context.fileSystemWrapper.getStandardizedAbsolutePath(r,i.getPath()));function u(m){return f(m.getFilePath())}function p(m){switch(n){case b.ModuleResolutionKind.NodeJs:return m===i?b.FileUtils.pathJoin(m.getPath(),"index.ts"):m.getPath();case b.ModuleResolutionKind.Classic:case b.ModuleResolutionKind.Node16:case b.ModuleResolutionKind.NodeNext:return b.FileUtils.pathJoin(m.getPath(),"index.ts");default:return b.errors.throwNotImplementedForNeverValueError(n)}}function f(m){let g=b.FileUtils.getDirPath(m);switch(n){case b.ModuleResolutionKind.NodeJs:return g===i.getPath()?m:m.replace(/\/index?(\.d\.ts|\.ts|\.js)$/i,"");case b.ModuleResolutionKind.Classic:case b.ModuleResolutionKind.Node16:case b.ModuleResolutionKind.NodeNext:return m;default:return b.errors.throwNotImplementedForNeverValueError(n)}}}}getProject(){return this._context.project}wasForgotten(){return this.__context==null}_isInProject(){return this._context.inProjectCoordinator.isDirectoryInProject(this)}_markAsInProject(){this._context.inProjectCoordinator.markDirectoryAsInProject(this)}_hasLoadedParent(){return this._context.compilerFactory.containsDirectoryAtPath(b.FileUtils.getDirPath(this.getPath()))}_throwIfDeletedOrRemoved(){if(this.wasForgotten())throw new b.errors.InvalidOperationError("Cannot use a directory that was deleted, removed, or overwritten.")}_getReferencesForCopy(r){return r._getReferencesForCopyInternal().filter(i=>!this.isAncestorOf(i[1]))}_getReferencesForMove(r){let{literalReferences:n,referencingLiterals:i}=r._getReferencesForMoveInternal();return{literalReferences:n.filter(a=>!this.isAncestorOf(a[1])),referencingLiterals:i.filter(a=>!this.isAncestorOf(a._sourceFile))}}static _isAncestorOfDir(r,n){if(n instanceof kE&&(n=n.getDirectory(),r===n))return!0;if(r._pathParts.length>=n._pathParts.length)return!1;for(let i=r._pathParts.length-1;i>=0;i--)if(r._pathParts[i]!==n._pathParts[i])return!1;return!0}};function oj(e){return e=b.ObjectUtils.clone(e||{}),mu(e,"includeUntrackedFiles",!0),e}function Nfe(e){return typeof e=="string"}var MH=class{constructor(r,n){this.compilerFactory=r,this.fileSystemWrapper=n}addDirectoryAtPathIfExists(r,n){let i=this.compilerFactory.getDirectoryFromPath(r,n);if(i!=null){if(n.recursive)for(let a of b.FileUtils.getDescendantDirectories(this.fileSystemWrapper,r))this.compilerFactory.createDirectoryOrAddIfExists(a,n);return i}}addDirectoryAtPath(r,n){let i=this.addDirectoryAtPathIfExists(r,n);if(i==null)throw new b.errors.DirectoryNotFoundError(r);return i}createDirectoryOrAddIfExists(r,n){return this.compilerFactory.createDirectoryOrAddIfExists(r,n)}addSourceFileAtPathIfExists(r,n){return this.compilerFactory.addOrGetSourceFileFromFilePath(r,{markInProject:n.markInProject,scriptKind:void 0})}addSourceFileAtPath(r,n){let i=this.addSourceFileAtPathIfExists(r,n);if(i==null)throw new b.errors.FileNotFoundError(this.fileSystemWrapper.getStandardizedAbsolutePath(r));return i}addSourceFilesAtPaths(r,n){typeof r=="string"&&(r=[r]);let i=[],a=new Set;for(let s of this.fileSystemWrapper.globSync(r)){let u=this.addSourceFileAtPathIfExists(s,n);u!=null&&i.push(u),a.add(b.FileUtils.getDirPath(s))}for(let s of b.FileUtils.getParentMostPaths(Array.from(a)))this.addDirectoryAtPathIfExists(s,{recursive:!0,markInProject:n.markInProject});return i}},wH=class{constructor(r){this.context=r,this.directoriesByPath=new b.KeyValueCache,this.sourceFilesByDirPath=new b.KeyValueCache,this.directoriesByDirPath=new b.KeyValueCache,this.orphanDirs=new b.KeyValueCache}has(r){return this.directoriesByPath.has(r)}get(r){if(!this.directoriesByPath.has(r)){for(let n of this.orphanDirs.getValues())if(b.FileUtils.pathStartsWith(n.getPath(),r))return this.createOrAddIfExists(r);return}return this.directoriesByPath.get(r)}getOrphans(){return this.orphanDirs.getValues()}getAll(){return this.directoriesByPath.getValuesAsArray()}*getAllByDepth(){let r=new b.KeyValueCache,n=0;for(let a of this.getOrphans())i(a);for(n=Math.min(...Array.from(r.getKeys()));r.getSize()>0;){for(let a of r.get(n)||[])yield a,a.getDirectories().forEach(i);r.removeByKey(n),n++}function i(a){let s=a._getDepth();if(n>s)throw new Error(`For some reason a subdirectory had a lower depth than the parent directory: ${a.getPath()}`);r.getOrCreate(s,()=>[]).push(a)}}remove(r){this.removeFromDirectoriesByDirPath(r),this.directoriesByPath.removeByKey(r),this.orphanDirs.removeByKey(r)}*getChildDirectoriesOfDirectory(r){var n;let i=(n=this.directoriesByDirPath.get(r))===null||n===void 0?void 0:n.entries();if(i!=null)for(let a of i)yield a}*getChildSourceFilesOfDirectory(r){var n;let i=(n=this.sourceFilesByDirPath.get(r))===null||n===void 0?void 0:n.entries();if(i!=null)for(let a of i)yield a}addSourceFile(r){let n=r.getDirectoryPath();this.createOrAddIfExists(n),this.sourceFilesByDirPath.getOrCreate(n,()=>new b.SortedKeyValueArray(a=>a.getBaseName(),b.LocaleStringComparer.instance)).set(r)}removeSourceFile(r){let n=b.FileUtils.getDirPath(r),i=this.sourceFilesByDirPath.get(n);i!=null&&(i.removeByKey(b.FileUtils.getBaseName(r)),i.hasItems()||this.sourceFilesByDirPath.removeByKey(n))}createOrAddIfExists(r){return this.has(r)?this.get(r):(this.fillParentsOfDirPath(r),this.createDirectory(r))}createDirectory(r){let n=new OE(this.context,r);return this.addDirectory(n),n}addDirectory(r){let n=r.getPath(),i=b.FileUtils.getDirPath(n),a=i===n;for(let s of this.orphanDirs.getValues()){let u=s.getPath(),p=b.FileUtils.getDirPath(u);!(p===u)&&p===n&&this.orphanDirs.removeByKey(u)}a||this.addToDirectoriesByDirPath(r),this.has(i)||this.orphanDirs.set(n,r),this.directoriesByPath.set(n,r),this.context.fileSystemWrapper.directoryExistsSync(n)||this.context.fileSystemWrapper.queueMkdir(n);for(let s of this.orphanDirs.getValues())r.isAncestorOf(s)&&this.fillParentsOfDirPath(s.getPath())}addToDirectoriesByDirPath(r){if(b.FileUtils.isRootDirPath(r.getPath()))return;let n=b.FileUtils.getDirPath(r.getPath());this.directoriesByDirPath.getOrCreate(n,()=>new b.SortedKeyValueArray(a=>a.getBaseName(),b.LocaleStringComparer.instance)).set(r)}removeFromDirectoriesByDirPath(r){if(b.FileUtils.isRootDirPath(r))return;let n=b.FileUtils.getDirPath(r),i=this.directoriesByDirPath.get(n);i!=null&&(i.removeByKey(b.FileUtils.getBaseName(r)),i.hasItems()||this.directoriesByDirPath.removeByKey(n))}fillParentsOfDirPath(r){let n=[],i=b.FileUtils.getDirPath(r);for(;r!==i;){if(r=i,i=b.FileUtils.getDirPath(r),this.directoriesByPath.has(r)){for(let a of n)this.createDirectory(a);break}n.unshift(r)}}},FH=class extends b.KeyValueCache{constructor(){super(...arguments),this.forgetStack=[]}getOrCreate(r,n){return super.getOrCreate(r,()=>{let i=n();return this.forgetStack.length>0&&this.forgetStack[this.forgetStack.length-1].add(i),i})}setForgetPoint(){this.forgetStack.push(new Set)}forgetLastPoint(){let r=this.forgetStack.pop();r!=null&&this.forgetNodes(r.values())}rememberNode(r){if(r.wasForgotten())throw new b.errors.InvalidOperationError("Cannot remember a node that was removed or forgotten.");let n=!1;for(let i of this.forgetStack)if(i.delete(r)){n=!0;break}return n&&this.rememberParentOfNode(r),n}rememberParentOfNode(r){let n=r.getParentSyntaxList()||r.getParent();n!=null&&this.rememberNode(n)}forgetNodes(r){for(let n of r)n.wasForgotten()||n.getKind()===b.SyntaxKind.SourceFile||n._forgetOnlyThis()}},aUe={[b.SyntaxKind.SourceFile]:kE,[b.SyntaxKind.ArrayBindingPattern]:eM,[b.SyntaxKind.ArrayLiteralExpression]:iM,[b.SyntaxKind.ArrayType]:kw,[b.SyntaxKind.ArrowFunction]:hw,[b.SyntaxKind.AsExpression]:aM,[b.SyntaxKind.AssertClause]:ew,[b.SyntaxKind.AssertEntry]:rw,[b.SyntaxKind.AwaitExpression]:oM,[b.SyntaxKind.BigIntLiteral]:c6,[b.SyntaxKind.BindingElement]:rM,[b.SyntaxKind.BinaryExpression]:aL,[b.SyntaxKind.Block]:OM,[b.SyntaxKind.BreakStatement]:kM,[b.SyntaxKind.CallExpression]:sM,[b.SyntaxKind.CallSignature]:qF,[b.SyntaxKind.CaseBlock]:RM,[b.SyntaxKind.CaseClause]:MM,[b.SyntaxKind.CatchClause]:wM,[b.SyntaxKind.ClassDeclaration]:Tw,[b.SyntaxKind.ClassExpression]:xw,[b.SyntaxKind.ClassStaticBlockDeclaration]:Dw,[b.SyntaxKind.ConditionalType]:Rw,[b.SyntaxKind.Constructor]:Aw,[b.SyntaxKind.ConstructorType]:Mw,[b.SyntaxKind.ConstructSignature]:zF,[b.SyntaxKind.ContinueStatement]:GM,[b.SyntaxKind.CommaListExpression]:lM,[b.SyntaxKind.ComputedPropertyName]:x6,[b.SyntaxKind.ConditionalExpression]:uM,[b.SyntaxKind.DebuggerStatement]:BM,[b.SyntaxKind.Decorator]:Pw,[b.SyntaxKind.DefaultClause]:UM,[b.SyntaxKind.DeleteExpression]:cM,[b.SyntaxKind.DoStatement]:KM,[b.SyntaxKind.ElementAccessExpression]:sL,[b.SyntaxKind.EmptyStatement]:WM,[b.SyntaxKind.EnumDeclaration]:VF,[b.SyntaxKind.EnumMember]:jF,[b.SyntaxKind.ExportAssignment]:tw,[b.SyntaxKind.ExportDeclaration]:nw,[b.SyntaxKind.ExportSpecifier]:iw,[b.SyntaxKind.ExpressionWithTypeArguments]:ww,[b.SyntaxKind.ExpressionStatement]:VM,[b.SyntaxKind.ExternalModuleReference]:aw,[b.SyntaxKind.QualifiedName]:A6,[b.SyntaxKind.ForInStatement]:jM,[b.SyntaxKind.ForOfStatement]:HM,[b.SyntaxKind.ForStatement]:qM,[b.SyntaxKind.FunctionDeclaration]:Ew,[b.SyntaxKind.FunctionExpression]:bw,[b.SyntaxKind.FunctionType]:Fw,[b.SyntaxKind.GetAccessor]:Lw,[b.SyntaxKind.HeritageClause]:HF,[b.SyntaxKind.Identifier]:D6,[b.SyntaxKind.IfStatement]:JM,[b.SyntaxKind.ImportClause]:ow,[b.SyntaxKind.ImportDeclaration]:sw,[b.SyntaxKind.ImportEqualsDeclaration]:lw,[b.SyntaxKind.ImportSpecifier]:uw,[b.SyntaxKind.ImportType]:Bw,[b.SyntaxKind.ImportTypeAssertionContainer]:Gw,[b.SyntaxKind.IndexedAccessType]:Uw,[b.SyntaxKind.IndexSignature]:$F,[b.SyntaxKind.InferType]:Kw,[b.SyntaxKind.InterfaceDeclaration]:XF,[b.SyntaxKind.IntersectionType]:Ww,[b.SyntaxKind.JSDocAllType]:iF,[b.SyntaxKind.JSDocAugmentsTag]:aF,[b.SyntaxKind.JSDocAuthorTag]:oF,[b.SyntaxKind.JSDocCallbackTag]:sF,[b.SyntaxKind.JSDocClassTag]:lF,[b.SyntaxKind.JSDocDeprecatedTag]:uF,[b.SyntaxKind.JSDocEnumTag]:cF,[b.SyntaxKind.JSDocFunctionType]:dF,[b.SyntaxKind.JSDocImplementsTag]:fF,[b.SyntaxKind.JSDocLink]:pF,[b.SyntaxKind.JSDocLinkCode]:mF,[b.SyntaxKind.JSDocLinkPlain]:_F,[b.SyntaxKind.JSDocMemberName]:gF,[b.SyntaxKind.JSDocNamepathType]:yF,[b.SyntaxKind.JSDocNameReference]:vF,[b.SyntaxKind.JSDocNonNullableType]:hF,[b.SyntaxKind.JSDocNullableType]:EF,[b.SyntaxKind.JSDocOptionalType]:bF,[b.SyntaxKind.JSDocOverrideTag]:SF,[b.SyntaxKind.JSDocParameterTag]:TF,[b.SyntaxKind.JSDocPrivateTag]:xF,[b.SyntaxKind.JSDocPropertyTag]:DF,[b.SyntaxKind.JSDocProtectedTag]:CF,[b.SyntaxKind.JSDocPublicTag]:AF,[b.SyntaxKind.JSDocReturnTag]:NF,[b.SyntaxKind.JSDocReadonlyTag]:LF,[b.SyntaxKind.JSDocSeeTag]:IF,[b.SyntaxKind.JSDocSignature]:PF,[b.SyntaxKind.JSDocTag]:BF,[b.SyntaxKind.JSDocTemplateTag]:OF,[b.SyntaxKind.JSDocText]:kF,[b.SyntaxKind.JSDocThisTag]:RF,[b.SyntaxKind.JSDocTypeExpression]:wF,[b.SyntaxKind.JSDocTypeLiteral]:FF,[b.SyntaxKind.JSDocTypeTag]:GF,[b.SyntaxKind.JSDocTypedefTag]:MF,[b.SyntaxKind.JSDocUnknownType]:UF,[b.SyntaxKind.JSDocVariadicType]:KF,[b.SyntaxKind.JsxAttribute]:ZF,[b.SyntaxKind.JsxClosingElement]:e6,[b.SyntaxKind.JsxClosingFragment]:r6,[b.SyntaxKind.JsxElement]:t6,[b.SyntaxKind.JsxExpression]:n6,[b.SyntaxKind.JsxFragment]:i6,[b.SyntaxKind.JsxOpeningElement]:a6,[b.SyntaxKind.JsxOpeningFragment]:o6,[b.SyntaxKind.JsxSelfClosingElement]:s6,[b.SyntaxKind.JsxSpreadAttribute]:l6,[b.SyntaxKind.JsxText]:u6,[b.SyntaxKind.LabeledStatement]:zM,[b.SyntaxKind.LiteralType]:Vw,[b.SyntaxKind.MappedType]:jw,[b.SyntaxKind.MetaProperty]:fM,[b.SyntaxKind.MethodDeclaration]:MD,[b.SyntaxKind.MethodSignature]:YF,[b.SyntaxKind.ModuleBlock]:cw,[b.SyntaxKind.ModuleDeclaration]:dw,[b.SyntaxKind.NamedExports]:fw,[b.SyntaxKind.NamedImports]:pw,[b.SyntaxKind.NamedTupleMember]:Hw,[b.SyntaxKind.NamespaceExport]:mw,[b.SyntaxKind.NamespaceImport]:_w,[b.SyntaxKind.NewExpression]:pM,[b.SyntaxKind.NonNullExpression]:mM,[b.SyntaxKind.NotEmittedStatement]:$M,[b.SyntaxKind.NoSubstitutionTemplateLiteral]:y6,[b.SyntaxKind.NumericLiteral]:m6,[b.SyntaxKind.ObjectBindingPattern]:tM,[b.SyntaxKind.ObjectLiteralExpression]:gM,[b.SyntaxKind.OmittedExpression]:EM,[b.SyntaxKind.Parameter]:Sw,[b.SyntaxKind.ParenthesizedExpression]:bM,[b.SyntaxKind.ParenthesizedType]:qw,[b.SyntaxKind.PartiallyEmittedExpression]:SM,[b.SyntaxKind.PostfixUnaryExpression]:TM,[b.SyntaxKind.PrefixUnaryExpression]:xM,[b.SyntaxKind.PrivateIdentifier]:C6,[b.SyntaxKind.PropertyAccessExpression]:lL,[b.SyntaxKind.PropertyAssignment]:yM,[b.SyntaxKind.PropertyDeclaration]:Nw,[b.SyntaxKind.PropertySignature]:QF,[b.SyntaxKind.RegularExpressionLiteral]:_6,[b.SyntaxKind.ReturnStatement]:XM,[b.SyntaxKind.SetAccessor]:Iw,[b.SyntaxKind.ShorthandPropertyAssignment]:vM,[b.SyntaxKind.SpreadAssignment]:hM,[b.SyntaxKind.SpreadElement]:DM,[b.SyntaxKind.StringLiteral]:g6,[b.SyntaxKind.SwitchStatement]:YM,[b.SyntaxKind.SyntaxList]:YR,[b.SyntaxKind.TaggedTemplateExpression]:v6,[b.SyntaxKind.TemplateExpression]:h6,[b.SyntaxKind.TemplateHead]:E6,[b.SyntaxKind.TemplateLiteralType]:Jw,[b.SyntaxKind.TemplateMiddle]:b6,[b.SyntaxKind.TemplateSpan]:S6,[b.SyntaxKind.TemplateTail]:T6,[b.SyntaxKind.ThisType]:zw,[b.SyntaxKind.ThrowStatement]:QM,[b.SyntaxKind.TryStatement]:ZM,[b.SyntaxKind.TupleType]:$w,[b.SyntaxKind.TypeAliasDeclaration]:Xw,[b.SyntaxKind.TypeAssertionExpression]:LM,[b.SyntaxKind.TypeLiteral]:Yw,[b.SyntaxKind.TypeOperator]:Qw,[b.SyntaxKind.TypeParameter]:Zw,[b.SyntaxKind.TypePredicate]:eF,[b.SyntaxKind.TypeQuery]:rF,[b.SyntaxKind.TypeReference]:tF,[b.SyntaxKind.UnionType]:nF,[b.SyntaxKind.VariableDeclaration]:L6,[b.SyntaxKind.VariableDeclarationList]:N6,[b.SyntaxKind.VariableStatement]:gw,[b.SyntaxKind.JSDoc]:Ow,[b.SyntaxKind.TypeOfExpression]:NM,[b.SyntaxKind.WhileStatement]:yw,[b.SyntaxKind.WithStatement]:vw,[b.SyntaxKind.YieldExpression]:PM,[b.SyntaxKind.SemicolonToken]:Tr,[b.SyntaxKind.AnyKeyword]:oc,[b.SyntaxKind.BooleanKeyword]:oc,[b.SyntaxKind.FalseKeyword]:f6,[b.SyntaxKind.ImportKeyword]:dM,[b.SyntaxKind.InferKeyword]:Tr,[b.SyntaxKind.NeverKeyword]:Tr,[b.SyntaxKind.NullKeyword]:p6,[b.SyntaxKind.NumberKeyword]:oc,[b.SyntaxKind.ObjectKeyword]:oc,[b.SyntaxKind.StringKeyword]:oc,[b.SyntaxKind.SymbolKeyword]:oc,[b.SyntaxKind.SuperKeyword]:CM,[b.SyntaxKind.ThisKeyword]:AM,[b.SyntaxKind.TrueKeyword]:d6,[b.SyntaxKind.UndefinedKeyword]:oc,[b.SyntaxKind.VoidExpression]:IM},GH=class{constructor(r){this.context=r,this.sourceFileCacheByFilePath=new Map,this.diagnosticCache=new b.WeakCache,this.definitionInfoCache=new b.WeakCache,this.documentSpanCache=new b.WeakCache,this.diagnosticMessageChainCache=new b.WeakCache,this.jsDocTagInfoCache=new b.WeakCache,this.signatureCache=new b.WeakCache,this.symbolCache=new b.WeakCache,this.symbolDisplayPartCache=new b.WeakCache,this.referencedSymbolEntryCache=new b.WeakCache,this.referencedSymbolCache=new b.WeakCache,this.referencedSymbolDefinitionInfoCache=new b.WeakCache,this.typeCache=new b.WeakCache,this.typeParameterCache=new b.WeakCache,this.nodeCache=new FH,this.sourceFileAddedEventContainer=new b.EventContainer,this.sourceFileRemovedEventContainer=new b.EventContainer,this.documentRegistry=new b.DocumentRegistry(r.fileSystemWrapper),this.directoryCache=new wH(r),this.context.compilerOptions.onModified(()=>{let n=Array.from(this.sourceFileCacheByFilePath.values());for(let i of n)b7e(i)})}*getSourceFilesByDirectoryDepth(){for(let r of this.getDirectoriesByDepth())yield*r.getSourceFiles()}getSourceFilePaths(){return this.sourceFileCacheByFilePath.keys()}getChildDirectoriesOfDirectory(r){return this.directoryCache.getChildDirectoriesOfDirectory(r)}getChildSourceFilesOfDirectory(r){return this.directoryCache.getChildSourceFilesOfDirectory(r)}onSourceFileAdded(r,n=!0){n?this.sourceFileAddedEventContainer.subscribe(r):this.sourceFileAddedEventContainer.unsubscribe(r)}onSourceFileRemoved(r){this.sourceFileRemovedEventContainer.subscribe(r)}createSourceFile(r,n,i){if(n=n instanceof Function?$g(this.context.createWriter(),n):n||"",typeof n=="string")return this.createSourceFileFromText(r,n,i);let a=this.context.createWriter();return this.context.structurePrinterFactory.forSourceFile({isAmbient:b.FileUtils.getExtension(r)===".d.ts"}).printText(a,n),this.createSourceFileFromText(r,a.toString(),i)}createSourceFileFromText(r,n,i){return r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r),i.overwrite===!0?this.createOrOverwriteSourceFileFromText(r,n,i):(this.throwIfFileExists(r,"Did you mean to provide the overwrite option?"),this.createSourceFileFromTextInternal(r,n,i))}throwIfFileExists(r,n){if(!(!this.containsSourceFileAtPath(r)&&!this.context.fileSystemWrapper.fileExistsSync(r)))throw n=n==null?"":n+" ",new b.errors.InvalidOperationError(`${n}A source file already exists at the provided file path: ${r}`)}createOrOverwriteSourceFileFromText(r,n,i){r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r);let a=this.addOrGetSourceFileFromFilePath(r,i);return a!=null?(a.getChildren().forEach(s=>s.forget()),this.replaceCompilerNode(a,this.createCompilerSourceFileFromText(r,n,i.scriptKind)),a):this.createSourceFileFromTextInternal(r,n,i)}getSourceFileFromCacheFromFilePath(r){return r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r),this.sourceFileCacheByFilePath.get(r)}addOrGetSourceFileFromFilePath(r,n){r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r);let i=this.sourceFileCacheByFilePath.get(r);if(i==null){let a=this.context.fileSystemWrapper.readFileIfExistsSync(r,this.context.getEncoding());a!=null&&(this.context.logger.log(`Loaded file: ${r}`),i=this.createSourceFileFromTextInternal(r,a,n),i._setIsSaved(!0))}return i!=null&&n.markInProject&&i._markAsInProject(),i}containsSourceFileAtPath(r){return r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r),this.sourceFileCacheByFilePath.has(r)}containsDirectoryAtPath(r){return r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r),this.directoryCache.has(r)}getSourceFileForNode(r){let n=r;for(;n.kind!==b.SyntaxKind.SourceFile;){if(n.parent==null)return;n=n.parent}return this.getSourceFile(n,{markInProject:!1})}hasCompilerNode(r){return this.nodeCache.has(r)}getExistingNodeFromCompilerNode(r){return this.nodeCache.get(r)}getNodeFromCompilerNode(r,n){if(r.kind===b.SyntaxKind.SourceFile)return this.getSourceFile(r,{markInProject:!1});return this.nodeCache.getOrCreate(r,()=>{let u=i.call(this);return s.call(this,u),u});function i(){if(a(r))return f_.isCommentStatement(r)?new FM(this.context,r,n):f_.isCommentClassElement(r)?new Cw(this.context,r,n):f_.isCommentTypeElement(r)?new JF(this.context,r,n):f_.isCommentObjectLiteralElement(r)?new _M(this.context,r,n):f_.isCommentEnumMember(r)?new WF(this.context,r,n):b.errors.throwNotImplementedForNeverValueError(r);let u=aUe[r.kind]||Tr;return new u(this.context,r,n)}function a(u){return u._commentKind!=null}function s(u){if(r.parent!=null){let f=this.getNodeFromCompilerNode(r.parent,n);f._wrappedChildCount++}let p=u._getParentSyntaxListIfWrapped();if(p!=null&&p._wrappedChildCount++,r.kind===b.SyntaxKind.SyntaxList){let f=0;for(let m of u._getChildrenInCacheIterator())f++;u._wrappedChildCount=f}}}createSourceFileFromTextInternal(r,n,i){let a=b.StringUtils.hasBom(n);a&&(n=b.StringUtils.stripBom(n));let s=this.getSourceFile(this.createCompilerSourceFileFromText(r,n,i.scriptKind),i);return a&&(s._hasBom=!0),s}createCompilerSourceFileFromText(r,n,i){return this.documentRegistry.createOrUpdateSourceFile(r,this.context.compilerOptions.get(),b.ts.ScriptSnapshot.fromString(n),i)}getSourceFile(r,n){var i;let a=!1,s=(i=this.sourceFileCacheByFilePath.get(r.fileName))!==null&&i!==void 0?i:this.nodeCache.getOrCreate(r,()=>{let u=new kE(this.context,r);return n.markInProject||this.context.inProjectCoordinator.setSourceFileNotInProject(u),this.addSourceFileToCache(u),a=!0,u});return n.markInProject&&s._markAsInProject(),a&&this.sourceFileAddedEventContainer.fire(s),s}addSourceFileToCache(r){this.sourceFileCacheByFilePath.set(r.getFilePath(),r),this.context.fileSystemWrapper.removeFileDelete(r.getFilePath()),this.directoryCache.addSourceFile(r)}getDirectoryFromPath(r,n){r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r);let i=this.directoryCache.get(r);return i==null&&this.context.fileSystemWrapper.directoryExistsSync(r)&&(i=this.directoryCache.createOrAddIfExists(r)),i!=null&&n.markInProject&&i._markAsInProject(),i}createDirectoryOrAddIfExists(r,n){let i=this.directoryCache.createOrAddIfExists(r);return i!=null&&n.markInProject&&i._markAsInProject(),i}getDirectoryFromCache(r){return this.directoryCache.get(r)}getDirectoryFromCacheOnlyIfInCache(r){return this.directoryCache.has(r)?this.directoryCache.get(r):void 0}getDirectoriesByDepth(){return this.directoryCache.getAllByDepth()}getOrphanDirectories(){return this.directoryCache.getOrphans()}getSymbolDisplayPart(r){return this.symbolDisplayPartCache.getOrCreate(r,()=>new B6(r))}getType(r){return(r.flags&b.TypeFlags.TypeParameter)===b.TypeFlags.TypeParameter?this.getTypeParameter(r):this.typeCache.getOrCreate(r,()=>new hL(this.context,r))}getTypeParameter(r){return this.typeParameterCache.getOrCreate(r,()=>new W6(this.context,r))}getSignature(r){return this.signatureCache.getOrCreate(r,()=>new I6(this.context,r))}getSymbol(r){return this.symbolCache.getOrCreate(r,()=>new P6(this.context,r))}getDefinitionInfo(r){return this.definitionInfoCache.getOrCreate(r,()=>new FD(this.context,r))}getDocumentSpan(r){return this.documentSpanCache.getOrCreate(r,()=>new dv(this.context,r))}getReferencedSymbolEntry(r){return this.referencedSymbolEntryCache.getOrCreate(r,()=>new F6(this.context,r))}getReferencedSymbol(r){return this.referencedSymbolCache.getOrCreate(r,()=>new gL(this.context,r))}getReferencedSymbolDefinitionInfo(r){return this.referencedSymbolDefinitionInfoCache.getOrCreate(r,()=>new yL(this.context,r))}getDiagnostic(r){return this.diagnosticCache.getOrCreate(r,()=>r.start!=null?new fL(this.context,r):new WT(this.context,r))}getDiagnosticWithLocation(r){return this.diagnosticCache.getOrCreate(r,()=>new fL(this.context,r))}getDiagnosticMessageChain(r){return this.diagnosticMessageChainCache.getOrCreate(r,()=>new pS(r))}getJSDocTagInfo(r){return this.jsDocTagInfoCache.getOrCreate(r,()=>new cL(r))}replaceCompilerNode(r,n){let i=r instanceof Tr?r.compilerNode:r,a=r instanceof Tr?r:this.nodeCache.get(r);if(i.kind===b.SyntaxKind.SourceFile&&i.fileName!==n.fileName){let s=a;this.removeCompilerNodeFromCache(i),s._replaceCompilerNodeFromFactory(n),this.nodeCache.set(n,s),this.addSourceFileToCache(s),this.sourceFileAddedEventContainer.fire(s)}else this.nodeCache.replaceKey(i,n),a?._replaceCompilerNodeFromFactory(n)}removeNodeFromCache(r){this.removeCompilerNodeFromCache(r.compilerNode)}removeCompilerNodeFromCache(r){if(this.nodeCache.removeByKey(r),r.kind===b.SyntaxKind.SourceFile){let n=r,i=this.context.fileSystemWrapper.getStandardizedAbsolutePath(n.fileName);this.directoryCache.removeSourceFile(i);let a=this.sourceFileCacheByFilePath.get(i);this.sourceFileCacheByFilePath.delete(i),this.documentRegistry.removeSourceFile(i),a!=null&&this.sourceFileRemovedEventContainer.fire(a)}}addDirectoryToCache(r){this.directoryCache.addDirectory(r)}removeDirectoryFromCache(r){this.directoryCache.remove(r)}forgetNodesCreatedInBlock(r){this.nodeCache.setForgetPoint();let n=!1,i;try{if(i=r((...s)=>{for(let u of s)this.nodeCache.rememberNode(u)}),Tr.isNode(i)&&this.nodeCache.rememberNode(i),a(i))return n=!0,i.then(s=>(Tr.isNode(s)&&this.nodeCache.rememberNode(s),this.nodeCache.forgetLastPoint(),s))}finally{n||this.nodeCache.forgetLastPoint()}return i;function a(s){return s!=null&&typeof s.then=="function"}}},BH=class{constructor(r){this.compilerFactory=r,this.notInProjectFiles=new Set,r.onSourceFileRemoved(n=>{this.notInProjectFiles.delete(n)})}setSourceFileNotInProject(r){this.notInProjectFiles.add(r),r._inProject=!1}markSourceFileAsInProject(r){this.isSourceFileInProject(r)||(this._internalMarkSourceFileAsInProject(r),this.notInProjectFiles.delete(r))}markSourceFilesAsInProjectForResolution(){let r="/node_modules/",n=this.compilerFactory,i=[],a=[];for(let u of[...this.notInProjectFiles.values()])s(u)?(this._internalMarkSourceFileAsInProject(u),this.notInProjectFiles.delete(u),i.push(u)):a.push(u);return{changedSourceFiles:i,unchangedSourceFiles:a};function s(u){let p=u.getFilePath(),f=p.toLowerCase().lastIndexOf(r);if(f===-1)return!0;let m=p.substring(0,f+r.length-1),g=n.getDirectoryFromCacheOnlyIfInCache(m);if(g!=null&&g._isInProject())return!0;let D=u.getDirectory();for(;D!=null&&D.getPath()!==m;){if(D._isInProject())return!0;D=n.getDirectoryFromCacheOnlyIfInCache(b.FileUtils.getDirPath(D.getPath()))}return!1}}_internalMarkSourceFileAsInProject(r){r._inProject=!0,this.markDirectoryAsInProject(r.getDirectory())}isSourceFileInProject(r){return r._inProject===!0}setDirectoryAndFilesAsNotInProjectForTesting(r){for(let n of r.getDirectories())this.setDirectoryAndFilesAsNotInProjectForTesting(n);for(let n of r.getSourceFiles())delete n._inProject,this.notInProjectFiles.add(n);delete r._inProject}markDirectoryAsInProject(r){if(this.isDirectoryInProject(r))return;let n=this,i=this.compilerFactory;r._inProject=!0,a(r);function a(u){let p=Array.from(s(u)),f=p[p.length-1];if(!(f==null||!n.isDirectoryInProject(f)))for(let m of p)m._inProject=!0}function*s(u){if(b.FileUtils.isRootDirPath(u.getPath()))return;let p=b.FileUtils.getDirPath(u.getPath()),f=i.getDirectoryFromCacheOnlyIfInCache(p);f!=null&&(yield f,n.isDirectoryInProject(f)||(yield*s(f)))}}isDirectoryInProject(r){return r._inProject===!0}},Vo=class{constructor(r){this._getFormatCodeSettings=r}getFormatCodeSettings(){return this._getFormatCodeSettings()}forInitializerExpressionableNode(){return new Pj}forModifierableNode(){return new Oj}forReturnTypedNode(r){return new kj(r)}forTypedNode(r,n){return new Rj(r,n)}forClassDeclaration(r){return new wj(this,r)}forClassMember(r){return new Fj(this,r)}forClassStaticBlockDeclaration(){return new Gj(this)}forConstructorDeclaration(r){return new Bj(this,r)}forGetAccessorDeclaration(r){return new Uj(this,r)}forMethodDeclaration(r){return new Kj(this,r)}forPropertyDeclaration(){return new Wj(this)}forSetAccessorDeclaration(r){return new Vj(this,r)}forDecorator(){return new jj(this)}forJSDoc(){return new Hj(this)}forJSDocTag(r){return new qj(this,r)}forEnumDeclaration(){return new Jj(this)}forEnumMember(){return new zj(this)}forObjectLiteralExpressionProperty(){return new $j(this)}forPropertyAssignment(){return new Xj(this)}forShorthandPropertyAssignment(){return new Yj(this)}forSpreadAssignment(){return new Qj(this)}forFunctionDeclaration(r){return new Zj(this,r)}forParameterDeclaration(){return new eH(this)}forCallSignatureDeclaration(){return new rH(this)}forConstructSignatureDeclaration(){return new tH(this)}forIndexSignatureDeclaration(){return new nH(this)}forInterfaceDeclaration(){return new iH(this)}forMethodSignature(){return new aH(this)}forPropertySignature(){return new oH(this)}forTypeElementMemberedNode(){return new sH(this)}forTypeElementMember(){return new lH(this)}forJsxAttributeDecider(){return new uH(this)}forJsxAttribute(){return new cH(this)}forJsxChildDecider(){return new dH(this)}forJsxElement(){return new fH(this)}forJsxSelfClosingElement(){return new pH(this)}forJsxSpreadAttribute(){return new mH(this)}forAssertEntry(){return new _H(this)}forExportAssignment(){return new gH(this)}forExportDeclaration(){return new yH(this)}forImportDeclaration(){return new vH(this)}forModuleDeclaration(r){return new hH(this,r)}forNamedImportExportSpecifier(){return new EH(this)}forSourceFile(r){return new bH(this,r)}forStatementedNode(r){return new SH(this,r)}forStatement(r){return new TH(this,r)}forVariableStatement(){return new xH(this)}forTypeAliasDeclaration(){return new DH(this)}forTypeParameterDeclaration(){return new CH(this)}forVariableDeclaration(){return new AH(this)}};co([b.Memoize],Vo.prototype,"forInitializerExpressionableNode",null);co([b.Memoize],Vo.prototype,"forModifierableNode",null);co([b.Memoize],Vo.prototype,"forReturnTypedNode",null);co([b.Memoize],Vo.prototype,"forTypedNode",null);co([b.Memoize],Vo.prototype,"forClassDeclaration",null);co([b.Memoize],Vo.prototype,"forClassMember",null);co([b.Memoize],Vo.prototype,"forClassStaticBlockDeclaration",null);co([b.Memoize],Vo.prototype,"forConstructorDeclaration",null);co([b.Memoize],Vo.prototype,"forGetAccessorDeclaration",null);co([b.Memoize],Vo.prototype,"forMethodDeclaration",null);co([b.Memoize],Vo.prototype,"forPropertyDeclaration",null);co([b.Memoize],Vo.prototype,"forSetAccessorDeclaration",null);co([b.Memoize],Vo.prototype,"forDecorator",null);co([b.Memoize],Vo.prototype,"forJSDoc",null);co([b.Memoize],Vo.prototype,"forJSDocTag",null);co([b.Memoize],Vo.prototype,"forEnumDeclaration",null);co([b.Memoize],Vo.prototype,"forEnumMember",null);co([b.Memoize],Vo.prototype,"forObjectLiteralExpressionProperty",null);co([b.Memoize],Vo.prototype,"forPropertyAssignment",null);co([b.Memoize],Vo.prototype,"forShorthandPropertyAssignment",null);co([b.Memoize],Vo.prototype,"forSpreadAssignment",null);co([b.Memoize],Vo.prototype,"forFunctionDeclaration",null);co([b.Memoize],Vo.prototype,"forParameterDeclaration",null);co([b.Memoize],Vo.prototype,"forCallSignatureDeclaration",null);co([b.Memoize],Vo.prototype,"forConstructSignatureDeclaration",null);co([b.Memoize],Vo.prototype,"forIndexSignatureDeclaration",null);co([b.Memoize],Vo.prototype,"forInterfaceDeclaration",null);co([b.Memoize],Vo.prototype,"forMethodSignature",null);co([b.Memoize],Vo.prototype,"forPropertySignature",null);co([b.Memoize],Vo.prototype,"forTypeElementMemberedNode",null);co([b.Memoize],Vo.prototype,"forTypeElementMember",null);co([b.Memoize],Vo.prototype,"forJsxAttributeDecider",null);co([b.Memoize],Vo.prototype,"forJsxAttribute",null);co([b.Memoize],Vo.prototype,"forJsxChildDecider",null);co([b.Memoize],Vo.prototype,"forJsxElement",null);co([b.Memoize],Vo.prototype,"forJsxSelfClosingElement",null);co([b.Memoize],Vo.prototype,"forJsxSpreadAttribute",null);co([b.Memoize],Vo.prototype,"forAssertEntry",null);co([b.Memoize],Vo.prototype,"forExportAssignment",null);co([b.Memoize],Vo.prototype,"forExportDeclaration",null);co([b.Memoize],Vo.prototype,"forImportDeclaration",null);co([b.Memoize],Vo.prototype,"forModuleDeclaration",null);co([b.Memoize],Vo.prototype,"forNamedImportExportSpecifier",null);co([b.Memoize],Vo.prototype,"forSourceFile",null);co([b.Memoize],Vo.prototype,"forStatementedNode",null);co([b.Memoize],Vo.prototype,"forStatement",null);co([b.Memoize],Vo.prototype,"forVariableStatement",null);co([b.Memoize],Vo.prototype,"forTypeAliasDeclaration",null);co([b.Memoize],Vo.prototype,"forTypeParameterDeclaration",null);co([b.Memoize],Vo.prototype,"forVariableDeclaration",null);var GD=class{constructor(r){this.logger=new uj,this.manipulationSettings=new WR,this._project=r.project,this.fileSystemWrapper=r.fileSystemWrapper,this._compilerOptions=r.compilerOptionsContainer,this.compilerFactory=new GH(this),this.inProjectCoordinator=new BH(this.compilerFactory),this.structurePrinterFactory=new Vo(()=>this.manipulationSettings.getFormatCodeSettings()),this.lazyReferenceCoordinator=new cj(this.compilerFactory),this.directoryCoordinator=new MH(this.compilerFactory,r.fileSystemWrapper),this._languageService=r.createLanguageService?new K6({context:this,configFileParsingDiagnostics:r.configFileParsingDiagnostics,resolutionHost:r.resolutionHost&&r.resolutionHost(this.getModuleResolutionHost(),()=>this.compilerOptions.get()),skipLoadingLibFiles:r.skipLoadingLibFiles,libFolderPath:r.libFolderPath}):void 0,r.typeChecker!=null&&(b.errors.throwIfTrue(r.createLanguageService,"Cannot specify a type checker and create a language service."),this._customTypeChecker=new vL(this),this._customTypeChecker._reset(()=>r.typeChecker))}get project(){if(this._project==null)throw new b.errors.InvalidOperationError("This operation is not permitted in this context.");return this._project}get compilerOptions(){return this._compilerOptions}get languageService(){if(this._languageService==null)throw this.getToolRequiredError("language service");return this._languageService}get program(){if(this._languageService==null)throw this.getToolRequiredError("program");return this.languageService.getProgram()}get typeChecker(){if(this._customTypeChecker!=null)return this._customTypeChecker;if(this._languageService==null)throw this.getToolRequiredError("type checker");return this.program.getTypeChecker()}hasLanguageService(){return this._languageService!=null}getEncoding(){return this.compilerOptions.getEncoding()}getFormatCodeSettings(){return this.manipulationSettings.getFormatCodeSettings()}getUserPreferences(){return this.manipulationSettings.getUserPreferences()}resetProgram(){this.languageService._reset()}createWriter(){let r=this.manipulationSettings.getIndentationText();return new KR.default({newLine:this.manipulationSettings.getNewLineKindAsString(),indentNumberOfSpaces:r===Oe.IndentationText.Tab?void 0:r.length,useTabs:r===Oe.IndentationText.Tab,useSingleQuote:this.manipulationSettings.getQuoteKind()===Oe.QuoteKind.Single})}getPreEmitDiagnostics(r){return b.ts.getPreEmitDiagnostics(this.program.compilerObject,r?.compilerNode).map(i=>this.compilerFactory.getDiagnostic(i))}getSourceFileContainer(){return{addOrGetSourceFileFromFilePath:(r,n)=>{var i;return Promise.resolve((i=this.compilerFactory.addOrGetSourceFileFromFilePath(r,n))===null||i===void 0?void 0:i.compilerNode)},addOrGetSourceFileFromFilePathSync:(r,n)=>{var i;return(i=this.compilerFactory.addOrGetSourceFileFromFilePath(r,n))===null||i===void 0?void 0:i.compilerNode},containsDirectoryAtPath:r=>this.compilerFactory.containsDirectoryAtPath(r),containsSourceFileAtPath:r=>this.compilerFactory.containsSourceFileAtPath(r),getSourceFileFromCacheFromFilePath:r=>{let n=this.compilerFactory.getSourceFileFromCacheFromFilePath(r);return n?.compilerNode},getSourceFilePaths:()=>this.compilerFactory.getSourceFilePaths(),getSourceFileVersion:r=>this.compilerFactory.documentRegistry.getSourceFileVersion(r),getChildDirectoriesOfDirectory:r=>{let n=[];for(let i of this.compilerFactory.getChildDirectoriesOfDirectory(r))n.push(i.getPath());return n}}}getModuleResolutionHost(){return b.createModuleResolutionHost({transactionalFileSystem:this.fileSystemWrapper,getEncoding:()=>this.getEncoding(),sourceFileContainer:this.getSourceFileContainer()})}getToolRequiredError(r){return new b.errors.InvalidOperationError(`A ${r} is required for this operation. This might occur when manipulating or getting type information from a node that was not added to a Project object and created via createWrappedNode. Please submit a bug report if you don't believe a ${r} should be required for this operation.`)}};co([b.Memoize],GD.prototype,"getSourceFileContainer",null);co([b.Memoize],GD.prototype,"getModuleResolutionHost",null);var UH=class{constructor(r={}){var n;f();let i=m(),a=new b.TransactionalFileSystem({fileSystem:i,skipLoadingLibFiles:r.skipLoadingLibFiles,libFolderPath:r.libFolderPath}),s=r.tsConfigFilePath==null?void 0:new b.TsConfigResolver(a,a.getStandardizedAbsolutePath(r.tsConfigFilePath),P()),u=g(),p=new b.CompilerOptionsContainer;p.set(u),this._context=new GD({project:this,compilerOptionsContainer:p,fileSystemWrapper:a,createLanguageService:!0,resolutionHost:r.resolutionHost,configFileParsingDiagnostics:(n=s?.getErrors())!==null&&n!==void 0?n:[],skipLoadingLibFiles:r.skipLoadingLibFiles,libFolderPath:r.libFolderPath}),r.manipulationSettings!=null&&this._context.manipulationSettings.set(r.manipulationSettings),s!=null&&r.skipAddingFilesFromTsConfig!==!0&&(this._addSourceFilesForTsConfigResolver(s,u),r.skipFileDependencyResolution||this.resolveSourceFileDependencies());function f(){if(r.fileSystem!=null&&r.useInMemoryFileSystem)throw new b.errors.InvalidOperationError("Cannot provide a file system when specifying to use an in-memory file system.")}function m(){var B;return r.useInMemoryFileSystem?new b.InMemoryFileSystemHost:(B=r.fileSystem)!==null&&B!==void 0?B:new b.RealFileSystemHost}function g(){var B;return{...D(),...(B=r.compilerOptions)!==null&&B!==void 0?B:{}}}function D(){var B;return(B=s?.getCompilerOptions())!==null&&B!==void 0?B:{}}function P(){var B;let K="utf-8";return r.compilerOptions!=null&&(B=r.compilerOptions.charset)!==null&&B!==void 0?B:K}}get manipulationSettings(){return this._context.manipulationSettings}get compilerOptions(){return this._context.compilerOptions}resolveSourceFileDependencies(){let r=new Set,n=u=>r.add(u),{compilerFactory:i,inProjectCoordinator:a}=this._context;i.onSourceFileAdded(n);try{this.getProgram().compilerObject}finally{i.onSourceFileAdded(n,!1)}let s=a.markSourceFilesAsInProjectForResolution();for(let u of s.changedSourceFiles)r.add(u);for(let u of s.unchangedSourceFiles)r.delete(u);return Array.from(r.values())}addDirectoryAtPathIfExists(r,n={}){return this._context.directoryCoordinator.addDirectoryAtPathIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),{...n,markInProject:!0})}addDirectoryAtPath(r,n={}){return this._context.directoryCoordinator.addDirectoryAtPath(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),{...n,markInProject:!0})}createDirectory(r){return this._context.directoryCoordinator.createDirectoryOrAddIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),{markInProject:!0})}getDirectoryOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getDirectory(r),()=>`Could not find a directory at the specified path: ${this._context.fileSystemWrapper.getStandardizedAbsolutePath(r)}`)}getDirectory(r){let{compilerFactory:n}=this._context;return n.getDirectoryFromCache(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r))}getDirectories(){return Array.from(this._getProjectDirectoriesByDirectoryDepth())}getRootDirectories(){let{inProjectCoordinator:r}=this._context,n=[];for(let a of this._context.compilerFactory.getOrphanDirectories())for(let s of i(a))n.push(s);return n;function*i(a){if(r.isDirectoryInProject(a)){yield a;return}for(let s of a._getDirectoriesIterator())yield*i(s)}}addSourceFilesAtPaths(r){return this._context.directoryCoordinator.addSourceFilesAtPaths(r,{markInProject:!0})}addSourceFileAtPathIfExists(r){return this._context.directoryCoordinator.addSourceFileAtPathIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),{markInProject:!0})}addSourceFileAtPath(r){return this._context.directoryCoordinator.addSourceFileAtPath(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),{markInProject:!0})}addSourceFilesFromTsConfig(r){let n=new b.TsConfigResolver(this._context.fileSystemWrapper,this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),this._context.getEncoding());return this._addSourceFilesForTsConfigResolver(n,n.getCompilerOptions())}_addSourceFilesForTsConfigResolver(r,n){let i=r.getPaths(n),a=i.filePaths.map(s=>this.addSourceFileAtPath(s));for(let s of i.directoryPaths)this.addDirectoryAtPathIfExists(s);return a}createSourceFile(r,n,i){return this._context.compilerFactory.createSourceFile(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),n??"",{...i??{},markInProject:!0})}removeSourceFile(r){let n=r.wasForgotten();return r.forget(),!n}getSourceFileOrThrow(r){let n=this.getSourceFile(r);if(n!=null)return n;if(typeof r=="string"){let i=b.FileUtils.standardizeSlashes(r);if(b.FileUtils.pathIsAbsolute(i)||i.indexOf("/")>=0){let a=this._context.fileSystemWrapper.getStandardizedAbsolutePath(i);throw new b.errors.InvalidOperationError(`Could not find source file in project at the provided path: ${a}`)}else throw new b.errors.InvalidOperationError(`Could not find source file in project with the provided file name: ${r}`)}else throw new b.errors.InvalidOperationError("Could not find source file in project based on the provided condition.")}getSourceFile(r){let n=i(this._context.fileSystemWrapper);if(a(n))return this._context.compilerFactory.getSourceFileFromCacheFromFilePath(n);return b.IterableUtils.find(this._getProjectSourceFilesByDirectoryDepth(),n);function i(s){if(r instanceof Function)return r;let u=b.FileUtils.standardizeSlashes(r);return b.FileUtils.pathIsAbsolute(u)||u.indexOf("/")>=0?s.getStandardizedAbsolutePath(u):p=>b.FileUtils.pathEndsWith(p.getFilePath(),u)}function a(s){return typeof s=="string"}}getSourceFiles(r){let{compilerFactory:n,fileSystemWrapper:i}=this._context,a=this._getProjectSourceFilesByDirectoryDepth();if(typeof r=="string"||r instanceof Array)return Array.from(s());return Array.from(a);function*s(){let u=Array.from(f()),p=b.matchGlobs(u,r,i.getCurrentDirectory());for(let m of p)yield n.getSourceFileFromCacheFromFilePath(i.getStandardizedAbsolutePath(m));function*f(){for(let m of a)yield m.getFilePath()}}}*_getProjectSourceFilesByDirectoryDepth(){let{compilerFactory:r,inProjectCoordinator:n}=this._context;for(let i of r.getSourceFilesByDirectoryDepth())n.isSourceFileInProject(i)&&(yield i)}*_getProjectDirectoriesByDirectoryDepth(){let{compilerFactory:r,inProjectCoordinator:n}=this._context;for(let i of r.getDirectoriesByDepth())n.isDirectoryInProject(i)&&(yield i)}getAmbientModule(r){return r=Ife(r),this.getAmbientModules().find(n=>n.getName()===r)}getAmbientModuleOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getAmbientModule(r),()=>`Could not find ambient module with name: ${Ife(r)}`)}getAmbientModules(){return this.getTypeChecker().getAmbientModules()}async save(){await this._context.fileSystemWrapper.flush(),await Promise.all(this._getUnsavedSourceFiles().map(r=>r.save()))}saveSync(){this._context.fileSystemWrapper.flushSync();for(let r of this._getUnsavedSourceFiles())r.saveSync()}enableLogging(r=!0){this._context.logger.setEnabled(r)}_getUnsavedSourceFiles(){return Array.from(r(this._context.compilerFactory.getSourceFilesByDirectoryDepth()));function*r(n){for(let i of n)i.isSaved()||(yield i)}}getPreEmitDiagnostics(){return this._context.getPreEmitDiagnostics()}getLanguageService(){return this._context.languageService}getProgram(){return this._context.program}getTypeChecker(){return this._context.typeChecker}getFileSystem(){return this._context.fileSystemWrapper.getFileSystem()}emit(r={}){return this._context.program.emit(r)}emitSync(r={}){return this._context.program.emitSync(r)}emitToMemory(r={}){return this._context.program.emitToMemory(r)}getCompilerOptions(){return this._context.compilerOptions.get()}getConfigFileParsingDiagnostics(){return this.getProgram().getConfigFileParsingDiagnostics()}createWriter(){return this._context.createWriter()}forgetNodesCreatedInBlock(r){return this._context.compilerFactory.forgetNodesCreatedInBlock(r)}formatDiagnosticsWithColorAndContext(r,n={}){return b.ts.formatDiagnosticsWithColorAndContext(r.map(i=>i.compilerObject),{getCurrentDirectory:()=>this._context.fileSystemWrapper.getCurrentDirectory(),getCanonicalFileName:i=>i,getNewLine:()=>{var i;return(i=n.newLineChar)!==null&&i!==void 0?i:b.runtime.getEndOfLine()}})}getModuleResolutionHost(){return this._context.getModuleResolutionHost()}};function Ife(e){return r(e[0])&&r(e[e.length-1])&&(e=e.substring(1,e.length-1)),`"${e}"`;function r(n){return n==='"'||n==="'"}}function oUe(e,r={}){let{compilerOptions:n={},sourceFile:i,typeChecker:a}=r,s=new b.CompilerOptionsContainer;s.set(n);let u=new GD({project:void 0,fileSystemWrapper:new b.TransactionalFileSystem({fileSystem:new b.RealFileSystemHost,skipLoadingLibFiles:!0,libFolderPath:void 0}),compilerOptionsContainer:s,createLanguageService:!1,typeChecker:a,configFileParsingDiagnostics:[],skipLoadingLibFiles:!0,libFolderPath:void 0}),p=u.compilerFactory.getSourceFile(f(),{markInProject:!0});return u.compilerFactory.getNodeFromCompilerNode(e,p);function f(){return i??m(e)}function m(g){if(g.kind===b.SyntaxKind.SourceFile)return g;if(g.parent==null)throw new b.errors.InvalidOperationError("Please ensure the node was created from a source file with 'setParentNodes' set to 'true'.");let D=g;for(;D.parent!=null;)D=D.parent;if(D.kind!==b.SyntaxKind.SourceFile)throw new b.errors.NotImplementedError("For some reason the top parent was not a source file.");return D}}var sUe=new Vo(()=>{throw new b.errors.NotImplementedError("Not implemented scenario for getting code format settings when using a writer function. Please open an issue.")}),KH=class{constructor(){}static object(r){return n=>{let i=Object.keys(r);n.write("{"),i.length>0&&n.indent(()=>{a()}),n.write("}");function a(){for(let s=0;s<i.length;s++){s>0&&n.write(",").newLine();let u=i[s],p=r[u];n.write(u),p!=null&&(n.write(": "),tL(n,p))}n.newLine()}}}static objectType(r){return n=>{n.write("{"),lUe(r)&&n.indent(()=>{sUe.forTypeElementMemberedNode().printText(n,r)}),n.write("}")}}static unionType(r,n,...i){return Pfe("|",[r,n,...i])}static intersectionType(r,n,...i){return Pfe("&",[r,n,...i])}static assertion(r,n){return i=>{tL(i,r),i.spaceIfLastNot().write("as "),tL(i,n)}}static returnStatement(r){return n=>{n.write("return "),n.hangingIndentUnlessBlock(()=>{tL(n,r),n.write(";")})}}};function Pfe(e,r){return n=>{uUe(n,` ${e} `,r)}}function lUe(e){for(let r of Object.keys(e))if(e[r]!=null&&!(e[r]instanceof Array&&e[r].length===0))return!0;return!1}function uUe(e,r,n){for(let i=0;i<n.length;i++)e.conditionalWrite(i>0,r),tL(e,n[i])}function tL(e,r){r instanceof Function?r(e):e.write(r.toString())}var{InvalidOperationError:cUe,FileNotFoundError:dUe,ArgumentError:fUe,ArgumentNullOrWhitespaceError:pUe,ArgumentOutOfRangeError:mUe,ArgumentTypeError:_Ue,BaseError:gUe,DirectoryNotFoundError:yUe,NotImplementedError:vUe,NotSupportedError:hUe,PathNotFoundError:EUe}=b.errors;Object.defineProperty(Oe,"CompilerOptionsContainer",{enumerable:!0,get:function(){return b.CompilerOptionsContainer}});Object.defineProperty(Oe,"DiagnosticCategory",{enumerable:!0,get:function(){return b.DiagnosticCategory}});Object.defineProperty(Oe,"EmitHint",{enumerable:!0,get:function(){return b.EmitHint}});Object.defineProperty(Oe,"InMemoryFileSystemHost",{enumerable:!0,get:function(){return b.InMemoryFileSystemHost}});Object.defineProperty(Oe,"LanguageVariant",{enumerable:!0,get:function(){return b.LanguageVariant}});Object.defineProperty(Oe,"ModuleKind",{enumerable:!0,get:function(){return b.ModuleKind}});Object.defineProperty(Oe,"ModuleResolutionKind",{enumerable:!0,get:function(){return b.ModuleResolutionKind}});Object.defineProperty(Oe,"NewLineKind",{enumerable:!0,get:function(){return b.NewLineKind}});Object.defineProperty(Oe,"NodeFlags",{enumerable:!0,get:function(){return b.NodeFlags}});Object.defineProperty(Oe,"ObjectFlags",{enumerable:!0,get:function(){return b.ObjectFlags}});Object.defineProperty(Oe,"ResolutionHosts",{enumerable:!0,get:function(){return b.ResolutionHosts}});Object.defineProperty(Oe,"ScriptKind",{enumerable:!0,get:function(){return b.ScriptKind}});Object.defineProperty(Oe,"ScriptTarget",{enumerable:!0,get:function(){return b.ScriptTarget}});Object.defineProperty(Oe,"SettingsContainer",{enumerable:!0,get:function(){return b.SettingsContainer}});Object.defineProperty(Oe,"SymbolFlags",{enumerable:!0,get:function(){return b.SymbolFlags}});Object.defineProperty(Oe,"SyntaxKind",{enumerable:!0,get:function(){return b.SyntaxKind}});Object.defineProperty(Oe,"TypeFlags",{enumerable:!0,get:function(){return b.TypeFlags}});Object.defineProperty(Oe,"TypeFormatFlags",{enumerable:!0,get:function(){return b.TypeFormatFlags}});Object.defineProperty(Oe,"ts",{enumerable:!0,get:function(){return b.ts}});Object.defineProperty(Oe,"CodeBlockWriter",{enumerable:!0,get:function(){return KR.default}});Oe.AbstractableNode=gS;Oe.AmbientableNode=Ph;Oe.ArgumentError=fUe;Oe.ArgumentNullOrWhitespaceError=pUe;Oe.ArgumentOutOfRangeError=mUe;Oe.ArgumentTypeError=_Ue;Oe.ArgumentedNode=JH;Oe.ArrayBindingPattern=eM;Oe.ArrayDestructuringAssignment=LH;Oe.ArrayDestructuringAssignmentBase=ppe;Oe.ArrayLiteralExpression=iM;Oe.ArrayTypeNode=kw;Oe.ArrowFunction=hw;Oe.ArrowFunctionBase=bme;Oe.AsExpression=aM;Oe.AsExpressionBase=mpe;Oe.AssertClause=ew;Oe.AssertClauseBase=ume;Oe.AssertEntry=rw;Oe.AssertEntryBase=sR;Oe.AssertionKeyNamedNode=ope;Oe.AssignmentExpression=oL;Oe.AssignmentExpressionBase=fpe;Oe.AsyncableNode=jT;Oe.AwaitExpression=oM;Oe.AwaitExpressionBase=_pe;Oe.AwaitableNode=Yfe;Oe.BaseError=gUe;Oe.BaseExpressionedNode=VD;Oe.BigIntLiteral=c6;Oe.BigIntLiteralBase=Qme;Oe.BinaryExpression=aL;Oe.BinaryExpressionBase=dpe;Oe.BindingElement=rM;Oe.BindingElementBase=cpe;Oe.BindingNamedNode=$6;Oe.Block=OM;Oe.BlockBase=jpe;Oe.BodiedNode=H6;Oe.BodyableNode=HT;Oe.BreakStatement=kM;Oe.CallExpression=sM;Oe.CallExpressionBase=gpe;Oe.CallSignatureDeclaration=qF;Oe.CallSignatureDeclarationBase=IR;Oe.CaseBlock=RM;Oe.CaseBlockBase=Hpe;Oe.CaseClause=MM;Oe.CaseClauseBase=qpe;Oe.CatchClause=wM;Oe.CatchClauseBase=Jpe;Oe.ChildOrderableNode=Nm;Oe.ClassDeclaration=Tw;Oe.ClassDeclarationBase=yR;Oe.ClassElement=zg;Oe.ClassExpression=xw;Oe.ClassExpressionBase=Ame;Oe.ClassLikeDeclarationBase=iq;Oe.ClassLikeDeclarationBaseSpecific=Dme;Oe.ClassStaticBlockDeclaration=Dw;Oe.ClassStaticBlockDeclarationBase=vR;Oe.CodeAction=O6;Oe.CodeFixAction=k6;Oe.CombinedCodeActions=dL;Oe.CommaListExpression=lM;Oe.CommaListExpressionBase=ype;Oe.CommentClassElement=Cw;Oe.CommentEnumMember=WF;Oe.CommentObjectLiteralElement=_M;Oe.CommentRange=XR;Oe.CommentStatement=FM;Oe.CommentTypeElement=JF;Oe.CommonIdentifierBase=lq;Oe.CompilerCommentClassElement=jR;Oe.CompilerCommentEnumMember=JR;Oe.CompilerCommentNode=sS;Oe.CompilerCommentObjectLiteralElement=qR;Oe.CompilerCommentStatement=VR;Oe.CompilerCommentTypeElement=HR;Oe.ComputedPropertyName=x6;Oe.ComputedPropertyNameBase=f_e;Oe.ConditionalExpression=uM;Oe.ConditionalExpressionBase=vpe;Oe.ConditionalTypeNode=Rw;Oe.ConstructSignatureDeclaration=zF;Oe.ConstructSignatureDeclarationBase=PR;Oe.ConstructorDeclaration=Aw;Oe.ConstructorDeclarationBase=hR;Oe.ConstructorDeclarationOverloadBase=Lme;Oe.ConstructorTypeNode=Mw;Oe.ConstructorTypeNodeBase=Ome;Oe.ContinueStatement=GM;Oe.DebuggerStatement=BM;Oe.DebuggerStatementBase=zpe;Oe.DecoratableNode=qT;Oe.Decorator=Pw;Oe.DecoratorBase=TR;Oe.DefaultClause=UM;Oe.DefaultClauseBase=$pe;Oe.DefinitionInfo=FD;Oe.DeleteExpression=cM;Oe.DeleteExpressionBase=hpe;Oe.Diagnostic=WT;Oe.DiagnosticMessageChain=pS;Oe.DiagnosticWithLocation=fL;Oe.Directory=OE;Oe.DirectoryEmitResult=EL;Oe.DirectoryNotFoundError=yUe;Oe.DoStatement=KM;Oe.DoStatementBase=Xpe;Oe.DocumentSpan=dv;Oe.DotDotDotTokenableNode=bL;Oe.ElementAccessExpression=sL;Oe.ElementAccessExpressionBase=Epe;Oe.EmitOutput=pL;Oe.EmitResult=VT;Oe.EmptyStatement=WM;Oe.EmptyStatementBase=Ype;Oe.EnumDeclaration=VF;Oe.EnumDeclarationBase=LR;Oe.EnumMember=jF;Oe.EnumMemberBase=NR;Oe.ExclamationTokenableNode=$H;Oe.ExportAssignment=tw;Oe.ExportAssignmentBase=OH;Oe.ExportDeclaration=nw;Oe.ExportDeclarationBase=lR;Oe.ExportGetableNode=XH;Oe.ExportSpecifier=iw;Oe.ExportSpecifierBase=kH;Oe.ExportableNode=BE;Oe.Expression=oc;Oe.ExpressionStatement=VM;Oe.ExpressionStatementBase=Qpe;Oe.ExpressionWithTypeArguments=ww;Oe.ExpressionWithTypeArgumentsBase=kme;Oe.ExpressionableNode=DL;Oe.ExpressionedNode=ud;Oe.ExtendsClauseableNode=ipe;Oe.ExternalModuleReference=aw;Oe.ExternalModuleReferenceBase=cme;Oe.FalseLiteral=f6;Oe.FalseLiteralBase=e_e;Oe.FileNotFoundError=dUe;Oe.FileReference=OD;Oe.FileTextChanges=fS;Oe.ForInStatement=jM;Oe.ForInStatementBase=Zpe;Oe.ForOfStatement=HM;Oe.ForOfStatementBase=eme;Oe.ForStatement=qM;Oe.ForStatementBase=rme;Oe.FunctionDeclaration=Ew;Oe.FunctionDeclarationBase=mR;Oe.FunctionDeclarationOverloadBase=Sme;Oe.FunctionExpression=bw;Oe.FunctionExpressionBase=Tme;Oe.FunctionLikeDeclaration=YT;Oe.FunctionOrConstructorTypeNodeBase=uL;Oe.FunctionOrConstructorTypeNodeBaseBase=Pme;Oe.FunctionTypeNode=Fw;Oe.FunctionTypeNodeBase=Rme;Oe.GeneratorableNode=zT;Oe.GetAccessorDeclaration=Lw;Oe.GetAccessorDeclarationBase=ER;Oe.HeritageClause=HF;Oe.HeritageClauseableNode=QH;Oe.Identifier=D6;Oe.IdentifierBase=p_e;Oe.IfStatement=JM;Oe.IfStatementBase=tme;Oe.ImplementationLocation=mL;Oe.ImplementsClauseableNode=ape;Oe.ImportClause=ow;Oe.ImportClauseBase=dme;Oe.ImportDeclaration=sw;Oe.ImportDeclarationBase=uR;Oe.ImportEqualsDeclaration=lw;Oe.ImportEqualsDeclarationBase=pme;Oe.ImportExpression=dM;Oe.ImportExpressionBase=bpe;Oe.ImportExpressionedNode=p9e;Oe.ImportSpecifier=uw;Oe.ImportSpecifierBase=cR;Oe.ImportTypeAssertionContainer=Gw;Oe.ImportTypeNode=Bw;Oe.IndexSignatureDeclaration=$F;Oe.IndexSignatureDeclarationBase=OR;Oe.IndexedAccessTypeNode=Uw;Oe.InferTypeNode=Kw;Oe.InitializerExpressionGetableNode=z6;Oe.InitializerExpressionableNode=$T;Oe.InterfaceDeclaration=XF;Oe.InterfaceDeclarationBase=kR;Oe.IntersectionTypeNode=Ww;Oe.InvalidOperationError=cUe;Oe.IterationStatement=dS;Oe.JSDoc=Ow;Oe.JSDocAllType=iF;Oe.JSDocAugmentsTag=aF;Oe.JSDocAuthorTag=oF;Oe.JSDocBase=xR;Oe.JSDocCallbackTag=sF;Oe.JSDocClassTag=lF;Oe.JSDocDeprecatedTag=uF;Oe.JSDocEnumTag=cF;Oe.JSDocFunctionType=dF;Oe.JSDocFunctionTypeBase=Kme;Oe.JSDocImplementsTag=fF;Oe.JSDocLink=pF;Oe.JSDocLinkCode=mF;Oe.JSDocLinkPlain=_F;Oe.JSDocMemberName=gF;Oe.JSDocNameReference=vF;Oe.JSDocNamepathType=yF;Oe.JSDocNonNullableType=hF;Oe.JSDocNullableType=EF;Oe.JSDocOptionalType=bF;Oe.JSDocOverrideTag=SF;Oe.JSDocParameterTag=TF;Oe.JSDocParameterTagBase=Wme;Oe.JSDocPrivateTag=xF;Oe.JSDocPropertyLikeTag=aq;Oe.JSDocPropertyTag=DF;Oe.JSDocPropertyTagBase=Vme;Oe.JSDocProtectedTag=CF;Oe.JSDocPublicTag=AF;Oe.JSDocReadonlyTag=LF;Oe.JSDocReturnTag=NF;Oe.JSDocReturnTagBase=jme;Oe.JSDocSeeTag=IF;Oe.JSDocSeeTagBase=Hme;Oe.JSDocSignature=PF;Oe.JSDocTag=bc;Oe.JSDocTagBase=AR;Oe.JSDocTagInfo=cL;Oe.JSDocTemplateTag=OF;Oe.JSDocTemplateTagBase=qme;Oe.JSDocText=kF;Oe.JSDocThisTag=RF;Oe.JSDocThisTagBase=Jme;Oe.JSDocType=q_;Oe.JSDocTypeExpression=wF;Oe.JSDocTypeExpressionableTag=tG;Oe.JSDocTypeLiteral=FF;Oe.JSDocTypeParameteredTag=Nme;Oe.JSDocTypeTag=GF;Oe.JSDocTypedefTag=MF;Oe.JSDocUnknownTag=BF;Oe.JSDocUnknownType=UF;Oe.JSDocVariadicType=KF;Oe.JSDocableNode=sc;Oe.JsxAttribute=ZF;Oe.JsxAttributeBase=wR;Oe.JsxAttributedNode=oq;Oe.JsxClosingElement=e6;Oe.JsxClosingElementBase=zme;Oe.JsxClosingFragment=r6;Oe.JsxElement=t6;Oe.JsxElementBase=FR;Oe.JsxExpression=n6;Oe.JsxExpressionBase=$me;Oe.JsxFragment=i6;Oe.JsxOpeningElement=a6;Oe.JsxOpeningElementBase=Xme;Oe.JsxOpeningFragment=o6;Oe.JsxSelfClosingElement=s6;Oe.JsxSelfClosingElementBase=GR;Oe.JsxSpreadAttribute=l6;Oe.JsxSpreadAttributeBase=BR;Oe.JsxTagNamedNode=nG;Oe.JsxText=u6;Oe.JsxTextBase=Yme;Oe.LabeledStatement=zM;Oe.LabeledStatementBase=nme;Oe.LanguageService=K6;Oe.LeftHandSideExpression=RD;Oe.LeftHandSideExpressionedNode=XT;Oe.LiteralExpression=cS;Oe.LiteralExpressionBase=Spe;Oe.LiteralLikeNode=UD;Oe.LiteralTypeNode=Vw;Oe.ManipulationError=$R;Oe.ManipulationSettingsContainer=WR;Oe.MappedTypeNode=jw;Oe.MemberExpression=BT;Oe.MemoryEmitResult=M6;Oe.MetaProperty=fM;Oe.MetaPropertyBase=Tpe;Oe.MethodDeclaration=MD;Oe.MethodDeclarationBase=gR;Oe.MethodDeclarationOverloadBase=xme;Oe.MethodSignature=YF;Oe.MethodSignatureBase=RR;Oe.ModifierableNode=sf;Oe.ModuleBlock=cw;Oe.ModuleBlockBase=mme;Oe.ModuleChildableNode=yS;Oe.ModuleDeclaration=dw;Oe.ModuleDeclarationBase=dR;Oe.ModuleNamedNode=spe;Oe.ModuledNode=ZH;Oe.NameableNode=X6;Oe.NamedExports=fw;Oe.NamedExportsBase=_me;Oe.NamedImports=pw;Oe.NamedImportsBase=gme;Oe.NamedNode=mv;Oe.NamedNodeBase=KD;Oe.NamedTupleMember=Hw;Oe.NamedTupleMemberBase=Mme;Oe.NamespaceExport=mw;Oe.NamespaceExportBase=yme;Oe.NamespaceImport=_w;Oe.NamespaceImportBase=vme;Oe.NewExpression=pM;Oe.NewExpressionBase=xpe;Oe.NoSubstitutionTemplateLiteral=y6;Oe.NoSubstitutionTemplateLiteralBase=o_e;Oe.Node=Tr;Oe.NodeWithTypeArguments=KT;Oe.NodeWithTypeArgumentsBase=Ime;Oe.NonNullExpression=mM;Oe.NonNullExpressionBase=Dpe;Oe.NotEmittedStatement=$M;Oe.NotEmittedStatementBase=ime;Oe.NotImplementedError=vUe;Oe.NotSupportedError=hUe;Oe.NullLiteral=p6;Oe.NullLiteralBase=t_e;Oe.NumericLiteral=m6;Oe.NumericLiteralBase=n_e;Oe.ObjectBindingPattern=tM;Oe.ObjectDestructuringAssignment=NH;Oe.ObjectDestructuringAssignmentBase=Cpe;Oe.ObjectLiteralElement=UT;Oe.ObjectLiteralExpression=gM;Oe.ObjectLiteralExpressionBase=Ape;Oe.OmittedExpression=EM;Oe.OmittedExpressionBase=Lpe;Oe.OutputFile=R6;Oe.OverloadableNode=eG;Oe.OverrideableNode=TL;Oe.ParameterDeclaration=Sw;Oe.ParameterDeclarationBase=_R;Oe.ParameteredNode=lpe;Oe.ParenthesizedExpression=bM;Oe.ParenthesizedExpressionBase=Npe;Oe.ParenthesizedTypeNode=qw;Oe.PartiallyEmittedExpression=SM;Oe.PartiallyEmittedExpressionBase=Ipe;Oe.PathNotFoundError=EUe;Oe.PostfixUnaryExpression=TM;Oe.PostfixUnaryExpressionBase=Ppe;Oe.PrefixUnaryExpression=xM;Oe.PrefixUnaryExpressionBase=Ope;Oe.PrimaryExpression=sd;Oe.PrivateIdentifier=C6;Oe.PrivateIdentifierBase=m_e;Oe.Program=U6;Oe.Project=UH;Oe.PropertyAccessExpression=lL;Oe.PropertyAccessExpressionBase=kpe;Oe.PropertyAssignment=yM;Oe.PropertyAssignmentBase=iR;Oe.PropertyDeclaration=Nw;Oe.PropertyDeclarationBase=bR;Oe.PropertyNamedNode=UE;Oe.PropertySignature=QF;Oe.PropertySignatureBase=MR;Oe.QualifiedName=A6;Oe.QuestionDotTokenableNode=Y6;Oe.QuestionTokenableNode=Rh;Oe.ReadonlyableNode=xL;Oe.RefactorEditInfo=_L;Oe.ReferenceEntry=w6;Oe.ReferenceFindableNode=kh;Oe.ReferencedSymbol=gL;Oe.ReferencedSymbolDefinitionInfo=yL;Oe.ReferencedSymbolEntry=F6;Oe.RegularExpressionLiteral=_6;Oe.RegularExpressionLiteralBase=i_e;Oe.RenameLocation=G6;Oe.RenameableNode=pv;Oe.ReturnStatement=XM;Oe.ReturnStatementBase=ame;Oe.ReturnTypedNode=eq;Oe.ScopeableNode=upe;Oe.ScopedNode=_S;Oe.SetAccessorDeclaration=Iw;Oe.SetAccessorDeclarationBase=SR;Oe.ShorthandPropertyAssignment=vM;Oe.ShorthandPropertyAssignmentBase=aR;Oe.Signature=I6;Oe.SignaturedDeclaration=_v;Oe.SourceFile=kE;Oe.SourceFileBase=fR;Oe.SpreadAssignment=hM;Oe.SpreadAssignmentBase=oR;Oe.SpreadElement=DM;Oe.SpreadElementBase=Rpe;Oe.Statement=Cl;Oe.StatementBase=Vpe;Oe.StatementedNode=Mh;Oe.StaticableNode=WD;Oe.StringLiteral=g6;Oe.StringLiteralBase=a_e;Oe.Structure=rL;Oe.SuperElementAccessExpression=IH;Oe.SuperElementAccessExpressionBase=Mpe;Oe.SuperExpression=CM;Oe.SuperExpressionBase=wpe;Oe.SuperExpressionedNode=nq;Oe.SuperPropertyAccessExpression=PH;Oe.SuperPropertyAccessExpressionBase=Fpe;Oe.SwitchStatement=YM;Oe.SwitchStatementBase=ome;Oe.Symbol=P6;Oe.SymbolDisplayPart=B6;Oe.SyntaxList=YR;Oe.TaggedTemplateExpression=v6;Oe.TemplateExpression=h6;Oe.TemplateExpressionBase=s_e;Oe.TemplateHead=E6;Oe.TemplateHeadBase=l_e;Oe.TemplateLiteralTypeNode=Jw;Oe.TemplateMiddle=b6;Oe.TemplateMiddleBase=u_e;Oe.TemplateSpan=S6;Oe.TemplateSpanBase=c_e;Oe.TemplateTail=T6;Oe.TemplateTailBase=d_e;Oe.TextChange=FE;Oe.TextInsertableNode=ld;Oe.TextRange=nL;Oe.TextSpan=wD;Oe.ThisExpression=AM;Oe.ThisExpressionBase=Gpe;Oe.ThisTypeNode=zw;Oe.ThrowStatement=QM;Oe.ThrowStatementBase=sme;Oe.TrueLiteral=d6;Oe.TrueLiteralBase=Zme;Oe.TryStatement=ZM;Oe.TryStatementBase=lme;Oe.TupleTypeNode=$w;Oe.Type=hL;Oe.TypeAliasDeclaration=Xw;Oe.TypeAliasDeclarationBase=DR;Oe.TypeArgumentedNode=Q6;Oe.TypeAssertion=LM;Oe.TypeAssertionBase=Bpe;Oe.TypeChecker=vL;Oe.TypeElement=wE;Oe.TypeElementMemberedNode=tq;Oe.TypeLiteralNode=Yw;Oe.TypeLiteralNodeBase=wme;Oe.TypeNode=wc;Oe.TypeOfExpression=NM;Oe.TypeOfExpressionBase=Upe;Oe.TypeOperatorTypeNode=Qw;Oe.TypeParameter=W6;Oe.TypeParameterDeclaration=Zw;Oe.TypeParameterDeclarationBase=CR;Oe.TypeParameteredNode=J_;Oe.TypePredicateNode=eF;Oe.TypeQueryNode=rF;Oe.TypeReferenceNode=tF;Oe.TypedNode=KE;Oe.UnaryExpression=cv;Oe.UnaryExpressionedNode=jD;Oe.UnionTypeNode=nF;Oe.UnwrappableNode=Z6;Oe.UpdateExpression=nM;Oe.VariableDeclaration=L6;Oe.VariableDeclarationBase=UR;Oe.VariableDeclarationList=N6;Oe.VariableDeclarationListBase=__e;Oe.VariableStatement=gw;Oe.VariableStatementBase=pR;Oe.VoidExpression=IM;Oe.VoidExpressionBase=Kpe;Oe.WhileStatement=yw;Oe.WhileStatementBase=hme;Oe.WithStatement=vw;Oe.WithStatementBase=Eme;Oe.Writers=KH;Oe.YieldExpression=PM;Oe.YieldExpressionBase=Wpe;Oe.createWrappedNode=oUe;Oe.forEachStructureChild=A7e;Oe.getCompilerOptionsFromTsConfig=GBe;Oe.getScopeForNode=ZR;Oe.insertOverloads=rG;Oe.printNode=sj;Oe.setScopeForNode=rq});var Yg=gt((hYe,oG)=>{var E_e,b_e,S_e,T_e,x_e,D_e,C_e,A_e,L_e,iG,uq,N_e,I_e,P_e,qD,O_e,k_e,R_e,M_e,w_e,F_e,G_e,B_e,U_e,aG;(function(e){var r=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){e(n(r,n(i)))}):typeof oG=="object"&&typeof oG.exports=="object"?e(n(r,n(oG.exports))):e(n(r));function n(i,a){return i!==r&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(s,u){return i[s]=a?a(s,u):u}}})(function(e){var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(i[s]=a[s])};E_e=function(i,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");r(i,a);function s(){this.constructor=i}i.prototype=a===null?Object.create(a):(s.prototype=a.prototype,new s)},b_e=Object.assign||function(i){for(var a,s=1,u=arguments.length;s<u;s++){a=arguments[s];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(i[p]=a[p])}return i},S_e=function(i,a){var s={};for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&a.indexOf(u)<0&&(s[u]=i[u]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var p=0,u=Object.getOwnPropertySymbols(i);p<u.length;p++)a.indexOf(u[p])<0&&Object.prototype.propertyIsEnumerable.call(i,u[p])&&(s[u[p]]=i[u[p]]);return s},T_e=function(i,a,s,u){var p=arguments.length,f=p<3?a:u===null?u=Object.getOwnPropertyDescriptor(a,s):u,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(i,a,s,u);else for(var g=i.length-1;g>=0;g--)(m=i[g])&&(f=(p<3?m(f):p>3?m(a,s,f):m(a,s))||f);return p>3&&f&&Object.defineProperty(a,s,f),f},x_e=function(i,a){return function(s,u){a(s,u,i)}},D_e=function(i,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,a)},C_e=function(i,a,s,u){function p(f){return f instanceof s?f:new s(function(m){m(f)})}return new(s||(s=Promise))(function(f,m){function g(B){try{P(u.next(B))}catch(K){m(K)}}function D(B){try{P(u.throw(B))}catch(K){m(K)}}function P(B){B.done?f(B.value):p(B.value).then(g,D)}P((u=u.apply(i,a||[])).next())})},A_e=function(i,a){var s={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},u,p,f,m;return m={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function g(P){return function(B){return D([P,B])}}function D(P){if(u)throw new TypeError("Generator is already executing.");for(;s;)try{if(u=1,p&&(f=P[0]&2?p.return:P[0]?p.throw||((f=p.return)&&f.call(p),0):p.next)&&!(f=f.call(p,P[1])).done)return f;switch(p=0,f&&(P=[P[0]&2,f.value]),P[0]){case 0:case 1:f=P;break;case 4:return s.label++,{value:P[1],done:!1};case 5:s.label++,p=P[1],P=[0];continue;case 7:P=s.ops.pop(),s.trys.pop();continue;default:if(f=s.trys,!(f=f.length>0&&f[f.length-1])&&(P[0]===6||P[0]===2)){s=0;continue}if(P[0]===3&&(!f||P[1]>f[0]&&P[1]<f[3])){s.label=P[1];break}if(P[0]===6&&s.label<f[1]){s.label=f[1],f=P;break}if(f&&s.label<f[2]){s.label=f[2],s.ops.push(P);break}f[2]&&s.ops.pop(),s.trys.pop();continue}P=a.call(i,s)}catch(B){P=[6,B],p=0}finally{u=f=0}if(P[0]&5)throw P[1];return{value:P[0]?P[1]:void 0,done:!0}}},L_e=function(i,a){for(var s in i)s!=="default"&&!Object.prototype.hasOwnProperty.call(a,s)&&aG(a,i,s)},aG=Object.create?function(i,a,s,u){u===void 0&&(u=s);var p=Object.getOwnPropertyDescriptor(a,s);(!p||("get"in p?!a.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return a[s]}}),Object.defineProperty(i,u,p)}:function(i,a,s,u){u===void 0&&(u=s),i[u]=a[s]},iG=function(i){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&i[a],u=0;if(s)return s.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&u>=i.length&&(i=void 0),{value:i&&i[u++],done:!i}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")},uq=function(i,a){var s=typeof Symbol=="function"&&i[Symbol.iterator];if(!s)return i;var u=s.call(i),p,f=[],m;try{for(;(a===void 0||a-- >0)&&!(p=u.next()).done;)f.push(p.value)}catch(g){m={error:g}}finally{try{p&&!p.done&&(s=u.return)&&s.call(u)}finally{if(m)throw m.error}}return f},N_e=function(){for(var i=[],a=0;a<arguments.length;a++)i=i.concat(uq(arguments[a]));return i},I_e=function(){for(var i=0,a=0,s=arguments.length;a<s;a++)i+=arguments[a].length;for(var u=Array(i),p=0,a=0;a<s;a++)for(var f=arguments[a],m=0,g=f.length;m<g;m++,p++)u[p]=f[m];return u},P_e=function(i,a,s){if(s||arguments.length===2)for(var u=0,p=a.length,f;u<p;u++)(f||!(u in a))&&(f||(f=Array.prototype.slice.call(a,0,u)),f[u]=a[u]);return i.concat(f||Array.prototype.slice.call(a))},qD=function(i){return this instanceof qD?(this.v=i,this):new qD(i)},O_e=function(i,a,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u=s.apply(i,a||[]),p,f=[];return p={},m("next"),m("throw"),m("return"),p[Symbol.asyncIterator]=function(){return this},p;function m(h){u[h]&&(p[h]=function(S){return new Promise(function(U,C){f.push([h,S,U,C])>1||g(h,S)})})}function g(h,S){try{D(u[h](S))}catch(U){K(f[0][3],U)}}function D(h){h.value instanceof qD?Promise.resolve(h.value.v).then(P,B):K(f[0][2],h)}function P(h){g("next",h)}function B(h){g("throw",h)}function K(h,S){h(S),f.shift(),f.length&&g(f[0][0],f[0][1])}},k_e=function(i){var a,s;return a={},u("next"),u("throw",function(p){throw p}),u("return"),a[Symbol.iterator]=function(){return this},a;function u(p,f){a[p]=i[p]?function(m){return(s=!s)?{value:qD(i[p](m)),done:p==="return"}:f?f(m):m}:f}},R_e=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i[Symbol.asyncIterator],s;return a?a.call(i):(i=typeof iG=="function"?iG(i):i[Symbol.iterator](),s={},u("next"),u("throw"),u("return"),s[Symbol.asyncIterator]=function(){return this},s);function u(f){s[f]=i[f]&&function(m){return new Promise(function(g,D){m=i[f](m),p(g,D,m.done,m.value)})}}function p(f,m,g,D){Promise.resolve(D).then(function(P){f({value:P,done:g})},m)}},M_e=function(i,a){return Object.defineProperty?Object.defineProperty(i,"raw",{value:a}):i.raw=a,i};var n=Object.create?function(i,a){Object.defineProperty(i,"default",{enumerable:!0,value:a})}:function(i,a){i.default=a};w_e=function(i){if(i&&i.__esModule)return i;var a={};if(i!=null)for(var s in i)s!=="default"&&Object.prototype.hasOwnProperty.call(i,s)&&aG(a,i,s);return n(a,i),a},F_e=function(i){return i&&i.__esModule?i:{default:i}},G_e=function(i,a,s,u){if(s==="a"&&!u)throw new TypeError("Private accessor was defined without a getter");if(typeof a=="function"?i!==a||!u:!a.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?u:s==="a"?u.call(i):u?u.value:a.get(i)},B_e=function(i,a,s,u,p){if(u==="m")throw new TypeError("Private method is not writable");if(u==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof a=="function"?i!==a||!p:!a.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u==="a"?p.call(i,s):p?p.value=s:a.set(i,s),s},U_e=function(i,a){if(a===null||typeof a!="object"&&typeof a!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof i=="function"?a===i:i.has(a)},e("__extends",E_e),e("__assign",b_e),e("__rest",S_e),e("__decorate",T_e),e("__param",x_e),e("__metadata",D_e),e("__awaiter",C_e),e("__generator",A_e),e("__exportStar",L_e),e("__createBinding",aG),e("__values",iG),e("__read",uq),e("__spread",N_e),e("__spreadArrays",I_e),e("__spreadArray",P_e),e("__await",qD),e("__asyncGenerator",O_e),e("__asyncDelegator",k_e),e("__asyncValues",R_e),e("__makeTemplateObject",M_e),e("__importStar",w_e),e("__importDefault",F_e),e("__classPrivateFieldGet",G_e),e("__classPrivateFieldSet",B_e),e("__classPrivateFieldIn",U_e)})});var K_e=gt(JD=>{"use strict";Object.defineProperty(JD,"__esModule",{value:!0});JD.lowerCase=JD.localeLowerCase=void 0;var bUe={tr:{regexp:/\u0130|\u0049|\u0049\u0307/g,map:{\u0130:"i",I:"\u0131",I\u0307:"i"}},az:{regexp:/\u0130/g,map:{\u0130:"i",I:"\u0131",I\u0307:"i"}},lt:{regexp:/\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,map:{I:"i\u0307",J:"j\u0307",\u012E:"\u012F\u0307",\u00CC:"i\u0307\u0300",\u00CD:"i\u0307\u0301",\u0128:"i\u0307\u0303"}}};function SUe(e,r){var n=bUe[r.toLowerCase()];return cq(n?e.replace(n.regexp,function(i){return n.map[i]}):e)}JD.localeLowerCase=SUe;function cq(e){return e.toLowerCase()}JD.lowerCase=cq});var QT=gt(sG=>{"use strict";Object.defineProperty(sG,"__esModule",{value:!0});sG.noCase=void 0;var TUe=K_e(),xUe=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],DUe=/[^A-Z0-9]+/gi;function CUe(e,r){r===void 0&&(r={});for(var n=r.splitRegexp,i=n===void 0?xUe:n,a=r.stripRegexp,s=a===void 0?DUe:a,u=r.transform,p=u===void 0?TUe.lowerCase:u,f=r.delimiter,m=f===void 0?" ":f,g=W_e(W_e(e,i,"$1\0$2"),s,"\0"),D=0,P=g.length;g.charAt(D)==="\0";)D++;for(;g.charAt(P-1)==="\0";)P--;return g.slice(D,P).split("\0").map(p).join(m)}sG.noCase=CUe;function W_e(e,r,n){return r instanceof RegExp?e.replace(r,n):r.reduce(function(i,a){return i.replace(a,n)},e)}});var dq=gt(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});vS.pascalCase=vS.pascalCaseTransformMerge=vS.pascalCaseTransform=void 0;var AUe=Yg(),LUe=QT();function V_e(e,r){var n=e.charAt(0),i=e.substr(1).toLowerCase();return r>0&&n>="0"&&n<="9"?"_"+n+i:""+n.toUpperCase()+i}vS.pascalCaseTransform=V_e;function NUe(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}vS.pascalCaseTransformMerge=NUe;function IUe(e,r){return r===void 0&&(r={}),LUe.noCase(e,AUe.__assign({delimiter:"",transform:V_e},r))}vS.pascalCase=IUe});var H_e=gt(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});hS.camelCase=hS.camelCaseTransformMerge=hS.camelCaseTransform=void 0;var PUe=Yg(),fq=dq();function j_e(e,r){return r===0?e.toLowerCase():fq.pascalCaseTransform(e,r)}hS.camelCaseTransform=j_e;function OUe(e,r){return r===0?e.toLowerCase():fq.pascalCaseTransformMerge(e)}hS.camelCaseTransformMerge=OUe;function kUe(e,r){return r===void 0&&(r={}),fq.pascalCase(e,PUe.__assign({transform:j_e},r))}hS.camelCase=kUe});var pq=gt(lG=>{"use strict";Object.defineProperty(lG,"__esModule",{value:!0});lG.upperCaseFirst=void 0;function RUe(e){return e.charAt(0).toUpperCase()+e.substr(1)}lG.upperCaseFirst=RUe});var mq=gt(zD=>{"use strict";Object.defineProperty(zD,"__esModule",{value:!0});zD.capitalCase=zD.capitalCaseTransform=void 0;var MUe=Yg(),wUe=QT(),FUe=pq();function q_e(e){return FUe.upperCaseFirst(e.toLowerCase())}zD.capitalCaseTransform=q_e;function GUe(e,r){return r===void 0&&(r={}),wUe.noCase(e,MUe.__assign({delimiter:" ",transform:q_e},r))}zD.capitalCase=GUe});var J_e=gt($D=>{"use strict";Object.defineProperty($D,"__esModule",{value:!0});$D.upperCase=$D.localeUpperCase=void 0;var BUe={tr:{regexp:/[\u0069]/g,map:{i:"\u0130"}},az:{regexp:/[\u0069]/g,map:{i:"\u0130"}},lt:{regexp:/[\u0069\u006A\u012F]\u0307|\u0069\u0307[\u0300\u0301\u0303]/g,map:{i\u0307:"I",j\u0307:"J",\u012F\u0307:"\u012E",i\u0307\u0300:"\xCC",i\u0307\u0301:"\xCD",i\u0307\u0303:"\u0128"}}};function UUe(e,r){var n=BUe[r.toLowerCase()];return _q(n?e.replace(n.regexp,function(i){return n.map[i]}):e)}$D.localeUpperCase=UUe;function _q(e){return e.toUpperCase()}$D.upperCase=_q});var z_e=gt(uG=>{"use strict";Object.defineProperty(uG,"__esModule",{value:!0});uG.constantCase=void 0;var KUe=Yg(),WUe=QT(),VUe=J_e();function jUe(e,r){return r===void 0&&(r={}),WUe.noCase(e,KUe.__assign({delimiter:"_",transform:VUe.upperCase},r))}uG.constantCase=jUe});var kL=gt(cG=>{"use strict";Object.defineProperty(cG,"__esModule",{value:!0});cG.dotCase=void 0;var HUe=Yg(),qUe=QT();function JUe(e,r){return r===void 0&&(r={}),qUe.noCase(e,HUe.__assign({delimiter:"."},r))}cG.dotCase=JUe});var $_e=gt(dG=>{"use strict";Object.defineProperty(dG,"__esModule",{value:!0});dG.headerCase=void 0;var zUe=Yg(),$Ue=mq();function XUe(e,r){return r===void 0&&(r={}),$Ue.capitalCase(e,zUe.__assign({delimiter:"-"},r))}dG.headerCase=XUe});var X_e=gt(fG=>{"use strict";Object.defineProperty(fG,"__esModule",{value:!0});fG.paramCase=void 0;var YUe=Yg(),QUe=kL();function ZUe(e,r){return r===void 0&&(r={}),QUe.dotCase(e,YUe.__assign({delimiter:"-"},r))}fG.paramCase=ZUe});var Y_e=gt(pG=>{"use strict";Object.defineProperty(pG,"__esModule",{value:!0});pG.pathCase=void 0;var eKe=Yg(),rKe=kL();function tKe(e,r){return r===void 0&&(r={}),rKe.dotCase(e,eKe.__assign({delimiter:"/"},r))}pG.pathCase=tKe});var Z_e=gt(XD=>{"use strict";Object.defineProperty(XD,"__esModule",{value:!0});XD.sentenceCase=XD.sentenceCaseTransform=void 0;var nKe=Yg(),iKe=QT(),aKe=pq();function Q_e(e,r){var n=e.toLowerCase();return r===0?aKe.upperCaseFirst(n):n}XD.sentenceCaseTransform=Q_e;function oKe(e,r){return r===void 0&&(r={}),iKe.noCase(e,nKe.__assign({delimiter:" ",transform:Q_e},r))}XD.sentenceCase=oKe});var ege=gt(mG=>{"use strict";Object.defineProperty(mG,"__esModule",{value:!0});mG.snakeCase=void 0;var sKe=Yg(),lKe=kL();function uKe(e,r){return r===void 0&&(r={}),lKe.dotCase(e,sKe.__assign({delimiter:"_"},r))}mG.snakeCase=uKe});var gq=gt(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var gv=Yg();gv.__exportStar(H_e(),z_);gv.__exportStar(mq(),z_);gv.__exportStar(z_e(),z_);gv.__exportStar(kL(),z_);gv.__exportStar($_e(),z_);gv.__exportStar(QT(),z_);gv.__exportStar(X_e(),z_);gv.__exportStar(dq(),z_);gv.__exportStar(Y_e(),z_);gv.__exportStar(Z_e(),z_);gv.__exportStar(ege(),z_)});var hq=gt((KYe,cKe)=>{cKe.exports={name:"zenstack",publisher:"zenstack",displayName:"ZenStack Language Tools",description:"ZenStack is a toolkit that simplifies full-stack development",version:"0.1.51",author:{name:"ymc9"},keywords:["fullstack","react","typescript","data modeling"],preview:!0,icon:"asset/logo-light-256.png",repository:{type:"git",url:"https://github.com/zenstackhq/zenstack"},engines:{vscode:"^1.72.0"},categories:["Programming Languages"],contributes:{languages:[{id:"zmodel",aliases:["ZenStack Model","zmodel"],extensions:[".zmodel"],configuration:"./language-configuration.json",icon:{light:"./asset/logo-light-256.png",dark:"./asset/logo-dark-256.png"}}],grammars:[{language:"zmodel",scopeName:"source.zmodel",path:"./syntaxes/zmodel.tmLanguage.json"}]},activationEvents:["onLanguage:zmodel"],files:["bin","src","bundle"],bin:{zenstack:"./bin/cli"},main:"./bundle/extension.js",scripts:{"vscode:publish":"vsce publish --no-dependencies","vscode:prepublish":"pnpm lint && pnpm build && pnpm bundle","vscode:package":"vsce package --no-dependencies",build:"pnpm langium:generate && tsc --noEmit",bundle:"node build/bundle.js --minify","bundle-watch":"node build/bundle.js --watch","ts:watch":"tsc --watch --noEmit","tsc-alias:watch":"tsc-alias --watch",lint:"eslint src --ext ts","langium:generate":"langium generate","langium:watch":"langium generate --watch",watch:'concurrently --kill-others "npm:langium:watch" "npm:bundle-watch"',test:"jest",prepublishOnly:"pnpm build && pnpm bundle"},dependencies:{"@zenstackhq/internal":"workspace:*","change-case":"^4.1.2",chevrotain:"^9.1.0",colors:"^1.4.0",commander:"^8.3.0",langium:"^0.5.0",pluralize:"^8.0.0",prisma:"^4.5.0",promisify:"^0.0.3","ts-morph":"^16.0.0",uuid:"^9.0.0","vscode-jsonrpc":"^8.0.2","vscode-languageclient":"^8.0.2","vscode-languageserver":"^8.0.2","vscode-languageserver-textdocument":"^1.0.7","vscode-uri":"^3.0.6"},devDependencies:{"@prisma/internals":"^4.5.0","@types/jest":"^29.2.0","@types/node":"^14.18.32","@types/pluralize":"^0.0.29","@types/tmp":"^0.2.3","@types/uuid":"^8.3.4","@types/vscode":"^1.72.0","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.33.0",concurrently:"^7.4.0",esbuild:"^0.15.12",eslint:"^7.32.0",jest:"^29.2.1","langium-cli":"^0.5.0",tmp:"^0.2.1","ts-jest":"^29.0.3","ts-node":"^10.9.1","tsc-alias":"^1.7.0","tsconfig-paths-jest":"^0.0.1",typescript:"^4.8.4",vsce:"^2.13.0"}}});var fKe={};XDe(fKe,{default:()=>dKe,generateAction:()=>uge});module.exports=YDe(fKe);var vG=Gs(cQ()),sge=Gs(mQ());var _oe=Gs(CE()),foe="AbstractDeclaration";var f6e="Expression";var poe="ReferenceTarget";var JO="TypeDeclaration";var Hx="ArrayExpr";function zO(e){return iv.isInstance(e,Hx)}var rK="Attribute";var goe="AttributeArg";var TA="BinaryExpr";var $O="DataModel";function G_(e){return iv.isInstance(e,$O)}var tK="DataModelField";function qx(e){return iv.isInstance(e,tK)}var XO="DataSource";function yoe(e){return iv.isInstance(e,XO)}var YO="Enum";function voe(e){return iv.isInstance(e,YO)}var QO="EnumField";function Jx(e){return iv.isInstance(e,QO)}var moe="Function";var p6e="FunctionParam";var zx="InvocationExpr";function xA(e){return iv.isInstance(e,zx)}var Ub="LiteralExpr";function vh(e){return iv.isInstance(e,Ub)}var Kb="MemberAccessExpr";function nK(e){return iv.isInstance(e,Kb)}var DA="NullExpr";var Wb="ReferenceExpr";function Vb(e){return iv.isInstance(e,Wb)}var $x="ThisExpr";function xT(e){return iv.isInstance(e,$x)}var CA="UnaryExpr";var SA=class{getAllTypes(){return["AbstractDeclaration","Argument","ArrayExpr","Attribute","AttributeArg","AttributeParam","AttributeParamType","BinaryExpr","DataModel","DataModelAttribute","DataModelField","DataModelFieldAttribute","DataModelFieldType","DataSource","DataSourceField","Enum","EnumField","Expression","Function","FunctionParam","FunctionParamType","InvocationExpr","LiteralExpr","MemberAccessExpr","Model","NullExpr","ReferenceArg","ReferenceExpr","ReferenceTarget","ThisExpr","TypeDeclaration","UnaryExpr"]}isInstance(r,n){return(0,_oe.isAstNode)(r)&&this.isSubtype(r.$type,n)}isSubtype(r,n){if(r===n)return!0;switch(r){case Hx:case TA:case zx:case Ub:case Kb:case DA:case Wb:case $x:case CA:return this.isSubtype(f6e,n);case rK:case XO:case moe:return this.isSubtype(foe,n);case $O:case YO:return this.isSubtype(foe,n)||this.isSubtype(JO,n);case tK:case QO:case p6e:return this.isSubtype(poe,n);default:return!1}}getReferenceType(r){let n=`${r.container.$type}:${r.property}`;switch(n){case"AttributeParamType:reference":return JO;case"DataModelAttribute:decl":return rK;case"DataModelFieldAttribute:decl":return rK;case"DataModelFieldType:reference":return JO;case"FunctionParamType:reference":return JO;case"InvocationExpr:function":return moe;case"MemberAccessExpr:member":return tK;case"ReferenceExpr:target":return poe;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(r){switch(r){case"ArrayExpr":return{name:"ArrayExpr",mandatory:[{name:"items",type:"array"}]};case"Attribute":return{name:"Attribute",mandatory:[{name:"params",type:"array"}]};case"AttributeParam":return{name:"AttributeParam",mandatory:[{name:"default",type:"boolean"}]};case"AttributeParamType":return{name:"AttributeParamType",mandatory:[{name:"array",type:"boolean"},{name:"optional",type:"boolean"}]};case"DataModel":return{name:"DataModel",mandatory:[{name:"attributes",type:"array"},{name:"fields",type:"array"}]};case"DataModelAttribute":return{name:"DataModelAttribute",mandatory:[{name:"args",type:"array"}]};case"DataModelField":return{name:"DataModelField",mandatory:[{name:"attributes",type:"array"}]};case"DataModelFieldAttribute":return{name:"DataModelFieldAttribute",mandatory:[{name:"args",type:"array"}]};case"DataModelFieldType":return{name:"DataModelFieldType",mandatory:[{name:"array",type:"boolean"},{name:"optional",type:"boolean"}]};case"DataSource":return{name:"DataSource",mandatory:[{name:"fields",type:"array"}]};case"Enum":return{name:"Enum",mandatory:[{name:"fields",type:"array"}]};case"Function":return{name:"Function",mandatory:[{name:"params",type:"array"}]};case"FunctionParamType":return{name:"FunctionParamType",mandatory:[{name:"array",type:"boolean"}]};case"InvocationExpr":return{name:"InvocationExpr",mandatory:[{name:"args",type:"array"}]};case"Model":return{name:"Model",mandatory:[{name:"declarations",type:"array"}]};case"ReferenceExpr":return{name:"ReferenceExpr",mandatory:[{name:"args",type:"array"}]};default:return{name:r,mandatory:[]}}}},iv=new SA;var hoe=Gs(CE()),ZO,Eoe=()=>ZO!=null?ZO:ZO=(0,hoe.loadGrammarFromJson)(`{
4252
+ `)}getTags(){var r,n;return(n=(r=this.compilerNode.tags)===null||r===void 0?void 0:r.map(i=>this._getNodeFromCompilerNode(i)))!==null&&n!==void 0?n:[]}getInnerText(){return RH(this.getText())}getComment(){if(this.compilerNode.comment!=null)return typeof this.compilerNode.comment=="string"?this.compilerNode.comment:this.compilerNode.comment.map(r=>this._getNodeFromCompilerNodeIfExists(r))}getCommentText(){return typeof this.compilerNode.comment=="string"?this.compilerNode.comment:b.ts.getTextOfJSDocComment(this.compilerNode.comment)}getDescription(){var r,n;let i=this.getSourceFile().getFullText(),a=(n=(r=this.getTags()[0])===null||r===void 0?void 0:r.getStart())!==null&&n!==void 0?n:this.getEnd()-2,s=u(this);return RH(i.substring(s,Math.max(s,p())));function u(f){let m=f.getStart()+3;return i.charCodeAt(m)===ac.SPACE?m+1:m}function p(){let f=uv(i,a,m=>m===ac.NEWLINE||!b.StringUtils.isWhitespaceCharCode(m)&&m!==ac.ASTERISK);return uv(i,f,m=>m!==ac.NEWLINE&&m!==ac.CARRIAGE_RETURN)}}setDescription(r){let n=this.getTags(),i=this.getStart()+3,a=n.length>0?uv(this._sourceFile.getFullText(),n[0].getStart(),u=>u===ac.ASTERISK)-1:this.getEnd()-2;return E7e({parent:this,newText:s.call(this),replacePos:i,replacingLength:a-i}),this;function s(){var u,p;let f=this.getIndentationText(),m=this._context.manipulationSettings.getNewLineKindAsString(),g=$g(this._getWriter(),r).split(/\r?\n/),D=g[0].length===0,P=g.length===1&&((p=(u=this.compilerNode.tags)===null||u===void 0?void 0:u.length)!==null&&p!==void 0?p:0)===0,B=P?g[0]:g.map(K=>K.length===0?`${f} *`:`${f} * ${K}`).slice(D?1:0).join(m);return P?" "+B+" ":m+B+m+f+" "}}addTag(r){return this.addTags([r])[0]}addTags(r){var n,i;return this.insertTags((i=(n=this.compilerNode.tags)===null||n===void 0?void 0:n.length)!==null&&i!==void 0?i:0,r)}insertTag(r,n){return this.insertTags(r,[n])[0]}insertTags(r,n){if(b.ArrayUtils.isNullOrEmpty(n))return[];let i=this._getWriterWithQueuedIndentation(),a=this.getTags();if(r=ku(r,a.length),a.length===0&&!this.isMultiLine()){let p=this._context.structurePrinterFactory.forJSDoc();this.replaceWithText(f=>{p.printText(f,{description:this.getDescription(),tags:n})})}else{let p=this._context.structurePrinterFactory.forJSDocTag({printStarsOnNewLine:!0});i.newLine().write(" * "),p.printTexts(i,n),i.newLine().write(" *"),i.conditionalWrite(r<a.length," ");let f=s.call(this),m=u.call(this);qa({parent:this,insertPos:f,replacing:{textLength:m-f},newText:i.toString()})}return af(a,this.getTags(),r,!1);function s(){let p=r<a.length?a[r].getStart():this.getEnd()-2,f=this.getStart()+3;return Math.max(f,uv(this.getSourceFile().getFullText(),p,m=>!b.StringUtils.isWhitespaceCharCode(m)&&m!==ac.ASTERISK))}function u(){return r<a.length?a[r].getStart():this.getEnd()-1}}remove(){Bs({children:[this],removeFollowingSpaces:!0,removeFollowingNewLines:!0})}set(r){return io(xR.prototype,this,r),r.tags!=null?this.replaceWithText(n=>{var i;this._context.structurePrinterFactory.forJSDoc().printText(n,{description:(i=r.description)!==null&&i!==void 0?i:this.getDescription(),tags:r.tags})}):(r.description!=null&&this.setDescription(r.description),this)}getStructure(){return uo(xR.prototype,this,{kind:Oe.StructureKind.JSDoc,description:this.getDescription(),tags:this.getTags().map(r=>r.getStructure())})}},wc=class extends Tr{},Ime=Q6(wc),KT=class extends Ime{},kw=class extends wc{getElementTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.elementType)}},Rw=class extends wc{getCheckType(){return this._getNodeFromCompilerNode(this.compilerNode.checkType)}getExtendsType(){return this._getNodeFromCompilerNode(this.compilerNode.extendsType)}getTrueType(){return this._getNodeFromCompilerNode(this.compilerNode.trueType)}getFalseType(){return this._getNodeFromCompilerNode(this.compilerNode.falseType)}},Pme=_v(wc),uL=class extends Pme{},Ome=gS(sf(uL)),Mw=class extends Ome{},kme=XT(KT),ww=class extends kme{},Rme=J_(uL),Fw=class extends Rme{},Gw=class extends Tr{getAssertClause(){return this._getNodeFromCompilerNode(this.compilerNode.assertClause)}isMultiline(){var r;return(r=this.compilerNode.multiLine)!==null&&r!==void 0?r:!1}},Bw=class extends KT{setArgument(r){let n=this.getArgument();if(Tr.isLiteralTypeNode(n)){let i=n.getLiteral();if(Tr.isStringLiteral(i))return i.setLiteralValue(r),this}return n.replaceWithText(i=>i.quote(r),this._getWriterWithQueuedChildIndentation()),this}getArgument(){return this._getNodeFromCompilerNode(this.compilerNode.argument)}setQualifier(r){let n=this.getQualifier();if(n!=null)n.replaceWithText(r,this._getWriterWithQueuedChildIndentation());else{let i=this.getFirstChildByKindOrThrow(b.SyntaxKind.CloseParenToken);qa({insertPos:i.getEnd(),parent:this,newText:this._getWriterWithQueuedIndentation().write(".").write(r).toString()})}return this}getQualifierOrThrow(){return b.errors.throwIfNullOrUndefined(this.getQualifier(),()=>`Expected to find a qualifier for the import type: ${this.getText()}`)}getQualifier(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.qualifier)}getAssertions(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.assertions)}getAssertionsOrThrow(){return b.errors.throwIfNullOrUndefined(this._getNodeFromCompilerNodeIfExists(this.compilerNode.assertions),"Could not find import type assertion container.")}},Uw=class extends wc{getObjectTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.objectType)}getIndexTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.indexType)}},Kw=class extends wc{getTypeParameter(){return this._getNodeFromCompilerNode(this.compilerNode.typeParameter)}},Ww=class extends wc{getTypeNodes(){return this.compilerNode.types.map(r=>this._getNodeFromCompilerNode(r))}},Vw=class extends wc{getLiteral(){let r=this.compilerNode.literal;return this._getNodeFromCompilerNode(r)}},jw=class extends wc{getNameTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.nameType)}getNameTypeNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getNameTypeNode(),"Type did not exist.")}getReadonlyToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.readonlyToken)}getReadonlyTokenOrThrow(){return b.errors.throwIfNullOrUndefined(this.getReadonlyToken(),"Readonly token did not exist.")}getQuestionToken(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.questionToken)}getQuestionTokenOrThrow(){return b.errors.throwIfNullOrUndefined(this.getQuestionToken(),"Question token did not exist.")}getTypeParameter(){return this._getNodeFromCompilerNode(this.compilerNode.typeParameter)}getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getTypeNode(),"Type did not exist, but was expected to exist.")}},H9e=e=>KE(Rh(bL(sc(mv(e))))),Mme=H9e(wc),Hw=class extends Mme{getTypeNode(){return super.getTypeNode()}removeType(){throw new b.errors.InvalidOperationError("Cannot remove the type of a named tuple member.")}},qw=class extends wc{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}setType(r){return this.getTypeNode().replaceWithText(r),this}},Jw=class extends wc{getHead(){return this._getNodeFromCompilerNode(this.compilerNode.head)}getTemplateSpans(){return this.compilerNode.templateSpans.map(r=>this._getNodeFromCompilerNode(r))}setLiteralValue(r){var n;let i=this.getChildIndex(),a=(n=this.getParentSyntaxList())!==null&&n!==void 0?n:this.getParentOrThrow();return mS({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:r}),a.getChildAtIndex(i)}},zw=class extends wc{},$w=class extends wc{getElements(){return this.compilerNode.elements.map(r=>this._getNodeFromCompilerNode(r))}},q9e=e=>J_(KE(sc(Ph(BE(sf(mv(e))))))),DR=q9e(Cl),Xw=class extends DR{set(r){return io(DR.prototype,this,r),this}getStructure(){return uo(DR.prototype,this,{kind:Oe.StructureKind.TypeAlias,type:this.getTypeNodeOrThrow().getText()})}},wme=tq(wc),Yw=class extends wme{},Qw=class extends wc{getOperator(){return this.compilerNode.operator}getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}};Oe.TypeParameterVariance=void 0;(function(e){e[e.None=0]="None",e[e.In=1]="In",e[e.Out=2]="Out",e[e.InOut=3]="InOut"})(Oe.TypeParameterVariance||(Oe.TypeParameterVariance={}));var CR=sf(mv(Tr)),Zw=class extends CR{getConstraint(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.constraint)}getConstraintOrThrow(){return b.errors.throwIfNullOrUndefined(this.getConstraint(),"Expected to find the type parameter's constraint.")}setConstraint(r){if(r=this.getParentOrThrow()._getTextWithQueuedChildIndentation(r),b.StringUtils.isNullOrWhitespace(r))return this.removeConstraint(),this;let n=this.getConstraint();if(n!=null)return n.replaceWithText(r),this;let i=this.getNameNode();return qa({parent:this,insertPos:i.getEnd(),newText:` extends ${r}`}),this}removeConstraint(){return Cfe(this.getConstraint(),b.SyntaxKind.ExtendsKeyword),this}getDefault(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.default)}getDefaultOrThrow(){return b.errors.throwIfNullOrUndefined(this.getDefault(),"Expected to find the type parameter's default.")}setDefault(r){if(r=this.getParentOrThrow()._getTextWithQueuedChildIndentation(r),b.StringUtils.isNullOrWhitespace(r))return this.removeDefault(),this;let n=this.getDefault();if(n!=null)return n.replaceWithText(r),this;let i=this.getConstraint()||this.getNameNode();return qa({parent:this,insertPos:i.getEnd(),newText:` = ${r}`}),this}removeDefault(){return Cfe(this.getDefault(),b.SyntaxKind.EqualsToken),this}setVariance(r){return this.toggleModifier("in",(r&Oe.TypeParameterVariance.In)!==0),this.toggleModifier("out",(r&Oe.TypeParameterVariance.Out)!==0),this}getVariance(){let r=Oe.TypeParameterVariance.None;return this.hasModifier("in")&&(r|=Oe.TypeParameterVariance.In),this.hasModifier("out")&&(r|=Oe.TypeParameterVariance.Out),r}remove(){let r=this.getParentSyntaxListOrThrow();r.getChildrenOfKind(b.SyntaxKind.TypeParameter).length===1?i():fv(this);function i(){let a=[r.getPreviousSiblingIfKindOrThrow(b.SyntaxKind.LessThanToken),r,r.getNextSiblingIfKindOrThrow(b.SyntaxKind.GreaterThanToken)];Bs({children:a})}}set(r){return io(CR.prototype,this,r),r.constraint!=null?this.setConstraint(r.constraint):r.hasOwnProperty(b.nameof(r,"constraint"))&&this.removeConstraint(),r.default!=null?this.setDefault(r.default):r.hasOwnProperty(b.nameof(r,"default"))&&this.removeDefault(),r.variance!=null&&this.setVariance(r.variance),this}getStructure(){let r=this.getConstraint(),n=this.getDefault();return uo(CR.prototype,this,{kind:Oe.StructureKind.TypeParameter,constraint:r?.getText({trimLeadingIndentation:!0}),default:n?n.getText({trimLeadingIndentation:!0}):void 0,variance:this.getVariance()})}};function Cfe(e,r){e!=null&&Bs({children:[e.getPreviousSiblingIfKindOrThrow(r),e],removePrecedingSpaces:!0})}var eF=class extends wc{getParameterNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.parameterName)}hasAssertsModifier(){return this.compilerNode.assertsModifier!=null}getAssertsModifier(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.assertsModifier)}getAssertsModifierOrThrow(){return b.errors.throwIfNullOrUndefined(this.getAssertsModifier(),"Expected to find an asserts modifier.")}getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}getTypeNodeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getTypeNode(),"Expected to find a type node.")}},rF=class extends KT{getExprName(){return this._getNodeFromCompilerNode(this.compilerNode.exprName)}},tF=class extends KT{getTypeName(){return this._getNodeFromCompilerNode(this.compilerNode.typeName)}},nF=class extends wc{getTypeNodes(){return this.compilerNode.types.map(r=>this._getNodeFromCompilerNode(r))}},q_=class extends wc{},iF=class extends q_{},AR=Tr,bc=class extends AR{getTagName(){return this.getTagNameNode().getText()}getTagNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.tagName)}setTagName(r){return this.set({tagName:r})}getComment(){if(this.compilerNode.comment!=null)return typeof this.compilerNode.comment=="string"?this.compilerNode.comment:this.compilerNode.comment.map(r=>this._getNodeFromCompilerNodeIfExists(r))}getCommentText(){return typeof this.compilerNode.comment=="string"?this.compilerNode.comment:b.ts.getTextOfJSDocComment(this.compilerNode.comment)}remove(){let r=this.getParentOrThrow().getStart()+3,n=Bme(this),i=n==null,a=s.call(this);Bs({children:[this],customRemovalPos:a,customRemovalEnd:Gme(this,n),replaceTrivia:u.call(this)});function s(){return Math.max(r,Ume(this,this.getStart()))}function u(){if(a===r&&i)return"";let p=this._context.manipulationSettings.getNewLineKindAsString(),f=this.getParentOrThrow().getIndentationText();return`${p}${f} `+(i?"":"* ")}}set(r){return io(AR.prototype,this,r),r.text!=null||r.tagName!=null?this.replaceWithText(n=>{var i;this._context.structurePrinterFactory.forJSDocTag({printStarsOnNewLine:!0}).printText(n,{tagName:(i=r.tagName)!==null&&i!==void 0?i:this.getTagName(),text:r.text!=null?r.text:Afe(this)})}):this}replaceWithText(r){let n=$g(this._getWriterWithQueuedIndentation(),r),i=this.getParentOrThrow(),a=this.getChildIndex(),s=this.getStart();return qa({parent:i,insertPos:s,newText:n,replacing:{textLength:Fme(this)-s}}),i.getChildren()[a]}getStructure(){let r=Afe(this);return uo(AR.prototype,this,{kind:Oe.StructureKind.JSDocTag,tagName:this.getTagName(),text:r.length===0?void 0:r})}};function Afe(e){let r=e.getSourceFile().getFullText(),n=e.getTagNameNode().getEnd(),i=Fme(e),a=Math.min(r.charCodeAt(n)===ac.SPACE?n+1:n,i);return RH(r.substring(a,i))}function Fme(e){return Ume(e,Gme(e))}function Gme(e,r){return r=r??Bme(e),r!=null?r.getStart():e.getParentOrThrow().getEnd()-2}function Bme(e){let n=e.getParentIfKindOrThrow(b.SyntaxKind.JSDoc).getTags(),i=n.indexOf(e);return n[i+1]}function Ume(e,r){let n=e.getSourceFile().getFullText();return uv(n,r,i=>i!==ac.ASTERISK&&!b.StringUtils.isWhitespaceCharCode(i))}var aF=class extends bc{},oF=class extends bc{},sF=class extends bc{},lF=class extends bc{},uF=class extends bc{},cF=class extends bc{},Kme=_v(q_),dF=class extends Kme{},fF=class extends bc{},pF=class extends Tr{},mF=class extends Tr{},_F=class extends Tr{},gF=class extends Tr{},yF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},vF=class extends Tr{getName(){return this._getNodeFromCompilerNode(this.compilerNode.name)}},hF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}isPostfix(){return this.compilerNode.postfix}},EF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}isPostfix(){return this.compilerNode.postfix}},bF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},SF=class extends bc{},Wme=aq(bc),TF=class extends Wme{},xF=class extends bc{},Vme=aq(bc),DF=class extends Vme{},CF=class extends bc{},AF=class extends bc{},LF=class extends bc{},jme=tG(bc),NF=class extends jme{},Hme=tG(bc),IF=class extends Hme{},PF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.type)}},cL=class{constructor(r){this._compilerObject=r}get compilerObject(){return this._compilerObject}getName(){return this.compilerObject.name}getText(){var r;return(r=this.compilerObject.text)!==null&&r!==void 0?r:[]}},qme=Nme(bc),OF=class extends qme{getConstraint(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.constraint)}getConstraintOrThrow(){return b.errors.throwIfNullOrUndefined(this.getConstraint(),"Expected to find the JS doc template tag's constraint.")}},kF=class extends Tr{},Jme=tG(bc),RF=class extends Jme{},MF=class extends bc{},wF=class extends wc{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},FF=class extends q_{isArrayType(){return this.compilerNode.isArrayType}getPropertyTags(){return this.compilerNode.jsDocPropertyTags?this.compilerNode.jsDocPropertyTags.map(r=>this._getNodeFromCompilerNode(r)):void 0}},GF=class extends bc{getTypeExpression(){let r=this.compilerNode.typeExpression;if(!(r!=null&&r.pos===r.end))return this._getNodeFromCompilerNodeIfExists(this.compilerNode.typeExpression)}},BF=class extends bc{},UF=class extends q_{},KF=class extends q_{getTypeNode(){return this._getNodeFromCompilerNode(this.compilerNode.type)}},WF=class extends Tr{remove(){Nh({children:[this],getSiblingFormatting:()=>El.Newline})}},J9e=e=>ld(yS(sc(Ph(BE(sf(mv(e))))))),LR=J9e(Cl),VF=class extends LR{set(r){return io(LR.prototype,this,r),r.isConst!=null&&this.setIsConstEnum(r.isConst),r.members!=null&&(this.getMembers().forEach(n=>n.remove()),this.addMembers(r.members)),this}addMember(r){return this.addMembers([r])[0]}addMembers(r){return this.insertMembers(this.getMembers().length,r)}insertMember(r,n){return this.insertMembers(r,[n])[0]}insertMembers(r,n){if(n.length===0)return[];let i=this.getMembersWithComments();r=ku(r,i.length);let a=this._getWriterWithChildIndentation();return this._context.structurePrinterFactory.forEnumMember().printTexts(a,n),j_({parent:this.getChildSyntaxListOrThrow(),currentNodes:i,insertIndex:r,newText:a.toString(),useNewLines:!0,useTrailingCommas:this._context.manipulationSettings.getUseTrailingCommas()}),af(i,this.getMembersWithComments(),r,!u());function u(){return n instanceof Array?n.every(p=>typeof p=="object"):!1}}getMember(r){return ic(this.getMembers(),r)}getMemberOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getMember(r),()=>Ou("enum member",r))}getMembers(){return this.compilerNode.members.map(r=>this._getNodeFromCompilerNode(r))}getMembersWithComments(){let r=this.compilerNode;return od.getContainerArray(r,this.getSourceFile().compilerNode).map(n=>this._getNodeFromCompilerNode(n))}setIsConstEnum(r){return this.toggleModifier("const",r)}isConstEnum(){return this.getConstKeyword()!=null}getConstKeyword(){return this.getFirstModifierByKind(b.SyntaxKind.ConstKeyword)}getStructure(){return uo(LR.prototype,this,{kind:Oe.StructureKind.Enum,isConst:this.isConstEnum(),members:this.getMembers().map(r=>r.getStructure())})}},z9e=e=>sc($T(UE(e))),NR=z9e(Tr),jF=class extends NR{getValue(){return this._context.typeChecker.getConstantValue(this)}setValue(r){let n;if(typeof r=="string"){let i=this._context.manipulationSettings.getQuoteKind();n=i+b.StringUtils.escapeForWithinString(r,i)+i}else n=r.toString();return this.setInitializer(n),this}remove(){let r=[this],n=this.getNextSiblingIfKind(b.SyntaxKind.CommaToken);n!=null&&r.push(n),Nh({children:r,getSiblingFormatting:()=>El.Newline})}set(r){return io(NR.prototype,this,r),r.value!=null?this.setValue(r.value):r.hasOwnProperty(b.nameof(r,"value"))&&r.initializer==null&&this.removeInitializer(),this}getStructure(){return uo(NR.prototype,this,{kind:Oe.StructureKind.EnumMember,value:void 0})}},HF=class extends Tr{getTypeNodes(){var r,n;return(n=(r=this.compilerNode.types)===null||r===void 0?void 0:r.map(i=>this._getNodeFromCompilerNode(i)))!==null&&n!==void 0?n:[]}getToken(){return this.compilerNode.token}removeExpression(r){let n=this.getTypeNodes(),i=typeof r=="number"?a(r):r;if(n.length===1){let s=this.getParentSyntaxListOrThrow().getChildren();s.length===1?Bs({children:[s[0].getParentSyntaxListOrThrow()],removePrecedingSpaces:!0}):Bs({children:[this],removePrecedingSpaces:!0})}else fv(i);return this;function a(s){return n[ku(s,n.length-1)]}}},wE=class extends Tr{remove(){m7e(this)}},$9e=e=>J_(Nm(sc(_v(e)))),IR=$9e(wE),qF=class extends IR{set(r){return io(IR.prototype,this,r),this}getStructure(){return uo(IR.prototype,this,{kind:Oe.StructureKind.CallSignature})}},JF=class extends wE{},X9e=e=>J_(Nm(sc(_v(e)))),PR=X9e(wE),zF=class extends PR{set(r){return io(PR.prototype,this,r),this}getStructure(){return uo(PR.prototype,this,{kind:Oe.StructureKind.ConstructSignature})}},Y9e=e=>eq(Nm(sc(xL(sf(e))))),OR=Y9e(wE),$F=class extends OR{getKeyName(){return this.getKeyNameNode().getText()}setKeyName(r){b.errors.throwIfWhitespaceOrNotString(r,"name"),this.getKeyName()!==r&&this.getKeyNameNode().replaceWithText(r,this._getWriterWithQueuedChildIndentation())}getKeyNameNode(){let r=this.compilerNode.parameters[0];return this._getNodeFromCompilerNode(r.name)}getKeyType(){return this.getKeyNameNode().getType()}setKeyType(r){b.errors.throwIfWhitespaceOrNotString(r,"type");let n=this.getKeyTypeNode();return n.getText()===r?this:(n.replaceWithText(r,this._getWriterWithQueuedChildIndentation()),this)}getKeyTypeNode(){let r=this.compilerNode.parameters[0];return this._getNodeFromCompilerNode(r.type)}set(r){return io(OR.prototype,this,r),r.keyName!=null&&this.setKeyName(r.keyName),r.keyType!=null&&this.setKeyType(r.keyType),this}getStructure(){let r=this.getKeyTypeNode();return uo(OR.prototype,this,{kind:Oe.StructureKind.IndexSignature,keyName:this.getKeyName(),keyType:r.getText()})}},Q9e=e=>tq(ld(ipe(QH(J_(sc(Ph(yS(BE(sf(mv(e))))))))))),kR=Q9e(Cl),XF=class extends kR{getBaseTypes(){return this.getType().getBaseTypes()}getBaseDeclarations(){return b.ArrayUtils.flatten(this.getType().getBaseTypes().map(r=>{var n,i;return(i=(n=r.getSymbol())===null||n===void 0?void 0:n.getDeclarations())!==null&&i!==void 0?i:[]}))}getImplementations(){return this.getNameNode().getImplementations()}set(r){return io(kR.prototype,this,r),this}getStructure(){return uo(kR.prototype,this,{kind:Oe.StructureKind.Interface})}},Z9e=e=>Nm(sc(Rh(J_(_v(UE(e)))))),RR=Z9e(wE),YF=class extends RR{set(r){return io(RR.prototype,this,r),this}getStructure(){return uo(RR.prototype,this,{kind:Oe.StructureKind.MethodSignature})}},eUe=e=>Nm(sc(xL(Rh($T(KE(UE(sf(e)))))))),MR=eUe(wE),QF=class extends MR{set(r){return io(MR.prototype,this,r),this}getStructure(){return uo(MR.prototype,this,{kind:Oe.StructureKind.PropertySignature})}};function oq(e){return class extends e{getAttributes(){return this.compilerNode.attributes.properties.map(r=>this._getNodeFromCompilerNode(r))}getAttributeOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getAttribute(r),()=>Ou("attribute",r))}getAttribute(r){return ic(this.getAttributes(),r)}addAttribute(r){return this.addAttributes([r])[0]}addAttributes(r){return this.insertAttributes(this.compilerNode.attributes.properties.length,r)}insertAttribute(r,n){return this.insertAttributes(r,[n])[0]}insertAttributes(r,n){if(n.length===0)return[];let i=this.compilerNode.attributes.properties.length;r=ku(r,i);let a=r===0?this.getTagNameNode().getEnd():this.getAttributes()[r-1].getEnd(),s=this._getWriterWithQueuedChildIndentation();return new Mj(this._context.structurePrinterFactory.forJsxAttributeDecider()).printText(s,n),qa({insertPos:a,newText:" "+s.toString(),parent:this.getNodeProperty("attributes").getFirstChildByKindOrThrow(b.SyntaxKind.SyntaxList)}),af(i,this.getAttributes(),r,!1)}set(r){return io(e.prototype,this,r),r.attributes!=null&&(this.getAttributes().forEach(n=>n.remove()),this.addAttributes(r.attributes)),this}getStructure(){return uo(e.prototype,this,{attributes:this.getAttributes().map(r=>r.getStructure())})}}}function nG(e){return class extends e{getTagNameNode(){return this._getNodeFromCompilerNode(this.compilerNode.tagName)}set(r){return io(e.prototype,this,r),r.name!=null&&this.getTagNameNode().replaceWithText(r.name),this}getStructure(){return uo(e.prototype,this,{name:this.getTagNameNode().getText()})}}}var wR=mv(Tr),ZF=class extends wR{getInitializerOrThrow(){return b.errors.throwIfNullOrUndefined(this.getInitializer(),`Expected to find an initializer for the JSX attribute '${this.getName()}'`)}getInitializer(){return this._getNodeFromCompilerNodeIfExists(this.compilerNode.initializer)}setInitializer(r){let n=$g(this._getWriterWithQueuedIndentation(),r);if(b.StringUtils.isNullOrWhitespace(n))return this.removeInitializer(),this;let i=this.getInitializer();return i!=null?(i.replaceWithText(n),this):(qa({insertPos:this.getNameNode().getEnd(),parent:this,newText:`=${n}`}),this)}removeInitializer(){let r=this.getInitializer();return r==null?this:(Bs({children:[r.getPreviousSiblingIfKindOrThrow(b.SyntaxKind.EqualsToken),r],removePrecedingSpaces:!0,removePrecedingNewLines:!0}),this)}remove(){Bs({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}set(r){return io(wR.prototype,this,r),r.initializer!=null?this.setInitializer(r.initializer):r.hasOwnProperty(b.nameof(r,"initializer"))&&this.removeInitializer(),this}getStructure(){let r=this.getInitializer();return uo(wR.prototype,this,{kind:Oe.StructureKind.JsxAttribute,initializer:r?.getText()})}},rUe=e=>nG(e),zme=rUe(Tr),e6=class extends zme{},r6=class extends oc{},FR=sd,t6=class extends FR{getJsxChildren(){return this.compilerNode.children.map(r=>this._getNodeFromCompilerNode(r))}getOpeningElement(){return this._getNodeFromCompilerNode(this.compilerNode.openingElement)}getClosingElement(){return this._getNodeFromCompilerNode(this.compilerNode.closingElement)}setBodyText(r){let n=Qfe(this._getWriterWithIndentation(),r);return Lfe(this,n),this}setBodyTextInline(r){let n=this._getWriterWithQueuedChildIndentation();return GE(n,r),n.isLastNewLine()&&(n.setIndentationLevel(Math.max(0,this.getIndentationLevel()-1)),n.write("")),Lfe(this,n.toString()),this}set(r){if(io(FR.prototype,this,r),r.attributes!=null){let n=this.getOpeningElement();n.getAttributes().forEach(i=>i.remove()),n.addAttributes(r.attributes)}if(r.children!=null)throw new b.errors.NotImplementedError("Setting JSX children is currently not implemented. Please open an issue if you need this.");return r.bodyText!=null?this.setBodyText(r.bodyText):r.hasOwnProperty(b.nameof(r,"bodyText"))&&this.setBodyTextInline(""),r.name!=null&&(this.getOpeningElement().getTagNameNode().replaceWithText(r.name),this.getClosingElement().getTagNameNode().replaceWithText(r.name)),this}getStructure(){let r=this.getOpeningElement(),n=uo(FR.prototype,this,{kind:Oe.StructureKind.JsxElement,name:r.getTagNameNode().getText(),attributes:r.getAttributes().map(i=>i.getStructure()),children:void 0,bodyText:zH(this)});return delete n.children,n}};function Lfe(e,r){let n=e.getOpeningElement(),i=e.getClosingElement();qa({insertPos:n.getEnd(),newText:r,parent:e.getChildSyntaxListOrThrow(),replacing:{textLength:i.getStart()-n.getEnd()}})}var $me=DL(bL(oc)),n6=class extends $me{},i6=class extends sd{getJsxChildren(){return this.compilerNode.children.map(r=>this._getNodeFromCompilerNode(r))}getOpeningFragment(){return this._getNodeFromCompilerNode(this.compilerNode.openingFragment)}getClosingFragment(){return this._getNodeFromCompilerNode(this.compilerNode.closingFragment)}},tUe=e=>oq(nG(e)),Xme=tUe(oc),a6=class extends Xme{},o6=class extends oc{},nUe=e=>oq(nG(e)),GR=nUe(sd),s6=class extends GR{set(r){return io(GR.prototype,this,r),this}getStructure(){return uo(GR.prototype,this,{kind:Oe.StructureKind.JsxSelfClosingElement})}},BR=ud(Tr),l6=class extends BR{remove(){Bs({children:[this],removePrecedingNewLines:!0,removePrecedingSpaces:!0})}set(r){return io(BR.prototype,this,r),r.expression!=null&&this.setExpression(r.expression),this}getStructure(){return uo(BR.prototype,this,{kind:Oe.StructureKind.JsxSpreadAttribute,expression:this.getExpression().getText()})}},Yme=UD(Tr),u6=class extends Yme{containsOnlyTriviaWhiteSpaces(){let r=this.compilerNode;return typeof r.containsOnlyWhiteSpaces=="boolean"?r.containsOnlyWhiteSpaces:this.compilerNode.containsOnlyTriviaWhiteSpaces}},Qme=cS,c6=class extends Qme{getLiteralValue(){let r=this.compilerNode.text;if(typeof BigInt>"u")throw new b.errors.InvalidOperationError("Runtime environment does not support BigInts. Perhaps work with the text instead?");let n=r.substring(0,r.length-1);return BigInt(n)}setLiteralValue(r){if(typeof r!="bigint")throw new b.errors.ArgumentTypeError("value","bigint",typeof r);return mS({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:r.toString()+"n"}),this}},Zme=sd,d6=class extends Zme{getLiteralValue(){return sq(this)}setLiteralValue(r){return r_e(this,r)}},e_e=sd,f6=class extends e_e{getLiteralValue(){return sq(this)}setLiteralValue(r){return r_e(this,r)}};function r_e(e,r){if(sq(e)===r)return e;let n=e.getParentSyntaxList()||e.getParentOrThrow(),i=e.getChildIndex();return e.replaceWithText(r?"true":"false"),n.getChildAtIndex(i)}function sq(e){return e.getKind()===b.SyntaxKind.TrueKeyword}var t_e=sd,p6=class extends t_e{},n_e=cS,m6=class extends n_e{getLiteralValue(){let r=this.compilerNode.text;return r.indexOf(".")>=0?parseFloat(r):parseInt(r,10)}setLiteralValue(r){return mS({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:r.toString(10)}),this}};Oe.QuoteKind=void 0;(function(e){e.Single="'",e.Double='"'})(Oe.QuoteKind||(Oe.QuoteKind={}));var i_e=cS,_6=class extends i_e{getLiteralValue(){let r=/^\/(.*)\/([^\/]*)$/,n=this.compilerNode.text,i=r.exec(n);return new RegExp(i[1],i[2])}setLiteralValue(r,n){let i;return typeof r=="string"?i=r:(i=r.source,n=r.flags),mS({sourceFile:this._sourceFile,start:this.getStart(),replacingLength:this.getWidth(),newText:`/${i}/${n||""}`}),this}},a_e=cS,g6=class extends a_e{getLiteralValue(){return this.compilerNode.text}setLiteralValue(r){return mS({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:b.StringUtils.escapeForWithinString(r,this.getQuoteKind())}),this}getQuoteKind(){return this.getText()[0]==="'"?Oe.QuoteKind.Single:Oe.QuoteKind.Double}},o_e=cS,y6=class extends o_e{getLiteralValue(){return this.compilerNode.text}setLiteralValue(r){let n=this.getChildIndex(),i=this.getParentSyntaxList()||this.getParentOrThrow();return mS({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:r}),i.getChildAtIndex(n)}},v6=class extends BT{getTag(){return this._getNodeFromCompilerNode(this.compilerNode.tag)}getTemplate(){return this._getNodeFromCompilerNode(this.compilerNode.template)}removeTag(){var r;let n=(r=this.getParentSyntaxList())!==null&&r!==void 0?r:this.getParentOrThrow(),i=this.getChildIndex(),a=this.getTemplate();return qa({customMappings:(s,u)=>[{currentNode:a,newNode:s.getChildren(u)[i]}],parent:n,insertPos:this.getStart(),newText:this.getTemplate().getText(),replacing:{textLength:this.getWidth(),nodes:[this]}}),n.getChildAtIndex(i)}},s_e=sd,h6=class extends s_e{getHead(){return this._getNodeFromCompilerNode(this.compilerNode.head)}getTemplateSpans(){return this.compilerNode.templateSpans.map(r=>this._getNodeFromCompilerNode(r))}setLiteralValue(r){var n;let i=this.getChildIndex(),a=(n=this.getParentSyntaxList())!==null&&n!==void 0?n:this.getParentOrThrow();return mS({sourceFile:this._sourceFile,start:this.getStart()+1,replacingLength:this.getWidth()-2,newText:r}),a.getChildAtIndex(i)}},l_e=UD(Tr),E6=class extends l_e{},u_e=UD(Tr),b6=class extends u_e{},c_e=ud(Tr),S6=class extends c_e{getLiteral(){return this._getNodeFromCompilerNode(this.compilerNode.literal)}},d_e=UD(Tr),T6=class extends d_e{};function lq(e){return class extends e{getText(){return this.compilerNode.text}getDefinitionNodes(){return this.getDefinitions().map(r=>r.getDeclarationNode()).filter(r=>r!=null)}getDefinitions(){return this._context.languageService.getDefinitions(this)}}}var f_e=ud(Tr),x6=class extends f_e{},p_e=lq(kh(pv(sd))),D6=class extends p_e{getImplementations(){return this._context.languageService.getImplementations(this)}},m_e=lq(kh(pv(Tr))),C6=class extends m_e{},A6=class extends Tr{getLeft(){return this._getNodeFromCompilerNode(this.compilerNode.left)}getRight(){return this._getNodeFromCompilerNode(this.compilerNode.right)}},iUe=e=>XH($H(KE($T($6(e))))),UR=iUe(Tr),L6=class extends UR{remove(){let r=this.getParentOrThrow();switch(r.getKind()){case b.SyntaxKind.VariableDeclarationList:n(this);break;case b.SyntaxKind.CatchClause:i(this);break;default:throw new b.errors.NotImplementedError(`Not implemented for syntax kind: ${r.getKindName()}`)}function n(a){let s=r.getParentIfKindOrThrow(b.SyntaxKind.VariableStatement);s.getDeclarations().length===1?s.remove():fv(a)}function i(a){Bs({children:[a.getPreviousSiblingIfKindOrThrow(b.SyntaxKind.OpenParenToken),a,a.getNextSiblingIfKindOrThrow(b.SyntaxKind.CloseParenToken)],removePrecedingSpaces:!0})}}getVariableStatementOrThrow(){return b.errors.throwIfNullOrUndefined(this.getVariableStatement(),"Expected the grandparent to be a variable statement.")}getVariableStatement(){let r=this.getParentOrThrow().getParentOrThrow();return Tr.isVariableStatement(r)?r:void 0}set(r){return io(UR.prototype,this,r),this}getStructure(){return uo(UR.prototype,this,{kind:Oe.StructureKind.VariableDeclaration})}},__e=sf(Tr),N6=class extends __e{getDeclarations(){return this.compilerNode.declarations.map(r=>this._getNodeFromCompilerNode(r))}getDeclarationKind(){let r=this.compilerNode.flags;return r&b.ts.NodeFlags.Let?Oe.VariableDeclarationKind.Let:r&b.ts.NodeFlags.Const?Oe.VariableDeclarationKind.Const:Oe.VariableDeclarationKind.Var}getDeclarationKindKeyword(){let r=this.getDeclarationKind();switch(r){case Oe.VariableDeclarationKind.Const:return this.getFirstChildByKindOrThrow(b.SyntaxKind.ConstKeyword);case Oe.VariableDeclarationKind.Let:return this.getFirstChildByKindOrThrow(b.SyntaxKind.LetKeyword);case Oe.VariableDeclarationKind.Var:return this.getFirstChildByKindOrThrow(b.SyntaxKind.VarKeyword);default:return b.errors.throwNotImplementedForNeverValueError(r)}}setDeclarationKind(r){if(this.getDeclarationKind()===r)return this;let n=this.getDeclarationKindKeyword();return qa({insertPos:n.getStart(),newText:r,parent:this,replacing:{textLength:n.getWidth()}}),this}addDeclaration(r){return this.addDeclarations([r])[0]}addDeclarations(r){return this.insertDeclarations(this.getDeclarations().length,r)}insertDeclaration(r,n){return this.insertDeclarations(r,[n])[0]}insertDeclarations(r,n){let i=this._getWriterWithQueuedChildIndentation(),a=new Ih(this._context.structurePrinterFactory.forVariableDeclaration()),s=this.compilerNode.declarations.length;return r=ku(r,s),a.printText(i,n),j_({parent:this.getFirstChildByKindOrThrow(b.SyntaxKind.SyntaxList),currentNodes:this.getDeclarations(),insertIndex:r,newText:i.toString(),useTrailingCommas:!1}),af(s,this.getDeclarations(),r,!1)}},I6=class{constructor(r,n){this._context=r,this._compilerSignature=n}get compilerSignature(){return this._compilerSignature}getTypeParameters(){return(this.compilerSignature.typeParameters||[]).map(n=>this._context.compilerFactory.getTypeParameter(n))}getParameters(){return this.compilerSignature.parameters.map(r=>this._context.compilerFactory.getSymbol(r))}getReturnType(){return this._context.compilerFactory.getType(this.compilerSignature.getReturnType())}getDocumentationComments(){return this.compilerSignature.getDocumentationComment(this._context.typeChecker.compilerObject).map(n=>this._context.compilerFactory.getSymbolDisplayPart(n))}getJsDocTags(){return this.compilerSignature.getJsDocTags().map(n=>this._context.compilerFactory.getJSDocTagInfo(n))}getDeclaration(){let{compilerFactory:r}=this._context,n=this.compilerSignature.getDeclaration();return r.getNodeFromCompilerNode(n,r.getSourceFileForNode(n))}},P6=class{constructor(r,n){this._context=r,this._compilerSymbol=n,this.getValueDeclaration(),this.getDeclarations()}get compilerSymbol(){return this._compilerSymbol}getName(){return this.compilerSymbol.getName()}getEscapedName(){return this.compilerSymbol.getEscapedName()}getAliasedSymbolOrThrow(){return b.errors.throwIfNullOrUndefined(this.getAliasedSymbol(),"Expected to find an aliased symbol.")}getImmediatelyAliasedSymbol(){return this._context.typeChecker.getImmediatelyAliasedSymbol(this)}getImmediatelyAliasedSymbolOrThrow(){return b.errors.throwIfNullOrUndefined(this.getImmediatelyAliasedSymbol(),"Expected to find an immediately aliased symbol.")}getAliasedSymbol(){return this._context.typeChecker.getAliasedSymbol(this)}getExportSymbol(){return this._context.typeChecker.getExportSymbolOfSymbol(this)}isAlias(){return(this.getFlags()&b.SymbolFlags.Alias)===b.SymbolFlags.Alias}isOptional(){return(this.getFlags()&b.SymbolFlags.Optional)===b.SymbolFlags.Optional}getFlags(){return this.compilerSymbol.getFlags()}hasFlags(r){return(this.compilerSymbol.flags&r)===r}getValueDeclarationOrThrow(){return b.errors.throwIfNullOrUndefined(this.getValueDeclaration(),()=>`Expected to find the value declaration of symbol '${this.getName()}'.`)}getValueDeclaration(){let r=this.compilerSymbol.valueDeclaration;if(r!=null)return this._context.compilerFactory.getNodeFromCompilerNode(r,this._context.compilerFactory.getSourceFileForNode(r))}getDeclarations(){var r;return((r=this.compilerSymbol.declarations)!==null&&r!==void 0?r:[]).map(n=>this._context.compilerFactory.getNodeFromCompilerNode(n,this._context.compilerFactory.getSourceFileForNode(n)))}getExportOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getExport(r),`Expected to find export with name: ${r}`)}getExport(r){if(this.compilerSymbol.exports==null)return;let n=this.compilerSymbol.exports.get(b.ts.escapeLeadingUnderscores(r));return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getExports(){return this.compilerSymbol.exports==null?[]:b.ArrayUtils.from(this.compilerSymbol.exports.values()).map(r=>this._context.compilerFactory.getSymbol(r))}getGlobalExportOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getGlobalExport(r),`Expected to find global export with name: ${r}`)}getGlobalExport(r){if(this.compilerSymbol.globalExports==null)return;let n=this.compilerSymbol.globalExports.get(b.ts.escapeLeadingUnderscores(r));return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getGlobalExports(){return this.compilerSymbol.globalExports==null?[]:b.ArrayUtils.from(this.compilerSymbol.globalExports.values()).map(r=>this._context.compilerFactory.getSymbol(r))}getMemberOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getMember(r),`Expected to find member with name: ${r}`)}getMember(r){if(this.compilerSymbol.members==null)return;let n=this.compilerSymbol.members.get(b.ts.escapeLeadingUnderscores(r));return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getMembers(){return this.compilerSymbol.members==null?[]:b.ArrayUtils.from(this.compilerSymbol.members.values()).map(r=>this._context.compilerFactory.getSymbol(r))}getDeclaredType(){return this._context.typeChecker.getDeclaredTypeOfSymbol(this)}getTypeAtLocation(r){return this._context.typeChecker.getTypeOfSymbolAtLocation(this,r)}getFullyQualifiedName(){return this._context.typeChecker.getFullyQualifiedName(this)}getJsDocTags(){return this.compilerSymbol.getJsDocTags(this._context.typeChecker.compilerObject).map(r=>new cL(r))}},wD=class{constructor(r){this._compilerObject=r}get compilerObject(){return this._compilerObject}getStart(){return this.compilerObject.start}getEnd(){return this.compilerObject.start+this.compilerObject.length}getLength(){return this.compilerObject.length}},FE=class{constructor(r){this._compilerObject=r}get compilerObject(){return this._compilerObject}getSpan(){return new wD(this.compilerObject.span)}getNewText(){return this.compilerObject.newText}};co([b.Memoize],FE.prototype,"getSpan",null);var fS=class{constructor(r,n){this._context=r,this._compilerObject=n;let i=r.compilerFactory.addOrGetSourceFileFromFilePath(r.fileSystemWrapper.getStandardizedAbsolutePath(n.fileName),{markInProject:!1,scriptKind:void 0});this._existingFileExists=i!=null,n.isNewFile||(this._sourceFile=i)}getFilePath(){return this._compilerObject.fileName}getSourceFile(){return this._sourceFile}getTextChanges(){return this._compilerObject.textChanges.map(r=>new FE(r))}applyChanges(r={}){if(this._isApplied)return;if(this.isNewFile()&&this._existingFileExists&&!r.overwrite)throw new b.errors.InvalidOperationError(`Cannot apply file text change for creating a new file when the file exists at path ${this.getFilePath()}. Did you mean to provide the overwrite option?`);let n;if(this.isNewFile()?n=this._context.project.createSourceFile(this.getFilePath(),"",{overwrite:r.overwrite}):n=this.getSourceFile(),n==null)throw new b.errors.InvalidOperationError(`Cannot apply file text change to modify existing file that doesn't exist at path: ${this.getFilePath()}`);return n.applyTextChanges(this.getTextChanges()),n._markAsInProject(),this._isApplied=!0,this}isNewFile(){return!!this._compilerObject.isNewFile}};co([b.Memoize],fS.prototype,"getTextChanges",null);var O6=class{constructor(r,n){this._context=r,this._compilerObject=n}get compilerObject(){return this._compilerObject}getDescription(){return this.compilerObject.description}getChanges(){return this.compilerObject.changes.map(r=>new fS(this._context,r))}},k6=class extends O6{getFixName(){return this.compilerObject.fixName}getFixId(){return this.compilerObject.fixId}getFixAllDescription(){return this.compilerObject.fixAllDescription}},dL=class{constructor(r,n){this._context=r,this._compilerObject=n}get compilerObject(){return this._compilerObject}getChanges(){return this.compilerObject.changes.map(r=>new fS(this._context,r))}applyChanges(r){for(let n of this.getChanges())n.applyChanges(r);return this}};co([b.Memoize],dL.prototype,"getChanges",null);var dv=class{constructor(r,n){this._context=r,this._compilerObject=n,this._sourceFile=this._context.compilerFactory.addOrGetSourceFileFromFilePath(r.fileSystemWrapper.getStandardizedAbsolutePath(this.compilerObject.fileName),{markInProject:!1,scriptKind:void 0}),this._sourceFile._doActionPreNextModification(()=>this.getNode())}get compilerObject(){return this._compilerObject}getSourceFile(){return this._sourceFile}getTextSpan(){return new wD(this.compilerObject.textSpan)}getNode(){let r=this.getTextSpan(),n=this.getSourceFile(),i=r.getStart(),a=r.getEnd();return s();function s(){let u;return n._context.compilerFactory.forgetNodesCreatedInBlock(p=>{let f,m=n;for(;m!=null;){if(f==null&&(u=m),m.getStart()===i&&m.getWidth()===a)u=f=m;else if(f!=null)break;m=m.getChildAtPos(i)}u!=null&&p(u)}),u}}getOriginalTextSpan(){let{originalTextSpan:r}=this.compilerObject;return r==null?void 0:new wD(r)}getOriginalFileName(){return this.compilerObject.originalFileName}};co([b.Memoize],dv.prototype,"getTextSpan",null);co([b.Memoize],dv.prototype,"getNode",null);co([b.Memoize],dv.prototype,"getOriginalTextSpan",null);var FD=class extends dv{constructor(r,n){super(r,n),this.getSourceFile()._doActionPreNextModification(()=>this.getDeclarationNode())}getKind(){return this.compilerObject.kind}getName(){return this.compilerObject.name}getContainerKind(){return this.compilerObject.containerKind}getContainerName(){return this.compilerObject.containerName}getDeclarationNode(){if(this.getKind()==="module"&&this.getTextSpan().getLength()===this.getSourceFile().getFullWidth())return this.getSourceFile();let r=this.getTextSpan().getStart(),n=i(this.getSourceFile());return n?.getParentOrThrow();function i(a){if(a.getKind()===b.SyntaxKind.Identifier&&a.getStart()===r)return a;for(let s of a._getChildrenIterator())if(s.getPos()<=r&&s.getEnd()>r)return i(s)}}};co([b.Memoize],FD.prototype,"getDeclarationNode",null);var pS=class{constructor(r){this._compilerObject=r}get compilerObject(){return this._compilerObject}getMessageText(){return this.compilerObject.messageText}getNext(){let r=this.compilerObject.next;if(r!=null)return r instanceof Array?r.map(n=>new pS(n)):[new pS(r)]}getCode(){return this.compilerObject.code}getCategory(){return this.compilerObject.category}},WT=class{constructor(r,n){this._context=r,this._compilerObject=n,this.getSourceFile()}get compilerObject(){return this._compilerObject}getSourceFile(){if(this._context==null)return;let r=this.compilerObject.file;return r==null?void 0:this._context.compilerFactory.getSourceFile(r,{markInProject:!1})}getMessageText(){let r=this._compilerObject.messageText;return typeof r=="string"?r:this._context==null?new pS(r):this._context.compilerFactory.getDiagnosticMessageChain(r)}getLineNumber(){let r=this.getSourceFile(),n=this.getStart();if(!(r==null||n==null))return b.StringUtils.getLineNumberAtPos(r.getFullText(),n)}getStart(){return this.compilerObject.start}getLength(){return this.compilerObject.length}getCategory(){return this.compilerObject.category}getCode(){return this.compilerObject.code}getSource(){return this.compilerObject.source}};co([b.Memoize],WT.prototype,"getSourceFile",null);var fL=class extends WT{constructor(r,n){super(r,n)}getLineNumber(){return super.getLineNumber()}getStart(){return super.getStart()}getLength(){return super.getLength()}getSourceFile(){return super.getSourceFile()}},R6=class{constructor(r,n){this._compilerObject=n,this._context=r}get compilerObject(){return this._compilerObject}getFilePath(){return this._context.fileSystemWrapper.getStandardizedAbsolutePath(this.compilerObject.name)}getWriteByteOrderMark(){return this.compilerObject.writeByteOrderMark||!1}getText(){return this.compilerObject.text}},pL=class{constructor(r,n){this._context=r,this._compilerObject=n}get compilerObject(){return this._compilerObject}getEmitSkipped(){return this.compilerObject.emitSkipped}getOutputFiles(){return this.compilerObject.outputFiles.map(r=>new R6(this._context,r))}};co([b.Memoize],pL.prototype,"getOutputFiles",null);var VT=class{constructor(r,n){this._context=r,this._compilerObject=n,this.getDiagnostics()}get compilerObject(){return this._compilerObject}getEmitSkipped(){return this.compilerObject.emitSkipped}getDiagnostics(){return this.compilerObject.diagnostics.map(r=>this._context.compilerFactory.getDiagnostic(r))}};co([b.Memoize],VT.prototype,"getDiagnostics",null);var mL=class extends dv{constructor(r,n){super(r,n)}getKind(){return this.compilerObject.kind}getDisplayParts(){return this.compilerObject.displayParts.map(r=>this._context.compilerFactory.getSymbolDisplayPart(r))}};co([b.Memoize],mL.prototype,"getDisplayParts",null);var M6=class extends VT{constructor(r,n,i){super(r,n),this._files=i}getFiles(){return this._files}saveFiles(){let r=this._context.fileSystemWrapper,n=this._files.map(i=>r.writeFile(i.filePath,i.writeByteOrderMark?"\uFEFF"+i.text:i.text));return Promise.all(n)}saveFilesSync(){let r=this._context.fileSystemWrapper;for(let n of this._files)r.writeFileSync(n.filePath,n.writeByteOrderMark?"\uFEFF"+n.text:n.text)}},_L=class{constructor(r,n){this._context=r,this._compilerObject=n}get compilerObject(){return this._compilerObject}getEdits(){return this.compilerObject.edits.map(r=>new fS(this._context,r))}getRenameFilePath(){return this.compilerObject.renameFilename}getRenameLocation(){return this.compilerObject.renameLocation}applyChanges(r){for(let n of this.getEdits())n.applyChanges(r);return this}};co([b.Memoize],_L.prototype,"getEdits",null);var gL=class{constructor(r,n){this._context=r,this._compilerObject=n,this._references=this.compilerObject.references.map(i=>r.compilerFactory.getReferencedSymbolEntry(i))}get compilerObject(){return this._compilerObject}getDefinition(){return this._context.compilerFactory.getReferencedSymbolDefinitionInfo(this.compilerObject.definition)}getReferences(){return this._references}};co([b.Memoize],gL.prototype,"getDefinition",null);var yL=class extends FD{constructor(r,n){super(r,n)}getDisplayParts(){return this.compilerObject.displayParts.map(r=>this._context.compilerFactory.getSymbolDisplayPart(r))}};co([b.Memoize],yL.prototype,"getDisplayParts",null);var w6=class extends dv{constructor(r,n){super(r,n)}isWriteAccess(){return this.compilerObject.isWriteAccess}isInString(){return this.compilerObject.isInString}},F6=class extends w6{constructor(r,n){super(r,n)}isDefinition(){return this.compilerObject.isDefinition}},G6=class extends dv{getPrefixText(){return this._compilerObject.prefixText}getSuffixText(){return this._compilerObject.suffixText}},B6=class{constructor(r){this._compilerObject=r}get compilerObject(){return this._compilerObject}getText(){return this.compilerObject.text}getKind(){return this.compilerObject.kind}},vL=class{constructor(r){this._context=r}get compilerObject(){return this._getCompilerObject()}_reset(r){this._getCompilerObject=r}getAmbientModules(){return this.compilerObject.getAmbientModules().map(r=>this._context.compilerFactory.getSymbol(r))}getApparentType(r){return this._context.compilerFactory.getType(this.compilerObject.getApparentType(r.compilerType))}getConstantValue(r){return this.compilerObject.getConstantValue(r.compilerNode)}getFullyQualifiedName(r){return this.compilerObject.getFullyQualifiedName(r.compilerSymbol)}getTypeAtLocation(r){return this._context.compilerFactory.getType(this.compilerObject.getTypeAtLocation(r.compilerNode))}getContextualType(r){let n=this.compilerObject.getContextualType(r.compilerNode);return n==null?void 0:this._context.compilerFactory.getType(n)}getTypeOfSymbolAtLocation(r,n){return this._context.compilerFactory.getType(this.compilerObject.getTypeOfSymbolAtLocation(r.compilerSymbol,n.compilerNode))}getDeclaredTypeOfSymbol(r){return this._context.compilerFactory.getType(this.compilerObject.getDeclaredTypeOfSymbol(r.compilerSymbol))}getSymbolAtLocation(r){let n=this.compilerObject.getSymbolAtLocation(r.compilerNode);return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getAliasedSymbol(r){if(!r.hasFlags(b.SymbolFlags.Alias))return;let n=this.compilerObject.getAliasedSymbol(r.compilerSymbol);return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getImmediatelyAliasedSymbol(r){let n=this.compilerObject.getImmediateAliasedSymbol(r.compilerSymbol);return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getExportSymbolOfSymbol(r){return this._context.compilerFactory.getSymbol(this.compilerObject.getExportSymbolOfSymbol(r.compilerSymbol))}getPropertiesOfType(r){return this.compilerObject.getPropertiesOfType(r.compilerType).map(n=>this._context.compilerFactory.getSymbol(n))}getTypeText(r,n,i){return i==null&&(i=this._getDefaultTypeFormatFlags(n)),this.compilerObject.typeToString(r.compilerType,n?.compilerNode,i)}getReturnTypeOfSignature(r){return this._context.compilerFactory.getType(this.compilerObject.getReturnTypeOfSignature(r.compilerSignature))}getSignatureFromNode(r){let n=this.compilerObject.getSignatureFromDeclaration(r.compilerNode);return n==null?void 0:this._context.compilerFactory.getSignature(n)}getExportsOfModule(r){return(this.compilerObject.getExportsOfModule(r.compilerSymbol)||[]).map(i=>this._context.compilerFactory.getSymbol(i))}getExportSpecifierLocalTargetSymbol(r){let n=this.compilerObject.getExportSpecifierLocalTargetSymbol(r.compilerNode);return n==null?void 0:this._context.compilerFactory.getSymbol(n)}getResolvedSignature(r){let n=this.compilerObject.getResolvedSignature(r.compilerNode);if(!(!n||!n.declaration))return this._context.compilerFactory.getSignature(n)}getResolvedSignatureOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getResolvedSignature(r),"Signature could not be resolved.")}getBaseTypeOfLiteralType(r){return this._context.compilerFactory.getType(this.compilerObject.getBaseTypeOfLiteralType(r.compilerType))}getSymbolsInScope(r,n){return this.compilerObject.getSymbolsInScope(r.compilerNode,n).map(i=>this._context.compilerFactory.getSymbol(i))}getTypeArguments(r){return this.compilerObject.getTypeArguments(r.compilerType).map(n=>this._context.compilerFactory.getType(n))}_getDefaultTypeFormatFlags(r){let n=b.TypeFormatFlags.UseTypeOfFunction|b.TypeFormatFlags.NoTruncation|b.TypeFormatFlags.UseFullyQualifiedType|b.TypeFormatFlags.WriteTypeArgumentsOfSignature;return r!=null&&r.getKind()===b.SyntaxKind.TypeAliasDeclaration&&(n|=b.TypeFormatFlags.InTypeAlias),n}},U6=class{constructor(r){this._context=r.context,this._configFileParsingDiagnostics=r.configFileParsingDiagnostics,this._typeChecker=new vL(this._context),this._reset(r.rootNames,r.host)}get compilerObject(){return this._getOrCreateCompilerObject()}_isCompilerProgramCreated(){return this._createdCompilerObject!=null}_reset(r,n){let i=this._context.compilerOptions.get();this._getOrCreateCompilerObject=()=>(this._createdCompilerObject==null&&(this._createdCompilerObject=b.ts.createProgram(r,i,n,this._oldProgram,this._configFileParsingDiagnostics),delete this._oldProgram),this._createdCompilerObject),this._createdCompilerObject!=null&&(this._oldProgram=this._createdCompilerObject,delete this._createdCompilerObject),this._typeChecker._reset(()=>this.compilerObject.getTypeChecker())}getTypeChecker(){return this._typeChecker}async emit(r={}){if(r.writeFile){let s=`Cannot specify a ${b.nameof(r,"writeFile")} option when emitting asynchrously. Use ${b.nameof(this,"emitSync")}() instead.`;throw new b.errors.InvalidOperationError(s)}let{fileSystemWrapper:n}=this._context,i=[],a=this._emit({writeFile:(s,u,p)=>{i.push(n.writeFile(n.getStandardizedAbsolutePath(s),p?"\uFEFF"+u:u))},...r});return await Promise.all(i),new VT(this._context,a)}emitSync(r={}){return new VT(this._context,this._emit(r))}emitToMemory(r={}){let n=[],{fileSystemWrapper:i}=this._context,a=this._emit({writeFile:(s,u,p)=>{n.push({filePath:i.getStandardizedAbsolutePath(s),text:u,writeByteOrderMark:p||!1})},...r});return new M6(this._context,a,n)}_emit(r={}){let n=r.targetSourceFile!=null?r.targetSourceFile.compilerNode:void 0,{emitOnlyDtsFiles:i,customTransformers:a,writeFile:s}=r,u=void 0;return this.compilerObject.emit(n,s,u,i,a)}getSyntacticDiagnostics(r){return this.compilerObject.getSyntacticDiagnostics(r?.compilerNode).map(i=>this._context.compilerFactory.getDiagnosticWithLocation(i))}getSemanticDiagnostics(r){return this.compilerObject.getSemanticDiagnostics(r?.compilerNode).map(i=>this._context.compilerFactory.getDiagnostic(i))}getDeclarationDiagnostics(r){return this.compilerObject.getDeclarationDiagnostics(r?.compilerNode).map(i=>this._context.compilerFactory.getDiagnosticWithLocation(i))}getGlobalDiagnostics(){return this.compilerObject.getGlobalDiagnostics().map(n=>this._context.compilerFactory.getDiagnostic(n))}getConfigFileParsingDiagnostics(){return this.compilerObject.getConfigFileParsingDiagnostics().map(n=>this._context.compilerFactory.getDiagnostic(n))}getEmitModuleResolutionKind(){return b.getEmitModuleResolutionKind(this.compilerObject.getCompilerOptions())}isSourceFileFromExternalLibrary(r){return r.isFromExternalLibrary()}},K6=class{constructor(r){var n;this._projectVersion=0,this._context=r.context;let{languageServiceHost:i,compilerHost:a}=b.createHosts({transactionalFileSystem:this._context.fileSystemWrapper,sourceFileContainer:this._context.getSourceFileContainer(),compilerOptions:this._context.compilerOptions,getNewLine:()=>this._context.manipulationSettings.getNewLineKindAsString(),getProjectVersion:()=>`${this._projectVersion}`,resolutionHost:(n=r.resolutionHost)!==null&&n!==void 0?n:{},libFolderPath:r.libFolderPath,skipLoadingLibFiles:r.skipLoadingLibFiles});this._compilerHost=a,this._compilerObject=b.ts.createLanguageService(i,this._context.compilerFactory.documentRegistry),this._program=new U6({context:this._context,rootNames:Array.from(this._context.compilerFactory.getSourceFilePaths()),host:this._compilerHost,configFileParsingDiagnostics:r.configFileParsingDiagnostics}),this._context.compilerFactory.onSourceFileAdded(s=>{s._isInProject()&&this._reset()}),this._context.compilerFactory.onSourceFileRemoved(()=>this._reset())}get compilerObject(){return this._compilerObject}_reset(){this._projectVersion+=1,this._program._reset(Array.from(this._context.compilerFactory.getSourceFilePaths()),this._compilerHost)}getProgram(){return this._program}getDefinitions(r){return this.getDefinitionsAtPosition(r._sourceFile,r.getStart())}getDefinitionsAtPosition(r,n){return(this.compilerObject.getDefinitionAtPosition(r.getFilePath(),n)||[]).map(a=>this._context.compilerFactory.getDefinitionInfo(a))}getImplementations(r){return this.getImplementationsAtPosition(r._sourceFile,r.getStart())}getImplementationsAtPosition(r,n){return(this.compilerObject.getImplementationAtPosition(r.getFilePath(),n)||[]).map(a=>new mL(this._context,a))}findReferences(r){return this.findReferencesAtPosition(r._sourceFile,r.getStart())}findReferencesAsNodes(r){let n=this.findReferences(r);return Array.from(i());function*i(){for(let a of n){let s=a.getDefinition().getKind()===b.ts.ScriptElementKind.alias,u=a.getReferences();for(let p=0;p<u.length;p++){let f=u[p];(s||!f.isDefinition()||p>0)&&(yield f.getNode())}}}}findReferencesAtPosition(r,n){return(this.compilerObject.findReferences(r.getFilePath(),n)||[]).map(a=>this._context.compilerFactory.getReferencedSymbol(a))}findRenameLocations(r,n={}){let i=n.usePrefixAndSuffixText==null?this._context.manipulationSettings.getUsePrefixAndSuffixTextForRename():n.usePrefixAndSuffixText;return(this.compilerObject.findRenameLocations(r._sourceFile.getFilePath(),r.getStart(),n.renameInStrings||!1,n.renameInComments||!1,i)||[]).map(s=>new G6(this._context,s))}getSuggestionDiagnostics(r){let n=this._getFilePathFromFilePathOrSourceFile(r);return this.compilerObject.getSuggestionDiagnostics(n).map(a=>this._context.compilerFactory.getDiagnosticWithLocation(a))}getFormattingEditsForRange(r,n,i){return(this.compilerObject.getFormattingEditsForRange(r,n[0],n[1],this._getFilledSettings(i))||[]).map(a=>new FE(a))}getFormattingEditsForDocument(r,n){let i=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r);return(this.compilerObject.getFormattingEditsForDocument(i,this._getFilledSettings(n))||[]).map(a=>new FE(a))}getFormattedDocumentText(r,n){let i=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),a=this._context.compilerFactory.getSourceFileFromCacheFromFilePath(i);if(a==null)throw new b.errors.FileNotFoundError(i);n=this._getFilledSettings(n);let s=this.getFormattingEditsForDocument(i,n),u=jH(a,s),p=n.newLineCharacter;return n.ensureNewLineAtEndOfFile&&!u.endsWith(p)&&(u+=p),u.replace(/\r?\n/g,p)}getEmitOutput(r,n){let i=this._getFilePathFromFilePathOrSourceFile(r),a=this.compilerObject;return new pL(this._context,s());function s(){let u=a.getProgram();return u==null||u.getSourceFile(i)==null?{emitSkipped:!0,outputFiles:[]}:a.getEmitOutput(i,n)}}getIdentationAtPosition(r,n,i){let a=this._getFilePathFromFilePathOrSourceFile(r);return i==null?i=this._context.manipulationSettings.getEditorSettings():VH(i,this._context.manipulationSettings),this.compilerObject.getIndentationAtPosition(a,n,i)}organizeImports(r,n={},i={}){let a={type:"file",fileName:this._getFilePathFromFilePathOrSourceFile(r)};return this.compilerObject.organizeImports(a,this._getFilledSettings(n),this._getFilledUserPreferences(i)).map(s=>new fS(this._context,s))}getEditsForRefactor(r,n,i,a,s,u={}){let p=this._getFilePathFromFilePathOrSourceFile(r),f=typeof i=="number"?i:{pos:i.getPos(),end:i.getEnd()},m=this.compilerObject.getEditsForRefactor(p,this._getFilledSettings(n),f,a,s,this._getFilledUserPreferences(u));return m!=null?new _L(this._context,m):void 0}getCombinedCodeFix(r,n,i={},a={}){let s=this.compilerObject.getCombinedCodeFix({type:"file",fileName:this._getFilePathFromFilePathOrSourceFile(r)},n,this._getFilledSettings(i),this._getFilledUserPreferences(a||{}));return new dL(this._context,s)}getCodeFixesAtPosition(r,n,i,a,s={},u={}){let p=this._getFilePathFromFilePathOrSourceFile(r);return this.compilerObject.getCodeFixesAtPosition(p,n,i,a,this._getFilledSettings(s),this._getFilledUserPreferences(u||{})).map(m=>new k6(this._context,m))}_getFilePathFromFilePathOrSourceFile(r){let n=typeof r=="string"?this._context.fileSystemWrapper.getStandardizedAbsolutePath(r):r.getFilePath();if(!this._context.compilerFactory.containsSourceFileAtPath(n))throw new b.errors.FileNotFoundError(n);return n}_getFilledSettings(r){return r._filled||(r=Object.assign(this._context.getFormatCodeSettings(),r),RBe(r,this._context.manipulationSettings),r._filled=!0),r}_getFilledUserPreferences(r){return Object.assign(this._context.getUserPreferences(),r)}},hL=class{constructor(r,n){this._context=r,this._compilerType=n}get compilerType(){return this._compilerType}getText(r,n){return this._context.typeChecker.getTypeText(this,r,n)}getAliasSymbol(){return this.compilerType.aliasSymbol==null?void 0:this._context.compilerFactory.getSymbol(this.compilerType.aliasSymbol)}getAliasSymbolOrThrow(){return b.errors.throwIfNullOrUndefined(this.getAliasSymbol(),"Expected to find an alias symbol.")}getAliasTypeArguments(){return(this.compilerType.aliasTypeArguments||[]).map(n=>this._context.compilerFactory.getType(n))}getApparentType(){return this._context.typeChecker.getApparentType(this)}getArrayElementTypeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getArrayElementType(),"Expected to find an array element type.")}getArrayElementType(){if(!!this.isArray())return this.getTypeArguments()[0]}getBaseTypes(){return(this.compilerType.getBaseTypes()||[]).map(n=>this._context.compilerFactory.getType(n))}getBaseTypeOfLiteralType(){return this._context.typeChecker.getBaseTypeOfLiteralType(this)}getCallSignatures(){return this.compilerType.getCallSignatures().map(r=>this._context.compilerFactory.getSignature(r))}getConstructSignatures(){return this.compilerType.getConstructSignatures().map(r=>this._context.compilerFactory.getSignature(r))}getConstraintOrThrow(){return b.errors.throwIfNullOrUndefined(this.getConstraint(),"Expected to find a constraint.")}getConstraint(){let r=this.compilerType.getConstraint();return r==null?void 0:this._context.compilerFactory.getType(r)}getDefaultOrThrow(){return b.errors.throwIfNullOrUndefined(this.getDefault(),"Expected to find a default type.")}getDefault(){let r=this.compilerType.getDefault();return r==null?void 0:this._context.compilerFactory.getType(r)}getProperties(){return this.compilerType.getProperties().map(r=>this._context.compilerFactory.getSymbol(r))}getPropertyOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getProperty(r),()=>Ou("symbol property",r))}getProperty(r){return Qde(this.getProperties(),r)}getApparentProperties(){return this.compilerType.getApparentProperties().map(r=>this._context.compilerFactory.getSymbol(r))}getApparentProperty(r){return Qde(this.getApparentProperties(),r)}isNullable(){return this.getUnionTypes().some(r=>r.isNull()||r.isUndefined())}getNonNullableType(){return this._context.compilerFactory.getType(this.compilerType.getNonNullableType())}getNumberIndexType(){let r=this.compilerType.getNumberIndexType();return r==null?void 0:this._context.compilerFactory.getType(r)}getStringIndexType(){let r=this.compilerType.getStringIndexType();return r==null?void 0:this._context.compilerFactory.getType(r)}getTargetType(){let r=this.compilerType.target||void 0;return r==null?void 0:this._context.compilerFactory.getType(r)}getTargetTypeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getTargetType(),"Expected to find the target type.")}getTypeArguments(){return this._context.typeChecker.getTypeArguments(this)}getTupleElements(){return this.isTuple()?this.getTypeArguments():[]}getUnionTypes(){return this.isUnion()?this.compilerType.types.map(r=>this._context.compilerFactory.getType(r)):[]}getIntersectionTypes(){return this.isIntersection()?this.compilerType.types.map(r=>this._context.compilerFactory.getType(r)):[]}getLiteralValue(){var r;return(r=this.compilerType)===null||r===void 0?void 0:r.value}getLiteralValueOrThrow(){return b.errors.throwIfNullOrUndefined(this.getLiteralValue(),"Type was not a literal type.")}getLiteralFreshType(){var r;let n=(r=this.compilerType)===null||r===void 0?void 0:r.freshType;return n==null?void 0:this._context.compilerFactory.getType(n)}getLiteralFreshTypeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getLiteralFreshType(),"Type was not a literal type.")}getLiteralRegularType(){var r;let n=(r=this.compilerType)===null||r===void 0?void 0:r.regularType;return n==null?void 0:this._context.compilerFactory.getType(n)}getLiteralRegularTypeOrThrow(){return b.errors.throwIfNullOrUndefined(this.getLiteralRegularType(),"Type was not a literal type.")}getSymbol(){let r=this.compilerType.getSymbol();return r==null?void 0:this._context.compilerFactory.getSymbol(r)}getSymbolOrThrow(){return b.errors.throwIfNullOrUndefined(this.getSymbol(),"Expected to find a symbol.")}isAnonymous(){return this._hasObjectFlag(b.ObjectFlags.Anonymous)}isAny(){return this._hasTypeFlag(b.TypeFlags.Any)}isNever(){return this._hasTypeFlag(b.TypeFlags.Never)}isArray(){let r=this.getSymbol();return r==null?!1:(r.getName()==="Array"||r.getName()==="ReadonlyArray")&&this.getTypeArguments().length===1}isReadonlyArray(){let r=this.getSymbol();return r==null?!1:r.getName()==="ReadonlyArray"&&this.getTypeArguments().length===1}isTemplateLiteral(){return this._hasTypeFlag(b.TypeFlags.TemplateLiteral)}isBoolean(){return this._hasTypeFlag(b.TypeFlags.Boolean)}isString(){return this._hasTypeFlag(b.TypeFlags.String)}isNumber(){return this._hasTypeFlag(b.TypeFlags.Number)}isLiteral(){let r=this.isBooleanLiteral();return this.compilerType.isLiteral()||r}isBooleanLiteral(){return this._hasTypeFlag(b.TypeFlags.BooleanLiteral)}isEnumLiteral(){return this._hasTypeFlag(b.TypeFlags.EnumLiteral)&&!this.isUnion()}isNumberLiteral(){return this._hasTypeFlag(b.TypeFlags.NumberLiteral)}isStringLiteral(){return this.compilerType.isStringLiteral()}isClass(){return this.compilerType.isClass()}isClassOrInterface(){return this.compilerType.isClassOrInterface()}isEnum(){if(this._hasTypeFlag(b.TypeFlags.Enum))return!0;if(this.isEnumLiteral()&&!this.isUnion())return!1;let n=this.getSymbol();if(n==null)return!1;let i=n.getValueDeclaration();return i!=null&&Tr.isEnumDeclaration(i)}isInterface(){return this._hasObjectFlag(b.ObjectFlags.Interface)}isObject(){return this._hasTypeFlag(b.TypeFlags.Object)}isTypeParameter(){return this.compilerType.isTypeParameter()}isTuple(){let r=this.getTargetType();return r==null?!1:r._hasObjectFlag(b.ObjectFlags.Tuple)}isUnion(){return this.compilerType.isUnion()}isIntersection(){return this.compilerType.isIntersection()}isUnionOrIntersection(){return this.compilerType.isUnionOrIntersection()}isUnknown(){return this._hasTypeFlag(b.TypeFlags.Unknown)}isNull(){return this._hasTypeFlag(b.TypeFlags.Null)}isUndefined(){return this._hasTypeFlag(b.TypeFlags.Undefined)}getFlags(){return this.compilerType.flags}getObjectFlags(){return this.isObject()&&this.compilerType.objectFlags||0}_hasTypeFlag(r){return(this.compilerType.flags&r)===r}_hasObjectFlag(r){return(this.getObjectFlags()&r)===r}},W6=class extends hL{getConstraintOrThrow(){return b.errors.throwIfNullOrUndefined(this.getConstraint(),"Expected type parameter to have a constraint.")}getConstraint(){let r=this._getTypeParameterDeclaration();if(r==null)return;let n=r.getConstraint();if(n!=null)return this._context.typeChecker.getTypeAtLocation(n)}getDefaultOrThrow(){return b.errors.throwIfNullOrUndefined(this.getDefault(),"Expected type parameter to have a default type.")}getDefault(){let r=this._getTypeParameterDeclaration();if(r==null)return;let n=r.getDefault();if(n!=null)return this._context.typeChecker.getTypeAtLocation(n)}_getTypeParameterDeclaration(){let r=this.getSymbol();if(r==null)return;let n=r.getDeclarations()[0];if(n!=null&&!!Tr.isTypeParameterDeclaration(n))return n}},EL=class{constructor(r,n){this._skippedFilePaths=r,this._outputFilePaths=n}getSkippedFilePaths(){return this._skippedFilePaths}getOutputFilePaths(){return this._outputFilePaths}},OE=class{constructor(r,n){this.__context=r,this._setPathInternal(n)}_setPathInternal(r){this._path=r,this._pathParts=r.split("/").filter(n=>n.length>0)}get _context(){return this._throwIfDeletedOrRemoved(),this.__context}isAncestorOf(r){return OE._isAncestorOfDir(this,r)}isDescendantOf(r){return OE._isAncestorOfDir(r,this)}_getDepth(){return this._pathParts.length}getPath(){return this._throwIfDeletedOrRemoved(),this._path}getBaseName(){return this._pathParts[this._pathParts.length-1]}getParentOrThrow(){return b.errors.throwIfNullOrUndefined(this.getParent(),()=>`Parent directory of ${this.getPath()} does not exist or was never added.`)}getParent(){if(!b.FileUtils.isRootDirPath(this.getPath()))return this.addDirectoryAtPathIfExists(b.FileUtils.getDirPath(this.getPath()))}getDirectoryOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getDirectory(r),()=>typeof r=="string"?`Could not find a directory at path '${this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath())}'.`:"Could not find child directory that matched condition.")}getDirectory(r){if(typeof r=="string"){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.compilerFactory.getDirectoryFromCache(n)}return this.getDirectories().find(r)}getSourceFileOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getSourceFile(r),()=>typeof r=="string"?`Could not find child source file at path '${this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath())}'.`:"Could not find child source file that matched condition.")}getSourceFile(r){if(typeof r=="string"){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.compilerFactory.getSourceFileFromCacheFromFilePath(n)}for(let n of this._getSourceFilesIterator())if(r(n))return n}getDirectories(){return Array.from(this._getDirectoriesIterator())}_getDirectoriesIterator(){return this._context.compilerFactory.getChildDirectoriesOfDirectory(this.getPath())}getSourceFiles(r){let{compilerFactory:n,fileSystemWrapper:i}=this._context,a=this;if(typeof r=="string"||r instanceof Array){let u=typeof r=="string"?[r]:r;return Array.from(s(u))}else return Array.from(this._getSourceFilesIterator());function*s(u){let p=Array.from(m()),f=b.matchGlobs(p,u,a.getPath());for(let g of f)yield n.getSourceFileFromCacheFromFilePath(i.getStandardizedAbsolutePath(g));function*m(){for(let g of a._getDescendantSourceFilesIterator())yield g.getFilePath()}}}_getSourceFilesIterator(){return this._context.compilerFactory.getChildSourceFilesOfDirectory(this.getPath())}getDescendantSourceFiles(){return Array.from(this._getDescendantSourceFilesIterator())}*_getDescendantSourceFilesIterator(){for(let r of this._getSourceFilesIterator())yield r;for(let r of this._getDirectoriesIterator())yield*r._getDescendantSourceFilesIterator()}getDescendantDirectories(){return Array.from(this._getDescendantDirectoriesIterator())}*_getDescendantDirectoriesIterator(){for(let r of this.getDirectories())yield r,yield*r._getDescendantDirectoriesIterator()}addSourceFilesAtPaths(r){return r=typeof r=="string"?[r]:r,r=r.map(n=>b.FileUtils.pathIsAbsolute(n)?n:b.FileUtils.pathJoin(this.getPath(),n)),this._context.directoryCoordinator.addSourceFilesAtPaths(r,{markInProject:this._isInProject()})}addDirectoryAtPathIfExists(r,n={}){let i=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.directoryCoordinator.addDirectoryAtPathIfExists(i,{...n,markInProject:this._isInProject()})}addDirectoryAtPath(r,n={}){let i=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.directoryCoordinator.addDirectoryAtPath(i,{...n,markInProject:this._isInProject()})}createDirectory(r){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.directoryCoordinator.createDirectoryOrAddIfExists(n,{markInProject:this._isInProject()})}createSourceFile(r,n,i){let a=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.compilerFactory.createSourceFile(a,n||"",{...i||{},markInProject:this._isInProject()})}addSourceFileAtPathIfExists(r){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.directoryCoordinator.addSourceFileAtPathIfExists(n,{markInProject:this._isInProject()})}addSourceFileAtPath(r){let n=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return this._context.directoryCoordinator.addSourceFileAtPath(n,{markInProject:this._isInProject()})}async emit(r={}){let{fileSystemWrapper:n}=this._context,i=[],a=[],s=[];for(let u of this._emitInternal(r))Nfe(u)?s.push(u):(i.push(n.writeFile(u.filePath,u.fileText)),a.push(u.filePath));return await Promise.all(i),new EL(s,a)}emitSync(r={}){let{fileSystemWrapper:n}=this._context,i=[],a=[];for(let s of this._emitInternal(r))Nfe(s)?a.push(s):(n.writeFileSync(s.filePath,s.fileText),i.push(s.filePath));return new EL(a,i)}_emitInternal(r={}){let{emitOnlyDtsFiles:n=!1}=r,i=r.outDir==null?void 0:/\.js$/i,a=r.outDir==null?void 0:/\.js\.map$/i,s=r.declarationDir==null&&r.outDir==null?void 0:/\.d\.ts$/i,u=g=>g==null?void 0:this._context.fileSystemWrapper.getStandardizedAbsolutePath(g,this.getPath()),p=(g,D)=>g==null?void 0:b.FileUtils.pathJoin(g,D.getBaseName()),f=this._context.compilerOptions.get().declarationDir!=null||r.declarationDir!=null;return m(this,u(r.outDir),u(r.declarationDir));function*m(g,D,P){for(let B of g.getSourceFiles()){let K=B.getEmitOutput({emitOnlyDtsFiles:n});if(K.getEmitSkipped()){yield B.getFilePath();continue}for(let h of K.getOutputFiles()){let S=h.getFilePath(),U=h.getWriteByteOrderMark()?b.FileUtils.getTextWithByteOrderMark(h.getText()):h.getText();D!=null&&(i.test(S)||a.test(S)||!f&&s.test(S))?S=b.FileUtils.pathJoin(D,b.FileUtils.getBaseName(S)):P!=null&&s.test(S)&&(S=b.FileUtils.pathJoin(P,b.FileUtils.getBaseName(S))),yield{filePath:S,fileText:U}}}for(let B of g.getDirectories())yield*m(B,p(D,B),p(P,B))}}copyToDirectory(r,n){let i=typeof r=="string"?r:r.getPath();return this.copy(b.FileUtils.pathJoin(i,this.getBaseName()),n)}copy(r,n){let i=this.getPath(),a=this._context.fileSystemWrapper,s=this._context.fileSystemWrapper.getStandardizedAbsolutePath(r,this.getPath());return i===s?this:(n=oj(n),n.includeUntrackedFiles&&a.queueCopyDirectory(i,s),this._copyInternal(s,n))}async copyImmediately(r,n){let i=this._context.fileSystemWrapper,a=this.getPath(),s=i.getStandardizedAbsolutePath(r,a);if(a===s)return await this.save(),this;n=oj(n);let u=this._copyInternal(s,n);return n.includeUntrackedFiles&&await i.copyDirectoryImmediately(a,s),await u.save(),u}copyImmediatelySync(r,n){let i=this._context.fileSystemWrapper,a=this.getPath(),s=i.getStandardizedAbsolutePath(r,a);if(a===s)return this.saveSync(),this;n=oj(n);let u=this._copyInternal(s,n);return n.includeUntrackedFiles&&i.copyDirectoryImmediatelySync(a,s),u.saveSync(),u}_copyInternal(r,n){if(this.getPath()===r)return this;let{fileSystemWrapper:a,compilerFactory:s}=this._context,u=[this,...this.getDescendantDirectories()].map(f=>({newDirPath:f===this?r:a.getStandardizedAbsolutePath(this.getRelativePathTo(f),r)})),p=this.getDescendantSourceFiles().map(f=>({sourceFile:f,newFilePath:a.getStandardizedAbsolutePath(this.getRelativePathTo(f),r),references:this._getReferencesForCopy(f)}));for(let{newDirPath:f}of u)this._context.compilerFactory.createDirectoryOrAddIfExists(f,{markInProject:this._isInProject()});for(let{sourceFile:f,newFilePath:m}of p)f._copyInternal(m,n);for(let{references:f,newFilePath:m}of p)this.getSourceFileOrThrow(m)._updateReferencesForCopyInternal(f);return s.getDirectoryFromCache(r)}moveToDirectory(r,n){let i=typeof r=="string"?r:r.getPath();return this.move(b.FileUtils.pathJoin(i,this.getBaseName()),n)}move(r,n){let i=this._context.fileSystemWrapper,a=this.getPath(),s=i.getStandardizedAbsolutePath(r,a);return a===s?this:this._moveInternal(s,n,()=>i.queueMoveDirectory(a,s))}async moveImmediately(r,n){let i=this._context.fileSystemWrapper,a=this.getPath(),s=i.getStandardizedAbsolutePath(r,a);return a===s?(await this.save(),this):(this._moveInternal(s,n),await i.moveDirectoryImmediately(a,s),await this.save(),this)}moveImmediatelySync(r,n){let i=this._context.fileSystemWrapper,a=this.getPath(),s=i.getStandardizedAbsolutePath(r,a);return a===s?(this.saveSync(),this):(this._moveInternal(s,n),i.moveDirectoryImmediatelySync(a,s),this.saveSync(),this)}_moveInternal(r,n,i){let a=this.getPath();if(a===r)return this;let s=this._context.compilerFactory.getDirectoryFromCacheOnlyIfInCache(r),u=s!=null&&s._isInProject();i&&i();let p=this._context.fileSystemWrapper,f=this._context.compilerFactory,m=[this,...this.getDescendantDirectories()].map(D=>({directory:D,oldPath:D.getPath(),newDirPath:D===this?r:p.getStandardizedAbsolutePath(this.getRelativePathTo(D),r)})),g=this.getDescendantSourceFiles().map(D=>({sourceFile:D,newFilePath:p.getStandardizedAbsolutePath(this.getRelativePathTo(D),r),references:this._getReferencesForMove(D)}));for(let{directory:D,oldPath:P,newDirPath:B}of m){f.removeDirectoryFromCache(P);let K=f.getDirectoryFromCache(B);K?._forgetOnlyThis(),D._setPathInternal(B),f.addDirectoryToCache(D)}for(let{sourceFile:D,newFilePath:P}of g)D._moveInternal(P,n);for(let{sourceFile:D,references:P}of g)D._updateReferencesForMoveInternal(P,a);return u&&this._markAsInProject(),this}clear(){let r=this.getPath();this._deleteDescendants(),this._context.fileSystemWrapper.queueDirectoryDelete(r),this._context.fileSystemWrapper.queueMkdir(r)}async clearImmediately(){let r=this.getPath();this._deleteDescendants(),await this._context.fileSystemWrapper.clearDirectoryImmediately(r)}clearImmediatelySync(){let r=this.getPath();this._deleteDescendants(),this._context.fileSystemWrapper.clearDirectoryImmediatelySync(r)}delete(){let r=this.getPath();this._deleteDescendants(),this._context.fileSystemWrapper.queueDirectoryDelete(r),this.forget()}_deleteDescendants(){for(let r of this.getSourceFiles())r.delete();for(let r of this.getDirectories())r.delete()}async deleteImmediately(){let{fileSystemWrapper:r}=this._context,n=this.getPath();this.forget(),await r.deleteDirectoryImmediately(n)}deleteImmediatelySync(){let{fileSystemWrapper:r}=this._context,n=this.getPath();this.forget(),r.deleteDirectoryImmediatelySync(n)}forget(){if(!this.wasForgotten()){for(let r of this.getSourceFiles())r.forget();for(let r of this.getDirectories())r.forget();this._forgetOnlyThis()}}_forgetOnlyThis(){this.wasForgotten()||(this._context.compilerFactory.removeDirectoryFromCache(this.getPath()),this.__context=void 0)}async save(){await this._context.fileSystemWrapper.saveForDirectory(this.getPath());let r=this.getDescendantSourceFiles().filter(n=>!n.isSaved());await Promise.all(r.map(n=>n.save()))}saveSync(){this._context.fileSystemWrapper.saveForDirectorySync(this.getPath()),this.getDescendantSourceFiles().filter(n=>!n.isSaved()).forEach(n=>n.saveSync())}getRelativePathTo(r){let n=this;return b.FileUtils.getRelativePathTo(this.getPath(),i());function i(){return r instanceof kE?r.getFilePath():r instanceof OE?r.getPath():n._context.fileSystemWrapper.getStandardizedAbsolutePath(r,n.getPath())}}getRelativePathAsModuleSpecifierTo(r){let n=this._context.program.getEmitModuleResolutionKind(),i=this,a=b.FileUtils.getRelativePathTo(this.getPath(),s()).replace(/((\.d\.ts$)|(\.[^/.]+$))/i,"");return a.startsWith("../")?a:"./"+a;function s(){return r instanceof kE?u(r):r instanceof OE?p(r):f(i._context.fileSystemWrapper.getStandardizedAbsolutePath(r,i.getPath()));function u(m){return f(m.getFilePath())}function p(m){switch(n){case b.ModuleResolutionKind.NodeJs:return m===i?b.FileUtils.pathJoin(m.getPath(),"index.ts"):m.getPath();case b.ModuleResolutionKind.Classic:case b.ModuleResolutionKind.Node16:case b.ModuleResolutionKind.NodeNext:return b.FileUtils.pathJoin(m.getPath(),"index.ts");default:return b.errors.throwNotImplementedForNeverValueError(n)}}function f(m){let g=b.FileUtils.getDirPath(m);switch(n){case b.ModuleResolutionKind.NodeJs:return g===i.getPath()?m:m.replace(/\/index?(\.d\.ts|\.ts|\.js)$/i,"");case b.ModuleResolutionKind.Classic:case b.ModuleResolutionKind.Node16:case b.ModuleResolutionKind.NodeNext:return m;default:return b.errors.throwNotImplementedForNeverValueError(n)}}}}getProject(){return this._context.project}wasForgotten(){return this.__context==null}_isInProject(){return this._context.inProjectCoordinator.isDirectoryInProject(this)}_markAsInProject(){this._context.inProjectCoordinator.markDirectoryAsInProject(this)}_hasLoadedParent(){return this._context.compilerFactory.containsDirectoryAtPath(b.FileUtils.getDirPath(this.getPath()))}_throwIfDeletedOrRemoved(){if(this.wasForgotten())throw new b.errors.InvalidOperationError("Cannot use a directory that was deleted, removed, or overwritten.")}_getReferencesForCopy(r){return r._getReferencesForCopyInternal().filter(i=>!this.isAncestorOf(i[1]))}_getReferencesForMove(r){let{literalReferences:n,referencingLiterals:i}=r._getReferencesForMoveInternal();return{literalReferences:n.filter(a=>!this.isAncestorOf(a[1])),referencingLiterals:i.filter(a=>!this.isAncestorOf(a._sourceFile))}}static _isAncestorOfDir(r,n){if(n instanceof kE&&(n=n.getDirectory(),r===n))return!0;if(r._pathParts.length>=n._pathParts.length)return!1;for(let i=r._pathParts.length-1;i>=0;i--)if(r._pathParts[i]!==n._pathParts[i])return!1;return!0}};function oj(e){return e=b.ObjectUtils.clone(e||{}),mu(e,"includeUntrackedFiles",!0),e}function Nfe(e){return typeof e=="string"}var MH=class{constructor(r,n){this.compilerFactory=r,this.fileSystemWrapper=n}addDirectoryAtPathIfExists(r,n){let i=this.compilerFactory.getDirectoryFromPath(r,n);if(i!=null){if(n.recursive)for(let a of b.FileUtils.getDescendantDirectories(this.fileSystemWrapper,r))this.compilerFactory.createDirectoryOrAddIfExists(a,n);return i}}addDirectoryAtPath(r,n){let i=this.addDirectoryAtPathIfExists(r,n);if(i==null)throw new b.errors.DirectoryNotFoundError(r);return i}createDirectoryOrAddIfExists(r,n){return this.compilerFactory.createDirectoryOrAddIfExists(r,n)}addSourceFileAtPathIfExists(r,n){return this.compilerFactory.addOrGetSourceFileFromFilePath(r,{markInProject:n.markInProject,scriptKind:void 0})}addSourceFileAtPath(r,n){let i=this.addSourceFileAtPathIfExists(r,n);if(i==null)throw new b.errors.FileNotFoundError(this.fileSystemWrapper.getStandardizedAbsolutePath(r));return i}addSourceFilesAtPaths(r,n){typeof r=="string"&&(r=[r]);let i=[],a=new Set;for(let s of this.fileSystemWrapper.globSync(r)){let u=this.addSourceFileAtPathIfExists(s,n);u!=null&&i.push(u),a.add(b.FileUtils.getDirPath(s))}for(let s of b.FileUtils.getParentMostPaths(Array.from(a)))this.addDirectoryAtPathIfExists(s,{recursive:!0,markInProject:n.markInProject});return i}},wH=class{constructor(r){this.context=r,this.directoriesByPath=new b.KeyValueCache,this.sourceFilesByDirPath=new b.KeyValueCache,this.directoriesByDirPath=new b.KeyValueCache,this.orphanDirs=new b.KeyValueCache}has(r){return this.directoriesByPath.has(r)}get(r){if(!this.directoriesByPath.has(r)){for(let n of this.orphanDirs.getValues())if(b.FileUtils.pathStartsWith(n.getPath(),r))return this.createOrAddIfExists(r);return}return this.directoriesByPath.get(r)}getOrphans(){return this.orphanDirs.getValues()}getAll(){return this.directoriesByPath.getValuesAsArray()}*getAllByDepth(){let r=new b.KeyValueCache,n=0;for(let a of this.getOrphans())i(a);for(n=Math.min(...Array.from(r.getKeys()));r.getSize()>0;){for(let a of r.get(n)||[])yield a,a.getDirectories().forEach(i);r.removeByKey(n),n++}function i(a){let s=a._getDepth();if(n>s)throw new Error(`For some reason a subdirectory had a lower depth than the parent directory: ${a.getPath()}`);r.getOrCreate(s,()=>[]).push(a)}}remove(r){this.removeFromDirectoriesByDirPath(r),this.directoriesByPath.removeByKey(r),this.orphanDirs.removeByKey(r)}*getChildDirectoriesOfDirectory(r){var n;let i=(n=this.directoriesByDirPath.get(r))===null||n===void 0?void 0:n.entries();if(i!=null)for(let a of i)yield a}*getChildSourceFilesOfDirectory(r){var n;let i=(n=this.sourceFilesByDirPath.get(r))===null||n===void 0?void 0:n.entries();if(i!=null)for(let a of i)yield a}addSourceFile(r){let n=r.getDirectoryPath();this.createOrAddIfExists(n),this.sourceFilesByDirPath.getOrCreate(n,()=>new b.SortedKeyValueArray(a=>a.getBaseName(),b.LocaleStringComparer.instance)).set(r)}removeSourceFile(r){let n=b.FileUtils.getDirPath(r),i=this.sourceFilesByDirPath.get(n);i!=null&&(i.removeByKey(b.FileUtils.getBaseName(r)),i.hasItems()||this.sourceFilesByDirPath.removeByKey(n))}createOrAddIfExists(r){return this.has(r)?this.get(r):(this.fillParentsOfDirPath(r),this.createDirectory(r))}createDirectory(r){let n=new OE(this.context,r);return this.addDirectory(n),n}addDirectory(r){let n=r.getPath(),i=b.FileUtils.getDirPath(n),a=i===n;for(let s of this.orphanDirs.getValues()){let u=s.getPath(),p=b.FileUtils.getDirPath(u);!(p===u)&&p===n&&this.orphanDirs.removeByKey(u)}a||this.addToDirectoriesByDirPath(r),this.has(i)||this.orphanDirs.set(n,r),this.directoriesByPath.set(n,r),this.context.fileSystemWrapper.directoryExistsSync(n)||this.context.fileSystemWrapper.queueMkdir(n);for(let s of this.orphanDirs.getValues())r.isAncestorOf(s)&&this.fillParentsOfDirPath(s.getPath())}addToDirectoriesByDirPath(r){if(b.FileUtils.isRootDirPath(r.getPath()))return;let n=b.FileUtils.getDirPath(r.getPath());this.directoriesByDirPath.getOrCreate(n,()=>new b.SortedKeyValueArray(a=>a.getBaseName(),b.LocaleStringComparer.instance)).set(r)}removeFromDirectoriesByDirPath(r){if(b.FileUtils.isRootDirPath(r))return;let n=b.FileUtils.getDirPath(r),i=this.directoriesByDirPath.get(n);i!=null&&(i.removeByKey(b.FileUtils.getBaseName(r)),i.hasItems()||this.directoriesByDirPath.removeByKey(n))}fillParentsOfDirPath(r){let n=[],i=b.FileUtils.getDirPath(r);for(;r!==i;){if(r=i,i=b.FileUtils.getDirPath(r),this.directoriesByPath.has(r)){for(let a of n)this.createDirectory(a);break}n.unshift(r)}}},FH=class extends b.KeyValueCache{constructor(){super(...arguments),this.forgetStack=[]}getOrCreate(r,n){return super.getOrCreate(r,()=>{let i=n();return this.forgetStack.length>0&&this.forgetStack[this.forgetStack.length-1].add(i),i})}setForgetPoint(){this.forgetStack.push(new Set)}forgetLastPoint(){let r=this.forgetStack.pop();r!=null&&this.forgetNodes(r.values())}rememberNode(r){if(r.wasForgotten())throw new b.errors.InvalidOperationError("Cannot remember a node that was removed or forgotten.");let n=!1;for(let i of this.forgetStack)if(i.delete(r)){n=!0;break}return n&&this.rememberParentOfNode(r),n}rememberParentOfNode(r){let n=r.getParentSyntaxList()||r.getParent();n!=null&&this.rememberNode(n)}forgetNodes(r){for(let n of r)n.wasForgotten()||n.getKind()===b.SyntaxKind.SourceFile||n._forgetOnlyThis()}},aUe={[b.SyntaxKind.SourceFile]:kE,[b.SyntaxKind.ArrayBindingPattern]:eM,[b.SyntaxKind.ArrayLiteralExpression]:iM,[b.SyntaxKind.ArrayType]:kw,[b.SyntaxKind.ArrowFunction]:hw,[b.SyntaxKind.AsExpression]:aM,[b.SyntaxKind.AssertClause]:ew,[b.SyntaxKind.AssertEntry]:rw,[b.SyntaxKind.AwaitExpression]:oM,[b.SyntaxKind.BigIntLiteral]:c6,[b.SyntaxKind.BindingElement]:rM,[b.SyntaxKind.BinaryExpression]:aL,[b.SyntaxKind.Block]:OM,[b.SyntaxKind.BreakStatement]:kM,[b.SyntaxKind.CallExpression]:sM,[b.SyntaxKind.CallSignature]:qF,[b.SyntaxKind.CaseBlock]:RM,[b.SyntaxKind.CaseClause]:MM,[b.SyntaxKind.CatchClause]:wM,[b.SyntaxKind.ClassDeclaration]:Tw,[b.SyntaxKind.ClassExpression]:xw,[b.SyntaxKind.ClassStaticBlockDeclaration]:Dw,[b.SyntaxKind.ConditionalType]:Rw,[b.SyntaxKind.Constructor]:Aw,[b.SyntaxKind.ConstructorType]:Mw,[b.SyntaxKind.ConstructSignature]:zF,[b.SyntaxKind.ContinueStatement]:GM,[b.SyntaxKind.CommaListExpression]:lM,[b.SyntaxKind.ComputedPropertyName]:x6,[b.SyntaxKind.ConditionalExpression]:uM,[b.SyntaxKind.DebuggerStatement]:BM,[b.SyntaxKind.Decorator]:Pw,[b.SyntaxKind.DefaultClause]:UM,[b.SyntaxKind.DeleteExpression]:cM,[b.SyntaxKind.DoStatement]:KM,[b.SyntaxKind.ElementAccessExpression]:sL,[b.SyntaxKind.EmptyStatement]:WM,[b.SyntaxKind.EnumDeclaration]:VF,[b.SyntaxKind.EnumMember]:jF,[b.SyntaxKind.ExportAssignment]:tw,[b.SyntaxKind.ExportDeclaration]:nw,[b.SyntaxKind.ExportSpecifier]:iw,[b.SyntaxKind.ExpressionWithTypeArguments]:ww,[b.SyntaxKind.ExpressionStatement]:VM,[b.SyntaxKind.ExternalModuleReference]:aw,[b.SyntaxKind.QualifiedName]:A6,[b.SyntaxKind.ForInStatement]:jM,[b.SyntaxKind.ForOfStatement]:HM,[b.SyntaxKind.ForStatement]:qM,[b.SyntaxKind.FunctionDeclaration]:Ew,[b.SyntaxKind.FunctionExpression]:bw,[b.SyntaxKind.FunctionType]:Fw,[b.SyntaxKind.GetAccessor]:Lw,[b.SyntaxKind.HeritageClause]:HF,[b.SyntaxKind.Identifier]:D6,[b.SyntaxKind.IfStatement]:JM,[b.SyntaxKind.ImportClause]:ow,[b.SyntaxKind.ImportDeclaration]:sw,[b.SyntaxKind.ImportEqualsDeclaration]:lw,[b.SyntaxKind.ImportSpecifier]:uw,[b.SyntaxKind.ImportType]:Bw,[b.SyntaxKind.ImportTypeAssertionContainer]:Gw,[b.SyntaxKind.IndexedAccessType]:Uw,[b.SyntaxKind.IndexSignature]:$F,[b.SyntaxKind.InferType]:Kw,[b.SyntaxKind.InterfaceDeclaration]:XF,[b.SyntaxKind.IntersectionType]:Ww,[b.SyntaxKind.JSDocAllType]:iF,[b.SyntaxKind.JSDocAugmentsTag]:aF,[b.SyntaxKind.JSDocAuthorTag]:oF,[b.SyntaxKind.JSDocCallbackTag]:sF,[b.SyntaxKind.JSDocClassTag]:lF,[b.SyntaxKind.JSDocDeprecatedTag]:uF,[b.SyntaxKind.JSDocEnumTag]:cF,[b.SyntaxKind.JSDocFunctionType]:dF,[b.SyntaxKind.JSDocImplementsTag]:fF,[b.SyntaxKind.JSDocLink]:pF,[b.SyntaxKind.JSDocLinkCode]:mF,[b.SyntaxKind.JSDocLinkPlain]:_F,[b.SyntaxKind.JSDocMemberName]:gF,[b.SyntaxKind.JSDocNamepathType]:yF,[b.SyntaxKind.JSDocNameReference]:vF,[b.SyntaxKind.JSDocNonNullableType]:hF,[b.SyntaxKind.JSDocNullableType]:EF,[b.SyntaxKind.JSDocOptionalType]:bF,[b.SyntaxKind.JSDocOverrideTag]:SF,[b.SyntaxKind.JSDocParameterTag]:TF,[b.SyntaxKind.JSDocPrivateTag]:xF,[b.SyntaxKind.JSDocPropertyTag]:DF,[b.SyntaxKind.JSDocProtectedTag]:CF,[b.SyntaxKind.JSDocPublicTag]:AF,[b.SyntaxKind.JSDocReturnTag]:NF,[b.SyntaxKind.JSDocReadonlyTag]:LF,[b.SyntaxKind.JSDocSeeTag]:IF,[b.SyntaxKind.JSDocSignature]:PF,[b.SyntaxKind.JSDocTag]:BF,[b.SyntaxKind.JSDocTemplateTag]:OF,[b.SyntaxKind.JSDocText]:kF,[b.SyntaxKind.JSDocThisTag]:RF,[b.SyntaxKind.JSDocTypeExpression]:wF,[b.SyntaxKind.JSDocTypeLiteral]:FF,[b.SyntaxKind.JSDocTypeTag]:GF,[b.SyntaxKind.JSDocTypedefTag]:MF,[b.SyntaxKind.JSDocUnknownType]:UF,[b.SyntaxKind.JSDocVariadicType]:KF,[b.SyntaxKind.JsxAttribute]:ZF,[b.SyntaxKind.JsxClosingElement]:e6,[b.SyntaxKind.JsxClosingFragment]:r6,[b.SyntaxKind.JsxElement]:t6,[b.SyntaxKind.JsxExpression]:n6,[b.SyntaxKind.JsxFragment]:i6,[b.SyntaxKind.JsxOpeningElement]:a6,[b.SyntaxKind.JsxOpeningFragment]:o6,[b.SyntaxKind.JsxSelfClosingElement]:s6,[b.SyntaxKind.JsxSpreadAttribute]:l6,[b.SyntaxKind.JsxText]:u6,[b.SyntaxKind.LabeledStatement]:zM,[b.SyntaxKind.LiteralType]:Vw,[b.SyntaxKind.MappedType]:jw,[b.SyntaxKind.MetaProperty]:fM,[b.SyntaxKind.MethodDeclaration]:MD,[b.SyntaxKind.MethodSignature]:YF,[b.SyntaxKind.ModuleBlock]:cw,[b.SyntaxKind.ModuleDeclaration]:dw,[b.SyntaxKind.NamedExports]:fw,[b.SyntaxKind.NamedImports]:pw,[b.SyntaxKind.NamedTupleMember]:Hw,[b.SyntaxKind.NamespaceExport]:mw,[b.SyntaxKind.NamespaceImport]:_w,[b.SyntaxKind.NewExpression]:pM,[b.SyntaxKind.NonNullExpression]:mM,[b.SyntaxKind.NotEmittedStatement]:$M,[b.SyntaxKind.NoSubstitutionTemplateLiteral]:y6,[b.SyntaxKind.NumericLiteral]:m6,[b.SyntaxKind.ObjectBindingPattern]:tM,[b.SyntaxKind.ObjectLiteralExpression]:gM,[b.SyntaxKind.OmittedExpression]:EM,[b.SyntaxKind.Parameter]:Sw,[b.SyntaxKind.ParenthesizedExpression]:bM,[b.SyntaxKind.ParenthesizedType]:qw,[b.SyntaxKind.PartiallyEmittedExpression]:SM,[b.SyntaxKind.PostfixUnaryExpression]:TM,[b.SyntaxKind.PrefixUnaryExpression]:xM,[b.SyntaxKind.PrivateIdentifier]:C6,[b.SyntaxKind.PropertyAccessExpression]:lL,[b.SyntaxKind.PropertyAssignment]:yM,[b.SyntaxKind.PropertyDeclaration]:Nw,[b.SyntaxKind.PropertySignature]:QF,[b.SyntaxKind.RegularExpressionLiteral]:_6,[b.SyntaxKind.ReturnStatement]:XM,[b.SyntaxKind.SetAccessor]:Iw,[b.SyntaxKind.ShorthandPropertyAssignment]:vM,[b.SyntaxKind.SpreadAssignment]:hM,[b.SyntaxKind.SpreadElement]:DM,[b.SyntaxKind.StringLiteral]:g6,[b.SyntaxKind.SwitchStatement]:YM,[b.SyntaxKind.SyntaxList]:YR,[b.SyntaxKind.TaggedTemplateExpression]:v6,[b.SyntaxKind.TemplateExpression]:h6,[b.SyntaxKind.TemplateHead]:E6,[b.SyntaxKind.TemplateLiteralType]:Jw,[b.SyntaxKind.TemplateMiddle]:b6,[b.SyntaxKind.TemplateSpan]:S6,[b.SyntaxKind.TemplateTail]:T6,[b.SyntaxKind.ThisType]:zw,[b.SyntaxKind.ThrowStatement]:QM,[b.SyntaxKind.TryStatement]:ZM,[b.SyntaxKind.TupleType]:$w,[b.SyntaxKind.TypeAliasDeclaration]:Xw,[b.SyntaxKind.TypeAssertionExpression]:LM,[b.SyntaxKind.TypeLiteral]:Yw,[b.SyntaxKind.TypeOperator]:Qw,[b.SyntaxKind.TypeParameter]:Zw,[b.SyntaxKind.TypePredicate]:eF,[b.SyntaxKind.TypeQuery]:rF,[b.SyntaxKind.TypeReference]:tF,[b.SyntaxKind.UnionType]:nF,[b.SyntaxKind.VariableDeclaration]:L6,[b.SyntaxKind.VariableDeclarationList]:N6,[b.SyntaxKind.VariableStatement]:gw,[b.SyntaxKind.JSDoc]:Ow,[b.SyntaxKind.TypeOfExpression]:NM,[b.SyntaxKind.WhileStatement]:yw,[b.SyntaxKind.WithStatement]:vw,[b.SyntaxKind.YieldExpression]:PM,[b.SyntaxKind.SemicolonToken]:Tr,[b.SyntaxKind.AnyKeyword]:oc,[b.SyntaxKind.BooleanKeyword]:oc,[b.SyntaxKind.FalseKeyword]:f6,[b.SyntaxKind.ImportKeyword]:dM,[b.SyntaxKind.InferKeyword]:Tr,[b.SyntaxKind.NeverKeyword]:Tr,[b.SyntaxKind.NullKeyword]:p6,[b.SyntaxKind.NumberKeyword]:oc,[b.SyntaxKind.ObjectKeyword]:oc,[b.SyntaxKind.StringKeyword]:oc,[b.SyntaxKind.SymbolKeyword]:oc,[b.SyntaxKind.SuperKeyword]:CM,[b.SyntaxKind.ThisKeyword]:AM,[b.SyntaxKind.TrueKeyword]:d6,[b.SyntaxKind.UndefinedKeyword]:oc,[b.SyntaxKind.VoidExpression]:IM},GH=class{constructor(r){this.context=r,this.sourceFileCacheByFilePath=new Map,this.diagnosticCache=new b.WeakCache,this.definitionInfoCache=new b.WeakCache,this.documentSpanCache=new b.WeakCache,this.diagnosticMessageChainCache=new b.WeakCache,this.jsDocTagInfoCache=new b.WeakCache,this.signatureCache=new b.WeakCache,this.symbolCache=new b.WeakCache,this.symbolDisplayPartCache=new b.WeakCache,this.referencedSymbolEntryCache=new b.WeakCache,this.referencedSymbolCache=new b.WeakCache,this.referencedSymbolDefinitionInfoCache=new b.WeakCache,this.typeCache=new b.WeakCache,this.typeParameterCache=new b.WeakCache,this.nodeCache=new FH,this.sourceFileAddedEventContainer=new b.EventContainer,this.sourceFileRemovedEventContainer=new b.EventContainer,this.documentRegistry=new b.DocumentRegistry(r.fileSystemWrapper),this.directoryCache=new wH(r),this.context.compilerOptions.onModified(()=>{let n=Array.from(this.sourceFileCacheByFilePath.values());for(let i of n)b7e(i)})}*getSourceFilesByDirectoryDepth(){for(let r of this.getDirectoriesByDepth())yield*r.getSourceFiles()}getSourceFilePaths(){return this.sourceFileCacheByFilePath.keys()}getChildDirectoriesOfDirectory(r){return this.directoryCache.getChildDirectoriesOfDirectory(r)}getChildSourceFilesOfDirectory(r){return this.directoryCache.getChildSourceFilesOfDirectory(r)}onSourceFileAdded(r,n=!0){n?this.sourceFileAddedEventContainer.subscribe(r):this.sourceFileAddedEventContainer.unsubscribe(r)}onSourceFileRemoved(r){this.sourceFileRemovedEventContainer.subscribe(r)}createSourceFile(r,n,i){if(n=n instanceof Function?$g(this.context.createWriter(),n):n||"",typeof n=="string")return this.createSourceFileFromText(r,n,i);let a=this.context.createWriter();return this.context.structurePrinterFactory.forSourceFile({isAmbient:b.FileUtils.getExtension(r)===".d.ts"}).printText(a,n),this.createSourceFileFromText(r,a.toString(),i)}createSourceFileFromText(r,n,i){return r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r),i.overwrite===!0?this.createOrOverwriteSourceFileFromText(r,n,i):(this.throwIfFileExists(r,"Did you mean to provide the overwrite option?"),this.createSourceFileFromTextInternal(r,n,i))}throwIfFileExists(r,n){if(!(!this.containsSourceFileAtPath(r)&&!this.context.fileSystemWrapper.fileExistsSync(r)))throw n=n==null?"":n+" ",new b.errors.InvalidOperationError(`${n}A source file already exists at the provided file path: ${r}`)}createOrOverwriteSourceFileFromText(r,n,i){r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r);let a=this.addOrGetSourceFileFromFilePath(r,i);return a!=null?(a.getChildren().forEach(s=>s.forget()),this.replaceCompilerNode(a,this.createCompilerSourceFileFromText(r,n,i.scriptKind)),a):this.createSourceFileFromTextInternal(r,n,i)}getSourceFileFromCacheFromFilePath(r){return r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r),this.sourceFileCacheByFilePath.get(r)}addOrGetSourceFileFromFilePath(r,n){r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r);let i=this.sourceFileCacheByFilePath.get(r);if(i==null){let a=this.context.fileSystemWrapper.readFileIfExistsSync(r,this.context.getEncoding());a!=null&&(this.context.logger.log(`Loaded file: ${r}`),i=this.createSourceFileFromTextInternal(r,a,n),i._setIsSaved(!0))}return i!=null&&n.markInProject&&i._markAsInProject(),i}containsSourceFileAtPath(r){return r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r),this.sourceFileCacheByFilePath.has(r)}containsDirectoryAtPath(r){return r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r),this.directoryCache.has(r)}getSourceFileForNode(r){let n=r;for(;n.kind!==b.SyntaxKind.SourceFile;){if(n.parent==null)return;n=n.parent}return this.getSourceFile(n,{markInProject:!1})}hasCompilerNode(r){return this.nodeCache.has(r)}getExistingNodeFromCompilerNode(r){return this.nodeCache.get(r)}getNodeFromCompilerNode(r,n){if(r.kind===b.SyntaxKind.SourceFile)return this.getSourceFile(r,{markInProject:!1});return this.nodeCache.getOrCreate(r,()=>{let u=i.call(this);return s.call(this,u),u});function i(){if(a(r))return f_.isCommentStatement(r)?new FM(this.context,r,n):f_.isCommentClassElement(r)?new Cw(this.context,r,n):f_.isCommentTypeElement(r)?new JF(this.context,r,n):f_.isCommentObjectLiteralElement(r)?new _M(this.context,r,n):f_.isCommentEnumMember(r)?new WF(this.context,r,n):b.errors.throwNotImplementedForNeverValueError(r);let u=aUe[r.kind]||Tr;return new u(this.context,r,n)}function a(u){return u._commentKind!=null}function s(u){if(r.parent!=null){let f=this.getNodeFromCompilerNode(r.parent,n);f._wrappedChildCount++}let p=u._getParentSyntaxListIfWrapped();if(p!=null&&p._wrappedChildCount++,r.kind===b.SyntaxKind.SyntaxList){let f=0;for(let m of u._getChildrenInCacheIterator())f++;u._wrappedChildCount=f}}}createSourceFileFromTextInternal(r,n,i){let a=b.StringUtils.hasBom(n);a&&(n=b.StringUtils.stripBom(n));let s=this.getSourceFile(this.createCompilerSourceFileFromText(r,n,i.scriptKind),i);return a&&(s._hasBom=!0),s}createCompilerSourceFileFromText(r,n,i){return this.documentRegistry.createOrUpdateSourceFile(r,this.context.compilerOptions.get(),b.ts.ScriptSnapshot.fromString(n),i)}getSourceFile(r,n){var i;let a=!1,s=(i=this.sourceFileCacheByFilePath.get(r.fileName))!==null&&i!==void 0?i:this.nodeCache.getOrCreate(r,()=>{let u=new kE(this.context,r);return n.markInProject||this.context.inProjectCoordinator.setSourceFileNotInProject(u),this.addSourceFileToCache(u),a=!0,u});return n.markInProject&&s._markAsInProject(),a&&this.sourceFileAddedEventContainer.fire(s),s}addSourceFileToCache(r){this.sourceFileCacheByFilePath.set(r.getFilePath(),r),this.context.fileSystemWrapper.removeFileDelete(r.getFilePath()),this.directoryCache.addSourceFile(r)}getDirectoryFromPath(r,n){r=this.context.fileSystemWrapper.getStandardizedAbsolutePath(r);let i=this.directoryCache.get(r);return i==null&&this.context.fileSystemWrapper.directoryExistsSync(r)&&(i=this.directoryCache.createOrAddIfExists(r)),i!=null&&n.markInProject&&i._markAsInProject(),i}createDirectoryOrAddIfExists(r,n){let i=this.directoryCache.createOrAddIfExists(r);return i!=null&&n.markInProject&&i._markAsInProject(),i}getDirectoryFromCache(r){return this.directoryCache.get(r)}getDirectoryFromCacheOnlyIfInCache(r){return this.directoryCache.has(r)?this.directoryCache.get(r):void 0}getDirectoriesByDepth(){return this.directoryCache.getAllByDepth()}getOrphanDirectories(){return this.directoryCache.getOrphans()}getSymbolDisplayPart(r){return this.symbolDisplayPartCache.getOrCreate(r,()=>new B6(r))}getType(r){return(r.flags&b.TypeFlags.TypeParameter)===b.TypeFlags.TypeParameter?this.getTypeParameter(r):this.typeCache.getOrCreate(r,()=>new hL(this.context,r))}getTypeParameter(r){return this.typeParameterCache.getOrCreate(r,()=>new W6(this.context,r))}getSignature(r){return this.signatureCache.getOrCreate(r,()=>new I6(this.context,r))}getSymbol(r){return this.symbolCache.getOrCreate(r,()=>new P6(this.context,r))}getDefinitionInfo(r){return this.definitionInfoCache.getOrCreate(r,()=>new FD(this.context,r))}getDocumentSpan(r){return this.documentSpanCache.getOrCreate(r,()=>new dv(this.context,r))}getReferencedSymbolEntry(r){return this.referencedSymbolEntryCache.getOrCreate(r,()=>new F6(this.context,r))}getReferencedSymbol(r){return this.referencedSymbolCache.getOrCreate(r,()=>new gL(this.context,r))}getReferencedSymbolDefinitionInfo(r){return this.referencedSymbolDefinitionInfoCache.getOrCreate(r,()=>new yL(this.context,r))}getDiagnostic(r){return this.diagnosticCache.getOrCreate(r,()=>r.start!=null?new fL(this.context,r):new WT(this.context,r))}getDiagnosticWithLocation(r){return this.diagnosticCache.getOrCreate(r,()=>new fL(this.context,r))}getDiagnosticMessageChain(r){return this.diagnosticMessageChainCache.getOrCreate(r,()=>new pS(r))}getJSDocTagInfo(r){return this.jsDocTagInfoCache.getOrCreate(r,()=>new cL(r))}replaceCompilerNode(r,n){let i=r instanceof Tr?r.compilerNode:r,a=r instanceof Tr?r:this.nodeCache.get(r);if(i.kind===b.SyntaxKind.SourceFile&&i.fileName!==n.fileName){let s=a;this.removeCompilerNodeFromCache(i),s._replaceCompilerNodeFromFactory(n),this.nodeCache.set(n,s),this.addSourceFileToCache(s),this.sourceFileAddedEventContainer.fire(s)}else this.nodeCache.replaceKey(i,n),a?._replaceCompilerNodeFromFactory(n)}removeNodeFromCache(r){this.removeCompilerNodeFromCache(r.compilerNode)}removeCompilerNodeFromCache(r){if(this.nodeCache.removeByKey(r),r.kind===b.SyntaxKind.SourceFile){let n=r,i=this.context.fileSystemWrapper.getStandardizedAbsolutePath(n.fileName);this.directoryCache.removeSourceFile(i);let a=this.sourceFileCacheByFilePath.get(i);this.sourceFileCacheByFilePath.delete(i),this.documentRegistry.removeSourceFile(i),a!=null&&this.sourceFileRemovedEventContainer.fire(a)}}addDirectoryToCache(r){this.directoryCache.addDirectory(r)}removeDirectoryFromCache(r){this.directoryCache.remove(r)}forgetNodesCreatedInBlock(r){this.nodeCache.setForgetPoint();let n=!1,i;try{if(i=r((...s)=>{for(let u of s)this.nodeCache.rememberNode(u)}),Tr.isNode(i)&&this.nodeCache.rememberNode(i),a(i))return n=!0,i.then(s=>(Tr.isNode(s)&&this.nodeCache.rememberNode(s),this.nodeCache.forgetLastPoint(),s))}finally{n||this.nodeCache.forgetLastPoint()}return i;function a(s){return s!=null&&typeof s.then=="function"}}},BH=class{constructor(r){this.compilerFactory=r,this.notInProjectFiles=new Set,r.onSourceFileRemoved(n=>{this.notInProjectFiles.delete(n)})}setSourceFileNotInProject(r){this.notInProjectFiles.add(r),r._inProject=!1}markSourceFileAsInProject(r){this.isSourceFileInProject(r)||(this._internalMarkSourceFileAsInProject(r),this.notInProjectFiles.delete(r))}markSourceFilesAsInProjectForResolution(){let r="/node_modules/",n=this.compilerFactory,i=[],a=[];for(let u of[...this.notInProjectFiles.values()])s(u)?(this._internalMarkSourceFileAsInProject(u),this.notInProjectFiles.delete(u),i.push(u)):a.push(u);return{changedSourceFiles:i,unchangedSourceFiles:a};function s(u){let p=u.getFilePath(),f=p.toLowerCase().lastIndexOf(r);if(f===-1)return!0;let m=p.substring(0,f+r.length-1),g=n.getDirectoryFromCacheOnlyIfInCache(m);if(g!=null&&g._isInProject())return!0;let D=u.getDirectory();for(;D!=null&&D.getPath()!==m;){if(D._isInProject())return!0;D=n.getDirectoryFromCacheOnlyIfInCache(b.FileUtils.getDirPath(D.getPath()))}return!1}}_internalMarkSourceFileAsInProject(r){r._inProject=!0,this.markDirectoryAsInProject(r.getDirectory())}isSourceFileInProject(r){return r._inProject===!0}setDirectoryAndFilesAsNotInProjectForTesting(r){for(let n of r.getDirectories())this.setDirectoryAndFilesAsNotInProjectForTesting(n);for(let n of r.getSourceFiles())delete n._inProject,this.notInProjectFiles.add(n);delete r._inProject}markDirectoryAsInProject(r){if(this.isDirectoryInProject(r))return;let n=this,i=this.compilerFactory;r._inProject=!0,a(r);function a(u){let p=Array.from(s(u)),f=p[p.length-1];if(!(f==null||!n.isDirectoryInProject(f)))for(let m of p)m._inProject=!0}function*s(u){if(b.FileUtils.isRootDirPath(u.getPath()))return;let p=b.FileUtils.getDirPath(u.getPath()),f=i.getDirectoryFromCacheOnlyIfInCache(p);f!=null&&(yield f,n.isDirectoryInProject(f)||(yield*s(f)))}}isDirectoryInProject(r){return r._inProject===!0}},Vo=class{constructor(r){this._getFormatCodeSettings=r}getFormatCodeSettings(){return this._getFormatCodeSettings()}forInitializerExpressionableNode(){return new Pj}forModifierableNode(){return new Oj}forReturnTypedNode(r){return new kj(r)}forTypedNode(r,n){return new Rj(r,n)}forClassDeclaration(r){return new wj(this,r)}forClassMember(r){return new Fj(this,r)}forClassStaticBlockDeclaration(){return new Gj(this)}forConstructorDeclaration(r){return new Bj(this,r)}forGetAccessorDeclaration(r){return new Uj(this,r)}forMethodDeclaration(r){return new Kj(this,r)}forPropertyDeclaration(){return new Wj(this)}forSetAccessorDeclaration(r){return new Vj(this,r)}forDecorator(){return new jj(this)}forJSDoc(){return new Hj(this)}forJSDocTag(r){return new qj(this,r)}forEnumDeclaration(){return new Jj(this)}forEnumMember(){return new zj(this)}forObjectLiteralExpressionProperty(){return new $j(this)}forPropertyAssignment(){return new Xj(this)}forShorthandPropertyAssignment(){return new Yj(this)}forSpreadAssignment(){return new Qj(this)}forFunctionDeclaration(r){return new Zj(this,r)}forParameterDeclaration(){return new eH(this)}forCallSignatureDeclaration(){return new rH(this)}forConstructSignatureDeclaration(){return new tH(this)}forIndexSignatureDeclaration(){return new nH(this)}forInterfaceDeclaration(){return new iH(this)}forMethodSignature(){return new aH(this)}forPropertySignature(){return new oH(this)}forTypeElementMemberedNode(){return new sH(this)}forTypeElementMember(){return new lH(this)}forJsxAttributeDecider(){return new uH(this)}forJsxAttribute(){return new cH(this)}forJsxChildDecider(){return new dH(this)}forJsxElement(){return new fH(this)}forJsxSelfClosingElement(){return new pH(this)}forJsxSpreadAttribute(){return new mH(this)}forAssertEntry(){return new _H(this)}forExportAssignment(){return new gH(this)}forExportDeclaration(){return new yH(this)}forImportDeclaration(){return new vH(this)}forModuleDeclaration(r){return new hH(this,r)}forNamedImportExportSpecifier(){return new EH(this)}forSourceFile(r){return new bH(this,r)}forStatementedNode(r){return new SH(this,r)}forStatement(r){return new TH(this,r)}forVariableStatement(){return new xH(this)}forTypeAliasDeclaration(){return new DH(this)}forTypeParameterDeclaration(){return new CH(this)}forVariableDeclaration(){return new AH(this)}};co([b.Memoize],Vo.prototype,"forInitializerExpressionableNode",null);co([b.Memoize],Vo.prototype,"forModifierableNode",null);co([b.Memoize],Vo.prototype,"forReturnTypedNode",null);co([b.Memoize],Vo.prototype,"forTypedNode",null);co([b.Memoize],Vo.prototype,"forClassDeclaration",null);co([b.Memoize],Vo.prototype,"forClassMember",null);co([b.Memoize],Vo.prototype,"forClassStaticBlockDeclaration",null);co([b.Memoize],Vo.prototype,"forConstructorDeclaration",null);co([b.Memoize],Vo.prototype,"forGetAccessorDeclaration",null);co([b.Memoize],Vo.prototype,"forMethodDeclaration",null);co([b.Memoize],Vo.prototype,"forPropertyDeclaration",null);co([b.Memoize],Vo.prototype,"forSetAccessorDeclaration",null);co([b.Memoize],Vo.prototype,"forDecorator",null);co([b.Memoize],Vo.prototype,"forJSDoc",null);co([b.Memoize],Vo.prototype,"forJSDocTag",null);co([b.Memoize],Vo.prototype,"forEnumDeclaration",null);co([b.Memoize],Vo.prototype,"forEnumMember",null);co([b.Memoize],Vo.prototype,"forObjectLiteralExpressionProperty",null);co([b.Memoize],Vo.prototype,"forPropertyAssignment",null);co([b.Memoize],Vo.prototype,"forShorthandPropertyAssignment",null);co([b.Memoize],Vo.prototype,"forSpreadAssignment",null);co([b.Memoize],Vo.prototype,"forFunctionDeclaration",null);co([b.Memoize],Vo.prototype,"forParameterDeclaration",null);co([b.Memoize],Vo.prototype,"forCallSignatureDeclaration",null);co([b.Memoize],Vo.prototype,"forConstructSignatureDeclaration",null);co([b.Memoize],Vo.prototype,"forIndexSignatureDeclaration",null);co([b.Memoize],Vo.prototype,"forInterfaceDeclaration",null);co([b.Memoize],Vo.prototype,"forMethodSignature",null);co([b.Memoize],Vo.prototype,"forPropertySignature",null);co([b.Memoize],Vo.prototype,"forTypeElementMemberedNode",null);co([b.Memoize],Vo.prototype,"forTypeElementMember",null);co([b.Memoize],Vo.prototype,"forJsxAttributeDecider",null);co([b.Memoize],Vo.prototype,"forJsxAttribute",null);co([b.Memoize],Vo.prototype,"forJsxChildDecider",null);co([b.Memoize],Vo.prototype,"forJsxElement",null);co([b.Memoize],Vo.prototype,"forJsxSelfClosingElement",null);co([b.Memoize],Vo.prototype,"forJsxSpreadAttribute",null);co([b.Memoize],Vo.prototype,"forAssertEntry",null);co([b.Memoize],Vo.prototype,"forExportAssignment",null);co([b.Memoize],Vo.prototype,"forExportDeclaration",null);co([b.Memoize],Vo.prototype,"forImportDeclaration",null);co([b.Memoize],Vo.prototype,"forModuleDeclaration",null);co([b.Memoize],Vo.prototype,"forNamedImportExportSpecifier",null);co([b.Memoize],Vo.prototype,"forSourceFile",null);co([b.Memoize],Vo.prototype,"forStatementedNode",null);co([b.Memoize],Vo.prototype,"forStatement",null);co([b.Memoize],Vo.prototype,"forVariableStatement",null);co([b.Memoize],Vo.prototype,"forTypeAliasDeclaration",null);co([b.Memoize],Vo.prototype,"forTypeParameterDeclaration",null);co([b.Memoize],Vo.prototype,"forVariableDeclaration",null);var GD=class{constructor(r){this.logger=new uj,this.manipulationSettings=new WR,this._project=r.project,this.fileSystemWrapper=r.fileSystemWrapper,this._compilerOptions=r.compilerOptionsContainer,this.compilerFactory=new GH(this),this.inProjectCoordinator=new BH(this.compilerFactory),this.structurePrinterFactory=new Vo(()=>this.manipulationSettings.getFormatCodeSettings()),this.lazyReferenceCoordinator=new cj(this.compilerFactory),this.directoryCoordinator=new MH(this.compilerFactory,r.fileSystemWrapper),this._languageService=r.createLanguageService?new K6({context:this,configFileParsingDiagnostics:r.configFileParsingDiagnostics,resolutionHost:r.resolutionHost&&r.resolutionHost(this.getModuleResolutionHost(),()=>this.compilerOptions.get()),skipLoadingLibFiles:r.skipLoadingLibFiles,libFolderPath:r.libFolderPath}):void 0,r.typeChecker!=null&&(b.errors.throwIfTrue(r.createLanguageService,"Cannot specify a type checker and create a language service."),this._customTypeChecker=new vL(this),this._customTypeChecker._reset(()=>r.typeChecker))}get project(){if(this._project==null)throw new b.errors.InvalidOperationError("This operation is not permitted in this context.");return this._project}get compilerOptions(){return this._compilerOptions}get languageService(){if(this._languageService==null)throw this.getToolRequiredError("language service");return this._languageService}get program(){if(this._languageService==null)throw this.getToolRequiredError("program");return this.languageService.getProgram()}get typeChecker(){if(this._customTypeChecker!=null)return this._customTypeChecker;if(this._languageService==null)throw this.getToolRequiredError("type checker");return this.program.getTypeChecker()}hasLanguageService(){return this._languageService!=null}getEncoding(){return this.compilerOptions.getEncoding()}getFormatCodeSettings(){return this.manipulationSettings.getFormatCodeSettings()}getUserPreferences(){return this.manipulationSettings.getUserPreferences()}resetProgram(){this.languageService._reset()}createWriter(){let r=this.manipulationSettings.getIndentationText();return new KR.default({newLine:this.manipulationSettings.getNewLineKindAsString(),indentNumberOfSpaces:r===Oe.IndentationText.Tab?void 0:r.length,useTabs:r===Oe.IndentationText.Tab,useSingleQuote:this.manipulationSettings.getQuoteKind()===Oe.QuoteKind.Single})}getPreEmitDiagnostics(r){return b.ts.getPreEmitDiagnostics(this.program.compilerObject,r?.compilerNode).map(i=>this.compilerFactory.getDiagnostic(i))}getSourceFileContainer(){return{addOrGetSourceFileFromFilePath:(r,n)=>{var i;return Promise.resolve((i=this.compilerFactory.addOrGetSourceFileFromFilePath(r,n))===null||i===void 0?void 0:i.compilerNode)},addOrGetSourceFileFromFilePathSync:(r,n)=>{var i;return(i=this.compilerFactory.addOrGetSourceFileFromFilePath(r,n))===null||i===void 0?void 0:i.compilerNode},containsDirectoryAtPath:r=>this.compilerFactory.containsDirectoryAtPath(r),containsSourceFileAtPath:r=>this.compilerFactory.containsSourceFileAtPath(r),getSourceFileFromCacheFromFilePath:r=>{let n=this.compilerFactory.getSourceFileFromCacheFromFilePath(r);return n?.compilerNode},getSourceFilePaths:()=>this.compilerFactory.getSourceFilePaths(),getSourceFileVersion:r=>this.compilerFactory.documentRegistry.getSourceFileVersion(r),getChildDirectoriesOfDirectory:r=>{let n=[];for(let i of this.compilerFactory.getChildDirectoriesOfDirectory(r))n.push(i.getPath());return n}}}getModuleResolutionHost(){return b.createModuleResolutionHost({transactionalFileSystem:this.fileSystemWrapper,getEncoding:()=>this.getEncoding(),sourceFileContainer:this.getSourceFileContainer()})}getToolRequiredError(r){return new b.errors.InvalidOperationError(`A ${r} is required for this operation. This might occur when manipulating or getting type information from a node that was not added to a Project object and created via createWrappedNode. Please submit a bug report if you don't believe a ${r} should be required for this operation.`)}};co([b.Memoize],GD.prototype,"getSourceFileContainer",null);co([b.Memoize],GD.prototype,"getModuleResolutionHost",null);var UH=class{constructor(r={}){var n;f();let i=m(),a=new b.TransactionalFileSystem({fileSystem:i,skipLoadingLibFiles:r.skipLoadingLibFiles,libFolderPath:r.libFolderPath}),s=r.tsConfigFilePath==null?void 0:new b.TsConfigResolver(a,a.getStandardizedAbsolutePath(r.tsConfigFilePath),P()),u=g(),p=new b.CompilerOptionsContainer;p.set(u),this._context=new GD({project:this,compilerOptionsContainer:p,fileSystemWrapper:a,createLanguageService:!0,resolutionHost:r.resolutionHost,configFileParsingDiagnostics:(n=s?.getErrors())!==null&&n!==void 0?n:[],skipLoadingLibFiles:r.skipLoadingLibFiles,libFolderPath:r.libFolderPath}),r.manipulationSettings!=null&&this._context.manipulationSettings.set(r.manipulationSettings),s!=null&&r.skipAddingFilesFromTsConfig!==!0&&(this._addSourceFilesForTsConfigResolver(s,u),r.skipFileDependencyResolution||this.resolveSourceFileDependencies());function f(){if(r.fileSystem!=null&&r.useInMemoryFileSystem)throw new b.errors.InvalidOperationError("Cannot provide a file system when specifying to use an in-memory file system.")}function m(){var B;return r.useInMemoryFileSystem?new b.InMemoryFileSystemHost:(B=r.fileSystem)!==null&&B!==void 0?B:new b.RealFileSystemHost}function g(){var B;return{...D(),...(B=r.compilerOptions)!==null&&B!==void 0?B:{}}}function D(){var B;return(B=s?.getCompilerOptions())!==null&&B!==void 0?B:{}}function P(){var B;let K="utf-8";return r.compilerOptions!=null&&(B=r.compilerOptions.charset)!==null&&B!==void 0?B:K}}get manipulationSettings(){return this._context.manipulationSettings}get compilerOptions(){return this._context.compilerOptions}resolveSourceFileDependencies(){let r=new Set,n=u=>r.add(u),{compilerFactory:i,inProjectCoordinator:a}=this._context;i.onSourceFileAdded(n);try{this.getProgram().compilerObject}finally{i.onSourceFileAdded(n,!1)}let s=a.markSourceFilesAsInProjectForResolution();for(let u of s.changedSourceFiles)r.add(u);for(let u of s.unchangedSourceFiles)r.delete(u);return Array.from(r.values())}addDirectoryAtPathIfExists(r,n={}){return this._context.directoryCoordinator.addDirectoryAtPathIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),{...n,markInProject:!0})}addDirectoryAtPath(r,n={}){return this._context.directoryCoordinator.addDirectoryAtPath(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),{...n,markInProject:!0})}createDirectory(r){return this._context.directoryCoordinator.createDirectoryOrAddIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),{markInProject:!0})}getDirectoryOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getDirectory(r),()=>`Could not find a directory at the specified path: ${this._context.fileSystemWrapper.getStandardizedAbsolutePath(r)}`)}getDirectory(r){let{compilerFactory:n}=this._context;return n.getDirectoryFromCache(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r))}getDirectories(){return Array.from(this._getProjectDirectoriesByDirectoryDepth())}getRootDirectories(){let{inProjectCoordinator:r}=this._context,n=[];for(let a of this._context.compilerFactory.getOrphanDirectories())for(let s of i(a))n.push(s);return n;function*i(a){if(r.isDirectoryInProject(a)){yield a;return}for(let s of a._getDirectoriesIterator())yield*i(s)}}addSourceFilesAtPaths(r){return this._context.directoryCoordinator.addSourceFilesAtPaths(r,{markInProject:!0})}addSourceFileAtPathIfExists(r){return this._context.directoryCoordinator.addSourceFileAtPathIfExists(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),{markInProject:!0})}addSourceFileAtPath(r){return this._context.directoryCoordinator.addSourceFileAtPath(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),{markInProject:!0})}addSourceFilesFromTsConfig(r){let n=new b.TsConfigResolver(this._context.fileSystemWrapper,this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),this._context.getEncoding());return this._addSourceFilesForTsConfigResolver(n,n.getCompilerOptions())}_addSourceFilesForTsConfigResolver(r,n){let i=r.getPaths(n),a=i.filePaths.map(s=>this.addSourceFileAtPath(s));for(let s of i.directoryPaths)this.addDirectoryAtPathIfExists(s);return a}createSourceFile(r,n,i){return this._context.compilerFactory.createSourceFile(this._context.fileSystemWrapper.getStandardizedAbsolutePath(r),n??"",{...i??{},markInProject:!0})}removeSourceFile(r){let n=r.wasForgotten();return r.forget(),!n}getSourceFileOrThrow(r){let n=this.getSourceFile(r);if(n!=null)return n;if(typeof r=="string"){let i=b.FileUtils.standardizeSlashes(r);if(b.FileUtils.pathIsAbsolute(i)||i.indexOf("/")>=0){let a=this._context.fileSystemWrapper.getStandardizedAbsolutePath(i);throw new b.errors.InvalidOperationError(`Could not find source file in project at the provided path: ${a}`)}else throw new b.errors.InvalidOperationError(`Could not find source file in project with the provided file name: ${r}`)}else throw new b.errors.InvalidOperationError("Could not find source file in project based on the provided condition.")}getSourceFile(r){let n=i(this._context.fileSystemWrapper);if(a(n))return this._context.compilerFactory.getSourceFileFromCacheFromFilePath(n);return b.IterableUtils.find(this._getProjectSourceFilesByDirectoryDepth(),n);function i(s){if(r instanceof Function)return r;let u=b.FileUtils.standardizeSlashes(r);return b.FileUtils.pathIsAbsolute(u)||u.indexOf("/")>=0?s.getStandardizedAbsolutePath(u):p=>b.FileUtils.pathEndsWith(p.getFilePath(),u)}function a(s){return typeof s=="string"}}getSourceFiles(r){let{compilerFactory:n,fileSystemWrapper:i}=this._context,a=this._getProjectSourceFilesByDirectoryDepth();if(typeof r=="string"||r instanceof Array)return Array.from(s());return Array.from(a);function*s(){let u=Array.from(f()),p=b.matchGlobs(u,r,i.getCurrentDirectory());for(let m of p)yield n.getSourceFileFromCacheFromFilePath(i.getStandardizedAbsolutePath(m));function*f(){for(let m of a)yield m.getFilePath()}}}*_getProjectSourceFilesByDirectoryDepth(){let{compilerFactory:r,inProjectCoordinator:n}=this._context;for(let i of r.getSourceFilesByDirectoryDepth())n.isSourceFileInProject(i)&&(yield i)}*_getProjectDirectoriesByDirectoryDepth(){let{compilerFactory:r,inProjectCoordinator:n}=this._context;for(let i of r.getDirectoriesByDepth())n.isDirectoryInProject(i)&&(yield i)}getAmbientModule(r){return r=Ife(r),this.getAmbientModules().find(n=>n.getName()===r)}getAmbientModuleOrThrow(r){return b.errors.throwIfNullOrUndefined(this.getAmbientModule(r),()=>`Could not find ambient module with name: ${Ife(r)}`)}getAmbientModules(){return this.getTypeChecker().getAmbientModules()}async save(){await this._context.fileSystemWrapper.flush(),await Promise.all(this._getUnsavedSourceFiles().map(r=>r.save()))}saveSync(){this._context.fileSystemWrapper.flushSync();for(let r of this._getUnsavedSourceFiles())r.saveSync()}enableLogging(r=!0){this._context.logger.setEnabled(r)}_getUnsavedSourceFiles(){return Array.from(r(this._context.compilerFactory.getSourceFilesByDirectoryDepth()));function*r(n){for(let i of n)i.isSaved()||(yield i)}}getPreEmitDiagnostics(){return this._context.getPreEmitDiagnostics()}getLanguageService(){return this._context.languageService}getProgram(){return this._context.program}getTypeChecker(){return this._context.typeChecker}getFileSystem(){return this._context.fileSystemWrapper.getFileSystem()}emit(r={}){return this._context.program.emit(r)}emitSync(r={}){return this._context.program.emitSync(r)}emitToMemory(r={}){return this._context.program.emitToMemory(r)}getCompilerOptions(){return this._context.compilerOptions.get()}getConfigFileParsingDiagnostics(){return this.getProgram().getConfigFileParsingDiagnostics()}createWriter(){return this._context.createWriter()}forgetNodesCreatedInBlock(r){return this._context.compilerFactory.forgetNodesCreatedInBlock(r)}formatDiagnosticsWithColorAndContext(r,n={}){return b.ts.formatDiagnosticsWithColorAndContext(r.map(i=>i.compilerObject),{getCurrentDirectory:()=>this._context.fileSystemWrapper.getCurrentDirectory(),getCanonicalFileName:i=>i,getNewLine:()=>{var i;return(i=n.newLineChar)!==null&&i!==void 0?i:b.runtime.getEndOfLine()}})}getModuleResolutionHost(){return this._context.getModuleResolutionHost()}};function Ife(e){return r(e[0])&&r(e[e.length-1])&&(e=e.substring(1,e.length-1)),`"${e}"`;function r(n){return n==='"'||n==="'"}}function oUe(e,r={}){let{compilerOptions:n={},sourceFile:i,typeChecker:a}=r,s=new b.CompilerOptionsContainer;s.set(n);let u=new GD({project:void 0,fileSystemWrapper:new b.TransactionalFileSystem({fileSystem:new b.RealFileSystemHost,skipLoadingLibFiles:!0,libFolderPath:void 0}),compilerOptionsContainer:s,createLanguageService:!1,typeChecker:a,configFileParsingDiagnostics:[],skipLoadingLibFiles:!0,libFolderPath:void 0}),p=u.compilerFactory.getSourceFile(f(),{markInProject:!0});return u.compilerFactory.getNodeFromCompilerNode(e,p);function f(){return i??m(e)}function m(g){if(g.kind===b.SyntaxKind.SourceFile)return g;if(g.parent==null)throw new b.errors.InvalidOperationError("Please ensure the node was created from a source file with 'setParentNodes' set to 'true'.");let D=g;for(;D.parent!=null;)D=D.parent;if(D.kind!==b.SyntaxKind.SourceFile)throw new b.errors.NotImplementedError("For some reason the top parent was not a source file.");return D}}var sUe=new Vo(()=>{throw new b.errors.NotImplementedError("Not implemented scenario for getting code format settings when using a writer function. Please open an issue.")}),KH=class{constructor(){}static object(r){return n=>{let i=Object.keys(r);n.write("{"),i.length>0&&n.indent(()=>{a()}),n.write("}");function a(){for(let s=0;s<i.length;s++){s>0&&n.write(",").newLine();let u=i[s],p=r[u];n.write(u),p!=null&&(n.write(": "),tL(n,p))}n.newLine()}}}static objectType(r){return n=>{n.write("{"),lUe(r)&&n.indent(()=>{sUe.forTypeElementMemberedNode().printText(n,r)}),n.write("}")}}static unionType(r,n,...i){return Pfe("|",[r,n,...i])}static intersectionType(r,n,...i){return Pfe("&",[r,n,...i])}static assertion(r,n){return i=>{tL(i,r),i.spaceIfLastNot().write("as "),tL(i,n)}}static returnStatement(r){return n=>{n.write("return "),n.hangingIndentUnlessBlock(()=>{tL(n,r),n.write(";")})}}};function Pfe(e,r){return n=>{uUe(n,` ${e} `,r)}}function lUe(e){for(let r of Object.keys(e))if(e[r]!=null&&!(e[r]instanceof Array&&e[r].length===0))return!0;return!1}function uUe(e,r,n){for(let i=0;i<n.length;i++)e.conditionalWrite(i>0,r),tL(e,n[i])}function tL(e,r){r instanceof Function?r(e):e.write(r.toString())}var{InvalidOperationError:cUe,FileNotFoundError:dUe,ArgumentError:fUe,ArgumentNullOrWhitespaceError:pUe,ArgumentOutOfRangeError:mUe,ArgumentTypeError:_Ue,BaseError:gUe,DirectoryNotFoundError:yUe,NotImplementedError:vUe,NotSupportedError:hUe,PathNotFoundError:EUe}=b.errors;Object.defineProperty(Oe,"CompilerOptionsContainer",{enumerable:!0,get:function(){return b.CompilerOptionsContainer}});Object.defineProperty(Oe,"DiagnosticCategory",{enumerable:!0,get:function(){return b.DiagnosticCategory}});Object.defineProperty(Oe,"EmitHint",{enumerable:!0,get:function(){return b.EmitHint}});Object.defineProperty(Oe,"InMemoryFileSystemHost",{enumerable:!0,get:function(){return b.InMemoryFileSystemHost}});Object.defineProperty(Oe,"LanguageVariant",{enumerable:!0,get:function(){return b.LanguageVariant}});Object.defineProperty(Oe,"ModuleKind",{enumerable:!0,get:function(){return b.ModuleKind}});Object.defineProperty(Oe,"ModuleResolutionKind",{enumerable:!0,get:function(){return b.ModuleResolutionKind}});Object.defineProperty(Oe,"NewLineKind",{enumerable:!0,get:function(){return b.NewLineKind}});Object.defineProperty(Oe,"NodeFlags",{enumerable:!0,get:function(){return b.NodeFlags}});Object.defineProperty(Oe,"ObjectFlags",{enumerable:!0,get:function(){return b.ObjectFlags}});Object.defineProperty(Oe,"ResolutionHosts",{enumerable:!0,get:function(){return b.ResolutionHosts}});Object.defineProperty(Oe,"ScriptKind",{enumerable:!0,get:function(){return b.ScriptKind}});Object.defineProperty(Oe,"ScriptTarget",{enumerable:!0,get:function(){return b.ScriptTarget}});Object.defineProperty(Oe,"SettingsContainer",{enumerable:!0,get:function(){return b.SettingsContainer}});Object.defineProperty(Oe,"SymbolFlags",{enumerable:!0,get:function(){return b.SymbolFlags}});Object.defineProperty(Oe,"SyntaxKind",{enumerable:!0,get:function(){return b.SyntaxKind}});Object.defineProperty(Oe,"TypeFlags",{enumerable:!0,get:function(){return b.TypeFlags}});Object.defineProperty(Oe,"TypeFormatFlags",{enumerable:!0,get:function(){return b.TypeFormatFlags}});Object.defineProperty(Oe,"ts",{enumerable:!0,get:function(){return b.ts}});Object.defineProperty(Oe,"CodeBlockWriter",{enumerable:!0,get:function(){return KR.default}});Oe.AbstractableNode=gS;Oe.AmbientableNode=Ph;Oe.ArgumentError=fUe;Oe.ArgumentNullOrWhitespaceError=pUe;Oe.ArgumentOutOfRangeError=mUe;Oe.ArgumentTypeError=_Ue;Oe.ArgumentedNode=JH;Oe.ArrayBindingPattern=eM;Oe.ArrayDestructuringAssignment=LH;Oe.ArrayDestructuringAssignmentBase=ppe;Oe.ArrayLiteralExpression=iM;Oe.ArrayTypeNode=kw;Oe.ArrowFunction=hw;Oe.ArrowFunctionBase=bme;Oe.AsExpression=aM;Oe.AsExpressionBase=mpe;Oe.AssertClause=ew;Oe.AssertClauseBase=ume;Oe.AssertEntry=rw;Oe.AssertEntryBase=sR;Oe.AssertionKeyNamedNode=ope;Oe.AssignmentExpression=oL;Oe.AssignmentExpressionBase=fpe;Oe.AsyncableNode=jT;Oe.AwaitExpression=oM;Oe.AwaitExpressionBase=_pe;Oe.AwaitableNode=Yfe;Oe.BaseError=gUe;Oe.BaseExpressionedNode=VD;Oe.BigIntLiteral=c6;Oe.BigIntLiteralBase=Qme;Oe.BinaryExpression=aL;Oe.BinaryExpressionBase=dpe;Oe.BindingElement=rM;Oe.BindingElementBase=cpe;Oe.BindingNamedNode=$6;Oe.Block=OM;Oe.BlockBase=jpe;Oe.BodiedNode=H6;Oe.BodyableNode=HT;Oe.BreakStatement=kM;Oe.CallExpression=sM;Oe.CallExpressionBase=gpe;Oe.CallSignatureDeclaration=qF;Oe.CallSignatureDeclarationBase=IR;Oe.CaseBlock=RM;Oe.CaseBlockBase=Hpe;Oe.CaseClause=MM;Oe.CaseClauseBase=qpe;Oe.CatchClause=wM;Oe.CatchClauseBase=Jpe;Oe.ChildOrderableNode=Nm;Oe.ClassDeclaration=Tw;Oe.ClassDeclarationBase=yR;Oe.ClassElement=zg;Oe.ClassExpression=xw;Oe.ClassExpressionBase=Ame;Oe.ClassLikeDeclarationBase=iq;Oe.ClassLikeDeclarationBaseSpecific=Dme;Oe.ClassStaticBlockDeclaration=Dw;Oe.ClassStaticBlockDeclarationBase=vR;Oe.CodeAction=O6;Oe.CodeFixAction=k6;Oe.CombinedCodeActions=dL;Oe.CommaListExpression=lM;Oe.CommaListExpressionBase=ype;Oe.CommentClassElement=Cw;Oe.CommentEnumMember=WF;Oe.CommentObjectLiteralElement=_M;Oe.CommentRange=XR;Oe.CommentStatement=FM;Oe.CommentTypeElement=JF;Oe.CommonIdentifierBase=lq;Oe.CompilerCommentClassElement=jR;Oe.CompilerCommentEnumMember=JR;Oe.CompilerCommentNode=sS;Oe.CompilerCommentObjectLiteralElement=qR;Oe.CompilerCommentStatement=VR;Oe.CompilerCommentTypeElement=HR;Oe.ComputedPropertyName=x6;Oe.ComputedPropertyNameBase=f_e;Oe.ConditionalExpression=uM;Oe.ConditionalExpressionBase=vpe;Oe.ConditionalTypeNode=Rw;Oe.ConstructSignatureDeclaration=zF;Oe.ConstructSignatureDeclarationBase=PR;Oe.ConstructorDeclaration=Aw;Oe.ConstructorDeclarationBase=hR;Oe.ConstructorDeclarationOverloadBase=Lme;Oe.ConstructorTypeNode=Mw;Oe.ConstructorTypeNodeBase=Ome;Oe.ContinueStatement=GM;Oe.DebuggerStatement=BM;Oe.DebuggerStatementBase=zpe;Oe.DecoratableNode=qT;Oe.Decorator=Pw;Oe.DecoratorBase=TR;Oe.DefaultClause=UM;Oe.DefaultClauseBase=$pe;Oe.DefinitionInfo=FD;Oe.DeleteExpression=cM;Oe.DeleteExpressionBase=hpe;Oe.Diagnostic=WT;Oe.DiagnosticMessageChain=pS;Oe.DiagnosticWithLocation=fL;Oe.Directory=OE;Oe.DirectoryEmitResult=EL;Oe.DirectoryNotFoundError=yUe;Oe.DoStatement=KM;Oe.DoStatementBase=Xpe;Oe.DocumentSpan=dv;Oe.DotDotDotTokenableNode=bL;Oe.ElementAccessExpression=sL;Oe.ElementAccessExpressionBase=Epe;Oe.EmitOutput=pL;Oe.EmitResult=VT;Oe.EmptyStatement=WM;Oe.EmptyStatementBase=Ype;Oe.EnumDeclaration=VF;Oe.EnumDeclarationBase=LR;Oe.EnumMember=jF;Oe.EnumMemberBase=NR;Oe.ExclamationTokenableNode=$H;Oe.ExportAssignment=tw;Oe.ExportAssignmentBase=OH;Oe.ExportDeclaration=nw;Oe.ExportDeclarationBase=lR;Oe.ExportGetableNode=XH;Oe.ExportSpecifier=iw;Oe.ExportSpecifierBase=kH;Oe.ExportableNode=BE;Oe.Expression=oc;Oe.ExpressionStatement=VM;Oe.ExpressionStatementBase=Qpe;Oe.ExpressionWithTypeArguments=ww;Oe.ExpressionWithTypeArgumentsBase=kme;Oe.ExpressionableNode=DL;Oe.ExpressionedNode=ud;Oe.ExtendsClauseableNode=ipe;Oe.ExternalModuleReference=aw;Oe.ExternalModuleReferenceBase=cme;Oe.FalseLiteral=f6;Oe.FalseLiteralBase=e_e;Oe.FileNotFoundError=dUe;Oe.FileReference=OD;Oe.FileTextChanges=fS;Oe.ForInStatement=jM;Oe.ForInStatementBase=Zpe;Oe.ForOfStatement=HM;Oe.ForOfStatementBase=eme;Oe.ForStatement=qM;Oe.ForStatementBase=rme;Oe.FunctionDeclaration=Ew;Oe.FunctionDeclarationBase=mR;Oe.FunctionDeclarationOverloadBase=Sme;Oe.FunctionExpression=bw;Oe.FunctionExpressionBase=Tme;Oe.FunctionLikeDeclaration=YT;Oe.FunctionOrConstructorTypeNodeBase=uL;Oe.FunctionOrConstructorTypeNodeBaseBase=Pme;Oe.FunctionTypeNode=Fw;Oe.FunctionTypeNodeBase=Rme;Oe.GeneratorableNode=zT;Oe.GetAccessorDeclaration=Lw;Oe.GetAccessorDeclarationBase=ER;Oe.HeritageClause=HF;Oe.HeritageClauseableNode=QH;Oe.Identifier=D6;Oe.IdentifierBase=p_e;Oe.IfStatement=JM;Oe.IfStatementBase=tme;Oe.ImplementationLocation=mL;Oe.ImplementsClauseableNode=ape;Oe.ImportClause=ow;Oe.ImportClauseBase=dme;Oe.ImportDeclaration=sw;Oe.ImportDeclarationBase=uR;Oe.ImportEqualsDeclaration=lw;Oe.ImportEqualsDeclarationBase=pme;Oe.ImportExpression=dM;Oe.ImportExpressionBase=bpe;Oe.ImportExpressionedNode=p9e;Oe.ImportSpecifier=uw;Oe.ImportSpecifierBase=cR;Oe.ImportTypeAssertionContainer=Gw;Oe.ImportTypeNode=Bw;Oe.IndexSignatureDeclaration=$F;Oe.IndexSignatureDeclarationBase=OR;Oe.IndexedAccessTypeNode=Uw;Oe.InferTypeNode=Kw;Oe.InitializerExpressionGetableNode=z6;Oe.InitializerExpressionableNode=$T;Oe.InterfaceDeclaration=XF;Oe.InterfaceDeclarationBase=kR;Oe.IntersectionTypeNode=Ww;Oe.InvalidOperationError=cUe;Oe.IterationStatement=dS;Oe.JSDoc=Ow;Oe.JSDocAllType=iF;Oe.JSDocAugmentsTag=aF;Oe.JSDocAuthorTag=oF;Oe.JSDocBase=xR;Oe.JSDocCallbackTag=sF;Oe.JSDocClassTag=lF;Oe.JSDocDeprecatedTag=uF;Oe.JSDocEnumTag=cF;Oe.JSDocFunctionType=dF;Oe.JSDocFunctionTypeBase=Kme;Oe.JSDocImplementsTag=fF;Oe.JSDocLink=pF;Oe.JSDocLinkCode=mF;Oe.JSDocLinkPlain=_F;Oe.JSDocMemberName=gF;Oe.JSDocNameReference=vF;Oe.JSDocNamepathType=yF;Oe.JSDocNonNullableType=hF;Oe.JSDocNullableType=EF;Oe.JSDocOptionalType=bF;Oe.JSDocOverrideTag=SF;Oe.JSDocParameterTag=TF;Oe.JSDocParameterTagBase=Wme;Oe.JSDocPrivateTag=xF;Oe.JSDocPropertyLikeTag=aq;Oe.JSDocPropertyTag=DF;Oe.JSDocPropertyTagBase=Vme;Oe.JSDocProtectedTag=CF;Oe.JSDocPublicTag=AF;Oe.JSDocReadonlyTag=LF;Oe.JSDocReturnTag=NF;Oe.JSDocReturnTagBase=jme;Oe.JSDocSeeTag=IF;Oe.JSDocSeeTagBase=Hme;Oe.JSDocSignature=PF;Oe.JSDocTag=bc;Oe.JSDocTagBase=AR;Oe.JSDocTagInfo=cL;Oe.JSDocTemplateTag=OF;Oe.JSDocTemplateTagBase=qme;Oe.JSDocText=kF;Oe.JSDocThisTag=RF;Oe.JSDocThisTagBase=Jme;Oe.JSDocType=q_;Oe.JSDocTypeExpression=wF;Oe.JSDocTypeExpressionableTag=tG;Oe.JSDocTypeLiteral=FF;Oe.JSDocTypeParameteredTag=Nme;Oe.JSDocTypeTag=GF;Oe.JSDocTypedefTag=MF;Oe.JSDocUnknownTag=BF;Oe.JSDocUnknownType=UF;Oe.JSDocVariadicType=KF;Oe.JSDocableNode=sc;Oe.JsxAttribute=ZF;Oe.JsxAttributeBase=wR;Oe.JsxAttributedNode=oq;Oe.JsxClosingElement=e6;Oe.JsxClosingElementBase=zme;Oe.JsxClosingFragment=r6;Oe.JsxElement=t6;Oe.JsxElementBase=FR;Oe.JsxExpression=n6;Oe.JsxExpressionBase=$me;Oe.JsxFragment=i6;Oe.JsxOpeningElement=a6;Oe.JsxOpeningElementBase=Xme;Oe.JsxOpeningFragment=o6;Oe.JsxSelfClosingElement=s6;Oe.JsxSelfClosingElementBase=GR;Oe.JsxSpreadAttribute=l6;Oe.JsxSpreadAttributeBase=BR;Oe.JsxTagNamedNode=nG;Oe.JsxText=u6;Oe.JsxTextBase=Yme;Oe.LabeledStatement=zM;Oe.LabeledStatementBase=nme;Oe.LanguageService=K6;Oe.LeftHandSideExpression=RD;Oe.LeftHandSideExpressionedNode=XT;Oe.LiteralExpression=cS;Oe.LiteralExpressionBase=Spe;Oe.LiteralLikeNode=UD;Oe.LiteralTypeNode=Vw;Oe.ManipulationError=$R;Oe.ManipulationSettingsContainer=WR;Oe.MappedTypeNode=jw;Oe.MemberExpression=BT;Oe.MemoryEmitResult=M6;Oe.MetaProperty=fM;Oe.MetaPropertyBase=Tpe;Oe.MethodDeclaration=MD;Oe.MethodDeclarationBase=gR;Oe.MethodDeclarationOverloadBase=xme;Oe.MethodSignature=YF;Oe.MethodSignatureBase=RR;Oe.ModifierableNode=sf;Oe.ModuleBlock=cw;Oe.ModuleBlockBase=mme;Oe.ModuleChildableNode=yS;Oe.ModuleDeclaration=dw;Oe.ModuleDeclarationBase=dR;Oe.ModuleNamedNode=spe;Oe.ModuledNode=ZH;Oe.NameableNode=X6;Oe.NamedExports=fw;Oe.NamedExportsBase=_me;Oe.NamedImports=pw;Oe.NamedImportsBase=gme;Oe.NamedNode=mv;Oe.NamedNodeBase=KD;Oe.NamedTupleMember=Hw;Oe.NamedTupleMemberBase=Mme;Oe.NamespaceExport=mw;Oe.NamespaceExportBase=yme;Oe.NamespaceImport=_w;Oe.NamespaceImportBase=vme;Oe.NewExpression=pM;Oe.NewExpressionBase=xpe;Oe.NoSubstitutionTemplateLiteral=y6;Oe.NoSubstitutionTemplateLiteralBase=o_e;Oe.Node=Tr;Oe.NodeWithTypeArguments=KT;Oe.NodeWithTypeArgumentsBase=Ime;Oe.NonNullExpression=mM;Oe.NonNullExpressionBase=Dpe;Oe.NotEmittedStatement=$M;Oe.NotEmittedStatementBase=ime;Oe.NotImplementedError=vUe;Oe.NotSupportedError=hUe;Oe.NullLiteral=p6;Oe.NullLiteralBase=t_e;Oe.NumericLiteral=m6;Oe.NumericLiteralBase=n_e;Oe.ObjectBindingPattern=tM;Oe.ObjectDestructuringAssignment=NH;Oe.ObjectDestructuringAssignmentBase=Cpe;Oe.ObjectLiteralElement=UT;Oe.ObjectLiteralExpression=gM;Oe.ObjectLiteralExpressionBase=Ape;Oe.OmittedExpression=EM;Oe.OmittedExpressionBase=Lpe;Oe.OutputFile=R6;Oe.OverloadableNode=eG;Oe.OverrideableNode=TL;Oe.ParameterDeclaration=Sw;Oe.ParameterDeclarationBase=_R;Oe.ParameteredNode=lpe;Oe.ParenthesizedExpression=bM;Oe.ParenthesizedExpressionBase=Npe;Oe.ParenthesizedTypeNode=qw;Oe.PartiallyEmittedExpression=SM;Oe.PartiallyEmittedExpressionBase=Ipe;Oe.PathNotFoundError=EUe;Oe.PostfixUnaryExpression=TM;Oe.PostfixUnaryExpressionBase=Ppe;Oe.PrefixUnaryExpression=xM;Oe.PrefixUnaryExpressionBase=Ope;Oe.PrimaryExpression=sd;Oe.PrivateIdentifier=C6;Oe.PrivateIdentifierBase=m_e;Oe.Program=U6;Oe.Project=UH;Oe.PropertyAccessExpression=lL;Oe.PropertyAccessExpressionBase=kpe;Oe.PropertyAssignment=yM;Oe.PropertyAssignmentBase=iR;Oe.PropertyDeclaration=Nw;Oe.PropertyDeclarationBase=bR;Oe.PropertyNamedNode=UE;Oe.PropertySignature=QF;Oe.PropertySignatureBase=MR;Oe.QualifiedName=A6;Oe.QuestionDotTokenableNode=Y6;Oe.QuestionTokenableNode=Rh;Oe.ReadonlyableNode=xL;Oe.RefactorEditInfo=_L;Oe.ReferenceEntry=w6;Oe.ReferenceFindableNode=kh;Oe.ReferencedSymbol=gL;Oe.ReferencedSymbolDefinitionInfo=yL;Oe.ReferencedSymbolEntry=F6;Oe.RegularExpressionLiteral=_6;Oe.RegularExpressionLiteralBase=i_e;Oe.RenameLocation=G6;Oe.RenameableNode=pv;Oe.ReturnStatement=XM;Oe.ReturnStatementBase=ame;Oe.ReturnTypedNode=eq;Oe.ScopeableNode=upe;Oe.ScopedNode=_S;Oe.SetAccessorDeclaration=Iw;Oe.SetAccessorDeclarationBase=SR;Oe.ShorthandPropertyAssignment=vM;Oe.ShorthandPropertyAssignmentBase=aR;Oe.Signature=I6;Oe.SignaturedDeclaration=_v;Oe.SourceFile=kE;Oe.SourceFileBase=fR;Oe.SpreadAssignment=hM;Oe.SpreadAssignmentBase=oR;Oe.SpreadElement=DM;Oe.SpreadElementBase=Rpe;Oe.Statement=Cl;Oe.StatementBase=Vpe;Oe.StatementedNode=Mh;Oe.StaticableNode=WD;Oe.StringLiteral=g6;Oe.StringLiteralBase=a_e;Oe.Structure=rL;Oe.SuperElementAccessExpression=IH;Oe.SuperElementAccessExpressionBase=Mpe;Oe.SuperExpression=CM;Oe.SuperExpressionBase=wpe;Oe.SuperExpressionedNode=nq;Oe.SuperPropertyAccessExpression=PH;Oe.SuperPropertyAccessExpressionBase=Fpe;Oe.SwitchStatement=YM;Oe.SwitchStatementBase=ome;Oe.Symbol=P6;Oe.SymbolDisplayPart=B6;Oe.SyntaxList=YR;Oe.TaggedTemplateExpression=v6;Oe.TemplateExpression=h6;Oe.TemplateExpressionBase=s_e;Oe.TemplateHead=E6;Oe.TemplateHeadBase=l_e;Oe.TemplateLiteralTypeNode=Jw;Oe.TemplateMiddle=b6;Oe.TemplateMiddleBase=u_e;Oe.TemplateSpan=S6;Oe.TemplateSpanBase=c_e;Oe.TemplateTail=T6;Oe.TemplateTailBase=d_e;Oe.TextChange=FE;Oe.TextInsertableNode=ld;Oe.TextRange=nL;Oe.TextSpan=wD;Oe.ThisExpression=AM;Oe.ThisExpressionBase=Gpe;Oe.ThisTypeNode=zw;Oe.ThrowStatement=QM;Oe.ThrowStatementBase=sme;Oe.TrueLiteral=d6;Oe.TrueLiteralBase=Zme;Oe.TryStatement=ZM;Oe.TryStatementBase=lme;Oe.TupleTypeNode=$w;Oe.Type=hL;Oe.TypeAliasDeclaration=Xw;Oe.TypeAliasDeclarationBase=DR;Oe.TypeArgumentedNode=Q6;Oe.TypeAssertion=LM;Oe.TypeAssertionBase=Bpe;Oe.TypeChecker=vL;Oe.TypeElement=wE;Oe.TypeElementMemberedNode=tq;Oe.TypeLiteralNode=Yw;Oe.TypeLiteralNodeBase=wme;Oe.TypeNode=wc;Oe.TypeOfExpression=NM;Oe.TypeOfExpressionBase=Upe;Oe.TypeOperatorTypeNode=Qw;Oe.TypeParameter=W6;Oe.TypeParameterDeclaration=Zw;Oe.TypeParameterDeclarationBase=CR;Oe.TypeParameteredNode=J_;Oe.TypePredicateNode=eF;Oe.TypeQueryNode=rF;Oe.TypeReferenceNode=tF;Oe.TypedNode=KE;Oe.UnaryExpression=cv;Oe.UnaryExpressionedNode=jD;Oe.UnionTypeNode=nF;Oe.UnwrappableNode=Z6;Oe.UpdateExpression=nM;Oe.VariableDeclaration=L6;Oe.VariableDeclarationBase=UR;Oe.VariableDeclarationList=N6;Oe.VariableDeclarationListBase=__e;Oe.VariableStatement=gw;Oe.VariableStatementBase=pR;Oe.VoidExpression=IM;Oe.VoidExpressionBase=Kpe;Oe.WhileStatement=yw;Oe.WhileStatementBase=hme;Oe.WithStatement=vw;Oe.WithStatementBase=Eme;Oe.Writers=KH;Oe.YieldExpression=PM;Oe.YieldExpressionBase=Wpe;Oe.createWrappedNode=oUe;Oe.forEachStructureChild=A7e;Oe.getCompilerOptionsFromTsConfig=GBe;Oe.getScopeForNode=ZR;Oe.insertOverloads=rG;Oe.printNode=sj;Oe.setScopeForNode=rq});var Yg=gt((hYe,oG)=>{var E_e,b_e,S_e,T_e,x_e,D_e,C_e,A_e,L_e,iG,uq,N_e,I_e,P_e,qD,O_e,k_e,R_e,M_e,w_e,F_e,G_e,B_e,U_e,aG;(function(e){var r=typeof global=="object"?global:typeof self=="object"?self:typeof this=="object"?this:{};typeof define=="function"&&define.amd?define("tslib",["exports"],function(i){e(n(r,n(i)))}):typeof oG=="object"&&typeof oG.exports=="object"?e(n(r,n(oG.exports))):e(n(r));function n(i,a){return i!==r&&(typeof Object.create=="function"?Object.defineProperty(i,"__esModule",{value:!0}):i.__esModule=!0),function(s,u){return i[s]=a?a(s,u):u}}})(function(e){var r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var s in a)Object.prototype.hasOwnProperty.call(a,s)&&(i[s]=a[s])};E_e=function(i,a){if(typeof a!="function"&&a!==null)throw new TypeError("Class extends value "+String(a)+" is not a constructor or null");r(i,a);function s(){this.constructor=i}i.prototype=a===null?Object.create(a):(s.prototype=a.prototype,new s)},b_e=Object.assign||function(i){for(var a,s=1,u=arguments.length;s<u;s++){a=arguments[s];for(var p in a)Object.prototype.hasOwnProperty.call(a,p)&&(i[p]=a[p])}return i},S_e=function(i,a){var s={};for(var u in i)Object.prototype.hasOwnProperty.call(i,u)&&a.indexOf(u)<0&&(s[u]=i[u]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var p=0,u=Object.getOwnPropertySymbols(i);p<u.length;p++)a.indexOf(u[p])<0&&Object.prototype.propertyIsEnumerable.call(i,u[p])&&(s[u[p]]=i[u[p]]);return s},T_e=function(i,a,s,u){var p=arguments.length,f=p<3?a:u===null?u=Object.getOwnPropertyDescriptor(a,s):u,m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(i,a,s,u);else for(var g=i.length-1;g>=0;g--)(m=i[g])&&(f=(p<3?m(f):p>3?m(a,s,f):m(a,s))||f);return p>3&&f&&Object.defineProperty(a,s,f),f},x_e=function(i,a){return function(s,u){a(s,u,i)}},D_e=function(i,a){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,a)},C_e=function(i,a,s,u){function p(f){return f instanceof s?f:new s(function(m){m(f)})}return new(s||(s=Promise))(function(f,m){function g(B){try{P(u.next(B))}catch(K){m(K)}}function D(B){try{P(u.throw(B))}catch(K){m(K)}}function P(B){B.done?f(B.value):p(B.value).then(g,D)}P((u=u.apply(i,a||[])).next())})},A_e=function(i,a){var s={label:0,sent:function(){if(f[0]&1)throw f[1];return f[1]},trys:[],ops:[]},u,p,f,m;return m={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(m[Symbol.iterator]=function(){return this}),m;function g(P){return function(B){return D([P,B])}}function D(P){if(u)throw new TypeError("Generator is already executing.");for(;s;)try{if(u=1,p&&(f=P[0]&2?p.return:P[0]?p.throw||((f=p.return)&&f.call(p),0):p.next)&&!(f=f.call(p,P[1])).done)return f;switch(p=0,f&&(P=[P[0]&2,f.value]),P[0]){case 0:case 1:f=P;break;case 4:return s.label++,{value:P[1],done:!1};case 5:s.label++,p=P[1],P=[0];continue;case 7:P=s.ops.pop(),s.trys.pop();continue;default:if(f=s.trys,!(f=f.length>0&&f[f.length-1])&&(P[0]===6||P[0]===2)){s=0;continue}if(P[0]===3&&(!f||P[1]>f[0]&&P[1]<f[3])){s.label=P[1];break}if(P[0]===6&&s.label<f[1]){s.label=f[1],f=P;break}if(f&&s.label<f[2]){s.label=f[2],s.ops.push(P);break}f[2]&&s.ops.pop(),s.trys.pop();continue}P=a.call(i,s)}catch(B){P=[6,B],p=0}finally{u=f=0}if(P[0]&5)throw P[1];return{value:P[0]?P[1]:void 0,done:!0}}},L_e=function(i,a){for(var s in i)s!=="default"&&!Object.prototype.hasOwnProperty.call(a,s)&&aG(a,i,s)},aG=Object.create?function(i,a,s,u){u===void 0&&(u=s);var p=Object.getOwnPropertyDescriptor(a,s);(!p||("get"in p?!a.__esModule:p.writable||p.configurable))&&(p={enumerable:!0,get:function(){return a[s]}}),Object.defineProperty(i,u,p)}:function(i,a,s,u){u===void 0&&(u=s),i[u]=a[s]},iG=function(i){var a=typeof Symbol=="function"&&Symbol.iterator,s=a&&i[a],u=0;if(s)return s.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&u>=i.length&&(i=void 0),{value:i&&i[u++],done:!i}}};throw new TypeError(a?"Object is not iterable.":"Symbol.iterator is not defined.")},uq=function(i,a){var s=typeof Symbol=="function"&&i[Symbol.iterator];if(!s)return i;var u=s.call(i),p,f=[],m;try{for(;(a===void 0||a-- >0)&&!(p=u.next()).done;)f.push(p.value)}catch(g){m={error:g}}finally{try{p&&!p.done&&(s=u.return)&&s.call(u)}finally{if(m)throw m.error}}return f},N_e=function(){for(var i=[],a=0;a<arguments.length;a++)i=i.concat(uq(arguments[a]));return i},I_e=function(){for(var i=0,a=0,s=arguments.length;a<s;a++)i+=arguments[a].length;for(var u=Array(i),p=0,a=0;a<s;a++)for(var f=arguments[a],m=0,g=f.length;m<g;m++,p++)u[p]=f[m];return u},P_e=function(i,a,s){if(s||arguments.length===2)for(var u=0,p=a.length,f;u<p;u++)(f||!(u in a))&&(f||(f=Array.prototype.slice.call(a,0,u)),f[u]=a[u]);return i.concat(f||Array.prototype.slice.call(a))},qD=function(i){return this instanceof qD?(this.v=i,this):new qD(i)},O_e=function(i,a,s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var u=s.apply(i,a||[]),p,f=[];return p={},m("next"),m("throw"),m("return"),p[Symbol.asyncIterator]=function(){return this},p;function m(h){u[h]&&(p[h]=function(S){return new Promise(function(U,C){f.push([h,S,U,C])>1||g(h,S)})})}function g(h,S){try{D(u[h](S))}catch(U){K(f[0][3],U)}}function D(h){h.value instanceof qD?Promise.resolve(h.value.v).then(P,B):K(f[0][2],h)}function P(h){g("next",h)}function B(h){g("throw",h)}function K(h,S){h(S),f.shift(),f.length&&g(f[0][0],f[0][1])}},k_e=function(i){var a,s;return a={},u("next"),u("throw",function(p){throw p}),u("return"),a[Symbol.iterator]=function(){return this},a;function u(p,f){a[p]=i[p]?function(m){return(s=!s)?{value:qD(i[p](m)),done:p==="return"}:f?f(m):m}:f}},R_e=function(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=i[Symbol.asyncIterator],s;return a?a.call(i):(i=typeof iG=="function"?iG(i):i[Symbol.iterator](),s={},u("next"),u("throw"),u("return"),s[Symbol.asyncIterator]=function(){return this},s);function u(f){s[f]=i[f]&&function(m){return new Promise(function(g,D){m=i[f](m),p(g,D,m.done,m.value)})}}function p(f,m,g,D){Promise.resolve(D).then(function(P){f({value:P,done:g})},m)}},M_e=function(i,a){return Object.defineProperty?Object.defineProperty(i,"raw",{value:a}):i.raw=a,i};var n=Object.create?function(i,a){Object.defineProperty(i,"default",{enumerable:!0,value:a})}:function(i,a){i.default=a};w_e=function(i){if(i&&i.__esModule)return i;var a={};if(i!=null)for(var s in i)s!=="default"&&Object.prototype.hasOwnProperty.call(i,s)&&aG(a,i,s);return n(a,i),a},F_e=function(i){return i&&i.__esModule?i:{default:i}},G_e=function(i,a,s,u){if(s==="a"&&!u)throw new TypeError("Private accessor was defined without a getter");if(typeof a=="function"?i!==a||!u:!a.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return s==="m"?u:s==="a"?u.call(i):u?u.value:a.get(i)},B_e=function(i,a,s,u,p){if(u==="m")throw new TypeError("Private method is not writable");if(u==="a"&&!p)throw new TypeError("Private accessor was defined without a setter");if(typeof a=="function"?i!==a||!p:!a.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return u==="a"?p.call(i,s):p?p.value=s:a.set(i,s),s},U_e=function(i,a){if(a===null||typeof a!="object"&&typeof a!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof i=="function"?a===i:i.has(a)},e("__extends",E_e),e("__assign",b_e),e("__rest",S_e),e("__decorate",T_e),e("__param",x_e),e("__metadata",D_e),e("__awaiter",C_e),e("__generator",A_e),e("__exportStar",L_e),e("__createBinding",aG),e("__values",iG),e("__read",uq),e("__spread",N_e),e("__spreadArrays",I_e),e("__spreadArray",P_e),e("__await",qD),e("__asyncGenerator",O_e),e("__asyncDelegator",k_e),e("__asyncValues",R_e),e("__makeTemplateObject",M_e),e("__importStar",w_e),e("__importDefault",F_e),e("__classPrivateFieldGet",G_e),e("__classPrivateFieldSet",B_e),e("__classPrivateFieldIn",U_e)})});var K_e=gt(JD=>{"use strict";Object.defineProperty(JD,"__esModule",{value:!0});JD.lowerCase=JD.localeLowerCase=void 0;var bUe={tr:{regexp:/\u0130|\u0049|\u0049\u0307/g,map:{\u0130:"i",I:"\u0131",I\u0307:"i"}},az:{regexp:/\u0130/g,map:{\u0130:"i",I:"\u0131",I\u0307:"i"}},lt:{regexp:/\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,map:{I:"i\u0307",J:"j\u0307",\u012E:"\u012F\u0307",\u00CC:"i\u0307\u0300",\u00CD:"i\u0307\u0301",\u0128:"i\u0307\u0303"}}};function SUe(e,r){var n=bUe[r.toLowerCase()];return cq(n?e.replace(n.regexp,function(i){return n.map[i]}):e)}JD.localeLowerCase=SUe;function cq(e){return e.toLowerCase()}JD.lowerCase=cq});var QT=gt(sG=>{"use strict";Object.defineProperty(sG,"__esModule",{value:!0});sG.noCase=void 0;var TUe=K_e(),xUe=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],DUe=/[^A-Z0-9]+/gi;function CUe(e,r){r===void 0&&(r={});for(var n=r.splitRegexp,i=n===void 0?xUe:n,a=r.stripRegexp,s=a===void 0?DUe:a,u=r.transform,p=u===void 0?TUe.lowerCase:u,f=r.delimiter,m=f===void 0?" ":f,g=W_e(W_e(e,i,"$1\0$2"),s,"\0"),D=0,P=g.length;g.charAt(D)==="\0";)D++;for(;g.charAt(P-1)==="\0";)P--;return g.slice(D,P).split("\0").map(p).join(m)}sG.noCase=CUe;function W_e(e,r,n){return r instanceof RegExp?e.replace(r,n):r.reduce(function(i,a){return i.replace(a,n)},e)}});var dq=gt(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});vS.pascalCase=vS.pascalCaseTransformMerge=vS.pascalCaseTransform=void 0;var AUe=Yg(),LUe=QT();function V_e(e,r){var n=e.charAt(0),i=e.substr(1).toLowerCase();return r>0&&n>="0"&&n<="9"?"_"+n+i:""+n.toUpperCase()+i}vS.pascalCaseTransform=V_e;function NUe(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()}vS.pascalCaseTransformMerge=NUe;function IUe(e,r){return r===void 0&&(r={}),LUe.noCase(e,AUe.__assign({delimiter:"",transform:V_e},r))}vS.pascalCase=IUe});var H_e=gt(hS=>{"use strict";Object.defineProperty(hS,"__esModule",{value:!0});hS.camelCase=hS.camelCaseTransformMerge=hS.camelCaseTransform=void 0;var PUe=Yg(),fq=dq();function j_e(e,r){return r===0?e.toLowerCase():fq.pascalCaseTransform(e,r)}hS.camelCaseTransform=j_e;function OUe(e,r){return r===0?e.toLowerCase():fq.pascalCaseTransformMerge(e)}hS.camelCaseTransformMerge=OUe;function kUe(e,r){return r===void 0&&(r={}),fq.pascalCase(e,PUe.__assign({transform:j_e},r))}hS.camelCase=kUe});var pq=gt(lG=>{"use strict";Object.defineProperty(lG,"__esModule",{value:!0});lG.upperCaseFirst=void 0;function RUe(e){return e.charAt(0).toUpperCase()+e.substr(1)}lG.upperCaseFirst=RUe});var mq=gt(zD=>{"use strict";Object.defineProperty(zD,"__esModule",{value:!0});zD.capitalCase=zD.capitalCaseTransform=void 0;var MUe=Yg(),wUe=QT(),FUe=pq();function q_e(e){return FUe.upperCaseFirst(e.toLowerCase())}zD.capitalCaseTransform=q_e;function GUe(e,r){return r===void 0&&(r={}),wUe.noCase(e,MUe.__assign({delimiter:" ",transform:q_e},r))}zD.capitalCase=GUe});var J_e=gt($D=>{"use strict";Object.defineProperty($D,"__esModule",{value:!0});$D.upperCase=$D.localeUpperCase=void 0;var BUe={tr:{regexp:/[\u0069]/g,map:{i:"\u0130"}},az:{regexp:/[\u0069]/g,map:{i:"\u0130"}},lt:{regexp:/[\u0069\u006A\u012F]\u0307|\u0069\u0307[\u0300\u0301\u0303]/g,map:{i\u0307:"I",j\u0307:"J",\u012F\u0307:"\u012E",i\u0307\u0300:"\xCC",i\u0307\u0301:"\xCD",i\u0307\u0303:"\u0128"}}};function UUe(e,r){var n=BUe[r.toLowerCase()];return _q(n?e.replace(n.regexp,function(i){return n.map[i]}):e)}$D.localeUpperCase=UUe;function _q(e){return e.toUpperCase()}$D.upperCase=_q});var z_e=gt(uG=>{"use strict";Object.defineProperty(uG,"__esModule",{value:!0});uG.constantCase=void 0;var KUe=Yg(),WUe=QT(),VUe=J_e();function jUe(e,r){return r===void 0&&(r={}),WUe.noCase(e,KUe.__assign({delimiter:"_",transform:VUe.upperCase},r))}uG.constantCase=jUe});var kL=gt(cG=>{"use strict";Object.defineProperty(cG,"__esModule",{value:!0});cG.dotCase=void 0;var HUe=Yg(),qUe=QT();function JUe(e,r){return r===void 0&&(r={}),qUe.noCase(e,HUe.__assign({delimiter:"."},r))}cG.dotCase=JUe});var $_e=gt(dG=>{"use strict";Object.defineProperty(dG,"__esModule",{value:!0});dG.headerCase=void 0;var zUe=Yg(),$Ue=mq();function XUe(e,r){return r===void 0&&(r={}),$Ue.capitalCase(e,zUe.__assign({delimiter:"-"},r))}dG.headerCase=XUe});var X_e=gt(fG=>{"use strict";Object.defineProperty(fG,"__esModule",{value:!0});fG.paramCase=void 0;var YUe=Yg(),QUe=kL();function ZUe(e,r){return r===void 0&&(r={}),QUe.dotCase(e,YUe.__assign({delimiter:"-"},r))}fG.paramCase=ZUe});var Y_e=gt(pG=>{"use strict";Object.defineProperty(pG,"__esModule",{value:!0});pG.pathCase=void 0;var eKe=Yg(),rKe=kL();function tKe(e,r){return r===void 0&&(r={}),rKe.dotCase(e,eKe.__assign({delimiter:"/"},r))}pG.pathCase=tKe});var Z_e=gt(XD=>{"use strict";Object.defineProperty(XD,"__esModule",{value:!0});XD.sentenceCase=XD.sentenceCaseTransform=void 0;var nKe=Yg(),iKe=QT(),aKe=pq();function Q_e(e,r){var n=e.toLowerCase();return r===0?aKe.upperCaseFirst(n):n}XD.sentenceCaseTransform=Q_e;function oKe(e,r){return r===void 0&&(r={}),iKe.noCase(e,nKe.__assign({delimiter:" ",transform:Q_e},r))}XD.sentenceCase=oKe});var ege=gt(mG=>{"use strict";Object.defineProperty(mG,"__esModule",{value:!0});mG.snakeCase=void 0;var sKe=Yg(),lKe=kL();function uKe(e,r){return r===void 0&&(r={}),lKe.dotCase(e,sKe.__assign({delimiter:"_"},r))}mG.snakeCase=uKe});var gq=gt(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});var gv=Yg();gv.__exportStar(H_e(),z_);gv.__exportStar(mq(),z_);gv.__exportStar(z_e(),z_);gv.__exportStar(kL(),z_);gv.__exportStar($_e(),z_);gv.__exportStar(QT(),z_);gv.__exportStar(X_e(),z_);gv.__exportStar(dq(),z_);gv.__exportStar(Y_e(),z_);gv.__exportStar(Z_e(),z_);gv.__exportStar(ege(),z_)});var hq=gt((KYe,cKe)=>{cKe.exports={name:"zenstack",publisher:"zenstack",displayName:"ZenStack Language Tools",description:"ZenStack is a toolkit that simplifies full-stack development",version:"0.1.52",author:{name:"ymc9"},keywords:["fullstack","react","typescript","data modeling"],preview:!0,icon:"asset/logo-light-256.png",repository:{type:"git",url:"https://github.com/zenstackhq/zenstack"},engines:{vscode:"^1.72.0"},categories:["Programming Languages"],contributes:{languages:[{id:"zmodel",aliases:["ZenStack Model","zmodel"],extensions:[".zmodel"],configuration:"./language-configuration.json",icon:{light:"./asset/logo-light-256.png",dark:"./asset/logo-dark-256.png"}}],grammars:[{language:"zmodel",scopeName:"source.zmodel",path:"./syntaxes/zmodel.tmLanguage.json"}]},activationEvents:["onLanguage:zmodel"],files:["bin","src","bundle"],bin:{zenstack:"./bin/cli"},main:"./bundle/extension.js",scripts:{"vscode:publish":"vsce publish --no-dependencies","vscode:prepublish":"pnpm lint && pnpm build && pnpm bundle","vscode:package":"vsce package --no-dependencies",build:"pnpm langium:generate && tsc --noEmit",bundle:"node build/bundle.js --minify","bundle-watch":"node build/bundle.js --watch","ts:watch":"tsc --watch --noEmit","tsc-alias:watch":"tsc-alias --watch",lint:"eslint src --ext ts","langium:generate":"langium generate","langium:watch":"langium generate --watch",watch:'concurrently --kill-others "npm:langium:watch" "npm:bundle-watch"',test:"jest",prepublishOnly:"pnpm build && pnpm bundle"},dependencies:{"@zenstackhq/internal":"workspace:*","change-case":"^4.1.2",chevrotain:"^9.1.0",colors:"^1.4.0",commander:"^8.3.0",langium:"^0.5.0",pluralize:"^8.0.0",prisma:"^4.5.0",promisify:"^0.0.3","ts-morph":"^16.0.0",uuid:"^9.0.0","vscode-jsonrpc":"^8.0.2","vscode-languageclient":"^8.0.2","vscode-languageserver":"^8.0.2","vscode-languageserver-textdocument":"^1.0.7","vscode-uri":"^3.0.6"},devDependencies:{"@prisma/internals":"^4.5.0","@types/jest":"^29.2.0","@types/node":"^14.18.32","@types/pluralize":"^0.0.29","@types/tmp":"^0.2.3","@types/uuid":"^8.3.4","@types/vscode":"^1.72.0","@typescript-eslint/eslint-plugin":"^4.33.0","@typescript-eslint/parser":"^4.33.0",concurrently:"^7.4.0",esbuild:"^0.15.12",eslint:"^7.32.0",jest:"^29.2.1","langium-cli":"^0.5.0",tmp:"^0.2.1","ts-jest":"^29.0.3","ts-node":"^10.9.1","tsc-alias":"^1.7.0","tsconfig-paths-jest":"^0.0.1",typescript:"^4.8.4",vsce:"^2.13.0"}}});var fKe={};XDe(fKe,{default:()=>dKe,generateAction:()=>uge});module.exports=YDe(fKe);var vG=Gs(cQ()),sge=Gs(mQ());var _oe=Gs(CE()),foe="AbstractDeclaration";var f6e="Expression";var poe="ReferenceTarget";var JO="TypeDeclaration";var Hx="ArrayExpr";function zO(e){return iv.isInstance(e,Hx)}var rK="Attribute";var goe="AttributeArg";var TA="BinaryExpr";var $O="DataModel";function G_(e){return iv.isInstance(e,$O)}var tK="DataModelField";function qx(e){return iv.isInstance(e,tK)}var XO="DataSource";function yoe(e){return iv.isInstance(e,XO)}var YO="Enum";function voe(e){return iv.isInstance(e,YO)}var QO="EnumField";function Jx(e){return iv.isInstance(e,QO)}var moe="Function";var p6e="FunctionParam";var zx="InvocationExpr";function xA(e){return iv.isInstance(e,zx)}var Ub="LiteralExpr";function vh(e){return iv.isInstance(e,Ub)}var Kb="MemberAccessExpr";function nK(e){return iv.isInstance(e,Kb)}var DA="NullExpr";var Wb="ReferenceExpr";function Vb(e){return iv.isInstance(e,Wb)}var $x="ThisExpr";function xT(e){return iv.isInstance(e,$x)}var CA="UnaryExpr";var SA=class{getAllTypes(){return["AbstractDeclaration","Argument","ArrayExpr","Attribute","AttributeArg","AttributeParam","AttributeParamType","BinaryExpr","DataModel","DataModelAttribute","DataModelField","DataModelFieldAttribute","DataModelFieldType","DataSource","DataSourceField","Enum","EnumField","Expression","Function","FunctionParam","FunctionParamType","InvocationExpr","LiteralExpr","MemberAccessExpr","Model","NullExpr","ReferenceArg","ReferenceExpr","ReferenceTarget","ThisExpr","TypeDeclaration","UnaryExpr"]}isInstance(r,n){return(0,_oe.isAstNode)(r)&&this.isSubtype(r.$type,n)}isSubtype(r,n){if(r===n)return!0;switch(r){case Hx:case TA:case zx:case Ub:case Kb:case DA:case Wb:case $x:case CA:return this.isSubtype(f6e,n);case rK:case XO:case moe:return this.isSubtype(foe,n);case $O:case YO:return this.isSubtype(foe,n)||this.isSubtype(JO,n);case tK:case QO:case p6e:return this.isSubtype(poe,n);default:return!1}}getReferenceType(r){let n=`${r.container.$type}:${r.property}`;switch(n){case"AttributeParamType:reference":return JO;case"DataModelAttribute:decl":return rK;case"DataModelFieldAttribute:decl":return rK;case"DataModelFieldType:reference":return JO;case"FunctionParamType:reference":return JO;case"InvocationExpr:function":return moe;case"MemberAccessExpr:member":return tK;case"ReferenceExpr:target":return poe;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(r){switch(r){case"ArrayExpr":return{name:"ArrayExpr",mandatory:[{name:"items",type:"array"}]};case"Attribute":return{name:"Attribute",mandatory:[{name:"params",type:"array"}]};case"AttributeParam":return{name:"AttributeParam",mandatory:[{name:"default",type:"boolean"}]};case"AttributeParamType":return{name:"AttributeParamType",mandatory:[{name:"array",type:"boolean"},{name:"optional",type:"boolean"}]};case"DataModel":return{name:"DataModel",mandatory:[{name:"attributes",type:"array"},{name:"fields",type:"array"}]};case"DataModelAttribute":return{name:"DataModelAttribute",mandatory:[{name:"args",type:"array"}]};case"DataModelField":return{name:"DataModelField",mandatory:[{name:"attributes",type:"array"}]};case"DataModelFieldAttribute":return{name:"DataModelFieldAttribute",mandatory:[{name:"args",type:"array"}]};case"DataModelFieldType":return{name:"DataModelFieldType",mandatory:[{name:"array",type:"boolean"},{name:"optional",type:"boolean"}]};case"DataSource":return{name:"DataSource",mandatory:[{name:"fields",type:"array"}]};case"Enum":return{name:"Enum",mandatory:[{name:"fields",type:"array"}]};case"Function":return{name:"Function",mandatory:[{name:"params",type:"array"}]};case"FunctionParamType":return{name:"FunctionParamType",mandatory:[{name:"array",type:"boolean"}]};case"InvocationExpr":return{name:"InvocationExpr",mandatory:[{name:"args",type:"array"}]};case"Model":return{name:"Model",mandatory:[{name:"declarations",type:"array"}]};case"ReferenceExpr":return{name:"ReferenceExpr",mandatory:[{name:"args",type:"array"}]};default:return{name:r,mandatory:[]}}}},iv=new SA;var hoe=Gs(CE()),ZO,Eoe=()=>ZO!=null?ZO:ZO=(0,hoe.loadGrammarFromJson)(`{
4253
4253
  "$type": "Grammar",
4254
4254
  "isDeclared": true,
4255
4255
  "name": "ZModel",