@budibase/cli 3.20.3 → 3.20.4

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.
package/dist/index.js CHANGED
@@ -214,7 +214,7 @@ Ensure these configurations are set before running your application.`);x$?.setAg
214
214
  Failed to append evaluation metric to LLM Observability writer, likely due to an unserializable property.
215
215
  Evaluation metrics won't be sent to LLM Observability: ${t.message}
216
216
  `)}}s(xXr,"handleEvalMetricAppend");CXr.exports={enable:qDo,disable:BDo}});var NXr=y((TEl,kXr)=>{"use strict";var IXr=O_e(),rZ=IXr.load("crashtracker"),RXr=At(),{URL:UDo}=require("url"),lot=Sf(),fot=class{static{s(this,"Crashtracker")}constructor(){this._started=!1}configure(t){if(this._started)try{rZ.updateConfig(this._getConfig(t)),rZ.updateMetadata(this._getMetadata(t))}catch(r){RXr.error("Error configuring crashtracker",r)}}start(t){if(this._started)return this.configure(t);this._started=!0;try{rZ.init(this._getConfig(t),this._getReceiverConfig(t),this._getMetadata(t))}catch(r){RXr.error("Error initialising crashtracker",r)}}withProfilerSerializing(t){rZ.beginProfilerSerializing();try{return t()}finally{rZ.endProfilerSerializing()}}_getConfig(t){let{hostname:r="127.0.0.1",port:n=8126}=t,i=t.url||new UDo(`http://${r}:${n}`);return{additional_files:[],create_alt_stack:!0,use_alt_stack:!0,endpoint:{url:{scheme:i.protocol.slice(0,-1),authority:i.protocol==="unix:"?Buffer.from(i.pathname).toString("hex"):i.host,path_and_query:""},timeout_ms:3e3},timeout_ms:5e3,resolve_frames:"EnabledWithInprocessSymbols"}}_getMetadata(t){let r=Object.keys(t.tags).map(n=>`${n}:${t.tags[n]}`);return{library_name:lot.name,library_version:lot.version,family:"nodejs",tags:[...r,"is_crash:true","language:javascript",`library_version:${lot.version}`,"runtime:nodejs",`runtime_version:${process.versions.node}`,"severity:crash"]}}_getReceiverConfig(){return{args:[],env:[],path_to_receiver_binary:IXr.find("crashtracker-receiver",!0),stderr_filename:null,stdout_filename:null}}};kXr.exports=new fot});var pot=y((xEl,PXr)=>{"use strict";var dot=class{static{s(this,"NoopCrashtracker")}configure(){}start(){}withProfilerSerializing(t){return t()}};PXr.exports=new dot});var hot=y((OEl,bEe)=>{"use strict";var{isMainThread:FDo}=require("worker_threads"),jDo=At();if(FDo)try{bEe.exports=NXr()}catch(e){jDo.warn(e.message),bEe.exports=pot()}else bEe.exports=pot()});var LXr=y((REl,MXr)=>{"use strict";var $Do=ch(),DXr=$Do.manager.namespace("profilers"),yC=hi(),HDo=At(),mot=3e4,got=class{static{s(this,"SSIHeuristics")}constructor(t){let r=t.injectionEnabled.includes("profiler");this._heuristicsActive=r||t.profiling.enabled==="auto",this._emitsTelemetry=t.injectionEnabled.length>0&&t.profiling.enabled!=="false",this._emitsTelemetry&&(t.profiling.enabled==="true"?this.enablementChoice="manually_enabled":r?this.enablementChoice="ssi_enabled":t.profiling.enabled==="auto"?this.enablementChoice="auto_enabled":this.enablementChoice="ssi_not_enabled");let n=t.profiling.longLivedThreshold||mot;typeof n!="number"||n<=0?(this.longLivedThreshold=mot,HDo.warn(`Invalid SSIHeuristics.longLivedThreshold value: ${t.profiling.longLivedThreshold}. Using default value: ${mot}`)):this.longLivedThreshold=n,this.hasSentProfiles=!1,this.noSpan=!0,this.shortLived=!0}get emitsTelemetry(){return this._emitsTelemetry}get heuristicsActive(){return this._heuristicsActive}start(){(this.heuristicsActive||this.emitsTelemetry)&&(setTimeout(()=>{this.shortLived=!1,this._maybeTriggered()},this.longLivedThreshold).unref(),this._onSpanCreated=this._onSpanCreated.bind(this),yC.subscribe("dd-trace:span:start",this._onSpanCreated),this.emitsTelemetry&&(this._onProfileSubmitted=this._onProfileSubmitted.bind(this),this._onMockProfileSubmitted=this._onMockProfileSubmitted.bind(this),yC.subscribe("datadog:profiling:profile-submitted",this._onProfileSubmitted),yC.subscribe("datadog:profiling:mock-profile-submitted",this._onMockProfileSubmitted)),this._onAppClosing=this._onAppClosing.bind(this),yC.subscribe("datadog:telemetry:app-closing",this._onAppClosing))}onTriggered(t){switch(typeof t){case"undefined":case"function":this.triggeredCallback=t,process.nextTick(()=>{this._maybeTriggered()});break;default:throw new TypeError("callback must be a function or undefined")}}_maybeTriggered(){!this.shortLived&&!this.noSpan&&typeof this.triggeredCallback=="function"&&this.triggeredCallback.call(null)}_onSpanCreated(){this.noSpan=!1,this._maybeTriggered(),yC.unsubscribe("dd-trace:span:start",this._onSpanCreated)}_onProfileSubmitted(){this.hasSentProfiles=!0,this._incProfileCount()}_onMockProfileSubmitted(){this._incProfileCount()}_incProfileCount(){this._ensureProfileMetrics(),this._profileCount.inc()}_ensureProfileMetrics(){let t=[];this.noSpan&&t.push("no_span"),this.shortLived&&t.push("short_lived"),t.length===0&&t.push("triggered");let r=["installation:ssi",`enablement_choice:${this.enablementChoice}`,`has_sent_profiles:${this.hasSentProfiles}`,`heuristic_hypothetical_decision:${t.join("_")}`];this._profileCount=DXr.count("ssi_heuristic.number_of_profiles",r),this._runtimeIdCount=DXr.count("ssi_heuristic.number_of_runtime_id",r),!this._emittedRuntimeId&&t[0]==="triggered"&&(!this.heuristicsActive||this.hasSentProfiles)&&(this._emittedRuntimeId=!0,this._runtimeIdCount.inc())}_onAppClosing(){this.emitsTelemetry&&(this._ensureProfileMetrics(),this._emittedRuntimeId||(this._emittedRuntimeId=!0,this._runtimeIdCount.inc()),this._profileCount.inc(0),yC.unsubscribe("datadog:profiling:profile-submitted",this._onProfileSubmitted),yC.unsubscribe("datadog:profiling:mock-profile-submitted",this._onMockProfileSubmitted)),yC.unsubscribe("datadog:telemetry:app-closing",this._onAppClosing),this.noSpan&&yC.unsubscribe("dd-trace:span:start",this._onSpanCreated)}};MXr.exports={SSIHeuristics:got}});var BXr=y((kEl,qXr)=>{"use strict";var GDo=hi(),zDo=YI(),VDo=GDo.channel("datadog:profiling:mock-profile-submitted"),{getEnvironmentVariable:WDo}=Dn(),KDo=WDo("DD_PROFILING_UPLOAD_PERIOD"),C$;qXr.exports={start:e=>{let t=zDo(e.interval,Number(KDo)*1e3,65e3);C$=setTimeout(()=>{VDo.publish(),C$.refresh()},t),C$.unref()},stop:()=>{C$!==void 0&&(clearTimeout(C$),C$=void 0)}}});var FXr=y((NEl,UXr)=>{"use strict";var YDo=Wx(),{TEST_STATUS:QDo,finishAllTraceSpans:XDo,getTestSuitePath:JDo}=Sd(),{storage:_ot}=Fr(),yot=class extends YDo{static{s(this,"TestApiManualPlugin")}static get id(){return"test-api-manual"}constructor(...t){super(...t),this._isEnvDataCalcualted=!1,this.sourceRoot=process.cwd(),this.unconfiguredAddSub("dd-trace:ci:manual:test:start",({testName:r,testSuite:n})=>{let i=_ot("legacy").getStore(),o=JDo(n,this.sourceRoot),a=this.startTestSpan(r,o);this.enter(a,i)}),this.unconfiguredAddSub("dd-trace:ci:manual:test:finish",({status:r,error:n})=>{let i=_ot("legacy").getStore(),o=i&&i.span;o&&(o.setTag(QDo,r),n&&o.setTag("error",n),o.finish(),XDo(o))}),this.unconfiguredAddSub("dd-trace:ci:manual:test:addTags",r=>{let n=_ot("legacy").getStore(),i=n&&n.span;i&&i.addTags(r)})}unconfiguredAddSub(t,r){this.addSub(t,(...n)=>(this._isEnvDataCalcualted||(this._isEnvDataCalcualted=!0,this.configure(this._config,!0)),r(...n)))}configure(t,r){this._config=t,super.configure(t,r)}};UXr.exports=yot});var $Xr=y((DEl,jXr)=>{"use strict";var ZDo=Td(),eMo=At(),{getEnvironmentVariable:bot}=Dn();function tMo(e){let{site:t,service:r}=e,n={host:`http-intake.logs.${t}`,path:`/api/v2/logs?ddsource=winston&service=${r}`,ssl:!0,headers:{"DD-API-KEY":bot("DD_API_KEY")}};if(!bot("DD_AGENTLESS_LOG_SUBMISSION_URL"))return n;try{let i=new URL(bot("DD_AGENTLESS_LOG_SUBMISSION_URL"));return{host:i.hostname,port:i.port,ssl:i.protocol==="https:",path:n.path,headers:n.headers}}catch{return eMo.error("Could not parse DD_AGENTLESS_LOG_SUBMISSION_URL"),n}}s(tMo,"getWinstonLogSubmissionParameters");var Eot=class extends ZDo{static{s(this,"LogSubmissionPlugin")}static get id(){return"log-submission"}constructor(...t){super(...t),this.addSub("ci:log-submission:winston:configure",r=>{this.HttpClass=r}),this.addSub("ci:log-submission:winston:add-transport",r=>{r.add(new this.HttpClass(tMo(this.config)))})}};jXr.exports=Eot});var GXr=y((LEl,HXr)=>{"use strict";function zb(e,t){typeof t=="boolean"&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}s(zb,"RetryOperation");HXr.exports=zb;zb.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};zb.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};zb.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r),this._options.unref&&this._timer.unref(),!0};zb.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};zb.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)};zb.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)};zb.prototype.start=zb.prototype.try;zb.prototype.errors=function(){return this._errors};zb.prototype.attempts=function(){return this._attempts};zb.prototype.mainError=function(){if(this._errors.length===0)return null;for(var e={},t=null,r=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,a=(e[o]||0)+1;e[o]=a,a>=r&&(t=i,r=a)}return t}});var zXr=y(m2=>{"use strict";var rMo=GXr();m2.operation=function(e){var t=m2.timeouts(e);return new rMo(t,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})};m2.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],i=0;i<t.retries;i++)n.push(this.createTimeout(i,t));return e&&e.forever&&!n.length&&n.push(this.createTimeout(i,t)),n.sort(function(o,a){return o-a}),n};m2.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,n=Math.round(r*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return n=Math.min(n,t.maxTimeout),n};m2.wrap=function(e,t,r){if(t instanceof Array&&(r=t,t=null),!r){r=[];for(var n in e)typeof e[n]=="function"&&r.push(n)}for(var i=0;i<r.length;i++){var o=r[i],a=e[o];e[o]=s(function(u){var l=m2.operation(t),f=Array.prototype.slice.call(arguments,1),d=f.pop();f.push(function(p){l.retry(p)||(p&&(arguments[0]=l.mainError()),d.apply(this,arguments))}),l.attempt(function(){u.apply(e,f)})},"retryWrapper").bind(e,a),e[o].options=t}}});var WXr=y((FEl,VXr)=>{"use strict";VXr.exports=zXr()});var Sot=y((jEl,QXr)=>{"use strict";var O$=require("os"),KXr=require("perf_hooks").performance,YXr=Sf().version,{getEnvironmentVariable:nMo}=Dn(),iMo=(()=>{let e=nMo("UV_THREADPOOL_SIZE");if(e===void 0)return;let t=Number.parseInt(e);return Number.isNaN(t)?0:t})(),vot=class{static{s(this,"EventSerializer")}constructor({env:t,host:r,service:n,version:i,libraryInjected:o,activation:a}={}){this._env=t,this._host=r,this._service=n,this._appVersion=i,this._libraryInjected=!!o,this._activation=a||"unknown"}typeToFile(t){return`${t}.pprof`}getEventJSON({profiles:t,start:r,end:n,tags:i={},endpointCounts:o}){return JSON.stringify({attachments:Object.keys(t).map(a=>this.typeToFile(a)),start:r.toISOString(),end:n.toISOString(),family:"node",version:"4",tags_profiler:["language:javascript","runtime:nodejs",`runtime_arch:${process.arch}`,`runtime_os:${process.platform}`,`runtime_version:${process.version}`,`process_id:${process.pid}`,`profiler_version:${YXr}`,"format:pprof",...Object.entries(i).map(([a,c])=>`${a}:${c}`)].join(","),endpoint_counts:o,info:{application:{env:this._env,service:this._service,start_time:new Date(KXr.nodeTiming.nodeStart+KXr.timeOrigin).toISOString(),version:this._appVersion},platform:{hostname:this._host,kernel_name:O$.type(),kernel_release:O$.release(),kernel_version:O$.version()},profiler:{activation:this._activation,ssi:{mechanism:this._libraryInjected?"injected_agent":"none"},version:YXr},runtime:{available_processors:typeof O$.availableParallelism=="function"?O$.availableParallelism():O$.cpus().length,engine:"nodejs",libuv_threadpool_size:iMo,version:process.version.slice(1)}}})}};QXr.exports={EventSerializer:vot}});var Aot=y((HEl,tJr)=>{"use strict";var sMo=WXr(),{request:oMo}=require("http"),{request:aMo}=require("https"),{EventSerializer:cMo}=Sot(),uMo=xze(),lMo=RQ(),{storage:wot}=Fr(),fMo=Sf().version,{urlToHttpOptions:dMo}=require("url"),XXr=require("perf_hooks").performance,pMo=ch(),R$=pMo.manager.namespace("profilers"),JXr=[],hMo=R$.count("profile_api.requests",[]),mMo=R$.distribution("profile_api.bytes",[]),gMo=R$.distribution("profile_api.ms",[]),_Mo=R$.count("profile_api.errors",["type:status_code"]),ZXr=R$.count("profile_api.errors",["type:network"]);function yMo(e){let t=JXr[e];t===void 0&&(t=JXr[e]=R$.count("profile_api.responses",[`status_code:${e}`])),t.inc()}s(yMo,"countStatusCode");function bMo(e,t,r){let n=e.protocol==="https:"?aMo:oMo,i=wot("legacy").getStore();wot("legacy").enterWith({noop:!0}),hMo.inc();let o=XXr.now(),a=n(e,c=>{if(gMo.track(XXr.now()-o),yMo(c.statusCode),c.statusCode>=400){_Mo.inc();let u=new Error(`HTTP Error ${c.statusCode}`);u.status=c.statusCode,r(u)}else r(null,c)});a.on("error",c=>{ZXr.inc(),r(c)}),t&&(mMo.track(t.size()),t.pipe(a)),wot("legacy").enterWith(i)}s(bMo,"sendRequest");function EMo(e,t){let r=[];e.on("error",n=>{ZXr.inc(),t(n)}),e.on("data",n=>r.push(n)),e.on("end",()=>{t(null,Buffer.concat(r))})}s(EMo,"getBody");function eJr(e){let t=0;for(;t<2||e>1e3;)t++,e/=2;return[t,Math.floor(e)]}s(eJr,"computeRetries");var Tot=class extends cMo{static{s(this,"AgentExporter")}constructor(t={}){super(t);let{url:r,logger:n,uploadTimeout:i}=t;this._url=r,this._logger=n;let[o,a]=eJr(i);this._backoffTime=a,this._backoffTries=o}export(t){let{profiles:r}=t,n=[],i=this.getEventJSON(t);n.push(["event",i,{filename:"event.json",contentType:"application/json"}]),this._logger.debug(()=>`Building agent export report:
217
- ${i}`);for(let[o,a]of Object.entries(r)){this._logger.debug(()=>{let u=a.toString("hex").match(/../g).join(" ");return`Adding ${o} profile to agent export: `+u});let c=this.typeToFile(o);n.push([c,a,{filename:c,contentType:"application/octet-stream"}])}return new Promise((o,a)=>{let c=sMo.operation({randomize:!0,minTimeout:this._backoffTime,retries:this._backoffTries,unref:!0});c.attempt(u=>{let l=new lMo;for(let[d,p,h]of n)l.append(d,p,h);let f={method:"POST",path:"/profiling/v1/input",headers:{"DD-EVP-ORIGIN":"dd-trace-js","DD-EVP-ORIGIN-VERSION":fMo,...l.getHeaders()},timeout:this._backoffTime*2**u};if(uMo.inject(f.headers),this._url.protocol==="unix:")f.socketPath=this._url.pathname;else{let d=dMo(this._url);f.protocol=d.protocol,f.hostname=d.hostname,f.port=d.port}this._logger.debug(()=>`Submitting profiler agent report attempt #${u} to: ${JSON.stringify(f)}`),bMo(f,l,(d,p)=>{if(d){let{status:h}=d;(typeof h!="number"||h>=500||h===429)&&c.retry(d)?this._logger.warn(`Error from the agent: ${d.message}`):a(d);return}EMo(p,(h,g)=>{h?this._logger.warn(`Error reading agent response: ${h.message}`):this._logger.debug(()=>`Agent export response: ${(g.toString("hex").match(/../g)||[]).join(" ")}`)}),o()})})})}};tJr.exports={AgentExporter:Tot,computeRetries:eJr}});var Cot=y((zEl,iJr)=>{"use strict";var vMo=require("fs"),{promisify:SMo}=require("util"),{threadId:rJr}=require("worker_threads"),nJr=SMo(vMo.writeFile),{EventSerializer:wMo}=Sot(),nZ=s(e=>String(e).padStart(2,"0"),"pad");function TMo(e){return`${e.getUTCFullYear()}${nZ(e.getUTCMonth()+1)}${nZ(e.getUTCDate())}T${nZ(e.getUTCHours())}${nZ(e.getUTCMinutes())}${nZ(e.getUTCSeconds())}Z`}s(TMo,"formatDateTime");var xot=class extends wMo{static{s(this,"FileExporter")}constructor(t={}){super(t);let{pprofPrefix:r}=t;this._pprofPrefix=r||""}export(t){let{profiles:r,end:n}=t,i=Object.keys(r),o=TMo(n),a=i.map(c=>nJr(`${this._pprofPrefix}${c}_worker_${rJr}_${o}.pprof`,r[c]));return a.push(nJr(`event_worker_${rJr}_${o}.json`,this.getEventJSON(t))),Promise.all(a)}};iJr.exports={FileExporter:xot}});var Iot=y((WEl,sJr)=>{"use strict";var Oot={error:3,warn:4,info:6,debug:7},Rot=class{static{s(this,"ConsoleLogger")}constructor(t={}){this._level=Oot[t.level]||Oot.error}debug(t){this._log("debug",t)}info(t){this._log("info",t)}warn(t){this._log("warn",t)}error(t){this._log("error",t)}_log(t,r){Oot[t]>this._level||console[t](r)}};sJr.exports={ConsoleLogger:Rot}});var Dot=y((YEl,dJr)=>{"use strict";var cJr=require("fs"),u1=require("path"),uJr=require("os"),lJr=typeof __webpack_require__=="function"?__non_webpack_require__:require,AMo=!!process.env.PREBUILDS_ONLY,fJr=process.versions.modules,Not=RMo()?"electron":"node",I$=uJr.arch(),EEe=uJr.platform(),kot=process.env.LIBC||(IMo(EEe)?"musl":"glibc"),oJr=process.env.ARM_VERSION||(I$==="arm64"?"8":process.config.variables.arm_version)||"";dJr.exports=Pot;function Pot(e){return lJr(Pot.path(e))}s(Pot,"load");Pot.path=function(e){e=u1.resolve(e||".");try{var t=lJr(u1.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[t+"_PREBUILD"]&&(e=process.env[t+"_PREBUILD"])}catch{}if(!AMo){var r=iZ(u1.join(e,"build/Release"),aJr);if(r)return r;var n=iZ(u1.join(e,"build/Debug"),aJr);if(n)return n}var i=[EEe+"-"+I$];kot&&i.push(EEe+kot+"-"+I$),(I$==="arm"||I$==="arm64")&&oJr&&i.forEach(function(l){i.push(l+"-v"+oJr)});for(var o=i.length;o--;){var a=iZ(u1.join(e,"prebuilds/"+i[o]),OMo);if(a)return a;var c=iZ(u1.join(e,"prebuilds/"+i[o]),xMo);if(c)return c;var u=iZ(u1.join(e,"prebuilds/"+i[o]),CMo);if(u)return u}throw new Error("No native build was found for runtime="+Not+" abi="+fJr+" platform="+EEe+kot+" arch="+I$)};function iZ(e,t){try{var r=cJr.readdirSync(e).filter(t);return r[0]&&u1.join(e,r[0])}catch{return null}}s(iZ,"getFirst");function xMo(e){return e===Not+"-napi.node"}s(xMo,"matchNapiRuntime");function CMo(e){return e==="node-napi.node"}s(CMo,"matchNapi");function OMo(e){var t=e.split("-");return t[0]===Not&&t[1]===fJr+".node"}s(OMo,"matchPrebuild");function aJr(e){return/\.node$/.test(e)}s(aJr,"matchBuild");function RMo(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}s(RMo,"isElectron");function IMo(e){return e==="linux"&&cJr.existsSync("/etc/alpine-release")}s(IMo,"isAlpine")});var pJr=y(mh=>{"use strict";var kMo=mh&&mh.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),NMo=mh&&mh.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),PMo=mh&&mh.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&kMo(t,e,r);return NMo(t,e),t};Object.defineProperty(mh,"__esModule",{value:!0});mh.monitorOutOfMemory=mh.getAllocationProfile=mh.stopSamplingHeapProfiler=mh.startSamplingHeapProfiler=void 0;var DMo=PMo(require("path")),MMo=Dot(),vEe=MMo(DMo.join(__dirname,"..",".."));function LMo(e,t){vEe.heapProfiler.startSamplingHeapProfiler(e,t)}s(LMo,"startSamplingHeapProfiler");mh.startSamplingHeapProfiler=LMo;function qMo(){vEe.heapProfiler.stopSamplingHeapProfiler()}s(qMo,"stopSamplingHeapProfiler");mh.stopSamplingHeapProfiler=qMo;function BMo(){return vEe.heapProfiler.getAllocationProfile()}s(BMo,"getAllocationProfile");mh.getAllocationProfile=BMo;function UMo(e,t,r,n,i,o,a){vEe.heapProfiler.monitorOutOfMemory(e,t,r,n,i,o,a)}s(UMo,"monitorOutOfMemory");mh.monitorOutOfMemory=UMo});var jot=y($a=>{"use strict";var l1=$a&&$a.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},k$,N$;Object.defineProperty($a,"__esModule",{value:!0});$a.Profile=$a.Function=$a.Location=$a.Line=$a.Mapping=$a.Sample=$a.Label=$a.ValueType=$a.StringTable=$a.emptyTableToken=void 0;var hJr=2n**32n-1n,Lot=2**32-1,mJr=Lot+1,FMo=typeof Buffer>"u"?e=>new TextEncoder().encode(e):e=>Buffer.from(e,"utf8");function gJr(e){if(!e.length)return 0;let t=0;for(;t<e.length&&e[t++]>=128;);return t}s(gJr,"countNumberBytes");function jMo(e){if(!e.length)return BigInt(0);let t=BigInt(e[0]&127),r=0;for(;e[r++]>=128;)t|=BigInt(e[r]&127)<<BigInt(7*r);return t}s(jMo,"decodeBigNumber");function Mot(e,t=0){return{value:e,offset:t}}s(Mot,"makeValue");function $Mo(e,t){switch(e){case zMo:for(let r=0;r<t.length;r++)if(!(t[r]&128))return Mot(t.slice(0,r+1));return Mot(t);case VMo:{let r=gJr(t),n=Zs(t);return Mot(t.slice(r,Number(n)+r),r)}default:throw new Error(`Unrecognized value type: ${e}`)}}s($Mo,"getValue");function HMo(e){return typeof e!="bigint"?(e>>>0)%mJr:Number(e&hJr)}s(HMo,"lowBits");function GMo(e){return typeof e!="bigint"?e/mJr>>>0:Number(e>>32n&hJr)}s(GMo,"highBits");function _Jr(e){let t=e<0;t&&(e=-e);let r=HMo(e),n=GMo(e);return t&&(n=~n>>>0,r=~r>>>0,++r>Lot&&(r=0,++n>Lot&&(n=0))),[n,r]}s(_Jr,"long");var zMo=0,VMo=2;function Zs(e){if(gJr(e)>4)return jMo(e);if(!e.length)return 0;let r=e[0]&127,n=0;for(;e[n++]>=128;)r|=(e[n]&127)<<7*n;return r}s(Zs,"decodeNumber");function qot(e){let t=[],r=0;for(let n=0;n<e.length;n++)e[n]&128||(t.push(Zs(e.slice(r,n+1))),r=n+1);return t}s(qot,"decodeNumbers");function g2(e,t){return t==null?[e]:(t.push(e),t)}s(g2,"push");function P$(e){if(e===0||e===0n)return 0;let[t,r]=_Jr(e),n=r,i=(r>>>28|t<<4)>>>0,o=t>>>24;return o!==0?o<128?9:10:i!==0?i<16384?i<128?5:6:i<2097152?7:8:n<16384?n<128?1:2:n<2097152?3:4}s(P$,"measureNumber");function yJr(e){return typeof e>"u"?0:typeof e=="number"||typeof e=="bigint"?P$(e)||1:e.length}s(yJr,"measureValue");function Bot(e){let t=0;for(let r of e)t+=yJr(r);return t}s(Bot,"measureArray");function mo(e){let t=P$(e);return t?1+t:0}s(mo,"measureNumberField");function Uot(e){let t=0;for(let r of e)t+=P$(r)||1;return t?1+P$(t)+t:0}s(Uot,"measureNumberArrayField");function bJr(e){let t=yJr(e);return t?1+P$(t)+t:0}s(bJr,"measureLengthDelimField");function _2(e){let t=0;for(let r of e)t+=bJr(r);return t}s(_2,"measureLengthDelimArrayField");function mi(e,t,r){if(r===0||r===0n)return e[t++]=0,t;let[n,i]=_Jr(r);for(;n;)e[t++]=i&127|128,i=(i>>>7|n<<25)>>>0,n>>>=7;for(;i>127;)e[t++]=i&127|128,i=i>>>7;return e[t++]=i,t}s(mi,"encodeNumber");$a.emptyTableToken=Symbol();var sZ=class e{static{s(this,"StringTable")}constructor(t){this.strings=new Array,k$.set(this,new Array),N$.set(this,new Map),t!==$a.emptyTableToken&&this.dedup("")}get encodedLength(){let t=0;for(let r of l1(this,k$,"f"))t+=r.length;return t}_encodeToBuffer(t,r){for(let n of l1(this,k$,"f"))t.set(n,r),r+=n.length;return r}encode(t=new Uint8Array(this.encodedLength)){return this._encodeToBuffer(t,0),t}static _encodeStringFromUtf8(t){let r=new Uint8Array(1+t.length+(P$(t.length)||1)),n=0;return r[n++]=50,n=mi(r,n,t.length),t.length>0&&r.set(t,n++),r}static _encodeString(t){return e._encodeStringFromUtf8(FMo(t))}dedup(t){if(typeof t=="number")return t;if(!l1(this,N$,"f").has(t)){let r=this.strings.push(t)-1;l1(this,N$,"f").set(t,r),l1(this,k$,"f").push(e._encodeString(t))}return l1(this,N$,"f").get(t)}_decodeString(t){let r=new TextDecoder().decode(t);l1(this,N$,"f").set(r,this.strings.push(r)-1),l1(this,k$,"f").push(e._encodeStringFromUtf8(t))}};$a.StringTable=sZ;k$=new WeakMap,N$=new WeakMap;function f1(e,t){let r={},n=0;for(;n<e.length;){let i=e[n]>>3,o=e[n]&7;n++;let{offset:a,value:c}=$Mo(o,e.slice(n));n+=c.length+a,t(r,i,c)}return r}s(f1,"decode");var y2=class{static{s(this,"ValueType")}constructor(t){this.type=t.type||0,this.unit=t.unit||0}get length(){let t=0;return t+=mo(this.type),t+=mo(this.unit),t}_encodeToBuffer(t,r=0){return this.type&&(t[r++]=8,r=mi(t,r,this.type)),this.unit&&(t[r++]=16,r=mi(t,r,this.unit)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.type=Zs(n);break;case 2:t.unit=Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.ValueType=y2;var oZ=class{static{s(this,"Label")}constructor(t){this.key=t.key||0,this.str=t.str||0,this.num=t.num||0,this.numUnit=t.numUnit||0}get length(){let t=0;return t+=mo(this.key),t+=mo(this.str),t+=mo(this.num),t+=mo(this.numUnit),t}_encodeToBuffer(t,r=0){return this.key&&(t[r++]=8,r=mi(t,r,this.key)),this.str&&(t[r++]=16,r=mi(t,r,this.str)),this.num&&(t[r++]=24,r=mi(t,r,this.num)),this.numUnit&&(t[r++]=32,r=mi(t,r,this.numUnit)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.key=Zs(n);break;case 2:t.str=Zs(n);break;case 3:t.num=Zs(n);break;case 4:t.numUnit=Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Label=oZ;var aZ=class{static{s(this,"Sample")}constructor(t){this.locationId=t.locationId||[],this.value=t.value||[],this.label=(t.label||[]).map(r=>new oZ(r))}get length(){let t=0;return t+=Uot(this.locationId),t+=Uot(this.value),t+=_2(this.label),t}_encodeToBuffer(t,r=0){if(this.locationId.length){t[r++]=10,r=mi(t,r,Bot(this.locationId));for(let n of this.locationId)r=mi(t,r,n)}if(this.value.length){t[r++]=18,r=mi(t,r,Bot(this.value));for(let n of this.value)r=mi(t,r,n)}for(let n of this.label)t[r++]=26,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.locationId=qot(n);break;case 2:t.value=qot(n);break;case 3:t.label=g2(oZ.decode(n),t.label);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Sample=aZ;var cZ=class{static{s(this,"Mapping")}constructor(t){this.id=t.id||0,this.memoryStart=t.memoryStart||0,this.memoryLimit=t.memoryLimit||0,this.fileOffset=t.fileOffset||0,this.filename=t.filename||0,this.buildId=t.buildId||0,this.hasFunctions=!!t.hasFunctions,this.hasFilenames=!!t.hasFilenames,this.hasLineNumbers=!!t.hasLineNumbers,this.hasInlineFrames=!!t.hasInlineFrames}get length(){let t=0;return t+=mo(this.id),t+=mo(this.memoryStart),t+=mo(this.memoryLimit),t+=mo(this.fileOffset),t+=mo(this.filename),t+=mo(this.buildId),t+=mo(this.hasFunctions?1:0),t+=mo(this.hasFilenames?1:0),t+=mo(this.hasLineNumbers?1:0),t+=mo(this.hasInlineFrames?1:0),t}_encodeToBuffer(t,r=0){return this.id&&(t[r++]=8,r=mi(t,r,this.id)),this.memoryStart&&(t[r++]=16,r=mi(t,r,this.memoryStart)),this.memoryLimit&&(t[r++]=24,r=mi(t,r,this.memoryLimit)),this.fileOffset&&(t[r++]=32,r=mi(t,r,this.fileOffset)),this.filename&&(t[r++]=40,r=mi(t,r,this.filename)),this.buildId&&(t[r++]=48,r=mi(t,r,this.buildId)),this.hasFunctions&&(t[r++]=56,r=mi(t,r,1)),this.hasFilenames&&(t[r++]=64,r=mi(t,r,1)),this.hasLineNumbers&&(t[r++]=72,r=mi(t,r,1)),this.hasInlineFrames&&(t[r++]=80,r=mi(t,r,1)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.id=Zs(n);break;case 2:t.memoryStart=Zs(n);break;case 3:t.memoryLimit=Zs(n);break;case 4:t.fileOffset=Zs(n);break;case 5:t.filename=Zs(n);break;case 6:t.buildId=Zs(n);break;case 7:t.hasFunctions=!!Zs(n);break;case 8:t.hasFilenames=!!Zs(n);break;case 9:t.hasLineNumbers=!!Zs(n);break;case 10:t.hasInlineFrames=!!Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Mapping=cZ;var uZ=class{static{s(this,"Line")}constructor(t){this.functionId=t.functionId||0,this.line=t.line||0}get length(){let t=0;return t+=mo(this.functionId),t+=mo(this.line),t}_encodeToBuffer(t,r=0){return this.functionId&&(t[r++]=8,r=mi(t,r,this.functionId)),this.line&&(t[r++]=16,r=mi(t,r,this.line)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.functionId=Zs(n);break;case 2:t.line=Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Line=uZ;var lZ=class{static{s(this,"Location")}constructor(t){this.id=t.id||0,this.mappingId=t.mappingId||0,this.address=t.address||0,this.line=(t.line||[]).map(r=>new uZ(r)),this.isFolded=!!t.isFolded}get length(){let t=0;return t+=mo(this.id),t+=mo(this.mappingId),t+=mo(this.address),t+=_2(this.line),t+=mo(this.isFolded?1:0),t}_encodeToBuffer(t,r=0){this.id&&(t[r++]=8,r=mi(t,r,this.id)),this.mappingId&&(t[r++]=16,r=mi(t,r,this.mappingId)),this.address&&(t[r++]=24,r=mi(t,r,this.address));for(let n of this.line)t[r++]=34,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return this.isFolded&&(t[r++]=40,r=mi(t,r,1)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.id=Zs(n);break;case 2:t.mappingId=Zs(n);break;case 3:t.address=Zs(n);break;case 4:t.line=g2(uZ.decode(n),t.line);break;case 5:t.isFolded=!!Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Location=lZ;var fZ=class{static{s(this,"Function")}constructor(t){this.id=t.id||0,this.name=t.name||0,this.systemName=t.systemName||0,this.filename=t.filename||0,this.startLine=t.startLine||0}get length(){let t=0;return t+=mo(this.id),t+=mo(this.name),t+=mo(this.systemName),t+=mo(this.filename),t+=mo(this.startLine),t}_encodeToBuffer(t,r=0){return this.id&&(t[r++]=8,r=mi(t,r,this.id)),this.name&&(t[r++]=16,r=mi(t,r,this.name)),this.systemName&&(t[r++]=24,r=mi(t,r,this.systemName)),this.filename&&(t[r++]=32,r=mi(t,r,this.filename)),this.startLine&&(t[r++]=40,r=mi(t,r,this.startLine)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.id=Zs(n);break;case 2:t.name=Zs(n);break;case 3:t.systemName=Zs(n);break;case 4:t.filename=Zs(n);break;case 5:t.startLine=Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Function=fZ;var Fot=class{static{s(this,"Profile")}constructor(t={}){this.sampleType=(t.sampleType||[]).map(r=>new y2(r)),this.sample=(t.sample||[]).map(r=>new aZ(r)),this.mapping=(t.mapping||[]).map(r=>new cZ(r)),this.location=(t.location||[]).map(r=>new lZ(r)),this.function=(t.function||[]).map(r=>new fZ(r)),this.stringTable=t.stringTable||new sZ,this.dropFrames=t.dropFrames||0,this.keepFrames=t.keepFrames||0,this.timeNanos=t.timeNanos||0,this.durationNanos=t.durationNanos||0,this.periodType=t.periodType?new y2(t.periodType):void 0,this.period=t.period||0,this.comment=t.comment||[],this.defaultSampleType=t.defaultSampleType||0}get length(){let t=0;return t+=_2(this.sampleType),t+=_2(this.sample),t+=_2(this.mapping),t+=_2(this.location),t+=_2(this.function),t+=this.stringTable.encodedLength,t+=mo(this.dropFrames),t+=mo(this.keepFrames),t+=mo(this.timeNanos),t+=mo(this.durationNanos),t+=bJr(this.periodType),t+=mo(this.period),t+=Uot(this.comment),t+=mo(this.defaultSampleType),t}_encodeSampleTypesToBuffer(t,r=0){for(let n of this.sampleType)t[r++]=10,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}_encodeSamplesToBuffer(t,r=0){for(let n of this.sample)t[r++]=18,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}_encodeMappingsToBuffer(t,r=0){for(let n of this.mapping)t[r++]=26,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}_encodeLocationsToBuffer(t,r=0){for(let n of this.location)t[r++]=34,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}_encodeFunctionsToBuffer(t,r=0){for(let n of this.function)t[r++]=42,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}_encodeBasicValuesToBuffer(t,r=0){if(this.dropFrames&&(t[r++]=56,r=mi(t,r,this.dropFrames)),this.keepFrames&&(t[r++]=64,r=mi(t,r,this.keepFrames)),this.timeNanos&&(t[r++]=72,r=mi(t,r,this.timeNanos)),this.durationNanos&&(t[r++]=80,r=mi(t,r,this.durationNanos)),typeof this.periodType<"u"&&(t[r++]=90,r=mi(t,r,this.periodType.length),r=this.periodType._encodeToBuffer(t,r)),this.period&&(t[r++]=96,r=mi(t,r,this.period)),this.comment.length){t[r++]=106,r=mi(t,r,Bot(this.comment));for(let n of this.comment)r=mi(t,r,n)}return this.defaultSampleType&&(t[r++]=112,r=mi(t,r,this.defaultSampleType)),r}_encodeToBuffer(t,r=0){return r=this._encodeSampleTypesToBuffer(t,r),r=this._encodeSamplesToBuffer(t,r),r=this._encodeMappingsToBuffer(t,r),r=this._encodeLocationsToBuffer(t,r),r=this._encodeFunctionsToBuffer(t,r),r=this.stringTable._encodeToBuffer(t,r),r=this._encodeBasicValuesToBuffer(t,r),r}async _encodeToBufferAsync(t,r=0){return r=this._encodeSampleTypesToBuffer(t,r),await new Promise(setImmediate),r=this._encodeSamplesToBuffer(t,r),await new Promise(setImmediate),r=this._encodeMappingsToBuffer(t,r),await new Promise(setImmediate),r=this._encodeLocationsToBuffer(t,r),await new Promise(setImmediate),r=this._encodeFunctionsToBuffer(t,r),await new Promise(setImmediate),r=this.stringTable._encodeToBuffer(t,r),await new Promise(setImmediate),r=this._encodeBasicValuesToBuffer(t,r),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}async encodeAsync(t=new Uint8Array(this.length)){return await this._encodeToBufferAsync(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.sampleType=g2(y2.decode(n),t.sampleType);break;case 2:t.sample=g2(aZ.decode(n),t.sample);break;case 3:t.mapping=g2(cZ.decode(n),t.mapping);break;case 4:t.location=g2(lZ.decode(n),t.location);break;case 5:t.function=g2(fZ.decode(n),t.function);break;case 6:{t.stringTable===void 0&&(t.stringTable=new sZ($a.emptyTableToken)),t.stringTable._decodeString(n);break}case 7:t.dropFrames=Zs(n);break;case 8:t.keepFrames=Zs(n);break;case 9:t.timeNanos=Zs(n);break;case 10:t.durationNanos=Zs(n);break;case 11:t.periodType=y2.decode(n);break;case 12:t.period=Zs(n);break;case 13:t.comment=qot(n);break;case 14:t.defaultSampleType=Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Profile=Fot});var Hot=y(Vb=>{"use strict";Object.defineProperty(Vb,"__esModule",{value:!0});Vb.serializeHeapProfile=Vb.serializeTimeProfile=Vb.GARBAGE_COLLECTION_FUNCTION_NAME=Vb.NON_JS_THREADS_FUNCTION_NAME=void 0;var gh=jot();Vb.NON_JS_THREADS_FUNCTION_NAME="Non JS threads activity";Vb.GARBAGE_COLLECTION_FUNCTION_NAME="Garbage Collection";function WMo(e){return e.column!==void 0&&e.line!==void 0&&e.line>0}s(WMo,"isGeneratedLocation");function EJr(e,t,r,n,i,o){let a=[],c=[],u=[],l=new Map,f=new Map,d=t.children.map(b=>({node:b,stack:[]}));for(;d.length>0;){let b=d.pop(),v=b.node;if(v.scriptName.startsWith("file://")&&(v.scriptName=v.scriptName.slice(7)),i&&v.scriptName.indexOf(i)>-1)continue;let S=b.stack,C=p(v,o);S.unshift(C.id),r(b,a);for(let R of v.children)d.push({node:R,stack:S.slice()})}e.sample=a,e.location=c,e.function=u,e.stringTable=n;function p(b,v){let S={file:b.scriptName||"",line:b.lineNumber,column:b.columnNumber,name:b.name};S.line&&v&&WMo(S)&&(S=v.mappingInfo(S));let C=`${b.scriptId}:${S.line}:${S.column}:${S.name}`,R=f.get(C);if(R!==void 0)return c[R-1];R=c.length+1,f.set(C,R);let N=h(S,b.scriptId),A=new gh.Location({id:R,line:[N]});return c.push(A),A}s(p,"getLocation");function h(b,v){return new gh.Line({functionId:g(b,v).id,line:b.line})}s(h,"getLine");function g(b,v){let S=b.name,C=S?`${v}:${S}`:`${v}:${b.line}:${b.column}`,R=l.get(C);if(R!==void 0)return u[R-1];R=u.length+1,l.set(C,R),S||(b.line?b.column?S=`(anonymous:L#${b.line}:C#${b.column})`:S=`(anonymous:L#${b.line})`:S="(anonymous)");let N=n.dedup(S),A=new gh.Function({id:R,name:N,systemName:N,filename:n.dedup(b.file||"")});return u.push(A),A}s(g,"getFunction")}s(EJr,"serialize");function KMo(e){return new gh.ValueType({type:e.dedup("sample"),unit:e.dedup("count")})}s(KMo,"createSampleCountValueType");function YMo(e){return new gh.ValueType({type:e.dedup("wall"),unit:e.dedup("nanoseconds")})}s(YMo,"createTimeValueType");function QMo(e){return new gh.ValueType({type:e.dedup("cpu"),unit:e.dedup("nanoseconds")})}s(QMo,"createCpuValueType");function XMo(e){return new gh.ValueType({type:e.dedup("objects"),unit:e.dedup("count")})}s(XMo,"createObjectCountValueType");function JMo(e){return new gh.ValueType({type:e.dedup("space"),unit:e.dedup("bytes")})}s(JMo,"createAllocationValueType");function vJr(e){return e.hitCount+e.children.reduce((t,r)=>t+vJr(r),0)}s(vJr,"computeTotalHitCount");function ZMo(e){let t=[],r;function n(){return r||(r={name:"Node.js",scriptName:"",scriptId:0,lineNumber:0,columnNumber:0,children:[],hitCount:0},t.push(r)),r}s(n,"getRuntimeNode");for(let i of e.topDownRoot.children)if(i.name!=="(program)"&&!(i.name==="(idle)"&&i.contexts?.length===0))if(i.name==="(garbage collector)"){let o={...i,name:Vb.GARBAGE_COLLECTION_FUNCTION_NAME};n().children.push(o)}else t.push(i);if(e.hasCpuTime&&e.nonJSThreadsCpuTime){let i={name:Vb.NON_JS_THREADS_FUNCTION_NAME,scriptName:"",scriptId:0,lineNumber:0,columnNumber:0,children:[],hitCount:0,contexts:[{context:{},timestamp:BigInt(0),cpuTime:e.nonJSThreadsCpuTime,asyncId:-1}]};n().children.push(i)}return{...e,topDownRoot:{...e.topDownRoot,children:t}}}s(ZMo,"updateTimeProfile");function eLo(e,t,r,n=!1,i){if(n){let h=vJr(e.topDownRoot);h>0&&(t=Math.min(Math.max(Math.floor((e.endTime-e.startTime)/h),t),2*t))}let o=t*1e3,a=s((h,g)=>{let b=h.node.hitCount,v=0,S=h.node.name==="(idle)";for(let C of h.node.contexts||[]){let R=i?i({node:h.node,context:C}):C.context??{};if(Object.keys(R).length>0){let N=b>0?[1,S?0:o]:[0,0];e.hasCpuTime&&N.push(C.cpuTime??0);let A=new gh.Sample({locationId:h.stack,value:N,label:$ot(R,c)});g.push(A),b--}else e.hasCpuTime&&(v+=C.cpuTime??0)}if(!S&&b>0||v>0){let C=i?i({node:h.node}):{},R=b>0?[b,S?0:b*o]:[0,0];e.hasCpuTime&&R.push(v);let N=new gh.Sample({locationId:h.stack,value:R,label:$ot(C,c)});g.push(N)}},"appendTimeEntryToSamples"),c=new gh.StringTable,u=KMo(c),l=YMo(c),f=[u,l];if(e.hasCpuTime){let h=QMo(c);f.push(h)}let d={sampleType:f,timeNanos:Date.now()*1e3*1e3,durationNanos:(e.endTime-e.startTime)*1e3,periodType:l,period:o},p=ZMo(e);return EJr(d,p.topDownRoot,a,c,void 0,r),new gh.Profile(d)}s(eLo,"serializeTimeProfile");Vb.serializeTimeProfile=eLo;function $ot(e,t){let r=[];for(let[n,i]of Object.entries(e)){let o={key:t.dedup(n)};switch(typeof i){case"string":o.str=t.dedup(i);break;case"number":case"bigint":o.num=i;break;default:continue}r.push(new gh.Label(o))}return r}s($ot,"buildLabels");function tLo(e,t,r,n,i,o){let a=s((d,p)=>{if(d.node.allocations.length>0){let h=o?$ot(o({node:d.node}),c):[];for(let g of d.node.allocations){let b=new gh.Sample({locationId:d.stack,value:[g.count,g.sizeBytes*g.count],label:h});p.push(b)}}},"appendHeapEntryToSamples"),c=new gh.StringTable,u=XMo(c),l=JMo(c),f={sampleType:[u,l],timeNanos:t,periodType:l,period:r};return EJr(f,e,a,c,n,i),new gh.Profile(f)}s(tLo,"serializeHeapProfile");Vb.serializeHeapProfile=tLo});var TJr=y(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.monitorOutOfMemory=hp.CallbackMode=hp.stop=hp.start=hp.convertProfile=hp.profile=hp.v8Profile=void 0;var wEe=pJr(),rLo=Hot(),nLo=require("worker_threads"),D$=!1,SEe=0,SJr=0;function wJr(){if(!D$)throw new Error("Heap profiler is not enabled.");return(0,wEe.getAllocationProfile)()}s(wJr,"v8Profile");hp.v8Profile=wJr;function iLo(e,t,r){return Got(wJr(),e,t,r)}s(iLo,"profile");hp.profile=iLo;function Got(e,t,r,n){let i=Date.now()*1e3*1e3,{external:o}=process.memoryUsage();if(o>0){let a={name:"(external)",scriptName:"",children:[],allocations:[{sizeBytes:o,count:1}]};e.children.push(a)}return(0,rLo.serializeHeapProfile)(e,i,SEe,t,r,n)}s(Got,"convertProfile");hp.convertProfile=Got;function sLo(e,t){if(D$)throw new Error(`Heap profiler is already started with intervalBytes ${SEe} and stackDepth ${t}`);SEe=e,SJr=t,(0,wEe.startSamplingHeapProfiler)(SEe,SJr),D$=!0}s(sLo,"start");hp.start=sLo;function oLo(){D$&&(D$=!1,(0,wEe.stopSamplingHeapProfiler)())}s(oLo,"stop");hp.stop=oLo;hp.CallbackMode={Async:1,Interrupt:2,Both:3};function aLo(e,t,r,n,i,o){if(!D$)throw new Error("Heap profiler must already be started to call monitorOutOfMemory");let a;typeof i<"u"&&(a=s(c=>{i(Got(c))},"newCallback")),(0,wEe.monitorOutOfMemory)(e,t,r,n||[],a,typeof o<"u"?o:hp.CallbackMode.Async,nLo.isMainThread)}s(aLo,"monitorOutOfMemory");hp.monitorOutOfMemory=aLo});var zot=y(M$=>{"use strict";Object.defineProperty(M$,"__esModule",{value:!0});M$.encodeSync=M$.encode=void 0;var cLo=require("util"),AJr=require("zlib"),uLo=(0,cLo.promisify)(AJr.gzip);function lLo(e){return e.encodeAsync().then(uLo)}s(lLo,"encode");M$.encode=lLo;function fLo(e){return(0,AJr.gzipSync)(e.encode())}s(fLo,"encodeSync");M$.encodeSync=fLo});var RJr=y((avl,Wot)=>{"use strict";var dLo=s((e,t)=>Math.floor(Math.random()*(t-e+1)+e),"randomInteger"),xJr=s(()=>{let e=new Error("Delay aborted");return e.name="AbortError",e},"createAbortError"),CJr=s(({clearTimeout:e,setTimeout:t,willResolve:r})=>(n,{value:i,signal:o}={})=>{if(o&&o.aborted)return Promise.reject(xJr());let a,c,u,l=e||clearTimeout,f=s(()=>{l(a),u(xJr())},"signalListener"),d=s(()=>{o&&o.removeEventListener("abort",f)},"cleanup"),p=new Promise((h,g)=>{c=s(()=>{d(),r?h(i):g(i)},"settle"),u=g,a=(t||setTimeout)(c,n)});return o&&o.addEventListener("abort",f,{once:!0}),p.clear=()=>{l(a),a=null,c()},p},"createDelay"),OJr=s(e=>{let t=CJr({...e,willResolve:!0});return t.reject=CJr({...e,willResolve:!1}),t.range=(r,n,i)=>t(dLo(r,n),i),t},"createWithTimers"),Vot=OJr();Vot.createWithTimers=OJr;Wot.exports=Vot;Wot.exports.default=Vot});var IJr=y(d1=>{"use strict";Object.defineProperty(d1,"__esModule",{value:!0});d1.getNativeThreadId=d1.constants=d1.TimeProfiler=void 0;var pLo=require("path"),hLo=Dot(),Kot=hLo((0,pLo.join)(__dirname,"..",".."));d1.TimeProfiler=Kot.TimeProfiler;d1.constants=Kot.constants;d1.getNativeThreadId=Kot.getNativeThreadId});var Zot=y(Gc=>{"use strict";var mLo=Gc&&Gc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.getNativeThreadId=Gc.constants=Gc.v8ProfilerStuckEventLoopDetected=Gc.isStarted=Gc.getContext=Gc.setContext=Gc.getState=Gc.stop=Gc.start=Gc.profile=void 0;var gLo=mLo(RJr()),Yot=Hot(),Xot=IJr();Object.defineProperty(Gc,"getNativeThreadId",{enumerable:!0,get:function(){return Xot.getNativeThreadId}});var _Lo=require("worker_threads"),{kSampleCount:yLo}=Xot.constants,bLo=1e3,ELo=6e4,mp,Qot,kJr,dZ=0;process.once("exit",()=>{MJr()&&Jot()});var NJr={durationMillis:ELo,intervalMicros:bLo,lineNumbers:!1,withContexts:!1,workaroundV8Bug:!0,collectCpuTime:!1,collectAsyncId:!1};async function vLo(e={}){return e={...NJr,...e},PJr(e),await(0,gLo.default)(e.durationMillis),Jot()}s(vLo,"profile");Gc.profile=vLo;function PJr(e={}){if(e={...NJr,...e},mp)throw new Error("Wall profiler is already started");mp=new Xot.TimeProfiler({...e,isMainThread:_Lo.isMainThread}),Qot=e.sourceMapper,kJr=e.intervalMicros,dZ=0,mp.start(),e.withContexts&&DJr({})}s(PJr,"start");Gc.start=PJr;function Jot(e=!1,t){if(!mp)throw new Error("Wall profiler is not started");let r=mp.stop(e);e?(dZ=mp.v8ProfilerStuckEventLoopDetected(),dZ>0&&(mp.stop(!1),mp.start())):dZ=0;let n=(0,Yot.serializeTimeProfile)(r,kJr,Qot,!0,t);return e||(mp.dispose(),mp=void 0,Qot=void 0),n}s(Jot,"stop");Gc.stop=Jot;function SLo(){if(!mp)throw new Error("Wall profiler is not started");return mp.state}s(SLo,"getState");Gc.getState=SLo;function DJr(e){if(!mp)throw new Error("Wall profiler is not started");mp.context=e}s(DJr,"setContext");Gc.setContext=DJr;function wLo(){if(!mp)throw new Error("Wall profiler is not started");return mp.context}s(wLo,"getContext");Gc.getContext=wLo;function MJr(){return!!mp}s(MJr,"isStarted");Gc.isStarted=MJr;function TLo(){return dZ}s(TLo,"v8ProfilerStuckEventLoopDetected");Gc.v8ProfilerStuckEventLoopDetected=TLo;Gc.constants={kSampleCount:yLo,GARBAGE_COLLECTION_FUNCTION_NAME:Yot.GARBAGE_COLLECTION_FUNCTION_NAME,NON_JS_THREADS_FUNCTION_NAME:Yot.NON_JS_THREADS_FUNCTION_NAME}});var BJr=y(qJr=>{"use strict";var LJr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");qJr.encode=function(e){if(0<=e&&e<LJr.length)return LJr[e];throw new TypeError("Must be between 0 and 63: "+e)}});var eat=y(jJr=>{"use strict";var ALo=BJr(),UJr=5,FJr=1<<UJr,xLo=FJr-1,CLo=FJr;function OLo(e){return e<0?(-e<<1)+1:(e<<1)+0}s(OLo,"toVLQSigned");jJr.encode=s(function(t){let r="",n,i=OLo(t);do n=i&xLo,i>>>=UJr,i>0&&(n|=CLo),r+=ALo.encode(n);while(i>0);return r},"base64VLQ_encode")});var HJr=y((mvl,$Jr)=>{"use strict";$Jr.exports=typeof URL=="function"?URL:require("url").URL});var mZ=y(Aw=>{"use strict";var h1=HJr();function RLo(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}s(RLo,"getArg");Aw.getArg=RLo;var zJr=function(){return!("__proto__"in Object.create(null))}();function VJr(e){return e}s(VJr,"identity");function ILo(e){return WJr(e)?"$"+e:e}s(ILo,"toSetString");Aw.toSetString=zJr?VJr:ILo;function kLo(e){return WJr(e)?e.slice(1):e}s(kLo,"fromSetString");Aw.fromSetString=zJr?VJr:kLo;function WJr(e){if(!e)return!1;let t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(let r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}s(WJr,"isProtoString");function GJr(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}s(GJr,"strcmp");function NLo(e,t){let r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=GJr(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:GJr(e.name,t.name)}s(NLo,"compareByGeneratedPositionsInflated");Aw.compareByGeneratedPositionsInflated=NLo;function PLo(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}s(PLo,"parseSourceMapInput");Aw.parseSourceMapInput=PLo;var rat="http:",pZ=`${rat}//host`;function nat(e){return t=>{let r=L$(t),n=iat(t),i=new h1(t,n);e(i);let o=i.toString();return r==="absolute"?o:r==="scheme-relative"?o.slice(rat.length):r==="path-absolute"?o.slice(pZ.length):sat(n,o)}}s(nat,"createSafeHandler");function p1(e,t){return new h1(e,t).toString()}s(p1,"withBase");function DLo(e,t){let r=0;do{let n=e+r++;if(t.indexOf(n)===-1)return n}while(!0)}s(DLo,"buildUniqueSegment");function iat(e){let t=e.split("..").length-1,r=DLo("p",e),n=`${pZ}/`;for(let i=0;i<t;i++)n+=`${r}/`;return n}s(iat,"buildSafeBase");var MLo=/^[A-Za-z0-9\+\-\.]+:/;function L$(e){return e[0]==="/"?e[1]==="/"?"scheme-relative":"path-absolute":MLo.test(e)?"absolute":"path-relative"}s(L$,"getURLType");function sat(e,t){typeof e=="string"&&(e=new h1(e)),typeof t=="string"&&(t=new h1(t));let r=t.pathname.split("/"),n=e.pathname.split("/");for(n.length>0&&!n[n.length-1]&&n.pop();r.length>0&&n.length>0&&r[0]===n[0];)r.shift(),n.shift();return n.map(()=>"..").concat(r).join("/")+t.search+t.hash}s(sat,"computeRelativeURL");var LLo=nat(e=>{e.pathname=e.pathname.replace(/\/?$/,"/")}),qLo=nat(e=>{e.href=new h1(".",e.toString()).toString()}),hZ=nat(e=>{});Aw.normalize=hZ;function tat(e,t){let r=L$(t),n=L$(e);if(e=LLo(e),r==="absolute")return p1(t,void 0);if(n==="absolute")return p1(t,e);if(r==="scheme-relative")return hZ(t);if(n==="scheme-relative")return p1(t,p1(e,pZ)).slice(rat.length);if(r==="path-absolute")return hZ(t);if(n==="path-absolute")return p1(t,p1(e,pZ)).slice(pZ.length);let i=iat(t+e),o=p1(t,p1(e,i));return sat(i,o)}s(tat,"join");Aw.join=tat;function BLo(e,t){let r=ULo(e,t);return typeof r=="string"?r:hZ(t)}s(BLo,"relative");Aw.relative=BLo;function ULo(e,t){if(L$(e)!==L$(t))return null;let n=iat(e+t),i=new h1(e,n),o=new h1(t,n);try{new h1("",o.toString())}catch{return null}return o.protocol!==i.protocol||o.user!==i.user||o.password!==i.password||o.hostname!==i.hostname||o.port!==i.port?null:sat(i,o)}s(ULo,"relativeIfPossible");function FLo(e,t,r){e&&L$(t)==="path-absolute"&&(t=t.replace(/^\//,""));let n=hZ(t||"");return e&&(n=tat(e,n)),r&&(n=tat(qLo(r),n)),n}s(FLo,"computeSourceURL");Aw.computeSourceURL=FLo});var aat=y(KJr=>{"use strict";var oat=class e{static{s(this,"ArraySet")}constructor(){this._array=[],this._set=new Map}static fromArray(t,r){let n=new e;for(let i=0,o=t.length;i<o;i++)n.add(t[i],r);return n}size(){return this._set.size}add(t,r){let n=this.has(t),i=this._array.length;(!n||r)&&this._array.push(t),n||this._set.set(t,i)}has(t){return this._set.has(t)}indexOf(t){let r=this._set.get(t);if(r>=0)return r;throw new Error('"'+t+'" is not in the set.')}at(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)}toArray(){return this._array.slice()}};KJr.ArraySet=oat});var XJr=y(QJr=>{"use strict";var YJr=mZ();function jLo(e,t){let r=e.generatedLine,n=t.generatedLine,i=e.generatedColumn,o=t.generatedColumn;return n>r||n==r&&o>=i||YJr.compareByGeneratedPositionsInflated(e,t)<=0}s(jLo,"generatedPositionAfter");var cat=class{static{s(this,"MappingList")}constructor(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}unsortedForEach(t,r){this._array.forEach(t,r)}add(t){jLo(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(YJr.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}};QJr.MappingList=cat});var uat=y(JJr=>{"use strict";var gZ=eat(),Fl=mZ(),TEe=aat().ArraySet,$Lo=XJr().MappingList,AEe=class e{static{s(this,"SourceMapGenerator")}constructor(t){t||(t={}),this._file=Fl.getArg(t,"file",null),this._sourceRoot=Fl.getArg(t,"sourceRoot",null),this._skipValidation=Fl.getArg(t,"skipValidation",!1),this._sources=new TEe,this._names=new TEe,this._mappings=new $Lo,this._sourcesContents=null}static fromSourceMap(t){let r=t.sourceRoot,n=new e({file:t.file,sourceRoot:r});return t.eachMapping(function(i){let o={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(o.source=i.source,r!=null&&(o.source=Fl.relative(r,o.source)),o.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(o.name=i.name)),n.addMapping(o)}),t.sources.forEach(function(i){let o=i;r!=null&&(o=Fl.relative(r,i)),n._sources.has(o)||n._sources.add(o);let a=t.sourceContentFor(i);a!=null&&n.setSourceContent(i,a)}),n}addMapping(t){let r=Fl.getArg(t,"generated"),n=Fl.getArg(t,"original",null),i=Fl.getArg(t,"source",null),o=Fl.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,i,o),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n&&n.line,originalColumn:n&&n.column,source:i,name:o})}setSourceContent(t,r){let n=t;this._sourceRoot!=null&&(n=Fl.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Fl.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Fl.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))}applySourceMap(t,r,n){let i=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=t.file}let o=this._sourceRoot;o!=null&&(i=Fl.relative(o,i));let a=this._mappings.toArray().length>0?new TEe:this._sources,c=new TEe;this._mappings.unsortedForEach(function(u){if(u.source===i&&u.originalLine!=null){let d=t.originalPositionFor({line:u.originalLine,column:u.originalColumn});d.source!=null&&(u.source=d.source,n!=null&&(u.source=Fl.join(n,u.source)),o!=null&&(u.source=Fl.relative(o,u.source)),u.originalLine=d.line,u.originalColumn=d.column,d.name!=null&&(u.name=d.name))}let l=u.source;l!=null&&!a.has(l)&&a.add(l);let f=u.name;f!=null&&!c.has(f)&&c.add(f)},this),this._sources=a,this._names=c,t.sources.forEach(function(u){let l=t.sourceContentFor(u);l!=null&&(n!=null&&(u=Fl.join(n,u)),o!=null&&(u=Fl.relative(o,u)),this.setSourceContent(u,l))},this)}_validateMapping(t,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!i)){if(!(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:i}))}}_serializeMappings(){let t=0,r=1,n=0,i=0,o=0,a=0,c="",u,l,f,d,p=this._mappings.toArray();for(let h=0,g=p.length;h<g;h++){if(l=p[h],u="",l.generatedLine!==r)for(t=0;l.generatedLine!==r;)u+=";",r++;else if(h>0){if(!Fl.compareByGeneratedPositionsInflated(l,p[h-1]))continue;u+=","}u+=gZ.encode(l.generatedColumn-t),t=l.generatedColumn,l.source!=null&&(d=this._sources.indexOf(l.source),u+=gZ.encode(d-a),a=d,u+=gZ.encode(l.originalLine-1-i),i=l.originalLine-1,u+=gZ.encode(l.originalColumn-n),n=l.originalColumn,l.name!=null&&(f=this._names.indexOf(l.name),u+=gZ.encode(f-o),o=f)),c+=u}return c}_generateSourcesContent(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Fl.relative(r,n));let i=Fl.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)}toJSON(){let t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t}toString(){return JSON.stringify(this.toJSON())}};AEe.prototype._version=3;JJr.SourceMapGenerator=AEe});var ZJr=y(b2=>{"use strict";b2.GREATEST_LOWER_BOUND=1;b2.LEAST_UPPER_BOUND=2;function lat(e,t,r,n,i,o){let a=Math.floor((t-e)/2)+e,c=i(r,n[a],!0);return c===0?a:c>0?t-a>1?lat(a,t,r,n,i,o):o===b2.LEAST_UPPER_BOUND?t<n.length?t:-1:a:a-e>1?lat(e,a,r,n,i,o):o==b2.LEAST_UPPER_BOUND?a:e<0?-1:e}s(lat,"recursiveSearch");b2.search=s(function(t,r,n,i){if(r.length===0)return-1;let o=lat(-1,r.length,t,r,n,i||b2.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&n(r[o],r[o-1],!0)===0;)--o;return o},"search")});var dat=y((xvl,fat)=>{"use strict";var HLo=require("fs"),GLo=require("path");fat.exports=s(function(){return new Promise((t,r)=>{let n=GLo.join(__dirname,"mappings.wasm");HLo.readFile(n,null,(i,o)=>{if(i){r(i);return}t(o.buffer)})})},"readWasm");fat.exports.initialize=e=>{console.debug("SourceMapConsumer.initialize is a no-op when running in node.js")}});var tZr=y((Ovl,eZr)=>{"use strict";var zLo=dat();function VLo(){this.generatedLine=0,this.generatedColumn=0,this.lastGeneratedColumn=null,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}s(VLo,"Mapping");var _Z=null;eZr.exports=s(function(){if(_Z)return _Z;let t=[];return _Z=zLo().then(r=>WebAssembly.instantiate(r,{env:{mapping_callback(n,i,o,a,c,u,l,f,d,p){let h=new VLo;h.generatedLine=n+1,h.generatedColumn=i,o&&(h.lastGeneratedColumn=a-1),c&&(h.source=u,h.originalLine=l+1,h.originalColumn=f,d&&(h.name=p)),t[t.length-1](h)},start_all_generated_locations_for(){console.time("all_generated_locations_for")},end_all_generated_locations_for(){console.timeEnd("all_generated_locations_for")},start_compute_column_spans(){console.time("compute_column_spans")},end_compute_column_spans(){console.timeEnd("compute_column_spans")},start_generated_location_for(){console.time("generated_location_for")},end_generated_location_for(){console.timeEnd("generated_location_for")},start_original_location_for(){console.time("original_location_for")},end_original_location_for(){console.timeEnd("original_location_for")},start_parse_mappings(){console.time("parse_mappings")},end_parse_mappings(){console.timeEnd("parse_mappings")},start_sort_by_generated_location(){console.time("sort_by_generated_location")},end_sort_by_generated_location(){console.timeEnd("sort_by_generated_location")},start_sort_by_original_location(){console.time("sort_by_original_location")},end_sort_by_original_location(){console.timeEnd("sort_by_original_location")}}})).then(r=>({exports:r.instance.exports,withMappingCallback:(n,i)=>{t.push(n);try{i()}finally{t.pop()}}})).then(null,r=>{throw _Z=null,r}),_Z},"wasm")});var rZr=y(CEe=>{"use strict";var _s=mZ(),WLo=ZJr(),pat=aat().ArraySet,Ivl=eat(),KLo=dat(),YLo=tZr(),hat=Symbol("smcInternal"),Cf=class e{static{s(this,"SourceMapConsumer")}constructor(t,r){return t==hat?Promise.resolve(this):QLo(t,r)}static initialize(t){KLo.initialize(t["lib/mappings.wasm"])}static fromSourceMap(t,r){return XLo(t,r)}static async with(t,r,n){let i=await new e(t,r);try{return await n(i)}finally{i.destroy()}}eachMapping(t,r,n){throw new Error("Subclasses must implement eachMapping")}allGeneratedPositionsFor(t){throw new Error("Subclasses must implement allGeneratedPositionsFor")}destroy(){throw new Error("Subclasses must implement destroy")}};Cf.prototype._version=3;Cf.GENERATED_ORDER=1;Cf.ORIGINAL_ORDER=2;Cf.GREATEST_LOWER_BOUND=1;Cf.LEAST_UPPER_BOUND=2;CEe.SourceMapConsumer=Cf;var q$=class e extends Cf{static{s(this,"BasicSourceMapConsumer")}constructor(t,r){return super(hat).then(n=>{let i=t;typeof t=="string"&&(i=_s.parseSourceMapInput(t));let o=_s.getArg(i,"version"),a=_s.getArg(i,"sources").map(String),c=_s.getArg(i,"names",[]),u=_s.getArg(i,"sourceRoot",null),l=_s.getArg(i,"sourcesContent",null),f=_s.getArg(i,"mappings"),d=_s.getArg(i,"file",null),p=_s.getArg(i,"x_google_ignoreList",null);if(o!=n._version)throw new Error("Unsupported version: "+o);return n._sourceLookupCache=new Map,n._names=pat.fromArray(c.map(String),!0),n._sources=pat.fromArray(a,!0),n._absoluteSources=pat.fromArray(n._sources.toArray().map(function(h){return _s.computeSourceURL(u,h,r)}),!0),n.sourceRoot=u,n.sourcesContent=l,n._mappings=f,n._sourceMapURL=r,n.file=d,n.x_google_ignoreList=p,n._computedColumnSpans=!1,n._mappingsPtr=0,n._wasm=null,YLo().then(h=>(n._wasm=h,n))})}_findSourceIndex(t){let r=this._sourceLookupCache.get(t);if(typeof r=="number")return r;let n=_s.computeSourceURL(null,t,this._sourceMapURL);if(this._absoluteSources.has(n)){let o=this._absoluteSources.indexOf(n);return this._sourceLookupCache.set(t,o),o}let i=_s.computeSourceURL(this.sourceRoot,t,this._sourceMapURL);if(this._absoluteSources.has(i)){let o=this._absoluteSources.indexOf(i);return this._sourceLookupCache.set(t,o),o}return-1}static fromSourceMap(t,r){return new e(t.toString())}get sources(){return this._absoluteSources.toArray()}_getMappingsPtr(){return this._mappingsPtr===0&&this._parseMappings(),this._mappingsPtr}_parseMappings(){let t=this._mappings,r=t.length,n=this._wasm.exports.allocate_mappings(r)>>>0,i=new Uint8Array(this._wasm.exports.memory.buffer,n,r);for(let a=0;a<r;a++)i[a]=t.charCodeAt(a);let o=this._wasm.exports.parse_mappings(n);if(!o){let a=this._wasm.exports.get_last_error(),c=`Error parsing mappings (code ${a}): `;switch(a){case 1:c+="the mappings contained a negative line, column, source index, or name index";break;case 2:c+="the mappings contained a number larger than 2**32";break;case 3:c+="reached EOF while in the middle of parsing a VLQ";break;case 4:c+="invalid base 64 character while parsing a VLQ";break;default:c+="unknown error code";break}throw new Error(c)}this._mappingsPtr=o}eachMapping(t,r,n){let i=r||null,o=n||Cf.GENERATED_ORDER;this._wasm.withMappingCallback(a=>{a.source!==null&&(a.source=this._absoluteSources.at(a.source),a.name!==null&&(a.name=this._names.at(a.name))),this._computedColumnSpans&&a.lastGeneratedColumn===null&&(a.lastGeneratedColumn=1/0),t.call(i,a)},()=>{switch(o){case Cf.GENERATED_ORDER:this._wasm.exports.by_generated_location(this._getMappingsPtr());break;case Cf.ORIGINAL_ORDER:this._wasm.exports.by_original_location(this._getMappingsPtr());break;default:throw new Error("Unknown order of iteration.")}})}allGeneratedPositionsFor(t){let r=_s.getArg(t,"source"),n=_s.getArg(t,"line"),i=t.column||0;if(r=this._findSourceIndex(r),r<0)return[];if(n<1)throw new Error("Line numbers must be >= 1");if(i<0)throw new Error("Column numbers must be >= 0");let o=[];return this._wasm.withMappingCallback(a=>{let c=a.lastGeneratedColumn;this._computedColumnSpans&&c===null&&(c=1/0),o.push({line:a.generatedLine,column:a.generatedColumn,lastColumn:c})},()=>{this._wasm.exports.all_generated_locations_for(this._getMappingsPtr(),r,n-1,"column"in t,i)}),o}destroy(){this._mappingsPtr!==0&&(this._wasm.exports.free_mappings(this._mappingsPtr),this._mappingsPtr=0)}computeColumnSpans(){this._computedColumnSpans||(this._wasm.exports.compute_column_spans(this._getMappingsPtr()),this._computedColumnSpans=!0)}originalPositionFor(t){let r={generatedLine:_s.getArg(t,"line"),generatedColumn:_s.getArg(t,"column")};if(r.generatedLine<1)throw new Error("Line numbers must be >= 1");if(r.generatedColumn<0)throw new Error("Column numbers must be >= 0");let n=_s.getArg(t,"bias",Cf.GREATEST_LOWER_BOUND);n==null&&(n=Cf.GREATEST_LOWER_BOUND);let i;if(this._wasm.withMappingCallback(o=>i=o,()=>{this._wasm.exports.original_location_for(this._getMappingsPtr(),r.generatedLine-1,r.generatedColumn,n)}),i&&i.generatedLine===r.generatedLine){let o=_s.getArg(i,"source",null);o!==null&&(o=this._absoluteSources.at(o));let a=_s.getArg(i,"name",null);return a!==null&&(a=this._names.at(a)),{source:o,line:_s.getArg(i,"originalLine",null),column:_s.getArg(i,"originalColumn",null),name:a}}return{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1}sourceContentFor(t,r){if(!this.sourcesContent)return null;let n=this._findSourceIndex(t);if(n>=0)return this.sourcesContent[n];if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')}generatedPositionFor(t){let r=_s.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};let n={source:r,originalLine:_s.getArg(t,"line"),originalColumn:_s.getArg(t,"column")};if(n.originalLine<1)throw new Error("Line numbers must be >= 1");if(n.originalColumn<0)throw new Error("Column numbers must be >= 0");let i=_s.getArg(t,"bias",Cf.GREATEST_LOWER_BOUND);i==null&&(i=Cf.GREATEST_LOWER_BOUND);let o;if(this._wasm.withMappingCallback(a=>o=a,()=>{this._wasm.exports.generated_location_for(this._getMappingsPtr(),n.source,n.originalLine-1,n.originalColumn,i)}),o&&o.source===n.source){let a=o.lastGeneratedColumn;return this._computedColumnSpans&&a===null&&(a=1/0),{line:_s.getArg(o,"generatedLine",null),column:_s.getArg(o,"generatedColumn",null),lastColumn:a}}return{line:null,column:null,lastColumn:null}}};q$.prototype.consumer=Cf;CEe.BasicSourceMapConsumer=q$;var xEe=class extends Cf{static{s(this,"IndexedSourceMapConsumer")}constructor(t,r){return super(hat).then(n=>{let i=t;typeof t=="string"&&(i=_s.parseSourceMapInput(t));let o=_s.getArg(i,"version"),a=_s.getArg(i,"sections");if(o!=n._version)throw new Error("Unsupported version: "+o);let c={line:-1,column:0};return Promise.all(a.map(u=>{if(u.url)throw new Error("Support for url field in sections not implemented.");let l=_s.getArg(u,"offset"),f=_s.getArg(l,"line"),d=_s.getArg(l,"column");if(f<c.line||f===c.line&&d<c.column)throw new Error("Section offsets must be ordered and non-overlapping.");return c=l,new Cf(_s.getArg(u,"map"),r).then(h=>({generatedOffset:{generatedLine:f+1,generatedColumn:d+1},consumer:h}))})).then(u=>(n._sections=u,n))})}get sources(){let t=[];for(let r=0;r<this._sections.length;r++)for(let n=0;n<this._sections[r].consumer.sources.length;n++)t.push(this._sections[r].consumer.sources[n]);return t}originalPositionFor(t){let r={generatedLine:_s.getArg(t,"line"),generatedColumn:_s.getArg(t,"column")},n=WLo.search(r,this._sections,function(o,a){let c=o.generatedLine-a.generatedOffset.generatedLine;return c||o.generatedColumn-(a.generatedOffset.generatedColumn-1)}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})}sourceContentFor(t,r){for(let n=0;n<this._sections.length;n++){let o=this._sections[n].consumer.sourceContentFor(t,!0);if(o)return o}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')}_findSectionIndex(t){for(let r=0;r<this._sections.length;r++){let{consumer:n}=this._sections[r];if(n._findSourceIndex(t)!==-1)return r}return-1}generatedPositionFor(t){let r=this._findSectionIndex(_s.getArg(t,"source")),n=r>=0?this._sections[r]:null,i=r>=0&&r+1<this._sections.length?this._sections[r+1]:null,o=n&&n.consumer.generatedPositionFor(t);if(o&&o.line!==null){let a=n.generatedOffset.generatedLine-1,c=n.generatedOffset.generatedColumn-1;return o.line===1&&(o.column+=c,typeof o.lastColumn=="number"&&(o.lastColumn+=c)),o.lastColumn===1/0&&i&&o.line===i.generatedOffset.generatedLine&&(o.lastColumn=i.generatedOffset.generatedColumn-2),o.line+=a,o}return{line:null,column:null,lastColumn:null}}allGeneratedPositionsFor(t){let r=this._findSectionIndex(_s.getArg(t,"source")),n=r>=0?this._sections[r]:null,i=r>=0&&r+1<this._sections.length?this._sections[r+1]:null;return n?n.consumer.allGeneratedPositionsFor(t).map(o=>{let a=n.generatedOffset.generatedLine-1,c=n.generatedOffset.generatedColumn-1;return o.line===1&&(o.column+=c,typeof o.lastColumn=="number"&&(o.lastColumn+=c)),o.lastColumn===1/0&&i&&o.line===i.generatedOffset.generatedLine&&(o.lastColumn=i.generatedOffset.generatedColumn-2),o.line+=a,o}):[]}eachMapping(t,r,n){this._sections.forEach((i,o)=>{let a=o+1<this._sections.length?this._sections[o+1]:null,{generatedOffset:c}=i,u=c.generatedLine-1,l=c.generatedColumn-1;i.consumer.eachMapping(function(f){f.generatedLine===1&&(f.generatedColumn+=l,typeof f.lastGeneratedColumn=="number"&&(f.lastGeneratedColumn+=l)),f.lastGeneratedColumn===1/0&&a&&f.generatedLine===a.generatedOffset.generatedLine&&(f.lastGeneratedColumn=a.generatedOffset.generatedColumn-2),f.generatedLine+=u,t.call(this,f)},r,n)})}computeColumnSpans(){for(let t=0;t<this._sections.length;t++)this._sections[t].consumer.computeColumnSpans()}destroy(){for(let t=0;t<this._sections.length;t++)this._sections[t].consumer.destroy()}};CEe.IndexedSourceMapConsumer=xEe;function QLo(e,t){let r=e;typeof e=="string"&&(r=_s.parseSourceMapInput(e));let n=r.sections!=null?new xEe(r,t):new q$(r,t);return Promise.resolve(n)}s(QLo,"_factory");function XLo(e,t){return q$.fromSourceMap(e,t)}s(XLo,"_factoryBSM")});var iZr=y(nZr=>{"use strict";var JLo=uat().SourceMapGenerator,OEe=mZ(),ZLo=/(\r?\n)/,e2o=10,B$="$$$isSourceNode$$$",mat=class e{static{s(this,"SourceNode")}constructor(t,r,n,i,o){this.children=[],this.sourceContents={},this.line=t??null,this.column=r??null,this.source=n??null,this.name=o??null,this[B$]=!0,i!=null&&this.add(i)}static fromStringWithSourceMap(t,r,n){let i=new e,o=t.split(ZLo),a=0,c=s(function(){let h=b(),g=b()||"";return h+g;function b(){return a<o.length?o[a++]:void 0}},"shiftNextLine"),u=1,l=0,f=null,d;return r.eachMapping(function(h){if(f!==null)if(u<h.generatedLine)p(f,c()),u++,l=0;else{d=o[a]||"";let g=d.substr(0,h.generatedColumn-l);o[a]=d.substr(h.generatedColumn-l),l=h.generatedColumn,p(f,g),f=h;return}for(;u<h.generatedLine;)i.add(c()),u++;l<h.generatedColumn&&(d=o[a]||"",i.add(d.substr(0,h.generatedColumn)),o[a]=d.substr(h.generatedColumn),l=h.generatedColumn),f=h},this),a<o.length&&(f&&p(f,c()),i.add(o.splice(a).join(""))),r.sources.forEach(function(h){let g=r.sourceContentFor(h);g!=null&&(n!=null&&(h=OEe.join(n,h)),i.setSourceContent(h,g))}),i;function p(h,g){if(h===null||h.source===void 0)i.add(g);else{let b=n?OEe.join(n,h.source):h.source;i.add(new e(h.originalLine,h.originalColumn,b,g,h.name))}}s(p,"addMappingWithCode")}add(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[B$]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this}prepend(t){if(Array.isArray(t))for(let r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[B$]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this}walk(t){let r;for(let n=0,i=this.children.length;n<i;n++)r=this.children[n],r[B$]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})}join(t){let r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(t);r.push(this.children[n]),this.children=r}return this}replaceRight(t,r){let n=this.children[this.children.length-1];return n[B$]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this}setSourceContent(t,r){this.sourceContents[OEe.toSetString(t)]=r}walkSourceContents(t){for(let n=0,i=this.children.length;n<i;n++)this.children[n][B$]&&this.children[n].walkSourceContents(t);let r=Object.keys(this.sourceContents);for(let n=0,i=r.length;n<i;n++)t(OEe.fromSetString(r[n]),this.sourceContents[r[n]])}toString(){let t="";return this.walk(function(r){t+=r}),t}toStringWithSourceMap(t){let r={code:"",line:1,column:0},n=new JLo(t),i=!1,o=null,a=null,c=null,u=null;return this.walk(function(l,f){r.code+=l,f.source!==null&&f.line!==null&&f.column!==null?((o!==f.source||a!==f.line||c!==f.column||u!==f.name)&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name}),o=f.source,a=f.line,c=f.column,u=f.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),o=null,i=!1);for(let d=0,p=l.length;d<p;d++)l.charCodeAt(d)===e2o?(r.line++,r.column=0,d+1===p?(o=null,i=!1):i&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name})):r.column++}),this.walkSourceContents(function(l,f){n.setSourceContent(l,f)}),{code:r.code,map:n}}};nZr.SourceNode=mat});var sZr=y(REe=>{"use strict";REe.SourceMapGenerator=uat().SourceMapGenerator;REe.SourceMapConsumer=rZr().SourceMapConsumer;REe.SourceNode=iZr().SourceNode});var gat=y(bC=>{"use strict";Object.defineProperty(bC,"__esModule",{value:!0});bC.setLogger=bC.logger=bC.NullLogger=void 0;var IEe=class{static{s(this,"NullLogger")}info(...t){}error(...t){}trace(...t){}warn(...t){}fatal(...t){}debug(...t){}};bC.NullLogger=IEe;bC.logger=new IEe;function t2o(e){bC.logger=e}s(t2o,"setLogger");bC.setLogger=t2o});var aZr=y((Bvl,oZr)=>{"use strict";var _at=class{static{s(this,"Node")}constructor(t){this.value=t,this.next=void 0}},yat=class{static{s(this,"Queue")}constructor(){this.clear()}enqueue(t){let r=new _at(t);this._head?(this._tail.next=r,this._tail=r):(this._head=r,this._tail=r),this._size++}dequeue(){let t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};oZr.exports=yat});var uZr=y((Fvl,cZr)=>{"use strict";var r2o=aZr(),n2o=s(e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=new r2o,r=0,n=s(()=>{r--,t.size>0&&t.dequeue()()},"next"),i=s(async(c,u,...l)=>{r++;let f=(async()=>c(...l))();u(f);try{await f}catch{}n()},"run"),o=s((c,u,...l)=>{t.enqueue(i.bind(null,c,u,...l)),(async()=>(await Promise.resolve(),r<e&&t.size>0&&t.dequeue()()))()},"enqueue"),a=s((c,...u)=>new Promise(l=>{o(c,l,...u)}),"generator");return Object.defineProperties(a,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),a},"pLimit");cZr.exports=n2o});var fZr=y(Wb=>{"use strict";var i2o=Wb&&Wb.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),s2o=Wb&&Wb.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),bat=Wb&&Wb.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&i2o(t,e,r);return s2o(t,e),t},o2o=Wb&&Wb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wb,"__esModule",{value:!0});Wb.SourceMapper=void 0;var U$=bat(require("fs")),u0=bat(require("path")),a2o=bat(sZr()),xw=gat(),c2o=o2o(uZr()),u2o=U$.promises.readFile,l2o=10,lZr=".map";function yZ(e){return xw.logger.debug(`Error: ${e}`),new Error(e)}s(yZ,"error");async function f2o(e,t,r){if(!t||!t.endsWith(lZr))throw yZ(`The path "${t}" does not specify a source map file`);t=u0.normalize(t);let n;try{n=await u2o(t,"utf8")}catch(u){throw yZ("Could not read source map file "+t+": "+u)}let i;try{i=await new a2o.SourceMapConsumer(n)}catch(u){throw yZ("An error occurred while reading the sourceMap file "+t+": "+u)}let o=u0.dirname(t),a=[];i.file&&a.push(u0.resolve(o,i.file));let c=u0.resolve(o,u0.basename(t,lZr));(a.length===0||a[0]!==c)&&a.push(c);for(let u of a)try{await U$.promises.access(u,U$.constants.F_OK),e.set(u,{mapFileDir:o,mapConsumer:i}),r&&xw.logger.debug(`Loaded source map for ${u} => ${t}`);return}catch{r&&xw.logger.debug(`Generated path ${u} does not exist`)}r&&xw.logger.debug(`Unable to find generated file for ${t}`)}s(f2o,"processSourceMap");var kEe=class{static{s(this,"SourceMapper")}static async create(t,r=!1){r&&xw.logger.debug(`Looking for source map files in dirs: [${t.join(", ")}]`);let n=[];for(let i of t)try{(await g2o(i)).forEach(a=>{n.push(u0.resolve(i,a))})}catch(o){throw yZ(`failed to get source maps from ${i}: ${o}`)}return r&&xw.logger.debug(`Found source map files: [${n.join(", ")}]`),d2o(n,r)}constructor(t=!1){this.infoMap=new Map,this.debug=t}getMappingInfo(t){return this.infoMap.has(u0.normalize(t))?this.infoMap.get(t):null}hasMappingInfo(t){return this.getMappingInfo(t)!==null}mappingInfo(t){let r=u0.normalize(t.file),n=this.getMappingInfo(r);if(n===null)return this.debug&&xw.logger.debug(`Source map lookup failed: no map found for ${t.file} (normalized: ${r})`),t;let i={line:t.line,column:t.column>0?t.column-1:0},a=n.mapConsumer.originalPositionFor(i);if(a.source===null)return this.debug&&xw.logger.debug(`Source map lookup failed for ${t.name}(${t.file}:${t.line}:${t.column})`),t;let c={file:u0.resolve(n.mapFileDir,a.source),line:a.line||void 0,name:a.name||t.name,column:a.column===null?void 0:a.column+1};return this.debug&&xw.logger.debug(`Source map lookup succeeded for ${t.name}(${t.file}:${t.line}:${t.column}) => ${c.name}(${c.file}:${c.line}:${c.column})`),c}};Wb.SourceMapper=kEe;async function d2o(e,t){let r=(0,c2o.default)(l2o),n=new kEe(t),i=e.map(o=>r(()=>f2o(n.infoMap,o,t)));try{await Promise.all(i)}catch(o){throw yZ("An error occurred while processing the source map files"+o)}return n}s(d2o,"createFromMapFiles");function p2o(e){return e instanceof Error&&"code"in e}s(p2o,"isErrnoException");function h2o(e){let t=["ENOENT","EPERM","EACCES","ELOOP"];return p2o(e)&&e.code&&t.includes(e.code)}s(h2o,"isNonFatalError");async function*m2o(e,t=n=>!0,r=(n,i)=>!0){async function*n(i){try{for await(let o of await U$.promises.opendir(i)){let a=u0.join(i,o.name);o.isDirectory()&&r(i,o.name)?yield*n(a):o.isFile()&&t(o.name)&&(await U$.promises.access(a,U$.constants.R_OK),yield a)}}catch(o){if(h2o(o))xw.logger.debug(()=>`Non fatal error: ${o}`);else throw o}}s(n,"walkRecursive"),yield*n(e)}s(m2o,"walk");async function g2o(e){let t=[];for await(let r of m2o(e,n=>/\.[cm]?js\.map$/.test(n),(n,i)=>n!=="/proc"&&i!==".git"&&i!=="node_modules"))t.push(u0.relative(e,r));return t}s(g2o,"getMapFiles")});var bZ=y((zc,Eat)=>{"use strict";var _2o=zc&&zc.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),y2o=zc&&zc.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),dZr=zc&&zc.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&_2o(t,e,r);return y2o(t,e),t};Object.defineProperty(zc,"__esModule",{value:!0});zc.heap=zc.time=zc.getNativeThreadId=zc.setLogger=zc.SourceMapper=zc.encodeSync=zc.encode=void 0;var b2o=require("fs"),E2=dZr(TJr()),E2o=zot(),EC=dZr(Zot()),pZr=zot();Object.defineProperty(zc,"encode",{enumerable:!0,get:function(){return pZr.encode}});Object.defineProperty(zc,"encodeSync",{enumerable:!0,get:function(){return pZr.encodeSync}});var v2o=fZr();Object.defineProperty(zc,"SourceMapper",{enumerable:!0,get:function(){return v2o.SourceMapper}});var S2o=gat();Object.defineProperty(zc,"setLogger",{enumerable:!0,get:function(){return S2o.setLogger}});var w2o=Zot();Object.defineProperty(zc,"getNativeThreadId",{enumerable:!0,get:function(){return w2o.getNativeThreadId}});zc.time={profile:EC.profile,start:EC.start,stop:EC.stop,getContext:EC.getContext,setContext:EC.setContext,isStarted:EC.isStarted,v8ProfilerStuckEventLoopDetected:EC.v8ProfilerStuckEventLoopDetected,getState:EC.getState,constants:EC.constants};zc.heap={start:E2.start,stop:E2.stop,profile:E2.profile,convertProfile:E2.convertProfile,v8Profile:E2.v8Profile,monitorOutOfMemory:E2.monitorOutOfMemory,CallbackMode:E2.CallbackMode};Eat.parent&&Eat.parent.id==="internal/preload"&&(zc.time.start({}),process.on("exit",()=>{let e=zc.time.stop(),t=(0,E2o.encodeSync)(e);(0,b2o.writeFileSync)(`pprof-profile-${process.pid}.pb.gz`,t)}))});var EZ=y((Gvl,_Zr)=>{"use strict";var{isMainThread:T2o,threadId:hZr}=require("worker_threads"),A2o="end_timestamp_ns",vat="thread name",Sat="os thread id",wat="thread id",x2o="span id",C2o="local root span id",mZr=T2o?"Main":`Worker #${hZr}`,gZr=`${mZr} Event Loop`;function O2o(){let t=bZ().getNativeThreadId();return{[vat]:gZr,[wat]:`${hZr}`,[Sat]:`${t}`}}s(O2o,"getThreadLabels");function R2o(){let e;return()=>(e||(e=O2o()),e)}s(R2o,"cacheThreadLabels");function I2o(){return{[vat]:"Non-JS threads",[wat]:"NA",[Sat]:"NA"}}s(I2o,"getNonJSThreadsLabels");function k2o(e){return e.encodeAsync().then(Buffer.from)}s(k2o,"encodeProfileAsync");_Zr.exports={END_TIMESTAMP_LABEL:A2o,THREAD_NAME_LABEL:vat,THREAD_ID_LABEL:wat,OS_THREAD_ID_LABEL:Sat,SPAN_ID_LABEL:x2o,LOCAL_ROOT_SPAN_ID_LABEL:C2o,threadNamePrefix:mZr,eventLoopThreadName:gZr,getNonJSThreadsLabels:I2o,getThreadLabels:R2o(),encodeProfileAsync:k2o}});var Tat=y((Vvl,yZr)=>{"use strict";var{HTTP_METHOD:N2o,HTTP_ROUTE:P2o,RESOURCE_NAME:D2o,SPAN_TYPE:M2o}=cu(),{WEB:L2o}=hQ();function q2o(e){return e[M2o]===L2o}s(q2o,"isWebServerSpan");function B2o(e){return e[D2o]||[e[N2o],e[P2o]].filter(Boolean).join(" ")}s(B2o,"endpointNameFromTags");function U2o(e){return e._trace.started}s(U2o,"getStartedSpans");yZr.exports={isWebServerSpan:q2o,endpointNameFromTags:B2o,getStartedSpans:U2o}});var Oat=y((Kvl,TZr)=>{"use strict";var{storage:F2o}=Fr(),Cat=hi(),j2o=I4(),$2o=ch(),{END_TIMESTAMP_LABEL:H2o,SPAN_ID_LABEL:G2o,LOCAL_ROOT_SPAN_ID_LABEL:z2o,getNonJSThreadsLabels:V2o,getThreadLabels:bZr,encodeProfileAsync:W2o}=EZ(),{isWebServerSpan:K2o,endpointNameFromTags:EZr,getStartedSpans:Y2o}=Tat(),Aat=Cat.channel("dd-trace:storage:before"),vZ=Cat.channel("dd-trace:storage:enter"),vZr=Cat.channel("dd-trace:span:finish"),Q2o=$2o.manager.namespace("profilers"),NEe=Symbol("NativeWallProfiler.ProfilingContext"),SZr;function X2o(){let e=F2o("legacy").getStore();return e&&e.span}s(X2o,"getActiveSpan");var wZr=!1;function J2o(){if(wZr)return;let{AsyncLocalStorage:e,createHook:t}=require("async_hooks"),r=zt();t({before:()=>Aat.publish()}).enable();let n=!1;r.wrap(e.prototype,"enterWith",function(i){return function(...o){let a=i.apply(this,o);return n||vZ.publish(),a}}),r.wrap(e.prototype,"run",function(i){return function(o,a,...c){let u=r.wrapFunction(a,f=>function(...d){n=!1,vZ.publish();let p=f.apply(this,d);return n=!0,p});n=!0;let l=i.call(this,o,u,...c);return vZ.publish(),n=!1,l}}),wZr=!0}s(J2o,"ensureChannelsActivated");var xat=class{static{s(this,"NativeWallProfiler")}constructor(t={}){this.type="wall",this._samplingIntervalMicros=t.samplingInterval||1e6/99,this._flushIntervalMillis=t.flushInterval||60*1e3,this._codeHotspotsEnabled=!!t.codeHotspotsEnabled,this._endpointCollectionEnabled=!!t.endpointCollectionEnabled,this._timelineEnabled=!!t.timelineEnabled,this._cpuProfilingEnabled=!!t.cpuProfilingEnabled,this._captureSpanData=this._codeHotspotsEnabled||this._endpointCollectionEnabled,this._withContexts=this._captureSpanData||this._timelineEnabled||this._cpuProfilingEnabled,this._v8ProfilerBugWorkaroundEnabled=!!t.v8ProfilerBugWorkaroundEnabled,this._mapper=void 0,this._pprof=void 0,this._withContexts&&this._captureSpanData&&(this._enter=this._enter.bind(this),this._spanFinished=this._spanFinished.bind(this)),this._generateLabels=this._generateLabels.bind(this),this._logger=t.logger,this._started=!1}codeHotspotsEnabled(){return this._codeHotspotsEnabled}endpointCollectionEnabled(){return this._endpointCollectionEnabled}start({mapper:t}={}){this._started||(this._mapper=t,this._pprof=bZ(),SZr=this._pprof.time.constants.kSampleCount,process._startProfilerIdleNotifier||(process._startProfilerIdleNotifier=()=>{}),process._stopProfilerIdleNotifier||(process._stopProfilerIdleNotifier=()=>{}),this._pprof.time.start({intervalMicros:this._samplingIntervalMicros,durationMillis:this._flushIntervalMillis,sourceMapper:this._mapper,withContexts:this._withContexts,lineNumbers:!1,workaroundV8Bug:this._v8ProfilerBugWorkaroundEnabled,collectCpuTime:this._cpuProfilingEnabled}),this._withContexts&&(this._setNewContext(),this._captureSpanData&&(this._profilerState=this._pprof.time.getState(),this._lastSampleCount=0,J2o(),Aat.subscribe(this._enter),vZ.subscribe(this._enter),vZr.subscribe(this._spanFinished))),this._started=!0)}_enter(){if(!this._started)return;let t=this._profilerState[SZr];if(t!==this._lastSampleCount){this._lastSampleCount=t;let n=this._currentContext.ref;this._setNewContext(),this._updateContext(n)}let r=X2o();this._currentContext.ref=r?this._getProfilingContext(r):{}}_getProfilingContext(t){let r=t[NEe];if(r===void 0){let n=t.context(),i=Y2o(n),o,a;this._codeHotspotsEnabled&&(o=n._spanId,a=i.length?i[0].context()._spanId:n._spanId);let c;if(this._endpointCollectionEnabled){let u=n._tags;if(K2o(u))c=u;else{let l=n._parentId;for(let f=i.length;--f>=0;){let d=i[f];if(d.context()._spanId===l){c=this._getProfilingContext(d).webTags;break}}}}r={spanId:o,rootSpanId:a,webTags:c},t[NEe]=r}return r}_setNewContext(){this._pprof.time.setContext(this._currentContext={ref:{}})}_updateContext(t){typeof t.spanId=="object"&&(t.spanId=t.spanId.toString(10)),typeof t.rootSpanId=="object"&&(t.rootSpanId=t.rootSpanId.toString(10)),t.webTags!==void 0&&t.endpoint===void 0&&(t.endpoint=EZr(t.webTags))}_spanFinished(t){t[NEe]!==void 0&&(t[NEe]=void 0)}_reportV8bug(t){let r=`v8_profiler_bug_workaround_enabled:${this._v8ProfilerBugWorkaroundEnabled}`,n=`v8_cpu_profiler${t?"_maybe":""}_stuck_event_loop`;this._logger?.warn(`Wall profiler: ${t?"possible ":""}v8 profiler stuck event loop detected.`),j2o.increment(`runtime.node.profiler.${n}`,r,!0),Q2o.count(n,[r]).inc()}_stop(t){if(!this._started)return;this._captureSpanData&&(this._enter(),this._lastSampleCount=0);let r=this._pprof.time.stop(t,this._generateLabels);if(t){let n=this._pprof.time.v8ProfilerStuckEventLoopDetected();n!==0&&this._reportV8bug(n===1)}else this._captureSpanData&&(Aat.unsubscribe(this._enter),vZ.unsubscribe(this._enter),vZr.unsubscribe(this._spanFinished),this._profilerState=void 0),this._started=!1;return r}_generateLabels({node:t,context:r}){if(t.name===this._pprof.time.constants.NON_JS_THREADS_FUNCTION_NAME)return V2o();if(r==null)return bZr();let n={...bZr()};this._timelineEnabled&&(n[H2o]=r.timestamp*1000n);let i=r.asyncId;i!==void 0&&i!==-1&&(n["async id"]=i);let o=r.context?.ref;if(typeof o!="object")return n;let{spanId:a,rootSpanId:c,webTags:u,endpoint:l}=o;return a!==void 0&&(n[G2o]=a),c!==void 0&&(n[z2o]=c),u!==void 0&&Object.keys(u).length!==0?n["trace endpoint"]=EZr(u):l&&(n["trace endpoint"]=l),n}profile(t){return this._stop(t)}encode(t){return W2o(t)}stop(){this._stop(!1)}isStarted(){return this._started}};TZr.exports=xat});var PEe=y((Qvl,AZr)=>{"use strict";var Z2o=Object.freeze({PERIODIC:"periodic",ON_SHUTDOWN:"on_shutdown",ON_OUT_OF_MEMORY:"on_oom"}),eqo=Object.freeze({PROCESS:"process",ASYNC_CALLBACK:"async",LOGS:"logs"});AZr.exports={snapshotKinds:Z2o,oomExportStrategies:eqo}});var kat=y((Xvl,xZr)=>{"use strict";var{oomExportStrategies:Rat}=PEe(),{encodeProfileAsync:tqo,getThreadLabels:rqo}=EZ();function nqo(e,t){return e.includes(Rat.ASYNC_CALLBACK)?t.Async:0}s(nqo,"strategiesToCallbackMode");var Iat=class{static{s(this,"NativeSpaceProfiler")}constructor(t={}){this.type="space",this._samplingInterval=t.heapSamplingInterval||512*1024,this._stackDepth=t.stackDepth||64,this._pprof=void 0,this._oomMonitoring=t.oomMonitoring||{},this._started=!1}start({mapper:t,nearOOMCallback:r}={}){if(!this._started){if(this._mapper=t,this._pprof=bZ(),this._pprof.heap.start(this._samplingInterval,this._stackDepth),this._oomMonitoring.enabled){let n=this._oomMonitoring.exportStrategies;this._pprof.heap.monitorOutOfMemory(this._oomMonitoring.heapLimitExtensionSize,this._oomMonitoring.maxHeapExtensionCount,n.includes(Rat.LOGS),n.includes(Rat.PROCESS)?this._oomMonitoring.exportCommand:[],i=>r(this.type,this._pprof.encodeSync(i)),nqo(n,this._pprof.heap.CallbackMode))}this._started=!0}}profile(t){let r=this._pprof.heap.profile(void 0,this._mapper,rqo);return t||this.stop(),r}encode(t){return tqo(t)}stop(){this._started&&(this._pprof.heap.stop(),this._started=!1)}isStarted(){return this._started}};xZr.exports=Iat});var DEe=y((Zvl,OZr)=>{"use strict";var iqo=Am(),{performance:CZr}=require("perf_hooks"),Nat=class extends iqo{static{s(this,"EventPlugin")}constructor(t,r){super(),this.eventHandler=t,this.eventFilter=r,this.contextData=new WeakMap,this.entryType=this.constructor.entryType}start(t){this.contextData.set(t,{startEvent:t,startTime:CZr.now()})}error(t){let r=this.contextData.get(t);r&&(r.error=!0)}finish(t){let r=this.contextData.get(t);if(!r)return;let{startEvent:n,startTime:i,error:o}=r;if(o||this.ignoreEvent(n))return;let a=CZr.now()-i,c={entryType:this.entryType,startTime:i,duration:a};if(!this.eventFilter(c))return;let u=(t.currentStore?.span||this.activeSpan)?.context();c._ddSpanId=u?.toSpanId(),c._ddRootSpanId=u?._trace.started[0]?.context().toSpanId()||c._ddSpanId,this.eventHandler(this.extendEvent(c,n))}ignoreEvent(){return!1}};OZr.exports=Nat});var SZ=y((t0l,RZr)=>{"use strict";var sqo=DEe(),Pat=class extends sqo{static{s(this,"DNSPlugin")}static get id(){return"dns"}static get entryType(){return"dns"}};RZr.exports=Pat});var kZr=y((n0l,IZr)=>{"use strict";var oqo=SZ(),Dat=class extends oqo{static{s(this,"DNSLookupPlugin")}static get operation(){return"lookup"}extendEvent(t,r){return t.name="lookup",t.detail={hostname:r.args[0]},t}};IZr.exports=Dat});var PZr=y((s0l,NZr)=>{"use strict";var aqo=SZ(),Mat=class extends aqo{static{s(this,"DNSLookupServicePlugin")}static get operation(){return"lookup_service"}extendEvent(t,r){return t.name="lookupService",t.detail={host:r.args[0],port:r.args[1]},t}};NZr.exports=Mat});var LZr=y((a0l,MZr)=>{"use strict";var cqo=SZ(),DZr=new Map,Lat=class extends cqo{static{s(this,"DNSResolvePlugin")}static get operation(){return"resolve"}extendEvent(t,r){let n=r.args[1],i=DZr.get(n);return i||(i=`query${n}`,DZr.set(n,i)),t.name=i,t.detail={host:r.args[0]},t}};MZr.exports=Lat});var BZr=y((u0l,qZr)=>{"use strict";var uqo=SZ(),qat=class extends uqo{static{s(this,"DNSReversePlugin")}static get operation(){return"reverse"}extendEvent(t,r){return t.name="getHostByAddr",t.detail={host:r.args[0]},t}};qZr.exports=qat});var FZr=y((f0l,UZr)=>{"use strict";var lqo=DEe(),fqo=new Set(["atime","dest","existingPath","fd","file","flag","gid","len","length","mode","mtime","newPath","offset","oldPath","operation","options","path","position","prefix","src","target","type","uid"]),Bat=class extends lqo{static{s(this,"FilesystemPlugin")}static get id(){return"fs"}static get operation(){return"operation"}static get entryType(){return"fs"}ignoreEvent(t){return t.operation?.endsWith("Sync")}extendEvent(t,r){let n={...r};return Object.entries(n).forEach(([i,o])=>{fqo.has(i)&&(typeof o=="string"||typeof o=="number")||delete n[i]}),t.detail=n,t}};UZr.exports=Bat});var $Zr=y((p0l,jZr)=>{"use strict";var dqo=DEe(),Uat=class extends dqo{static{s(this,"NetPlugin")}static get id(){return"net"}static get operation(){return"tcp"}static get entryType(){return"net"}extendEvent(t,{options:r}){return t.name="connect",t.detail=r,t}};jZr.exports=Uat});var WZr=y((m0l,VZr)=>{"use strict";var{performance:HZr,constants:pqo,PerformanceObserver:hqo}=require("perf_hooks"),{END_TIMESTAMP_LABEL:mqo,SPAN_ID_LABEL:gqo,LOCAL_ROOT_SPAN_ID_LABEL:_qo,encodeProfileAsync:yqo}=EZ(),{Function:bqo,Label:TZ,Line:Eqo,Location:vqo,Profile:Sqo,Sample:wqo,StringTable:Tqo,ValueType:Aqo}=jot(),wZ=1e6,xqo="timeline",Cqo="nanoseconds",Oqo=BigInt(Math.round(HZr.timeOrigin*wZ));function v2(e,t,r){return new TZ({key:t,str:e.dedup(Rqo(r))})}s(v2,"labelFromStr");function Rqo(e){switch(typeof e){case"string":return e;case"object":return"[object]";case"function":return"[function]";default:return String(e)}}s(Rqo,"safeToString");function GZr(e,t,r){return v2(e,e.dedup(t),r)}s(GZr,"labelFromStrStr");var Fat=class{static{s(this,"GCDecorator")}constructor(t){this.stringTable=t,this.reasonLabelKey=t.dedup("gc reason"),this.kindLabels=[],this.reasonLabels=[],this.flagObj={};let r=t.dedup("gc type");for(let[n,i]of Object.entries(pqo))if(n.startsWith("NODE_PERFORMANCE_GC_FLAGS_"))this.flagObj[n.slice(26).toLowerCase()]=i;else if(n.startsWith("NODE_PERFORMANCE_GC_")){let o=n.slice(20).toLowerCase();this.kindLabels[i]=v2(t,r,o)}}decorateSample(t,r){let{kind:n,flags:i}=r.detail;t.label.push(this.kindLabels[n]);let o=this.getReasonLabel(i);o&&t.label.push(o)}getReasonLabel(t){if(t===0)return null;let r=this.reasonLabels[t];if(!r){let n=[];for(let[o,a]of Object.entries(this.flagObj))a&t&&n.push(o);let i=n.join(",");r=v2(this.stringTable,this.reasonLabelKey,i),this.reasonLabels[t]=r}return r}},jat=class{static{s(this,"DNSDecorator")}constructor(t){this.stringTable=t,this.operationNameLabelKey=t.dedup("operation"),this.hostLabelKey=t.dedup("host"),this.addressLabelKey=t.dedup("address"),this.portLabelKey=t.dedup("port")}decorateSample(t,r){let n=t.label,i=this.stringTable;function o(u,l){n.push(v2(i,u,l))}s(o,"addLabel");let a=r.name;o(this.operationNameLabelKey,r.name);let c=r.detail;switch(a){case"lookup":o(this.hostLabelKey,c.hostname);break;case"lookupService":o(this.addressLabelKey,c.host),n.push(new TZ({key:this.portLabelKey,num:c.port}));break;case"getHostByAddr":o(this.addressLabelKey,c.host);break;default:a.startsWith("query")&&o(this.hostLabelKey,c.host)}}},$at=class{static{s(this,"NetDecorator")}constructor(t){this.stringTable=t,this.operationNameLabelKey=t.dedup("operation"),this.hostLabelKey=t.dedup("host"),this.portLabelKey=t.dedup("port")}decorateSample(t,r){let n=t.label,i=this.stringTable;function o(c,u){n.push(v2(i,c,u))}s(o,"addLabel");let a=r.name;if(o(this.operationNameLabelKey,a),a==="connect"){let c=r.detail;o(this.hostLabelKey,c.host),n.push(new TZ({key:this.portLabelKey,num:c.port}))}}},Hat=class{static{s(this,"FilesystemDecorator")}constructor(t){this.stringTable=t}decorateSample(t,r){let n=t.label,i=this.stringTable;Object.entries(r.detail).forEach(([o,a])=>{switch(typeof a){case"string":n.push(GZr(i,o,a));break;case"number":n.push(new TZ({key:i.dedup(o),num:a}))}})}},zZr={fs:Hat,dns:jat,gc:Fat,net:$at},MEe=class{static{s(this,"EventSerializer")}constructor(){this.stringTable=new Tqo,this.samples=[],this.locations=[],this.functions=[],this.decorators={};let t=new bqo({id:this.functions.length+1,name:this.stringTable.dedup("")});this.functions.push(t);let r=new Eqo({functionId:t.id}),n=new vqo({id:this.locations.length+1,line:[r]});this.locations.push(n),this.locationId=[n.id],this.timestampLabelKey=this.stringTable.dedup(mqo),this.spanIdKey=this.stringTable.dedup(gqo),this.rootSpanIdKey=this.stringTable.dedup(_qo)}addEvent(t){let{entryType:r,startTime:n,duration:i,_ddSpanId:o,_ddRootSpanId:a}=t,c=this.decorators[r];if(!c){let d=zZr[r];if(d)c=new d(this.stringTable),c.eventTypeLabel=GZr(this.stringTable,"event",r),this.decorators[r]=c;else return}let u=n+i,l=[c.eventTypeLabel,new TZ({key:this.timestampLabelKey,num:Oqo+BigInt(Math.round(u*wZ))})];o&&l.push(v2(this.stringTable,this.spanIdKey,o)),a&&l.push(v2(this.stringTable,this.rootSpanIdKey,a));let f={value:[Math.round(i*wZ)],locationId:this.locationId,label:l};c.decorateSample(f,t),this.samples.push(new wqo(f))}createProfile(t,r){let n=new Aqo({type:this.stringTable.dedup(xqo),unit:this.stringTable.dedup(Cqo)});return new Sqo({sampleType:[n],timeNanos:r.getTime()*wZ,periodType:n,period:1,durationNanos:(r.getTime()-t.getTime())*wZ,sample:this.samples,location:this.locations,function:this.functions,stringTable:this.stringTable})}};function Iqo(e){for(let t of e.getEntries())this.eventHandler(t)}s(Iqo,"add");var LEe=class{static{s(this,"NodeApiEventSource")}constructor(t,r){this.eventHandler=t,this.observer=void 0,this.entryTypes=r||Object.keys(zZr)}start(){this.observer||(this.observer=new hqo(Iqo.bind(this)),this.observer.observe({entryTypes:this.entryTypes}))}stop(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},Gat=class{static{s(this,"DatadogInstrumentationEventSource")}constructor(t,r){let n=[kZr(),PZr(),LZr(),BZr(),FZr(),$Zr()];this.plugins=n.map(i=>new i(t,r)),this.started=!1}start(){this.started||(this.plugins.forEach(t=>t.configure({enabled:!0})),this.started=!0)}stop(){this.started&&(this.plugins.forEach(t=>t.configure({enabled:!1})),this.started=!1)}},zat=class{static{s(this,"CompositeEventSource")}constructor(t){this.sources=t}start(){this.sources.forEach(t=>t.start())}stop(){this.sources.forEach(t=>t.stop())}};function kqo(e){let t=HZr.now(),r=0;return n(),i=>{let o=i.startTime+i.duration;for(;o>=t;)n();return i.startTime<r};function n(){r=t,t-=Math.log(1-Math.random())*e}s(n,"setNextSamplingInstant")}s(kqo,"createPossionProcessSamplingFilter");var Vat=class{static{s(this,"EventsProfiler")}constructor(t={}){this.type="events",this.eventSerializer=new MEe;let r=s(o=>this.eventSerializer.addEvent(o),"eventHandler"),n=t.timelineSamplingEnabled?kqo((t.samplingInterval??1e6/99)/1e3):o=>!0,i=s(o=>{n(o)&&r(o)},"filteringEventHandler");this.eventSource=t.codeHotspotsEnabled?new zat([new Gat(r,n),new LEe(i,["gc"])]):new LEe(i)}start(){this.eventSource.start()}stop(){this.eventSource.stop()}profile(t,r,n){t||this.stop();let i=this.eventSerializer;return this.eventSerializer=new MEe,()=>i.createProfile(r,n)}encode(t){return yqo(t())}};VZr.exports=Vat});var YZr=y((_0l,KZr)=>{"use strict";var Wat={parse(e){if(!e)return{};switch(typeof e){case"object":{if(Array.isArray(e)){let r={};for(let n of e){let i=n.indexOf(":");if(i===-1)continue;let o=n.slice(0,i).trim(),a=n.slice(i+1).trim();o.length!==0&&a.length!==0&&(r[o]=a)}return r}let t=[];for(let[r,n]of Object.entries(e))n!=null&&t.push(`${r}:${n}`);return Wat.parse(t)}case"string":return Wat.parse(e.split(","));default:return{}}}};KZr.exports={tagger:Wat}});var een=y((y0l,ZZr)=>{"use strict";var Nqo=require("os"),{getIsAzureFunction:QZr}=N6(),{getEnvironmentVariable:Pqo,getEnvironmentVariables:Dqo}=Dn();function Mqo(e){if(e!==void 0){let t=e.split("+")[0].trim();if(t.length>0)return t}}s(Mqo,"extractSubscriptionID");function Lqo(e){return/.+\+(.+)-.+webspace(-Linux)?/.exec(e)?.[1]}s(Lqo,"extractResourceGroup");function qqo(e,t,r){if(!(e===void 0||t===void 0||r===void 0))return`/subscriptions/${e}/resourcegroups/${r}/providers/microsoft.web/sites/${t}`.toLowerCase()}s(qqo,"buildResourceID");function XZr(e){return Object.entries(e).filter(([t,r])=>r===void 0).forEach(([t,r])=>{delete e[t]}),e}s(XZr,"trimObject");function JZr(){let{COMPUTERNAME:e,DD_AAS_DOTNET_EXTENSION_VERSION:t,FUNCTIONS_EXTENSION_VERSION:r,FUNCTIONS_WORKER_RUNTIME:n,FUNCTIONS_WORKER_RUNTIME_VERSION:i,WEBSITE_INSTANCE_ID:o,WEBSITE_OWNER_NAME:a,WEBSITE_OS:c,WEBSITE_RESOURCE_GROUP:u,WEBSITE_SITE_NAME:l}=Dqo(),f=Mqo(a),d=l,[p,h]=QZr()?["functionapp","function"]:["app","app"],g=u??Lqo(a);return XZr({extensionVersion:t,functionRuntimeVersion:r,instanceID:o,instanceName:e,operatingSystem:c??Nqo.platform(),resourceGroup:g,resourceID:qqo(f,d,g),runtime:n,runtimeVersion:i,siteKind:p,siteName:d,siteType:h,subscriptionID:f})}s(JZr,"buildMetadata");function Bqo(){if(Pqo("DD_AZURE_APP_SERVICES")!==void 0)return JZr()}s(Bqo,"getAzureAppMetadata");function Uqo(){if(QZr())return JZr()}s(Uqo,"getAzureFunctionMetadata");function Fqo(e){return e===void 0?{}:XZr({"aas.environment.extension_version":e.extensionVersion,"aas.environment.function_runtime":e.functionRuntimeVersion,"aas.environment.instance_id":e.instanceID,"aas.environment.instance_name":e.instanceName,"aas.environment.os":e.operatingSystem,"aas.environment.runtime":e.runtime,"aas.environment.runtime_version":e.runtimeVersion,"aas.resource.group":e.resourceGroup,"aas.resource.id":e.resourceID,"aas.site.kind":e.siteKind,"aas.site.name":e.siteName,"aas.site.type":e.siteType,"aas.subscription.id":e.subscriptionID})}s(Fqo,"getAzureTagsFromMetadata");ZZr.exports={getAzureAppMetadata:Bqo,getAzureFunctionMetadata:Uqo,getAzureTagsFromMetadata:Fqo}});var oen=y((E0l,sen)=>{"use strict";var fu=YI(),jqo=require("os"),$qo=require("path"),{URL:Hqo,format:Gqo,pathToFileURL:zqo}=require("url"),{AgentExporter:Qat}=Aot(),{FileExporter:ren}=Cot(),{ConsoleLogger:Vqo}=Iot(),nen=Oat(),Wqo=kat(),Kqo=WZr(),{oomExportStrategies:ien,snapshotKinds:Yqo}=PEe(),{GIT_REPOSITORY_URL:Qqo,GIT_COMMIT_SHA:Xqo}=sw(),{tagger:Kat}=YZr(),{isFalse:ten,isTrue:Cw}=bf(),{getAzureTagsFromMetadata:Jqo,getAzureAppMetadata:Zqo}=een(),{getEnvironmentVariables:eBo}=Dn(),Yat=class{static{s(this,"Config")}constructor(t={}){let{AWS_LAMBDA_FUNCTION_NAME:r,DD_AGENT_HOST:n,DD_ENV:i,DD_INTERNAL_PROFILING_TIMELINE_SAMPLING_ENABLED:o,DD_PROFILING_CODEHOTSPOTS_ENABLED:a,DD_PROFILING_CPU_ENABLED:c,DD_PROFILING_DEBUG_SOURCE_MAPS:u,DD_PROFILING_DEBUG_UPLOAD_COMPRESSION:l,DD_PROFILING_ENDPOINT_COLLECTION_ENABLED:f,DD_PROFILING_EXPERIMENTAL_OOM_EXPORT_STRATEGIES:d,DD_PROFILING_EXPERIMENTAL_OOM_HEAP_LIMIT_EXTENSION_SIZE:p,DD_PROFILING_EXPERIMENTAL_OOM_MAX_HEAP_EXTENSION_COUNT:h,DD_PROFILING_EXPERIMENTAL_OOM_MONITORING_ENABLED:g,DD_PROFILING_HEAP_ENABLED:b,DD_PROFILING_HEAP_SAMPLING_INTERVAL:v,DD_PROFILING_PPROF_PREFIX:S,DD_PROFILING_PROFILERS:C,DD_PROFILING_SOURCE_MAP:R,DD_PROFILING_TIMELINE_ENABLED:N,DD_PROFILING_UPLOAD_PERIOD:A,DD_PROFILING_UPLOAD_TIMEOUT:L,DD_PROFILING_V8_PROFILER_BUG_WORKAROUND:$,DD_PROFILING_WALLTIME_ENABLED:U,DD_SERVICE:G,DD_TAGS:Z,DD_TRACE_AGENT_PORT:re,DD_TRACE_AGENT_URL:me,DD_VERSION:B}=eBo(),le=fu(t.env,i),J=t.service||G||"node",F=jqo.hostname(),P=fu(t.version,B),ve=fu(t.interval,Number(A)*1e3,65*1e3),ee=fu(t.uploadTimeout,Number(L),60*1e3),be=fu(t.sourceMap,R,!0),Le=fu(t.pprofPrefix,S,"");this.service=J,this.env=le,this.host=F,this.functionname=r,this.version=P,this.tags=Object.assign(Kat.parse(Z),Kat.parse(t.tags),Kat.parse({env:le,host:F,service:J,version:P,functionname:r}),Jqo(Zqo())),t.repositoryUrl&&t.commitSHA&&(this.tags[Qqo]=t.repositoryUrl,this.tags[Xqo]=t.commitSHA),this.logger=cBo(t.logger);let je=process.platform!=="win32";function fe(Or,Tn,Ti){if(Or&&!Ti)throw new Error(`${Tn} not supported on ${process.platform}.`)}s(fe,"checkOptionAllowed");function xe(Or,Tn){fe(Or,Tn,je)}s(xe,"checkOptionWithSamplingContextAllowed"),this.flushInterval=ve,this.uploadTimeout=ee,this.sourceMap=be,this.debugSourceMaps=Cw(fu(t.debugSourceMaps,u,!1)),this.endpointCollectionEnabled=Cw(fu(t.endpointCollection,f,je)),xe(this.endpointCollectionEnabled,"Endpoint collection"),this.pprofPrefix=Le,this.v8ProfilerBugWorkaroundEnabled=Cw(fu(t.v8ProfilerBugWorkaround,$,!0));let Ce=fu(t.hostname,n)||"localhost",V=fu(t.port,re)||8126;this.url=new Hqo(fu(t.url,me,Gqo({protocol:"http:",hostname:Ce,port:V}))),this.libraryInjected=t.libraryInjected,this.activation=t.activation,this.exporters=sBo(t.exporters||[new Qat(this)],this);let Y=process.platform!=="win32",Se=Cw(fu(t.oomMonitoring,g,Y));fe(Se,"OOM monitoring",Y);let pe=fu(t.oomHeapLimitExtensionSize,Number(p),0),ct=fu(t.oomMaxHeapExtensionCount,Number(h),0),Ge=Se?nBo(fu(t.oomExportStrategies,d,[ien.PROCESS]),this):[],xt=Se?uBo(this):void 0;this.oomMonitoring={enabled:Se,heapLimitExtensionSize:pe,maxHeapExtensionCount:ct,exportStrategies:Ge,exportCommand:xt};let Jt=t.profilers||tBo({DD_PROFILING_HEAP_ENABLED:b,DD_PROFILING_WALLTIME_ENABLED:U,DD_PROFILING_PROFILERS:C});this.timelineEnabled=Cw(fu(t.timelineEnabled,N,je)),xe(this.timelineEnabled,"Timeline view"),this.timelineSamplingEnabled=Cw(fu(t.timelineSamplingEnabled,o,!0)),this.codeHotspotsEnabled=Cw(fu(t.codeHotspotsEnabled,a,je)),xe(this.codeHotspotsEnabled,"Code hotspots"),this.cpuProfilingEnabled=Cw(fu(t.cpuProfilingEnabled,c,je)),xe(this.cpuProfilingEnabled,"CPU profiling"),this.heapSamplingInterval=fu(t.heapSamplingInterval,Number(v));let pt=fu(t.uploadCompression,l,"on"),[fr,ln]=pt.split("-");["on","off","gzip","zstd"].includes(fr)||(this.logger.warn(`Invalid profile upload compression method "${pt}". Will use "on".`),fr="on");let sn=ln?Number.parseInt(ln,10):void 0;if(sn!==void 0)if(["on","off"].includes(fr))this.logger.warn(`Compression levels are not supported for "${fr}".`),sn=void 0;else if(Number.isNaN(sn))this.logger.warn(`Invalid compression level "${ln}". Will use default level.`),sn=void 0;else if(sn<1)this.logger.warn(`Invalid compression level ${sn}. Will use 1.`),sn=1;else{let Or={gzip:9,zstd:22}[fr];sn>Or&&(this.logger.warn(`Invalid compression level ${sn}. Will use ${Or}.`),sn=Or)}fr==="on"&&(fr="gzip"),this.uploadCompression={method:fr,level:sn},this.profilers=aBo(Jt,this)}};sen.exports={Config:Yat};function tBo({DD_PROFILING_HEAP_ENABLED:e,DD_PROFILING_WALLTIME_ENABLED:t,DD_PROFILING_PROFILERS:r}){let n=new Set(fu(r,"wall,space").split(","));return t!=null&&(Cw(t)?n.add("wall"):ten(t)&&n.delete("wall")),e!=null&&(Cw(e)?n.add("space"):ten(e)&&n.delete("space")),[...n]}s(tBo,"getProfilers");function rBo(e,t){let r=Object.values(ien).find(n=>n===e);return r===void 0&&t.logger.error(`Unknown oom export strategy "${e}"`),r}s(rBo,"getExportStrategy");function nBo(e,t){if(!e)return[];typeof e=="string"&&(e=e.split(","));for(let r=0;r<e.length;r++){let n=e[r];typeof n=="string"&&(e[r]=rBo(n,t))}return[...new Set(e)]}s(nBo,"ensureOOMExportStrategies");function iBo(e,t){switch(e){case"agent":return new Qat(t);case"file":return new ren(t)}}s(iBo,"getExporter");function sBo(e,t){typeof e=="string"&&(e=e.split(","));for(let r=0;r<e.length;r++){let n=e[r];typeof n=="string"&&(e[r]=iBo(n,t))}return e}s(sBo,"ensureExporters");function oBo(e,t){switch(e){case"cpu":case"wall":return new nen(t);case"space":return new Wqo(t);default:t.logger.error(`Unknown profiler "${e}"`)}}s(oBo,"getProfiler");function aBo(e,t){typeof e=="string"&&(e=e.split(","));for(let r=0;r<e.length;r++){let n=e[r];typeof n=="string"&&(e[r]=oBo(n,t))}return t.timelineEnabled&&e.some(r=>r instanceof nen)&&e.push(new Kqo(t)),e.filter(Boolean)}s(aBo,"ensureProfilers");function cBo(e){return typeof e!="object"||typeof e.debug!="function"||typeof e.info!="function"||typeof e.warn!="function"||typeof e.error!="function"?new Vqo:e}s(cBo,"ensureLogger");function uBo(e){let t=[...Object.entries(e.tags),["snapshot",Yqo.ON_OUT_OF_MEMORY]].map(([n,i])=>`${n}:${i}`).join(","),r=[];for(let n of e.exporters)n instanceof Qat?r.push(e.url.toString()):n instanceof ren&&r.push(zqo(e.pprofPrefix).toString());return[process.execPath,$qo.join(__dirname,"exporter_cli.js"),r.join(","),t,"space"]}s(uBo,"buildExportCommand")});var pen=y((S0l,den)=>{"use strict";var{EventEmitter:lBo}=require("events"),{Config:fBo}=oen(),{snapshotKinds:Xat}=PEe(),{threadNamePrefix:Jat}=EZ(),{isWebServerSpan:len,endpointNameFromTags:dBo,getStartedSpans:pBo}=Tat(),fen=hi(),hBo=hot(),{promisify:aen}=require("util"),qEe=require("zlib"),mBo=fen.channel("datadog:profiling:profile-submitted"),cen=fen.channel("dd-trace:span:finish");function gBo(e,t,r){if(e)return t.create([process.cwd()],r)}s(gBo,"maybeSourceMap");function uen(e,...t){e&&e.error(...t)}s(uen,"logError");function _Bo(e,t){for(let r=e.length;--r>=0;){let i=e[r].context();if(i._spanId===t){if(len(i._tags))return!0;t=i._parentId}}return!1}s(_Bo,"findWebSpan");var BEe=class extends lBo{static{s(this,"Profiler")}constructor(){super(),this._enabled=!1,this._logger=void 0,this._config=void 0,this._timer=void 0,this._lastStart=void 0,this._timeoutInterval=void 0,this.endpointCounts=new Map}start(t){return this._start(t).catch(r=>(uen(t.logger,"Error starting profiler. For troubleshooting tips, see <https://dtdg.co/nodejs-profiler-troubleshooting>",r),!1))}_logError(t){uen(this._logger,t)}async _start(t){if(this._enabled)return!0;let r=this._config=new fBo(t);this._logger=r.logger,this._enabled=!0,this._setInterval();let n;try{let{setLogger:i,SourceMapper:o}=bZ();i(r.logger),n=await gBo(r.sourceMap,o,r.debugSourceMaps),r.sourceMap&&r.debugSourceMaps&&this._logger.debug(()=>n.infoMap.size===0?"Found no source maps":`Found source maps for following files: [${[...n.infoMap.keys()].join(", ")}]`);let a=r.uploadCompression.level;switch(r.uploadCompression.method){case"gzip":this._compressionFn=aen(qEe.gzip),a!==void 0&&(this._compressionOptions={level:a});break;case"zstd":if(typeof qEe.zstdCompress=="function")this._compressionFn=aen(qEe.zstdCompress),a!==void 0&&(this._compressionOptions={params:{[qEe.constants.ZSTD_c_compressionLevel]:a}});else{let c=O_e().load("datadog-js-zstd").zstd_compress,u=a??0;this._compressionFn=l=>Promise.resolve(Buffer.from(c(l,u)))}break}}catch(i){this._logError(i)}try{let i=new Date;for(let o of r.profilers)o.start({mapper:n,nearOOMCallback:this._nearOOMExport.bind(this)}),this._logger.debug(`Started ${o.type} profiler in ${Jat} thread`);return r.endpointCollectionEnabled&&(this._spanFinishListener=this._onSpanFinish.bind(this),cen.subscribe(this._spanFinishListener)),this._capture(this._timeoutInterval,i),!0}catch(i){return this._logError(i),this._stop(),!1}}_nearOOMExport(t,r){let n=this._lastStart,i=new Date;this._submit({[t]:r},n,i,Xat.ON_OUT_OF_MEMORY)}_setInterval(){this._timeoutInterval=this._config.flushInterval}stop(){this._enabled&&(this._collect(Xat.ON_SHUTDOWN,!1),this._stop())}_stop(){if(this._enabled){this._enabled=!1,this._spanFinishListener!==void 0&&(cen.unsubscribe(this._spanFinishListener),this._spanFinishListener=void 0);for(let t of this._config.profilers)t.stop(),this._logger.debug(`Stopped ${t.type} profiler in ${Jat} thread`);clearTimeout(this._timer),this._timer=void 0}}_capture(t,r){this._enabled&&(this._lastStart=r,!this._timer||t!==this._timeoutInterval?(this._timer=setTimeout(()=>this._collect(Xat.PERIODIC),t),this._timer.unref()):this._timer.refresh())}_onSpanFinish(t){let r=t.context(),n=r._tags;if(!len(n))return;let i=dBo(n);if(!i||_Bo(pBo(r),r._parentId))return;let o=this.endpointCounts.get(i);o===void 0?(o={count:1},this.endpointCounts.set(i,o)):o.count++}async _collect(t,r=!0){if(!this._enabled)return;let n=this._lastStart,i=new Date,o=[],a={};try{if(this._config.profilers.length===0)throw new Error("No profile types configured.");hBo.withProfilerSerializing(()=>{for(let u of this._config.profilers){let l=u.profile(r,n,i);r||this._logger.debug(`Stopped ${u.type} profiler in ${Jat} thread`),l&&o.push({profiler:u,profile:l})}}),r&&this._capture(this._timeoutInterval,i);let c=!1;await Promise.all(o.map(async({profiler:u,profile:l})=>{try{let f=await u.encode(l),d=f instanceof Buffer&&this._compressionFn!==void 0?await this._compressionFn(f,this._compressionOptions):f;a[u.type]=d,this._logger.debug(()=>{let p=JSON.stringify(l,(h,g)=>typeof g=="bigint"?g.toString():g);return`Collected ${u.type} profile: `+p}),c=!0}catch(f){this._logError(f)}})),c&&(await this._submit(a,n,i,t),mBo.publish(),this._logger.debug("Submitted profiles"))}catch(c){this._logError(c),this._stop()}}_submit(t,r,n,i){let{tags:o}=this._config,a={};for(let[l,{count:f}]of this.endpointCounts)a[l]=f;this.endpointCounts.clear(),o.snapshot=i;let c={profiles:t,start:r,end:n,tags:o,endpointCounts:a},u=this._config.exporters.map(l=>l.export(c).catch(f=>{this._logger&&this._logger.warn(f)}));return Promise.all(u)}},Zat=class extends BEe{static{s(this,"ServerlessProfiler")}constructor(){super(),this._profiledIntervals=0,this._interval=1,this._flushAfterIntervals=void 0}_setInterval(){this._timeoutInterval=this._interval*1e3,this._flushAfterIntervals=this._config.flushInterval/1e3}async _collect(t,r=!0){this._profiledIntervals>=this._flushAfterIntervals||!r?(this._profiledIntervals=0,await super._collect(t,r)):(this._profiledIntervals+=1,this._capture(this._timeoutInterval,new Date))}};den.exports={Profiler:BEe,ServerlessProfiler:Zat}});var men=y((T0l,hen)=>{"use strict";var{Profiler:yBo,ServerlessProfiler:bBo}=pen(),EBo=Oat(),vBo=kat(),{AgentExporter:SBo}=Aot(),{FileExporter:wBo}=Cot(),{ConsoleLogger:TBo}=Iot(),{getEnvironmentVariable:ABo}=Dn(),xBo=ABo("AWS_LAMBDA_FUNCTION_NAME")?new bBo:new yBo;hen.exports={profiler:xBo,AgentExporter:SBo,FileExporter:wBo,WallProfiler:EBo,SpaceProfiler:vBo,ConsoleLogger:TBo}});var _en=y((A0l,gen)=>{"use strict";var UEe=At(),{profiler:ect}=men();process.once("beforeExit",()=>{ect.stop()});gen.exports={start:e=>{let{service:t,version:r,env:n,url:i,hostname:o,port:a,tags:c,repositoryUrl:u,commitSHA:l,injectionEnabled:f}=e,{enabled:d,sourceMap:p,exporters:h}=e.profiling,g={debug:S=>UEe.debug(S),info:S=>UEe.info(S),warn:S=>UEe.warn(S),error:(...S)=>UEe.error(...S)},b=f.length>0,v;return d==="auto"?v="auto":d==="true"?v="manual":f.includes("profiler")&&(v="injection"),ect.start({service:t,version:r,env:n,logger:g,sourceMap:p,exporters:h,url:i,hostname:o,port:a,tags:c,repositoryUrl:u,commitSHA:l,libraryInjected:b,activation:v})},stop:()=>{ect.stop()}}});var tct=y((x0l,yen)=>{"use strict";var{TRACE_SOURCE_PROPAGATION_KEY:FEe}=oi();function CBo(e,t){if(e&&t){let r=e[FEe]?Number.parseInt(e[FEe],16):0;e[FEe]=((r|t.id)>>>0).toString(16).padStart(2,"0")}return e}s(CBo,"addTraceSourceTag");function OBo(e){return Object.hasOwn(e,FEe)}s(OBo,"hasTraceSourcePropagationTag");yen.exports={addTraceSourceTag:CBo,hasTraceSourcePropagationTag:OBo}});var wen=y((O0l,Sen)=>{"use strict";var RBo=ck(),{MANUAL_KEEP:ben}=cu(),{USER_KEEP:Een,AUTO_KEEP:IBo,AUTO_REJECT:kBo}=KS(),{SAMPLING_MECHANISM_DEFAULT:NBo}=oi(),{addTraceSourceTag:PBo,hasTraceSourcePropagationTag:ven}=tct(),{getProductRateLimiter:DBo}=i2(),rct=class extends RBo{static{s(this,"TraceSourcePrioritySampler")}configure(t,r,n){this._env=t,this._limiter=DBo(n)}_getPriorityFromTags(t,r){if(Object.hasOwn(t,ben)&&t[ben]!==!1&&ven(r._trace.tags))return Een}_getPriorityFromAuto(t){let r=this._getContext(t);return r._sampling.mechanism=NBo,ven(r._trace.tags)?Een:this._isSampledByRateLimit(r)?IBo:kBo}setPriority(t,r,n){super.setPriority(t,r,n);let i=this._getContext(t);PBo(i?._trace?.tags,n)}};Sen.exports=rct});var Ren=y((I0l,Oen)=>{"use strict";var{channel:oct}=hi(),MBo=wen(),{USER_KEEP:Ten}=KS(),LBo=Ihe(),{APM_TRACING_ENABLED_KEY:qBo}=oi(),{hasTraceSourcePropagationTag:act}=tct(),nct=oct("dd-trace:span:start"),ict=oct("dd-trace:span:inject"),sct=oct("dd-trace:span:extract");function BBo(e){if(nct.hasSubscribers&&nct.unsubscribe(Aen),ict.hasSubscribers&&ict.unsubscribe(xen),sct.hasSubscribers&&sct.unsubscribe(Cen),e.apmTracingEnabled===!1)return nct.subscribe(Aen),ict.subscribe(xen),sct.subscribe(Cen),new MBo(e.env)}s(BBo,"configure");function Aen({span:e,fields:t}){let r=e.context?.()?._tags;if(!r)return;let{parent:n}=t;(!n||n._isRemote)&&(r[qBo]=0)}s(Aen,"onSpanStart");function xen({spanContext:e,carrier:t}){if(!(!e?._trace?.tags||!t)&&!act(e._trace.tags))for(let r in t){let n=r.toLowerCase();if(n.startsWith("x-datadog")||n.startsWith("x-b3")||n==="traceparent")delete t[r];else if(n==="tracestate"){let i=LBo.fromString(t[r]);i.forVendor("dd",o=>o.clear()),t[r]=i.toString()}}}s(xen,"onSpanInject");function Cen({spanContext:e={}}){!e._trace?.tags||!e._sampling||(act(e._trace.tags)?e._sampling.priority!==Ten&&(e._sampling.priority=Ten):e._sampling.priority=void 0)}s(Cen,"onSpanExtract");Oen.exports={configure:BBo,hasTraceSourcePropagationTag:act}});var jEe=y((N0l,Ien)=>{"use strict";function UBo(e){let t=e.scope().active();if(!t)return;let r=t.context(),n=r._trace.started,i=r._parentId;for(;i;){let o=n.find(c=>c.context()._spanId===i),a=o?.context();if(!a)break;i=a._parentId,a._tags?._inferred_span||(t=o)}return t}s(UBo,"getRootSpan");Ien.exports={getRootSpan:UBo}});var $Ee=y((D0l,Den)=>{"use strict";var{getRootSpan:FBo}=jEe(),ken=At(),jBo=$b(),Nen=jb();function Pen(e,t){for(let r of Object.keys(e))t.setTag(`usr.${r}`,String(e[r]));t.setTag("_dd.appsec.user.collection_mode","sdk")}s(Pen,"setUserTags");function $Bo(e,t){if(!t||!t.id){ken.warn("[ASM] Invalid user provided to setUser");return}let r=FBo(e);if(!r){ken.warn("[ASM] Root span not available in setUser");return}Pen(t,r);let n={[Nen.USER_ID]:String(t.id)};t.session_id&&typeof t.session_id=="string"&&(n[Nen.USER_SESSION_ID]=t.session_id),jBo.run({persistent:n})}s($Bo,"setUser");Den.exports={setUserTags:Pen,setUser:$Bo}});var Uen=y((L0l,Ben)=>{"use strict";var Ow=At(),{getRootSpan:AZ}=jEe(),{setUserTags:Len}=$Ee(),HBo=$b(),{keepTrace:GBo}=ck(),Men=jb(),{ASM:zBo}=i2(),{incrementSdkEventMetric:xZ}=nC();function VBo(e,t,r){if(!t||!t.id){Ow.warn("[ASM] Invalid user provided to trackUserLoginSuccessEvent");return}xZ("login_success","v1");let n=AZ(e);if(!n){Ow.warn("[ASM] Root span not available in trackUserLoginSuccessEvent");return}Len(t,n);let i=t.login??t.id;r={"usr.login":i,...r},F$("users.login.success",r,"trackUserLoginSuccessEvent",n),j$("users.login.success",{id:t.id,login:i})}s(VBo,"trackUserLoginSuccessEvent");function WBo(e,t,r,n){if(!t||typeof t!="string"){Ow.warn("[ASM] Invalid userId provided to trackUserLoginFailureEvent");return}let i={"usr.id":t,"usr.login":t,"usr.exists":r?"true":"false",...n};F$("users.login.failure",i,"trackUserLoginFailureEvent",AZ(e)),j$("users.login.failure",{login:t}),xZ("login_failure","v1")}s(WBo,"trackUserLoginFailureEvent");function KBo(e,t,r){if(!t||typeof t!="string"){Ow.warn("[ASM] Invalid eventName provided to trackCustomEvent");return}F$(t,r,"trackCustomEvent",AZ(e)),xZ("custom","v1"),(t==="users.login.success"||t==="users.login.failure")&&j$(t)}s(KBo,"trackCustomEvent");function YBo(e,t,r,n){if(!t||typeof t!="string"){Ow.warn("[ASM] Invalid login provided to eventTrackingV2.trackUserLoginSuccess");return}xZ("login_success","v2");let i=AZ(e);if(!i){Ow.warn("[ASM] Root span not available in eventTrackingV2.trackUserLoginSuccess");return}let o={login:t};n={"usr.login":t,...n},r&&(typeof r!="object"&&(r={id:r}),r.id&&(o.id=r.id,Len(r,i),n.usr=r)),F$("users.login.success",n,"eventTrackingV2.trackUserLoginSuccess",i),j$("users.login.success",o)}s(YBo,"trackUserLoginSuccessV2");function QBo(e,t,r,n){if(!t||typeof t!="string"){Ow.warn("[ASM] Invalid login provided to eventTrackingV2.trackUserLoginFailure");return}xZ("login_failure","v2");let i=AZ(e);if(!i){Ow.warn("[ASM] Root span not available in eventTrackingV2.trackUserLoginFailure");return}let o={login:t};typeof r=="object"&&n===void 0&&(n=r,r=!1),n={"usr.login":t,"usr.exists":r?"true":"false",...n},F$("users.login.failure",n,"eventTrackingV2.trackUserLoginFailure",i),j$("users.login.failure",o)}s(QBo,"trackUserLoginFailureV2");function qen(e,t=0){if(t>4)return{truncated:!0};let r={},n=!1;for(let i of Object.keys(e)){let o=e[i];if(o&&typeof o=="object"){let{result:a,truncated:c}=qen(o,t+1);if(n=n||c,a)for(let u of Object.keys(a))r[`${i}.${u}`]=a[u]}else o!==void 0&&(r[i]=o)}return{result:r,truncated:n}}s(qen,"flattenFields");function F$(e,t,r,n){if(!n){Ow.warn("[ASM] Root span not available in %s",r);return}let i={[`appsec.events.${e}.track`]:"true",[`_dd.appsec.events.${e}.sdk`]:"true"};if(t){let{result:o,truncated:a}=qen(t);a&&Ow.warn("[ASM] Too deep object provided in the SDK method %s, object truncated",r);for(let c of Object.keys(o))i[`appsec.events.${e}.${c}`]=String(o[c])}n.addTags(i),GBo(n,zBo)}s(F$,"trackEvent");function j$(e,t){let r={[`server.business_logic.${e}`]:null};t?.id&&(r[Men.USER_ID]=String(t.id)),t?.login&&(r[Men.USER_LOGIN]=String(t.login)),HBo.run({persistent:r})}s(j$,"runWaf");Ben.exports={trackUserLoginSuccessEvent:VBo,trackUserLoginFailureEvent:WBo,trackCustomEvent:KBo,trackUserLoginSuccessV2:YBo,trackUserLoginFailureV2:QBo,trackEvent:F$,runWaf:j$}});var $en=y((B0l,jen)=>{"use strict";var{USER_ID:XBo}=jb(),JBo=$b(),{getRootSpan:Fen}=jEe(),{block:ZBo,getBlockingAction:eUo}=iC(),{storage:tUo}=Fr(),{setUserTags:rUo}=$Ee(),HEe=At();function nUo(e){let t=JBo.run({persistent:{[XBo]:e.id}});return!!eUo(t?.actions)}s(nUo,"isUserBlocked");function iUo(e,t){if(!t||!t.id)return HEe.warn("[ASM] Invalid user provided to isUserBlocked"),!1;let r=Fen(e);return r?r.context()._tags["usr.id"]||rUo(t,r):HEe.warn("[ASM] Root span not available in isUserBlocked"),nUo(t)}s(iUo,"checkUserAndSetUser");function sUo(e,t,r){if(!t||!r){let i=tUo("legacy").getStore();i&&(t=t||i.req,r=r||i.res)}if(!t||!r)return HEe.warn("[ASM] Requests or response object not available in blockRequest"),!1;let n=Fen(e);return n?ZBo(t,r,n):(HEe.warn("[ASM] Root span not available in blockRequest"),!1)}s(sUo,"blockRequest");jen.exports={checkUserAndSetUser:iUo,blockRequest:sUo}});var Gen=y((F0l,Hen)=>{"use strict";var{trackUserLoginSuccessEvent:oUo,trackUserLoginFailureEvent:aUo,trackCustomEvent:cUo,trackUserLoginSuccessV2:uUo,trackUserLoginFailureV2:lUo}=Uen(),{checkUserAndSetUser:fUo,blockRequest:dUo}=$en(),{setTemplates:pUo}=iC(),{setUser:hUo}=$Ee(),cct=class{static{s(this,"EventTrackingV2")}constructor(t){this._tracer=t}trackUserLoginSuccess(t,r,n){uUo(this._tracer,t,r,n)}trackUserLoginFailure(t,r,n){lUo(this._tracer,t,r,n)}},uct=class{static{s(this,"AppsecSdk")}constructor(t,r){this._tracer=t,r&&pUo(r),this.eventTrackingV2=new cct(t)}trackUserLoginSuccessEvent(t,r){return oUo(this._tracer,t,r)}trackUserLoginFailureEvent(t,r,n){return aUo(this._tracer,t,r,n)}trackCustomEvent(t,r){return cUo(this._tracer,t,r)}isUserBlocked(t){return fUo(this._tracer,t)}blockRequest(t,r){return dUo(this._tracer,t,r)}setUser(t){return hUo(this._tracer,t)}};Hen.exports=uct});var Yen=y(($0l,Ken)=>{"use strict";var{SPAN_KIND:mUo,OUTPUT_VALUE:gUo,INPUT_VALUE:_Uo}=Kk(),{getFunctionArguments:CZ,validateKind:zen}=zL(),{isTrue:yUo,isError:bUo}=bf(),{storage:lct}=eye(),Ven=Ohe(),EUo=Sf().version,S2=At(),{getEnvironmentVariable:vUo}=Dn(),$$=Vx(),H$=zx(),{channel:Wen}=hi(),SUo=Wen("llmobs:eval-metric:append"),wUo=Wen("llmobs:writers:flush"),TUo=HHe(),fct=class extends TUo{static{s(this,"LLMObs")}constructor(t,r,n){super(t),this._config=n,this._llmobsModule=r,this._tagger=new H$(n)}get enabled(){return this._config.llmobs.enabled}enable(t={}){if(this.enabled){S2.debug("LLMObs is already enabled.");return}S2.debug("Enabling LLMObs");let{mlApp:r,agentlessEnabled:n}=t,i=vUo("DD_LLMOBS_ENABLED"),o={mlApp:r,agentlessEnabled:n};if(!(i==null||yUo(i))){S2.debug("LLMObs.enable() called when DD_LLMOBS_ENABLED is false. No action taken.");return}this._config.llmobs.enabled=!0,this._config.configure({...this._config,llmobs:o}),this._llmobsModule.enable(this._config)}disable(){if(!this.enabled){S2.debug("LLMObs is already disabled.");return}S2.debug("Disabling LLMObs"),this._config.llmobs.enabled=!1,this._llmobsModule.disable()}trace(t={},r){typeof t=="function"&&(r=t,t={});let n=zen(t.kind);$$.incrementLLMObsSpanStartCount({autoinstrumented:!1,kind:n});let i=t.name||n;if(!i)throw new Error("No span name provided for `trace`.");let{spanOptions:o,...a}=this._extractOptions(t);return r.length>1?this._tracer.trace(i,o,(c,u)=>this._activate(c,{kind:n,...a},()=>r(c,u))):this._tracer.trace(i,o,c=>this._activate(c,{kind:n,...a},()=>r(c)))}wrap(t={},r){typeof t=="function"&&(r=t,t={});let n=zen(t.kind),i=t.name||r?.name||n;i||(S2.warn('No span name provided for `wrap`. Defaulting to "unnamed-anonymous-function".'),i="unnamed-anonymous-function");let{spanOptions:o,...a}=this._extractOptions(t),c=this;function u(){$$.incrementLLMObsSpanStartCount({autoinstrumented:!1,kind:n});let l=c._tracer.scope().active(),f=arguments,d=f.length-1,p=f[d],h=typeof p=="function";if(h){let g=c._bind(p);f[d]=function(){let b=arguments[0],v=arguments[1];return c._autoAnnotate(l,n,CZ(r,f),bUo(b)||b==null?v:b),g.apply(this,arguments)}}try{let g=c._activate(l,{kind:n,...a},()=>r.apply(this,f));return g&&typeof g.then=="function"?g.then(b=>(h||c._autoAnnotate(l,n,CZ(r,f),b),b),b=>{throw c._autoAnnotate(l,n,CZ(r,f)),b}):(h||c._autoAnnotate(l,n,CZ(r,f),g),g)}catch(g){throw c._autoAnnotate(l,n,CZ(r,f)),g}}return s(u,"wrapped"),this._tracer.wrap(i,o,u)}annotate(t,r,n=!1){if(!this.enabled)return;t||(t=this._active()),t&&!r&&!(t instanceof Ven)&&(r=t,t=this._active());let i="";try{if(!t)throw i="invalid_span_no_active_spans",new Error("No span provided and no active LLMObs-generated span found");if(!r)throw i="invalid_options",new Error("No options provided for annotation.");if(!H$.tagMap.has(t))throw i="invalid_span_type",new Error("Span must be an LLMObs-generated span");if(t._duration!==void 0)throw i="invalid_finished_span",new Error("Cannot annotate a finished span");let o=H$.tagMap.get(t)[mUo];if(!o)throw i="invalid_no_span_kind",new Error("LLMObs span must have a span kind specified");let{inputData:a,outputData:c,metadata:u,metrics:l,tags:f}=r;(a||c)&&(o==="llm"?this._tagger.tagLLMIO(t,a,c):o==="embedding"?this._tagger.tagEmbeddingIO(t,a,c):o==="retrieval"?this._tagger.tagRetrievalIO(t,a,c):this._tagger.tagTextIO(t,a,c)),u&&this._tagger.tagMetadata(t,u),l&&this._tagger.tagMetrics(t,l),f&&this._tagger.tagSpanTags(t,f)}catch(o){throw o.ddErrorTag&&(i=o.ddErrorTag),o}finally{n===!1&&$$.recordLLMObsAnnotate(t,i)}}exportSpan(t){t=t||this._active();let r="";try{if(!t)throw r="no_active_span",new Error("No span provided and no active LLMObs-generated span found");if(!(t instanceof Ven))throw r="invalid_span",new TypeError("Span must be a valid Span object.");if(!H$.tagMap.has(t))throw r="invalid_span",new Error("Span must be an LLMObs-generated span")}catch(n){throw $$.recordExportSpan(t,r),n}try{return{traceId:t.context().toTraceId(!0),spanId:t.context().toSpanId()}}catch{r="invalid_span",S2.warn("Failed to export span. Span must be a valid Span object.")}finally{$$.recordExportSpan(t,r)}}submitEvaluation(t,r={}){if(!this.enabled)return;let n="",{traceId:i,spanId:o}=t;try{if(!i||!o)throw n="invalid_span",new Error("spanId and traceId must both be specified for the given evaluation metric to be submitted.");let a=r.mlApp||this._config.llmobs.mlApp;if(!a)throw n="missing_ml_app",new Error("ML App name is required for sending evaluation metrics. Evaluation metric data will not be sent.");let c=r.timestampMs||Date.now();if(typeof c!="number"||c<0)throw n="invalid_timestamp",new Error("timestampMs must be a non-negative integer. Evaluation metric data will not be sent");let{label:u,value:l,tags:f}=r,d=r.metricType?.toLowerCase();if(!u)throw n="invalid_metric_label",new Error("label must be the specified name of the evaluation metric");if(!d||!["categorical","score"].includes(d))throw n="invalid_metric_type",new Error('metricType must be one of "categorical" or "score"');if(d==="categorical"&&typeof l!="string")throw n="invalid_metric_value",new Error("value must be a string for a categorical metric.");if(d==="score"&&typeof l!="number")throw n="invalid_metric_value",new Error("value must be a number for a score metric.");let p={"ddtrace.version":EUo,ml_app:a};if(f)for(let g in f){let b=f[g];if(typeof b=="string")p[g]=b;else if(typeof b.toString=="function")p[g]=b.toString();else if(b==null)p[g]=Object.prototype.toString.call(b);else throw n="invalid_tags",new Error("Failed to parse tags. Tags for evaluation metrics must be strings")}let h={span_id:o,trace_id:i,label:u,metric_type:d,ml_app:a,[`${d}_value`]:l,timestamp_ms:c,tags:Object.entries(p).map(([g,b])=>`${g}:${b}`)};SUo.publish(h)}finally{$$.recordSubmitEvaluation(r,n)}}flush(){this.enabled&&wUo.publish()}_autoAnnotate(t,r,n,i){let o={};n&&!["llm","embedding"].includes(r)&&!H$.tagMap.get(t)?.[_Uo]&&(o.inputData=n),i&&!["llm","retrieval"].includes(r)&&!H$.tagMap.get(t)?.[gUo]&&(o.outputData=i),this.annotate(t,o,!0)}_active(){return lct.getStore()?.span}_activate(t,r,n){let i=this._active();this.enabled&&lct.enterWith({span:t}),r&&this._tagger.registerLLMObsSpan(t,{...r,parent:i});try{return n()}finally{this.enabled&&lct.enterWith({span:i})}}_bind(t){if(typeof t!="function")return t;let r=this,n=r._active();return s(function(){return r._activate(n,null,()=>t.apply(this,arguments))},"bound")}_extractOptions(t){let{modelName:r,modelProvider:n,sessionId:i,mlApp:o,_decorator:a,...c}=t;return{mlApp:o,modelName:r,modelProvider:n,sessionId:i,_decorator:a,spanOptions:c}}};Ken.exports=fct});var Jen=y((G0l,Xen)=>{"use strict";var AUo=BVe(),xUo=HLr(),CUo=gqr(),OUo=I4(),dct=At(),{setStartupLogPluginManager:RUo}=rL(),Qen=Eqr(),IUo=x_e(),kUo=tBr(),NUo=kGr(),PUo=Fde(),{getEnvironmentVariable:DUo}=Dn(),{setBaggageItem:MUo,getBaggageItem:LUo,getAllBaggageItems:qUo,removeBaggageItem:BUo,removeAllBaggageItems:UUo}=TVe(),w2=class{static{s(this,"LazyModule")}constructor(t){this.provider=t}enable(...t){this.module=this.provider(),this.module.enable(...t)}disable(){this.module?.disable()}};function pct(e,t,r,n,...i){r?._isInServerlessEnvironment?.()===!1?FUo(e,t,n,...i):jUo(e,t,n,...i)}s(pct,"lazyProxy");function FUo(e,t,r,...n){let i=r();e[t]=new i(...n)}s(FUo,"defineEagerly");function jUo(e,t,r,...n){Reflect.defineProperty(e,t,{get(){let i=r(),o=new i(...n);return Reflect.defineProperty(e,t,{value:o,configurable:!0,enumerable:!0}),o},configurable:!0,enumerable:!0})}s(jUo,"defineLazily");var hct=class extends AUo{static{s(this,"Tracer")}constructor(){super(),this._initialized=!1,this._nomenclature=kUo,this._pluginManager=new NUo(this),this.dogstatsd=new PUo,this._tracingInitialized=!1,this._flare=new w2(()=>LGr()),this.setBaggageItem=MUo,this.getBaggageItem=LUo,this.getAllBaggageItems=qUo,this.removeBaggageItem=BUo,this.removeAllBaggageItems=UUo,this._modules={appsec:new w2(()=>R5r()),iast:new w2(()=>VQr()),llmobs:new w2(()=>OXr()),rewriter:new w2(()=>kit())}}init(t){if(this._initialized)return this;this._initialized=!0;try{let r=new CUo(t);if(r.crashtracking.enabled&&hot().start(r),IUo.start(r,this._pluginManager),r.dogstatsd&&pct(this,"dogstatsd",r,()=>hhe().CustomMetrics,r),r.spanLeakDebug>0){let n=uVe();r.spanLeakDebug===n.MODES.LOG?n.enableLogging():r.spanLeakDebug===n.MODES.GC_AND_LOG&&n.enableGarbageCollection(),n.startScrubber()}if(r.remoteConfig.enabled&&!r.isCiVisibility){let n=Lrt().enable(r,this._modules.appsec);n.setProductHandler("APM_TRACING",(i,o)=>{i==="unapply"?r.configure({},!0):r.configure(o.lib_config,!0),this._enableOrDisableTracing(r)}),n.setProductHandler("AGENT_CONFIG",(i,o)=>{o?.name?.startsWith("flare-log-level.")&&(i==="unapply"?this._flare.disable():o.config?.log_level&&(this._flare.enable(r),this._flare.module.prepare(o.config.log_level)))}),n.setProductHandler("AGENT_TASK",(i,o)=>{i==="unapply"||!o||o.task_type!=="tracer_flare"||!o.args||(this._flare.enable(r),this._flare.module.send(o.args))}),r.dynamicInstrumentation.enabled&&Qen.start(r,n)}if(r.profiling.enabled!=="false"){let{SSIHeuristics:n}=LXr(),i=new n(r);i.start();let o=null;r.profiling.enabled==="true"?this._profilerStarted=this._startProfiler(r):i.emitsTelemetry&&(o=BXr(),o.start(r)),i.heuristicsActive&&i.onTriggered(()=>{o&&o.stop(),this._startProfiler(r),i.onTriggered()}),this._profilerStarted||(this._profilerStarted=Promise.resolve(!1))}if(r.runtimeMetrics&&OUo.start(r),this._enableOrDisableTracing(r),this._modules.rewriter.enable(r),r.tracing&&r.isManualApiEnabled){let n=FXr();this._testApiManualPlugin=new n(this),this._testApiManualPlugin.configure({...r,enabled:!0},!1)}if(r.ciVisAgentlessLogSubmissionEnabled)if(DUo("DD_API_KEY")){let n=$Xr();new n(this).configure({...r,enabled:!0})}else dct.warn("DD_AGENTLESS_LOG_SUBMISSION_ENABLED is set, but DD_API_KEY is undefined, so no automatic log submission will be performed.");r.isTestDynamicInstrumentationEnabled&&YXe()(r)}catch(r){dct.error("Error initialising tracer",r)}return this}_startProfiler(t){try{return _en().start(t)}catch(r){dct.error("Error starting profiler. For troubleshooting tips, see <https://dtdg.co/nodejs-profiler-troubleshooting>",r)}}_enableOrDisableTracing(t){if(t.tracing!==!1){if(t.appsec.enabled&&this._modules.appsec.enable(t),t.llmobs.enabled&&this._modules.llmobs.enable(t),!this._tracingInitialized){let r=t.apmTracingEnabled===!1?Ren().configure(t):void 0;this._tracer=new xUo(t,r),this.dataStreamsCheckpointer=this._tracer.dataStreamsCheckpointer,pct(this,"appsec",t,()=>Gen(),this._tracer,t),pct(this,"llmobs",t,()=>Yen(),this._tracer,this._modules.llmobs,t),this._tracingInitialized=!0}t.iast.enabled&&this._modules.iast.enable(t,this._tracer)}else this._tracingInitialized&&(this._modules.appsec.disable(),this._modules.iast.disable(),this._modules.llmobs.disable());this._tracingInitialized&&(this._tracer.configure(t),this._pluginManager.configure(t),Qen.configure(t),RUo(this._pluginManager))}profilerStarted(){if(!this._profilerStarted)throw new Error("profilerStarted() must be called after init()");return this._profilerStarted}use(){return this._pluginManager.configurePlugin(...arguments),this}get TracerProvider(){return LVe()}};Xen.exports=hct});var etn=y((V0l,Zen)=>{"use strict";var{isFalse:$Uo}=bf(),{getEnvironmentVariable:mct}=Dn(),HUo=typeof jest<"u",GUo=mct("DD_TRACE_ENABLED")?$Uo(mct("DD_TRACE_ENABLED")):String(mct("OTEL_TRACES_EXPORTER")).toLowerCase()==="none";Zen.exports=GUo||HUo?BVe():Jen()});var d4=y((W0l,ttn)=>{"use strict";if(!global._ddtrace){let e=etn();Object.defineProperty(global,"_ddtrace",{value:new e,enumerable:!1,configurable:!0,writable:!0}),global._ddtrace.default=global._ddtrace,global._ddtrace.tracer=global._ddtrace}ttn.exports=global._ddtrace});var Qx=y((K0l,rtn)=>{"use strict";rtn.exports=d4()});var mtn=y((twl,_Fo)=>{_Fo.exports={acl:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},append:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},asking:{arity:1,flags:["fast"],keyStart:0,keyStop:0,step:0},auth:{arity:-2,flags:["noscript","loading","stale","fast","no_auth","allow_busy"],keyStart:0,keyStop:0,step:0},bgrewriteaof:{arity:1,flags:["admin","noscript","no_async_loading"],keyStart:0,keyStop:0,step:0},bgsave:{arity:-1,flags:["admin","noscript","no_async_loading"],keyStart:0,keyStop:0,step:0},bitcount:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},bitfield:{arity:-2,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},bitfield_ro:{arity:-2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},bitop:{arity:-4,flags:["write","denyoom"],keyStart:2,keyStop:-1,step:1},bitpos:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},blmove:{arity:6,flags:["write","denyoom","noscript","blocking"],keyStart:1,keyStop:2,step:1},blmpop:{arity:-5,flags:["write","blocking","movablekeys"],keyStart:0,keyStop:0,step:0},blpop:{arity:-3,flags:["write","noscript","blocking"],keyStart:1,keyStop:-2,step:1},brpop:{arity:-3,flags:["write","noscript","blocking"],keyStart:1,keyStop:-2,step:1},brpoplpush:{arity:4,flags:["write","denyoom","noscript","blocking"],keyStart:1,keyStop:2,step:1},bzmpop:{arity:-5,flags:["write","blocking","movablekeys"],keyStart:0,keyStop:0,step:0},bzpopmax:{arity:-3,flags:["write","noscript","blocking","fast"],keyStart:1,keyStop:-2,step:1},bzpopmin:{arity:-3,flags:["write","noscript","blocking","fast"],keyStart:1,keyStop:-2,step:1},client:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},cluster:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},command:{arity:-1,flags:["loading","stale"],keyStart:0,keyStop:0,step:0},config:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},copy:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:2,step:1},dbsize:{arity:1,flags:["readonly","fast"],keyStart:0,keyStop:0,step:0},debug:{arity:-2,flags:["admin","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},decr:{arity:2,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},decrby:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},del:{arity:-2,flags:["write"],keyStart:1,keyStop:-1,step:1},discard:{arity:1,flags:["noscript","loading","stale","fast","allow_busy"],keyStart:0,keyStop:0,step:0},dump:{arity:2,flags:["readonly"],keyStart:1,keyStop:1,step:1},echo:{arity:2,flags:["fast"],keyStart:0,keyStop:0,step:0},eval:{arity:-3,flags:["noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},eval_ro:{arity:-3,flags:["readonly","noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},evalsha:{arity:-3,flags:["noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},evalsha_ro:{arity:-3,flags:["readonly","noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},exec:{arity:1,flags:["noscript","loading","stale","skip_slowlog"],keyStart:0,keyStop:0,step:0},exists:{arity:-2,flags:["readonly","fast"],keyStart:1,keyStop:-1,step:1},expire:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},expireat:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},expiretime:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},failover:{arity:-1,flags:["admin","noscript","stale"],keyStart:0,keyStop:0,step:0},fcall:{arity:-3,flags:["noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},fcall_ro:{arity:-3,flags:["readonly","noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},flushall:{arity:-1,flags:["write"],keyStart:0,keyStop:0,step:0},flushdb:{arity:-1,flags:["write"],keyStart:0,keyStop:0,step:0},function:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},geoadd:{arity:-5,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},geodist:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},geohash:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},geopos:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},georadius:{arity:-6,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1},georadius_ro:{arity:-6,flags:["readonly"],keyStart:1,keyStop:1,step:1},georadiusbymember:{arity:-5,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1},georadiusbymember_ro:{arity:-5,flags:["readonly"],keyStart:1,keyStop:1,step:1},geosearch:{arity:-7,flags:["readonly"],keyStart:1,keyStop:1,step:1},geosearchstore:{arity:-8,flags:["write","denyoom"],keyStart:1,keyStop:2,step:1},get:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},getbit:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},getdel:{arity:2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},getex:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},getrange:{arity:4,flags:["readonly"],keyStart:1,keyStop:1,step:1},getset:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hdel:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},hello:{arity:-1,flags:["noscript","loading","stale","fast","no_auth","allow_busy"],keyStart:0,keyStop:0,step:0},hexists:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},hexpire:{arity:-6,flags:["write","fast"],keyStart:1,keyStop:1,step:1},hget:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},hgetall:{arity:2,flags:["readonly"],keyStart:1,keyStop:1,step:1},hincrby:{arity:4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hincrbyfloat:{arity:4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hkeys:{arity:2,flags:["readonly"],keyStart:1,keyStop:1,step:1},hlen:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},hmget:{arity:-3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},hmset:{arity:-4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hrandfield:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},hscan:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},hset:{arity:-4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hsetnx:{arity:4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hstrlen:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},hvals:{arity:2,flags:["readonly"],keyStart:1,keyStop:1,step:1},incr:{arity:2,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},incrby:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},incrbyfloat:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},info:{arity:-1,flags:["loading","stale"],keyStart:0,keyStop:0,step:0},keys:{arity:2,flags:["readonly"],keyStart:0,keyStop:0,step:0},lastsave:{arity:1,flags:["loading","stale","fast"],keyStart:0,keyStop:0,step:0},latency:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},lcs:{arity:-3,flags:["readonly"],keyStart:1,keyStop:2,step:1},lindex:{arity:3,flags:["readonly"],keyStart:1,keyStop:1,step:1},linsert:{arity:5,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},llen:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},lmove:{arity:5,flags:["write","denyoom"],keyStart:1,keyStop:2,step:1},lmpop:{arity:-4,flags:["write","movablekeys"],keyStart:0,keyStop:0,step:0},lolwut:{arity:-1,flags:["readonly","fast"],keyStart:0,keyStop:0,step:0},lpop:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},lpos:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},lpush:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},lpushx:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},lrange:{arity:4,flags:["readonly"],keyStart:1,keyStop:1,step:1},lrem:{arity:4,flags:["write"],keyStart:1,keyStop:1,step:1},lset:{arity:4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},ltrim:{arity:4,flags:["write"],keyStart:1,keyStop:1,step:1},memory:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},mget:{arity:-2,flags:["readonly","fast"],keyStart:1,keyStop:-1,step:1},migrate:{arity:-6,flags:["write","movablekeys"],keyStart:3,keyStop:3,step:1},module:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},monitor:{arity:1,flags:["admin","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},move:{arity:3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},mset:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:2},msetnx:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:2},multi:{arity:1,flags:["noscript","loading","stale","fast","allow_busy"],keyStart:0,keyStop:0,step:0},object:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},persist:{arity:2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},pexpire:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},pexpireat:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},pexpiretime:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},pfadd:{arity:-2,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},pfcount:{arity:-2,flags:["readonly"],keyStart:1,keyStop:-1,step:1},pfdebug:{arity:3,flags:["write","denyoom","admin"],keyStart:2,keyStop:2,step:1},pfmerge:{arity:-2,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:1},pfselftest:{arity:1,flags:["admin"],keyStart:0,keyStop:0,step:0},ping:{arity:-1,flags:["fast"],keyStart:0,keyStop:0,step:0},psetex:{arity:4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},psubscribe:{arity:-2,flags:["pubsub","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},psync:{arity:-3,flags:["admin","noscript","no_async_loading","no_multi"],keyStart:0,keyStop:0,step:0},pttl:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},publish:{arity:3,flags:["pubsub","loading","stale","fast"],keyStart:0,keyStop:0,step:0},pubsub:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},punsubscribe:{arity:-1,flags:["pubsub","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},quit:{arity:-1,flags:["noscript","loading","stale","fast","no_auth","allow_busy"],keyStart:0,keyStop:0,step:0},randomkey:{arity:1,flags:["readonly"],keyStart:0,keyStop:0,step:0},readonly:{arity:1,flags:["loading","stale","fast"],keyStart:0,keyStop:0,step:0},readwrite:{arity:1,flags:["loading","stale","fast"],keyStart:0,keyStop:0,step:0},rename:{arity:3,flags:["write"],keyStart:1,keyStop:2,step:1},renamenx:{arity:3,flags:["write","fast"],keyStart:1,keyStop:2,step:1},replconf:{arity:-1,flags:["admin","noscript","loading","stale","allow_busy"],keyStart:0,keyStop:0,step:0},replicaof:{arity:3,flags:["admin","noscript","stale","no_async_loading"],keyStart:0,keyStop:0,step:0},reset:{arity:1,flags:["noscript","loading","stale","fast","no_auth","allow_busy"],keyStart:0,keyStop:0,step:0},restore:{arity:-4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},"restore-asking":{arity:-4,flags:["write","denyoom","asking"],keyStart:1,keyStop:1,step:1},role:{arity:1,flags:["noscript","loading","stale","fast"],keyStart:0,keyStop:0,step:0},rpop:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},rpoplpush:{arity:3,flags:["write","denyoom"],keyStart:1,keyStop:2,step:1},rpush:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},rpushx:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},sadd:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},save:{arity:1,flags:["admin","noscript","no_async_loading","no_multi"],keyStart:0,keyStop:0,step:0},scan:{arity:-2,flags:["readonly"],keyStart:0,keyStop:0,step:0},scard:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},script:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},sdiff:{arity:-2,flags:["readonly"],keyStart:1,keyStop:-1,step:1},sdiffstore:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:1},select:{arity:2,flags:["loading","stale","fast"],keyStart:0,keyStop:0,step:0},set:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},setbit:{arity:4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},setex:{arity:4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},setnx:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},setrange:{arity:4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},shutdown:{arity:-1,flags:["admin","noscript","loading","stale","no_multi","allow_busy"],keyStart:0,keyStop:0,step:0},sinter:{arity:-2,flags:["readonly"],keyStart:1,keyStop:-1,step:1},sintercard:{arity:-3,flags:["readonly","movablekeys"],keyStart:0,keyStop:0,step:0},sinterstore:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:1},sismember:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},slaveof:{arity:3,flags:["admin","noscript","stale","no_async_loading"],keyStart:0,keyStop:0,step:0},slowlog:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},smembers:{arity:2,flags:["readonly"],keyStart:1,keyStop:1,step:1},smismember:{arity:-3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},smove:{arity:4,flags:["write","fast"],keyStart:1,keyStop:2,step:1},sort:{arity:-2,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1},sort_ro:{arity:-2,flags:["readonly","movablekeys"],keyStart:1,keyStop:1,step:1},spop:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},spublish:{arity:3,flags:["pubsub","loading","stale","fast"],keyStart:1,keyStop:1,step:1},srandmember:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},srem:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},sscan:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},ssubscribe:{arity:-2,flags:["pubsub","noscript","loading","stale"],keyStart:1,keyStop:-1,step:1},strlen:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},subscribe:{arity:-2,flags:["pubsub","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},substr:{arity:4,flags:["readonly"],keyStart:1,keyStop:1,step:1},sunion:{arity:-2,flags:["readonly"],keyStart:1,keyStop:-1,step:1},sunionstore:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:1},sunsubscribe:{arity:-1,flags:["pubsub","noscript","loading","stale"],keyStart:1,keyStop:-1,step:1},swapdb:{arity:3,flags:["write","fast"],keyStart:0,keyStop:0,step:0},sync:{arity:1,flags:["admin","noscript","no_async_loading","no_multi"],keyStart:0,keyStop:0,step:0},time:{arity:1,flags:["loading","stale","fast"],keyStart:0,keyStop:0,step:0},touch:{arity:-2,flags:["readonly","fast"],keyStart:1,keyStop:-1,step:1},ttl:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},type:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},unlink:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:-1,step:1},unsubscribe:{arity:-1,flags:["pubsub","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},unwatch:{arity:1,flags:["noscript","loading","stale","fast","allow_busy"],keyStart:0,keyStop:0,step:0},wait:{arity:3,flags:["noscript"],keyStart:0,keyStop:0,step:0},watch:{arity:-2,flags:["noscript","loading","stale","fast","allow_busy"],keyStart:1,keyStop:-1,step:1},xack:{arity:-4,flags:["write","fast"],keyStart:1,keyStop:1,step:1},xadd:{arity:-5,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},xautoclaim:{arity:-6,flags:["write","fast"],keyStart:1,keyStop:1,step:1},xclaim:{arity:-6,flags:["write","fast"],keyStart:1,keyStop:1,step:1},xdel:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},xgroup:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},xinfo:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},xlen:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},xpending:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},xrange:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},xread:{arity:-4,flags:["readonly","blocking","movablekeys"],keyStart:0,keyStop:0,step:0},xreadgroup:{arity:-7,flags:["write","blocking","movablekeys"],keyStart:0,keyStop:0,step:0},xrevrange:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},xsetid:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},xtrim:{arity:-4,flags:["write"],keyStart:1,keyStop:1,step:1},zadd:{arity:-4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},zcard:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zcount:{arity:4,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zdiff:{arity:-3,flags:["readonly","movablekeys"],keyStart:0,keyStop:0,step:0},zdiffstore:{arity:-4,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1},zincrby:{arity:4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},zinter:{arity:-3,flags:["readonly","movablekeys"],keyStart:0,keyStop:0,step:0},zintercard:{arity:-3,flags:["readonly","movablekeys"],keyStart:0,keyStop:0,step:0},zinterstore:{arity:-4,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1},zlexcount:{arity:4,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zmpop:{arity:-4,flags:["write","movablekeys"],keyStart:0,keyStop:0,step:0},zmscore:{arity:-3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zpopmax:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},zpopmin:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},zrandmember:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrange:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrangebylex:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrangebyscore:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrangestore:{arity:-5,flags:["write","denyoom"],keyStart:1,keyStop:2,step:1},zrank:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zrem:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},zremrangebylex:{arity:4,flags:["write"],keyStart:1,keyStop:1,step:1},zremrangebyrank:{arity:4,flags:["write"],keyStart:1,keyStop:1,step:1},zremrangebyscore:{arity:4,flags:["write"],keyStart:1,keyStop:1,step:1},zrevrange:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrevrangebylex:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrevrangebyscore:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrevrank:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zscan:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},zscore:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zunion:{arity:-3,flags:["readonly","movablekeys"],keyStart:0,keyStop:0,step:0},zunionstore:{arity:-4,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1}}});var x2=y(dy=>{"use strict";var yFo=dy&&dy.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dy,"__esModule",{value:!0});dy.getKeyIndexes=dy.hasFlag=dy.exists=dy.list=void 0;var WEe=yFo(mtn());dy.list=Object.keys(WEe.default);var Cct={};dy.list.forEach(e=>{Cct[e]=WEe.default[e].flags.reduce(function(t,r){return t[r]=!0,t},{})});function bFo(e){return!!WEe.default[e]}s(bFo,"exists");dy.exists=bFo;function EFo(e,t){if(!Cct[e])throw new Error("Unknown command "+e);return!!Cct[e][t]}s(EFo,"hasFlag");dy.hasFlag=EFo;function vFo(e,t,r){let n=WEe.default[e];if(!n)throw new Error("Unknown command "+e);if(!Array.isArray(t))throw new Error("Expect args to be an array");let i=[],o=!!(r&&r.parseExternalKey),a=s((u,l)=>{let f=[],d=Number(u[l]);for(let p=0;p<d;p++)f.push(p+l+1);return f},"takeDynamicKeys"),c=s((u,l,f)=>{for(let d=l;d<u.length-1;d+=1)if(String(u[d]).toLowerCase()===f.toLowerCase())return d+1;return null},"takeKeyAfterToken");switch(e){case"zunionstore":case"zinterstore":case"zdiffstore":i.push(0,...a(t,1));break;case"eval":case"evalsha":case"eval_ro":case"evalsha_ro":case"fcall":case"fcall_ro":case"blmpop":case"bzmpop":i.push(...a(t,1));break;case"sintercard":case"lmpop":case"zunion":case"zinter":case"zmpop":case"zintercard":case"zdiff":{i.push(...a(t,0));break}case"georadius":{i.push(0);let u=c(t,5,"STORE");u&&i.push(u);let l=c(t,5,"STOREDIST");l&&i.push(l);break}case"georadiusbymember":{i.push(0);let u=c(t,4,"STORE");u&&i.push(u);let l=c(t,4,"STOREDIST");l&&i.push(l);break}case"sort":case"sort_ro":i.push(0);for(let u=1;u<t.length-1;u++){let l=t[u];if(typeof l!="string")continue;let f=l.toUpperCase();f==="GET"?(u+=1,l=t[u],l!=="#"&&(o?i.push([u,gtn(l)]):i.push(u))):f==="BY"?(u+=1,o?i.push([u,gtn(t[u])]):i.push(u)):f==="STORE"&&(u+=1,i.push(u))}break;case"migrate":if(t[2]==="")for(let u=5;u<t.length-1;u++){let l=t[u];if(typeof l=="string"&&l.toUpperCase()==="KEYS"){for(let f=u+1;f<t.length;f++)i.push(f);break}}else i.push(2);break;case"xreadgroup":case"xread":for(let u=e==="xread"?0:3;u<t.length-1;u++)if(String(t[u]).toUpperCase()==="STREAMS"){for(let l=u+1;l<=u+(t.length-1-u)/2;l++)i.push(l);break}break;default:if(n.step>0){let u=n.keyStart-1,l=n.keyStop>0?n.keyStop:t.length+n.keyStop+1;for(let f=u;f<l;f+=n.step)i.push(f)}break}return i}s(vFo,"getKeyIndexes");dy.getKeyIndexes=vFo;function gtn(e){typeof e!="string"&&(e=String(e));let t=e.indexOf("->");return t===-1?e.length:t}s(gtn,"getExternalKeyNameLength")});var _tn=y(g1=>{"use strict";Object.defineProperty(g1,"__esModule",{value:!0});g1.tryCatch=g1.errorObj=void 0;g1.errorObj={e:{}};var Oct;function SFo(e,t){try{let r=Oct;return Oct=null,r.apply(this,arguments)}catch(r){return g1.errorObj.e=r,g1.errorObj}}s(SFo,"tryCatcher");function wFo(e){return Oct=e,SFo}s(wFo,"tryCatch");g1.tryCatch=wFo});var _1=y(Rct=>{"use strict";Object.defineProperty(Rct,"__esModule",{value:!0});var V$=_tn();function ytn(e){setTimeout(function(){throw e},0)}s(ytn,"throwLater");function TFo(e,t,r){return typeof t=="function"&&e.then(n=>{let i;r!==void 0&&Object(r).spread&&Array.isArray(n)?i=V$.tryCatch(t).apply(void 0,[null].concat(n)):i=n===void 0?V$.tryCatch(t)(null):V$.tryCatch(t)(null,n),i===V$.errorObj&&ytn(i.e)},n=>{if(!n){let o=new Error(n+"");Object.assign(o,{cause:n}),n=o}let i=V$.tryCatch(t)(n);i===V$.errorObj&&ytn(i.e)}),e}s(TFo,"asCallback");Rct.default=TFo});var vtn=y((cwl,Etn)=>{"use strict";var btn=require("assert"),IZ=require("util");function W$(e){Object.defineProperty(this,"message",{value:e||"",configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}s(W$,"RedisError");IZ.inherits(W$,Error);Object.defineProperty(W$.prototype,"name",{value:"RedisError",configurable:!0,writable:!0});function Ict(e,t,r){btn(t),btn.strictEqual(typeof r,"number"),Object.defineProperty(this,"message",{value:e||"",configurable:!0,writable:!0});let n=Error.stackTraceLimit;Error.stackTraceLimit=2,Error.captureStackTrace(this,this.constructor),Error.stackTraceLimit=n,this.offset=r,this.buffer=t}s(Ict,"ParserError");IZ.inherits(Ict,W$);Object.defineProperty(Ict.prototype,"name",{value:"ParserError",configurable:!0,writable:!0});function kct(e){Object.defineProperty(this,"message",{value:e||"",configurable:!0,writable:!0});let t=Error.stackTraceLimit;Error.stackTraceLimit=2,Error.captureStackTrace(this,this.constructor),Error.stackTraceLimit=t}s(kct,"ReplyError");IZ.inherits(kct,W$);Object.defineProperty(kct.prototype,"name",{value:"ReplyError",configurable:!0,writable:!0});function KEe(e){Object.defineProperty(this,"message",{value:e||"",configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}s(KEe,"AbortError");IZ.inherits(KEe,W$);Object.defineProperty(KEe.prototype,"name",{value:"AbortError",configurable:!0,writable:!0});function Nct(e){Object.defineProperty(this,"message",{value:e||"",configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}s(Nct,"InterruptError");IZ.inherits(Nct,KEe);Object.defineProperty(Nct.prototype,"name",{value:"InterruptError",configurable:!0,writable:!0});Etn.exports={RedisError:W$,ParserError:Ict,ReplyError:kct,AbortError:KEe,InterruptError:Nct}});var Ttn=y((lwl,wtn)=>{"use strict";var Stn=require("assert"),K$=class extends Error{static{s(this,"RedisError")}get name(){return this.constructor.name}},Pct=class extends K${static{s(this,"ParserError")}constructor(t,r,n){Stn(r),Stn.strictEqual(typeof n,"number");let i=Error.stackTraceLimit;Error.stackTraceLimit=2,super(t),Error.stackTraceLimit=i,this.offset=n,this.buffer=r}get name(){return this.constructor.name}},Dct=class extends K${static{s(this,"ReplyError")}constructor(t){let r=Error.stackTraceLimit;Error.stackTraceLimit=2,super(t),Error.stackTraceLimit=r}get name(){return this.constructor.name}},YEe=class extends K${static{s(this,"AbortError")}get name(){return this.constructor.name}},Mct=class extends YEe{static{s(this,"InterruptError")}get name(){return this.constructor.name}};wtn.exports={RedisError:K$,ParserError:Pct,ReplyError:Dct,AbortError:YEe,InterruptError:Mct}});var C2=y((dwl,Atn)=>{"use strict";var AFo=process.version.charCodeAt(1)<55&&process.version.charCodeAt(2)===46?vtn():Ttn();Atn.exports=AFo});var QEe=y((pwl,Lct)=>{"use strict";var xtn=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],xFo=s(function(t){for(var r,n=0,i=0,o=[],a=t.length;n<a;n++)r=t.charCodeAt(n),r<128?o[i++]=r:r<2048?(o[i++]=r>>6|192,o[i++]=r&63|128):(r&64512)===55296&&n+1<t.length&&(t.charCodeAt(n+1)&64512)===56320?(r=65536+((r&1023)<<10)+(t.charCodeAt(++n)&1023),o[i++]=r>>18|240,o[i++]=r>>12&63|128,o[i++]=r>>6&63|128,o[i++]=r&63|128):(o[i++]=r>>12|224,o[i++]=r>>6&63|128,o[i++]=r&63|128);return o},"toUTF8Array"),Ctn=Lct.exports=s(function(t){for(var r,n=0,i=-1,o=0,a=0,c=typeof t=="string"?xFo(t):t,u=c.length;n<u;){if(r=c[n++],i===-1)r===123&&(i=n);else if(r!==125)a=xtn[(r^a>>8)&255]^a<<8;else if(n-1!==i)return a&16383;o=xtn[(r^o>>8)&255]^o<<8}return o&16383},"generate");Lct.exports.generateMulti=s(function(t){for(var r=1,n=t.length,i=Ctn(t[0]);r<n;)if(Ctn(t[r++])!==i)return-1;return i},"generateMulti")});var Mtn=y((mwl,Dtn)=>{"use strict";var Rtn=9007199254740991,CFo="[object Arguments]",OFo="[object Function]",RFo="[object GeneratorFunction]",IFo=/^(?:0|[1-9]\d*)$/;function Itn(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}s(Itn,"apply");function kFo(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}s(kFo,"baseTimes");var kZ=Object.prototype,NZ=kZ.hasOwnProperty,ktn=kZ.toString,NFo=kZ.propertyIsEnumerable,Otn=Math.max;function PFo(e,t){var r=HFo(e)||$Fo(e)?kFo(e.length,String):[],n=r.length,i=!!n;for(var o in e)(t||NZ.call(e,o))&&!(i&&(o=="length"||Ptn(o,n)))&&r.push(o);return r}s(PFo,"arrayLikeKeys");function DFo(e,t,r,n){return e===void 0||qct(e,kZ[r])&&!NZ.call(n,r)?t:e}s(DFo,"assignInDefaults");function MFo(e,t,r){var n=e[t];(!(NZ.call(e,t)&&qct(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}s(MFo,"assignValue");function LFo(e){if(!Uct(e))return jFo(e);var t=FFo(e),r=[];for(var n in e)n=="constructor"&&(t||!NZ.call(e,n))||r.push(n);return r}s(LFo,"baseKeysIn");function Ntn(e,t){return t=Otn(t===void 0?e.length-1:t,0),function(){for(var r=arguments,n=-1,i=Otn(r.length-t,0),o=Array(i);++n<i;)o[n]=r[t+n];n=-1;for(var a=Array(t+1);++n<t;)a[n]=r[n];return a[t]=o,Itn(e,this,a)}}s(Ntn,"baseRest");function qFo(e,t,r,n){r||(r={});for(var i=-1,o=t.length;++i<o;){var a=t[i],c=n?n(r[a],e[a],a,r,e):void 0;MFo(r,a,c===void 0?e[a]:c)}return r}s(qFo,"copyObject");function BFo(e){return Ntn(function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&UFo(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,o)}return t})}s(BFo,"createAssigner");function Ptn(e,t){return t=t??Rtn,!!t&&(typeof e=="number"||IFo.test(e))&&e>-1&&e%1==0&&e<t}s(Ptn,"isIndex");function UFo(e,t,r){if(!Uct(r))return!1;var n=typeof t;return(n=="number"?Bct(r)&&Ptn(t,r.length):n=="string"&&t in r)?qct(r[t],e):!1}s(UFo,"isIterateeCall");function FFo(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||kZ;return e===r}s(FFo,"isPrototype");function jFo(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}s(jFo,"nativeKeysIn");function qct(e,t){return e===t||e!==e&&t!==t}s(qct,"eq");function $Fo(e){return GFo(e)&&NZ.call(e,"callee")&&(!NFo.call(e,"callee")||ktn.call(e)==CFo)}s($Fo,"isArguments");var HFo=Array.isArray;function Bct(e){return e!=null&&VFo(e.length)&&!zFo(e)}s(Bct,"isArrayLike");function GFo(e){return WFo(e)&&Bct(e)}s(GFo,"isArrayLikeObject");function zFo(e){var t=Uct(e)?ktn.call(e):"";return t==OFo||t==RFo}s(zFo,"isFunction");function VFo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Rtn}s(VFo,"isLength");function Uct(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}s(Uct,"isObject");function WFo(e){return!!e&&typeof e=="object"}s(WFo,"isObjectLike");var KFo=BFo(function(e,t,r,n){qFo(t,QFo(t),e,n)}),YFo=Ntn(function(e){return e.push(void 0,DFo),Itn(KFo,void 0,e)});function QFo(e){return Bct(e)?PFo(e,!0):LFo(e)}s(QFo,"keysIn");Dtn.exports=YFo});var Btn=y((_wl,qtn)=>{"use strict";var XFo=9007199254740991,JFo="[object Arguments]",ZFo="[object Function]",ejo="[object GeneratorFunction]",Fct=Object.prototype,tjo=Fct.hasOwnProperty,Ltn=Fct.toString,rjo=Fct.propertyIsEnumerable;function njo(e){return sjo(e)&&tjo.call(e,"callee")&&(!rjo.call(e,"callee")||Ltn.call(e)==JFo)}s(njo,"isArguments");function ijo(e){return e!=null&&ajo(e.length)&&!ojo(e)}s(ijo,"isArrayLike");function sjo(e){return ujo(e)&&ijo(e)}s(sjo,"isArrayLikeObject");function ojo(e){var t=cjo(e)?Ltn.call(e):"";return t==ZFo||t==ejo}s(ojo,"isFunction");function ajo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=XFo}s(ajo,"isLength");function cjo(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}s(cjo,"isObject");function ujo(e){return!!e&&typeof e=="object"}s(ujo,"isObjectLike");qtn.exports=njo});var XEe=y(y1=>{"use strict";Object.defineProperty(y1,"__esModule",{value:!0});y1.isArguments=y1.defaults=y1.noop=void 0;var ljo=Mtn();y1.defaults=ljo;var fjo=Btn();y1.isArguments=fjo;function djo(){}s(djo,"noop");y1.noop=djo});var jtn=y(SC=>{"use strict";Object.defineProperty(SC,"__esModule",{value:!0});SC.genRedactedString=SC.getStringValue=SC.MAX_ARGUMENT_LENGTH=void 0;var pjo=kM(),jct=200;SC.MAX_ARGUMENT_LENGTH=jct;var hjo="ioredis";function Utn(e){if(e!==null)switch(typeof e){case"boolean":return;case"number":return;case"object":if(Buffer.isBuffer(e))return e.toString("hex");if(Array.isArray(e))return e.join(",");try{return JSON.stringify(e)}catch{return}case"string":return e}}s(Utn,"getStringValue");SC.getStringValue=Utn;function Ftn(e,t){let{length:r}=e;return r<=t?e:e.slice(0,t)+' ... <REDACTED full-length="'+r+'">'}s(Ftn,"genRedactedString");SC.genRedactedString=Ftn;function mjo(e){let t=(0,pjo.default)(`${hjo}:${e}`);function r(...n){if(t.enabled){for(let i=1;i<n.length;i++){let o=Utn(n[i]);typeof o=="string"&&o.length>jct&&(n[i]=Ftn(o,jct))}return t.apply(null,n)}}return s(r,"wrappedDebug"),Object.defineProperties(r,{namespace:{get(){return t.namespace}},enabled:{get(){return t.enabled}},destroy:{get(){return t.destroy}},log:{get(){return t.log},set(n){t.log=n}}}),r}s(mjo,"genDebugFunction");SC.default=mjo});var Htn=y($ct=>{"use strict";Object.defineProperty($ct,"__esModule",{value:!0});var $tn=`-----BEGIN CERTIFICATE-----
217
+ ${i}`);for(let[o,a]of Object.entries(r)){this._logger.debug(()=>{let u=a.toString("hex").match(/../g).join(" ");return`Adding ${o} profile to agent export: `+u});let c=this.typeToFile(o);n.push([c,a,{filename:c,contentType:"application/octet-stream"}])}return new Promise((o,a)=>{let c=sMo.operation({randomize:!0,minTimeout:this._backoffTime,retries:this._backoffTries,unref:!0});c.attempt(u=>{let l=new lMo;for(let[d,p,h]of n)l.append(d,p,h);let f={method:"POST",path:"/profiling/v1/input",headers:{"DD-EVP-ORIGIN":"dd-trace-js","DD-EVP-ORIGIN-VERSION":fMo,...l.getHeaders()},timeout:this._backoffTime*2**u};if(uMo.inject(f.headers),this._url.protocol==="unix:")f.socketPath=this._url.pathname;else{let d=dMo(this._url);f.protocol=d.protocol,f.hostname=d.hostname,f.port=d.port}this._logger.debug(()=>`Submitting profiler agent report attempt #${u} to: ${JSON.stringify(f)}`),bMo(f,l,(d,p)=>{if(d){let{status:h}=d;(typeof h!="number"||h>=500||h===429)&&c.retry(d)?this._logger.warn(`Error from the agent: ${d.message}`):a(d);return}EMo(p,(h,g)=>{h?this._logger.warn(`Error reading agent response: ${h.message}`):this._logger.debug(()=>`Agent export response: ${(g.toString("hex").match(/../g)||[]).join(" ")}`)}),o()})})})}};tJr.exports={AgentExporter:Tot,computeRetries:eJr}});var Cot=y((zEl,iJr)=>{"use strict";var vMo=require("fs"),{promisify:SMo}=require("util"),{threadId:rJr}=require("worker_threads"),nJr=SMo(vMo.writeFile),{EventSerializer:wMo}=Sot(),nZ=s(e=>String(e).padStart(2,"0"),"pad");function TMo(e){return`${e.getUTCFullYear()}${nZ(e.getUTCMonth()+1)}${nZ(e.getUTCDate())}T${nZ(e.getUTCHours())}${nZ(e.getUTCMinutes())}${nZ(e.getUTCSeconds())}Z`}s(TMo,"formatDateTime");var xot=class extends wMo{static{s(this,"FileExporter")}constructor(t={}){super(t);let{pprofPrefix:r}=t;this._pprofPrefix=r||""}export(t){let{profiles:r,end:n}=t,i=Object.keys(r),o=TMo(n),a=i.map(c=>nJr(`${this._pprofPrefix}${c}_worker_${rJr}_${o}.pprof`,r[c]));return a.push(nJr(`event_worker_${rJr}_${o}.json`,this.getEventJSON(t))),Promise.all(a)}};iJr.exports={FileExporter:xot}});var Iot=y((WEl,sJr)=>{"use strict";var Oot={error:3,warn:4,info:6,debug:7},Rot=class{static{s(this,"ConsoleLogger")}constructor(t={}){this._level=Oot[t.level]||Oot.error}debug(t){this._log("debug",t)}info(t){this._log("info",t)}warn(t){this._log("warn",t)}error(t){this._log("error",t)}_log(t,r){Oot[t]>this._level||console[t](r)}};sJr.exports={ConsoleLogger:Rot}});var Dot=y((YEl,dJr)=>{"use strict";var cJr=require("fs"),u1=require("path"),uJr=require("os"),lJr=typeof __webpack_require__=="function"?__non_webpack_require__:require,AMo=!!process.env.PREBUILDS_ONLY,fJr=process.versions.modules,Not=RMo()?"electron":"node",I$=uJr.arch(),EEe=uJr.platform(),kot=process.env.LIBC||(IMo(EEe)?"musl":"glibc"),oJr=process.env.ARM_VERSION||(I$==="arm64"?"8":process.config.variables.arm_version)||"";dJr.exports=Pot;function Pot(e){return lJr(Pot.path(e))}s(Pot,"load");Pot.path=function(e){e=u1.resolve(e||".");try{var t=lJr(u1.join(e,"package.json")).name.toUpperCase().replace(/-/g,"_");process.env[t+"_PREBUILD"]&&(e=process.env[t+"_PREBUILD"])}catch{}if(!AMo){var r=iZ(u1.join(e,"build/Release"),aJr);if(r)return r;var n=iZ(u1.join(e,"build/Debug"),aJr);if(n)return n}var i=[EEe+"-"+I$];kot&&i.push(EEe+kot+"-"+I$),(I$==="arm"||I$==="arm64")&&oJr&&i.forEach(function(l){i.push(l+"-v"+oJr)});for(var o=i.length;o--;){var a=iZ(u1.join(e,"prebuilds/"+i[o]),OMo);if(a)return a;var c=iZ(u1.join(e,"prebuilds/"+i[o]),xMo);if(c)return c;var u=iZ(u1.join(e,"prebuilds/"+i[o]),CMo);if(u)return u}throw new Error("No native build was found for runtime="+Not+" abi="+fJr+" platform="+EEe+kot+" arch="+I$)};function iZ(e,t){try{var r=cJr.readdirSync(e).filter(t);return r[0]&&u1.join(e,r[0])}catch{return null}}s(iZ,"getFirst");function xMo(e){return e===Not+"-napi.node"}s(xMo,"matchNapiRuntime");function CMo(e){return e==="node-napi.node"}s(CMo,"matchNapi");function OMo(e){var t=e.split("-");return t[0]===Not&&t[1]===fJr+".node"}s(OMo,"matchPrebuild");function aJr(e){return/\.node$/.test(e)}s(aJr,"matchBuild");function RMo(){return process.versions&&process.versions.electron||process.env.ELECTRON_RUN_AS_NODE?!0:typeof window<"u"&&window.process&&window.process.type==="renderer"}s(RMo,"isElectron");function IMo(e){return e==="linux"&&cJr.existsSync("/etc/alpine-release")}s(IMo,"isAlpine")});var pJr=y(mh=>{"use strict";var kMo=mh&&mh.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),NMo=mh&&mh.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),PMo=mh&&mh.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&kMo(t,e,r);return NMo(t,e),t};Object.defineProperty(mh,"__esModule",{value:!0});mh.monitorOutOfMemory=mh.getAllocationProfile=mh.stopSamplingHeapProfiler=mh.startSamplingHeapProfiler=void 0;var DMo=PMo(require("path")),MMo=Dot(),vEe=MMo(DMo.join(__dirname,"..",".."));function LMo(e,t){vEe.heapProfiler.startSamplingHeapProfiler(e,t)}s(LMo,"startSamplingHeapProfiler");mh.startSamplingHeapProfiler=LMo;function qMo(){vEe.heapProfiler.stopSamplingHeapProfiler()}s(qMo,"stopSamplingHeapProfiler");mh.stopSamplingHeapProfiler=qMo;function BMo(){return vEe.heapProfiler.getAllocationProfile()}s(BMo,"getAllocationProfile");mh.getAllocationProfile=BMo;function UMo(e,t,r,n,i,o,a){vEe.heapProfiler.monitorOutOfMemory(e,t,r,n,i,o,a)}s(UMo,"monitorOutOfMemory");mh.monitorOutOfMemory=UMo});var jot=y($a=>{"use strict";var l1=$a&&$a.__classPrivateFieldGet||function(e,t,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(e):n?n.value:t.get(e)},k$,N$;Object.defineProperty($a,"__esModule",{value:!0});$a.Profile=$a.Function=$a.Location=$a.Line=$a.Mapping=$a.Sample=$a.Label=$a.ValueType=$a.StringTable=$a.emptyTableToken=void 0;var hJr=2n**32n-1n,Lot=2**32-1,mJr=Lot+1,FMo=typeof Buffer>"u"?e=>new TextEncoder().encode(e):e=>Buffer.from(e,"utf8");function gJr(e){if(!e.length)return 0;let t=0;for(;t<e.length&&e[t++]>=128;);return t}s(gJr,"countNumberBytes");function jMo(e){if(!e.length)return BigInt(0);let t=BigInt(e[0]&127),r=0;for(;e[r++]>=128;)t|=BigInt(e[r]&127)<<BigInt(7*r);return t}s(jMo,"decodeBigNumber");function Mot(e,t=0){return{value:e,offset:t}}s(Mot,"makeValue");function $Mo(e,t){switch(e){case zMo:for(let r=0;r<t.length;r++)if(!(t[r]&128))return Mot(t.slice(0,r+1));return Mot(t);case VMo:{let r=gJr(t),n=Zs(t);return Mot(t.slice(r,Number(n)+r),r)}default:throw new Error(`Unrecognized value type: ${e}`)}}s($Mo,"getValue");function HMo(e){return typeof e!="bigint"?(e>>>0)%mJr:Number(e&hJr)}s(HMo,"lowBits");function GMo(e){return typeof e!="bigint"?e/mJr>>>0:Number(e>>32n&hJr)}s(GMo,"highBits");function _Jr(e){let t=e<0;t&&(e=-e);let r=HMo(e),n=GMo(e);return t&&(n=~n>>>0,r=~r>>>0,++r>Lot&&(r=0,++n>Lot&&(n=0))),[n,r]}s(_Jr,"long");var zMo=0,VMo=2;function Zs(e){if(gJr(e)>4)return jMo(e);if(!e.length)return 0;let r=e[0]&127,n=0;for(;e[n++]>=128;)r|=(e[n]&127)<<7*n;return r}s(Zs,"decodeNumber");function qot(e){let t=[],r=0;for(let n=0;n<e.length;n++)e[n]&128||(t.push(Zs(e.slice(r,n+1))),r=n+1);return t}s(qot,"decodeNumbers");function g2(e,t){return t==null?[e]:(t.push(e),t)}s(g2,"push");function P$(e){if(e===0||e===0n)return 0;let[t,r]=_Jr(e),n=r,i=(r>>>28|t<<4)>>>0,o=t>>>24;return o!==0?o<128?9:10:i!==0?i<16384?i<128?5:6:i<2097152?7:8:n<16384?n<128?1:2:n<2097152?3:4}s(P$,"measureNumber");function yJr(e){return typeof e>"u"?0:typeof e=="number"||typeof e=="bigint"?P$(e)||1:e.length}s(yJr,"measureValue");function Bot(e){let t=0;for(let r of e)t+=yJr(r);return t}s(Bot,"measureArray");function mo(e){let t=P$(e);return t?1+t:0}s(mo,"measureNumberField");function Uot(e){let t=0;for(let r of e)t+=P$(r)||1;return t?1+P$(t)+t:0}s(Uot,"measureNumberArrayField");function bJr(e){let t=yJr(e);return t?1+P$(t)+t:0}s(bJr,"measureLengthDelimField");function _2(e){let t=0;for(let r of e)t+=bJr(r);return t}s(_2,"measureLengthDelimArrayField");function mi(e,t,r){if(r===0||r===0n)return e[t++]=0,t;let[n,i]=_Jr(r);for(;n;)e[t++]=i&127|128,i=(i>>>7|n<<25)>>>0,n>>>=7;for(;i>127;)e[t++]=i&127|128,i=i>>>7;return e[t++]=i,t}s(mi,"encodeNumber");$a.emptyTableToken=Symbol();var sZ=class e{static{s(this,"StringTable")}constructor(t){this.strings=new Array,k$.set(this,new Array),N$.set(this,new Map),t!==$a.emptyTableToken&&this.dedup("")}get encodedLength(){let t=0;for(let r of l1(this,k$,"f"))t+=r.length;return t}_encodeToBuffer(t,r){for(let n of l1(this,k$,"f"))t.set(n,r),r+=n.length;return r}encode(t=new Uint8Array(this.encodedLength)){return this._encodeToBuffer(t,0),t}static _encodeStringFromUtf8(t){let r=new Uint8Array(1+t.length+(P$(t.length)||1)),n=0;return r[n++]=50,n=mi(r,n,t.length),t.length>0&&r.set(t,n++),r}static _encodeString(t){return e._encodeStringFromUtf8(FMo(t))}dedup(t){if(typeof t=="number")return t;if(!l1(this,N$,"f").has(t)){let r=this.strings.push(t)-1;l1(this,N$,"f").set(t,r),l1(this,k$,"f").push(e._encodeString(t))}return l1(this,N$,"f").get(t)}_decodeString(t){let r=new TextDecoder().decode(t);l1(this,N$,"f").set(r,this.strings.push(r)-1),l1(this,k$,"f").push(e._encodeStringFromUtf8(t))}};$a.StringTable=sZ;k$=new WeakMap,N$=new WeakMap;function f1(e,t){let r={},n=0;for(;n<e.length;){let i=e[n]>>3,o=e[n]&7;n++;let{offset:a,value:c}=$Mo(o,e.slice(n));n+=c.length+a,t(r,i,c)}return r}s(f1,"decode");var y2=class e{static{s(this,"ValueType")}static create(t){return t instanceof e?t:new e(t)}constructor(t){this.type=t.type||0,this.unit=t.unit||0}get length(){let t=0;return t+=mo(this.type),t+=mo(this.unit),t}_encodeToBuffer(t,r=0){return this.type&&(t[r++]=8,r=mi(t,r,this.type)),this.unit&&(t[r++]=16,r=mi(t,r,this.unit)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.type=Zs(n);break;case 2:t.unit=Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.ValueType=y2;var oZ=class e{static{s(this,"Label")}static create(t){return t instanceof e?t:new e(t)}constructor(t){this.key=t.key||0,this.str=t.str||0,this.num=t.num||0,this.numUnit=t.numUnit||0}get length(){let t=0;return t+=mo(this.key),t+=mo(this.str),t+=mo(this.num),t+=mo(this.numUnit),t}_encodeToBuffer(t,r=0){return this.key&&(t[r++]=8,r=mi(t,r,this.key)),this.str&&(t[r++]=16,r=mi(t,r,this.str)),this.num&&(t[r++]=24,r=mi(t,r,this.num)),this.numUnit&&(t[r++]=32,r=mi(t,r,this.numUnit)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.key=Zs(n);break;case 2:t.str=Zs(n);break;case 3:t.num=Zs(n);break;case 4:t.numUnit=Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Label=oZ;var aZ=class e{static{s(this,"Sample")}static create(t){return t instanceof e?t:new e(t)}constructor(t){this.locationId=t.locationId||[],this.value=t.value||[],this.label=(t.label||[]).map(oZ.create)}get length(){let t=0;return t+=Uot(this.locationId),t+=Uot(this.value),t+=_2(this.label),t}_encodeToBuffer(t,r=0){if(this.locationId.length){t[r++]=10,r=mi(t,r,Bot(this.locationId));for(let n of this.locationId)r=mi(t,r,n)}if(this.value.length){t[r++]=18,r=mi(t,r,Bot(this.value));for(let n of this.value)r=mi(t,r,n)}for(let n of this.label)t[r++]=26,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.locationId=qot(n);break;case 2:t.value=qot(n);break;case 3:t.label=g2(oZ.decode(n),t.label);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Sample=aZ;var cZ=class e{static{s(this,"Mapping")}static create(t){return t instanceof e?t:new e(t)}constructor(t){this.id=t.id||0,this.memoryStart=t.memoryStart||0,this.memoryLimit=t.memoryLimit||0,this.fileOffset=t.fileOffset||0,this.filename=t.filename||0,this.buildId=t.buildId||0,this.hasFunctions=!!t.hasFunctions,this.hasFilenames=!!t.hasFilenames,this.hasLineNumbers=!!t.hasLineNumbers,this.hasInlineFrames=!!t.hasInlineFrames}get length(){let t=0;return t+=mo(this.id),t+=mo(this.memoryStart),t+=mo(this.memoryLimit),t+=mo(this.fileOffset),t+=mo(this.filename),t+=mo(this.buildId),t+=mo(this.hasFunctions?1:0),t+=mo(this.hasFilenames?1:0),t+=mo(this.hasLineNumbers?1:0),t+=mo(this.hasInlineFrames?1:0),t}_encodeToBuffer(t,r=0){return this.id&&(t[r++]=8,r=mi(t,r,this.id)),this.memoryStart&&(t[r++]=16,r=mi(t,r,this.memoryStart)),this.memoryLimit&&(t[r++]=24,r=mi(t,r,this.memoryLimit)),this.fileOffset&&(t[r++]=32,r=mi(t,r,this.fileOffset)),this.filename&&(t[r++]=40,r=mi(t,r,this.filename)),this.buildId&&(t[r++]=48,r=mi(t,r,this.buildId)),this.hasFunctions&&(t[r++]=56,r=mi(t,r,1)),this.hasFilenames&&(t[r++]=64,r=mi(t,r,1)),this.hasLineNumbers&&(t[r++]=72,r=mi(t,r,1)),this.hasInlineFrames&&(t[r++]=80,r=mi(t,r,1)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.id=Zs(n);break;case 2:t.memoryStart=Zs(n);break;case 3:t.memoryLimit=Zs(n);break;case 4:t.fileOffset=Zs(n);break;case 5:t.filename=Zs(n);break;case 6:t.buildId=Zs(n);break;case 7:t.hasFunctions=!!Zs(n);break;case 8:t.hasFilenames=!!Zs(n);break;case 9:t.hasLineNumbers=!!Zs(n);break;case 10:t.hasInlineFrames=!!Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Mapping=cZ;var uZ=class e{static{s(this,"Line")}static create(t){return t instanceof e?t:new e(t)}constructor(t){this.functionId=t.functionId||0,this.line=t.line||0}get length(){let t=0;return t+=mo(this.functionId),t+=mo(this.line),t}_encodeToBuffer(t,r=0){return this.functionId&&(t[r++]=8,r=mi(t,r,this.functionId)),this.line&&(t[r++]=16,r=mi(t,r,this.line)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.functionId=Zs(n);break;case 2:t.line=Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Line=uZ;var lZ=class e{static{s(this,"Location")}static create(t){return t instanceof e?t:new e(t)}constructor(t){this.id=t.id||0,this.mappingId=t.mappingId||0,this.address=t.address||0,this.line=(t.line||[]).map(uZ.create),this.isFolded=!!t.isFolded}get length(){let t=0;return t+=mo(this.id),t+=mo(this.mappingId),t+=mo(this.address),t+=_2(this.line),t+=mo(this.isFolded?1:0),t}_encodeToBuffer(t,r=0){this.id&&(t[r++]=8,r=mi(t,r,this.id)),this.mappingId&&(t[r++]=16,r=mi(t,r,this.mappingId)),this.address&&(t[r++]=24,r=mi(t,r,this.address));for(let n of this.line)t[r++]=34,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return this.isFolded&&(t[r++]=40,r=mi(t,r,1)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.id=Zs(n);break;case 2:t.mappingId=Zs(n);break;case 3:t.address=Zs(n);break;case 4:t.line=g2(uZ.decode(n),t.line);break;case 5:t.isFolded=!!Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Location=lZ;var fZ=class e{static{s(this,"Function")}static create(t){return t instanceof e?t:new e(t)}constructor(t){this.id=t.id||0,this.name=t.name||0,this.systemName=t.systemName||0,this.filename=t.filename||0,this.startLine=t.startLine||0}get length(){let t=0;return t+=mo(this.id),t+=mo(this.name),t+=mo(this.systemName),t+=mo(this.filename),t+=mo(this.startLine),t}_encodeToBuffer(t,r=0){return this.id&&(t[r++]=8,r=mi(t,r,this.id)),this.name&&(t[r++]=16,r=mi(t,r,this.name)),this.systemName&&(t[r++]=24,r=mi(t,r,this.systemName)),this.filename&&(t[r++]=32,r=mi(t,r,this.filename)),this.startLine&&(t[r++]=40,r=mi(t,r,this.startLine)),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.id=Zs(n);break;case 2:t.name=Zs(n);break;case 3:t.systemName=Zs(n);break;case 4:t.filename=Zs(n);break;case 5:t.startLine=Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Function=fZ;var Fot=class{static{s(this,"Profile")}constructor(t={}){this.sampleType=(t.sampleType||[]).map(y2.create),this.sample=(t.sample||[]).map(aZ.create),this.mapping=(t.mapping||[]).map(cZ.create),this.location=(t.location||[]).map(lZ.create),this.function=(t.function||[]).map(fZ.create),this.stringTable=t.stringTable||new sZ,this.dropFrames=t.dropFrames||0,this.keepFrames=t.keepFrames||0,this.timeNanos=t.timeNanos||0,this.durationNanos=t.durationNanos||0,this.periodType=t.periodType?y2.create(t.periodType):void 0,this.period=t.period||0,this.comment=t.comment||[],this.defaultSampleType=t.defaultSampleType||0}get length(){let t=0;return t+=_2(this.sampleType),t+=_2(this.sample),t+=_2(this.mapping),t+=_2(this.location),t+=_2(this.function),t+=this.stringTable.encodedLength,t+=mo(this.dropFrames),t+=mo(this.keepFrames),t+=mo(this.timeNanos),t+=mo(this.durationNanos),t+=bJr(this.periodType),t+=mo(this.period),t+=Uot(this.comment),t+=mo(this.defaultSampleType),t}_encodeSampleTypesToBuffer(t,r=0){for(let n of this.sampleType)t[r++]=10,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}_encodeSamplesToBuffer(t,r=0){for(let n of this.sample)t[r++]=18,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}_encodeMappingsToBuffer(t,r=0){for(let n of this.mapping)t[r++]=26,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}_encodeLocationsToBuffer(t,r=0){for(let n of this.location)t[r++]=34,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}_encodeFunctionsToBuffer(t,r=0){for(let n of this.function)t[r++]=42,r=mi(t,r,n.length),r=n._encodeToBuffer(t,r);return r}_encodeBasicValuesToBuffer(t,r=0){if(this.dropFrames&&(t[r++]=56,r=mi(t,r,this.dropFrames)),this.keepFrames&&(t[r++]=64,r=mi(t,r,this.keepFrames)),this.timeNanos&&(t[r++]=72,r=mi(t,r,this.timeNanos)),this.durationNanos&&(t[r++]=80,r=mi(t,r,this.durationNanos)),typeof this.periodType<"u"&&(t[r++]=90,r=mi(t,r,this.periodType.length),r=this.periodType._encodeToBuffer(t,r)),this.period&&(t[r++]=96,r=mi(t,r,this.period)),this.comment.length){t[r++]=106,r=mi(t,r,Bot(this.comment));for(let n of this.comment)r=mi(t,r,n)}return this.defaultSampleType&&(t[r++]=112,r=mi(t,r,this.defaultSampleType)),r}_encodeToBuffer(t,r=0){return r=this._encodeSampleTypesToBuffer(t,r),r=this._encodeSamplesToBuffer(t,r),r=this._encodeMappingsToBuffer(t,r),r=this._encodeLocationsToBuffer(t,r),r=this._encodeFunctionsToBuffer(t,r),r=this.stringTable._encodeToBuffer(t,r),r=this._encodeBasicValuesToBuffer(t,r),r}async _encodeToBufferAsync(t,r=0){return r=this._encodeSampleTypesToBuffer(t,r),await new Promise(setImmediate),r=this._encodeSamplesToBuffer(t,r),await new Promise(setImmediate),r=this._encodeMappingsToBuffer(t,r),await new Promise(setImmediate),r=this._encodeLocationsToBuffer(t,r),await new Promise(setImmediate),r=this._encodeFunctionsToBuffer(t,r),await new Promise(setImmediate),r=this.stringTable._encodeToBuffer(t,r),await new Promise(setImmediate),r=this._encodeBasicValuesToBuffer(t,r),r}encode(t=new Uint8Array(this.length)){return this._encodeToBuffer(t,0),t}async encodeAsync(t=new Uint8Array(this.length)){return await this._encodeToBufferAsync(t,0),t}static decodeValue(t,r,n){switch(r){case 1:t.sampleType=g2(y2.decode(n),t.sampleType);break;case 2:t.sample=g2(aZ.decode(n),t.sample);break;case 3:t.mapping=g2(cZ.decode(n),t.mapping);break;case 4:t.location=g2(lZ.decode(n),t.location);break;case 5:t.function=g2(fZ.decode(n),t.function);break;case 6:{t.stringTable===void 0&&(t.stringTable=new sZ($a.emptyTableToken)),t.stringTable._decodeString(n);break}case 7:t.dropFrames=Zs(n);break;case 8:t.keepFrames=Zs(n);break;case 9:t.timeNanos=Zs(n);break;case 10:t.durationNanos=Zs(n);break;case 11:t.periodType=y2.decode(n);break;case 12:t.period=Zs(n);break;case 13:t.comment=qot(n);break;case 14:t.defaultSampleType=Zs(n);break}}static decode(t){return new this(f1(t,this.decodeValue))}};$a.Profile=Fot});var Hot=y(Vb=>{"use strict";Object.defineProperty(Vb,"__esModule",{value:!0});Vb.serializeHeapProfile=Vb.serializeTimeProfile=Vb.GARBAGE_COLLECTION_FUNCTION_NAME=Vb.NON_JS_THREADS_FUNCTION_NAME=void 0;var gh=jot();Vb.NON_JS_THREADS_FUNCTION_NAME="Non JS threads activity";Vb.GARBAGE_COLLECTION_FUNCTION_NAME="Garbage Collection";function WMo(e){return e.column!==void 0&&e.line!==void 0&&e.line>0}s(WMo,"isGeneratedLocation");function EJr(e,t,r,n,i,o){let a=[],c=[],u=[],l=new Map,f=new Map,d=t.children.map(b=>({node:b,stack:[]}));for(;d.length>0;){let b=d.pop(),v=b.node;if(v.scriptName.startsWith("file://")&&(v.scriptName=v.scriptName.slice(7)),i&&v.scriptName.indexOf(i)>-1)continue;let S=b.stack,C=p(v,o);S.unshift(C.id),r(b,a);for(let R of v.children)d.push({node:R,stack:S.slice()})}e.sample=a,e.location=c,e.function=u,e.stringTable=n;function p(b,v){let S={file:b.scriptName||"",line:b.lineNumber,column:b.columnNumber,name:b.name};S.line&&v&&WMo(S)&&(S=v.mappingInfo(S));let C=`${b.scriptId}:${S.line}:${S.column}:${S.name}`,R=f.get(C);if(R!==void 0)return c[R-1];R=c.length+1,f.set(C,R);let N=h(S,b.scriptId),A=new gh.Location({id:R,line:[N]});return c.push(A),A}s(p,"getLocation");function h(b,v){return new gh.Line({functionId:g(b,v).id,line:b.line})}s(h,"getLine");function g(b,v){let S=b.name,C=S?`${v}:${S}`:`${v}:${b.line}:${b.column}`,R=l.get(C);if(R!==void 0)return u[R-1];R=u.length+1,l.set(C,R),S||(b.line?b.column?S=`(anonymous:L#${b.line}:C#${b.column})`:S=`(anonymous:L#${b.line})`:S="(anonymous)");let N=n.dedup(S),A=new gh.Function({id:R,name:N,systemName:N,filename:n.dedup(b.file||"")});return u.push(A),A}s(g,"getFunction")}s(EJr,"serialize");function KMo(e){return new gh.ValueType({type:e.dedup("sample"),unit:e.dedup("count")})}s(KMo,"createSampleCountValueType");function YMo(e){return new gh.ValueType({type:e.dedup("wall"),unit:e.dedup("nanoseconds")})}s(YMo,"createTimeValueType");function QMo(e){return new gh.ValueType({type:e.dedup("cpu"),unit:e.dedup("nanoseconds")})}s(QMo,"createCpuValueType");function XMo(e){return new gh.ValueType({type:e.dedup("objects"),unit:e.dedup("count")})}s(XMo,"createObjectCountValueType");function JMo(e){return new gh.ValueType({type:e.dedup("space"),unit:e.dedup("bytes")})}s(JMo,"createAllocationValueType");function vJr(e){return e.hitCount+e.children.reduce((t,r)=>t+vJr(r),0)}s(vJr,"computeTotalHitCount");function ZMo(e){let t=[],r;function n(){return r||(r={name:"Node.js",scriptName:"",scriptId:0,lineNumber:0,columnNumber:0,children:[],hitCount:0},t.push(r)),r}s(n,"getRuntimeNode");for(let i of e.topDownRoot.children)if(i.name!=="(program)"&&!(i.name==="(idle)"&&i.contexts?.length===0))if(i.name==="(garbage collector)"){let o={...i,name:Vb.GARBAGE_COLLECTION_FUNCTION_NAME};n().children.push(o)}else t.push(i);if(e.hasCpuTime&&e.nonJSThreadsCpuTime){let i={name:Vb.NON_JS_THREADS_FUNCTION_NAME,scriptName:"",scriptId:0,lineNumber:0,columnNumber:0,children:[],hitCount:0,contexts:[{context:{},timestamp:BigInt(0),cpuTime:e.nonJSThreadsCpuTime,asyncId:-1}]};n().children.push(i)}return{...e,topDownRoot:{...e.topDownRoot,children:t}}}s(ZMo,"updateTimeProfile");function eLo(e,t,r,n=!1,i){if(n){let h=vJr(e.topDownRoot);h>0&&(t=Math.min(Math.max(Math.floor((e.endTime-e.startTime)/h),t),2*t))}let o=t*1e3,a=s((h,g)=>{let b=h.node.hitCount,v=0,S=h.node.name==="(idle)";for(let C of h.node.contexts||[]){let R=i?i({node:h.node,context:C}):C.context??{};if(Object.keys(R).length>0){let N=b>0?[1,S?0:o]:[0,0];e.hasCpuTime&&N.push(C.cpuTime??0);let A=new gh.Sample({locationId:h.stack,value:N,label:$ot(R,c)});g.push(A),b--}else e.hasCpuTime&&(v+=C.cpuTime??0)}if(!S&&b>0||v>0){let C=i?i({node:h.node}):{},R=b>0?[b,S?0:b*o]:[0,0];e.hasCpuTime&&R.push(v);let N=new gh.Sample({locationId:h.stack,value:R,label:$ot(C,c)});g.push(N)}},"appendTimeEntryToSamples"),c=new gh.StringTable,u=KMo(c),l=YMo(c),f=[u,l];if(e.hasCpuTime){let h=QMo(c);f.push(h)}let d={sampleType:f,timeNanos:Date.now()*1e3*1e3,durationNanos:(e.endTime-e.startTime)*1e3,periodType:l,period:o},p=ZMo(e);return EJr(d,p.topDownRoot,a,c,void 0,r),new gh.Profile(d)}s(eLo,"serializeTimeProfile");Vb.serializeTimeProfile=eLo;function $ot(e,t){let r=[];for(let[n,i]of Object.entries(e)){let o={key:t.dedup(n)};switch(typeof i){case"string":o.str=t.dedup(i);break;case"number":case"bigint":o.num=i;break;default:continue}r.push(new gh.Label(o))}return r}s($ot,"buildLabels");function tLo(e,t,r,n,i,o){let a=s((d,p)=>{if(d.node.allocations.length>0){let h=o?$ot(o({node:d.node}),c):[];for(let g of d.node.allocations){let b=new gh.Sample({locationId:d.stack,value:[g.count,g.sizeBytes*g.count],label:h});p.push(b)}}},"appendHeapEntryToSamples"),c=new gh.StringTable,u=XMo(c),l=JMo(c),f={sampleType:[u,l],timeNanos:t,periodType:l,period:r};return EJr(f,e,a,c,n,i),new gh.Profile(f)}s(tLo,"serializeHeapProfile");Vb.serializeHeapProfile=tLo});var TJr=y(hp=>{"use strict";Object.defineProperty(hp,"__esModule",{value:!0});hp.monitorOutOfMemory=hp.CallbackMode=hp.stop=hp.start=hp.convertProfile=hp.profile=hp.v8Profile=void 0;var wEe=pJr(),rLo=Hot(),nLo=require("worker_threads"),D$=!1,SEe=0,SJr=0;function wJr(){if(!D$)throw new Error("Heap profiler is not enabled.");return(0,wEe.getAllocationProfile)()}s(wJr,"v8Profile");hp.v8Profile=wJr;function iLo(e,t,r){return Got(wJr(),e,t,r)}s(iLo,"profile");hp.profile=iLo;function Got(e,t,r,n){let i=Date.now()*1e3*1e3,{external:o}=process.memoryUsage();if(o>0){let a={name:"(external)",scriptName:"",children:[],allocations:[{sizeBytes:o,count:1}]};e.children.push(a)}return(0,rLo.serializeHeapProfile)(e,i,SEe,t,r,n)}s(Got,"convertProfile");hp.convertProfile=Got;function sLo(e,t){if(D$)throw new Error(`Heap profiler is already started with intervalBytes ${SEe} and stackDepth ${t}`);SEe=e,SJr=t,(0,wEe.startSamplingHeapProfiler)(SEe,SJr),D$=!0}s(sLo,"start");hp.start=sLo;function oLo(){D$&&(D$=!1,(0,wEe.stopSamplingHeapProfiler)())}s(oLo,"stop");hp.stop=oLo;hp.CallbackMode={Async:1,Interrupt:2,Both:3};function aLo(e,t,r,n,i,o){if(!D$)throw new Error("Heap profiler must already be started to call monitorOutOfMemory");let a;typeof i<"u"&&(a=s(c=>{i(Got(c))},"newCallback")),(0,wEe.monitorOutOfMemory)(e,t,r,n||[],a,typeof o<"u"?o:hp.CallbackMode.Async,nLo.isMainThread)}s(aLo,"monitorOutOfMemory");hp.monitorOutOfMemory=aLo});var zot=y(M$=>{"use strict";Object.defineProperty(M$,"__esModule",{value:!0});M$.encodeSync=M$.encode=void 0;var cLo=require("util"),AJr=require("zlib"),uLo=(0,cLo.promisify)(AJr.gzip);function lLo(e){return e.encodeAsync().then(uLo)}s(lLo,"encode");M$.encode=lLo;function fLo(e){return(0,AJr.gzipSync)(e.encode())}s(fLo,"encodeSync");M$.encodeSync=fLo});var RJr=y((avl,Wot)=>{"use strict";var dLo=s((e,t)=>Math.floor(Math.random()*(t-e+1)+e),"randomInteger"),xJr=s(()=>{let e=new Error("Delay aborted");return e.name="AbortError",e},"createAbortError"),CJr=s(({clearTimeout:e,setTimeout:t,willResolve:r})=>(n,{value:i,signal:o}={})=>{if(o&&o.aborted)return Promise.reject(xJr());let a,c,u,l=e||clearTimeout,f=s(()=>{l(a),u(xJr())},"signalListener"),d=s(()=>{o&&o.removeEventListener("abort",f)},"cleanup"),p=new Promise((h,g)=>{c=s(()=>{d(),r?h(i):g(i)},"settle"),u=g,a=(t||setTimeout)(c,n)});return o&&o.addEventListener("abort",f,{once:!0}),p.clear=()=>{l(a),a=null,c()},p},"createDelay"),OJr=s(e=>{let t=CJr({...e,willResolve:!0});return t.reject=CJr({...e,willResolve:!1}),t.range=(r,n,i)=>t(dLo(r,n),i),t},"createWithTimers"),Vot=OJr();Vot.createWithTimers=OJr;Wot.exports=Vot;Wot.exports.default=Vot});var IJr=y(d1=>{"use strict";Object.defineProperty(d1,"__esModule",{value:!0});d1.getNativeThreadId=d1.constants=d1.TimeProfiler=void 0;var pLo=require("path"),hLo=Dot(),Kot=hLo((0,pLo.join)(__dirname,"..",".."));d1.TimeProfiler=Kot.TimeProfiler;d1.constants=Kot.constants;d1.getNativeThreadId=Kot.getNativeThreadId});var Zot=y(Gc=>{"use strict";var mLo=Gc&&Gc.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Gc,"__esModule",{value:!0});Gc.getNativeThreadId=Gc.constants=Gc.v8ProfilerStuckEventLoopDetected=Gc.isStarted=Gc.getContext=Gc.setContext=Gc.getState=Gc.stop=Gc.start=Gc.profile=void 0;var gLo=mLo(RJr()),Yot=Hot(),Xot=IJr();Object.defineProperty(Gc,"getNativeThreadId",{enumerable:!0,get:function(){return Xot.getNativeThreadId}});var _Lo=require("worker_threads"),{kSampleCount:yLo}=Xot.constants,bLo=1e3,ELo=6e4,mp,Qot,kJr,dZ=0;process.once("exit",()=>{MJr()&&Jot()});var NJr={durationMillis:ELo,intervalMicros:bLo,lineNumbers:!1,withContexts:!1,workaroundV8Bug:!0,collectCpuTime:!1,collectAsyncId:!1};async function vLo(e={}){return e={...NJr,...e},PJr(e),await(0,gLo.default)(e.durationMillis),Jot()}s(vLo,"profile");Gc.profile=vLo;function PJr(e={}){if(e={...NJr,...e},mp)throw new Error("Wall profiler is already started");mp=new Xot.TimeProfiler({...e,isMainThread:_Lo.isMainThread}),Qot=e.sourceMapper,kJr=e.intervalMicros,dZ=0,mp.start(),e.withContexts&&DJr({})}s(PJr,"start");Gc.start=PJr;function Jot(e=!1,t){if(!mp)throw new Error("Wall profiler is not started");let r=mp.stop(e);e?(dZ=mp.v8ProfilerStuckEventLoopDetected(),dZ>0&&(mp.stop(!1),mp.start())):dZ=0;let n=(0,Yot.serializeTimeProfile)(r,kJr,Qot,!0,t);return e||(mp.dispose(),mp=void 0,Qot=void 0),n}s(Jot,"stop");Gc.stop=Jot;function SLo(){if(!mp)throw new Error("Wall profiler is not started");return mp.state}s(SLo,"getState");Gc.getState=SLo;function DJr(e){if(!mp)throw new Error("Wall profiler is not started");mp.context=e}s(DJr,"setContext");Gc.setContext=DJr;function wLo(){if(!mp)throw new Error("Wall profiler is not started");return mp.context}s(wLo,"getContext");Gc.getContext=wLo;function MJr(){return!!mp}s(MJr,"isStarted");Gc.isStarted=MJr;function TLo(){return dZ}s(TLo,"v8ProfilerStuckEventLoopDetected");Gc.v8ProfilerStuckEventLoopDetected=TLo;Gc.constants={kSampleCount:yLo,GARBAGE_COLLECTION_FUNCTION_NAME:Yot.GARBAGE_COLLECTION_FUNCTION_NAME,NON_JS_THREADS_FUNCTION_NAME:Yot.NON_JS_THREADS_FUNCTION_NAME}});var BJr=y(qJr=>{"use strict";var LJr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");qJr.encode=function(e){if(0<=e&&e<LJr.length)return LJr[e];throw new TypeError("Must be between 0 and 63: "+e)}});var eat=y(jJr=>{"use strict";var ALo=BJr(),UJr=5,FJr=1<<UJr,xLo=FJr-1,CLo=FJr;function OLo(e){return e<0?(-e<<1)+1:(e<<1)+0}s(OLo,"toVLQSigned");jJr.encode=s(function(t){let r="",n,i=OLo(t);do n=i&xLo,i>>>=UJr,i>0&&(n|=CLo),r+=ALo.encode(n);while(i>0);return r},"base64VLQ_encode")});var HJr=y((mvl,$Jr)=>{"use strict";$Jr.exports=typeof URL=="function"?URL:require("url").URL});var mZ=y(Aw=>{"use strict";var h1=HJr();function RLo(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}s(RLo,"getArg");Aw.getArg=RLo;var zJr=function(){return!("__proto__"in Object.create(null))}();function VJr(e){return e}s(VJr,"identity");function ILo(e){return WJr(e)?"$"+e:e}s(ILo,"toSetString");Aw.toSetString=zJr?VJr:ILo;function kLo(e){return WJr(e)?e.slice(1):e}s(kLo,"fromSetString");Aw.fromSetString=zJr?VJr:kLo;function WJr(e){if(!e)return!1;let t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(let r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}s(WJr,"isProtoString");function GJr(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}s(GJr,"strcmp");function NLo(e,t){let r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=GJr(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:GJr(e.name,t.name)}s(NLo,"compareByGeneratedPositionsInflated");Aw.compareByGeneratedPositionsInflated=NLo;function PLo(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}s(PLo,"parseSourceMapInput");Aw.parseSourceMapInput=PLo;var rat="http:",pZ=`${rat}//host`;function nat(e){return t=>{let r=L$(t),n=iat(t),i=new h1(t,n);e(i);let o=i.toString();return r==="absolute"?o:r==="scheme-relative"?o.slice(rat.length):r==="path-absolute"?o.slice(pZ.length):sat(n,o)}}s(nat,"createSafeHandler");function p1(e,t){return new h1(e,t).toString()}s(p1,"withBase");function DLo(e,t){let r=0;do{let n=e+r++;if(t.indexOf(n)===-1)return n}while(!0)}s(DLo,"buildUniqueSegment");function iat(e){let t=e.split("..").length-1,r=DLo("p",e),n=`${pZ}/`;for(let i=0;i<t;i++)n+=`${r}/`;return n}s(iat,"buildSafeBase");var MLo=/^[A-Za-z0-9\+\-\.]+:/;function L$(e){return e[0]==="/"?e[1]==="/"?"scheme-relative":"path-absolute":MLo.test(e)?"absolute":"path-relative"}s(L$,"getURLType");function sat(e,t){typeof e=="string"&&(e=new h1(e)),typeof t=="string"&&(t=new h1(t));let r=t.pathname.split("/"),n=e.pathname.split("/");for(n.length>0&&!n[n.length-1]&&n.pop();r.length>0&&n.length>0&&r[0]===n[0];)r.shift(),n.shift();return n.map(()=>"..").concat(r).join("/")+t.search+t.hash}s(sat,"computeRelativeURL");var LLo=nat(e=>{e.pathname=e.pathname.replace(/\/?$/,"/")}),qLo=nat(e=>{e.href=new h1(".",e.toString()).toString()}),hZ=nat(e=>{});Aw.normalize=hZ;function tat(e,t){let r=L$(t),n=L$(e);if(e=LLo(e),r==="absolute")return p1(t,void 0);if(n==="absolute")return p1(t,e);if(r==="scheme-relative")return hZ(t);if(n==="scheme-relative")return p1(t,p1(e,pZ)).slice(rat.length);if(r==="path-absolute")return hZ(t);if(n==="path-absolute")return p1(t,p1(e,pZ)).slice(pZ.length);let i=iat(t+e),o=p1(t,p1(e,i));return sat(i,o)}s(tat,"join");Aw.join=tat;function BLo(e,t){let r=ULo(e,t);return typeof r=="string"?r:hZ(t)}s(BLo,"relative");Aw.relative=BLo;function ULo(e,t){if(L$(e)!==L$(t))return null;let n=iat(e+t),i=new h1(e,n),o=new h1(t,n);try{new h1("",o.toString())}catch{return null}return o.protocol!==i.protocol||o.user!==i.user||o.password!==i.password||o.hostname!==i.hostname||o.port!==i.port?null:sat(i,o)}s(ULo,"relativeIfPossible");function FLo(e,t,r){e&&L$(t)==="path-absolute"&&(t=t.replace(/^\//,""));let n=hZ(t||"");return e&&(n=tat(e,n)),r&&(n=tat(qLo(r),n)),n}s(FLo,"computeSourceURL");Aw.computeSourceURL=FLo});var aat=y(KJr=>{"use strict";var oat=class e{static{s(this,"ArraySet")}constructor(){this._array=[],this._set=new Map}static fromArray(t,r){let n=new e;for(let i=0,o=t.length;i<o;i++)n.add(t[i],r);return n}size(){return this._set.size}add(t,r){let n=this.has(t),i=this._array.length;(!n||r)&&this._array.push(t),n||this._set.set(t,i)}has(t){return this._set.has(t)}indexOf(t){let r=this._set.get(t);if(r>=0)return r;throw new Error('"'+t+'" is not in the set.')}at(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)}toArray(){return this._array.slice()}};KJr.ArraySet=oat});var XJr=y(QJr=>{"use strict";var YJr=mZ();function jLo(e,t){let r=e.generatedLine,n=t.generatedLine,i=e.generatedColumn,o=t.generatedColumn;return n>r||n==r&&o>=i||YJr.compareByGeneratedPositionsInflated(e,t)<=0}s(jLo,"generatedPositionAfter");var cat=class{static{s(this,"MappingList")}constructor(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}unsortedForEach(t,r){this._array.forEach(t,r)}add(t){jLo(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))}toArray(){return this._sorted||(this._array.sort(YJr.compareByGeneratedPositionsInflated),this._sorted=!0),this._array}};QJr.MappingList=cat});var uat=y(JJr=>{"use strict";var gZ=eat(),Fl=mZ(),TEe=aat().ArraySet,$Lo=XJr().MappingList,AEe=class e{static{s(this,"SourceMapGenerator")}constructor(t){t||(t={}),this._file=Fl.getArg(t,"file",null),this._sourceRoot=Fl.getArg(t,"sourceRoot",null),this._skipValidation=Fl.getArg(t,"skipValidation",!1),this._sources=new TEe,this._names=new TEe,this._mappings=new $Lo,this._sourcesContents=null}static fromSourceMap(t){let r=t.sourceRoot,n=new e({file:t.file,sourceRoot:r});return t.eachMapping(function(i){let o={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(o.source=i.source,r!=null&&(o.source=Fl.relative(r,o.source)),o.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(o.name=i.name)),n.addMapping(o)}),t.sources.forEach(function(i){let o=i;r!=null&&(o=Fl.relative(r,i)),n._sources.has(o)||n._sources.add(o);let a=t.sourceContentFor(i);a!=null&&n.setSourceContent(i,a)}),n}addMapping(t){let r=Fl.getArg(t,"generated"),n=Fl.getArg(t,"original",null),i=Fl.getArg(t,"source",null),o=Fl.getArg(t,"name",null);this._skipValidation||this._validateMapping(r,n,i,o),i!=null&&(i=String(i),this._sources.has(i)||this._sources.add(i)),o!=null&&(o=String(o),this._names.has(o)||this._names.add(o)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n&&n.line,originalColumn:n&&n.column,source:i,name:o})}setSourceContent(t,r){let n=t;this._sourceRoot!=null&&(n=Fl.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[Fl.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[Fl.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))}applySourceMap(t,r,n){let i=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);i=t.file}let o=this._sourceRoot;o!=null&&(i=Fl.relative(o,i));let a=this._mappings.toArray().length>0?new TEe:this._sources,c=new TEe;this._mappings.unsortedForEach(function(u){if(u.source===i&&u.originalLine!=null){let d=t.originalPositionFor({line:u.originalLine,column:u.originalColumn});d.source!=null&&(u.source=d.source,n!=null&&(u.source=Fl.join(n,u.source)),o!=null&&(u.source=Fl.relative(o,u.source)),u.originalLine=d.line,u.originalColumn=d.column,d.name!=null&&(u.name=d.name))}let l=u.source;l!=null&&!a.has(l)&&a.add(l);let f=u.name;f!=null&&!c.has(f)&&c.add(f)},this),this._sources=a,this._names=c,t.sources.forEach(function(u){let l=t.sourceContentFor(u);l!=null&&(n!=null&&(u=Fl.join(n,u)),o!=null&&(u=Fl.relative(o,u)),this.setSourceContent(u,l))},this)}_validateMapping(t,r,n,i){if(r&&typeof r.line!="number"&&typeof r.column!="number")throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!i)){if(!(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n))throw new Error("Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:i}))}}_serializeMappings(){let t=0,r=1,n=0,i=0,o=0,a=0,c="",u,l,f,d,p=this._mappings.toArray();for(let h=0,g=p.length;h<g;h++){if(l=p[h],u="",l.generatedLine!==r)for(t=0;l.generatedLine!==r;)u+=";",r++;else if(h>0){if(!Fl.compareByGeneratedPositionsInflated(l,p[h-1]))continue;u+=","}u+=gZ.encode(l.generatedColumn-t),t=l.generatedColumn,l.source!=null&&(d=this._sources.indexOf(l.source),u+=gZ.encode(d-a),a=d,u+=gZ.encode(l.originalLine-1-i),i=l.originalLine-1,u+=gZ.encode(l.originalColumn-n),n=l.originalColumn,l.name!=null&&(f=this._names.indexOf(l.name),u+=gZ.encode(f-o),o=f)),c+=u}return c}_generateSourcesContent(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=Fl.relative(r,n));let i=Fl.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,i)?this._sourcesContents[i]:null},this)}toJSON(){let t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t}toString(){return JSON.stringify(this.toJSON())}};AEe.prototype._version=3;JJr.SourceMapGenerator=AEe});var ZJr=y(b2=>{"use strict";b2.GREATEST_LOWER_BOUND=1;b2.LEAST_UPPER_BOUND=2;function lat(e,t,r,n,i,o){let a=Math.floor((t-e)/2)+e,c=i(r,n[a],!0);return c===0?a:c>0?t-a>1?lat(a,t,r,n,i,o):o===b2.LEAST_UPPER_BOUND?t<n.length?t:-1:a:a-e>1?lat(e,a,r,n,i,o):o==b2.LEAST_UPPER_BOUND?a:e<0?-1:e}s(lat,"recursiveSearch");b2.search=s(function(t,r,n,i){if(r.length===0)return-1;let o=lat(-1,r.length,t,r,n,i||b2.GREATEST_LOWER_BOUND);if(o<0)return-1;for(;o-1>=0&&n(r[o],r[o-1],!0)===0;)--o;return o},"search")});var dat=y((xvl,fat)=>{"use strict";var HLo=require("fs"),GLo=require("path");fat.exports=s(function(){return new Promise((t,r)=>{let n=GLo.join(__dirname,"mappings.wasm");HLo.readFile(n,null,(i,o)=>{if(i){r(i);return}t(o.buffer)})})},"readWasm");fat.exports.initialize=e=>{console.debug("SourceMapConsumer.initialize is a no-op when running in node.js")}});var tZr=y((Ovl,eZr)=>{"use strict";var zLo=dat();function VLo(){this.generatedLine=0,this.generatedColumn=0,this.lastGeneratedColumn=null,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}s(VLo,"Mapping");var _Z=null;eZr.exports=s(function(){if(_Z)return _Z;let t=[];return _Z=zLo().then(r=>WebAssembly.instantiate(r,{env:{mapping_callback(n,i,o,a,c,u,l,f,d,p){let h=new VLo;h.generatedLine=n+1,h.generatedColumn=i,o&&(h.lastGeneratedColumn=a-1),c&&(h.source=u,h.originalLine=l+1,h.originalColumn=f,d&&(h.name=p)),t[t.length-1](h)},start_all_generated_locations_for(){console.time("all_generated_locations_for")},end_all_generated_locations_for(){console.timeEnd("all_generated_locations_for")},start_compute_column_spans(){console.time("compute_column_spans")},end_compute_column_spans(){console.timeEnd("compute_column_spans")},start_generated_location_for(){console.time("generated_location_for")},end_generated_location_for(){console.timeEnd("generated_location_for")},start_original_location_for(){console.time("original_location_for")},end_original_location_for(){console.timeEnd("original_location_for")},start_parse_mappings(){console.time("parse_mappings")},end_parse_mappings(){console.timeEnd("parse_mappings")},start_sort_by_generated_location(){console.time("sort_by_generated_location")},end_sort_by_generated_location(){console.timeEnd("sort_by_generated_location")},start_sort_by_original_location(){console.time("sort_by_original_location")},end_sort_by_original_location(){console.timeEnd("sort_by_original_location")}}})).then(r=>({exports:r.instance.exports,withMappingCallback:(n,i)=>{t.push(n);try{i()}finally{t.pop()}}})).then(null,r=>{throw _Z=null,r}),_Z},"wasm")});var rZr=y(CEe=>{"use strict";var _s=mZ(),WLo=ZJr(),pat=aat().ArraySet,Ivl=eat(),KLo=dat(),YLo=tZr(),hat=Symbol("smcInternal"),Cf=class e{static{s(this,"SourceMapConsumer")}constructor(t,r){return t==hat?Promise.resolve(this):QLo(t,r)}static initialize(t){KLo.initialize(t["lib/mappings.wasm"])}static fromSourceMap(t,r){return XLo(t,r)}static async with(t,r,n){let i=await new e(t,r);try{return await n(i)}finally{i.destroy()}}eachMapping(t,r,n){throw new Error("Subclasses must implement eachMapping")}allGeneratedPositionsFor(t){throw new Error("Subclasses must implement allGeneratedPositionsFor")}destroy(){throw new Error("Subclasses must implement destroy")}};Cf.prototype._version=3;Cf.GENERATED_ORDER=1;Cf.ORIGINAL_ORDER=2;Cf.GREATEST_LOWER_BOUND=1;Cf.LEAST_UPPER_BOUND=2;CEe.SourceMapConsumer=Cf;var q$=class e extends Cf{static{s(this,"BasicSourceMapConsumer")}constructor(t,r){return super(hat).then(n=>{let i=t;typeof t=="string"&&(i=_s.parseSourceMapInput(t));let o=_s.getArg(i,"version"),a=_s.getArg(i,"sources").map(String),c=_s.getArg(i,"names",[]),u=_s.getArg(i,"sourceRoot",null),l=_s.getArg(i,"sourcesContent",null),f=_s.getArg(i,"mappings"),d=_s.getArg(i,"file",null),p=_s.getArg(i,"x_google_ignoreList",null);if(o!=n._version)throw new Error("Unsupported version: "+o);return n._sourceLookupCache=new Map,n._names=pat.fromArray(c.map(String),!0),n._sources=pat.fromArray(a,!0),n._absoluteSources=pat.fromArray(n._sources.toArray().map(function(h){return _s.computeSourceURL(u,h,r)}),!0),n.sourceRoot=u,n.sourcesContent=l,n._mappings=f,n._sourceMapURL=r,n.file=d,n.x_google_ignoreList=p,n._computedColumnSpans=!1,n._mappingsPtr=0,n._wasm=null,YLo().then(h=>(n._wasm=h,n))})}_findSourceIndex(t){let r=this._sourceLookupCache.get(t);if(typeof r=="number")return r;let n=_s.computeSourceURL(null,t,this._sourceMapURL);if(this._absoluteSources.has(n)){let o=this._absoluteSources.indexOf(n);return this._sourceLookupCache.set(t,o),o}let i=_s.computeSourceURL(this.sourceRoot,t,this._sourceMapURL);if(this._absoluteSources.has(i)){let o=this._absoluteSources.indexOf(i);return this._sourceLookupCache.set(t,o),o}return-1}static fromSourceMap(t,r){return new e(t.toString())}get sources(){return this._absoluteSources.toArray()}_getMappingsPtr(){return this._mappingsPtr===0&&this._parseMappings(),this._mappingsPtr}_parseMappings(){let t=this._mappings,r=t.length,n=this._wasm.exports.allocate_mappings(r)>>>0,i=new Uint8Array(this._wasm.exports.memory.buffer,n,r);for(let a=0;a<r;a++)i[a]=t.charCodeAt(a);let o=this._wasm.exports.parse_mappings(n);if(!o){let a=this._wasm.exports.get_last_error(),c=`Error parsing mappings (code ${a}): `;switch(a){case 1:c+="the mappings contained a negative line, column, source index, or name index";break;case 2:c+="the mappings contained a number larger than 2**32";break;case 3:c+="reached EOF while in the middle of parsing a VLQ";break;case 4:c+="invalid base 64 character while parsing a VLQ";break;default:c+="unknown error code";break}throw new Error(c)}this._mappingsPtr=o}eachMapping(t,r,n){let i=r||null,o=n||Cf.GENERATED_ORDER;this._wasm.withMappingCallback(a=>{a.source!==null&&(a.source=this._absoluteSources.at(a.source),a.name!==null&&(a.name=this._names.at(a.name))),this._computedColumnSpans&&a.lastGeneratedColumn===null&&(a.lastGeneratedColumn=1/0),t.call(i,a)},()=>{switch(o){case Cf.GENERATED_ORDER:this._wasm.exports.by_generated_location(this._getMappingsPtr());break;case Cf.ORIGINAL_ORDER:this._wasm.exports.by_original_location(this._getMappingsPtr());break;default:throw new Error("Unknown order of iteration.")}})}allGeneratedPositionsFor(t){let r=_s.getArg(t,"source"),n=_s.getArg(t,"line"),i=t.column||0;if(r=this._findSourceIndex(r),r<0)return[];if(n<1)throw new Error("Line numbers must be >= 1");if(i<0)throw new Error("Column numbers must be >= 0");let o=[];return this._wasm.withMappingCallback(a=>{let c=a.lastGeneratedColumn;this._computedColumnSpans&&c===null&&(c=1/0),o.push({line:a.generatedLine,column:a.generatedColumn,lastColumn:c})},()=>{this._wasm.exports.all_generated_locations_for(this._getMappingsPtr(),r,n-1,"column"in t,i)}),o}destroy(){this._mappingsPtr!==0&&(this._wasm.exports.free_mappings(this._mappingsPtr),this._mappingsPtr=0)}computeColumnSpans(){this._computedColumnSpans||(this._wasm.exports.compute_column_spans(this._getMappingsPtr()),this._computedColumnSpans=!0)}originalPositionFor(t){let r={generatedLine:_s.getArg(t,"line"),generatedColumn:_s.getArg(t,"column")};if(r.generatedLine<1)throw new Error("Line numbers must be >= 1");if(r.generatedColumn<0)throw new Error("Column numbers must be >= 0");let n=_s.getArg(t,"bias",Cf.GREATEST_LOWER_BOUND);n==null&&(n=Cf.GREATEST_LOWER_BOUND);let i;if(this._wasm.withMappingCallback(o=>i=o,()=>{this._wasm.exports.original_location_for(this._getMappingsPtr(),r.generatedLine-1,r.generatedColumn,n)}),i&&i.generatedLine===r.generatedLine){let o=_s.getArg(i,"source",null);o!==null&&(o=this._absoluteSources.at(o));let a=_s.getArg(i,"name",null);return a!==null&&(a=this._names.at(a)),{source:o,line:_s.getArg(i,"originalLine",null),column:_s.getArg(i,"originalColumn",null),name:a}}return{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return this.sourcesContent?this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(t){return t==null}):!1}sourceContentFor(t,r){if(!this.sourcesContent)return null;let n=this._findSourceIndex(t);if(n>=0)return this.sourcesContent[n];if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')}generatedPositionFor(t){let r=_s.getArg(t,"source");if(r=this._findSourceIndex(r),r<0)return{line:null,column:null,lastColumn:null};let n={source:r,originalLine:_s.getArg(t,"line"),originalColumn:_s.getArg(t,"column")};if(n.originalLine<1)throw new Error("Line numbers must be >= 1");if(n.originalColumn<0)throw new Error("Column numbers must be >= 0");let i=_s.getArg(t,"bias",Cf.GREATEST_LOWER_BOUND);i==null&&(i=Cf.GREATEST_LOWER_BOUND);let o;if(this._wasm.withMappingCallback(a=>o=a,()=>{this._wasm.exports.generated_location_for(this._getMappingsPtr(),n.source,n.originalLine-1,n.originalColumn,i)}),o&&o.source===n.source){let a=o.lastGeneratedColumn;return this._computedColumnSpans&&a===null&&(a=1/0),{line:_s.getArg(o,"generatedLine",null),column:_s.getArg(o,"generatedColumn",null),lastColumn:a}}return{line:null,column:null,lastColumn:null}}};q$.prototype.consumer=Cf;CEe.BasicSourceMapConsumer=q$;var xEe=class extends Cf{static{s(this,"IndexedSourceMapConsumer")}constructor(t,r){return super(hat).then(n=>{let i=t;typeof t=="string"&&(i=_s.parseSourceMapInput(t));let o=_s.getArg(i,"version"),a=_s.getArg(i,"sections");if(o!=n._version)throw new Error("Unsupported version: "+o);let c={line:-1,column:0};return Promise.all(a.map(u=>{if(u.url)throw new Error("Support for url field in sections not implemented.");let l=_s.getArg(u,"offset"),f=_s.getArg(l,"line"),d=_s.getArg(l,"column");if(f<c.line||f===c.line&&d<c.column)throw new Error("Section offsets must be ordered and non-overlapping.");return c=l,new Cf(_s.getArg(u,"map"),r).then(h=>({generatedOffset:{generatedLine:f+1,generatedColumn:d+1},consumer:h}))})).then(u=>(n._sections=u,n))})}get sources(){let t=[];for(let r=0;r<this._sections.length;r++)for(let n=0;n<this._sections[r].consumer.sources.length;n++)t.push(this._sections[r].consumer.sources[n]);return t}originalPositionFor(t){let r={generatedLine:_s.getArg(t,"line"),generatedColumn:_s.getArg(t,"column")},n=WLo.search(r,this._sections,function(o,a){let c=o.generatedLine-a.generatedOffset.generatedLine;return c||o.generatedColumn-(a.generatedOffset.generatedColumn-1)}),i=this._sections[n];return i?i.consumer.originalPositionFor({line:r.generatedLine-(i.generatedOffset.generatedLine-1),column:r.generatedColumn-(i.generatedOffset.generatedLine===r.generatedLine?i.generatedOffset.generatedColumn-1:0),bias:t.bias}):{source:null,line:null,column:null,name:null}}hasContentsOfAllSources(){return this._sections.every(function(t){return t.consumer.hasContentsOfAllSources()})}sourceContentFor(t,r){for(let n=0;n<this._sections.length;n++){let o=this._sections[n].consumer.sourceContentFor(t,!0);if(o)return o}if(r)return null;throw new Error('"'+t+'" is not in the SourceMap.')}_findSectionIndex(t){for(let r=0;r<this._sections.length;r++){let{consumer:n}=this._sections[r];if(n._findSourceIndex(t)!==-1)return r}return-1}generatedPositionFor(t){let r=this._findSectionIndex(_s.getArg(t,"source")),n=r>=0?this._sections[r]:null,i=r>=0&&r+1<this._sections.length?this._sections[r+1]:null,o=n&&n.consumer.generatedPositionFor(t);if(o&&o.line!==null){let a=n.generatedOffset.generatedLine-1,c=n.generatedOffset.generatedColumn-1;return o.line===1&&(o.column+=c,typeof o.lastColumn=="number"&&(o.lastColumn+=c)),o.lastColumn===1/0&&i&&o.line===i.generatedOffset.generatedLine&&(o.lastColumn=i.generatedOffset.generatedColumn-2),o.line+=a,o}return{line:null,column:null,lastColumn:null}}allGeneratedPositionsFor(t){let r=this._findSectionIndex(_s.getArg(t,"source")),n=r>=0?this._sections[r]:null,i=r>=0&&r+1<this._sections.length?this._sections[r+1]:null;return n?n.consumer.allGeneratedPositionsFor(t).map(o=>{let a=n.generatedOffset.generatedLine-1,c=n.generatedOffset.generatedColumn-1;return o.line===1&&(o.column+=c,typeof o.lastColumn=="number"&&(o.lastColumn+=c)),o.lastColumn===1/0&&i&&o.line===i.generatedOffset.generatedLine&&(o.lastColumn=i.generatedOffset.generatedColumn-2),o.line+=a,o}):[]}eachMapping(t,r,n){this._sections.forEach((i,o)=>{let a=o+1<this._sections.length?this._sections[o+1]:null,{generatedOffset:c}=i,u=c.generatedLine-1,l=c.generatedColumn-1;i.consumer.eachMapping(function(f){f.generatedLine===1&&(f.generatedColumn+=l,typeof f.lastGeneratedColumn=="number"&&(f.lastGeneratedColumn+=l)),f.lastGeneratedColumn===1/0&&a&&f.generatedLine===a.generatedOffset.generatedLine&&(f.lastGeneratedColumn=a.generatedOffset.generatedColumn-2),f.generatedLine+=u,t.call(this,f)},r,n)})}computeColumnSpans(){for(let t=0;t<this._sections.length;t++)this._sections[t].consumer.computeColumnSpans()}destroy(){for(let t=0;t<this._sections.length;t++)this._sections[t].consumer.destroy()}};CEe.IndexedSourceMapConsumer=xEe;function QLo(e,t){let r=e;typeof e=="string"&&(r=_s.parseSourceMapInput(e));let n=r.sections!=null?new xEe(r,t):new q$(r,t);return Promise.resolve(n)}s(QLo,"_factory");function XLo(e,t){return q$.fromSourceMap(e,t)}s(XLo,"_factoryBSM")});var iZr=y(nZr=>{"use strict";var JLo=uat().SourceMapGenerator,OEe=mZ(),ZLo=/(\r?\n)/,e2o=10,B$="$$$isSourceNode$$$",mat=class e{static{s(this,"SourceNode")}constructor(t,r,n,i,o){this.children=[],this.sourceContents={},this.line=t??null,this.column=r??null,this.source=n??null,this.name=o??null,this[B$]=!0,i!=null&&this.add(i)}static fromStringWithSourceMap(t,r,n){let i=new e,o=t.split(ZLo),a=0,c=s(function(){let h=b(),g=b()||"";return h+g;function b(){return a<o.length?o[a++]:void 0}},"shiftNextLine"),u=1,l=0,f=null,d;return r.eachMapping(function(h){if(f!==null)if(u<h.generatedLine)p(f,c()),u++,l=0;else{d=o[a]||"";let g=d.substr(0,h.generatedColumn-l);o[a]=d.substr(h.generatedColumn-l),l=h.generatedColumn,p(f,g),f=h;return}for(;u<h.generatedLine;)i.add(c()),u++;l<h.generatedColumn&&(d=o[a]||"",i.add(d.substr(0,h.generatedColumn)),o[a]=d.substr(h.generatedColumn),l=h.generatedColumn),f=h},this),a<o.length&&(f&&p(f,c()),i.add(o.splice(a).join(""))),r.sources.forEach(function(h){let g=r.sourceContentFor(h);g!=null&&(n!=null&&(h=OEe.join(n,h)),i.setSourceContent(h,g))}),i;function p(h,g){if(h===null||h.source===void 0)i.add(g);else{let b=n?OEe.join(n,h.source):h.source;i.add(new e(h.originalLine,h.originalColumn,b,g,h.name))}}s(p,"addMappingWithCode")}add(t){if(Array.isArray(t))t.forEach(function(r){this.add(r)},this);else if(t[B$]||typeof t=="string")t&&this.children.push(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this}prepend(t){if(Array.isArray(t))for(let r=t.length-1;r>=0;r--)this.prepend(t[r]);else if(t[B$]||typeof t=="string")this.children.unshift(t);else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got "+t);return this}walk(t){let r;for(let n=0,i=this.children.length;n<i;n++)r=this.children[n],r[B$]?r.walk(t):r!==""&&t(r,{source:this.source,line:this.line,column:this.column,name:this.name})}join(t){let r,n,i=this.children.length;if(i>0){for(r=[],n=0;n<i-1;n++)r.push(this.children[n]),r.push(t);r.push(this.children[n]),this.children=r}return this}replaceRight(t,r){let n=this.children[this.children.length-1];return n[B$]?n.replaceRight(t,r):typeof n=="string"?this.children[this.children.length-1]=n.replace(t,r):this.children.push("".replace(t,r)),this}setSourceContent(t,r){this.sourceContents[OEe.toSetString(t)]=r}walkSourceContents(t){for(let n=0,i=this.children.length;n<i;n++)this.children[n][B$]&&this.children[n].walkSourceContents(t);let r=Object.keys(this.sourceContents);for(let n=0,i=r.length;n<i;n++)t(OEe.fromSetString(r[n]),this.sourceContents[r[n]])}toString(){let t="";return this.walk(function(r){t+=r}),t}toStringWithSourceMap(t){let r={code:"",line:1,column:0},n=new JLo(t),i=!1,o=null,a=null,c=null,u=null;return this.walk(function(l,f){r.code+=l,f.source!==null&&f.line!==null&&f.column!==null?((o!==f.source||a!==f.line||c!==f.column||u!==f.name)&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name}),o=f.source,a=f.line,c=f.column,u=f.name,i=!0):i&&(n.addMapping({generated:{line:r.line,column:r.column}}),o=null,i=!1);for(let d=0,p=l.length;d<p;d++)l.charCodeAt(d)===e2o?(r.line++,r.column=0,d+1===p?(o=null,i=!1):i&&n.addMapping({source:f.source,original:{line:f.line,column:f.column},generated:{line:r.line,column:r.column},name:f.name})):r.column++}),this.walkSourceContents(function(l,f){n.setSourceContent(l,f)}),{code:r.code,map:n}}};nZr.SourceNode=mat});var sZr=y(REe=>{"use strict";REe.SourceMapGenerator=uat().SourceMapGenerator;REe.SourceMapConsumer=rZr().SourceMapConsumer;REe.SourceNode=iZr().SourceNode});var gat=y(bC=>{"use strict";Object.defineProperty(bC,"__esModule",{value:!0});bC.setLogger=bC.logger=bC.NullLogger=void 0;var IEe=class{static{s(this,"NullLogger")}info(...t){}error(...t){}trace(...t){}warn(...t){}fatal(...t){}debug(...t){}};bC.NullLogger=IEe;bC.logger=new IEe;function t2o(e){bC.logger=e}s(t2o,"setLogger");bC.setLogger=t2o});var aZr=y((Bvl,oZr)=>{"use strict";var _at=class{static{s(this,"Node")}constructor(t){this.value=t,this.next=void 0}},yat=class{static{s(this,"Queue")}constructor(){this.clear()}enqueue(t){let r=new _at(t);this._head?(this._tail.next=r,this._tail=r):(this._head=r,this._tail=r),this._size++}dequeue(){let t=this._head;if(t)return this._head=this._head.next,this._size--,t.value}clear(){this._head=void 0,this._tail=void 0,this._size=0}get size(){return this._size}*[Symbol.iterator](){let t=this._head;for(;t;)yield t.value,t=t.next}};oZr.exports=yat});var uZr=y((Fvl,cZr)=>{"use strict";var r2o=aZr(),n2o=s(e=>{if(!((Number.isInteger(e)||e===1/0)&&e>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up");let t=new r2o,r=0,n=s(()=>{r--,t.size>0&&t.dequeue()()},"next"),i=s(async(c,u,...l)=>{r++;let f=(async()=>c(...l))();u(f);try{await f}catch{}n()},"run"),o=s((c,u,...l)=>{t.enqueue(i.bind(null,c,u,...l)),(async()=>(await Promise.resolve(),r<e&&t.size>0&&t.dequeue()()))()},"enqueue"),a=s((c,...u)=>new Promise(l=>{o(c,l,...u)}),"generator");return Object.defineProperties(a,{activeCount:{get:()=>r},pendingCount:{get:()=>t.size},clearQueue:{value:()=>{t.clear()}}}),a},"pLimit");cZr.exports=n2o});var fZr=y(Wb=>{"use strict";var i2o=Wb&&Wb.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),s2o=Wb&&Wb.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),bat=Wb&&Wb.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&i2o(t,e,r);return s2o(t,e),t},o2o=Wb&&Wb.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wb,"__esModule",{value:!0});Wb.SourceMapper=void 0;var U$=bat(require("fs")),u0=bat(require("path")),a2o=bat(sZr()),xw=gat(),c2o=o2o(uZr()),u2o=U$.promises.readFile,l2o=10,lZr=".map";function yZ(e){return xw.logger.debug(`Error: ${e}`),new Error(e)}s(yZ,"error");async function f2o(e,t,r){if(!t||!t.endsWith(lZr))throw yZ(`The path "${t}" does not specify a source map file`);t=u0.normalize(t);let n;try{n=await u2o(t,"utf8")}catch(u){throw yZ("Could not read source map file "+t+": "+u)}let i;try{i=await new a2o.SourceMapConsumer(n)}catch(u){throw yZ("An error occurred while reading the sourceMap file "+t+": "+u)}let o=u0.dirname(t),a=[];i.file&&a.push(u0.resolve(o,i.file));let c=u0.resolve(o,u0.basename(t,lZr));(a.length===0||a[0]!==c)&&a.push(c);for(let u of a)try{await U$.promises.access(u,U$.constants.F_OK),e.set(u,{mapFileDir:o,mapConsumer:i}),r&&xw.logger.debug(`Loaded source map for ${u} => ${t}`);return}catch{r&&xw.logger.debug(`Generated path ${u} does not exist`)}r&&xw.logger.debug(`Unable to find generated file for ${t}`)}s(f2o,"processSourceMap");var kEe=class{static{s(this,"SourceMapper")}static async create(t,r=!1){r&&xw.logger.debug(`Looking for source map files in dirs: [${t.join(", ")}]`);let n=[];for(let i of t)try{(await g2o(i)).forEach(a=>{n.push(u0.resolve(i,a))})}catch(o){throw yZ(`failed to get source maps from ${i}: ${o}`)}return r&&xw.logger.debug(`Found source map files: [${n.join(", ")}]`),d2o(n,r)}constructor(t=!1){this.infoMap=new Map,this.debug=t}getMappingInfo(t){return this.infoMap.has(u0.normalize(t))?this.infoMap.get(t):null}hasMappingInfo(t){return this.getMappingInfo(t)!==null}mappingInfo(t){let r=u0.normalize(t.file),n=this.getMappingInfo(r);if(n===null)return this.debug&&xw.logger.debug(`Source map lookup failed: no map found for ${t.file} (normalized: ${r})`),t;let i={line:t.line,column:t.column>0?t.column-1:0},a=n.mapConsumer.originalPositionFor(i);if(a.source===null)return this.debug&&xw.logger.debug(`Source map lookup failed for ${t.name}(${t.file}:${t.line}:${t.column})`),t;let c={file:u0.resolve(n.mapFileDir,a.source),line:a.line||void 0,name:a.name||t.name,column:a.column===null?void 0:a.column+1};return this.debug&&xw.logger.debug(`Source map lookup succeeded for ${t.name}(${t.file}:${t.line}:${t.column}) => ${c.name}(${c.file}:${c.line}:${c.column})`),c}};Wb.SourceMapper=kEe;async function d2o(e,t){let r=(0,c2o.default)(l2o),n=new kEe(t),i=e.map(o=>r(()=>f2o(n.infoMap,o,t)));try{await Promise.all(i)}catch(o){throw yZ("An error occurred while processing the source map files"+o)}return n}s(d2o,"createFromMapFiles");function p2o(e){return e instanceof Error&&"code"in e}s(p2o,"isErrnoException");function h2o(e){let t=["ENOENT","EPERM","EACCES","ELOOP"];return p2o(e)&&e.code&&t.includes(e.code)}s(h2o,"isNonFatalError");async function*m2o(e,t=n=>!0,r=(n,i)=>!0){async function*n(i){try{for await(let o of await U$.promises.opendir(i)){let a=u0.join(i,o.name);o.isDirectory()&&r(i,o.name)?yield*n(a):o.isFile()&&t(o.name)&&(await U$.promises.access(a,U$.constants.R_OK),yield a)}}catch(o){if(h2o(o))xw.logger.debug(()=>`Non fatal error: ${o}`);else throw o}}s(n,"walkRecursive"),yield*n(e)}s(m2o,"walk");async function g2o(e){let t=[];for await(let r of m2o(e,n=>/\.[cm]?js\.map$/.test(n),(n,i)=>n!=="/proc"&&i!==".git"&&i!=="node_modules"))t.push(u0.relative(e,r));return t}s(g2o,"getMapFiles")});var bZ=y((zc,Eat)=>{"use strict";var _2o=zc&&zc.__createBinding||(Object.create?function(e,t,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){n===void 0&&(n=r),e[n]=t[r]}),y2o=zc&&zc.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),dZr=zc&&zc.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(e!=null)for(var r in e)r!=="default"&&Object.prototype.hasOwnProperty.call(e,r)&&_2o(t,e,r);return y2o(t,e),t};Object.defineProperty(zc,"__esModule",{value:!0});zc.heap=zc.time=zc.getNativeThreadId=zc.setLogger=zc.SourceMapper=zc.encodeSync=zc.encode=void 0;var b2o=require("fs"),E2=dZr(TJr()),E2o=zot(),EC=dZr(Zot()),pZr=zot();Object.defineProperty(zc,"encode",{enumerable:!0,get:function(){return pZr.encode}});Object.defineProperty(zc,"encodeSync",{enumerable:!0,get:function(){return pZr.encodeSync}});var v2o=fZr();Object.defineProperty(zc,"SourceMapper",{enumerable:!0,get:function(){return v2o.SourceMapper}});var S2o=gat();Object.defineProperty(zc,"setLogger",{enumerable:!0,get:function(){return S2o.setLogger}});var w2o=Zot();Object.defineProperty(zc,"getNativeThreadId",{enumerable:!0,get:function(){return w2o.getNativeThreadId}});zc.time={profile:EC.profile,start:EC.start,stop:EC.stop,getContext:EC.getContext,setContext:EC.setContext,isStarted:EC.isStarted,v8ProfilerStuckEventLoopDetected:EC.v8ProfilerStuckEventLoopDetected,getState:EC.getState,constants:EC.constants};zc.heap={start:E2.start,stop:E2.stop,profile:E2.profile,convertProfile:E2.convertProfile,v8Profile:E2.v8Profile,monitorOutOfMemory:E2.monitorOutOfMemory,CallbackMode:E2.CallbackMode};Eat.parent&&Eat.parent.id==="internal/preload"&&(zc.time.start({}),process.on("exit",()=>{let e=zc.time.stop(),t=(0,E2o.encodeSync)(e);(0,b2o.writeFileSync)(`pprof-profile-${process.pid}.pb.gz`,t)}))});var EZ=y((Gvl,_Zr)=>{"use strict";var{isMainThread:T2o,threadId:hZr}=require("worker_threads"),A2o="end_timestamp_ns",vat="thread name",Sat="os thread id",wat="thread id",x2o="span id",C2o="local root span id",mZr=T2o?"Main":`Worker #${hZr}`,gZr=`${mZr} Event Loop`;function O2o(){let t=bZ().getNativeThreadId();return{[vat]:gZr,[wat]:`${hZr}`,[Sat]:`${t}`}}s(O2o,"getThreadLabels");function R2o(){let e;return()=>(e||(e=O2o()),e)}s(R2o,"cacheThreadLabels");function I2o(){return{[vat]:"Non-JS threads",[wat]:"NA",[Sat]:"NA"}}s(I2o,"getNonJSThreadsLabels");function k2o(e){return e.encodeAsync().then(Buffer.from)}s(k2o,"encodeProfileAsync");_Zr.exports={END_TIMESTAMP_LABEL:A2o,THREAD_NAME_LABEL:vat,THREAD_ID_LABEL:wat,OS_THREAD_ID_LABEL:Sat,SPAN_ID_LABEL:x2o,LOCAL_ROOT_SPAN_ID_LABEL:C2o,threadNamePrefix:mZr,eventLoopThreadName:gZr,getNonJSThreadsLabels:I2o,getThreadLabels:R2o(),encodeProfileAsync:k2o}});var Tat=y((Vvl,yZr)=>{"use strict";var{HTTP_METHOD:N2o,HTTP_ROUTE:P2o,RESOURCE_NAME:D2o,SPAN_TYPE:M2o}=cu(),{WEB:L2o}=hQ();function q2o(e){return e[M2o]===L2o}s(q2o,"isWebServerSpan");function B2o(e){return e[D2o]||[e[N2o],e[P2o]].filter(Boolean).join(" ")}s(B2o,"endpointNameFromTags");function U2o(e){return e._trace.started}s(U2o,"getStartedSpans");yZr.exports={isWebServerSpan:q2o,endpointNameFromTags:B2o,getStartedSpans:U2o}});var Oat=y((Kvl,TZr)=>{"use strict";var{storage:F2o}=Fr(),Cat=hi(),j2o=I4(),$2o=ch(),{END_TIMESTAMP_LABEL:H2o,SPAN_ID_LABEL:G2o,LOCAL_ROOT_SPAN_ID_LABEL:z2o,getNonJSThreadsLabels:V2o,getThreadLabels:bZr,encodeProfileAsync:W2o}=EZ(),{isWebServerSpan:K2o,endpointNameFromTags:EZr,getStartedSpans:Y2o}=Tat(),Aat=Cat.channel("dd-trace:storage:before"),vZ=Cat.channel("dd-trace:storage:enter"),vZr=Cat.channel("dd-trace:span:finish"),Q2o=$2o.manager.namespace("profilers"),NEe=Symbol("NativeWallProfiler.ProfilingContext"),SZr;function X2o(){let e=F2o("legacy").getStore();return e&&e.span}s(X2o,"getActiveSpan");var wZr=!1;function J2o(){if(wZr)return;let{AsyncLocalStorage:e,createHook:t}=require("async_hooks"),r=zt();t({before:()=>Aat.publish()}).enable();let n=!1;r.wrap(e.prototype,"enterWith",function(i){return function(...o){let a=i.apply(this,o);return n||vZ.publish(),a}}),r.wrap(e.prototype,"run",function(i){return function(o,a,...c){let u=r.wrapFunction(a,f=>function(...d){n=!1,vZ.publish();let p=f.apply(this,d);return n=!0,p});n=!0;let l=i.call(this,o,u,...c);return vZ.publish(),n=!1,l}}),wZr=!0}s(J2o,"ensureChannelsActivated");var xat=class{static{s(this,"NativeWallProfiler")}constructor(t={}){this.type="wall",this._samplingIntervalMicros=t.samplingInterval||1e6/99,this._flushIntervalMillis=t.flushInterval||60*1e3,this._codeHotspotsEnabled=!!t.codeHotspotsEnabled,this._endpointCollectionEnabled=!!t.endpointCollectionEnabled,this._timelineEnabled=!!t.timelineEnabled,this._cpuProfilingEnabled=!!t.cpuProfilingEnabled,this._captureSpanData=this._codeHotspotsEnabled||this._endpointCollectionEnabled,this._withContexts=this._captureSpanData||this._timelineEnabled||this._cpuProfilingEnabled,this._v8ProfilerBugWorkaroundEnabled=!!t.v8ProfilerBugWorkaroundEnabled,this._mapper=void 0,this._pprof=void 0,this._withContexts&&this._captureSpanData&&(this._enter=this._enter.bind(this),this._spanFinished=this._spanFinished.bind(this)),this._generateLabels=this._generateLabels.bind(this),this._logger=t.logger,this._started=!1}codeHotspotsEnabled(){return this._codeHotspotsEnabled}endpointCollectionEnabled(){return this._endpointCollectionEnabled}start({mapper:t}={}){this._started||(this._mapper=t,this._pprof=bZ(),SZr=this._pprof.time.constants.kSampleCount,process._startProfilerIdleNotifier||(process._startProfilerIdleNotifier=()=>{}),process._stopProfilerIdleNotifier||(process._stopProfilerIdleNotifier=()=>{}),this._pprof.time.start({intervalMicros:this._samplingIntervalMicros,durationMillis:this._flushIntervalMillis,sourceMapper:this._mapper,withContexts:this._withContexts,lineNumbers:!1,workaroundV8Bug:this._v8ProfilerBugWorkaroundEnabled,collectCpuTime:this._cpuProfilingEnabled}),this._withContexts&&(this._setNewContext(),this._captureSpanData&&(this._profilerState=this._pprof.time.getState(),this._lastSampleCount=0,J2o(),Aat.subscribe(this._enter),vZ.subscribe(this._enter),vZr.subscribe(this._spanFinished))),this._started=!0)}_enter(){if(!this._started)return;let t=this._profilerState[SZr];if(t!==this._lastSampleCount){this._lastSampleCount=t;let n=this._currentContext.ref;this._setNewContext(),this._updateContext(n)}let r=X2o();this._currentContext.ref=r?this._getProfilingContext(r):{}}_getProfilingContext(t){let r=t[NEe];if(r===void 0){let n=t.context(),i=Y2o(n),o,a;this._codeHotspotsEnabled&&(o=n._spanId,a=i.length?i[0].context()._spanId:n._spanId);let c;if(this._endpointCollectionEnabled){let u=n._tags;if(K2o(u))c=u;else{let l=n._parentId;for(let f=i.length;--f>=0;){let d=i[f];if(d.context()._spanId===l){c=this._getProfilingContext(d).webTags;break}}}}r={spanId:o,rootSpanId:a,webTags:c},t[NEe]=r}return r}_setNewContext(){this._pprof.time.setContext(this._currentContext={ref:{}})}_updateContext(t){typeof t.spanId=="object"&&(t.spanId=t.spanId.toString(10)),typeof t.rootSpanId=="object"&&(t.rootSpanId=t.rootSpanId.toString(10)),t.webTags!==void 0&&t.endpoint===void 0&&(t.endpoint=EZr(t.webTags))}_spanFinished(t){t[NEe]!==void 0&&(t[NEe]=void 0)}_reportV8bug(t){let r=`v8_profiler_bug_workaround_enabled:${this._v8ProfilerBugWorkaroundEnabled}`,n=`v8_cpu_profiler${t?"_maybe":""}_stuck_event_loop`;this._logger?.warn(`Wall profiler: ${t?"possible ":""}v8 profiler stuck event loop detected.`),j2o.increment(`runtime.node.profiler.${n}`,r,!0),Q2o.count(n,[r]).inc()}_stop(t){if(!this._started)return;this._captureSpanData&&(this._enter(),this._lastSampleCount=0);let r=this._pprof.time.stop(t,this._generateLabels);if(t){let n=this._pprof.time.v8ProfilerStuckEventLoopDetected();n!==0&&this._reportV8bug(n===1)}else this._captureSpanData&&(Aat.unsubscribe(this._enter),vZ.unsubscribe(this._enter),vZr.unsubscribe(this._spanFinished),this._profilerState=void 0),this._started=!1;return r}_generateLabels({node:t,context:r}){if(t.name===this._pprof.time.constants.NON_JS_THREADS_FUNCTION_NAME)return V2o();if(r==null)return bZr();let n={...bZr()};this._timelineEnabled&&(n[H2o]=r.timestamp*1000n);let i=r.asyncId;i!==void 0&&i!==-1&&(n["async id"]=i);let o=r.context?.ref;if(typeof o!="object")return n;let{spanId:a,rootSpanId:c,webTags:u,endpoint:l}=o;return a!==void 0&&(n[G2o]=a),c!==void 0&&(n[z2o]=c),u!==void 0&&Object.keys(u).length!==0?n["trace endpoint"]=EZr(u):l&&(n["trace endpoint"]=l),n}profile(t){return this._stop(t)}encode(t){return W2o(t)}stop(){this._stop(!1)}isStarted(){return this._started}};TZr.exports=xat});var PEe=y((Qvl,AZr)=>{"use strict";var Z2o=Object.freeze({PERIODIC:"periodic",ON_SHUTDOWN:"on_shutdown",ON_OUT_OF_MEMORY:"on_oom"}),eqo=Object.freeze({PROCESS:"process",ASYNC_CALLBACK:"async",LOGS:"logs"});AZr.exports={snapshotKinds:Z2o,oomExportStrategies:eqo}});var kat=y((Xvl,xZr)=>{"use strict";var{oomExportStrategies:Rat}=PEe(),{encodeProfileAsync:tqo,getThreadLabels:rqo}=EZ();function nqo(e,t){return e.includes(Rat.ASYNC_CALLBACK)?t.Async:0}s(nqo,"strategiesToCallbackMode");var Iat=class{static{s(this,"NativeSpaceProfiler")}constructor(t={}){this.type="space",this._samplingInterval=t.heapSamplingInterval||512*1024,this._stackDepth=t.stackDepth||64,this._pprof=void 0,this._oomMonitoring=t.oomMonitoring||{},this._started=!1}start({mapper:t,nearOOMCallback:r}={}){if(!this._started){if(this._mapper=t,this._pprof=bZ(),this._pprof.heap.start(this._samplingInterval,this._stackDepth),this._oomMonitoring.enabled){let n=this._oomMonitoring.exportStrategies;this._pprof.heap.monitorOutOfMemory(this._oomMonitoring.heapLimitExtensionSize,this._oomMonitoring.maxHeapExtensionCount,n.includes(Rat.LOGS),n.includes(Rat.PROCESS)?this._oomMonitoring.exportCommand:[],i=>r(this.type,this._pprof.encodeSync(i)),nqo(n,this._pprof.heap.CallbackMode))}this._started=!0}}profile(t){let r=this._pprof.heap.profile(void 0,this._mapper,rqo);return t||this.stop(),r}encode(t){return tqo(t)}stop(){this._started&&(this._pprof.heap.stop(),this._started=!1)}isStarted(){return this._started}};xZr.exports=Iat});var DEe=y((Zvl,OZr)=>{"use strict";var iqo=Am(),{performance:CZr}=require("perf_hooks"),Nat=class extends iqo{static{s(this,"EventPlugin")}constructor(t,r){super(),this.eventHandler=t,this.eventFilter=r,this.contextData=new WeakMap,this.entryType=this.constructor.entryType}start(t){this.contextData.set(t,{startEvent:t,startTime:CZr.now()})}error(t){let r=this.contextData.get(t);r&&(r.error=!0)}finish(t){let r=this.contextData.get(t);if(!r)return;let{startEvent:n,startTime:i,error:o}=r;if(o||this.ignoreEvent(n))return;let a=CZr.now()-i,c={entryType:this.entryType,startTime:i,duration:a};if(!this.eventFilter(c))return;let u=(t.currentStore?.span||this.activeSpan)?.context();c._ddSpanId=u?.toSpanId(),c._ddRootSpanId=u?._trace.started[0]?.context().toSpanId()||c._ddSpanId,this.eventHandler(this.extendEvent(c,n))}ignoreEvent(){return!1}};OZr.exports=Nat});var SZ=y((t0l,RZr)=>{"use strict";var sqo=DEe(),Pat=class extends sqo{static{s(this,"DNSPlugin")}static get id(){return"dns"}static get entryType(){return"dns"}};RZr.exports=Pat});var kZr=y((n0l,IZr)=>{"use strict";var oqo=SZ(),Dat=class extends oqo{static{s(this,"DNSLookupPlugin")}static get operation(){return"lookup"}extendEvent(t,r){return t.name="lookup",t.detail={hostname:r.args[0]},t}};IZr.exports=Dat});var PZr=y((s0l,NZr)=>{"use strict";var aqo=SZ(),Mat=class extends aqo{static{s(this,"DNSLookupServicePlugin")}static get operation(){return"lookup_service"}extendEvent(t,r){return t.name="lookupService",t.detail={host:r.args[0],port:r.args[1]},t}};NZr.exports=Mat});var LZr=y((a0l,MZr)=>{"use strict";var cqo=SZ(),DZr=new Map,Lat=class extends cqo{static{s(this,"DNSResolvePlugin")}static get operation(){return"resolve"}extendEvent(t,r){let n=r.args[1],i=DZr.get(n);return i||(i=`query${n}`,DZr.set(n,i)),t.name=i,t.detail={host:r.args[0]},t}};MZr.exports=Lat});var BZr=y((u0l,qZr)=>{"use strict";var uqo=SZ(),qat=class extends uqo{static{s(this,"DNSReversePlugin")}static get operation(){return"reverse"}extendEvent(t,r){return t.name="getHostByAddr",t.detail={host:r.args[0]},t}};qZr.exports=qat});var FZr=y((f0l,UZr)=>{"use strict";var lqo=DEe(),fqo=new Set(["atime","dest","existingPath","fd","file","flag","gid","len","length","mode","mtime","newPath","offset","oldPath","operation","options","path","position","prefix","src","target","type","uid"]),Bat=class extends lqo{static{s(this,"FilesystemPlugin")}static get id(){return"fs"}static get operation(){return"operation"}static get entryType(){return"fs"}ignoreEvent(t){return t.operation?.endsWith("Sync")}extendEvent(t,r){let n={...r};return Object.entries(n).forEach(([i,o])=>{fqo.has(i)&&(typeof o=="string"||typeof o=="number")||delete n[i]}),t.detail=n,t}};UZr.exports=Bat});var $Zr=y((p0l,jZr)=>{"use strict";var dqo=DEe(),Uat=class extends dqo{static{s(this,"NetPlugin")}static get id(){return"net"}static get operation(){return"tcp"}static get entryType(){return"net"}extendEvent(t,{options:r}){return t.name="connect",t.detail=r,t}};jZr.exports=Uat});var WZr=y((m0l,VZr)=>{"use strict";var{performance:HZr,constants:pqo,PerformanceObserver:hqo}=require("perf_hooks"),{END_TIMESTAMP_LABEL:mqo,SPAN_ID_LABEL:gqo,LOCAL_ROOT_SPAN_ID_LABEL:_qo,encodeProfileAsync:yqo}=EZ(),{Function:bqo,Label:TZ,Line:Eqo,Location:vqo,Profile:Sqo,Sample:wqo,StringTable:Tqo,ValueType:Aqo}=jot(),wZ=1e6,xqo="timeline",Cqo="nanoseconds",Oqo=BigInt(Math.round(HZr.timeOrigin*wZ));function v2(e,t,r){return new TZ({key:t,str:e.dedup(Rqo(r))})}s(v2,"labelFromStr");function Rqo(e){switch(typeof e){case"string":return e;case"object":return"[object]";case"function":return"[function]";default:return String(e)}}s(Rqo,"safeToString");function GZr(e,t,r){return v2(e,e.dedup(t),r)}s(GZr,"labelFromStrStr");var Fat=class{static{s(this,"GCDecorator")}constructor(t){this.stringTable=t,this.reasonLabelKey=t.dedup("gc reason"),this.kindLabels=[],this.reasonLabels=[],this.flagObj={};let r=t.dedup("gc type");for(let[n,i]of Object.entries(pqo))if(n.startsWith("NODE_PERFORMANCE_GC_FLAGS_"))this.flagObj[n.slice(26).toLowerCase()]=i;else if(n.startsWith("NODE_PERFORMANCE_GC_")){let o=n.slice(20).toLowerCase();this.kindLabels[i]=v2(t,r,o)}}decorateSample(t,r){let{kind:n,flags:i}=r.detail;t.label.push(this.kindLabels[n]);let o=this.getReasonLabel(i);o&&t.label.push(o)}getReasonLabel(t){if(t===0)return null;let r=this.reasonLabels[t];if(!r){let n=[];for(let[o,a]of Object.entries(this.flagObj))a&t&&n.push(o);let i=n.join(",");r=v2(this.stringTable,this.reasonLabelKey,i),this.reasonLabels[t]=r}return r}},jat=class{static{s(this,"DNSDecorator")}constructor(t){this.stringTable=t,this.operationNameLabelKey=t.dedup("operation"),this.hostLabelKey=t.dedup("host"),this.addressLabelKey=t.dedup("address"),this.portLabelKey=t.dedup("port")}decorateSample(t,r){let n=t.label,i=this.stringTable;function o(u,l){n.push(v2(i,u,l))}s(o,"addLabel");let a=r.name;o(this.operationNameLabelKey,r.name);let c=r.detail;switch(a){case"lookup":o(this.hostLabelKey,c.hostname);break;case"lookupService":o(this.addressLabelKey,c.host),n.push(new TZ({key:this.portLabelKey,num:c.port}));break;case"getHostByAddr":o(this.addressLabelKey,c.host);break;default:a.startsWith("query")&&o(this.hostLabelKey,c.host)}}},$at=class{static{s(this,"NetDecorator")}constructor(t){this.stringTable=t,this.operationNameLabelKey=t.dedup("operation"),this.hostLabelKey=t.dedup("host"),this.portLabelKey=t.dedup("port")}decorateSample(t,r){let n=t.label,i=this.stringTable;function o(c,u){n.push(v2(i,c,u))}s(o,"addLabel");let a=r.name;if(o(this.operationNameLabelKey,a),a==="connect"){let c=r.detail;o(this.hostLabelKey,c.host),n.push(new TZ({key:this.portLabelKey,num:c.port}))}}},Hat=class{static{s(this,"FilesystemDecorator")}constructor(t){this.stringTable=t}decorateSample(t,r){let n=t.label,i=this.stringTable;Object.entries(r.detail).forEach(([o,a])=>{switch(typeof a){case"string":n.push(GZr(i,o,a));break;case"number":n.push(new TZ({key:i.dedup(o),num:a}))}})}},zZr={fs:Hat,dns:jat,gc:Fat,net:$at},MEe=class{static{s(this,"EventSerializer")}constructor(){this.stringTable=new Tqo,this.samples=[],this.locations=[],this.functions=[],this.decorators={};let t=new bqo({id:this.functions.length+1,name:this.stringTable.dedup("")});this.functions.push(t);let r=new Eqo({functionId:t.id}),n=new vqo({id:this.locations.length+1,line:[r]});this.locations.push(n),this.locationId=[n.id],this.timestampLabelKey=this.stringTable.dedup(mqo),this.spanIdKey=this.stringTable.dedup(gqo),this.rootSpanIdKey=this.stringTable.dedup(_qo)}addEvent(t){let{entryType:r,startTime:n,duration:i,_ddSpanId:o,_ddRootSpanId:a}=t,c=this.decorators[r];if(!c){let d=zZr[r];if(d)c=new d(this.stringTable),c.eventTypeLabel=GZr(this.stringTable,"event",r),this.decorators[r]=c;else return}let u=n+i,l=[c.eventTypeLabel,new TZ({key:this.timestampLabelKey,num:Oqo+BigInt(Math.round(u*wZ))})];o&&l.push(v2(this.stringTable,this.spanIdKey,o)),a&&l.push(v2(this.stringTable,this.rootSpanIdKey,a));let f={value:[Math.round(i*wZ)],locationId:this.locationId,label:l};c.decorateSample(f,t),this.samples.push(new wqo(f))}createProfile(t,r){let n=new Aqo({type:this.stringTable.dedup(xqo),unit:this.stringTable.dedup(Cqo)});return new Sqo({sampleType:[n],timeNanos:r.getTime()*wZ,periodType:n,period:1,durationNanos:(r.getTime()-t.getTime())*wZ,sample:this.samples,location:this.locations,function:this.functions,stringTable:this.stringTable})}};function Iqo(e){for(let t of e.getEntries())this.eventHandler(t)}s(Iqo,"add");var LEe=class{static{s(this,"NodeApiEventSource")}constructor(t,r){this.eventHandler=t,this.observer=void 0,this.entryTypes=r||Object.keys(zZr)}start(){this.observer||(this.observer=new hqo(Iqo.bind(this)),this.observer.observe({entryTypes:this.entryTypes}))}stop(){this.observer&&(this.observer.disconnect(),this.observer=void 0)}},Gat=class{static{s(this,"DatadogInstrumentationEventSource")}constructor(t,r){let n=[kZr(),PZr(),LZr(),BZr(),FZr(),$Zr()];this.plugins=n.map(i=>new i(t,r)),this.started=!1}start(){this.started||(this.plugins.forEach(t=>t.configure({enabled:!0})),this.started=!0)}stop(){this.started&&(this.plugins.forEach(t=>t.configure({enabled:!1})),this.started=!1)}},zat=class{static{s(this,"CompositeEventSource")}constructor(t){this.sources=t}start(){this.sources.forEach(t=>t.start())}stop(){this.sources.forEach(t=>t.stop())}};function kqo(e){let t=HZr.now(),r=0;return n(),i=>{let o=i.startTime+i.duration;for(;o>=t;)n();return i.startTime<r};function n(){r=t,t-=Math.log(1-Math.random())*e}s(n,"setNextSamplingInstant")}s(kqo,"createPossionProcessSamplingFilter");var Vat=class{static{s(this,"EventsProfiler")}constructor(t={}){this.type="events",this.eventSerializer=new MEe;let r=s(o=>this.eventSerializer.addEvent(o),"eventHandler"),n=t.timelineSamplingEnabled?kqo((t.samplingInterval??1e6/99)/1e3):o=>!0,i=s(o=>{n(o)&&r(o)},"filteringEventHandler");this.eventSource=t.codeHotspotsEnabled?new zat([new Gat(r,n),new LEe(i,["gc"])]):new LEe(i)}start(){this.eventSource.start()}stop(){this.eventSource.stop()}profile(t,r,n){t||this.stop();let i=this.eventSerializer;return this.eventSerializer=new MEe,()=>i.createProfile(r,n)}encode(t){return yqo(t())}};VZr.exports=Vat});var YZr=y((_0l,KZr)=>{"use strict";var Wat={parse(e){if(!e)return{};switch(typeof e){case"object":{if(Array.isArray(e)){let r={};for(let n of e){let i=n.indexOf(":");if(i===-1)continue;let o=n.slice(0,i).trim(),a=n.slice(i+1).trim();o.length!==0&&a.length!==0&&(r[o]=a)}return r}let t=[];for(let[r,n]of Object.entries(e))n!=null&&t.push(`${r}:${n}`);return Wat.parse(t)}case"string":return Wat.parse(e.split(","));default:return{}}}};KZr.exports={tagger:Wat}});var een=y((y0l,ZZr)=>{"use strict";var Nqo=require("os"),{getIsAzureFunction:QZr}=N6(),{getEnvironmentVariable:Pqo,getEnvironmentVariables:Dqo}=Dn();function Mqo(e){if(e!==void 0){let t=e.split("+")[0].trim();if(t.length>0)return t}}s(Mqo,"extractSubscriptionID");function Lqo(e){return/.+\+(.+)-.+webspace(-Linux)?/.exec(e)?.[1]}s(Lqo,"extractResourceGroup");function qqo(e,t,r){if(!(e===void 0||t===void 0||r===void 0))return`/subscriptions/${e}/resourcegroups/${r}/providers/microsoft.web/sites/${t}`.toLowerCase()}s(qqo,"buildResourceID");function XZr(e){return Object.entries(e).filter(([t,r])=>r===void 0).forEach(([t,r])=>{delete e[t]}),e}s(XZr,"trimObject");function JZr(){let{COMPUTERNAME:e,DD_AAS_DOTNET_EXTENSION_VERSION:t,FUNCTIONS_EXTENSION_VERSION:r,FUNCTIONS_WORKER_RUNTIME:n,FUNCTIONS_WORKER_RUNTIME_VERSION:i,WEBSITE_INSTANCE_ID:o,WEBSITE_OWNER_NAME:a,WEBSITE_OS:c,WEBSITE_RESOURCE_GROUP:u,WEBSITE_SITE_NAME:l}=Dqo(),f=Mqo(a),d=l,[p,h]=QZr()?["functionapp","function"]:["app","app"],g=u??Lqo(a);return XZr({extensionVersion:t,functionRuntimeVersion:r,instanceID:o,instanceName:e,operatingSystem:c??Nqo.platform(),resourceGroup:g,resourceID:qqo(f,d,g),runtime:n,runtimeVersion:i,siteKind:p,siteName:d,siteType:h,subscriptionID:f})}s(JZr,"buildMetadata");function Bqo(){if(Pqo("DD_AZURE_APP_SERVICES")!==void 0)return JZr()}s(Bqo,"getAzureAppMetadata");function Uqo(){if(QZr())return JZr()}s(Uqo,"getAzureFunctionMetadata");function Fqo(e){return e===void 0?{}:XZr({"aas.environment.extension_version":e.extensionVersion,"aas.environment.function_runtime":e.functionRuntimeVersion,"aas.environment.instance_id":e.instanceID,"aas.environment.instance_name":e.instanceName,"aas.environment.os":e.operatingSystem,"aas.environment.runtime":e.runtime,"aas.environment.runtime_version":e.runtimeVersion,"aas.resource.group":e.resourceGroup,"aas.resource.id":e.resourceID,"aas.site.kind":e.siteKind,"aas.site.name":e.siteName,"aas.site.type":e.siteType,"aas.subscription.id":e.subscriptionID})}s(Fqo,"getAzureTagsFromMetadata");ZZr.exports={getAzureAppMetadata:Bqo,getAzureFunctionMetadata:Uqo,getAzureTagsFromMetadata:Fqo}});var oen=y((E0l,sen)=>{"use strict";var fu=YI(),jqo=require("os"),$qo=require("path"),{URL:Hqo,format:Gqo,pathToFileURL:zqo}=require("url"),{AgentExporter:Qat}=Aot(),{FileExporter:ren}=Cot(),{ConsoleLogger:Vqo}=Iot(),nen=Oat(),Wqo=kat(),Kqo=WZr(),{oomExportStrategies:ien,snapshotKinds:Yqo}=PEe(),{GIT_REPOSITORY_URL:Qqo,GIT_COMMIT_SHA:Xqo}=sw(),{tagger:Kat}=YZr(),{isFalse:ten,isTrue:Cw}=bf(),{getAzureTagsFromMetadata:Jqo,getAzureAppMetadata:Zqo}=een(),{getEnvironmentVariables:eBo}=Dn(),Yat=class{static{s(this,"Config")}constructor(t={}){let{AWS_LAMBDA_FUNCTION_NAME:r,DD_AGENT_HOST:n,DD_ENV:i,DD_INTERNAL_PROFILING_TIMELINE_SAMPLING_ENABLED:o,DD_PROFILING_CODEHOTSPOTS_ENABLED:a,DD_PROFILING_CPU_ENABLED:c,DD_PROFILING_DEBUG_SOURCE_MAPS:u,DD_PROFILING_DEBUG_UPLOAD_COMPRESSION:l,DD_PROFILING_ENDPOINT_COLLECTION_ENABLED:f,DD_PROFILING_EXPERIMENTAL_OOM_EXPORT_STRATEGIES:d,DD_PROFILING_EXPERIMENTAL_OOM_HEAP_LIMIT_EXTENSION_SIZE:p,DD_PROFILING_EXPERIMENTAL_OOM_MAX_HEAP_EXTENSION_COUNT:h,DD_PROFILING_EXPERIMENTAL_OOM_MONITORING_ENABLED:g,DD_PROFILING_HEAP_ENABLED:b,DD_PROFILING_HEAP_SAMPLING_INTERVAL:v,DD_PROFILING_PPROF_PREFIX:S,DD_PROFILING_PROFILERS:C,DD_PROFILING_SOURCE_MAP:R,DD_PROFILING_TIMELINE_ENABLED:N,DD_PROFILING_UPLOAD_PERIOD:A,DD_PROFILING_UPLOAD_TIMEOUT:L,DD_PROFILING_V8_PROFILER_BUG_WORKAROUND:$,DD_PROFILING_WALLTIME_ENABLED:U,DD_SERVICE:G,DD_TAGS:Z,DD_TRACE_AGENT_PORT:re,DD_TRACE_AGENT_URL:me,DD_VERSION:B}=eBo(),le=fu(t.env,i),J=t.service||G||"node",F=jqo.hostname(),P=fu(t.version,B),ve=fu(t.interval,Number(A)*1e3,65*1e3),ee=fu(t.uploadTimeout,Number(L),60*1e3),be=fu(t.sourceMap,R,!0),Le=fu(t.pprofPrefix,S,"");this.service=J,this.env=le,this.host=F,this.functionname=r,this.version=P,this.tags=Object.assign(Kat.parse(Z),Kat.parse(t.tags),Kat.parse({env:le,host:F,service:J,version:P,functionname:r}),Jqo(Zqo())),t.repositoryUrl&&t.commitSHA&&(this.tags[Qqo]=t.repositoryUrl,this.tags[Xqo]=t.commitSHA),this.logger=cBo(t.logger);let je=process.platform!=="win32";function fe(Or,Tn,Ti){if(Or&&!Ti)throw new Error(`${Tn} not supported on ${process.platform}.`)}s(fe,"checkOptionAllowed");function xe(Or,Tn){fe(Or,Tn,je)}s(xe,"checkOptionWithSamplingContextAllowed"),this.flushInterval=ve,this.uploadTimeout=ee,this.sourceMap=be,this.debugSourceMaps=Cw(fu(t.debugSourceMaps,u,!1)),this.endpointCollectionEnabled=Cw(fu(t.endpointCollection,f,je)),xe(this.endpointCollectionEnabled,"Endpoint collection"),this.pprofPrefix=Le,this.v8ProfilerBugWorkaroundEnabled=Cw(fu(t.v8ProfilerBugWorkaround,$,!0));let Ce=fu(t.hostname,n)||"localhost",V=fu(t.port,re)||8126;this.url=new Hqo(fu(t.url,me,Gqo({protocol:"http:",hostname:Ce,port:V}))),this.libraryInjected=t.libraryInjected,this.activation=t.activation,this.exporters=sBo(t.exporters||[new Qat(this)],this);let Y=process.platform!=="win32",Se=Cw(fu(t.oomMonitoring,g,Y));fe(Se,"OOM monitoring",Y);let pe=fu(t.oomHeapLimitExtensionSize,Number(p),0),ct=fu(t.oomMaxHeapExtensionCount,Number(h),0),Ge=Se?nBo(fu(t.oomExportStrategies,d,[ien.PROCESS]),this):[],xt=Se?uBo(this):void 0;this.oomMonitoring={enabled:Se,heapLimitExtensionSize:pe,maxHeapExtensionCount:ct,exportStrategies:Ge,exportCommand:xt};let Jt=t.profilers||tBo({DD_PROFILING_HEAP_ENABLED:b,DD_PROFILING_WALLTIME_ENABLED:U,DD_PROFILING_PROFILERS:C});this.timelineEnabled=Cw(fu(t.timelineEnabled,N,je)),xe(this.timelineEnabled,"Timeline view"),this.timelineSamplingEnabled=Cw(fu(t.timelineSamplingEnabled,o,!0)),this.codeHotspotsEnabled=Cw(fu(t.codeHotspotsEnabled,a,je)),xe(this.codeHotspotsEnabled,"Code hotspots"),this.cpuProfilingEnabled=Cw(fu(t.cpuProfilingEnabled,c,je)),xe(this.cpuProfilingEnabled,"CPU profiling"),this.heapSamplingInterval=fu(t.heapSamplingInterval,Number(v));let pt=fu(t.uploadCompression,l,"on"),[fr,ln]=pt.split("-");["on","off","gzip","zstd"].includes(fr)||(this.logger.warn(`Invalid profile upload compression method "${pt}". Will use "on".`),fr="on");let sn=ln?Number.parseInt(ln,10):void 0;if(sn!==void 0)if(["on","off"].includes(fr))this.logger.warn(`Compression levels are not supported for "${fr}".`),sn=void 0;else if(Number.isNaN(sn))this.logger.warn(`Invalid compression level "${ln}". Will use default level.`),sn=void 0;else if(sn<1)this.logger.warn(`Invalid compression level ${sn}. Will use 1.`),sn=1;else{let Or={gzip:9,zstd:22}[fr];sn>Or&&(this.logger.warn(`Invalid compression level ${sn}. Will use ${Or}.`),sn=Or)}fr==="on"&&(fr="gzip"),this.uploadCompression={method:fr,level:sn},this.profilers=aBo(Jt,this)}};sen.exports={Config:Yat};function tBo({DD_PROFILING_HEAP_ENABLED:e,DD_PROFILING_WALLTIME_ENABLED:t,DD_PROFILING_PROFILERS:r}){let n=new Set(fu(r,"wall,space").split(","));return t!=null&&(Cw(t)?n.add("wall"):ten(t)&&n.delete("wall")),e!=null&&(Cw(e)?n.add("space"):ten(e)&&n.delete("space")),[...n]}s(tBo,"getProfilers");function rBo(e,t){let r=Object.values(ien).find(n=>n===e);return r===void 0&&t.logger.error(`Unknown oom export strategy "${e}"`),r}s(rBo,"getExportStrategy");function nBo(e,t){if(!e)return[];typeof e=="string"&&(e=e.split(","));for(let r=0;r<e.length;r++){let n=e[r];typeof n=="string"&&(e[r]=rBo(n,t))}return[...new Set(e)]}s(nBo,"ensureOOMExportStrategies");function iBo(e,t){switch(e){case"agent":return new Qat(t);case"file":return new ren(t)}}s(iBo,"getExporter");function sBo(e,t){typeof e=="string"&&(e=e.split(","));for(let r=0;r<e.length;r++){let n=e[r];typeof n=="string"&&(e[r]=iBo(n,t))}return e}s(sBo,"ensureExporters");function oBo(e,t){switch(e){case"cpu":case"wall":return new nen(t);case"space":return new Wqo(t);default:t.logger.error(`Unknown profiler "${e}"`)}}s(oBo,"getProfiler");function aBo(e,t){typeof e=="string"&&(e=e.split(","));for(let r=0;r<e.length;r++){let n=e[r];typeof n=="string"&&(e[r]=oBo(n,t))}return t.timelineEnabled&&e.some(r=>r instanceof nen)&&e.push(new Kqo(t)),e.filter(Boolean)}s(aBo,"ensureProfilers");function cBo(e){return typeof e!="object"||typeof e.debug!="function"||typeof e.info!="function"||typeof e.warn!="function"||typeof e.error!="function"?new Vqo:e}s(cBo,"ensureLogger");function uBo(e){let t=[...Object.entries(e.tags),["snapshot",Yqo.ON_OUT_OF_MEMORY]].map(([n,i])=>`${n}:${i}`).join(","),r=[];for(let n of e.exporters)n instanceof Qat?r.push(e.url.toString()):n instanceof ren&&r.push(zqo(e.pprofPrefix).toString());return[process.execPath,$qo.join(__dirname,"exporter_cli.js"),r.join(","),t,"space"]}s(uBo,"buildExportCommand")});var pen=y((S0l,den)=>{"use strict";var{EventEmitter:lBo}=require("events"),{Config:fBo}=oen(),{snapshotKinds:Xat}=PEe(),{threadNamePrefix:Jat}=EZ(),{isWebServerSpan:len,endpointNameFromTags:dBo,getStartedSpans:pBo}=Tat(),fen=hi(),hBo=hot(),{promisify:aen}=require("util"),qEe=require("zlib"),mBo=fen.channel("datadog:profiling:profile-submitted"),cen=fen.channel("dd-trace:span:finish");function gBo(e,t,r){if(e)return t.create([process.cwd()],r)}s(gBo,"maybeSourceMap");function uen(e,...t){e&&e.error(...t)}s(uen,"logError");function _Bo(e,t){for(let r=e.length;--r>=0;){let i=e[r].context();if(i._spanId===t){if(len(i._tags))return!0;t=i._parentId}}return!1}s(_Bo,"findWebSpan");var BEe=class extends lBo{static{s(this,"Profiler")}constructor(){super(),this._enabled=!1,this._logger=void 0,this._config=void 0,this._timer=void 0,this._lastStart=void 0,this._timeoutInterval=void 0,this.endpointCounts=new Map}start(t){return this._start(t).catch(r=>(uen(t.logger,"Error starting profiler. For troubleshooting tips, see <https://dtdg.co/nodejs-profiler-troubleshooting>",r),!1))}_logError(t){uen(this._logger,t)}async _start(t){if(this._enabled)return!0;let r=this._config=new fBo(t);this._logger=r.logger,this._enabled=!0,this._setInterval();let n;try{let{setLogger:i,SourceMapper:o}=bZ();i(r.logger),n=await gBo(r.sourceMap,o,r.debugSourceMaps),r.sourceMap&&r.debugSourceMaps&&this._logger.debug(()=>n.infoMap.size===0?"Found no source maps":`Found source maps for following files: [${[...n.infoMap.keys()].join(", ")}]`);let a=r.uploadCompression.level;switch(r.uploadCompression.method){case"gzip":this._compressionFn=aen(qEe.gzip),a!==void 0&&(this._compressionOptions={level:a});break;case"zstd":if(typeof qEe.zstdCompress=="function")this._compressionFn=aen(qEe.zstdCompress),a!==void 0&&(this._compressionOptions={params:{[qEe.constants.ZSTD_c_compressionLevel]:a}});else{let c=O_e().load("datadog-js-zstd").zstd_compress,u=a??0;this._compressionFn=l=>Promise.resolve(Buffer.from(c(l,u)))}break}}catch(i){this._logError(i)}try{let i=new Date;for(let o of r.profilers)o.start({mapper:n,nearOOMCallback:this._nearOOMExport.bind(this)}),this._logger.debug(`Started ${o.type} profiler in ${Jat} thread`);return r.endpointCollectionEnabled&&(this._spanFinishListener=this._onSpanFinish.bind(this),cen.subscribe(this._spanFinishListener)),this._capture(this._timeoutInterval,i),!0}catch(i){return this._logError(i),this._stop(),!1}}_nearOOMExport(t,r){let n=this._lastStart,i=new Date;this._submit({[t]:r},n,i,Xat.ON_OUT_OF_MEMORY)}_setInterval(){this._timeoutInterval=this._config.flushInterval}stop(){this._enabled&&(this._collect(Xat.ON_SHUTDOWN,!1),this._stop())}_stop(){if(this._enabled){this._enabled=!1,this._spanFinishListener!==void 0&&(cen.unsubscribe(this._spanFinishListener),this._spanFinishListener=void 0);for(let t of this._config.profilers)t.stop(),this._logger.debug(`Stopped ${t.type} profiler in ${Jat} thread`);clearTimeout(this._timer),this._timer=void 0}}_capture(t,r){this._enabled&&(this._lastStart=r,!this._timer||t!==this._timeoutInterval?(this._timer=setTimeout(()=>this._collect(Xat.PERIODIC),t),this._timer.unref()):this._timer.refresh())}_onSpanFinish(t){let r=t.context(),n=r._tags;if(!len(n))return;let i=dBo(n);if(!i||_Bo(pBo(r),r._parentId))return;let o=this.endpointCounts.get(i);o===void 0?(o={count:1},this.endpointCounts.set(i,o)):o.count++}async _collect(t,r=!0){if(!this._enabled)return;let n=this._lastStart,i=new Date,o=[],a={};try{if(this._config.profilers.length===0)throw new Error("No profile types configured.");hBo.withProfilerSerializing(()=>{for(let u of this._config.profilers){let l=u.profile(r,n,i);r||this._logger.debug(`Stopped ${u.type} profiler in ${Jat} thread`),l&&o.push({profiler:u,profile:l})}}),r&&this._capture(this._timeoutInterval,i);let c=!1;await Promise.all(o.map(async({profiler:u,profile:l})=>{try{let f=await u.encode(l),d=f instanceof Buffer&&this._compressionFn!==void 0?await this._compressionFn(f,this._compressionOptions):f;a[u.type]=d,this._logger.debug(()=>{let p=JSON.stringify(l,(h,g)=>typeof g=="bigint"?g.toString():g);return`Collected ${u.type} profile: `+p}),c=!0}catch(f){this._logError(f)}})),c&&(await this._submit(a,n,i,t),mBo.publish(),this._logger.debug("Submitted profiles"))}catch(c){this._logError(c),this._stop()}}_submit(t,r,n,i){let{tags:o}=this._config,a={};for(let[l,{count:f}]of this.endpointCounts)a[l]=f;this.endpointCounts.clear(),o.snapshot=i;let c={profiles:t,start:r,end:n,tags:o,endpointCounts:a},u=this._config.exporters.map(l=>l.export(c).catch(f=>{this._logger&&this._logger.warn(f)}));return Promise.all(u)}},Zat=class extends BEe{static{s(this,"ServerlessProfiler")}constructor(){super(),this._profiledIntervals=0,this._interval=1,this._flushAfterIntervals=void 0}_setInterval(){this._timeoutInterval=this._interval*1e3,this._flushAfterIntervals=this._config.flushInterval/1e3}async _collect(t,r=!0){this._profiledIntervals>=this._flushAfterIntervals||!r?(this._profiledIntervals=0,await super._collect(t,r)):(this._profiledIntervals+=1,this._capture(this._timeoutInterval,new Date))}};den.exports={Profiler:BEe,ServerlessProfiler:Zat}});var men=y((T0l,hen)=>{"use strict";var{Profiler:yBo,ServerlessProfiler:bBo}=pen(),EBo=Oat(),vBo=kat(),{AgentExporter:SBo}=Aot(),{FileExporter:wBo}=Cot(),{ConsoleLogger:TBo}=Iot(),{getEnvironmentVariable:ABo}=Dn(),xBo=ABo("AWS_LAMBDA_FUNCTION_NAME")?new bBo:new yBo;hen.exports={profiler:xBo,AgentExporter:SBo,FileExporter:wBo,WallProfiler:EBo,SpaceProfiler:vBo,ConsoleLogger:TBo}});var _en=y((A0l,gen)=>{"use strict";var UEe=At(),{profiler:ect}=men();process.once("beforeExit",()=>{ect.stop()});gen.exports={start:e=>{let{service:t,version:r,env:n,url:i,hostname:o,port:a,tags:c,repositoryUrl:u,commitSHA:l,injectionEnabled:f}=e,{enabled:d,sourceMap:p,exporters:h}=e.profiling,g={debug:S=>UEe.debug(S),info:S=>UEe.info(S),warn:S=>UEe.warn(S),error:(...S)=>UEe.error(...S)},b=f.length>0,v;return d==="auto"?v="auto":d==="true"?v="manual":f.includes("profiler")&&(v="injection"),ect.start({service:t,version:r,env:n,logger:g,sourceMap:p,exporters:h,url:i,hostname:o,port:a,tags:c,repositoryUrl:u,commitSHA:l,libraryInjected:b,activation:v})},stop:()=>{ect.stop()}}});var tct=y((x0l,yen)=>{"use strict";var{TRACE_SOURCE_PROPAGATION_KEY:FEe}=oi();function CBo(e,t){if(e&&t){let r=e[FEe]?Number.parseInt(e[FEe],16):0;e[FEe]=((r|t.id)>>>0).toString(16).padStart(2,"0")}return e}s(CBo,"addTraceSourceTag");function OBo(e){return Object.hasOwn(e,FEe)}s(OBo,"hasTraceSourcePropagationTag");yen.exports={addTraceSourceTag:CBo,hasTraceSourcePropagationTag:OBo}});var wen=y((O0l,Sen)=>{"use strict";var RBo=ck(),{MANUAL_KEEP:ben}=cu(),{USER_KEEP:Een,AUTO_KEEP:IBo,AUTO_REJECT:kBo}=KS(),{SAMPLING_MECHANISM_DEFAULT:NBo}=oi(),{addTraceSourceTag:PBo,hasTraceSourcePropagationTag:ven}=tct(),{getProductRateLimiter:DBo}=i2(),rct=class extends RBo{static{s(this,"TraceSourcePrioritySampler")}configure(t,r,n){this._env=t,this._limiter=DBo(n)}_getPriorityFromTags(t,r){if(Object.hasOwn(t,ben)&&t[ben]!==!1&&ven(r._trace.tags))return Een}_getPriorityFromAuto(t){let r=this._getContext(t);return r._sampling.mechanism=NBo,ven(r._trace.tags)?Een:this._isSampledByRateLimit(r)?IBo:kBo}setPriority(t,r,n){super.setPriority(t,r,n);let i=this._getContext(t);PBo(i?._trace?.tags,n)}};Sen.exports=rct});var Ren=y((I0l,Oen)=>{"use strict";var{channel:oct}=hi(),MBo=wen(),{USER_KEEP:Ten}=KS(),LBo=Ihe(),{APM_TRACING_ENABLED_KEY:qBo}=oi(),{hasTraceSourcePropagationTag:act}=tct(),nct=oct("dd-trace:span:start"),ict=oct("dd-trace:span:inject"),sct=oct("dd-trace:span:extract");function BBo(e){if(nct.hasSubscribers&&nct.unsubscribe(Aen),ict.hasSubscribers&&ict.unsubscribe(xen),sct.hasSubscribers&&sct.unsubscribe(Cen),e.apmTracingEnabled===!1)return nct.subscribe(Aen),ict.subscribe(xen),sct.subscribe(Cen),new MBo(e.env)}s(BBo,"configure");function Aen({span:e,fields:t}){let r=e.context?.()?._tags;if(!r)return;let{parent:n}=t;(!n||n._isRemote)&&(r[qBo]=0)}s(Aen,"onSpanStart");function xen({spanContext:e,carrier:t}){if(!(!e?._trace?.tags||!t)&&!act(e._trace.tags))for(let r in t){let n=r.toLowerCase();if(n.startsWith("x-datadog")||n.startsWith("x-b3")||n==="traceparent")delete t[r];else if(n==="tracestate"){let i=LBo.fromString(t[r]);i.forVendor("dd",o=>o.clear()),t[r]=i.toString()}}}s(xen,"onSpanInject");function Cen({spanContext:e={}}){!e._trace?.tags||!e._sampling||(act(e._trace.tags)?e._sampling.priority!==Ten&&(e._sampling.priority=Ten):e._sampling.priority=void 0)}s(Cen,"onSpanExtract");Oen.exports={configure:BBo,hasTraceSourcePropagationTag:act}});var jEe=y((N0l,Ien)=>{"use strict";function UBo(e){let t=e.scope().active();if(!t)return;let r=t.context(),n=r._trace.started,i=r._parentId;for(;i;){let o=n.find(c=>c.context()._spanId===i),a=o?.context();if(!a)break;i=a._parentId,a._tags?._inferred_span||(t=o)}return t}s(UBo,"getRootSpan");Ien.exports={getRootSpan:UBo}});var $Ee=y((D0l,Den)=>{"use strict";var{getRootSpan:FBo}=jEe(),ken=At(),jBo=$b(),Nen=jb();function Pen(e,t){for(let r of Object.keys(e))t.setTag(`usr.${r}`,String(e[r]));t.setTag("_dd.appsec.user.collection_mode","sdk")}s(Pen,"setUserTags");function $Bo(e,t){if(!t||!t.id){ken.warn("[ASM] Invalid user provided to setUser");return}let r=FBo(e);if(!r){ken.warn("[ASM] Root span not available in setUser");return}Pen(t,r);let n={[Nen.USER_ID]:String(t.id)};t.session_id&&typeof t.session_id=="string"&&(n[Nen.USER_SESSION_ID]=t.session_id),jBo.run({persistent:n})}s($Bo,"setUser");Den.exports={setUserTags:Pen,setUser:$Bo}});var Uen=y((L0l,Ben)=>{"use strict";var Ow=At(),{getRootSpan:AZ}=jEe(),{setUserTags:Len}=$Ee(),HBo=$b(),{keepTrace:GBo}=ck(),Men=jb(),{ASM:zBo}=i2(),{incrementSdkEventMetric:xZ}=nC();function VBo(e,t,r){if(!t||!t.id){Ow.warn("[ASM] Invalid user provided to trackUserLoginSuccessEvent");return}xZ("login_success","v1");let n=AZ(e);if(!n){Ow.warn("[ASM] Root span not available in trackUserLoginSuccessEvent");return}Len(t,n);let i=t.login??t.id;r={"usr.login":i,...r},F$("users.login.success",r,"trackUserLoginSuccessEvent",n),j$("users.login.success",{id:t.id,login:i})}s(VBo,"trackUserLoginSuccessEvent");function WBo(e,t,r,n){if(!t||typeof t!="string"){Ow.warn("[ASM] Invalid userId provided to trackUserLoginFailureEvent");return}let i={"usr.id":t,"usr.login":t,"usr.exists":r?"true":"false",...n};F$("users.login.failure",i,"trackUserLoginFailureEvent",AZ(e)),j$("users.login.failure",{login:t}),xZ("login_failure","v1")}s(WBo,"trackUserLoginFailureEvent");function KBo(e,t,r){if(!t||typeof t!="string"){Ow.warn("[ASM] Invalid eventName provided to trackCustomEvent");return}F$(t,r,"trackCustomEvent",AZ(e)),xZ("custom","v1"),(t==="users.login.success"||t==="users.login.failure")&&j$(t)}s(KBo,"trackCustomEvent");function YBo(e,t,r,n){if(!t||typeof t!="string"){Ow.warn("[ASM] Invalid login provided to eventTrackingV2.trackUserLoginSuccess");return}xZ("login_success","v2");let i=AZ(e);if(!i){Ow.warn("[ASM] Root span not available in eventTrackingV2.trackUserLoginSuccess");return}let o={login:t};n={"usr.login":t,...n},r&&(typeof r!="object"&&(r={id:r}),r.id&&(o.id=r.id,Len(r,i),n.usr=r)),F$("users.login.success",n,"eventTrackingV2.trackUserLoginSuccess",i),j$("users.login.success",o)}s(YBo,"trackUserLoginSuccessV2");function QBo(e,t,r,n){if(!t||typeof t!="string"){Ow.warn("[ASM] Invalid login provided to eventTrackingV2.trackUserLoginFailure");return}xZ("login_failure","v2");let i=AZ(e);if(!i){Ow.warn("[ASM] Root span not available in eventTrackingV2.trackUserLoginFailure");return}let o={login:t};typeof r=="object"&&n===void 0&&(n=r,r=!1),n={"usr.login":t,"usr.exists":r?"true":"false",...n},F$("users.login.failure",n,"eventTrackingV2.trackUserLoginFailure",i),j$("users.login.failure",o)}s(QBo,"trackUserLoginFailureV2");function qen(e,t=0){if(t>4)return{truncated:!0};let r={},n=!1;for(let i of Object.keys(e)){let o=e[i];if(o&&typeof o=="object"){let{result:a,truncated:c}=qen(o,t+1);if(n=n||c,a)for(let u of Object.keys(a))r[`${i}.${u}`]=a[u]}else o!==void 0&&(r[i]=o)}return{result:r,truncated:n}}s(qen,"flattenFields");function F$(e,t,r,n){if(!n){Ow.warn("[ASM] Root span not available in %s",r);return}let i={[`appsec.events.${e}.track`]:"true",[`_dd.appsec.events.${e}.sdk`]:"true"};if(t){let{result:o,truncated:a}=qen(t);a&&Ow.warn("[ASM] Too deep object provided in the SDK method %s, object truncated",r);for(let c of Object.keys(o))i[`appsec.events.${e}.${c}`]=String(o[c])}n.addTags(i),GBo(n,zBo)}s(F$,"trackEvent");function j$(e,t){let r={[`server.business_logic.${e}`]:null};t?.id&&(r[Men.USER_ID]=String(t.id)),t?.login&&(r[Men.USER_LOGIN]=String(t.login)),HBo.run({persistent:r})}s(j$,"runWaf");Ben.exports={trackUserLoginSuccessEvent:VBo,trackUserLoginFailureEvent:WBo,trackCustomEvent:KBo,trackUserLoginSuccessV2:YBo,trackUserLoginFailureV2:QBo,trackEvent:F$,runWaf:j$}});var $en=y((B0l,jen)=>{"use strict";var{USER_ID:XBo}=jb(),JBo=$b(),{getRootSpan:Fen}=jEe(),{block:ZBo,getBlockingAction:eUo}=iC(),{storage:tUo}=Fr(),{setUserTags:rUo}=$Ee(),HEe=At();function nUo(e){let t=JBo.run({persistent:{[XBo]:e.id}});return!!eUo(t?.actions)}s(nUo,"isUserBlocked");function iUo(e,t){if(!t||!t.id)return HEe.warn("[ASM] Invalid user provided to isUserBlocked"),!1;let r=Fen(e);return r?r.context()._tags["usr.id"]||rUo(t,r):HEe.warn("[ASM] Root span not available in isUserBlocked"),nUo(t)}s(iUo,"checkUserAndSetUser");function sUo(e,t,r){if(!t||!r){let i=tUo("legacy").getStore();i&&(t=t||i.req,r=r||i.res)}if(!t||!r)return HEe.warn("[ASM] Requests or response object not available in blockRequest"),!1;let n=Fen(e);return n?ZBo(t,r,n):(HEe.warn("[ASM] Root span not available in blockRequest"),!1)}s(sUo,"blockRequest");jen.exports={checkUserAndSetUser:iUo,blockRequest:sUo}});var Gen=y((F0l,Hen)=>{"use strict";var{trackUserLoginSuccessEvent:oUo,trackUserLoginFailureEvent:aUo,trackCustomEvent:cUo,trackUserLoginSuccessV2:uUo,trackUserLoginFailureV2:lUo}=Uen(),{checkUserAndSetUser:fUo,blockRequest:dUo}=$en(),{setTemplates:pUo}=iC(),{setUser:hUo}=$Ee(),cct=class{static{s(this,"EventTrackingV2")}constructor(t){this._tracer=t}trackUserLoginSuccess(t,r,n){uUo(this._tracer,t,r,n)}trackUserLoginFailure(t,r,n){lUo(this._tracer,t,r,n)}},uct=class{static{s(this,"AppsecSdk")}constructor(t,r){this._tracer=t,r&&pUo(r),this.eventTrackingV2=new cct(t)}trackUserLoginSuccessEvent(t,r){return oUo(this._tracer,t,r)}trackUserLoginFailureEvent(t,r,n){return aUo(this._tracer,t,r,n)}trackCustomEvent(t,r){return cUo(this._tracer,t,r)}isUserBlocked(t){return fUo(this._tracer,t)}blockRequest(t,r){return dUo(this._tracer,t,r)}setUser(t){return hUo(this._tracer,t)}};Hen.exports=uct});var Yen=y(($0l,Ken)=>{"use strict";var{SPAN_KIND:mUo,OUTPUT_VALUE:gUo,INPUT_VALUE:_Uo}=Kk(),{getFunctionArguments:CZ,validateKind:zen}=zL(),{isTrue:yUo,isError:bUo}=bf(),{storage:lct}=eye(),Ven=Ohe(),EUo=Sf().version,S2=At(),{getEnvironmentVariable:vUo}=Dn(),$$=Vx(),H$=zx(),{channel:Wen}=hi(),SUo=Wen("llmobs:eval-metric:append"),wUo=Wen("llmobs:writers:flush"),TUo=HHe(),fct=class extends TUo{static{s(this,"LLMObs")}constructor(t,r,n){super(t),this._config=n,this._llmobsModule=r,this._tagger=new H$(n)}get enabled(){return this._config.llmobs.enabled}enable(t={}){if(this.enabled){S2.debug("LLMObs is already enabled.");return}S2.debug("Enabling LLMObs");let{mlApp:r,agentlessEnabled:n}=t,i=vUo("DD_LLMOBS_ENABLED"),o={mlApp:r,agentlessEnabled:n};if(!(i==null||yUo(i))){S2.debug("LLMObs.enable() called when DD_LLMOBS_ENABLED is false. No action taken.");return}this._config.llmobs.enabled=!0,this._config.configure({...this._config,llmobs:o}),this._llmobsModule.enable(this._config)}disable(){if(!this.enabled){S2.debug("LLMObs is already disabled.");return}S2.debug("Disabling LLMObs"),this._config.llmobs.enabled=!1,this._llmobsModule.disable()}trace(t={},r){typeof t=="function"&&(r=t,t={});let n=zen(t.kind);$$.incrementLLMObsSpanStartCount({autoinstrumented:!1,kind:n});let i=t.name||n;if(!i)throw new Error("No span name provided for `trace`.");let{spanOptions:o,...a}=this._extractOptions(t);return r.length>1?this._tracer.trace(i,o,(c,u)=>this._activate(c,{kind:n,...a},()=>r(c,u))):this._tracer.trace(i,o,c=>this._activate(c,{kind:n,...a},()=>r(c)))}wrap(t={},r){typeof t=="function"&&(r=t,t={});let n=zen(t.kind),i=t.name||r?.name||n;i||(S2.warn('No span name provided for `wrap`. Defaulting to "unnamed-anonymous-function".'),i="unnamed-anonymous-function");let{spanOptions:o,...a}=this._extractOptions(t),c=this;function u(){$$.incrementLLMObsSpanStartCount({autoinstrumented:!1,kind:n});let l=c._tracer.scope().active(),f=arguments,d=f.length-1,p=f[d],h=typeof p=="function";if(h){let g=c._bind(p);f[d]=function(){let b=arguments[0],v=arguments[1];return c._autoAnnotate(l,n,CZ(r,f),bUo(b)||b==null?v:b),g.apply(this,arguments)}}try{let g=c._activate(l,{kind:n,...a},()=>r.apply(this,f));return g&&typeof g.then=="function"?g.then(b=>(h||c._autoAnnotate(l,n,CZ(r,f),b),b),b=>{throw c._autoAnnotate(l,n,CZ(r,f)),b}):(h||c._autoAnnotate(l,n,CZ(r,f),g),g)}catch(g){throw c._autoAnnotate(l,n,CZ(r,f)),g}}return s(u,"wrapped"),this._tracer.wrap(i,o,u)}annotate(t,r,n=!1){if(!this.enabled)return;t||(t=this._active()),t&&!r&&!(t instanceof Ven)&&(r=t,t=this._active());let i="";try{if(!t)throw i="invalid_span_no_active_spans",new Error("No span provided and no active LLMObs-generated span found");if(!r)throw i="invalid_options",new Error("No options provided for annotation.");if(!H$.tagMap.has(t))throw i="invalid_span_type",new Error("Span must be an LLMObs-generated span");if(t._duration!==void 0)throw i="invalid_finished_span",new Error("Cannot annotate a finished span");let o=H$.tagMap.get(t)[mUo];if(!o)throw i="invalid_no_span_kind",new Error("LLMObs span must have a span kind specified");let{inputData:a,outputData:c,metadata:u,metrics:l,tags:f}=r;(a||c)&&(o==="llm"?this._tagger.tagLLMIO(t,a,c):o==="embedding"?this._tagger.tagEmbeddingIO(t,a,c):o==="retrieval"?this._tagger.tagRetrievalIO(t,a,c):this._tagger.tagTextIO(t,a,c)),u&&this._tagger.tagMetadata(t,u),l&&this._tagger.tagMetrics(t,l),f&&this._tagger.tagSpanTags(t,f)}catch(o){throw o.ddErrorTag&&(i=o.ddErrorTag),o}finally{n===!1&&$$.recordLLMObsAnnotate(t,i)}}exportSpan(t){t=t||this._active();let r="";try{if(!t)throw r="no_active_span",new Error("No span provided and no active LLMObs-generated span found");if(!(t instanceof Ven))throw r="invalid_span",new TypeError("Span must be a valid Span object.");if(!H$.tagMap.has(t))throw r="invalid_span",new Error("Span must be an LLMObs-generated span")}catch(n){throw $$.recordExportSpan(t,r),n}try{return{traceId:t.context().toTraceId(!0),spanId:t.context().toSpanId()}}catch{r="invalid_span",S2.warn("Failed to export span. Span must be a valid Span object.")}finally{$$.recordExportSpan(t,r)}}submitEvaluation(t,r={}){if(!this.enabled)return;let n="",{traceId:i,spanId:o}=t;try{if(!i||!o)throw n="invalid_span",new Error("spanId and traceId must both be specified for the given evaluation metric to be submitted.");let a=r.mlApp||this._config.llmobs.mlApp;if(!a)throw n="missing_ml_app",new Error("ML App name is required for sending evaluation metrics. Evaluation metric data will not be sent.");let c=r.timestampMs||Date.now();if(typeof c!="number"||c<0)throw n="invalid_timestamp",new Error("timestampMs must be a non-negative integer. Evaluation metric data will not be sent");let{label:u,value:l,tags:f}=r,d=r.metricType?.toLowerCase();if(!u)throw n="invalid_metric_label",new Error("label must be the specified name of the evaluation metric");if(!d||!["categorical","score"].includes(d))throw n="invalid_metric_type",new Error('metricType must be one of "categorical" or "score"');if(d==="categorical"&&typeof l!="string")throw n="invalid_metric_value",new Error("value must be a string for a categorical metric.");if(d==="score"&&typeof l!="number")throw n="invalid_metric_value",new Error("value must be a number for a score metric.");let p={"ddtrace.version":EUo,ml_app:a};if(f)for(let g in f){let b=f[g];if(typeof b=="string")p[g]=b;else if(typeof b.toString=="function")p[g]=b.toString();else if(b==null)p[g]=Object.prototype.toString.call(b);else throw n="invalid_tags",new Error("Failed to parse tags. Tags for evaluation metrics must be strings")}let h={span_id:o,trace_id:i,label:u,metric_type:d,ml_app:a,[`${d}_value`]:l,timestamp_ms:c,tags:Object.entries(p).map(([g,b])=>`${g}:${b}`)};SUo.publish(h)}finally{$$.recordSubmitEvaluation(r,n)}}flush(){this.enabled&&wUo.publish()}_autoAnnotate(t,r,n,i){let o={};n&&!["llm","embedding"].includes(r)&&!H$.tagMap.get(t)?.[_Uo]&&(o.inputData=n),i&&!["llm","retrieval"].includes(r)&&!H$.tagMap.get(t)?.[gUo]&&(o.outputData=i),this.annotate(t,o,!0)}_active(){return lct.getStore()?.span}_activate(t,r,n){let i=this._active();this.enabled&&lct.enterWith({span:t}),r&&this._tagger.registerLLMObsSpan(t,{...r,parent:i});try{return n()}finally{this.enabled&&lct.enterWith({span:i})}}_bind(t){if(typeof t!="function")return t;let r=this,n=r._active();return s(function(){return r._activate(n,null,()=>t.apply(this,arguments))},"bound")}_extractOptions(t){let{modelName:r,modelProvider:n,sessionId:i,mlApp:o,_decorator:a,...c}=t;return{mlApp:o,modelName:r,modelProvider:n,sessionId:i,_decorator:a,spanOptions:c}}};Ken.exports=fct});var Jen=y((G0l,Xen)=>{"use strict";var AUo=BVe(),xUo=HLr(),CUo=gqr(),OUo=I4(),dct=At(),{setStartupLogPluginManager:RUo}=rL(),Qen=Eqr(),IUo=x_e(),kUo=tBr(),NUo=kGr(),PUo=Fde(),{getEnvironmentVariable:DUo}=Dn(),{setBaggageItem:MUo,getBaggageItem:LUo,getAllBaggageItems:qUo,removeBaggageItem:BUo,removeAllBaggageItems:UUo}=TVe(),w2=class{static{s(this,"LazyModule")}constructor(t){this.provider=t}enable(...t){this.module=this.provider(),this.module.enable(...t)}disable(){this.module?.disable()}};function pct(e,t,r,n,...i){r?._isInServerlessEnvironment?.()===!1?FUo(e,t,n,...i):jUo(e,t,n,...i)}s(pct,"lazyProxy");function FUo(e,t,r,...n){let i=r();e[t]=new i(...n)}s(FUo,"defineEagerly");function jUo(e,t,r,...n){Reflect.defineProperty(e,t,{get(){let i=r(),o=new i(...n);return Reflect.defineProperty(e,t,{value:o,configurable:!0,enumerable:!0}),o},configurable:!0,enumerable:!0})}s(jUo,"defineLazily");var hct=class extends AUo{static{s(this,"Tracer")}constructor(){super(),this._initialized=!1,this._nomenclature=kUo,this._pluginManager=new NUo(this),this.dogstatsd=new PUo,this._tracingInitialized=!1,this._flare=new w2(()=>LGr()),this.setBaggageItem=MUo,this.getBaggageItem=LUo,this.getAllBaggageItems=qUo,this.removeBaggageItem=BUo,this.removeAllBaggageItems=UUo,this._modules={appsec:new w2(()=>R5r()),iast:new w2(()=>VQr()),llmobs:new w2(()=>OXr()),rewriter:new w2(()=>kit())}}init(t){if(this._initialized)return this;this._initialized=!0;try{let r=new CUo(t);if(r.crashtracking.enabled&&hot().start(r),IUo.start(r,this._pluginManager),r.dogstatsd&&pct(this,"dogstatsd",r,()=>hhe().CustomMetrics,r),r.spanLeakDebug>0){let n=uVe();r.spanLeakDebug===n.MODES.LOG?n.enableLogging():r.spanLeakDebug===n.MODES.GC_AND_LOG&&n.enableGarbageCollection(),n.startScrubber()}if(r.remoteConfig.enabled&&!r.isCiVisibility){let n=Lrt().enable(r,this._modules.appsec);n.setProductHandler("APM_TRACING",(i,o)=>{i==="unapply"?r.configure({},!0):r.configure(o.lib_config,!0),this._enableOrDisableTracing(r)}),n.setProductHandler("AGENT_CONFIG",(i,o)=>{o?.name?.startsWith("flare-log-level.")&&(i==="unapply"?this._flare.disable():o.config?.log_level&&(this._flare.enable(r),this._flare.module.prepare(o.config.log_level)))}),n.setProductHandler("AGENT_TASK",(i,o)=>{i==="unapply"||!o||o.task_type!=="tracer_flare"||!o.args||(this._flare.enable(r),this._flare.module.send(o.args))}),r.dynamicInstrumentation.enabled&&Qen.start(r,n)}if(r.profiling.enabled!=="false"){let{SSIHeuristics:n}=LXr(),i=new n(r);i.start();let o=null;r.profiling.enabled==="true"?this._profilerStarted=this._startProfiler(r):i.emitsTelemetry&&(o=BXr(),o.start(r)),i.heuristicsActive&&i.onTriggered(()=>{o&&o.stop(),this._startProfiler(r),i.onTriggered()}),this._profilerStarted||(this._profilerStarted=Promise.resolve(!1))}if(r.runtimeMetrics&&OUo.start(r),this._enableOrDisableTracing(r),this._modules.rewriter.enable(r),r.tracing&&r.isManualApiEnabled){let n=FXr();this._testApiManualPlugin=new n(this),this._testApiManualPlugin.configure({...r,enabled:!0},!1)}if(r.ciVisAgentlessLogSubmissionEnabled)if(DUo("DD_API_KEY")){let n=$Xr();new n(this).configure({...r,enabled:!0})}else dct.warn("DD_AGENTLESS_LOG_SUBMISSION_ENABLED is set, but DD_API_KEY is undefined, so no automatic log submission will be performed.");r.isTestDynamicInstrumentationEnabled&&YXe()(r)}catch(r){dct.error("Error initialising tracer",r)}return this}_startProfiler(t){try{return _en().start(t)}catch(r){dct.error("Error starting profiler. For troubleshooting tips, see <https://dtdg.co/nodejs-profiler-troubleshooting>",r)}}_enableOrDisableTracing(t){if(t.tracing!==!1){if(t.appsec.enabled&&this._modules.appsec.enable(t),t.llmobs.enabled&&this._modules.llmobs.enable(t),!this._tracingInitialized){let r=t.apmTracingEnabled===!1?Ren().configure(t):void 0;this._tracer=new xUo(t,r),this.dataStreamsCheckpointer=this._tracer.dataStreamsCheckpointer,pct(this,"appsec",t,()=>Gen(),this._tracer,t),pct(this,"llmobs",t,()=>Yen(),this._tracer,this._modules.llmobs,t),this._tracingInitialized=!0}t.iast.enabled&&this._modules.iast.enable(t,this._tracer)}else this._tracingInitialized&&(this._modules.appsec.disable(),this._modules.iast.disable(),this._modules.llmobs.disable());this._tracingInitialized&&(this._tracer.configure(t),this._pluginManager.configure(t),Qen.configure(t),RUo(this._pluginManager))}profilerStarted(){if(!this._profilerStarted)throw new Error("profilerStarted() must be called after init()");return this._profilerStarted}use(){return this._pluginManager.configurePlugin(...arguments),this}get TracerProvider(){return LVe()}};Xen.exports=hct});var etn=y((V0l,Zen)=>{"use strict";var{isFalse:$Uo}=bf(),{getEnvironmentVariable:mct}=Dn(),HUo=typeof jest<"u",GUo=mct("DD_TRACE_ENABLED")?$Uo(mct("DD_TRACE_ENABLED")):String(mct("OTEL_TRACES_EXPORTER")).toLowerCase()==="none";Zen.exports=GUo||HUo?BVe():Jen()});var d4=y((W0l,ttn)=>{"use strict";if(!global._ddtrace){let e=etn();Object.defineProperty(global,"_ddtrace",{value:new e,enumerable:!1,configurable:!0,writable:!0}),global._ddtrace.default=global._ddtrace,global._ddtrace.tracer=global._ddtrace}ttn.exports=global._ddtrace});var Qx=y((K0l,rtn)=>{"use strict";rtn.exports=d4()});var mtn=y((twl,_Fo)=>{_Fo.exports={acl:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},append:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},asking:{arity:1,flags:["fast"],keyStart:0,keyStop:0,step:0},auth:{arity:-2,flags:["noscript","loading","stale","fast","no_auth","allow_busy"],keyStart:0,keyStop:0,step:0},bgrewriteaof:{arity:1,flags:["admin","noscript","no_async_loading"],keyStart:0,keyStop:0,step:0},bgsave:{arity:-1,flags:["admin","noscript","no_async_loading"],keyStart:0,keyStop:0,step:0},bitcount:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},bitfield:{arity:-2,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},bitfield_ro:{arity:-2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},bitop:{arity:-4,flags:["write","denyoom"],keyStart:2,keyStop:-1,step:1},bitpos:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},blmove:{arity:6,flags:["write","denyoom","noscript","blocking"],keyStart:1,keyStop:2,step:1},blmpop:{arity:-5,flags:["write","blocking","movablekeys"],keyStart:0,keyStop:0,step:0},blpop:{arity:-3,flags:["write","noscript","blocking"],keyStart:1,keyStop:-2,step:1},brpop:{arity:-3,flags:["write","noscript","blocking"],keyStart:1,keyStop:-2,step:1},brpoplpush:{arity:4,flags:["write","denyoom","noscript","blocking"],keyStart:1,keyStop:2,step:1},bzmpop:{arity:-5,flags:["write","blocking","movablekeys"],keyStart:0,keyStop:0,step:0},bzpopmax:{arity:-3,flags:["write","noscript","blocking","fast"],keyStart:1,keyStop:-2,step:1},bzpopmin:{arity:-3,flags:["write","noscript","blocking","fast"],keyStart:1,keyStop:-2,step:1},client:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},cluster:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},command:{arity:-1,flags:["loading","stale"],keyStart:0,keyStop:0,step:0},config:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},copy:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:2,step:1},dbsize:{arity:1,flags:["readonly","fast"],keyStart:0,keyStop:0,step:0},debug:{arity:-2,flags:["admin","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},decr:{arity:2,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},decrby:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},del:{arity:-2,flags:["write"],keyStart:1,keyStop:-1,step:1},discard:{arity:1,flags:["noscript","loading","stale","fast","allow_busy"],keyStart:0,keyStop:0,step:0},dump:{arity:2,flags:["readonly"],keyStart:1,keyStop:1,step:1},echo:{arity:2,flags:["fast"],keyStart:0,keyStop:0,step:0},eval:{arity:-3,flags:["noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},eval_ro:{arity:-3,flags:["readonly","noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},evalsha:{arity:-3,flags:["noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},evalsha_ro:{arity:-3,flags:["readonly","noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},exec:{arity:1,flags:["noscript","loading","stale","skip_slowlog"],keyStart:0,keyStop:0,step:0},exists:{arity:-2,flags:["readonly","fast"],keyStart:1,keyStop:-1,step:1},expire:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},expireat:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},expiretime:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},failover:{arity:-1,flags:["admin","noscript","stale"],keyStart:0,keyStop:0,step:0},fcall:{arity:-3,flags:["noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},fcall_ro:{arity:-3,flags:["readonly","noscript","stale","skip_monitor","no_mandatory_keys","movablekeys"],keyStart:0,keyStop:0,step:0},flushall:{arity:-1,flags:["write"],keyStart:0,keyStop:0,step:0},flushdb:{arity:-1,flags:["write"],keyStart:0,keyStop:0,step:0},function:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},geoadd:{arity:-5,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},geodist:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},geohash:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},geopos:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},georadius:{arity:-6,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1},georadius_ro:{arity:-6,flags:["readonly"],keyStart:1,keyStop:1,step:1},georadiusbymember:{arity:-5,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1},georadiusbymember_ro:{arity:-5,flags:["readonly"],keyStart:1,keyStop:1,step:1},geosearch:{arity:-7,flags:["readonly"],keyStart:1,keyStop:1,step:1},geosearchstore:{arity:-8,flags:["write","denyoom"],keyStart:1,keyStop:2,step:1},get:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},getbit:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},getdel:{arity:2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},getex:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},getrange:{arity:4,flags:["readonly"],keyStart:1,keyStop:1,step:1},getset:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hdel:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},hello:{arity:-1,flags:["noscript","loading","stale","fast","no_auth","allow_busy"],keyStart:0,keyStop:0,step:0},hexists:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},hexpire:{arity:-6,flags:["write","fast"],keyStart:1,keyStop:1,step:1},hpexpire:{arity:-6,flags:["write","fast"],keyStart:1,keyStop:1,step:1},hget:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},hgetall:{arity:2,flags:["readonly"],keyStart:1,keyStop:1,step:1},hincrby:{arity:4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hincrbyfloat:{arity:4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hkeys:{arity:2,flags:["readonly"],keyStart:1,keyStop:1,step:1},hlen:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},hmget:{arity:-3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},hmset:{arity:-4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hrandfield:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},hscan:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},hset:{arity:-4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hsetnx:{arity:4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},hstrlen:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},hvals:{arity:2,flags:["readonly"],keyStart:1,keyStop:1,step:1},incr:{arity:2,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},incrby:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},incrbyfloat:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},info:{arity:-1,flags:["loading","stale"],keyStart:0,keyStop:0,step:0},keys:{arity:2,flags:["readonly"],keyStart:0,keyStop:0,step:0},lastsave:{arity:1,flags:["loading","stale","fast"],keyStart:0,keyStop:0,step:0},latency:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},lcs:{arity:-3,flags:["readonly"],keyStart:1,keyStop:2,step:1},lindex:{arity:3,flags:["readonly"],keyStart:1,keyStop:1,step:1},linsert:{arity:5,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},llen:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},lmove:{arity:5,flags:["write","denyoom"],keyStart:1,keyStop:2,step:1},lmpop:{arity:-4,flags:["write","movablekeys"],keyStart:0,keyStop:0,step:0},lolwut:{arity:-1,flags:["readonly","fast"],keyStart:0,keyStop:0,step:0},lpop:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},lpos:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},lpush:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},lpushx:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},lrange:{arity:4,flags:["readonly"],keyStart:1,keyStop:1,step:1},lrem:{arity:4,flags:["write"],keyStart:1,keyStop:1,step:1},lset:{arity:4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},ltrim:{arity:4,flags:["write"],keyStart:1,keyStop:1,step:1},memory:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},mget:{arity:-2,flags:["readonly","fast"],keyStart:1,keyStop:-1,step:1},migrate:{arity:-6,flags:["write","movablekeys"],keyStart:3,keyStop:3,step:1},module:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},monitor:{arity:1,flags:["admin","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},move:{arity:3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},mset:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:2},msetnx:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:2},multi:{arity:1,flags:["noscript","loading","stale","fast","allow_busy"],keyStart:0,keyStop:0,step:0},object:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},persist:{arity:2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},pexpire:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},pexpireat:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},pexpiretime:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},pfadd:{arity:-2,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},pfcount:{arity:-2,flags:["readonly"],keyStart:1,keyStop:-1,step:1},pfdebug:{arity:3,flags:["write","denyoom","admin"],keyStart:2,keyStop:2,step:1},pfmerge:{arity:-2,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:1},pfselftest:{arity:1,flags:["admin"],keyStart:0,keyStop:0,step:0},ping:{arity:-1,flags:["fast"],keyStart:0,keyStop:0,step:0},psetex:{arity:4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},psubscribe:{arity:-2,flags:["pubsub","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},psync:{arity:-3,flags:["admin","noscript","no_async_loading","no_multi"],keyStart:0,keyStop:0,step:0},pttl:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},publish:{arity:3,flags:["pubsub","loading","stale","fast"],keyStart:0,keyStop:0,step:0},pubsub:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},punsubscribe:{arity:-1,flags:["pubsub","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},quit:{arity:-1,flags:["noscript","loading","stale","fast","no_auth","allow_busy"],keyStart:0,keyStop:0,step:0},randomkey:{arity:1,flags:["readonly"],keyStart:0,keyStop:0,step:0},readonly:{arity:1,flags:["loading","stale","fast"],keyStart:0,keyStop:0,step:0},readwrite:{arity:1,flags:["loading","stale","fast"],keyStart:0,keyStop:0,step:0},rename:{arity:3,flags:["write"],keyStart:1,keyStop:2,step:1},renamenx:{arity:3,flags:["write","fast"],keyStart:1,keyStop:2,step:1},replconf:{arity:-1,flags:["admin","noscript","loading","stale","allow_busy"],keyStart:0,keyStop:0,step:0},replicaof:{arity:3,flags:["admin","noscript","stale","no_async_loading"],keyStart:0,keyStop:0,step:0},reset:{arity:1,flags:["noscript","loading","stale","fast","no_auth","allow_busy"],keyStart:0,keyStop:0,step:0},restore:{arity:-4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},"restore-asking":{arity:-4,flags:["write","denyoom","asking"],keyStart:1,keyStop:1,step:1},role:{arity:1,flags:["noscript","loading","stale","fast"],keyStart:0,keyStop:0,step:0},rpop:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},rpoplpush:{arity:3,flags:["write","denyoom"],keyStart:1,keyStop:2,step:1},rpush:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},rpushx:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},sadd:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},save:{arity:1,flags:["admin","noscript","no_async_loading","no_multi"],keyStart:0,keyStop:0,step:0},scan:{arity:-2,flags:["readonly"],keyStart:0,keyStop:0,step:0},scard:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},script:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},sdiff:{arity:-2,flags:["readonly"],keyStart:1,keyStop:-1,step:1},sdiffstore:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:1},select:{arity:2,flags:["loading","stale","fast"],keyStart:0,keyStop:0,step:0},set:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},setbit:{arity:4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},setex:{arity:4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},setnx:{arity:3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},setrange:{arity:4,flags:["write","denyoom"],keyStart:1,keyStop:1,step:1},shutdown:{arity:-1,flags:["admin","noscript","loading","stale","no_multi","allow_busy"],keyStart:0,keyStop:0,step:0},sinter:{arity:-2,flags:["readonly"],keyStart:1,keyStop:-1,step:1},sintercard:{arity:-3,flags:["readonly","movablekeys"],keyStart:0,keyStop:0,step:0},sinterstore:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:1},sismember:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},slaveof:{arity:3,flags:["admin","noscript","stale","no_async_loading"],keyStart:0,keyStop:0,step:0},slowlog:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},smembers:{arity:2,flags:["readonly"],keyStart:1,keyStop:1,step:1},smismember:{arity:-3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},smove:{arity:4,flags:["write","fast"],keyStart:1,keyStop:2,step:1},sort:{arity:-2,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1},sort_ro:{arity:-2,flags:["readonly","movablekeys"],keyStart:1,keyStop:1,step:1},spop:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},spublish:{arity:3,flags:["pubsub","loading","stale","fast"],keyStart:1,keyStop:1,step:1},srandmember:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},srem:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},sscan:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},ssubscribe:{arity:-2,flags:["pubsub","noscript","loading","stale"],keyStart:1,keyStop:-1,step:1},strlen:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},subscribe:{arity:-2,flags:["pubsub","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},substr:{arity:4,flags:["readonly"],keyStart:1,keyStop:1,step:1},sunion:{arity:-2,flags:["readonly"],keyStart:1,keyStop:-1,step:1},sunionstore:{arity:-3,flags:["write","denyoom"],keyStart:1,keyStop:-1,step:1},sunsubscribe:{arity:-1,flags:["pubsub","noscript","loading","stale"],keyStart:1,keyStop:-1,step:1},swapdb:{arity:3,flags:["write","fast"],keyStart:0,keyStop:0,step:0},sync:{arity:1,flags:["admin","noscript","no_async_loading","no_multi"],keyStart:0,keyStop:0,step:0},time:{arity:1,flags:["loading","stale","fast"],keyStart:0,keyStop:0,step:0},touch:{arity:-2,flags:["readonly","fast"],keyStart:1,keyStop:-1,step:1},ttl:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},type:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},unlink:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:-1,step:1},unsubscribe:{arity:-1,flags:["pubsub","noscript","loading","stale"],keyStart:0,keyStop:0,step:0},unwatch:{arity:1,flags:["noscript","loading","stale","fast","allow_busy"],keyStart:0,keyStop:0,step:0},wait:{arity:3,flags:["noscript"],keyStart:0,keyStop:0,step:0},watch:{arity:-2,flags:["noscript","loading","stale","fast","allow_busy"],keyStart:1,keyStop:-1,step:1},xack:{arity:-4,flags:["write","fast"],keyStart:1,keyStop:1,step:1},xadd:{arity:-5,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},xautoclaim:{arity:-6,flags:["write","fast"],keyStart:1,keyStop:1,step:1},xclaim:{arity:-6,flags:["write","fast"],keyStart:1,keyStop:1,step:1},xdel:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},xgroup:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},xinfo:{arity:-2,flags:[],keyStart:0,keyStop:0,step:0},xlen:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},xpending:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},xrange:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},xread:{arity:-4,flags:["readonly","blocking","movablekeys"],keyStart:0,keyStop:0,step:0},xreadgroup:{arity:-7,flags:["write","blocking","movablekeys"],keyStart:0,keyStop:0,step:0},xrevrange:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},xsetid:{arity:-3,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},xtrim:{arity:-4,flags:["write"],keyStart:1,keyStop:1,step:1},zadd:{arity:-4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},zcard:{arity:2,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zcount:{arity:4,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zdiff:{arity:-3,flags:["readonly","movablekeys"],keyStart:0,keyStop:0,step:0},zdiffstore:{arity:-4,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1},zincrby:{arity:4,flags:["write","denyoom","fast"],keyStart:1,keyStop:1,step:1},zinter:{arity:-3,flags:["readonly","movablekeys"],keyStart:0,keyStop:0,step:0},zintercard:{arity:-3,flags:["readonly","movablekeys"],keyStart:0,keyStop:0,step:0},zinterstore:{arity:-4,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1},zlexcount:{arity:4,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zmpop:{arity:-4,flags:["write","movablekeys"],keyStart:0,keyStop:0,step:0},zmscore:{arity:-3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zpopmax:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},zpopmin:{arity:-2,flags:["write","fast"],keyStart:1,keyStop:1,step:1},zrandmember:{arity:-2,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrange:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrangebylex:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrangebyscore:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrangestore:{arity:-5,flags:["write","denyoom"],keyStart:1,keyStop:2,step:1},zrank:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zrem:{arity:-3,flags:["write","fast"],keyStart:1,keyStop:1,step:1},zremrangebylex:{arity:4,flags:["write"],keyStart:1,keyStop:1,step:1},zremrangebyrank:{arity:4,flags:["write"],keyStart:1,keyStop:1,step:1},zremrangebyscore:{arity:4,flags:["write"],keyStart:1,keyStop:1,step:1},zrevrange:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrevrangebylex:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrevrangebyscore:{arity:-4,flags:["readonly"],keyStart:1,keyStop:1,step:1},zrevrank:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zscan:{arity:-3,flags:["readonly"],keyStart:1,keyStop:1,step:1},zscore:{arity:3,flags:["readonly","fast"],keyStart:1,keyStop:1,step:1},zunion:{arity:-3,flags:["readonly","movablekeys"],keyStart:0,keyStop:0,step:0},zunionstore:{arity:-4,flags:["write","denyoom","movablekeys"],keyStart:1,keyStop:1,step:1}}});var x2=y(dy=>{"use strict";var yFo=dy&&dy.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dy,"__esModule",{value:!0});dy.getKeyIndexes=dy.hasFlag=dy.exists=dy.list=void 0;var WEe=yFo(mtn());dy.list=Object.keys(WEe.default);var Cct={};dy.list.forEach(e=>{Cct[e]=WEe.default[e].flags.reduce(function(t,r){return t[r]=!0,t},{})});function bFo(e){return!!WEe.default[e]}s(bFo,"exists");dy.exists=bFo;function EFo(e,t){if(!Cct[e])throw new Error("Unknown command "+e);return!!Cct[e][t]}s(EFo,"hasFlag");dy.hasFlag=EFo;function vFo(e,t,r){let n=WEe.default[e];if(!n)throw new Error("Unknown command "+e);if(!Array.isArray(t))throw new Error("Expect args to be an array");let i=[],o=!!(r&&r.parseExternalKey),a=s((u,l)=>{let f=[],d=Number(u[l]);for(let p=0;p<d;p++)f.push(p+l+1);return f},"takeDynamicKeys"),c=s((u,l,f)=>{for(let d=l;d<u.length-1;d+=1)if(String(u[d]).toLowerCase()===f.toLowerCase())return d+1;return null},"takeKeyAfterToken");switch(e){case"zunionstore":case"zinterstore":case"zdiffstore":i.push(0,...a(t,1));break;case"eval":case"evalsha":case"eval_ro":case"evalsha_ro":case"fcall":case"fcall_ro":case"blmpop":case"bzmpop":i.push(...a(t,1));break;case"sintercard":case"lmpop":case"zunion":case"zinter":case"zmpop":case"zintercard":case"zdiff":{i.push(...a(t,0));break}case"georadius":{i.push(0);let u=c(t,5,"STORE");u&&i.push(u);let l=c(t,5,"STOREDIST");l&&i.push(l);break}case"georadiusbymember":{i.push(0);let u=c(t,4,"STORE");u&&i.push(u);let l=c(t,4,"STOREDIST");l&&i.push(l);break}case"sort":case"sort_ro":i.push(0);for(let u=1;u<t.length-1;u++){let l=t[u];if(typeof l!="string")continue;let f=l.toUpperCase();f==="GET"?(u+=1,l=t[u],l!=="#"&&(o?i.push([u,gtn(l)]):i.push(u))):f==="BY"?(u+=1,o?i.push([u,gtn(t[u])]):i.push(u)):f==="STORE"&&(u+=1,i.push(u))}break;case"migrate":if(t[2]==="")for(let u=5;u<t.length-1;u++){let l=t[u];if(typeof l=="string"&&l.toUpperCase()==="KEYS"){for(let f=u+1;f<t.length;f++)i.push(f);break}}else i.push(2);break;case"xreadgroup":case"xread":for(let u=e==="xread"?0:3;u<t.length-1;u++)if(String(t[u]).toUpperCase()==="STREAMS"){for(let l=u+1;l<=u+(t.length-1-u)/2;l++)i.push(l);break}break;default:if(n.step>0){let u=n.keyStart-1,l=n.keyStop>0?n.keyStop:t.length+n.keyStop+1;for(let f=u;f<l;f+=n.step)i.push(f)}break}return i}s(vFo,"getKeyIndexes");dy.getKeyIndexes=vFo;function gtn(e){typeof e!="string"&&(e=String(e));let t=e.indexOf("->");return t===-1?e.length:t}s(gtn,"getExternalKeyNameLength")});var _tn=y(g1=>{"use strict";Object.defineProperty(g1,"__esModule",{value:!0});g1.tryCatch=g1.errorObj=void 0;g1.errorObj={e:{}};var Oct;function SFo(e,t){try{let r=Oct;return Oct=null,r.apply(this,arguments)}catch(r){return g1.errorObj.e=r,g1.errorObj}}s(SFo,"tryCatcher");function wFo(e){return Oct=e,SFo}s(wFo,"tryCatch");g1.tryCatch=wFo});var _1=y(Rct=>{"use strict";Object.defineProperty(Rct,"__esModule",{value:!0});var V$=_tn();function ytn(e){setTimeout(function(){throw e},0)}s(ytn,"throwLater");function TFo(e,t,r){return typeof t=="function"&&e.then(n=>{let i;r!==void 0&&Object(r).spread&&Array.isArray(n)?i=V$.tryCatch(t).apply(void 0,[null].concat(n)):i=n===void 0?V$.tryCatch(t)(null):V$.tryCatch(t)(null,n),i===V$.errorObj&&ytn(i.e)},n=>{if(!n){let o=new Error(n+"");Object.assign(o,{cause:n}),n=o}let i=V$.tryCatch(t)(n);i===V$.errorObj&&ytn(i.e)}),e}s(TFo,"asCallback");Rct.default=TFo});var vtn=y((cwl,Etn)=>{"use strict";var btn=require("assert"),IZ=require("util");function W$(e){Object.defineProperty(this,"message",{value:e||"",configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}s(W$,"RedisError");IZ.inherits(W$,Error);Object.defineProperty(W$.prototype,"name",{value:"RedisError",configurable:!0,writable:!0});function Ict(e,t,r){btn(t),btn.strictEqual(typeof r,"number"),Object.defineProperty(this,"message",{value:e||"",configurable:!0,writable:!0});let n=Error.stackTraceLimit;Error.stackTraceLimit=2,Error.captureStackTrace(this,this.constructor),Error.stackTraceLimit=n,this.offset=r,this.buffer=t}s(Ict,"ParserError");IZ.inherits(Ict,W$);Object.defineProperty(Ict.prototype,"name",{value:"ParserError",configurable:!0,writable:!0});function kct(e){Object.defineProperty(this,"message",{value:e||"",configurable:!0,writable:!0});let t=Error.stackTraceLimit;Error.stackTraceLimit=2,Error.captureStackTrace(this,this.constructor),Error.stackTraceLimit=t}s(kct,"ReplyError");IZ.inherits(kct,W$);Object.defineProperty(kct.prototype,"name",{value:"ReplyError",configurable:!0,writable:!0});function KEe(e){Object.defineProperty(this,"message",{value:e||"",configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}s(KEe,"AbortError");IZ.inherits(KEe,W$);Object.defineProperty(KEe.prototype,"name",{value:"AbortError",configurable:!0,writable:!0});function Nct(e){Object.defineProperty(this,"message",{value:e||"",configurable:!0,writable:!0}),Error.captureStackTrace(this,this.constructor)}s(Nct,"InterruptError");IZ.inherits(Nct,KEe);Object.defineProperty(Nct.prototype,"name",{value:"InterruptError",configurable:!0,writable:!0});Etn.exports={RedisError:W$,ParserError:Ict,ReplyError:kct,AbortError:KEe,InterruptError:Nct}});var Ttn=y((lwl,wtn)=>{"use strict";var Stn=require("assert"),K$=class extends Error{static{s(this,"RedisError")}get name(){return this.constructor.name}},Pct=class extends K${static{s(this,"ParserError")}constructor(t,r,n){Stn(r),Stn.strictEqual(typeof n,"number");let i=Error.stackTraceLimit;Error.stackTraceLimit=2,super(t),Error.stackTraceLimit=i,this.offset=n,this.buffer=r}get name(){return this.constructor.name}},Dct=class extends K${static{s(this,"ReplyError")}constructor(t){let r=Error.stackTraceLimit;Error.stackTraceLimit=2,super(t),Error.stackTraceLimit=r}get name(){return this.constructor.name}},YEe=class extends K${static{s(this,"AbortError")}get name(){return this.constructor.name}},Mct=class extends YEe{static{s(this,"InterruptError")}get name(){return this.constructor.name}};wtn.exports={RedisError:K$,ParserError:Pct,ReplyError:Dct,AbortError:YEe,InterruptError:Mct}});var C2=y((dwl,Atn)=>{"use strict";var AFo=process.version.charCodeAt(1)<55&&process.version.charCodeAt(2)===46?vtn():Ttn();Atn.exports=AFo});var QEe=y((pwl,Lct)=>{"use strict";var xtn=[0,4129,8258,12387,16516,20645,24774,28903,33032,37161,41290,45419,49548,53677,57806,61935,4657,528,12915,8786,21173,17044,29431,25302,37689,33560,45947,41818,54205,50076,62463,58334,9314,13379,1056,5121,25830,29895,17572,21637,42346,46411,34088,38153,58862,62927,50604,54669,13907,9842,5649,1584,30423,26358,22165,18100,46939,42874,38681,34616,63455,59390,55197,51132,18628,22757,26758,30887,2112,6241,10242,14371,51660,55789,59790,63919,35144,39273,43274,47403,23285,19156,31415,27286,6769,2640,14899,10770,56317,52188,64447,60318,39801,35672,47931,43802,27814,31879,19684,23749,11298,15363,3168,7233,60846,64911,52716,56781,44330,48395,36200,40265,32407,28342,24277,20212,15891,11826,7761,3696,65439,61374,57309,53244,48923,44858,40793,36728,37256,33193,45514,41451,53516,49453,61774,57711,4224,161,12482,8419,20484,16421,28742,24679,33721,37784,41979,46042,49981,54044,58239,62302,689,4752,8947,13010,16949,21012,25207,29270,46570,42443,38312,34185,62830,58703,54572,50445,13538,9411,5280,1153,29798,25671,21540,17413,42971,47098,34713,38840,59231,63358,50973,55100,9939,14066,1681,5808,26199,30326,17941,22068,55628,51565,63758,59695,39368,35305,47498,43435,22596,18533,30726,26663,6336,2273,14466,10403,52093,56156,60223,64286,35833,39896,43963,48026,19061,23124,27191,31254,2801,6864,10931,14994,64814,60687,56684,52557,48554,44427,40424,36297,31782,27655,23652,19525,15522,11395,7392,3265,61215,65342,53085,57212,44955,49082,36825,40952,28183,32310,20053,24180,11923,16050,3793,7920],xFo=s(function(t){for(var r,n=0,i=0,o=[],a=t.length;n<a;n++)r=t.charCodeAt(n),r<128?o[i++]=r:r<2048?(o[i++]=r>>6|192,o[i++]=r&63|128):(r&64512)===55296&&n+1<t.length&&(t.charCodeAt(n+1)&64512)===56320?(r=65536+((r&1023)<<10)+(t.charCodeAt(++n)&1023),o[i++]=r>>18|240,o[i++]=r>>12&63|128,o[i++]=r>>6&63|128,o[i++]=r&63|128):(o[i++]=r>>12|224,o[i++]=r>>6&63|128,o[i++]=r&63|128);return o},"toUTF8Array"),Ctn=Lct.exports=s(function(t){for(var r,n=0,i=-1,o=0,a=0,c=typeof t=="string"?xFo(t):t,u=c.length;n<u;){if(r=c[n++],i===-1)r===123&&(i=n);else if(r!==125)a=xtn[(r^a>>8)&255]^a<<8;else if(n-1!==i)return a&16383;o=xtn[(r^o>>8)&255]^o<<8}return o&16383},"generate");Lct.exports.generateMulti=s(function(t){for(var r=1,n=t.length,i=Ctn(t[0]);r<n;)if(Ctn(t[r++])!==i)return-1;return i},"generateMulti")});var Mtn=y((mwl,Dtn)=>{"use strict";var Rtn=9007199254740991,CFo="[object Arguments]",OFo="[object Function]",RFo="[object GeneratorFunction]",IFo=/^(?:0|[1-9]\d*)$/;function Itn(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}s(Itn,"apply");function kFo(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}s(kFo,"baseTimes");var kZ=Object.prototype,NZ=kZ.hasOwnProperty,ktn=kZ.toString,NFo=kZ.propertyIsEnumerable,Otn=Math.max;function PFo(e,t){var r=HFo(e)||$Fo(e)?kFo(e.length,String):[],n=r.length,i=!!n;for(var o in e)(t||NZ.call(e,o))&&!(i&&(o=="length"||Ptn(o,n)))&&r.push(o);return r}s(PFo,"arrayLikeKeys");function DFo(e,t,r,n){return e===void 0||qct(e,kZ[r])&&!NZ.call(n,r)?t:e}s(DFo,"assignInDefaults");function MFo(e,t,r){var n=e[t];(!(NZ.call(e,t)&&qct(n,r))||r===void 0&&!(t in e))&&(e[t]=r)}s(MFo,"assignValue");function LFo(e){if(!Uct(e))return jFo(e);var t=FFo(e),r=[];for(var n in e)n=="constructor"&&(t||!NZ.call(e,n))||r.push(n);return r}s(LFo,"baseKeysIn");function Ntn(e,t){return t=Otn(t===void 0?e.length-1:t,0),function(){for(var r=arguments,n=-1,i=Otn(r.length-t,0),o=Array(i);++n<i;)o[n]=r[t+n];n=-1;for(var a=Array(t+1);++n<t;)a[n]=r[n];return a[t]=o,Itn(e,this,a)}}s(Ntn,"baseRest");function qFo(e,t,r,n){r||(r={});for(var i=-1,o=t.length;++i<o;){var a=t[i],c=n?n(r[a],e[a],a,r,e):void 0;MFo(r,a,c===void 0?e[a]:c)}return r}s(qFo,"copyObject");function BFo(e){return Ntn(function(t,r){var n=-1,i=r.length,o=i>1?r[i-1]:void 0,a=i>2?r[2]:void 0;for(o=e.length>3&&typeof o=="function"?(i--,o):void 0,a&&UFo(r[0],r[1],a)&&(o=i<3?void 0:o,i=1),t=Object(t);++n<i;){var c=r[n];c&&e(t,c,n,o)}return t})}s(BFo,"createAssigner");function Ptn(e,t){return t=t??Rtn,!!t&&(typeof e=="number"||IFo.test(e))&&e>-1&&e%1==0&&e<t}s(Ptn,"isIndex");function UFo(e,t,r){if(!Uct(r))return!1;var n=typeof t;return(n=="number"?Bct(r)&&Ptn(t,r.length):n=="string"&&t in r)?qct(r[t],e):!1}s(UFo,"isIterateeCall");function FFo(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||kZ;return e===r}s(FFo,"isPrototype");function jFo(e){var t=[];if(e!=null)for(var r in Object(e))t.push(r);return t}s(jFo,"nativeKeysIn");function qct(e,t){return e===t||e!==e&&t!==t}s(qct,"eq");function $Fo(e){return GFo(e)&&NZ.call(e,"callee")&&(!NFo.call(e,"callee")||ktn.call(e)==CFo)}s($Fo,"isArguments");var HFo=Array.isArray;function Bct(e){return e!=null&&VFo(e.length)&&!zFo(e)}s(Bct,"isArrayLike");function GFo(e){return WFo(e)&&Bct(e)}s(GFo,"isArrayLikeObject");function zFo(e){var t=Uct(e)?ktn.call(e):"";return t==OFo||t==RFo}s(zFo,"isFunction");function VFo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=Rtn}s(VFo,"isLength");function Uct(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}s(Uct,"isObject");function WFo(e){return!!e&&typeof e=="object"}s(WFo,"isObjectLike");var KFo=BFo(function(e,t,r,n){qFo(t,QFo(t),e,n)}),YFo=Ntn(function(e){return e.push(void 0,DFo),Itn(KFo,void 0,e)});function QFo(e){return Bct(e)?PFo(e,!0):LFo(e)}s(QFo,"keysIn");Dtn.exports=YFo});var Btn=y((_wl,qtn)=>{"use strict";var XFo=9007199254740991,JFo="[object Arguments]",ZFo="[object Function]",ejo="[object GeneratorFunction]",Fct=Object.prototype,tjo=Fct.hasOwnProperty,Ltn=Fct.toString,rjo=Fct.propertyIsEnumerable;function njo(e){return sjo(e)&&tjo.call(e,"callee")&&(!rjo.call(e,"callee")||Ltn.call(e)==JFo)}s(njo,"isArguments");function ijo(e){return e!=null&&ajo(e.length)&&!ojo(e)}s(ijo,"isArrayLike");function sjo(e){return ujo(e)&&ijo(e)}s(sjo,"isArrayLikeObject");function ojo(e){var t=cjo(e)?Ltn.call(e):"";return t==ZFo||t==ejo}s(ojo,"isFunction");function ajo(e){return typeof e=="number"&&e>-1&&e%1==0&&e<=XFo}s(ajo,"isLength");function cjo(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}s(cjo,"isObject");function ujo(e){return!!e&&typeof e=="object"}s(ujo,"isObjectLike");qtn.exports=njo});var XEe=y(y1=>{"use strict";Object.defineProperty(y1,"__esModule",{value:!0});y1.isArguments=y1.defaults=y1.noop=void 0;var ljo=Mtn();y1.defaults=ljo;var fjo=Btn();y1.isArguments=fjo;function djo(){}s(djo,"noop");y1.noop=djo});var jtn=y(SC=>{"use strict";Object.defineProperty(SC,"__esModule",{value:!0});SC.genRedactedString=SC.getStringValue=SC.MAX_ARGUMENT_LENGTH=void 0;var pjo=kM(),jct=200;SC.MAX_ARGUMENT_LENGTH=jct;var hjo="ioredis";function Utn(e){if(e!==null)switch(typeof e){case"boolean":return;case"number":return;case"object":if(Buffer.isBuffer(e))return e.toString("hex");if(Array.isArray(e))return e.join(",");try{return JSON.stringify(e)}catch{return}case"string":return e}}s(Utn,"getStringValue");SC.getStringValue=Utn;function Ftn(e,t){let{length:r}=e;return r<=t?e:e.slice(0,t)+' ... <REDACTED full-length="'+r+'">'}s(Ftn,"genRedactedString");SC.genRedactedString=Ftn;function mjo(e){let t=(0,pjo.default)(`${hjo}:${e}`);function r(...n){if(t.enabled){for(let i=1;i<n.length;i++){let o=Utn(n[i]);typeof o=="string"&&o.length>jct&&(n[i]=Ftn(o,jct))}return t.apply(null,n)}}return s(r,"wrappedDebug"),Object.defineProperties(r,{namespace:{get(){return t.namespace}},enabled:{get(){return t.enabled}},destroy:{get(){return t.destroy}},log:{get(){return t.log},set(n){t.log=n}}}),r}s(mjo,"genDebugFunction");SC.default=mjo});var Htn=y($ct=>{"use strict";Object.defineProperty($ct,"__esModule",{value:!0});var $tn=`-----BEGIN CERTIFICATE-----
218
218
  MIIDTzCCAjegAwIBAgIJAKSVpiDswLcwMA0GCSqGSIb3DQEBBQUAMD4xFjAUBgNV
219
219
  BAoMDUdhcmFudGlhIERhdGExJDAiBgNVBAMMG1NTTCBDZXJ0aWZpY2F0aW9uIEF1
220
220
  dGhvcml0eTAeFw0xMzEwMDExMjE0NTVaFw0yMzA5MjkxMjE0NTVaMD4xFjAUBgNV
@@ -1399,7 +1399,7 @@ $1`)};$ce.parseAttributes=s(function(t){return Object.keys(t).map(function(r){va
1399
1399
  `}s(QUe,"frontendWrapJS");var g3i=at(S6t()),_3i=at(KW()),y3i=at(w6t()),b3i=at(C6t()),E3i=at(A6t()),v3i=at(r6t()),S3i=at(NUe()),w3i=at(T6t()),T3i=at(M6t());var uCu={math:g3i.default,array:_3i.default,number:y3i.default,url:b3i.default,string:E3i.default,comparison:v3i.default,object:S3i.default,regex:w3i.default,uuid:T3i.default},A3i=["sortBy"],lCu={date:WUe,duration:eue},zR;function rue(){if(zR)return zR;zR={};for(let e of Object.values(uCu))for(let[t,r]of Object.entries(e))zR[t]=(...n)=>r(...n,{});zR={...zR,...lCu};for(let e of A3i)delete zR[e];return Object.freeze(zR),zR}s(rue,"getJsHelperList");var XUe=s(e=>`(function(){
1400
1400
  ${e}
1401
1401
  })();`,"iifeWrapper");var eK=class e extends Error{constructor(){super(e.message);this.code=e.code}static{s(this,"JsTimeoutError")}static{this.message="Timed out while executing JS"}static{this.code="JS_TIMEOUT_ERROR"}},Nj=class e extends Error{constructor(r){super(`error while running user-supplied JavaScript: ${r.toString()}`);this.userScriptError=r;this.code=e.code}static{s(this,"UserScriptError")}static{this.code="USER_SCRIPT_ERROR"}};var x3i=at(Ske());var JUe,c$t=s(e=>JUe=e,"setJSRunner"),C3i=s(()=>{JUe=void 0},"removeJSRunner"),a$t,fCu=s(e=>a$t=e,"setOnErrorLog"),dCu=s(e=>{if(!e||typeof e!="string")return e;let t=/\[+(.+)]+/,r=e.match(t);return r&&r[1]?r[1]:e},"removeSquareBrackets"),pCu=s(e=>e==="snippets"||e==="helpers"||e.startsWith("snippets.")||e.startsWith("helpers."),"isReservedKey"),hCu=s((e,t)=>{if(pCu(e))return;let r=/^(["'`]).*\1$/,n=t;return r.test(e)?e.substring(1,e.length-1):(e.split(".").forEach(i=>{if(n==null||typeof n!="object")return null;n=n[dCu(i)]}),n)},"getContextValue");function O3i(handlebars,context){if(!d3i()||!JUe)throw new Error("JS disabled in environment.");try{let js=XUe(o$t(handlebars)),snippetMap={},snippetCache={};for(let e of context.snippets||[])snippetMap[e.name]=e.code;let clonedContext;tue()?clonedContext=context:clonedContext=(0,x3i.default)(context);let sandboxContext={$:e=>hCu(e,clonedContext),helpers:rue(),snippets:new Proxy({},{get:function(_,name){return name in snippetCache||(snippetCache[name]=eval(XUe(snippetMap[name]))),snippetCache[name]}})},logs=[];if(!tue()){let e=QUe(js).split(js)[0].split(`
1402
- `).length,t=s(r=>(...n)=>{kj()||console[r](...n),n.forEach((o,a)=>{typeof o=="object"&&(n[a]=JSON.stringify(o))});let i=new Error().stack?.match(/<anonymous>:(\d+):\d+/)?.[1];logs.push({log:n,line:i?parseInt(i)-e:void 0,type:r})},"buildLogResponse");sandboxContext.console={log:t("log"),info:t("info"),debug:t("debug"),warn:t("warn"),error:t("error"),table:t("table")}}let res={data:JUe(js,sandboxContext),logs};return`{{${ZW} js_result-${JSON.stringify(res)}}}`}catch(e){a$t&&a$t(e);let{noThrow:t=!0}=context.__opts||{};if(e.code==="ERR_SCRIPT_EXECUTION_TIMEOUT")return"Timed out while executing JS";if(e.code==="JS_REQUEST_TIMEOUT_ERROR")return e.message;if(e.code===eK.code)return eK.message;if(e.code===Nj.code){if(t)return e.userScriptError.toString();throw e}if(e.name==="SyntaxError"){if(t)return e.toString();throw e}return"Error while executing JS"}}s(O3i,"processJS");var mCu={"<":"&lt;",">":"&gt;"};function gCu(e){return e==null||typeof e!="object"?!1:e.toString()==="[object Object]"||e.length>0&&typeof e[0]=="object"}s(gCu,"isObject");var _Cu=[new FR(Ij.OBJECT,e=>new ZUe.default.SafeString(JSON.stringify(e))),new FR(Ij.JS,O3i,!1),new FR(Ij.DECODE_ID,e=>{if(!e)return[];let t=typeof e=="string"?e:e._id,r=decodeURIComponent(t).replace(/'/g,'"');try{let n=JSON.parse(r);return Array.isArray(n)?n:[n]}catch{return[e]}}),new FR(Ij.ALL,(e,t)=>{let{__opts:r}=t;if(gCu(e))return new ZUe.default.SafeString(JSON.stringify(e));if(r&&r.onlyFound&&e==null)return r.input;if(e==null||typeof e!="string")return e??"";e&&e.string&&(e=e.string);let n=e;return r&&r.escapeNewlines&&(n=e.replace(/\n/g,"\\n")),n=new ZUe.default.SafeString(n.replace(/&amp;/g,"&")),n==null||typeof n!="string"?n:n.replace(/[<>]/g,i=>mCu[i]||i)}),new FR(Ij.LITERAL,e=>{if(e===void 0)return"";let t=typeof e,r=t==="object"?JSON.stringify(e):e;return`{{${ZW} ${t}-${r}}}`})];function R3i(){return Object.values(Ij).concat(KUe,n$t)}s(R3i,"HelperNames");function u$t(e){for(let t of _Cu)t.register(e)}s(u$t,"registerMinimum");function I3i(e){u$t(e),l3i(e)}s(I3i,"registerAll");var k3i=["#","else","/"];var tK=class{static{s(this,"Preprocessor")}constructor(t,r){this.name=t,this.fn=r}process(t,r,n){let i=this.fn(r,n),o=t.indexOf(r);return s$t(t,o,r.length,i)}},N3i=[new tK("swap-to-dot-notation",e=>{let t=e.indexOf("["),r=0;for(;t!==-1;){h3i(e.charAt(t-1))&&(e=s$t(e,t+r,1,".[")),r=t+1;let n=e.substring(r+1).indexOf("[");t=n>0?r+1+n:-1}return e}),new tK("fix-functions",e=>{for(let t of k3i){let r=`{ ${t}`,n=`{${t}`;e=e.replace(new RegExp(r,"g"),n)}return e}),new tK("normalize-spaces",e=>e.replace(/{{(\s{2,})/g,"{{ ")),new tK("finalise",(e,t)=>{let n=!t?.noHelpers,i=e.slice(2,e.length-2);i.charAt(0)===" "&&(i=i.slice(1)),i.charAt(i.length-1)===" "&&(i=i.slice(0,i.length-1));let o=i.split(" ")[0];for(let c of k3i)if(o.includes(c))return e;let a=o.trim().toLowerCase();return n&&!t?.disabledHelpers?.includes(a)&&R3i().some(c=>a===c.toLowerCase())&&(i=`(${i})`),`{{ all ${i} }}`})];var l$t=class{static{s(this,"Postprocessor")}constructor(t,r){this.name=t,this.fn=r}process(t){return this.fn(t)}},f$t=[new l$t("convert-literals",e=>{if(typeof e!="string"||!e.includes(ZW))return{result:e};let t=e.indexOf("-"),r=e.substring(12,t),n=e.substring(t+1,e.length-2);switch(r){case"string":return{result:n};case"number":return{result:parseFloat(n)};case"boolean":return{result:n==="true"};case"object":return{result:JSON.parse(n)};case"js_result":{let i=JSON.parse(n);return{result:i.data,logs:i.logs}}}return{result:n}})];function d$t(e,t,r){let n=[];for(let i of t){if(typeof e!="string")break;let o=new RegExp(YUe),a=e.match(o);if(a!=null)for(let c of a){let u=i.process(e,c,r||{});typeof u=="object"?("logs"in u&&u.logs&&(n=n.concat(u.logs)),e=u.result):e=u}}return{result:e,logs:n}}s(d$t,"process");function P3i(e,t){let r=N3i;return t.noFinalise&&(r=r.filter(n=>n.name!=="finalise")),d$t(e,r,t).result}s(P3i,"preprocess");function D3i(e){return d$t(e,f$t).result}s(D3i,"postprocess");function M3i(e){return d$t(e,f$t)}s(M3i,"postprocessWithLogs");var m$t=(0,h$t.create)();I3i(m$t);var ECu=Object.keys(m$t.helpers),B3i=(0,h$t.create)();u$t(B3i);var vCu={noHelpers:!1,cacheTemplates:!1,noEscaping:!1,escapeNewlines:!1,noFinalise:!1};function SCu(e){return e?Object.keys(e).filter(r=>ECu.includes(r)):[]}s(SCu,"findOverlappingHelpers");var p$t={};function wCu(e,t,r){t={...vCu,...t};let n=!t?.noHelpers,i=`${e}-${JSON.stringify(t)}`;if(t.cacheTemplates&&p$t[i])return p$t[i];let o=n?SCu(r):[];if(e=P3i(e,{...t,disabledHelpers:o}),r&&n&&o.length>0)for(let u of F3i(e))e=e.replace(u,m3i(u,o,"./"));t.noEscaping&&(e=ACu(e));let c=(t.noHelpers?B3i:m$t).compile(e,{strict:!1});return p$t[i]=c,c}s(wCu,"createTemplate");function TCu(e,t,r){let n=e;if(typeof e!="string")throw new Error("Cannot process non-string types.");function i(o){let a=wCu(o,r,t),c=Math.floor(Date.now()/1e3)*1e3,u=a({now:new Date(c).toISOString(),__opts:{...r,input:o},...t});return r?.logging?M3i(u):D3i(u)}s(i,"process");try{if(r&&r.onlyFound){let o=[],a=F3i(e);for(let c of a){let u=i(c);typeof u=="object"&&"result"in u?(o=o.concat(u.logs||[]),e=e.replace(c,u.result)):e=e.replace(c,u)}return r?.logging?{result:e,logs:o}:e}else return i(e)}catch(o){let{noThrow:a=!0}=r||{};if(a)return n;throw o}}s(TCu,"processStringSyncInternal");function U3i(e,t,r){return TCu(e,t,{...r,logging:!1})}s(U3i,"processStringSync");function ACu(e){let t=p3i(e);if(t==null)return e;let r=[...new Set(t)];for(let n of r){let i=new RegExp(`${n}(?!})`,"g");e=e.replace(i,`{${n}}`)}return e}s(ACu,"disableEscaping");function F3i(e){if(!e||typeof e!="string")return[];let t=new RegExp(i$t),r=e.match(t);return r??[]}s(F3i,"findHBSBlocks");function xCu(){let e=kj()?q3i.default:L3i.default;c$t((t,r)=>{e.createContext(r);let n=QUe(t),i=e.runInNewContext(n,r);if(i.error)throw new Nj(i.error);return i.result})}s(xCu,"browserJSSetup");function CCu(){tue()?C3i():xCu()}s(CCu,"defaultJSSetup");CCu();var OCu=require("download"),RCu=require("tar"),ICu=["package.json.hbs","schema.json.hbs","README.md.hbs"];async function kCu(e){let t=await(0,j3i.default)("https://api.github.com/repos/budibase/budibase-skeleton/releases/latest");if(t.status>=300)throw new Error("Failed to retrieve skeleton metadata");let r=await t.json();for(let n of r.assets)if(n.name&&n.name.includes(e))return n.browser_download_url;throw new Error("No skeleton found in latest release.")}s(kCu,"getSkeletonUrl");async function H3i(e,t){let r=await kCu(e),n=(0,eFe.join)($3i.default.tmpdir(),"skeleton.tar.gz");Pj.default.writeFileSync(n,await OCu(r)),Pj.default.mkdirSync(t),await RCu.extract({file:n,C:t}),Pj.default.rmSync(n)}s(H3i,"getSkeleton");async function G3i(e,t,r,n){for(let i of ICu){let o=(0,eFe.join)(t,i),a=(0,eFe.join)(t,i.substring(0,i.length-4)),c=Pj.default.readFileSync(o,"utf8");if(!c)continue;let u=U3i(c,{name:t,description:r,version:n});Pj.default.writeFileSync(a,u),Pj.default.rmSync(o)}}s(G3i,"fleshOutSkeleton");ZD();var Dj=at(require("fs"));Ir();var V3i=at(require("util")),W3i=at(require("child_process"));var NCu=V3i.default.promisify(W3i.default.exec);async function K3i(e,t="./"){let{stdout:r}=await NCu(e,{cwd:t});return r}s(K3i,"exec");async function z3i(e){try{return await K3i(`${e} --version`),!0}catch{return!1}}s(z3i,"utilityInstalled");async function tFe(e,t="./"){let r=await z3i("yarn"),n=await z3i("npm");if(!r&&!n)throw new Error("Must have yarn or npm installed to run build.");let i=e==="install"?`npm ${e}`:`npm run ${e}`,o=r?`yarn ${e} --ignore-engines`:i;await K3i(o,t)}s(tFe,"runPkgCommand");var rFe=require("path");ad();var PCu=require("find-free-port");function DCu(){if(!Dj.default.existsSync("package.json"))throw new Error("Please run in a plugin directory - must contain package.json");if(!Dj.default.existsSync("schema.json"))throw new Error("Please run in a plugin directory - must contain schema.json")}s(DCu,"checkInPlugin");async function MCu(e){return Dj.default.readdirSync(process.cwd()).find(r=>r===".git")?!1:(console.log(jc(`By default the plugin will be created in the directory "${e}"`)),console.log(jc("if you are already in an empty directory, such as a new Git repo, you can disable this functionality.")),sI("Create top level directory?"))}s(MCu,"askAboutTopLevel");async function LCu(e){let t=e.init||e;if(!t||!_Vt.includes(t)){console.log(ou("Please provide a type to init, either 'component', 'datasource' or 'automation'."));return}console.log(jc("Lets get some details about your new plugin:"));let r=await JD("Name",`budibase-${t}`);if(Dj.default.existsSync(r)){console.log(ou("Directory by plugin name already exists, pick a new name."));return}let n=await JD("Description",`An amazing Budibase ${t}!`),i=await JD("Version","1.0.0"),o=await MCu(r);console.log(jc("Retrieving project...")),await H3i(t,r),await G3i(t,r,n,i),console.log(jc("Installing dependencies...")),await tFe("install",(0,rFe.join)(process.cwd(),r)),o?console.log(jc(`Plugin created in directory "${r}"`)):(sje(r,process.cwd()),console.log(jc("Plugin created in current directory."))),Vue(WA.PluginInit,{type:t,name:r,description:n,version:i})}s(LCu,"init");async function Y3i(){DCu(),console.log(jc("Verifying plugin..."));let e=Dj.default.readFileSync("schema.json","utf8"),t=Dj.default.readFileSync("package.json","utf8"),r,n;try{let i=JSON.parse(e),o=JSON.parse(t);if(!o.name||!o.version||!o.description)throw new Error("package.json is missing one of 'name', 'version' or 'description'.");return r=o.name,n=o.version,cPe.validate(i),{name:r,version:n}}catch(i){i&&i.message&&i.message.includes("not valid JSON")?console.log(ou(`schema.json is not valid JSON: ${i.message}`)):console.log(ou(`Invalid schema/package.json: ${i.message}`))}}s(Y3i,"verify");async function qCu(){let e=await Y3i();if(!e?.name)return;console.log(Fc("Verified!")),console.log(jc("Building plugin...")),await tFe("build");let t=(0,rFe.join)("dist",`${e.name}-${e.version}.tar.gz`);console.log(Fc(`Build complete - output in: ${t}`))}s(qCu,"build");async function BCu(){let e=await Y3i();if(!e?.name)return;let t=(0,rFe.join)("dist",`${e.name}-${e.version}.tar.gz`);console.log(jc(`Watching - build in: ${t}`));try{await tFe("watch")}catch{console.log(Fc("Watch exited."))}}s(BCu,"watch");async function UCu(){let e=await JD("Directory to watch","./"),[t]=await PCu(1e4),r="admin";await Xue({init:"quick",single:!0,watchPluginDir:e,genUser:r,port:t,silent:!0}),await Xj(),console.log(Fc("Configuration has been written to docker-compose.yaml")),console.log(Fc("Development environment started successfully - connect at: ")+jc(`http://localhost:${t}`)),console.log(Fc("Use the following credentials to login:")),console.log(Fc("Email: ")+jc(vje)),console.log(Fc("Password: ")+jc(r))}s(UCu,"dev");var Q3i=new NS("plugins").addHelp("Custom plugins for Budibase, init, build and verify your components and datasources with this tool.").addSubOption("--init [type]","Init a new plugin project, with a type of either component or datasource.",LCu).addSubOption("--build","Build your plugin, this will verify and produce a final tarball for your project.",qCu).addSubOption("--watch","Automatically build any changes to your plugin.",BCu).addSubOption("--dev","Run a development environment which automatically watches the current directory.",UCu);function X3i(){return[T9t,Z5t,y2i,Q3i]}s(X3i,"getCommands");var Z3i=require("commander");ad();var J3i="3.20.3";async function jCu(){let e=new Z3i.Command().addHelpCommand("help",yK("Help with Budibase commands.")).helpOption(!1).version(J3i);for(let t of X3i())t.configure(e);await e.parseAsync(process.argv)}s(jCu,"init");var $Cu=["exit","SIGINT","SIGUSR1","SIGUSR2","uncaughtException"];$Cu.forEach(e=>{process.on(e,t=>{t&&!isNaN(t)||t&&(console.error(ou("Failed to run CLI command - please report with the following message:")),console.error(ou(t)))})});jCu().catch(e=>{console.error("Unexpected error - ",e)});
1402
+ `).length,t=s(r=>(...n)=>{kj()||console[r](...n),n.forEach((o,a)=>{typeof o=="object"&&(n[a]=JSON.stringify(o))});let i=new Error().stack?.match(/<anonymous>:(\d+):\d+/)?.[1];logs.push({log:n,line:i?parseInt(i)-e:void 0,type:r})},"buildLogResponse");sandboxContext.console={log:t("log"),info:t("info"),debug:t("debug"),warn:t("warn"),error:t("error"),table:t("table")}}let res={data:JUe(js,sandboxContext),logs};return`{{${ZW} js_result-${JSON.stringify(res)}}}`}catch(e){a$t&&a$t(e);let{noThrow:t=!0}=context.__opts||{};if(e.code==="ERR_SCRIPT_EXECUTION_TIMEOUT")return"Timed out while executing JS";if(e.code==="JS_REQUEST_TIMEOUT_ERROR")return e.message;if(e.code===eK.code)return eK.message;if(e.code===Nj.code){if(t)return e.userScriptError.toString();throw e}if(e.name==="SyntaxError"){if(t)return e.toString();throw e}return"Error while executing JS"}}s(O3i,"processJS");var mCu={"<":"&lt;",">":"&gt;"};function gCu(e){return e==null||typeof e!="object"?!1:e.toString()==="[object Object]"||e.length>0&&typeof e[0]=="object"}s(gCu,"isObject");var _Cu=[new FR(Ij.OBJECT,e=>new ZUe.default.SafeString(JSON.stringify(e))),new FR(Ij.JS,O3i,!1),new FR(Ij.DECODE_ID,e=>{if(!e)return[];let t=typeof e=="string"?e:e._id,r=decodeURIComponent(t).replace(/'/g,'"');try{let n=JSON.parse(r);return Array.isArray(n)?n:[n]}catch{return[e]}}),new FR(Ij.ALL,(e,t)=>{let{__opts:r}=t;if(gCu(e))return new ZUe.default.SafeString(JSON.stringify(e));if(r&&r.onlyFound&&e==null)return r.input;if(e==null||typeof e!="string")return e??"";e&&e.string&&(e=e.string);let n=e;return r&&r.escapeNewlines&&(n=e.replace(/\n/g,"\\n")),n=new ZUe.default.SafeString(n.replace(/&amp;/g,"&")),n==null||typeof n!="string"?n:n.replace(/[<>]/g,i=>mCu[i]||i)}),new FR(Ij.LITERAL,e=>{if(e===void 0)return"";let t=typeof e,r=t==="object"?JSON.stringify(e):e;return`{{${ZW} ${t}-${r}}}`})];function R3i(){return Object.values(Ij).concat(KUe,n$t)}s(R3i,"HelperNames");function u$t(e){for(let t of _Cu)t.register(e)}s(u$t,"registerMinimum");function I3i(e){u$t(e),l3i(e)}s(I3i,"registerAll");var k3i=["#","else","/"];var tK=class{static{s(this,"Preprocessor")}constructor(t,r){this.name=t,this.fn=r}process(t,r,n){let i=this.fn(r,n),o=t.indexOf(r);return s$t(t,o,r.length,i)}},N3i=[new tK("swap-to-dot-notation",e=>{let t=e.indexOf("["),r=0;for(;t!==-1;){h3i(e.charAt(t-1))&&(e=s$t(e,t+r,1,".[")),r=t+1;let n=e.substring(r+1).indexOf("[");t=n>0?r+1+n:-1}return e}),new tK("fix-functions",e=>{for(let t of k3i){let r=`{ ${t}`,n=`{${t}`;e=e.replace(new RegExp(r,"g"),n)}return e}),new tK("normalize-spaces",e=>e.replace(/{{(\s{2,})/g,"{{ ")),new tK("finalise",(e,t)=>{let n=!t?.noHelpers,i=e.slice(2,e.length-2);i.charAt(0)===" "&&(i=i.slice(1)),i.charAt(i.length-1)===" "&&(i=i.slice(0,i.length-1));let o=i.split(" ")[0];for(let c of k3i)if(o.includes(c))return e;let a=o.trim().toLowerCase();return n&&!t?.disabledHelpers?.includes(a)&&R3i().some(c=>a===c.toLowerCase())&&(i=`(${i})`),`{{ all ${i} }}`})];var l$t=class{static{s(this,"Postprocessor")}constructor(t,r){this.name=t,this.fn=r}process(t){return this.fn(t)}},f$t=[new l$t("convert-literals",e=>{if(typeof e!="string"||!e.includes(ZW))return{result:e};let t=e.indexOf("-"),r=e.substring(12,t),n=e.substring(t+1,e.length-2);switch(r){case"string":return{result:n};case"number":return{result:parseFloat(n)};case"boolean":return{result:n==="true"};case"object":return{result:JSON.parse(n)};case"js_result":{let i=JSON.parse(n);return{result:i.data,logs:i.logs}}}return{result:n}})];function d$t(e,t,r){let n=[];for(let i of t){if(typeof e!="string")break;let o=new RegExp(YUe),a=e.match(o);if(a!=null)for(let c of a){let u=i.process(e,c,r||{});typeof u=="object"?("logs"in u&&u.logs&&(n=n.concat(u.logs)),e=u.result):e=u}}return{result:e,logs:n}}s(d$t,"process");function P3i(e,t){let r=N3i;return t.noFinalise&&(r=r.filter(n=>n.name!=="finalise")),d$t(e,r,t).result}s(P3i,"preprocess");function D3i(e){return d$t(e,f$t).result}s(D3i,"postprocess");function M3i(e){return d$t(e,f$t)}s(M3i,"postprocessWithLogs");var m$t=(0,h$t.create)();I3i(m$t);var ECu=Object.keys(m$t.helpers),B3i=(0,h$t.create)();u$t(B3i);var vCu={noHelpers:!1,cacheTemplates:!1,noEscaping:!1,escapeNewlines:!1,noFinalise:!1};function SCu(e){return e?Object.keys(e).filter(r=>ECu.includes(r)):[]}s(SCu,"findOverlappingHelpers");var p$t={};function wCu(e,t,r){t={...vCu,...t};let n=!t?.noHelpers,i=`${e}-${JSON.stringify(t)}`;if(t.cacheTemplates&&p$t[i])return p$t[i];let o=n?SCu(r):[];if(e=P3i(e,{...t,disabledHelpers:o}),r&&n&&o.length>0)for(let u of F3i(e))e=e.replace(u,m3i(u,o,"./"));t.noEscaping&&(e=ACu(e));let c=(t.noHelpers?B3i:m$t).compile(e,{strict:!1});return p$t[i]=c,c}s(wCu,"createTemplate");function TCu(e,t,r){let n=e;if(typeof e!="string")throw new Error("Cannot process non-string types.");function i(o){let a=wCu(o,r,t),c=Math.floor(Date.now()/1e3)*1e3,u=a({now:new Date(c).toISOString(),__opts:{...r,input:o},...t});return r?.logging?M3i(u):D3i(u)}s(i,"process");try{if(r&&r.onlyFound){let o=[],a=F3i(e);for(let c of a){let u=i(c);typeof u=="object"&&"result"in u?(o=o.concat(u.logs||[]),e=e.replace(c,u.result)):e=e.replace(c,u)}return r?.logging?{result:e,logs:o}:e}else return i(e)}catch(o){let{noThrow:a=!0}=r||{};if(a)return n;throw o}}s(TCu,"processStringSyncInternal");function U3i(e,t,r){return TCu(e,t,{...r,logging:!1})}s(U3i,"processStringSync");function ACu(e){let t=p3i(e);if(t==null)return e;let r=[...new Set(t)];for(let n of r){let i=new RegExp(`${n}(?!})`,"g");e=e.replace(i,`{${n}}`)}return e}s(ACu,"disableEscaping");function F3i(e){if(!e||typeof e!="string")return[];let t=new RegExp(i$t),r=e.match(t);return r??[]}s(F3i,"findHBSBlocks");function xCu(){let e=kj()?q3i.default:L3i.default;c$t((t,r)=>{e.createContext(r);let n=QUe(t),i=e.runInNewContext(n,r);if(i.error)throw new Nj(i.error);return i.result})}s(xCu,"browserJSSetup");function CCu(){tue()?C3i():xCu()}s(CCu,"defaultJSSetup");CCu();var OCu=require("download"),RCu=require("tar"),ICu=["package.json.hbs","schema.json.hbs","README.md.hbs"];async function kCu(e){let t=await(0,j3i.default)("https://api.github.com/repos/budibase/budibase-skeleton/releases/latest");if(t.status>=300)throw new Error("Failed to retrieve skeleton metadata");let r=await t.json();for(let n of r.assets)if(n.name&&n.name.includes(e))return n.browser_download_url;throw new Error("No skeleton found in latest release.")}s(kCu,"getSkeletonUrl");async function H3i(e,t){let r=await kCu(e),n=(0,eFe.join)($3i.default.tmpdir(),"skeleton.tar.gz");Pj.default.writeFileSync(n,await OCu(r)),Pj.default.mkdirSync(t),await RCu.extract({file:n,C:t}),Pj.default.rmSync(n)}s(H3i,"getSkeleton");async function G3i(e,t,r,n){for(let i of ICu){let o=(0,eFe.join)(t,i),a=(0,eFe.join)(t,i.substring(0,i.length-4)),c=Pj.default.readFileSync(o,"utf8");if(!c)continue;let u=U3i(c,{name:t,description:r,version:n});Pj.default.writeFileSync(a,u),Pj.default.rmSync(o)}}s(G3i,"fleshOutSkeleton");ZD();var Dj=at(require("fs"));Ir();var V3i=at(require("util")),W3i=at(require("child_process"));var NCu=V3i.default.promisify(W3i.default.exec);async function K3i(e,t="./"){let{stdout:r}=await NCu(e,{cwd:t});return r}s(K3i,"exec");async function z3i(e){try{return await K3i(`${e} --version`),!0}catch{return!1}}s(z3i,"utilityInstalled");async function tFe(e,t="./"){let r=await z3i("yarn"),n=await z3i("npm");if(!r&&!n)throw new Error("Must have yarn or npm installed to run build.");let i=e==="install"?`npm ${e}`:`npm run ${e}`,o=r?`yarn ${e} --ignore-engines`:i;await K3i(o,t)}s(tFe,"runPkgCommand");var rFe=require("path");ad();var PCu=require("find-free-port");function DCu(){if(!Dj.default.existsSync("package.json"))throw new Error("Please run in a plugin directory - must contain package.json");if(!Dj.default.existsSync("schema.json"))throw new Error("Please run in a plugin directory - must contain schema.json")}s(DCu,"checkInPlugin");async function MCu(e){return Dj.default.readdirSync(process.cwd()).find(r=>r===".git")?!1:(console.log(jc(`By default the plugin will be created in the directory "${e}"`)),console.log(jc("if you are already in an empty directory, such as a new Git repo, you can disable this functionality.")),sI("Create top level directory?"))}s(MCu,"askAboutTopLevel");async function LCu(e){let t=e.init||e;if(!t||!_Vt.includes(t)){console.log(ou("Please provide a type to init, either 'component', 'datasource' or 'automation'."));return}console.log(jc("Lets get some details about your new plugin:"));let r=await JD("Name",`budibase-${t}`);if(Dj.default.existsSync(r)){console.log(ou("Directory by plugin name already exists, pick a new name."));return}let n=await JD("Description",`An amazing Budibase ${t}!`),i=await JD("Version","1.0.0"),o=await MCu(r);console.log(jc("Retrieving project...")),await H3i(t,r),await G3i(t,r,n,i),console.log(jc("Installing dependencies...")),await tFe("install",(0,rFe.join)(process.cwd(),r)),o?console.log(jc(`Plugin created in directory "${r}"`)):(sje(r,process.cwd()),console.log(jc("Plugin created in current directory."))),Vue(WA.PluginInit,{type:t,name:r,description:n,version:i})}s(LCu,"init");async function Y3i(){DCu(),console.log(jc("Verifying plugin..."));let e=Dj.default.readFileSync("schema.json","utf8"),t=Dj.default.readFileSync("package.json","utf8"),r,n;try{let i=JSON.parse(e),o=JSON.parse(t);if(!o.name||!o.version||!o.description)throw new Error("package.json is missing one of 'name', 'version' or 'description'.");return r=o.name,n=o.version,cPe.validate(i),{name:r,version:n}}catch(i){i&&i.message&&i.message.includes("not valid JSON")?console.log(ou(`schema.json is not valid JSON: ${i.message}`)):console.log(ou(`Invalid schema/package.json: ${i.message}`))}}s(Y3i,"verify");async function qCu(){let e=await Y3i();if(!e?.name)return;console.log(Fc("Verified!")),console.log(jc("Building plugin...")),await tFe("build");let t=(0,rFe.join)("dist",`${e.name}-${e.version}.tar.gz`);console.log(Fc(`Build complete - output in: ${t}`))}s(qCu,"build");async function BCu(){let e=await Y3i();if(!e?.name)return;let t=(0,rFe.join)("dist",`${e.name}-${e.version}.tar.gz`);console.log(jc(`Watching - build in: ${t}`));try{await tFe("watch")}catch{console.log(Fc("Watch exited."))}}s(BCu,"watch");async function UCu(){let e=await JD("Directory to watch","./"),[t]=await PCu(1e4),r="admin";await Xue({init:"quick",single:!0,watchPluginDir:e,genUser:r,port:t,silent:!0}),await Xj(),console.log(Fc("Configuration has been written to docker-compose.yaml")),console.log(Fc("Development environment started successfully - connect at: ")+jc(`http://localhost:${t}`)),console.log(Fc("Use the following credentials to login:")),console.log(Fc("Email: ")+jc(vje)),console.log(Fc("Password: ")+jc(r))}s(UCu,"dev");var Q3i=new NS("plugins").addHelp("Custom plugins for Budibase, init, build and verify your components and datasources with this tool.").addSubOption("--init [type]","Init a new plugin project, with a type of either component or datasource.",LCu).addSubOption("--build","Build your plugin, this will verify and produce a final tarball for your project.",qCu).addSubOption("--watch","Automatically build any changes to your plugin.",BCu).addSubOption("--dev","Run a development environment which automatically watches the current directory.",UCu);function X3i(){return[T9t,Z5t,y2i,Q3i]}s(X3i,"getCommands");var Z3i=require("commander");ad();var J3i="3.20.4";async function jCu(){let e=new Z3i.Command().addHelpCommand("help",yK("Help with Budibase commands.")).helpOption(!1).version(J3i);for(let t of X3i())t.configure(e);await e.parseAsync(process.argv)}s(jCu,"init");var $Cu=["exit","SIGINT","SIGUSR1","SIGUSR2","uncaughtException"];$Cu.forEach(e=>{process.on(e,t=>{t&&!isNaN(t)||t&&(console.error(ou("Failed to run CLI command - please report with the following message:")),console.error(ou(t)))})});jCu().catch(e=>{console.error("Unexpected error - ",e)});
1403
1403
  /*! Bundled license information:
1404
1404
 
1405
1405
  lodash/lodash.js:
@@ -1623,7 +1623,7 @@ mime-types/index.js:
1623
1623
  * MIT Licensed
1624
1624
  *)
1625
1625
 
1626
- pprof-format/dist/index.js:
1626
+ pprof-format/dist/commonjs/index.js:
1627
1627
  (*!
1628
1628
  * Private helpers. These are only used by other helpers.
1629
1629
  *)