@checksum-ai/runtime 1.0.27 → 1.0.28

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.
Files changed (3) hide show
  1. package/cli.js +2 -2
  2. package/index.js +3 -3
  3. package/package.json +1 -1
package/cli.js CHANGED
@@ -1,4 +1,4 @@
1
- var f=Object.create;var g=Object.defineProperty;var w=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,k=Object.prototype.hasOwnProperty;var u=(n,t)=>g(n,"name",{value:t,configurable:!0});var P=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of C(t))!k.call(n,o)&&o!==e&&g(n,o,{get:()=>t[o],enumerable:!(s=w(t,o))||s.enumerable});return n};var R=(n,t,e)=>(e=n!=null?f(y(n)):{},P(t||!n||!n.__esModule?g(e,"default",{value:n,enumerable:!0}):e,n));var i=require("fs"),l=R(require("child_process")),r=require("path");var d="checksum";var h=class{constructor(){this.TEST_RUN_MONITOR_PATH=(0,r.join)(__dirname,"test-run-monitor.js");this.CHECKSUM_API_URL="https://api.checksum.ai";this.didFail=!1;this.mock=!1;this.isolatedMode=!1;this.completeIndicators={upload:!1,tests:!1,report:!1};this.guardReturn=async(t,e=1e3,s="action hang guard timed out")=>{let o="guard-timed-out",a=u(async()=>(await this.awaitSleep(e+1e3),o),"guard"),c=await Promise.race([t,a()]);if(typeof c=="string"&&c===o)throw new Error(s);return c};this.awaitSleep=t=>new Promise(e=>setTimeout(e,t))}async execute(){switch(process.argv.find(t=>t==="--help"||t==="-h")&&(await this.printHelp(process.argv[2]),process.exit(0)),process.argv[2]){case"init":this.install();break;case"test":await this.test(process.argv.slice(3));break;case"show-report":this.showReport(process.argv.slice(3));break;default:await this.printHelp()}process.exit(0)}async execCmd(t){let e=await l.spawn(t,{shell:!0,stdio:"inherit"});return new Promise((o,a)=>{e.on("exit",c=>{c===0?o(!0):a(new Error(`Checsum failed execution with code: ${c} `))})})}async getCmdOutput(t){return new Promise(function(e,s){l.exec(t,(o,a,c)=>{if(o){s(`Error executing command: ${o.message}`);return}e(a)})})}async printHelp(t){switch(t){default:console.log(`
1
+ var f=Object.create;var g=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var w=Object.getOwnPropertyNames;var y=Object.getPrototypeOf,P=Object.prototype.hasOwnProperty;var u=(n,t)=>g(n,"name",{value:t,configurable:!0});var k=(n,t,e,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of w(t))!P.call(n,o)&&o!==e&&g(n,o,{get:()=>t[o],enumerable:!(s=C(t,o))||s.enumerable});return n};var R=(n,t,e)=>(e=n!=null?f(y(n)):{},k(t||!n||!n.__esModule?g(e,"default",{value:n,enumerable:!0}):e,n));var i=require("fs"),l=R(require("child_process")),r=require("path");var d="checksum";var h=class{constructor(){this.TEST_RUN_MONITOR_PATH=(0,r.join)(__dirname,"test-run-monitor.js");this.CHECKSUM_API_URL="https://api.checksum.ai";this.CHECKSUM_APP_URL="https://app.checksum.ai";this.didFail=!1;this.mock=!1;this.isolatedMode=!1;this.completeIndicators={upload:!1,tests:!1,report:!1};this.guardReturn=async(t,e=1e3,s="action hang guard timed out")=>{let o="guard-timed-out",a=u(async()=>(await this.awaitSleep(e+1e3),o),"guard"),c=await Promise.race([t,a()]);if(typeof c=="string"&&c===o)throw new Error(s);return c};this.awaitSleep=t=>new Promise(e=>setTimeout(e,t))}async execute(){switch(process.argv.find(t=>t==="--help"||t==="-h")&&(await this.printHelp(process.argv[2]),process.exit(0)),process.argv[2]){case"init":this.install();break;case"test":await this.test(process.argv.slice(3));break;case"show-report":this.showReport(process.argv.slice(3));break;default:await this.printHelp()}process.exit(0)}async execCmd(t){let e=await l.spawn(t,{shell:!0,stdio:"inherit"});return new Promise((o,a)=>{e.on("exit",c=>{c===0?o(!0):a(new Error(`Checsum failed execution with code: ${c} `))})})}async getCmdOutput(t){return new Promise(function(e,s){l.exec(t,(o,a,c)=>{if(o){s(`Error executing command: ${o.message}`);return}e(a)})})}async printHelp(t){switch(t){default:console.log(`
2
2
  Checksum CLI
3
3
  Usage: checksum [command] [options]
4
4
 
@@ -11,7 +11,7 @@ show-report [options] [report] show HTML report
11
11
  `);s.splice(5,0," --checksum-config=<config> Checksum configuration in JSON format").join(`
12
12
  `),console.log(s.join(`
13
13
  `))}catch(e){console.log("Error",e.message)}break;case"show-report":try{let e="npx playwright show-report --help",s=(await this.getCmdOutput(e)).replace(/npx playwright/g,"yarn checksum");console.log(s)}catch(e){console.log("Error",e.message)}break}}async showReport(t){let e=`npx playwright show-report ${t.join(" ")}`;try{await this.execCmd(e)}catch(s){console.log("Error showing report",s.message)}}async test(t){this.processChecksumArguments(t),this.setChecksumConfig(),await this.getSession();let e;try{e=await this.guardReturn(this.startTestRunMonitor(this.testSession),1e4,"test run monitor timeout")}catch{console.log("Error starting test run monitor. Test results will not be available on checksum.")}this.buildVolatileConfig();let s=`${e?`CHECKSUM_UPLOAD_AGENT_PORT=${e} `:""} PWDEBUG=console npx playwright test --config ${this.getPlaywrightConfigFile()} ${t.join(" ")}`;await this.patchPlaywright();try{await this.execCmd(s),console.log("Tests execution finished")}catch(o){this.didFail=!0,console.log("Error during test",o.message)}finally{let o=this.getPlaywrightReportPath();(0,i.existsSync)(o)?this.testRunMonitorProcess.stdin.write(`cli:report=${o}`):console.log(`Could not find report file at ${o}`),await this.patchPlaywright(!0),this.completeIndicators.tests=!0,await this.handleCompleteMessage()}}async patchPlaywright(t=!1){let e=`bash ${(0,r.join)(__dirname,"scripts/patch.sh")}${t?" off":""}`;try{await this.execCmd(e)}catch(s){console.log("Error patching playwright",s.message)}}getPlaywrightReportPath(){var o,a;let t=(0,r.join)(process.cwd(),"playwright-report"),e=require(this.getPlaywrightConfigFile()),{reporter:s}=e;return s instanceof Array&&s.length>1&&((o=s[1])!=null&&o.outputFolder)&&(t=(a=s[1])==null?void 0:a.outputFolder),process.env.PLAYWRIGHT_HTML_REPORT&&(t=process.env.PLAYWRIGHT_HTML_REPORT),(0,r.join)(t,"index.html")}getPlaywrightConfigFile(){return(0,r.join)(this.getRootDirPath(),"playwright.config.ts")}startTestRunMonitor(t){return new Promise(e=>{console.log("Starting test run monitor"),this.testRunMonitorProcess=l.spawn("node",[this.TEST_RUN_MONITOR_PATH,JSON.stringify({sessionId:t,checksumApiURL:this.CHECKSUM_API_URL,apiKey:this.config.apiKey}),...this.mock?["mock"]:[]]),this.testRunMonitorProcess.stdout.on("data",s=>{var p,m;let o=s.toString().trim();if(!o.startsWith("monitor")){(m=(p=this.config)==null?void 0:p.options)!=null&&m.printLogs&&console.log(`Message from test run monitor: ${o}`);return}let[a,c]=o.substring(o.indexOf(":")+1).split("=");a==="port"?e(c):this.handleTestRunMonitorMessage(a,c)}),this.testRunMonitorProcess.on("exit",(s,o)=>{console.log(`test run monitor process exited with code ${s} and signal ${o}`)}),this.testRunMonitorProcess.on("error",s=>{console.error(`Error starting test run monitor: ${s.message}`)})})}async handleTestRunMonitorMessage(t,e){switch(t){case"complete":this.isolatedMode||console.log("Test artifacts uploaded successfully"),this.sendUploadsComplete().then(()=>{this.completeIndicators.upload=!0});break;case"report-uploaded":{this.isolatedMode||console.log("Report generated and uploaded to checksum");let s={};try{s=JSON.parse(e)}catch(o){console.log("Error parsing stats",o.message)}await this.sendTestRunEnd(s),this.completeIndicators.report=!0,this.isolatedMode||console.log(`*******************
14
- * Checksum report URL: ${this.CHECKSUM_API_URL}/#/test-runs/${this.testSession}
14
+ * Checksum report URL: ${this.CHECKSUM_APP_URL}/#/test-runs/${this.testSession}
15
15
  *******************`);break}default:console.warn(`Unhandled test run monitor message: ${t}=${e}`)}}async handleCompleteMessage(){for(;;)Object.keys(this.completeIndicators).find(t=>!this.completeIndicators[t])?await this.awaitSleep(1e3):(console.log("Checksum test run complete"),this.shutdown(this.didFail?1:0))}shutdown(t=0){this.cleanup(),process.exit(t)}buildVolatileConfig(){if(!this.volatileChecksumConfig)return;let t=this.getVolatileConfigPath(),e=`
16
16
  import { RunMode, getChecksumConfig } from "@checksum-ai/runtime";
17
17
 
package/index.js CHANGED
@@ -267,8 +267,8 @@ m2: `).concat(this.mapper2.__debugToString().split(`
267
267
  `,P+=be.classification+`
268
268
  `}return P+=E.finalLexState,P},L}(z),ce=function(F){nv(L,F);function L(_,b,x){var E=F.call(this,_)||this;return E.logger=b,E.host=x,E.logPerformance=!1,E}return n(L,"CoreServicesShimObject"),L.prototype.forwardJSONCall=function(_,b){return B(this.logger,_,b,this.logPerformance)},L.prototype.resolveModuleName=function(_,b,x){var E=this;return this.forwardJSONCall("resolveModuleName('".concat(_,"')"),function(){var P=JSON.parse(x),A=e.resolveModuleName(b,e.normalizeSlashes(_),P,E.host),ve=A.resolvedModule?A.resolvedModule.resolvedFileName:void 0;return A.resolvedModule&&A.resolvedModule.extension!==".ts"&&A.resolvedModule.extension!==".tsx"&&A.resolvedModule.extension!==".d.ts"&&(ve=void 0),{resolvedFileName:ve,failedLookupLocations:A.failedLookupLocations,affectingLocations:A.affectingLocations}})},L.prototype.resolveTypeReferenceDirective=function(_,b,x){var E=this;return this.forwardJSONCall("resolveTypeReferenceDirective(".concat(_,")"),function(){var P=JSON.parse(x),A=e.resolveTypeReferenceDirective(b,e.normalizeSlashes(_),P,E.host);return{resolvedFileName:A.resolvedTypeReferenceDirective?A.resolvedTypeReferenceDirective.resolvedFileName:void 0,primary:A.resolvedTypeReferenceDirective?A.resolvedTypeReferenceDirective.primary:!0,failedLookupLocations:A.failedLookupLocations}})},L.prototype.getPreProcessedFileInfo=function(_,b){var x=this;return this.forwardJSONCall("getPreProcessedFileInfo('".concat(_,"')"),function(){var E=e.preProcessFile(e.getSnapshotText(b),!0,!0);return{referencedFiles:x.convertFileReferences(E.referencedFiles),importedFiles:x.convertFileReferences(E.importedFiles),ambientExternalModules:E.ambientExternalModules,isLibFile:E.isLibFile,typeReferenceDirectives:x.convertFileReferences(E.typeReferenceDirectives),libReferenceDirectives:x.convertFileReferences(E.libReferenceDirectives)}})},L.prototype.getAutomaticTypeDirectiveNames=function(_){var b=this;return this.forwardJSONCall("getAutomaticTypeDirectiveNames('".concat(_,"')"),function(){var x=JSON.parse(_);return e.getAutomaticTypeDirectiveNames(x,b.host)})},L.prototype.convertFileReferences=function(_){if(_){for(var b=[],x=0,E=_;x<E.length;x++){var P=E[x];b.push({path:e.normalizeSlashes(P.fileName),position:P.pos,length:P.end-P.pos})}return b}},L.prototype.getTSConfigFileInfo=function(_,b){var x=this;return this.forwardJSONCall("getTSConfigFileInfo('".concat(_,"')"),function(){var E=e.parseJsonText(_,e.getSnapshotText(b)),P=e.normalizeSlashes(_),A=e.parseJsonSourceFileConfigFileContent(E,x.host,e.getDirectoryPath(P),{},P);return{options:A.options,typeAcquisition:A.typeAcquisition,files:A.fileNames,raw:A.raw,errors:p(Gn(Gn([],E.parseDiagnostics,!0),A.errors,!0),`\r
269
269
  `)}})},L.prototype.getDefaultCompilationSettings=function(){return this.forwardJSONCall("getDefaultCompilationSettings()",function(){return e.getDefaultCompilerOptions()})},L.prototype.discoverTypings=function(_){var b=this,x=e.createGetCanonicalFileName(!1);return this.forwardJSONCall("discoverTypings()",function(){var E=JSON.parse(_);return b.safeList===void 0&&(b.safeList=e.JsTyping.loadSafeList(b.host,e.toPath(E.safeListPath,E.safeListPath,x))),e.JsTyping.discoverTypings(b.host,function(P){return b.logger.log(P)},E.fileNames,e.toPath(E.projectRootPath,E.projectRootPath,x),b.safeList,E.packageNameToTypingLocation,E.typeAcquisition,E.unresolvedImports,E.typesRegistry,e.emptyOptions)})},L}(z),ue=function(){function F(){this._shims=[]}return n(F,"TypeScriptServicesFactory"),F.prototype.getServicesVersion=function(){return e.servicesVersion},F.prototype.createLanguageServiceShim=function(L){try{this.documentRegistry===void 0&&(this.documentRegistry=e.createDocumentRegistry(L.useCaseSensitiveFileNames&&L.useCaseSensitiveFileNames(),L.getCurrentDirectory()));var _=new v(L),b=e.createLanguageService(_,this.documentRegistry,!1);return new fe(this,L,b)}catch(x){throw a(L,x),x}},F.prototype.createClassifierShim=function(L){try{return new se(this,L)}catch(_){throw a(L,_),_}},F.prototype.createCoreServicesShim=function(L){try{var _=new O(L);return new ce(this,L,_)}catch(b){throw a(L,b),b}},F.prototype.close=function(){e.clear(this._shims),this.documentRegistry=void 0},F.prototype.registerShim=function(L){this._shims.push(L)},F.prototype.unregisterShim=function(L){for(var _=0;_<this._shims.length;_++)if(this._shims[_]===L){delete this._shims[_];return}throw new Error("Invalid operation")},F}();e.TypeScriptServicesFactory=ue})(_r||(_r={}));(function(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,typeof globalThis>"u"&&(window.globalThis=window),delete Object.prototype.__magic__}catch{window.globalThis=window}})();(typeof process>"u"||process.browser)&&(globalThis.TypeScript=globalThis.TypeScript||{},globalThis.TypeScript.Services=globalThis.TypeScript.Services||{},globalThis.TypeScript.Services.TypeScriptServicesFactory=_r.TypeScriptServicesFactory,globalThis.toolsVersion=_r.versionMajorMinor);typeof Ih<"u"&&Ih.exports&&(Ih.exports=_r);var _r;(function(e){function a(O,h,B,re){if(Object.defineProperty(se,"name",Ri(Ri({},Object.getOwnPropertyDescriptor(se,"name")),{value:O})),re)for(var z=0,p=Object.keys(re);z<p.length;z++){var m=p[z],fe=+m;!isNaN(fe)&&e.hasProperty(h,"".concat(fe))&&(h[fe]=e.Debug.deprecate(h[fe],Ri(Ri({},re[fe]),{name:O})))}var le=y(h,B);return se;function se(){for(var ce=[],ue=0;ue<arguments.length;ue++)ce[ue]=arguments[ue];var F=le(ce),L=F!==void 0?h[F]:void 0;if(typeof L=="function")return L.apply(void 0,ce);throw new TypeError("Invalid arguments")}}n(a,"createOverload"),e.createOverload=a;function y(O,h){return function(B){for(var re=0;e.hasProperty(O,"".concat(re))&&e.hasProperty(h,"".concat(re));re++){var z=h[re];if(z(B))return re}}}n(y,"createBinder");function v(O){return{overload:function(h){return{bind:function(B){return{finish:function(){return a(O,h,B)},deprecate:function(re){return{finish:function(){return a(O,h,B,re)}}}}}}}}}n(v,"buildOverload"),e.buildOverload=v})(_r||(_r={}));var _r;(function(e){var a={since:"4.0",warnAfter:"4.1",message:"Use the appropriate method on 'ts.factory' or the 'factory' supplied by your transformation context instead."};e.createNodeArray=e.Debug.deprecate(e.factory.createNodeArray,a),e.createNumericLiteral=e.Debug.deprecate(e.factory.createNumericLiteral,a),e.createBigIntLiteral=e.Debug.deprecate(e.factory.createBigIntLiteral,a),e.createStringLiteral=e.Debug.deprecate(e.factory.createStringLiteral,a),e.createStringLiteralFromNode=e.Debug.deprecate(e.factory.createStringLiteralFromNode,a),e.createRegularExpressionLiteral=e.Debug.deprecate(e.factory.createRegularExpressionLiteral,a),e.createLoopVariable=e.Debug.deprecate(e.factory.createLoopVariable,a),e.createUniqueName=e.Debug.deprecate(e.factory.createUniqueName,a),e.createPrivateIdentifier=e.Debug.deprecate(e.factory.createPrivateIdentifier,a),e.createSuper=e.Debug.deprecate(e.factory.createSuper,a),e.createThis=e.Debug.deprecate(e.factory.createThis,a),e.createNull=e.Debug.deprecate(e.factory.createNull,a),e.createTrue=e.Debug.deprecate(e.factory.createTrue,a),e.createFalse=e.Debug.deprecate(e.factory.createFalse,a),e.createModifier=e.Debug.deprecate(e.factory.createModifier,a),e.createModifiersFromModifierFlags=e.Debug.deprecate(e.factory.createModifiersFromModifierFlags,a),e.createQualifiedName=e.Debug.deprecate(e.factory.createQualifiedName,a),e.updateQualifiedName=e.Debug.deprecate(e.factory.updateQualifiedName,a),e.createComputedPropertyName=e.Debug.deprecate(e.factory.createComputedPropertyName,a),e.updateComputedPropertyName=e.Debug.deprecate(e.factory.updateComputedPropertyName,a),e.createTypeParameterDeclaration=e.Debug.deprecate(e.factory.createTypeParameterDeclaration,a),e.updateTypeParameterDeclaration=e.Debug.deprecate(e.factory.updateTypeParameterDeclaration,a),e.createParameter=e.Debug.deprecate(e.factory.createParameterDeclaration,a),e.updateParameter=e.Debug.deprecate(e.factory.updateParameterDeclaration,a),e.createDecorator=e.Debug.deprecate(e.factory.createDecorator,a),e.updateDecorator=e.Debug.deprecate(e.factory.updateDecorator,a),e.createProperty=e.Debug.deprecate(e.factory.createPropertyDeclaration,a),e.updateProperty=e.Debug.deprecate(e.factory.updatePropertyDeclaration,a),e.createMethod=e.Debug.deprecate(e.factory.createMethodDeclaration,a),e.updateMethod=e.Debug.deprecate(e.factory.updateMethodDeclaration,a),e.createConstructor=e.Debug.deprecate(e.factory.createConstructorDeclaration,a),e.updateConstructor=e.Debug.deprecate(e.factory.updateConstructorDeclaration,a),e.createGetAccessor=e.Debug.deprecate(e.factory.createGetAccessorDeclaration,a),e.updateGetAccessor=e.Debug.deprecate(e.factory.updateGetAccessorDeclaration,a),e.createSetAccessor=e.Debug.deprecate(e.factory.createSetAccessorDeclaration,a),e.updateSetAccessor=e.Debug.deprecate(e.factory.updateSetAccessorDeclaration,a),e.createCallSignature=e.Debug.deprecate(e.factory.createCallSignature,a),e.updateCallSignature=e.Debug.deprecate(e.factory.updateCallSignature,a),e.createConstructSignature=e.Debug.deprecate(e.factory.createConstructSignature,a),e.updateConstructSignature=e.Debug.deprecate(e.factory.updateConstructSignature,a),e.updateIndexSignature=e.Debug.deprecate(e.factory.updateIndexSignature,a),e.createKeywordTypeNode=e.Debug.deprecate(e.factory.createKeywordTypeNode,a),e.createTypePredicateNodeWithModifier=e.Debug.deprecate(e.factory.createTypePredicateNode,a),e.updateTypePredicateNodeWithModifier=e.Debug.deprecate(e.factory.updateTypePredicateNode,a),e.createTypeReferenceNode=e.Debug.deprecate(e.factory.createTypeReferenceNode,a),e.updateTypeReferenceNode=e.Debug.deprecate(e.factory.updateTypeReferenceNode,a),e.createFunctionTypeNode=e.Debug.deprecate(e.factory.createFunctionTypeNode,a),e.updateFunctionTypeNode=e.Debug.deprecate(e.factory.updateFunctionTypeNode,a),e.createConstructorTypeNode=e.Debug.deprecate(function(y,v,O){return e.factory.createConstructorTypeNode(void 0,y,v,O)},a),e.updateConstructorTypeNode=e.Debug.deprecate(function(y,v,O,h){return e.factory.updateConstructorTypeNode(y,y.modifiers,v,O,h)},a),e.createTypeQueryNode=e.Debug.deprecate(e.factory.createTypeQueryNode,a),e.updateTypeQueryNode=e.Debug.deprecate(e.factory.updateTypeQueryNode,a),e.createTypeLiteralNode=e.Debug.deprecate(e.factory.createTypeLiteralNode,a),e.updateTypeLiteralNode=e.Debug.deprecate(e.factory.updateTypeLiteralNode,a),e.createArrayTypeNode=e.Debug.deprecate(e.factory.createArrayTypeNode,a),e.updateArrayTypeNode=e.Debug.deprecate(e.factory.updateArrayTypeNode,a),e.createTupleTypeNode=e.Debug.deprecate(e.factory.createTupleTypeNode,a),e.updateTupleTypeNode=e.Debug.deprecate(e.factory.updateTupleTypeNode,a),e.createOptionalTypeNode=e.Debug.deprecate(e.factory.createOptionalTypeNode,a),e.updateOptionalTypeNode=e.Debug.deprecate(e.factory.updateOptionalTypeNode,a),e.createRestTypeNode=e.Debug.deprecate(e.factory.createRestTypeNode,a),e.updateRestTypeNode=e.Debug.deprecate(e.factory.updateRestTypeNode,a),e.createUnionTypeNode=e.Debug.deprecate(e.factory.createUnionTypeNode,a),e.updateUnionTypeNode=e.Debug.deprecate(e.factory.updateUnionTypeNode,a),e.createIntersectionTypeNode=e.Debug.deprecate(e.factory.createIntersectionTypeNode,a),e.updateIntersectionTypeNode=e.Debug.deprecate(e.factory.updateIntersectionTypeNode,a),e.createConditionalTypeNode=e.Debug.deprecate(e.factory.createConditionalTypeNode,a),e.updateConditionalTypeNode=e.Debug.deprecate(e.factory.updateConditionalTypeNode,a),e.createInferTypeNode=e.Debug.deprecate(e.factory.createInferTypeNode,a),e.updateInferTypeNode=e.Debug.deprecate(e.factory.updateInferTypeNode,a),e.createImportTypeNode=e.Debug.deprecate(e.factory.createImportTypeNode,a),e.updateImportTypeNode=e.Debug.deprecate(e.factory.updateImportTypeNode,a),e.createParenthesizedType=e.Debug.deprecate(e.factory.createParenthesizedType,a),e.updateParenthesizedType=e.Debug.deprecate(e.factory.updateParenthesizedType,a),e.createThisTypeNode=e.Debug.deprecate(e.factory.createThisTypeNode,a),e.updateTypeOperatorNode=e.Debug.deprecate(e.factory.updateTypeOperatorNode,a),e.createIndexedAccessTypeNode=e.Debug.deprecate(e.factory.createIndexedAccessTypeNode,a),e.updateIndexedAccessTypeNode=e.Debug.deprecate(e.factory.updateIndexedAccessTypeNode,a),e.createMappedTypeNode=e.Debug.deprecate(e.factory.createMappedTypeNode,a),e.updateMappedTypeNode=e.Debug.deprecate(e.factory.updateMappedTypeNode,a),e.createLiteralTypeNode=e.Debug.deprecate(e.factory.createLiteralTypeNode,a),e.updateLiteralTypeNode=e.Debug.deprecate(e.factory.updateLiteralTypeNode,a),e.createObjectBindingPattern=e.Debug.deprecate(e.factory.createObjectBindingPattern,a),e.updateObjectBindingPattern=e.Debug.deprecate(e.factory.updateObjectBindingPattern,a),e.createArrayBindingPattern=e.Debug.deprecate(e.factory.createArrayBindingPattern,a),e.updateArrayBindingPattern=e.Debug.deprecate(e.factory.updateArrayBindingPattern,a),e.createBindingElement=e.Debug.deprecate(e.factory.createBindingElement,a),e.updateBindingElement=e.Debug.deprecate(e.factory.updateBindingElement,a),e.createArrayLiteral=e.Debug.deprecate(e.factory.createArrayLiteralExpression,a),e.updateArrayLiteral=e.Debug.deprecate(e.factory.updateArrayLiteralExpression,a),e.createObjectLiteral=e.Debug.deprecate(e.factory.createObjectLiteralExpression,a),e.updateObjectLiteral=e.Debug.deprecate(e.factory.updateObjectLiteralExpression,a),e.createPropertyAccess=e.Debug.deprecate(e.factory.createPropertyAccessExpression,a),e.updatePropertyAccess=e.Debug.deprecate(e.factory.updatePropertyAccessExpression,a),e.createPropertyAccessChain=e.Debug.deprecate(e.factory.createPropertyAccessChain,a),e.updatePropertyAccessChain=e.Debug.deprecate(e.factory.updatePropertyAccessChain,a),e.createElementAccess=e.Debug.deprecate(e.factory.createElementAccessExpression,a),e.updateElementAccess=e.Debug.deprecate(e.factory.updateElementAccessExpression,a),e.createElementAccessChain=e.Debug.deprecate(e.factory.createElementAccessChain,a),e.updateElementAccessChain=e.Debug.deprecate(e.factory.updateElementAccessChain,a),e.createCall=e.Debug.deprecate(e.factory.createCallExpression,a),e.updateCall=e.Debug.deprecate(e.factory.updateCallExpression,a),e.createCallChain=e.Debug.deprecate(e.factory.createCallChain,a),e.updateCallChain=e.Debug.deprecate(e.factory.updateCallChain,a),e.createNew=e.Debug.deprecate(e.factory.createNewExpression,a),e.updateNew=e.Debug.deprecate(e.factory.updateNewExpression,a),e.createTypeAssertion=e.Debug.deprecate(e.factory.createTypeAssertion,a),e.updateTypeAssertion=e.Debug.deprecate(e.factory.updateTypeAssertion,a),e.createParen=e.Debug.deprecate(e.factory.createParenthesizedExpression,a),e.updateParen=e.Debug.deprecate(e.factory.updateParenthesizedExpression,a),e.createFunctionExpression=e.Debug.deprecate(e.factory.createFunctionExpression,a),e.updateFunctionExpression=e.Debug.deprecate(e.factory.updateFunctionExpression,a),e.createDelete=e.Debug.deprecate(e.factory.createDeleteExpression,a),e.updateDelete=e.Debug.deprecate(e.factory.updateDeleteExpression,a),e.createTypeOf=e.Debug.deprecate(e.factory.createTypeOfExpression,a),e.updateTypeOf=e.Debug.deprecate(e.factory.updateTypeOfExpression,a),e.createVoid=e.Debug.deprecate(e.factory.createVoidExpression,a),e.updateVoid=e.Debug.deprecate(e.factory.updateVoidExpression,a),e.createAwait=e.Debug.deprecate(e.factory.createAwaitExpression,a),e.updateAwait=e.Debug.deprecate(e.factory.updateAwaitExpression,a),e.createPrefix=e.Debug.deprecate(e.factory.createPrefixUnaryExpression,a),e.updatePrefix=e.Debug.deprecate(e.factory.updatePrefixUnaryExpression,a),e.createPostfix=e.Debug.deprecate(e.factory.createPostfixUnaryExpression,a),e.updatePostfix=e.Debug.deprecate(e.factory.updatePostfixUnaryExpression,a),e.createBinary=e.Debug.deprecate(e.factory.createBinaryExpression,a),e.updateConditional=e.Debug.deprecate(e.factory.updateConditionalExpression,a),e.createTemplateExpression=e.Debug.deprecate(e.factory.createTemplateExpression,a),e.updateTemplateExpression=e.Debug.deprecate(e.factory.updateTemplateExpression,a),e.createTemplateHead=e.Debug.deprecate(e.factory.createTemplateHead,a),e.createTemplateMiddle=e.Debug.deprecate(e.factory.createTemplateMiddle,a),e.createTemplateTail=e.Debug.deprecate(e.factory.createTemplateTail,a),e.createNoSubstitutionTemplateLiteral=e.Debug.deprecate(e.factory.createNoSubstitutionTemplateLiteral,a),e.updateYield=e.Debug.deprecate(e.factory.updateYieldExpression,a),e.createSpread=e.Debug.deprecate(e.factory.createSpreadElement,a),e.updateSpread=e.Debug.deprecate(e.factory.updateSpreadElement,a),e.createOmittedExpression=e.Debug.deprecate(e.factory.createOmittedExpression,a),e.createAsExpression=e.Debug.deprecate(e.factory.createAsExpression,a),e.updateAsExpression=e.Debug.deprecate(e.factory.updateAsExpression,a),e.createNonNullExpression=e.Debug.deprecate(e.factory.createNonNullExpression,a),e.updateNonNullExpression=e.Debug.deprecate(e.factory.updateNonNullExpression,a),e.createNonNullChain=e.Debug.deprecate(e.factory.createNonNullChain,a),e.updateNonNullChain=e.Debug.deprecate(e.factory.updateNonNullChain,a),e.createMetaProperty=e.Debug.deprecate(e.factory.createMetaProperty,a),e.updateMetaProperty=e.Debug.deprecate(e.factory.updateMetaProperty,a),e.createTemplateSpan=e.Debug.deprecate(e.factory.createTemplateSpan,a),e.updateTemplateSpan=e.Debug.deprecate(e.factory.updateTemplateSpan,a),e.createSemicolonClassElement=e.Debug.deprecate(e.factory.createSemicolonClassElement,a),e.createBlock=e.Debug.deprecate(e.factory.createBlock,a),e.updateBlock=e.Debug.deprecate(e.factory.updateBlock,a),e.createVariableStatement=e.Debug.deprecate(e.factory.createVariableStatement,a),e.updateVariableStatement=e.Debug.deprecate(e.factory.updateVariableStatement,a),e.createEmptyStatement=e.Debug.deprecate(e.factory.createEmptyStatement,a),e.createExpressionStatement=e.Debug.deprecate(e.factory.createExpressionStatement,a),e.updateExpressionStatement=e.Debug.deprecate(e.factory.updateExpressionStatement,a),e.createStatement=e.Debug.deprecate(e.factory.createExpressionStatement,a),e.updateStatement=e.Debug.deprecate(e.factory.updateExpressionStatement,a),e.createIf=e.Debug.deprecate(e.factory.createIfStatement,a),e.updateIf=e.Debug.deprecate(e.factory.updateIfStatement,a),e.createDo=e.Debug.deprecate(e.factory.createDoStatement,a),e.updateDo=e.Debug.deprecate(e.factory.updateDoStatement,a),e.createWhile=e.Debug.deprecate(e.factory.createWhileStatement,a),e.updateWhile=e.Debug.deprecate(e.factory.updateWhileStatement,a),e.createFor=e.Debug.deprecate(e.factory.createForStatement,a),e.updateFor=e.Debug.deprecate(e.factory.updateForStatement,a),e.createForIn=e.Debug.deprecate(e.factory.createForInStatement,a),e.updateForIn=e.Debug.deprecate(e.factory.updateForInStatement,a),e.createForOf=e.Debug.deprecate(e.factory.createForOfStatement,a),e.updateForOf=e.Debug.deprecate(e.factory.updateForOfStatement,a),e.createContinue=e.Debug.deprecate(e.factory.createContinueStatement,a),e.updateContinue=e.Debug.deprecate(e.factory.updateContinueStatement,a),e.createBreak=e.Debug.deprecate(e.factory.createBreakStatement,a),e.updateBreak=e.Debug.deprecate(e.factory.updateBreakStatement,a),e.createReturn=e.Debug.deprecate(e.factory.createReturnStatement,a),e.updateReturn=e.Debug.deprecate(e.factory.updateReturnStatement,a),e.createWith=e.Debug.deprecate(e.factory.createWithStatement,a),e.updateWith=e.Debug.deprecate(e.factory.updateWithStatement,a),e.createSwitch=e.Debug.deprecate(e.factory.createSwitchStatement,a),e.updateSwitch=e.Debug.deprecate(e.factory.updateSwitchStatement,a),e.createLabel=e.Debug.deprecate(e.factory.createLabeledStatement,a),e.updateLabel=e.Debug.deprecate(e.factory.updateLabeledStatement,a),e.createThrow=e.Debug.deprecate(e.factory.createThrowStatement,a),e.updateThrow=e.Debug.deprecate(e.factory.updateThrowStatement,a),e.createTry=e.Debug.deprecate(e.factory.createTryStatement,a),e.updateTry=e.Debug.deprecate(e.factory.updateTryStatement,a),e.createDebuggerStatement=e.Debug.deprecate(e.factory.createDebuggerStatement,a),e.createVariableDeclarationList=e.Debug.deprecate(e.factory.createVariableDeclarationList,a),e.updateVariableDeclarationList=e.Debug.deprecate(e.factory.updateVariableDeclarationList,a),e.createFunctionDeclaration=e.Debug.deprecate(e.factory.createFunctionDeclaration,a),e.updateFunctionDeclaration=e.Debug.deprecate(e.factory.updateFunctionDeclaration,a),e.createClassDeclaration=e.Debug.deprecate(e.factory.createClassDeclaration,a),e.updateClassDeclaration=e.Debug.deprecate(e.factory.updateClassDeclaration,a),e.createInterfaceDeclaration=e.Debug.deprecate(e.factory.createInterfaceDeclaration,a),e.updateInterfaceDeclaration=e.Debug.deprecate(e.factory.updateInterfaceDeclaration,a),e.createTypeAliasDeclaration=e.Debug.deprecate(e.factory.createTypeAliasDeclaration,a),e.updateTypeAliasDeclaration=e.Debug.deprecate(e.factory.updateTypeAliasDeclaration,a),e.createEnumDeclaration=e.Debug.deprecate(e.factory.createEnumDeclaration,a),e.updateEnumDeclaration=e.Debug.deprecate(e.factory.updateEnumDeclaration,a),e.createModuleDeclaration=e.Debug.deprecate(e.factory.createModuleDeclaration,a),e.updateModuleDeclaration=e.Debug.deprecate(e.factory.updateModuleDeclaration,a),e.createModuleBlock=e.Debug.deprecate(e.factory.createModuleBlock,a),e.updateModuleBlock=e.Debug.deprecate(e.factory.updateModuleBlock,a),e.createCaseBlock=e.Debug.deprecate(e.factory.createCaseBlock,a),e.updateCaseBlock=e.Debug.deprecate(e.factory.updateCaseBlock,a),e.createNamespaceExportDeclaration=e.Debug.deprecate(e.factory.createNamespaceExportDeclaration,a),e.updateNamespaceExportDeclaration=e.Debug.deprecate(e.factory.updateNamespaceExportDeclaration,a),e.createImportEqualsDeclaration=e.Debug.deprecate(e.factory.createImportEqualsDeclaration,a),e.updateImportEqualsDeclaration=e.Debug.deprecate(e.factory.updateImportEqualsDeclaration,a),e.createImportDeclaration=e.Debug.deprecate(e.factory.createImportDeclaration,a),e.updateImportDeclaration=e.Debug.deprecate(e.factory.updateImportDeclaration,a),e.createNamespaceImport=e.Debug.deprecate(e.factory.createNamespaceImport,a),e.updateNamespaceImport=e.Debug.deprecate(e.factory.updateNamespaceImport,a),e.createNamedImports=e.Debug.deprecate(e.factory.createNamedImports,a),e.updateNamedImports=e.Debug.deprecate(e.factory.updateNamedImports,a),e.createImportSpecifier=e.Debug.deprecate(e.factory.createImportSpecifier,a),e.updateImportSpecifier=e.Debug.deprecate(e.factory.updateImportSpecifier,a),e.createExportAssignment=e.Debug.deprecate(e.factory.createExportAssignment,a),e.updateExportAssignment=e.Debug.deprecate(e.factory.updateExportAssignment,a),e.createNamedExports=e.Debug.deprecate(e.factory.createNamedExports,a),e.updateNamedExports=e.Debug.deprecate(e.factory.updateNamedExports,a),e.createExportSpecifier=e.Debug.deprecate(e.factory.createExportSpecifier,a),e.updateExportSpecifier=e.Debug.deprecate(e.factory.updateExportSpecifier,a),e.createExternalModuleReference=e.Debug.deprecate(e.factory.createExternalModuleReference,a),e.updateExternalModuleReference=e.Debug.deprecate(e.factory.updateExternalModuleReference,a),e.createJSDocTypeExpression=e.Debug.deprecate(e.factory.createJSDocTypeExpression,a),e.createJSDocTypeTag=e.Debug.deprecate(e.factory.createJSDocTypeTag,a),e.createJSDocReturnTag=e.Debug.deprecate(e.factory.createJSDocReturnTag,a),e.createJSDocThisTag=e.Debug.deprecate(e.factory.createJSDocThisTag,a),e.createJSDocComment=e.Debug.deprecate(e.factory.createJSDocComment,a),e.createJSDocParameterTag=e.Debug.deprecate(e.factory.createJSDocParameterTag,a),e.createJSDocClassTag=e.Debug.deprecate(e.factory.createJSDocClassTag,a),e.createJSDocAugmentsTag=e.Debug.deprecate(e.factory.createJSDocAugmentsTag,a),e.createJSDocEnumTag=e.Debug.deprecate(e.factory.createJSDocEnumTag,a),e.createJSDocTemplateTag=e.Debug.deprecate(e.factory.createJSDocTemplateTag,a),e.createJSDocTypedefTag=e.Debug.deprecate(e.factory.createJSDocTypedefTag,a),e.createJSDocCallbackTag=e.Debug.deprecate(e.factory.createJSDocCallbackTag,a),e.createJSDocSignature=e.Debug.deprecate(e.factory.createJSDocSignature,a),e.createJSDocPropertyTag=e.Debug.deprecate(e.factory.createJSDocPropertyTag,a),e.createJSDocTypeLiteral=e.Debug.deprecate(e.factory.createJSDocTypeLiteral,a),e.createJSDocImplementsTag=e.Debug.deprecate(e.factory.createJSDocImplementsTag,a),e.createJSDocAuthorTag=e.Debug.deprecate(e.factory.createJSDocAuthorTag,a),e.createJSDocPublicTag=e.Debug.deprecate(e.factory.createJSDocPublicTag,a),e.createJSDocPrivateTag=e.Debug.deprecate(e.factory.createJSDocPrivateTag,a),e.createJSDocProtectedTag=e.Debug.deprecate(e.factory.createJSDocProtectedTag,a),e.createJSDocReadonlyTag=e.Debug.deprecate(e.factory.createJSDocReadonlyTag,a),e.createJSDocTag=e.Debug.deprecate(e.factory.createJSDocUnknownTag,a),e.createJsxElement=e.Debug.deprecate(e.factory.createJsxElement,a),e.updateJsxElement=e.Debug.deprecate(e.factory.updateJsxElement,a),e.createJsxSelfClosingElement=e.Debug.deprecate(e.factory.createJsxSelfClosingElement,a),e.updateJsxSelfClosingElement=e.Debug.deprecate(e.factory.updateJsxSelfClosingElement,a),e.createJsxOpeningElement=e.Debug.deprecate(e.factory.createJsxOpeningElement,a),e.updateJsxOpeningElement=e.Debug.deprecate(e.factory.updateJsxOpeningElement,a),e.createJsxClosingElement=e.Debug.deprecate(e.factory.createJsxClosingElement,a),e.updateJsxClosingElement=e.Debug.deprecate(e.factory.updateJsxClosingElement,a),e.createJsxFragment=e.Debug.deprecate(e.factory.createJsxFragment,a),e.createJsxText=e.Debug.deprecate(e.factory.createJsxText,a),e.updateJsxText=e.Debug.deprecate(e.factory.updateJsxText,a),e.createJsxOpeningFragment=e.Debug.deprecate(e.factory.createJsxOpeningFragment,a),e.createJsxJsxClosingFragment=e.Debug.deprecate(e.factory.createJsxJsxClosingFragment,a),e.updateJsxFragment=e.Debug.deprecate(e.factory.updateJsxFragment,a),e.createJsxAttribute=e.Debug.deprecate(e.factory.createJsxAttribute,a),e.updateJsxAttribute=e.Debug.deprecate(e.factory.updateJsxAttribute,a),e.createJsxAttributes=e.Debug.deprecate(e.factory.createJsxAttributes,a),e.updateJsxAttributes=e.Debug.deprecate(e.factory.updateJsxAttributes,a),e.createJsxSpreadAttribute=e.Debug.deprecate(e.factory.createJsxSpreadAttribute,a),e.updateJsxSpreadAttribute=e.Debug.deprecate(e.factory.updateJsxSpreadAttribute,a),e.createJsxExpression=e.Debug.deprecate(e.factory.createJsxExpression,a),e.updateJsxExpression=e.Debug.deprecate(e.factory.updateJsxExpression,a),e.createCaseClause=e.Debug.deprecate(e.factory.createCaseClause,a),e.updateCaseClause=e.Debug.deprecate(e.factory.updateCaseClause,a),e.createDefaultClause=e.Debug.deprecate(e.factory.createDefaultClause,a),e.updateDefaultClause=e.Debug.deprecate(e.factory.updateDefaultClause,a),e.createHeritageClause=e.Debug.deprecate(e.factory.createHeritageClause,a),e.updateHeritageClause=e.Debug.deprecate(e.factory.updateHeritageClause,a),e.createCatchClause=e.Debug.deprecate(e.factory.createCatchClause,a),e.updateCatchClause=e.Debug.deprecate(e.factory.updateCatchClause,a),e.createPropertyAssignment=e.Debug.deprecate(e.factory.createPropertyAssignment,a),e.updatePropertyAssignment=e.Debug.deprecate(e.factory.updatePropertyAssignment,a),e.createShorthandPropertyAssignment=e.Debug.deprecate(e.factory.createShorthandPropertyAssignment,a),e.updateShorthandPropertyAssignment=e.Debug.deprecate(e.factory.updateShorthandPropertyAssignment,a),e.createSpreadAssignment=e.Debug.deprecate(e.factory.createSpreadAssignment,a),e.updateSpreadAssignment=e.Debug.deprecate(e.factory.updateSpreadAssignment,a),e.createEnumMember=e.Debug.deprecate(e.factory.createEnumMember,a),e.updateEnumMember=e.Debug.deprecate(e.factory.updateEnumMember,a),e.updateSourceFileNode=e.Debug.deprecate(e.factory.updateSourceFile,a),e.createNotEmittedStatement=e.Debug.deprecate(e.factory.createNotEmittedStatement,a),e.createPartiallyEmittedExpression=e.Debug.deprecate(e.factory.createPartiallyEmittedExpression,a),e.updatePartiallyEmittedExpression=e.Debug.deprecate(e.factory.updatePartiallyEmittedExpression,a),e.createCommaList=e.Debug.deprecate(e.factory.createCommaListExpression,a),e.updateCommaList=e.Debug.deprecate(e.factory.updateCommaListExpression,a),e.createBundle=e.Debug.deprecate(e.factory.createBundle,a),e.updateBundle=e.Debug.deprecate(e.factory.updateBundle,a),e.createImmediatelyInvokedFunctionExpression=e.Debug.deprecate(e.factory.createImmediatelyInvokedFunctionExpression,a),e.createImmediatelyInvokedArrowFunction=e.Debug.deprecate(e.factory.createImmediatelyInvokedArrowFunction,a),e.createVoidZero=e.Debug.deprecate(e.factory.createVoidZero,a),e.createExportDefault=e.Debug.deprecate(e.factory.createExportDefault,a),e.createExternalModuleExport=e.Debug.deprecate(e.factory.createExternalModuleExport,a),e.createNamespaceExport=e.Debug.deprecate(e.factory.createNamespaceExport,a),e.updateNamespaceExport=e.Debug.deprecate(e.factory.updateNamespaceExport,a),e.createToken=e.Debug.deprecate(n(function(v){return e.factory.createToken(v)},"createToken"),a),e.createIdentifier=e.Debug.deprecate(n(function(v){return e.factory.createIdentifier(v,void 0,void 0)},"createIdentifier"),a),e.createTempVariable=e.Debug.deprecate(n(function(v){return e.factory.createTempVariable(v,void 0)},"createTempVariable"),a),e.getGeneratedNameForNode=e.Debug.deprecate(n(function(v){return e.factory.getGeneratedNameForNode(v,void 0)},"getGeneratedNameForNode"),a),e.createOptimisticUniqueName=e.Debug.deprecate(n(function(v){return e.factory.createUniqueName(v,16)},"createOptimisticUniqueName"),a),e.createFileLevelUniqueName=e.Debug.deprecate(n(function(v){return e.factory.createUniqueName(v,48)},"createFileLevelUniqueName"),a),e.createIndexSignature=e.Debug.deprecate(n(function(v,O,h,B){return e.factory.createIndexSignature(v,O,h,B)},"createIndexSignature"),a),e.createTypePredicateNode=e.Debug.deprecate(n(function(v,O){return e.factory.createTypePredicateNode(void 0,v,O)},"createTypePredicateNode"),a),e.updateTypePredicateNode=e.Debug.deprecate(n(function(v,O,h){return e.factory.updateTypePredicateNode(v,void 0,O,h)},"updateTypePredicateNode"),a),e.createLiteral=e.Debug.deprecate(n(function(v){return typeof v=="number"?e.factory.createNumericLiteral(v):typeof v=="object"&&"base10Value"in v?e.factory.createBigIntLiteral(v):typeof v=="boolean"?v?e.factory.createTrue():e.factory.createFalse():typeof v=="string"?e.factory.createStringLiteral(v,void 0):e.factory.createStringLiteralFromNode(v)},"createLiteral"),{since:"4.0",warnAfter:"4.1",message:"Use `factory.createStringLiteral`, `factory.createStringLiteralFromNode`, `factory.createNumericLiteral`, `factory.createBigIntLiteral`, `factory.createTrue`, `factory.createFalse`, or the factory supplied by your transformation context instead."}),e.createMethodSignature=e.Debug.deprecate(n(function(v,O,h,B,re){return e.factory.createMethodSignature(void 0,B,re,v,O,h)},"createMethodSignature"),a),e.updateMethodSignature=e.Debug.deprecate(n(function(v,O,h,B,re,z){return e.factory.updateMethodSignature(v,v.modifiers,re,z,O,h,B)},"updateMethodSignature"),a),e.createTypeOperatorNode=e.Debug.deprecate(n(function(v,O){var h;return O?h=v:(O=v,h=141),e.factory.createTypeOperatorNode(h,O)},"createTypeOperatorNode"),a),e.createTaggedTemplate=e.Debug.deprecate(n(function(v,O,h){var B;return h?B=O:h=O,e.factory.createTaggedTemplateExpression(v,B,h)},"createTaggedTemplate"),a),e.updateTaggedTemplate=e.Debug.deprecate(n(function(v,O,h,B){var re;return B?re=h:B=h,e.factory.updateTaggedTemplateExpression(v,O,re,B)},"updateTaggedTemplate"),a),e.updateBinary=e.Debug.deprecate(n(function(v,O,h,B){return B===void 0&&(B=v.operatorToken),typeof B=="number"&&(B=B===v.operatorToken.kind?v.operatorToken:e.factory.createToken(B)),e.factory.updateBinaryExpression(v,O,B,h)},"updateBinary"),a),e.createConditional=e.Debug.deprecate(n(function(v,O,h,B,re){return arguments.length===5?e.factory.createConditionalExpression(v,O,h,B,re):arguments.length===3?e.factory.createConditionalExpression(v,e.factory.createToken(57),O,e.factory.createToken(58),h):e.Debug.fail("Argument count mismatch")},"createConditional"),a),e.createYield=e.Debug.deprecate(n(function(v,O){var h;return O?h=v:O=v,e.factory.createYieldExpression(h,O)},"createYield"),a),e.createClassExpression=e.Debug.deprecate(n(function(v,O,h,B,re){return e.factory.createClassExpression(void 0,v,O,h,B,re)},"createClassExpression"),a),e.updateClassExpression=e.Debug.deprecate(n(function(v,O,h,B,re,z){return e.factory.updateClassExpression(v,void 0,O,h,B,re,z)},"updateClassExpression"),a),e.createPropertySignature=e.Debug.deprecate(n(function(v,O,h,B,re){var z=e.factory.createPropertySignature(v,O,h,B);return z.initializer=re,z},"createPropertySignature"),a),e.updatePropertySignature=e.Debug.deprecate(n(function(v,O,h,B,re,z){var p=e.factory.updatePropertySignature(v,O,h,B,re);return v.initializer!==z&&(p===v&&(p=e.factory.cloneNode(v)),p.initializer=z),p},"updatePropertySignature"),a),e.createExpressionWithTypeArguments=e.Debug.deprecate(n(function(v,O){return e.factory.createExpressionWithTypeArguments(O,v)},"createExpressionWithTypeArguments"),a),e.updateExpressionWithTypeArguments=e.Debug.deprecate(n(function(v,O,h){return e.factory.updateExpressionWithTypeArguments(v,h,O)},"updateExpressionWithTypeArguments"),a),e.createArrowFunction=e.Debug.deprecate(n(function(v,O,h,B,re,z){return arguments.length===6?e.factory.createArrowFunction(v,O,h,B,re,z):arguments.length===5?e.factory.createArrowFunction(v,O,h,B,void 0,re):e.Debug.fail("Argument count mismatch")},"createArrowFunction"),a),e.updateArrowFunction=e.Debug.deprecate(n(function(v,O,h,B,re,z,p){return arguments.length===7?e.factory.updateArrowFunction(v,O,h,B,re,z,p):arguments.length===6?e.factory.updateArrowFunction(v,O,h,B,re,v.equalsGreaterThanToken,z):e.Debug.fail("Argument count mismatch")},"updateArrowFunction"),a),e.createVariableDeclaration=e.Debug.deprecate(n(function(v,O,h,B){return arguments.length===4?e.factory.createVariableDeclaration(v,O,h,B):arguments.length>=1&&arguments.length<=3?e.factory.createVariableDeclaration(v,void 0,O,h):e.Debug.fail("Argument count mismatch")},"createVariableDeclaration"),a),e.updateVariableDeclaration=e.Debug.deprecate(n(function(v,O,h,B,re){return arguments.length===5?e.factory.updateVariableDeclaration(v,O,h,B,re):arguments.length===4?e.factory.updateVariableDeclaration(v,O,v.exclamationToken,h,B):e.Debug.fail("Argument count mismatch")},"updateVariableDeclaration"),a),e.createImportClause=e.Debug.deprecate(n(function(v,O,h){return h===void 0&&(h=!1),e.factory.createImportClause(h,v,O)},"createImportClause"),a),e.updateImportClause=e.Debug.deprecate(n(function(v,O,h,B){return e.factory.updateImportClause(v,B,O,h)},"updateImportClause"),a),e.createExportDeclaration=e.Debug.deprecate(n(function(v,O,h,B,re){return re===void 0&&(re=!1),e.factory.createExportDeclaration(v,O,re,h,B)},"createExportDeclaration"),a),e.updateExportDeclaration=e.Debug.deprecate(n(function(v,O,h,B,re,z){return e.factory.updateExportDeclaration(v,O,h,z,B,re,v.assertClause)},"updateExportDeclaration"),a),e.createJSDocParamTag=e.Debug.deprecate(n(function(v,O,h,B){return e.factory.createJSDocParameterTag(void 0,v,O,h,!1,B?e.factory.createNodeArray([e.factory.createJSDocText(B)]):void 0)},"createJSDocParamTag"),a),e.createComma=e.Debug.deprecate(n(function(v,O){return e.factory.createComma(v,O)},"createComma"),a),e.createLessThan=e.Debug.deprecate(n(function(v,O){return e.factory.createLessThan(v,O)},"createLessThan"),a),e.createAssignment=e.Debug.deprecate(n(function(v,O){return e.factory.createAssignment(v,O)},"createAssignment"),a),e.createStrictEquality=e.Debug.deprecate(n(function(v,O){return e.factory.createStrictEquality(v,O)},"createStrictEquality"),a),e.createStrictInequality=e.Debug.deprecate(n(function(v,O){return e.factory.createStrictInequality(v,O)},"createStrictInequality"),a),e.createAdd=e.Debug.deprecate(n(function(v,O){return e.factory.createAdd(v,O)},"createAdd"),a),e.createSubtract=e.Debug.deprecate(n(function(v,O){return e.factory.createSubtract(v,O)},"createSubtract"),a),e.createLogicalAnd=e.Debug.deprecate(n(function(v,O){return e.factory.createLogicalAnd(v,O)},"createLogicalAnd"),a),e.createLogicalOr=e.Debug.deprecate(n(function(v,O){return e.factory.createLogicalOr(v,O)},"createLogicalOr"),a),e.createPostfixIncrement=e.Debug.deprecate(n(function(v){return e.factory.createPostfixIncrement(v)},"createPostfixIncrement"),a),e.createLogicalNot=e.Debug.deprecate(n(function(v){return e.factory.createLogicalNot(v)},"createLogicalNot"),a),e.createNode=e.Debug.deprecate(n(function(v,O,h){return O===void 0&&(O=0),h===void 0&&(h=0),e.setTextRangePosEnd(v===308?e.parseBaseNodeFactory.createBaseSourceFileNode(v):v===79?e.parseBaseNodeFactory.createBaseIdentifierNode(v):v===80?e.parseBaseNodeFactory.createBasePrivateIdentifierNode(v):e.isNodeKind(v)?e.parseBaseNodeFactory.createBaseNode(v):e.parseBaseNodeFactory.createBaseTokenNode(v),O,h)},"createNode"),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory` method instead."}),e.getMutableClone=e.Debug.deprecate(n(function(v){var O=e.factory.cloneNode(v);return e.setTextRange(O,v),e.setParent(O,v.parent),O},"getMutableClone"),{since:"4.0",warnAfter:"4.1",message:"Use an appropriate `factory.update...` method instead, use `setCommentRange` or `setSourceMapRange`, and avoid setting `parent`."})})(_r||(_r={}));var _r;(function(e){e.isTypeAssertion=e.Debug.deprecate(n(function(y){return y.kind===213},"isTypeAssertion"),{since:"4.0",warnAfter:"4.1",message:"Use `isTypeAssertionExpression` instead."})})(_r||(_r={}));var _r;(function(e){e.isIdentifierOrPrivateIdentifier=e.Debug.deprecate(n(function(y){return e.isMemberName(y)},"isIdentifierOrPrivateIdentifier"),{since:"4.2",warnAfter:"4.3",message:"Use `isMemberName` instead."})})(_r||(_r={}));var _r;(function(e){function a(v){var O=v.createConstructorTypeNode,h=v.updateConstructorTypeNode;v.createConstructorTypeNode=e.buildOverload("createConstructorTypeNode").overload({0:function(B,re,z,p){return O(B,re,z,p)},1:function(B,re,z){return O(void 0,B,re,z)}}).bind({0:function(B){return B.length===4},1:function(B){return B.length===3}}).deprecate({1:{since:"4.2",warnAfter:"4.3",message:"Use the overload that accepts 'modifiers'"}}).finish(),v.updateConstructorTypeNode=e.buildOverload("updateConstructorTypeNode").overload({0:function(B,re,z,p,m){return h(B,re,z,p,m)},1:function(B,re,z,p){return h(B,B.modifiers,re,z,p)}}).bind({0:function(B){return B.length===5},1:function(B){return B.length===4}}).deprecate({1:{since:"4.2",warnAfter:"4.3",message:"Use the overload that accepts 'modifiers'"}}).finish()}n(a,"patchNodeFactory");var y=e.createNodeFactory;e.createNodeFactory=function(v,O){var h=y(v,O);return a(h),h},a(e.factory)})(_r||(_r={}));var _r;(function(e){function a(v){var O=v.createImportTypeNode,h=v.updateImportTypeNode;v.createImportTypeNode=e.buildOverload("createImportTypeNode").overload({0:function(B,re,z,p,m){return O(B,re,z,p,m)},1:function(B,re,z,p){return O(B,void 0,re,z,p)}}).bind({0:function(B){var re=B[1],z=B[2],p=B[3],m=B[4];return(re===void 0||e.isImportTypeAssertionContainer(re))&&(z===void 0||!e.isArray(z))&&(p===void 0||e.isArray(p))&&(m===void 0||typeof m=="boolean")},1:function(B){var re=B[1],z=B[2],p=B[3],m=B[4];return m===void 0&&(re===void 0||e.isEntityName(re))&&(z===void 0||e.isArray(z))&&(p===void 0||typeof p=="boolean")}}).deprecate({1:{since:"4.6",warnAfter:"4.7",message:"Use the overload that accepts 'assertions'"}}).finish(),v.updateImportTypeNode=e.buildOverload("updateImportTypeNode").overload({0:function(B,re,z,p,m,fe){return h(B,re,z,p,m,fe)},1:function(B,re,z,p,m){return h(B,re,B.assertions,z,p,m)}}).bind({0:function(B){var re=B[2],z=B[3],p=B[4],m=B[5];return(re===void 0||e.isImportTypeAssertionContainer(re))&&(z===void 0||!e.isArray(z))&&(p===void 0||e.isArray(p))&&(m===void 0||typeof m=="boolean")},1:function(B){var re=B[2],z=B[3],p=B[4],m=B[5];return m===void 0&&(re===void 0||e.isEntityName(re))&&(z===void 0||e.isArray(z))&&(p===void 0||typeof p=="boolean")}}).deprecate({1:{since:"4.6",warnAfter:"4.7",message:"Use the overload that accepts 'assertions'"}}).finish()}n(a,"patchNodeFactory");var y=e.createNodeFactory;e.createNodeFactory=function(v,O){var h=y(v,O);return a(h),h},a(e.factory)})(_r||(_r={}));var _r;(function(e){function a(v){var O=v.createTypeParameterDeclaration,h=v.updateTypeParameterDeclaration;v.createTypeParameterDeclaration=e.buildOverload("createTypeParameterDeclaration").overload({0:function(B,re,z,p){return O(B,re,z,p)},1:function(B,re,z){return O(void 0,B,re,z)}}).bind({0:function(B){var re=B[0];return re===void 0||e.isArray(re)},1:function(B){var re=B[0];return re!==void 0&&!e.isArray(re)}}).deprecate({1:{since:"4.7",warnAfter:"4.8",message:"Use the overload that accepts 'modifiers'"}}).finish(),v.updateTypeParameterDeclaration=e.buildOverload("updateTypeParameterDeclaration").overload({0:function(B,re,z,p,m){return h(B,re,z,p,m)},1:function(B,re,z,p){return h(B,B.modifiers,re,z,p)}}).bind({0:function(B){var re=B[1];return re===void 0||e.isArray(re)},1:function(B){var re=B[1];return re!==void 0&&!e.isArray(re)}}).deprecate({1:{since:"4.7",warnAfter:"4.8",message:"Use the overload that accepts 'modifiers'"}}).finish()}n(a,"patchNodeFactory");var y=e.createNodeFactory;e.createNodeFactory=function(v,O){var h=y(v,O);return a(h),h},a(e.factory)})(_r||(_r={}));var _r;(function(e){var a={since:"4.8",warnAfter:"4.9.0-0",message:"Decorators have been combined with modifiers. Callers should switch to an overload that does not accept a 'decorators' parameter."},y={since:"4.8",warnAfter:"4.9.0-0",message:"Decorators are no longer supported for this function. Callers should switch to an overload that does not accept a 'decorators' parameter."},v={since:"4.8",warnAfter:"4.9.0-0",message:"Decorators and modifiers are no longer supported for this function. Callers should switch to an overload that does not accept the 'decorators' and 'modifiers' parameters."};function O(B){var re=B.createParameterDeclaration,z=B.updateParameterDeclaration,p=B.createPropertyDeclaration,m=B.updatePropertyDeclaration,fe=B.createMethodDeclaration,le=B.updateMethodDeclaration,se=B.createConstructorDeclaration,ce=B.updateConstructorDeclaration,ue=B.createGetAccessorDeclaration,F=B.updateGetAccessorDeclaration,L=B.createSetAccessorDeclaration,_=B.updateSetAccessorDeclaration,b=B.createIndexSignature,x=B.updateIndexSignature,E=B.createClassStaticBlockDeclaration,P=B.updateClassStaticBlockDeclaration,A=B.createClassExpression,ve=B.updateClassExpression,be=B.createFunctionDeclaration,Z=B.updateFunctionDeclaration,J=B.createClassDeclaration,$=B.updateClassDeclaration,Y=B.createInterfaceDeclaration,C=B.updateInterfaceDeclaration,j=B.createTypeAliasDeclaration,ae=B.updateTypeAliasDeclaration,U=B.createEnumDeclaration,M=B.updateEnumDeclaration,w=B.createModuleDeclaration,G=B.updateModuleDeclaration,X=B.createImportEqualsDeclaration,ee=B.updateImportEqualsDeclaration,De=B.createImportDeclaration,T=B.updateImportDeclaration,k=B.createExportAssignment,N=B.updateExportAssignment,ie=B.createExportDeclaration,V=B.updateExportDeclaration;B.createParameterDeclaration=e.buildOverload("createParameterDeclaration").overload({0:function(l,I,R,K,H,me){return re(l,I,R,K,H,me)},1:function(l,I,R,K,H,me,ge){return re(e.concatenate(l,I),R,K,H,me,ge)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5],ge=l[6];return ge===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||typeof R=="string"||e.isBindingName(R))&&(K===void 0||typeof K=="object"&&e.isQuestionToken(K))&&(H===void 0||e.isTypeNode(H))&&(me===void 0||e.isExpression(me))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5],ge=l[6];return(I===void 0||e.isArray(I))&&(R===void 0||typeof R=="object"&&e.isDotDotDotToken(R))&&(K===void 0||typeof K=="string"||e.isBindingName(K))&&(H===void 0||e.isQuestionToken(H))&&(me===void 0||e.isTypeNode(me))&&(ge===void 0||e.isExpression(ge))}}).deprecate({1:a}).finish(),B.updateParameterDeclaration=e.buildOverload("updateParameterDeclaration").overload({0:function(l,I,R,K,H,me,ge){return z(l,I,R,K,H,me,ge)},1:function(l,I,R,K,H,me,ge,Ke){return z(l,e.concatenate(I,R),K,H,me,ge,Ke)}}).bind({0:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6],ge=l[7];return ge===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||typeof R=="string"||e.isBindingName(R))&&(K===void 0||typeof K=="object"&&e.isQuestionToken(K))&&(H===void 0||e.isTypeNode(H))&&(me===void 0||e.isExpression(me))},1:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6],ge=l[7];return(I===void 0||e.isArray(I))&&(R===void 0||typeof R=="object"&&e.isDotDotDotToken(R))&&(K===void 0||typeof K=="string"||e.isBindingName(K))&&(H===void 0||e.isQuestionToken(H))&&(me===void 0||e.isTypeNode(me))&&(ge===void 0||e.isExpression(ge))}}).deprecate({1:a}).finish(),B.createPropertyDeclaration=e.buildOverload("createPropertyDeclaration").overload({0:function(l,I,R,K,H){return p(l,I,R,K,H)},1:function(l,I,R,K,H,me){return p(e.concatenate(l,I),R,K,H,me)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return me===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||typeof R=="object"&&e.isQuestionOrExclamationToken(R))&&(K===void 0||e.isTypeNode(K))&&(H===void 0||e.isExpression(H))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return(I===void 0||e.isArray(I))&&(R===void 0||typeof R=="string"||e.isPropertyName(R))&&(K===void 0||e.isQuestionOrExclamationToken(K))&&(H===void 0||e.isTypeNode(H))&&(me===void 0||e.isExpression(me))}}).deprecate({1:a}).finish(),B.updatePropertyDeclaration=e.buildOverload("updatePropertyDeclaration").overload({0:function(l,I,R,K,H,me){return m(l,I,R,K,H,me)},1:function(l,I,R,K,H,me,ge){return m(l,e.concatenate(I,R),K,H,me,ge)}}).bind({0:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6];return me===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||typeof R=="object"&&e.isQuestionOrExclamationToken(R))&&(K===void 0||e.isTypeNode(K))&&(H===void 0||e.isExpression(H))},1:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6];return(I===void 0||e.isArray(I))&&(R===void 0||typeof R=="string"||e.isPropertyName(R))&&(K===void 0||e.isQuestionOrExclamationToken(K))&&(H===void 0||e.isTypeNode(H))&&(me===void 0||e.isExpression(me))}}).deprecate({1:a}).finish(),B.createMethodDeclaration=e.buildOverload("createMethodDeclaration").overload({0:function(l,I,R,K,H,me,ge,Ke){return fe(l,I,R,K,H,me,ge,Ke)},1:function(l,I,R,K,H,me,ge,Ke,je){return fe(e.concatenate(l,I),R,K,H,me,ge,Ke,je)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5],ge=l[6],Ke=l[7],je=l[8];return je===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||typeof R=="string"||e.isPropertyName(R))&&(K===void 0||typeof K=="object"&&e.isQuestionToken(K))&&(H===void 0||e.isArray(H))&&(me===void 0||!e.some(me,e.isTypeParameterDeclaration))&&(ge===void 0||!e.isArray(ge))&&(Ke===void 0||e.isBlock(Ke))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5],ge=l[6],Ke=l[7],je=l[8];return(I===void 0||e.isArray(I))&&(R===void 0||typeof R=="object"&&e.isAsteriskToken(R))&&(K===void 0||typeof K=="string"||e.isPropertyName(K))&&(H===void 0||!e.isArray(H))&&(me===void 0||!e.some(me,e.isParameter))&&(ge===void 0||e.isArray(ge))&&(Ke===void 0||e.isTypeNode(Ke))&&(je===void 0||e.isBlock(je))}}).deprecate({1:a}).finish(),B.updateMethodDeclaration=e.buildOverload("updateMethodDeclaration").overload({0:function(l,I,R,K,H,me,ge,Ke,je){return le(l,I,R,K,H,me,ge,Ke,je)},1:function(l,I,R,K,H,me,ge,Ke,je,Le){return le(l,e.concatenate(I,R),K,H,me,ge,Ke,je,Le)}}).bind({0:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6],ge=l[7],Ke=l[8],je=l[9];return je===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||typeof R=="string"||e.isPropertyName(R))&&(K===void 0||typeof K=="object"&&e.isQuestionToken(K))&&(H===void 0||e.isArray(H))&&(me===void 0||!e.some(me,e.isTypeParameterDeclaration))&&(ge===void 0||!e.isArray(ge))&&(Ke===void 0||e.isBlock(Ke))},1:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6],ge=l[7],Ke=l[8],je=l[9];return(I===void 0||e.isArray(I))&&(R===void 0||typeof R=="object"&&e.isAsteriskToken(R))&&(K===void 0||typeof K=="string"||e.isPropertyName(K))&&(H===void 0||!e.isArray(H))&&(me===void 0||!e.some(me,e.isParameter))&&(ge===void 0||e.isArray(ge))&&(Ke===void 0||e.isTypeNode(Ke))&&(je===void 0||e.isBlock(je))}}).deprecate({1:a}).finish(),B.createConstructorDeclaration=e.buildOverload("createConstructorDeclaration").overload({0:function(l,I,R){return se(l,I,R)},1:function(l,I,R,K){return se(I,R,K)}}).bind({0:function(l){var I=l[0],R=l[1],K=l[2],H=l[3];return H===void 0&&(I===void 0||!e.some(I,e.isDecorator))&&(R===void 0||!e.some(R,e.isModifier))&&(K===void 0||!e.isArray(K))},1:function(l){var I=l[0],R=l[1],K=l[2],H=l[3];return(I===void 0||!e.some(I,e.isModifier))&&(R===void 0||!e.some(R,e.isParameter))&&(K===void 0||e.isArray(K))&&(H===void 0||e.isBlock(H))}}).deprecate({1:y}).finish(),B.updateConstructorDeclaration=e.buildOverload("updateConstructorDeclaration").overload({0:function(l,I,R,K){return ce(l,I,R,K)},1:function(l,I,R,K,H){return ce(l,R,K,H)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4];return H===void 0&&(I===void 0||!e.some(I,e.isDecorator))&&(R===void 0||!e.some(R,e.isModifier))&&(K===void 0||!e.isArray(K))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4];return(I===void 0||!e.some(I,e.isModifier))&&(R===void 0||!e.some(R,e.isParameter))&&(K===void 0||e.isArray(K))&&(H===void 0||e.isBlock(H))}}).deprecate({1:y}).finish(),B.createGetAccessorDeclaration=e.buildOverload("createGetAccessorDeclaration").overload({0:function(l,I,R,K,H){return ue(l,I,R,K,H)},1:function(l,I,R,K,H,me){return ue(e.concatenate(l,I),R,K,H,me)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return me===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||e.isArray(R))&&(K===void 0||!e.isArray(K))&&(H===void 0||e.isBlock(H))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return(I===void 0||e.isArray(I))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isArray(K))&&(H===void 0||e.isTypeNode(H))&&(me===void 0||e.isBlock(me))}}).deprecate({1:a}).finish(),B.updateGetAccessorDeclaration=e.buildOverload("updateGetAccessorDeclaration").overload({0:function(l,I,R,K,H,me){return F(l,I,R,K,H,me)},1:function(l,I,R,K,H,me,ge){return F(l,e.concatenate(I,R),K,H,me,ge)}}).bind({0:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6];return me===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||e.isArray(R))&&(K===void 0||!e.isArray(K))&&(H===void 0||e.isBlock(H))},1:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6];return(I===void 0||e.isArray(I))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isArray(K))&&(H===void 0||e.isTypeNode(H))&&(me===void 0||e.isBlock(me))}}).deprecate({1:a}).finish(),B.createSetAccessorDeclaration=e.buildOverload("createSetAccessorDeclaration").overload({0:function(l,I,R,K){return L(l,I,R,K)},1:function(l,I,R,K,H){return L(e.concatenate(l,I),R,K,H)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4];return H===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||e.isArray(R))&&(K===void 0||!e.isArray(K))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4];return(I===void 0||e.isArray(I))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isArray(K))&&(H===void 0||e.isBlock(H))}}).deprecate({1:a}).finish(),B.updateSetAccessorDeclaration=e.buildOverload("updateSetAccessorDeclaration").overload({0:function(l,I,R,K,H){return _(l,I,R,K,H)},1:function(l,I,R,K,H,me){return _(l,e.concatenate(I,R),K,H,me)}}).bind({0:function(l){var I=l[2],R=l[3],K=l[4],H=l[5];return H===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||e.isArray(R))&&(K===void 0||!e.isArray(K))},1:function(l){var I=l[2],R=l[3],K=l[4],H=l[5];return(I===void 0||e.isArray(I))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isArray(K))&&(H===void 0||e.isBlock(H))}}).deprecate({1:a}).finish(),B.createIndexSignature=e.buildOverload("createIndexSignature").overload({0:function(l,I,R){return b(l,I,R)},1:function(l,I,R,K){return b(I,R,K)}}).bind({0:function(l){var I=l[0],R=l[1],K=l[2],H=l[3];return H===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||e.every(R,e.isParameter))&&(K===void 0||!e.isArray(K))},1:function(l){var I=l[0],R=l[1],K=l[2],H=l[3];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.every(R,e.isModifier))&&(K===void 0||e.isArray(K))&&(H===void 0||e.isTypeNode(H))}}).deprecate({1:y}).finish(),B.updateIndexSignature=e.buildOverload("updateIndexSignature").overload({0:function(l,I,R,K){return x(l,I,R,K)},1:function(l,I,R,K,H){return x(l,R,K,H)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4];return H===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||e.every(R,e.isParameter))&&(K===void 0||!e.isArray(K))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.every(R,e.isModifier))&&(K===void 0||e.isArray(K))&&(H===void 0||e.isTypeNode(H))}}).deprecate({1:y}).finish(),B.createClassStaticBlockDeclaration=e.buildOverload("createClassStaticBlockDeclaration").overload({0:function(l){return E(l)},1:function(l,I,R){return E(R)}}).bind({0:function(l){var I=l[0],R=l[1],K=l[2];return R===void 0&&K===void 0&&(I===void 0||!e.isArray(I))},1:function(l){var I=l[0],R=l[1],K=l[2];return(I===void 0||e.isArray(I))&&(R===void 0||e.isArray(I))&&(K===void 0||e.isBlock(K))}}).deprecate({1:v}).finish(),B.updateClassStaticBlockDeclaration=e.buildOverload("updateClassStaticBlockDeclaration").overload({0:function(l,I){return P(l,I)},1:function(l,I,R,K){return P(l,K)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3];return R===void 0&&K===void 0&&(I===void 0||!e.isArray(I))},1:function(l){var I=l[1],R=l[2],K=l[3];return(I===void 0||e.isArray(I))&&(R===void 0||e.isArray(I))&&(K===void 0||e.isBlock(K))}}).deprecate({1:v}).finish(),B.createClassExpression=e.buildOverload("createClassExpression").overload({0:function(l,I,R,K,H){return A(l,I,R,K,H)},1:function(l,I,R,K,H,me){return A(e.concatenate(l,I),R,K,H,me)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return me===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||e.isArray(R))&&(K===void 0||e.every(K,e.isHeritageClause))&&(H===void 0||e.every(H,e.isClassElement))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return(I===void 0||e.isArray(I))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.every(K,e.isTypeParameterDeclaration))&&(H===void 0||e.every(H,e.isHeritageClause))&&(me===void 0||e.isArray(me))}}).deprecate({1:y}).finish(),B.updateClassExpression=e.buildOverload("updateClassExpression").overload({0:function(l,I,R,K,H,me){return ve(l,I,R,K,H,me)},1:function(l,I,R,K,H,me,ge){return ve(l,e.concatenate(I,R),K,H,me,ge)}}).bind({0:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6];return me===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||e.isArray(R))&&(K===void 0||e.every(K,e.isHeritageClause))&&(H===void 0||e.every(H,e.isClassElement))},1:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6];return(I===void 0||e.isArray(I))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.every(K,e.isTypeParameterDeclaration))&&(H===void 0||e.every(H,e.isHeritageClause))&&(me===void 0||e.isArray(me))}}).deprecate({1:y}).finish(),B.createFunctionDeclaration=e.buildOverload("createFunctionDeclaration").overload({0:function(l,I,R,K,H,me,ge){return be(l,I,R,K,H,me,ge)},1:function(l,I,R,K,H,me,ge,Ke){return be(I,R,K,H,me,ge,Ke)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5],ge=l[6],Ke=l[7];return Ke===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||typeof R=="string"||e.isIdentifier(R))&&(K===void 0||e.isArray(K))&&(H===void 0||e.every(H,e.isParameter))&&(me===void 0||!e.isArray(me))&&(ge===void 0||e.isBlock(ge))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5],ge=l[6],Ke=l[7];return(I===void 0||e.isArray(I))&&(R===void 0||typeof R!="string"&&e.isAsteriskToken(R))&&(K===void 0||!e.isArray(K))&&(H===void 0||e.every(H,e.isTypeParameterDeclaration))&&(me===void 0||e.isArray(me))&&(ge===void 0||e.isTypeNode(ge))&&(Ke===void 0||e.isBlock(Ke))}}).deprecate({1:y}).finish(),B.updateFunctionDeclaration=e.buildOverload("updateFunctionDeclaration").overload({0:function(l,I,R,K,H,me,ge,Ke){return Z(l,I,R,K,H,me,ge,Ke)},1:function(l,I,R,K,H,me,ge,Ke,je){return Z(l,R,K,H,me,ge,Ke,je)}}).bind({0:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6],ge=l[7],Ke=l[8];return Ke===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||e.isIdentifier(R))&&(K===void 0||e.isArray(K))&&(H===void 0||e.every(H,e.isParameter))&&(me===void 0||!e.isArray(me))&&(ge===void 0||e.isBlock(ge))},1:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6],ge=l[7],Ke=l[8];return(I===void 0||e.isArray(I))&&(R===void 0||typeof R!="string"&&e.isAsteriskToken(R))&&(K===void 0||!e.isArray(K))&&(H===void 0||e.every(H,e.isTypeParameterDeclaration))&&(me===void 0||e.isArray(me))&&(ge===void 0||e.isTypeNode(ge))&&(Ke===void 0||e.isBlock(Ke))}}).deprecate({1:y}).finish(),B.createClassDeclaration=e.buildOverload("createClassDeclaration").overload({0:function(l,I,R,K,H){return J(l,I,R,K,H)},1:function(l,I,R,K,H,me){return J(e.concatenate(l,I),R,K,H,me)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return me===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||e.isArray(R))&&(K===void 0||e.every(K,e.isHeritageClause))&&(H===void 0||e.every(H,e.isClassElement))},1:function(){return!0}}).deprecate({1:a}).finish(),B.updateClassDeclaration=e.buildOverload("updateClassDeclaration").overload({0:function(l,I,R,K,H,me){return $(l,I,R,K,H,me)},1:function(l,I,R,K,H,me,ge){return $(l,e.concatenate(I,R),K,H,me,ge)}}).bind({0:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6];return me===void 0&&(I===void 0||!e.isArray(I))&&(R===void 0||e.isArray(R))&&(K===void 0||e.every(K,e.isHeritageClause))&&(H===void 0||e.every(H,e.isClassElement))},1:function(l){var I=l[2],R=l[3],K=l[4],H=l[5],me=l[6];return(I===void 0||e.isArray(I))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.every(K,e.isTypeParameterDeclaration))&&(H===void 0||e.every(H,e.isHeritageClause))&&(me===void 0||e.isArray(me))}}).deprecate({1:a}).finish(),B.createInterfaceDeclaration=e.buildOverload("createInterfaceDeclaration").overload({0:function(l,I,R,K,H){return Y(l,I,R,K,H)},1:function(l,I,R,K,H,me){return Y(I,R,K,H,me)}}).bind({0:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4],ge=l[5];return ge===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isArray(K))&&(H===void 0||e.every(H,e.isHeritageClause))&&(me===void 0||e.every(me,e.isTypeElement))},1:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4],ge=l[5];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&(K===void 0||!e.isArray(K))&&(H===void 0||e.every(H,e.isTypeParameterDeclaration))&&(me===void 0||e.every(me,e.isHeritageClause))&&(ge===void 0||e.every(ge,e.isTypeElement))}}).deprecate({1:y}).finish(),B.updateInterfaceDeclaration=e.buildOverload("updateInterfaceDeclaration").overload({0:function(l,I,R,K,H,me){return C(l,I,R,K,H,me)},1:function(l,I,R,K,H,me,ge){return C(l,R,K,H,me,ge)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5],ge=l[6];return ge===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isArray(K))&&(H===void 0||e.every(H,e.isHeritageClause))&&(me===void 0||e.every(me,e.isTypeElement))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5],ge=l[6];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&(K===void 0||!e.isArray(K))&&(H===void 0||e.every(H,e.isTypeParameterDeclaration))&&(me===void 0||e.every(me,e.isHeritageClause))&&(ge===void 0||e.every(ge,e.isTypeElement))}}).deprecate({1:y}).finish(),B.createTypeAliasDeclaration=e.buildOverload("createTypeAliasDeclaration").overload({0:function(l,I,R,K){return j(l,I,R,K)},1:function(l,I,R,K,H){return j(I,R,K,H)}}).bind({0:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4];return me===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isArray(K))&&(H===void 0||!e.isArray(H))},1:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&(K===void 0||!e.isArray(K))&&(H===void 0||e.isArray(H))&&(me===void 0||e.isTypeNode(me))}}).deprecate({1:y}).finish(),B.updateTypeAliasDeclaration=e.buildOverload("updateTypeAliasDeclaration").overload({0:function(l,I,R,K,H){return ae(l,I,R,K,H)},1:function(l,I,R,K,H,me){return ae(l,R,K,H,me)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return me===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isArray(K))&&(H===void 0||!e.isArray(H))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&(K===void 0||!e.isArray(K))&&(H===void 0||e.isArray(H))&&(me===void 0||e.isTypeNode(me))}}).deprecate({1:y}).finish(),B.createEnumDeclaration=e.buildOverload("createEnumDeclaration").overload({0:function(l,I,R){return U(l,I,R)},1:function(l,I,R,K){return U(I,R,K)}}).bind({0:function(l){var I=l[0],R=l[1],K=l[2],H=l[3];return H===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isArray(K))},1:function(l){var I=l[0],R=l[1],K=l[2],H=l[3];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&(K===void 0||!e.isArray(K))&&(H===void 0||e.isArray(H))}}).deprecate({1:y}).finish(),B.updateEnumDeclaration=e.buildOverload("updateEnumDeclaration").overload({0:function(l,I,R,K){return M(l,I,R,K)},1:function(l,I,R,K,H){return M(l,R,K,H)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4];return H===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isArray(K))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&(K===void 0||!e.isArray(K))&&(H===void 0||e.isArray(H))}}).deprecate({1:y}).finish(),B.createModuleDeclaration=e.buildOverload("createModuleDeclaration").overload({0:function(l,I,R,K){return w(l,I,R,K)},1:function(l,I,R,K,H){return w(I,R,K,H)}}).bind({0:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4];return me===void 0&&(I===void 0||e.every(I,e.isModifier))&&R!==void 0&&!e.isArray(R)&&(K===void 0||e.isModuleBody(K))&&(H===void 0||typeof H=="number")},1:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&K!==void 0&&e.isModuleName(K)&&(H===void 0||typeof H=="object")&&(me===void 0||typeof me=="number")}}).deprecate({1:y}).finish(),B.updateModuleDeclaration=e.buildOverload("updateModuleDeclaration").overload({0:function(l,I,R,K){return G(l,I,R,K)},1:function(l,I,R,K,H){return G(l,R,K,H)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4];return H===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isModuleBody(K))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&K!==void 0&&e.isModuleName(K)&&(H===void 0||e.isModuleBody(H))}}).deprecate({1:y}).finish(),B.createImportEqualsDeclaration=e.buildOverload("createImportEqualsDeclaration").overload({0:function(l,I,R,K){return X(l,I,R,K)},1:function(l,I,R,K,H){return X(I,R,K,H)}}).bind({0:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4];return me===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||typeof R=="boolean")&&typeof K!="boolean"&&typeof H!="string"},1:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&(K===void 0||typeof K=="boolean")&&(typeof H=="string"||e.isIdentifier(H))&&me!==void 0&&e.isModuleReference(me)}}).deprecate({1:y}).finish(),B.updateImportEqualsDeclaration=e.buildOverload("updateImportEqualsDeclaration").overload({0:function(l,I,R,K,H){return ee(l,I,R,K,H)},1:function(l,I,R,K,H,me){return ee(l,R,K,H,me)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return me===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||typeof R=="boolean")&&typeof K!="boolean"&&typeof H!="string"},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&(K===void 0||typeof K=="boolean")&&(typeof H=="string"||e.isIdentifier(H))&&me!==void 0&&e.isModuleReference(me)}}).deprecate({1:y}).finish(),B.createImportDeclaration=e.buildOverload("createImportDeclaration").overload({0:function(l,I,R,K){return De(l,I,R,K)},1:function(l,I,R,K,H){return De(I,R,K,H)}}).bind({0:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4];return me===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||!e.isArray(R))&&K!==void 0&&e.isExpression(K)&&(H===void 0||e.isAssertClause(H))},1:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&(K===void 0||e.isImportClause(K))&&H!==void 0&&e.isExpression(H)&&(me===void 0||e.isAssertClause(me))}}).deprecate({1:y}).finish(),B.updateImportDeclaration=e.buildOverload("updateImportDeclaration").overload({0:function(l,I,R,K,H){return T(l,I,R,K,H)},1:function(l,I,R,K,H,me){return T(l,R,K,H,me)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return me===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||!e.isArray(R))&&(K===void 0||e.isExpression(K))&&(H===void 0||e.isAssertClause(H))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&(K===void 0||e.isImportClause(K))&&H!==void 0&&e.isExpression(H)&&(me===void 0||e.isAssertClause(me))}}).deprecate({1:y}).finish(),B.createExportAssignment=e.buildOverload("createExportAssignment").overload({0:function(l,I,R){return k(l,I,R)},1:function(l,I,R,K){return k(I,R,K)}}).bind({0:function(l){var I=l[0],R=l[1],K=l[2],H=l[3];return H===void 0&&(I===void 0||e.every(I,e.isModifier))&&(R===void 0||typeof R=="boolean")&&typeof K=="object"},1:function(l){var I=l[0],R=l[1],K=l[2],H=l[3];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&(K===void 0||typeof K=="boolean")&&H!==void 0&&e.isExpression(H)}}).deprecate({1:y}).finish(),B.updateExportAssignment=e.buildOverload("updateExportAssignment").overload({0:function(l,I,R){return N(l,I,R)},1:function(l,I,R,K){return N(l,R,K)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3];return K===void 0&&(I===void 0||e.every(I,e.isModifier))&&R!==void 0&&!e.isArray(R)},1:function(l){var I=l[1],R=l[2],K=l[3];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&K!==void 0&&e.isExpression(K)}}).deprecate({1:y}).finish(),B.createExportDeclaration=e.buildOverload("createExportDeclaration").overload({0:function(l,I,R,K,H){return ie(l,I,R,K,H)},1:function(l,I,R,K,H,me){return ie(I,R,K,H,me)}}).bind({0:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4],ge=l[5];return ge===void 0&&(I===void 0||e.every(I,e.isModifier))&&typeof R=="boolean"&&typeof K!="boolean"&&(H===void 0||e.isExpression(H))&&(me===void 0||e.isAssertClause(me))},1:function(l){var I=l[0],R=l[1],K=l[2],H=l[3],me=l[4],ge=l[5];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&typeof K=="boolean"&&(H===void 0||e.isNamedExportBindings(H))&&(me===void 0||e.isExpression(me))&&(ge===void 0||e.isAssertClause(ge))}}).deprecate({1:y}).finish(),B.updateExportDeclaration=e.buildOverload("updateExportDeclaration").overload({0:function(l,I,R,K,H,me){return V(l,I,R,K,H,me)},1:function(l,I,R,K,H,me,ge){return V(l,R,K,H,me,ge)}}).bind({0:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5],ge=l[6];return ge===void 0&&(I===void 0||e.every(I,e.isModifier))&&typeof R=="boolean"&&typeof K!="boolean"&&(H===void 0||e.isExpression(H))&&(me===void 0||e.isAssertClause(me))},1:function(l){var I=l[1],R=l[2],K=l[3],H=l[4],me=l[5],ge=l[6];return(I===void 0||e.every(I,e.isDecorator))&&(R===void 0||e.isArray(R))&&typeof K=="boolean"&&(H===void 0||e.isNamedExportBindings(H))&&(me===void 0||e.isExpression(me))&&(ge===void 0||e.isAssertClause(ge))}}).deprecate({1:y}).finish()}n(O,"patchNodeFactory");var h=e.createNodeFactory;e.createNodeFactory=function(B,re){var z=h(B,re);return O(z),z},O(e.factory)})(_r||(_r={}));var _r;(function(e){typeof console<"u"&&(e.Debug.loggingHost={log:function(a,y){switch(a){case e.LogLevel.Error:return console.error(y);case e.LogLevel.Warning:return console.warn(y);case e.LogLevel.Info:return console.log(y);case e.LogLevel.Verbose:return console.log(y)}}})})(_r||(_r={}))});var YF={};tF(YF,{RunMode:()=>Gv,getChecksumConfig:()=>yS,getLogin:()=>R1,init:()=>XF});module.exports=aF(YF);var bh=(v=>(v[v.Element=0]="Element",v[v.VisibleElement=1]="VisibleElement",v[v.AtPointElement=2]="AtPointElement",v))(bh||{});var A6=require("path");var Gv=(v=>(v.Normal="normal",v.Heal="heal",v.Refactor="refactor",v))(Gv||{});var I1=(z=>(z.Locator="locator",z.GetByRole="getByRole",z.GetByText="getByText",z.GetByLabel="getByLabel",z.GetByPlaceholder="getByPlaceholder",z.GetByAltText="getByAltText",z.GetByTitle="getByTitle",z.GetByTestId="getByTestId",z))(I1||{}),w1=(h=>(h.First="first",h.Last="last",h.Nth="nth",h.Filter="filter",h.Or="or",h))(w1||{});var Yp=P1(require("path")),Th=require("fs");var Sh=n(e=>new Promise(a=>setTimeout(a,e)),"awaitSleep"),_S=n(async(e,a=1e3,y="action hang guard timed out")=>{let v="guard-timed-out",O=n(async()=>(await Sh(a+1e3),v),"guard"),h=await Promise.race([e,O()]);if(typeof h=="string"&&h===v)throw new Error(y);return h},"guardReturn");function Ch(e=5,a="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"){let y="";for(let v=e;v>0;--v)y+=a[Math.floor(Math.random()*a.length)];return y}n(Ch,"randomString");async function F1(e,a){let y=pS(e,a),{ungzip:v}=dS();if(!(0,Th.existsSync)(y))throw new Error(`Could not find ESRA file for test ${a}`);let O=await v((0,Th.readFileSync)(y));return JSON.parse(O)}n(F1,"getESRAMapForTestId");function Ym(e){return Yp.join(Yp.dirname(e),"..")}n(Ym,"getTestBaseDir");function pS(e,a){return Yp.join(oF(e),`${a}.checksum.esra`)}n(pS,"getESRAFilePath");function oF(e){return Yp.join(mS(e),"esra")}n(oF,"getESRAFolderPath");function gS(e,a){return Yp.join(mS(e),"har",a)}n(gS,"getHARFolderPath");function C6(e,a){return Yp.join(mS(e),"trace",`${a}.playwright-trace.zip`)}n(C6,"getTraceFilePath");function mS(e){return Yp.join(e,"test-data")}n(mS,"getTestDataPath");function sF(){return{uploadAgentHOST:"localhost",uploadAgentPort:3e3}}n(sF,"getUploadAgentDefaultConfig");var O1=n(async e=>{try{await _S(e,5e3)}catch{}},"guardAwait"),vS=n(e=>{let a=/\/\/.*/,y=/\/\*[\s\S]*?\*\//g;return e.replace(a,"").replace(y,"")},"stripJavascriptComments");async function M1(e,a){wc("Fetching selection data..");let v=n(async h=>a.evaluate(async B=>await window.checksum.testRunner.getSelectionDataForSelector(B),h),"getSelectionDataForSelector"),O=await v(e);if(O||(wc("Failed, waiting for network idle..."),await O1(a.waitForLoadState("networkidle")),O=await v(e),O)||(wc("Failed, waiting for element to be visible..."),await O1(a.locator(e).waitFor({state:"visible"})),O=await v(e),O)||(wc("Failed, will wait 5000ms..."),await Sh(5e3),O=await v(e),O))return O}n(M1,"selectionDataForSelector");async function L1(e,a,y,v=6e4){return a in e?_S(e[a](...y),v,"Execution timeout"):e}n(L1,"executePlaywrightMethodWithTimeout");var x6=!1;function T6(e){x6=e}n(T6,"setLogToConsole");function wc(...e){x6&&console.log(...e)}n(wc,"log");function xh(){return Yp.join(__dirname,"..","..","..","checksum")}n(xh,"checksumFolder");function R1(e){try{let a=require(`${xh()}/login.ts`).default;return async y=>{await a(y,e)}}catch(a){throw console.warn("Could not find checksum login file. Please set login.ts file in your checksum folder"),a}}n(R1,"getLogin");var Hv;function E6(){if(Hv)return Hv;let e;try{let a=(0,Th.existsSync)(`${xh()}/checksum.config.tmp.ts`)?"checksum.config.tmp.ts":"checksum.config.ts";e=require(`${xh()}/${a}`).default}catch{console.warn("Could not find checksum config file, will run with defaults"),e=yS()}return e}n(E6,"loadChecksumConfig");function yS(e={}){return Hv={...{apiKey:void 0,runMode:"normal",baseURL:void 0,apiURL:void 0,username:void 0,password:void 0,options:{useChecksumSelectors:!0,useChecksumAI:!1,newAssertionsEnabled:!0,useMockData:!1,printLogs:!1},...sF()},...e},(!Hv.username||!Hv.password)&&console.warn("Username and/or password missing in config file"),Hv}n(yS,"getChecksumConfig");var Tg=class{constructor(a,y,v={generateSelectionData:!1}){this.page=a;this.phaseSetter=y;this.options=v;this.page=a,this.phaseSetter=y}addMetadata(a){}async execute(a,y,v){return L1(a,y,v)}async executeWithSelectors(a,y,v,O=void 0,h={}){for(let{selector:B,tag:re}of a){this.phaseSetter({phase:O,payload:{selector:B,...h}});let z=this.page.locator(B);this.log(`Running with selector=${B})`);let p=!1;["check","uncheck"].includes(y)&&re!=="input"&&(p=!0);let m=this.generateSelectionDataForSelector(B);if(await this.execute(z,p?"click":y,v)===!1){this.log("Fallback selector timeout");continue}return m}}async generateSelectionDataForSelector(a){let{generateSelectionData:y}=this.options;if(!y)return{selector:a,generatedLocator:void 0,esraMetadata:void 0};try{let v=await M1(a,this.page);if(!v)throw new Error(`[generateSelectionDataForSelector] Failed to generate selection data for selector ${a}`);return v}catch(v){throw this.log(v.message),v}}log(...a){wc(...a)}};n(Tg,"AbstractFallback");var B1=require("path");var Kv=class extends Tg{constructor(){super(...arguments);this.locatorTypeEnumToFieldMap={[0]:"element",[1]:"visibleElement",[2]:"atPointElement"}}init(y){return this.esraData={...this.esraData,minSelectionScore:.5,...y},this}async resolve(y){try{let{method:v,args:O}=y,{checksumId:h}=this.esraData,B=await this.getActionIdToESRAMap();if(!(h in B)){let m=`No ESRA metadata found for id ${h}`;throw new Error(m)}let re=await this.getTestIdsForLocator(B[h]),{elementDataMap:z}=await this.getSelectors(re),p=await this.executeWithSelectors(Object.values(z),v,O,"esra-action");if(p)return[p];throw new Error("Exhausted ESRA selectors")}catch(v){this.log(v.message);return}}async getActionIdToESRAMap(){try{this.actionIdToESRAMap||(this.actionIdToESRAMap=await F1((0,B1.join)((0,B1.dirname)(this.esraData.fileName),".."),this.esraData.testId))}catch(y){return super.log("Could not read ESRA metadata file, ",y),{}}return this.actionIdToESRAMap}async getSelectors(y){let v=[],O={};if(!y)return{selectors:v,elementDataMap:O};for(let h in Object.keys(bh)){let B=y.testIds[this.locatorTypeEnumToFieldMap[h]];if(!B)continue;let re=`[data-checksum-testid="${B}"]`;v.push(re),O[re]={...y.elementData[this.locatorTypeEnumToFieldMap[h]],selector:y.selectors[this.locatorTypeEnumToFieldMap[h]]}}for(let h in Object.keys(bh)){let B=y.selectors[this.locatorTypeEnumToFieldMap[h]];B&&(v.push(B),O[B]={...y.elementData[this.locatorTypeEnumToFieldMap[h]],selector:B})}return this.log("Selectors for ESRA metadata:",v),{selectors:v,elementDataMap:O}}async getTestIdsForLocator(y,v={}){let{cachedSelector:O=void 0,retriesLeft:h=3,retryMaxTimeout:B=3e3,staticMetadata:re}=v;this.phaseSetter({phase:"esra-search"});let z=await this.page.evaluate(async({esraMetadata:p,cachedSelector:m,staticMetadata:fe,minSelectionScore:le})=>await window.checksum.testRunner.getMatchingElementSelectionData(p,{minSelectionScore:le,cachedSelector:m,staticMetadata:fe}),{esraMetadata:y,cachedSelector:O,staticMetadata:re,minSelectionScore:this.esraData.minSelectionScore});if(!z){if(h>0)return this.log("[getTestIdsForLocator] no match found, waiting and retrying..."),await Sh(B/h),this.getTestIdsForLocator(y,{...v,retriesLeft:h-1});this.log("[getTestIdsForLocator] failed to locate")}return z}toString(){return`Checksum Selector (${this.esraData.checksumId})`}};n(Kv,"ESRAfallback");var Qv=class extends Tg{init(){return this}async resolve(a){try{let{locator:y,method:v,args:O}=a;if(!["check","uncheck"].includes(v))return;this.phaseSetter({phase:"force"});let h=!1;for(let re of Array.from(O))if(typeof re=="object"){re.force=!0,h=!0;break}if(h||(O=Array.from(O),O.push({force:!0})),await this.execute(y,v,O)!==!1)return[{selector:y._selector,generatedLocator:void 0,esraMetadata:void 0}];this.log("Locator timed out, ")}catch(y){this.log("initiateFallbackSequence exception, ",y);return}}toString(){return null}};n(Qv,"ForceFallback");var Gf=class extends Tg{constructor(){super(...arguments);this.config={llm:{persistChecksumIds:!1}};this.runningChecksumIdIndex=[0];this.steps=[];this.selectionData=[];this.finish=!1;this.actionsCounter=1;this.mockServer=!1}init(y){let{goal:v,apiKey:O,apiURL:h}=y;return Gf.goal=v,Gf.apiKey=O,h&&(Gf.API_BASE_URL=`${h.replace(/\/$/,"")}/client-api/runtime/ai-fallback`),this}async resolve(){try{if(await this.initSession(),!await this.iterate()){this.log("[AIFallback] AIFallback failed");return}return this.selectionData}catch(y){this.log("[AIFallback] Error resolving",y);return}}async iterate(){let y=!1,v=Gf.CLIENT_MAX_ITERATIONS;do{let{reducedHTML:O,flashingHTML:h,elementsForNodeInterpretation:B}=await this.page.evaluate(async([z])=>window.checksum.testGenerator.reduceHTML({overrideInteractableElementsSelectors:z}),[[void 0]]),re=await this.getNextAction({reducedHTML:O,flashingHTML:h,elementsForNodeInterpretation:B,hasPreviousActionFailed:y});if(re.thought==="finish")return this.log("[AIFallback] Received finish step"),this.steps.length>0;if(["failed","fail"].includes(re.thought))return this.log("[AIFallback] Received failed signal, will quit"),!1;re={...re,...await this.getPlaywrightLocatorForChecksumId(re.action.checksumid)};try{let z=await this.executeWithSelectors([{...re,tag:null}],re.action.type,["fill","navigate"].includes(re.action.type)?[re.action.value]:[],"llm-action",{thought:re.thought});if(z)y=!1,this.selectionData.push({...z,method:{name:re.action.type,args:["fill","navigate"].includes(re.action.type)?[re.action.value]:[]},comment:re.thought});else throw new Error("Action failed")}catch(z){this.log("[AIFallback] Error while executing selector",z.message),y=!0;continue}if(this.steps.push(re),--v<=0){this.log("[AIFallback] Maximum repeatition reached");break}}while(!0);return!1}async getNextAction({reducedHTML:y,flashingHTML:v,hasPreviousActionFailed:O,elementsForNodeInterpretation:h}){let{apiKey:B}=Gf;if(this.mockServer)return this.finish?{thought:"finish"}:(--this.actionsCounter===0&&(this.finish=!0),{thought:"mock-thought",action:{type:"click",checksumid:"10"}});let re={reduction:{reducedHTML:y,flashingHTML:v,elementsForNodeInterpretation:h},currentURL:this.page.url()};try{let p=await(await fetch(`${Gf.API_BASE_URL}/iterate`,{method:"POST",headers:{"Content-Type":"application/json",ChecksumAppCode:Gf.apiKey},body:JSON.stringify({appName:B,sessionId:this.sessionId,iterationData:re,hasPreviousActionFailed:O})})).json();return this.log("[AIFallback] Received next action",p),p}catch(z){throw this.log("[AIFallback] Error calling iterate",z),z}}async initSession(){let{apiKey:y,goal:v,thoughts:O}=Gf;if(this.log("[AIFallback] Calling init session...",{appName:y,goal:v,thoughts:O}),this.mockServer){this.sessionId="mock-session-id";return}let h={storyTitle:v,thoughtsAndActions:{previous:O.slice(0,Math.max(O.length-1,0)).map(B=>({thought:B})),failing:{thought:O[O.length-1]},next:[]}};this.phaseSetter({phase:"llm-prompt",payload:{thought:h.thoughtsAndActions.failing.thought}});try{let B=await fetch(`${Gf.API_BASE_URL}/init`,{method:"POST",headers:{"Content-Type":"application/json",ChecksumAppCode:Gf.apiKey},body:JSON.stringify({appName:y,data:h})});this.sessionId=await B.text(),this.log("[AIFallback] Session ID",this.sessionId)}catch(B){throw this.log("[AIFallback] Error calling init session",B),B}}addMetadata(y){Gf.thoughts.push(y.thought)}async getPlaywrightLocatorForChecksumId(y){return!y||isNaN(Number(y))?(this.log(`[getPlaywrightSelectorForChecksumId] Detected invalid checksum id : ${y},,,`),{selector:y}):(!this.config.llm.persistChecksumIds&&this.runningChecksumIdIndex.length>1&&Number(y)<this.runningChecksumIdIndex[this.runningChecksumIdIndex.length-2]&&this.log(`[getPlaywrightSelectorForChecksumId] Detected invalid checksum id, possibly from previous prompt: ${y},
270
- current running checksum id index: ${this.runningChecksumIdIndex[this.runningChecksumIdIndex.length-1]}`),await this.page.evaluate(async O=>window.checksum.testGenerator.getSelectorForChecksumId(O),y))}getFailedThought(){return Gf.thoughts[Gf.thoughts.length-1]}toString(){return`Checksum AI Selector ${this.getFailedThought()}`}},hp=Gf;n(hp,"AIFallback"),hp.API_BASE_URL="https://api.checksum.ai/client-api/runtime/ai-fallback",hp.CLIENT_MAX_ITERATIONS=10,hp.thoughts=[];var DS=P1(require("path")),bS=require("fs");var cF="checksum-playwright-runtime.js",uF=__dirname+"/checksumlib.js";var $p=class{constructor(a,y="normal",v,O,h,B,re,z,p){this.page=a;this.runMode=y;this.testIdSelector=v;this.codeMirror=O;this.monitorBridge=h;this.testInfo=B;this.options=re;this.apiKey=z;this.apiURL=p;this.locatorTypeEnumToFieldMap={[0]:"element",[1]:"visibleElement",[2]:"atPointElement"};this.minSelectionScore=.5;this.phasePayload=void 0;this.locatorStack=[];this.fallbacks=[];this.checksumStepStack=[];this.isTracingActive=!1;this.hasRuntimeStartedTrace=!1;this.didFail=!1;this.didHeal=!1;this.phaseMap={};this.setPhase=a=>{let{phase:y,payload:v,clear:O}=a;O&&(this.phase=void 0,this.phasePayload=void 0),y&&(this.phase=y),v&&(this.phasePayload=v)};T6(re.printLogs),this.proxy=new Proxy(this,{get:n(function(fe,le){return fe.getPageMethod(le)},"get")}),this.registerPageEvents(),this.resetFallbacks(),this.setupStepInterceptors(),this.phase="script"}async prepareAPIMock(){let a={GET:0,POST:0,PUT:0,DELETE:0},y=DS.join(gS(Ym(this.testInfo.file),this.checksumTestId),"test.har");if(!(0,bS.existsSync)(y)){wc("Could not find har file for test, will not use mock");return}await this.page.routeFromHAR(y,{url:"*/**",notFound:"fallback",update:!1});let v=this.page._routes[0].handler;await this.page.route("**/*",O=>{let h=O.request().headers(),B=O.request().method();h["Checksum-Id"]=(++a[B]).toString(),O.request()._applyFallbackOverrides({headers:h}),v(O)})}getPlaywrightConfig(){let a=DS.join(xh(),"playwright.config.ts");if((0,bS.existsSync)(a))return require(a).default}registerPageEvents(){var O;this.page.on("framenavigated",async h=>{h===this.page.mainFrame()&&(this.navigationPromise=new Promise((B,re)=>this.loadScript().then(B).catch(re)))});let y=(O=this.getPlaywrightConfig().use)==null?void 0:O.trace;!y||y==="off"||(this.isTracingActive=!0)}getPageMethod(a){return this.phase=void 0,typeof this[a]=="function"?this[a].bind(this):!Object.values(I1).includes(a)||!this.testInfo?this.page[a]:(this.locatorStack.length===0&&(this.pageInitialCallInTestFile=this.getFirstStackTraceFromTestFile()),this.pushToLocatorStack([{type:a,base:this.page,line:this.pageInitialCallInTestFile.line}]),n(function(v,O){try{return this.executeLocator(v,O)}catch(h){throw this.popLocatorChain(),h}},"Page").bind(this))}static async init(a,y,v,O,{runMode:h="normal",testIdSelector:B=void 0,apiKey:re,apiURL:z,options:p={}}){let m=new $p(a,h,B,y,v,O,{useChecksumSelectors:!0,useChecksumAI:!0,newAssertionsEnabled:!0,useMockData:!1,printLogs:!1,...p},re,z);return v.addTestInfo(m.getChecksumTestId(),O.testId),await m.asyncInit(),m.proxy}popLocatorChain(){return this.locatorStack.pop()}async asyncInit(){await this.page.addInitScript(()=>{window.sessionStorage.setItem("checksumai:disable","true")})}async onTestComplete(){await this.sendTestArtifacts(),this.monitorBridge.addSingleTestStats(!this.didFail,this.didHeal&&!this.didFail)}async sendTestArtifacts(){this.runMode!=="normal"&&(await this.codeMirror.write()).forEach(a=>this.monitorBridge.addAsset(a))}async getTraceFilePath(){if(this.isTracingActive)return this.hasRuntimeStartedTrace?C6(Ym(this.testInfo.file),this.checksumTestId).replace(".zip",".original.zip"):this.testInfo.outputPath("trace.zip")}didTestFail(){return this.didFail}async testId(a){a||(console.warn(`Checksum test id was not defined for test, will auto-generate. Please add one -
271
- test(defineChecksumTest("<title>", "<checksum test id>"), async ({ page }) => {...`),a=Ch(5)),this.checksumTestId=a,(this.options.useMockData||this.runMode==="refactor")&&await this.prepareAPIMock();let y=await this.getTraceFilePath();if(y&&this.monitorBridge.addAsset({type:"trace",path:y,testId:this.checksumTestId}),!1){let O=gS(Ym(this.testInfo.file),this.checksumTestId);this.monitorBridge.addAsset({type:"har",path:O,testId:this.checksumTestId})}}getChecksumTestId(){return this.checksumTestId}checksumSelector(a){return this.options.useChecksumSelectors&&(this.fallbacks.push(this.constructFallback(Kv).init({checksumId:a,fileName:this.testInfo.file,testId:this.checksumTestId})),this.sortFallbacks()),this.checksumStepId=a,this.proxy}checksumAI(...a){if(a.length===0)throw new Error("checksumAI missing arguments");if(!this.options.useChecksumAI)return this.proxy;let{apiKey:y,apiURL:v}=this;if(this.fallbacks.push(this.constructFallback(hp).init({goal:this.testInfo.title,apiKey:y,apiURL:v})),this.sortFallbacks(),this.fallbacks.filter(O=>O instanceof hp).forEach(O=>O.addMetadata({thought:a[0]})),this.checksumStepInitialCallInTestFile=this.getFirstStackTraceFromTestFile(),a.length===1)return this.proxy;if(typeof a[1]!="function")throw new Error("Second argument for withChecksumStep must be a function");this.checksumStepStack.push(a[0]);try{console.log("=== running test function");let O=this;return n(async function(){await a[1](),console.log("==== done running test function"),O.checksumStepStack.pop()},"Page")()}catch(O){console.log(O),this.checksumStepStack.pop()}}async loadScript(){try{return this.navigationPromise&&await this.navigationPromise,await this.page.addScriptTag({path:uF}),await this.page.evaluate(async({initModules:a,ESRAselectionRules:y})=>{window.checksum.testRunner.init(y,[],a)},{ESRAselectionRules:{testIdSelector:this.testIdSelector},initModules:{assertionGenerator:!0}}),wc(`[init] init script loaded for ${this.page.url()}`),!0}catch{return!1}}pushToLocatorStack(a){this.locatorStack.push(a)}getCurrentLocatorChain(){if(this.locatorStack.length)return this.locatorStack[this.locatorStack.length-1]}getCurrentLocatorInChain(){let a=this.getCurrentLocatorChain();return a==null?void 0:a[a.length-1]}getMessage(a,{initialSelector:y,selector:v,thought:O}={}){switch(a){case"script":return"Firing up checksum";case"initial":return`${y} failed, trying some checksum magic...`;case"force":return"check/uncheck methods failed, falling back to click action";case"esra-search":return"Checksum is looking for potential alternatives to resolve the issue...";case"esra-action":return`AI: use selector ${v}`;case"llm-prompt":return`Checksum is trying to achieve step "${O}" using AI...`;case"llm-action":return`AI: "${O}" using selector "${v}"`;case"fail":return`Checksum couldn't resolve the issue executing ${y}`}}onFallbackSuccess(){let a=this.testInfo._steps[this.testInfo._steps.length-1];a&&!a.endWallTime&&a.complete({error:{message:`Failed to resolve ${this.initialLocatorTitle}`,stack:""}})}setupStepInterceptors(){let a=["checksum-page.ts","checksum-test-extension.ts","checksum-playwright-runtime.js","code-mirror.ts","utils.ts","fallback/esra-fallback.ts","fallback/force-fallback.ts","fallback/llm-fallback.ts","index.js"].map(B=>(0,A6.join)(__dirname,B)),y={},v=n(B=>{var z,p,m,fe;return y[B.stepId]!==void 0?y[B.stepId]:B.location&&!a.includes(B.location.file)?!1:!!(B.stepId.includes(".evaluate@")||B.stepId.includes(".addScriptTag@")||(z=B.title)!=null&&z.includes("evaluate")||(p=B.title)!=null&&p.includes("addScriptTag")||(m=B.title)!=null&&m.includes("waitForLoadState")||B.category==="fixture"||(fe=B.title)!=null&&fe.includes("tracing.stop"))},"shouldFilterStep"),O=this.testInfo._onStepBegin;this.testInfo._onStepBegin=B=>{if(!this.phase&&v(B)){y[B.stepId]=!0;return}return y[B.stepId]=!1,this.phase==="initial"&&(this.initialLocatorTitle=B.title,B.location=this.pageInitialCallInTestFile),B.title.startsWith("proxy.")&&(B.title=B.title.replace("proxy.","page.")),this.phase&&this.phase!=="initial"&&(this.phaseMap[B.stepId]={phase:this.phase,payload:this.phasePayload,initialLocatorTitle:this.initialLocatorTitle},B.location=void 0,B.title=this.getMessage(this.phase,{initialSelector:this.initialLocatorTitle,...this.phasePayload})),this.phase=void 0,this.phasePayload=void 0,O(B)};let h=this.testInfo._onStepEnd;this.testInfo._onStepEnd=B=>{if(!y[B.stepId]){if(this.phaseMap[B.stepId]){let{phase:re,initialLocatorTitle:z,payload:p}=this.phaseMap[B.stepId];re==="fail"&&(B.error={message:`Failed to resolve ${z}`,stack:""})}return h(B)}}}getFirstStackTraceFromTestFile(){let a=this.getTestFileStackTrace()[0];if(!a)throw new Error(`Could not find test file location from stack trace ${$p.getStackTrace()}`);let v=[/\((.*):(\d+):(\d+)\)$/,/.*at (.*):(\d+):(\d+)$/].map(re=>re.exec(a)).find(re=>re!==null);if(!v)throw new Error(`Could not find test file location from stack trace ${a}`);let[,O,h,B]=v;return{file:O,line:parseInt(h),column:parseInt(B)}}getTestFileStackTrace(){return $p.getStackTrace().filter(y=>y.includes(this.testInfo.file))}isCalledDirectlyFromTestFunction(){let a=this.getTestFileStackTrace();if(a.length!==1+this.checksumStepStack.length)return!1;let y=a[0],v=/.*at (.*):(\d+):(\d+)$/;return this.checksumStepStack.length===0&&!v.exec(y)?!1:!this.isCalledThroughMethodInAnotherFile(y)}isCalledThroughMethodInAnotherFile(a){let y=$p.getStackTrace(),v=["node:internal","/node_modules/@playwright"],O=y.indexOf(a)-1;for(;O>=0&&v.some(B=>y[O].includes(B));)O--;let h=y[O];return!h.includes("checksum-page.ts")&&!h.includes(cF)}static getStackTrace(){return new Error().stack.split(`
270
+ current running checksum id index: ${this.runningChecksumIdIndex[this.runningChecksumIdIndex.length-1]}`),await this.page.evaluate(async O=>window.checksum.testGenerator.getSelectorForChecksumId(O),y))}getFailedThought(){return Gf.thoughts[Gf.thoughts.length-1]}toString(){return`Checksum AI Selector ${this.getFailedThought()}`}},hp=Gf;n(hp,"AIFallback"),hp.API_BASE_URL="https://api.checksum.ai/client-api/runtime/ai-fallback",hp.CLIENT_MAX_ITERATIONS=10,hp.thoughts=[];var DS=P1(require("path")),bS=require("fs");var cF="checksum-playwright-runtime.js",uF=__dirname+"/checksumlib.js";var $p=class{constructor(a,y="normal",v,O,h,B,re,z,p){this.page=a;this.runMode=y;this.testIdSelector=v;this.codeMirror=O;this.monitorBridge=h;this.testInfo=B;this.options=re;this.apiKey=z;this.apiURL=p;this.locatorTypeEnumToFieldMap={[0]:"element",[1]:"visibleElement",[2]:"atPointElement"};this.minSelectionScore=.5;this.phasePayload=void 0;this.locatorStack=[];this.fallbacks=[];this.checksumStepStack=[];this.isTracingActive=!1;this.hasRuntimeStartedTrace=!1;this.didFail=!1;this.didHeal=!1;this.phaseMap={};this.setPhase=a=>{let{phase:y,payload:v,clear:O}=a;O&&(this.phase=void 0,this.phasePayload=void 0),y&&(this.phase=y),v&&(this.phasePayload=v)};T6(re.printLogs),this.proxy=new Proxy(this,{get:n(function(fe,le){return fe.getPageMethod(le)},"get")}),this.registerPageEvents(),this.resetFallbacks(),this.setupStepInterceptors(),this.phase="script"}async prepareAPIMock(){let a={GET:0,POST:0,PUT:0,DELETE:0},y=DS.join(gS(Ym(this.testInfo.file),this.checksumTestId),"test.har");if(!(0,bS.existsSync)(y)){wc("Could not find har file for test, will not use mock");return}await this.page.routeFromHAR(y,{url:"*/**",notFound:"fallback",update:!1});let v=this.page._routes[0].handler;await this.page.route("**/*",O=>{let h=O.request().headers(),B=O.request().method();h["Checksum-Id"]=(++a[B]).toString(),O.request()._applyFallbackOverrides({headers:h}),v(O)})}getPlaywrightConfig(){let a=DS.join(xh(),"playwright.config.ts");if((0,bS.existsSync)(a))return require(a).default}registerPageEvents(){var O;this.page.on("framenavigated",async h=>{h===this.page.mainFrame()&&(this.navigationPromise=new Promise((B,re)=>this.loadScript().then(B).catch(re)))});let y=(O=this.getPlaywrightConfig().use)==null?void 0:O.trace;!y||y==="off"||(this.isTracingActive=!0)}getPageMethod(a){return this.phase=void 0,typeof this[a]=="function"?this[a].bind(this):!Object.values(I1).includes(a)||!this.testInfo?this.page[a]:(this.locatorStack.length===0&&(this.pageInitialCallInTestFile=this.getFirstStackTraceFromTestFile()),this.pushToLocatorStack([{type:a,base:this.page,line:this.pageInitialCallInTestFile.line}]),n(function(v,O){try{return this.executeLocator(v,O)}catch(h){throw this.popLocatorChain(),h}},"Page").bind(this))}static async init(a,y,v,O,{runMode:h="normal",testIdSelector:B=void 0,apiKey:re,apiURL:z,options:p={}}){let m=new $p(a,h,B,y,v,O,{useChecksumSelectors:!0,useChecksumAI:!0,newAssertionsEnabled:!0,useMockData:!1,printLogs:!1,...p},re,z);return v.addTestInfo(m.getChecksumTestId(),O.testId),await m.asyncInit(),m.proxy}popLocatorChain(){return this.locatorStack.pop()}async asyncInit(){await this.page.addInitScript(()=>{window.sessionStorage.setItem("checksumai:disable","true")})}async onTestComplete(){await this.sendTestArtifacts(),this.monitorBridge.addSingleTestStats(!this.didFail,this.didHeal&&!this.didFail)}async sendTestArtifacts(){this.runMode!=="normal"&&(await this.codeMirror.write()).forEach(a=>this.monitorBridge.addAsset(a))}async getTraceFilePath(){if(this.isTracingActive)return this.hasRuntimeStartedTrace?C6(Ym(this.testInfo.file),this.checksumTestId).replace(".zip",".original.zip"):this.testInfo.outputPath("trace.zip")}didTestFail(){return this.didFail}async testId(a){a||(a=Ch(5),console.warn(`Checksum test id was not defined for test, will auto-generate. Please replace - "${this.testInfo.title}" with -
271
+ test(defineChecksumTest("${this.testInfo.title}", "${a}"), async ({ page }) => {...`)),this.checksumTestId=a,(this.options.useMockData||this.runMode==="refactor")&&await this.prepareAPIMock();let y=await this.getTraceFilePath();if(y&&this.monitorBridge.addAsset({type:"trace",path:y,testId:this.checksumTestId}),!1){let O=gS(Ym(this.testInfo.file),this.checksumTestId);this.monitorBridge.addAsset({type:"har",path:O,testId:this.checksumTestId})}}getChecksumTestId(){return this.checksumTestId}checksumSelector(a){return this.options.useChecksumSelectors&&(this.fallbacks.push(this.constructFallback(Kv).init({checksumId:a,fileName:this.testInfo.file,testId:this.checksumTestId})),this.sortFallbacks()),this.checksumStepId=a,this.proxy}checksumAI(...a){if(a.length===0)throw new Error("checksumAI missing arguments");if(!this.options.useChecksumAI)return this.proxy;let{apiKey:y,apiURL:v}=this;if(this.fallbacks.push(this.constructFallback(hp).init({goal:this.testInfo.title,apiKey:y,apiURL:v})),this.sortFallbacks(),this.fallbacks.filter(O=>O instanceof hp).forEach(O=>O.addMetadata({thought:a[0]})),this.checksumStepInitialCallInTestFile=this.getFirstStackTraceFromTestFile(),a.length===1)return this.proxy;if(typeof a[1]!="function")throw new Error("Second argument for withChecksumStep must be a function");this.checksumStepStack.push(a[0]);try{console.log("=== running test function");let O=this;return n(async function(){await a[1](),console.log("==== done running test function"),O.checksumStepStack.pop()},"Page")()}catch(O){console.log(O),this.checksumStepStack.pop()}}async loadScript(){try{return this.navigationPromise&&await this.navigationPromise,await this.page.addScriptTag({path:uF}),await this.page.evaluate(async({initModules:a,ESRAselectionRules:y})=>{window.checksum.testRunner.init(y,[],a)},{ESRAselectionRules:{testIdSelector:this.testIdSelector},initModules:{assertionGenerator:!0}}),wc(`[init] init script loaded for ${this.page.url()}`),!0}catch{return!1}}pushToLocatorStack(a){this.locatorStack.push(a)}getCurrentLocatorChain(){if(this.locatorStack.length)return this.locatorStack[this.locatorStack.length-1]}getCurrentLocatorInChain(){let a=this.getCurrentLocatorChain();return a==null?void 0:a[a.length-1]}getMessage(a,{initialSelector:y,selector:v,thought:O}={}){switch(a){case"script":return"Firing up checksum";case"initial":return`${y} failed, trying some checksum magic...`;case"force":return"check/uncheck methods failed, falling back to click action";case"esra-search":return"Checksum is looking for potential alternatives to resolve the issue...";case"esra-action":return`AI: use selector ${v}`;case"llm-prompt":return`Checksum is trying to achieve step "${O}" using AI...`;case"llm-action":return`AI: "${O}" using selector "${v}"`;case"fail":return`Checksum couldn't resolve the issue executing ${y}`}}onFallbackSuccess(){let a=this.testInfo._steps[this.testInfo._steps.length-1];a&&!a.endWallTime&&a.complete({error:{message:`Failed to resolve ${this.initialLocatorTitle}`,stack:""}})}setupStepInterceptors(){let a=["checksum-page.ts","checksum-test-extension.ts","checksum-playwright-runtime.js","code-mirror.ts","utils.ts","fallback/esra-fallback.ts","fallback/force-fallback.ts","fallback/llm-fallback.ts","index.js"].map(B=>(0,A6.join)(__dirname,B)),y={},v=n(B=>{var z,p,m,fe;return y[B.stepId]!==void 0?y[B.stepId]:B.location&&!a.includes(B.location.file)?!1:!!(B.stepId.includes(".evaluate@")||B.stepId.includes(".addScriptTag@")||(z=B.title)!=null&&z.includes("evaluate")||(p=B.title)!=null&&p.includes("addScriptTag")||(m=B.title)!=null&&m.includes("waitForLoadState")||B.category==="fixture"||(fe=B.title)!=null&&fe.includes("tracing.stop"))},"shouldFilterStep"),O=this.testInfo._onStepBegin;this.testInfo._onStepBegin=B=>{if(!this.phase&&v(B)){y[B.stepId]=!0;return}return y[B.stepId]=!1,this.phase==="initial"&&(this.initialLocatorTitle=B.title,B.location=this.pageInitialCallInTestFile),B.title.startsWith("proxy.")&&(B.title=B.title.replace("proxy.","page.")),this.phase&&this.phase!=="initial"&&(this.phaseMap[B.stepId]={phase:this.phase,payload:this.phasePayload,initialLocatorTitle:this.initialLocatorTitle},B.location=void 0,B.title=this.getMessage(this.phase,{initialSelector:this.initialLocatorTitle,...this.phasePayload})),this.phase=void 0,this.phasePayload=void 0,O(B)};let h=this.testInfo._onStepEnd;this.testInfo._onStepEnd=B=>{if(!y[B.stepId]){if(this.phaseMap[B.stepId]){let{phase:re,initialLocatorTitle:z,payload:p}=this.phaseMap[B.stepId];re==="fail"&&(B.error={message:`Failed to resolve ${z}`,stack:""})}return h(B)}}}getFirstStackTraceFromTestFile(){let a=this.getTestFileStackTrace()[0];if(!a)throw new Error(`Could not find test file location from stack trace ${$p.getStackTrace()}`);let v=[/\((.*):(\d+):(\d+)\)$/,/.*at (.*):(\d+):(\d+)$/].map(re=>re.exec(a)).find(re=>re!==null);if(!v)throw new Error(`Could not find test file location from stack trace ${a}`);let[,O,h,B]=v;return{file:O,line:parseInt(h),column:parseInt(B)}}getTestFileStackTrace(){return $p.getStackTrace().filter(y=>y.includes(this.testInfo.file))}isCalledDirectlyFromTestFunction(){let a=this.getTestFileStackTrace();if(a.length!==1+this.checksumStepStack.length)return!1;let y=a[0],v=/.*at (.*):(\d+):(\d+)$/;return this.checksumStepStack.length===0&&!v.exec(y)?!1:!this.isCalledThroughMethodInAnotherFile(y)}isCalledThroughMethodInAnotherFile(a){let y=$p.getStackTrace(),v=["node:internal","/node_modules/@playwright"],O=y.indexOf(a)-1;for(;O>=0&&v.some(B=>y[O].includes(B));)O--;let h=y[O];return!h.includes("checksum-page.ts")&&!h.includes(cF)}static getStackTrace(){return new Error().stack.split(`
272
272
  `)}getLocator(a,y){let v=this.getCurrentLocatorInChain();return v.base[v.type](a,y)}executeLocator(a,y){try{wc(`
273
273
  Executing locator ${this.getCurrentLocatorInChain().type} with ${typeof a=="string"?`selector ${a}`:"locator"}`);let v=this.getLocator(a,y);return new Proxy(v,{get:n(function(h,B){return this.getLocatorMethod(v,h,B)},"get").bind(this)})}catch(v){wc("Failed to locate",v)}}getLocatorMethod(a,y,v){return v==="constructor"?n(function(...h){return this.popLocatorChain(),y.constructor(...h)},"Locator"):v in y&&typeof y[v]!="function"||v===Symbol.toPrimitive||v in Object?(this.popLocatorChain(),y[v]):[...Object.values(I1),...Object.values(w1)].includes(v)?v==="or"?(wc("'Or' locator not supported, will execute normally"),this.popLocatorChain(),y[v]):(this.getCurrentLocatorChain().push({type:v,base:a}),n(function(...h){return this.executeLocator(...h)},"Locator").bind(this)):n(async function(...h){let B=await this.executeLocatorAction(a,v,h);return this.popLocatorChain(),B},"Locator").bind(this)}async executeLocatorAction(a,y,v){this.selector=a._selector;let O=this.getChecksumStepId();wc("Executing",y,this.selector);let h=y==="_expect";try{wc("Running initial locator..."),await this.navigationPromise,await this.page.evaluate(()=>!!window.checksum)||wc("[loadScript] checksum libs missing, marking as failed"),await this.stepWillExecute(h),this.phase="initial";let re=await L1(a,y,v,this.getTimeout(y,v));if(h&&(re==null?void 0:re.timedOut)===!0)return wc("Expect timeout"),this.didFail=!0,re;if(re!==!1)return await this.onStepSuccess(O,y==="_expect"),re;await this.onStepFailure()}catch(B){wc("Failed initial execution. Exception:",B.message)}return this.initiateFallbackSequence(O,a,y,v)}getChecksumStepId(){let a=this.checksumStepId;return this.checksumStepId=void 0,a}async stepWillExecute(a){this.selectionData=void 0,this.runMode==="refactor"&&(wc(`stepWillExecute called for line ${this.pageInitialCallInTestFile.line}`),this.isCalledDirectlyFromTestFunction()&&(await this.evaluateWithChecksum(async()=>await window.checksum.testRunner.startMonitoringForAssertions()),this.selectionData=[await M1(this.selector,this.page)].filter(y=>y),Object.values(this.selectionData).length===0?wc(`Failed fetching selection data ${a?"- maybe because it is not visible and running inside expect":""}`):wc("Successfully fetched selection data")))}async onStepSuccess(a,y,v=!1){var B,re,z,p;let O=(B=this.fallbacks.find(m=>m instanceof hp))==null?void 0:B.getFailedThought();if(this.resetFallbacks(),this.runMode==="normal"||this.runMode==="heal"&&!v||!this.codeMirror||!this.getCurrentLocatorChain())return;if(!this.isCalledDirectlyFromTestFunction()){wc("<!> Step called from helper function, will not refactor step");return}if(this.runMode==="refactor"&&!this.selectionData.length){wc("Failed fetching selection data, will not refactor step");return}wc("Will update in-memory code"+(this.selectionData&&this.selectionData.length>0?`
274
274
  locators:
@@ -303,7 +303,7 @@ ${O}`,y(h,O))return v}return v}addESRA(a,y){if(!this.esraMetadataMap)return"";if
303
303
  \\s]*(?:(?!\\1)[\\s\\S]))*\\1(?:[\r
304
304
  \\s]*,\\s*({[\\s\\S]*?}))?[\r
305
305
  \\s]*\\)`)}}};n(pm,"CodeMirror");var wh=class{constructor(a){this.hasMonitor=!1;a.options.hostReports&&(this.monitorAgentHost="http://localhost",this.monitorAgentPort=process.env.CHECKSUM_UPLOAD_AGENT_PORT,this.monitorAgentPort?this.hasMonitor=!0:wc("CHECKSUM_UPLOAD_AGENT_PORT is not defined"))}addAsset(a){this.signalUpload(a,["trace","har"].includes(a.type))}addTestInfo(a,y){this.sendMessage({type:"testInfo",payload:{checksumTestId:a,pwTestId:y}})}addSingleTestStats(a,y){this.sendMessage({type:"testStats",payload:{passed:a,healed:y}})}sendMessage(a){if(this.hasMonitor)return fetch(`${this.monitorAgentHost}:${this.monitorAgentPort}`,{method:"POST",body:JSON.stringify(a)}).catch(y=>{wc("Failed to send message to test run monitor",a,y)})}signalUpload(a,y=!1){return this.sendMessage({type:"asset",payload:a,watch:y})}};n(wh,"TestRunMonitorBridge");var GS={},_A=n((e,a,y={})=>{let{baseURL:v,runMode:O,apiKey:h,apiURL:B}=a,re=e.extend({codeMirror:[async({},z)=>{let p=await pm.init(O);await z(p)},{scope:"worker"}],monitorBridge:[async({},z)=>{let p=new wh(a);await z(p)},{scope:"worker"}],page:async({page:z,codeMirror:p,monitorBridge:m},fe,le)=>{let se=await $p.init(z,p,m,le,{runMode:O,apiKey:h,apiURL:B,options:y}),ce=QF(le);await se.testId(ce),await fe(se),await se.onTestComplete()}});return re.use({launchOptions:{args:["--remote-debugging-port=9222",...y!=null&&y.useMockData?["--disable-web-security"]:[]]},baseURL:v,bypassCSP:!0}),{test:re,defineChecksumTest:KF}},"createChecksumTestExtension"),KF=n((e,a)=>{let v=new Error().stack.split(`
306
- `).filter(O=>O.includes(".checksum.spec.ts"))[0];if(!v)throw new Error("Could not locate test location. Make sure test is run from valid checksum test file");return GS[v]=a,`${e} (checksumId: ${a})`},"defineChecksumTest");function QF(e){var O;let{file:a,line:y}=e,v=Object.keys(GS).filter(h=>h.trim().includes(a.trim()));if(v.length){for(let h=0;h<4;h++)for(let B of v)if(parseInt((O=B.split(":"))==null?void 0:O[1])-h===parseInt(y))return GS[B]}}n(QF,"getCurrentTestIdFromMapping");function XF(e){let a=E6(),{baseURL:y,runMode:v,options:O,apiKey:h,apiURL:B}=a;if(!y)throw new Error("baseURL is required - please set it in the config file");if(!h)throw new Error("apiKey is required - please set it in the config file - checksum.config.ts");return{..._A(e,a,O),login:R1(a)}}n(XF,"init");0&&(module.exports={RunMode,getChecksumConfig,getLogin,init});
306
+ `).filter(O=>O.includes(".checksum.spec.ts"))[0];if(!v)throw new Error("Could not locate test location. Make sure test is run from valid checksum test file");return GS[v]=a,e},"defineChecksumTest");function QF(e){var O;let{file:a,line:y}=e,v=Object.keys(GS).filter(h=>h.trim().includes(a.trim()));if(v.length){for(let h=0;h<4;h++)for(let B of v)if(parseInt((O=B.split(":"))==null?void 0:O[1])-h===parseInt(y))return GS[B]}}n(QF,"getCurrentTestIdFromMapping");function XF(e){let a=E6(),{baseURL:y,runMode:v,options:O,apiKey:h,apiURL:B}=a;if(!y)throw new Error("baseURL is required - please set it in the config file");if(!h)throw new Error("apiKey is required - please set it in the config file - checksum.config.ts");return{..._A(e,a,O),login:R1(a)}}n(XF,"init");0&&(module.exports={RunMode,getChecksumConfig,getLogin,init});
307
307
  /*! Bundled license information:
308
308
 
309
309
  typescript/lib/typescript.js:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@checksum-ai/runtime",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Checksum.ai test runtime",
5
5
  "main": "index.js",
6
6
  "scripts": {