From faa41a1d7dfc5572c1876eef852699725b0c2152 Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Mon, 22 Jan 2024 05:35:24 +0800 Subject: [PATCH 1/4] fix(agent): remove completion timeout limit. update slowResponseTime check rules. --- clients/tabby-agent/src/AgentConfig.ts | 4 +--- clients/tabby-agent/src/CompletionProviderStats.ts | 12 +++--------- clients/tabby-agent/src/TabbyAgent.ts | 11 +---------- clients/tabby-agent/src/configFile.ts | 7 ------- 4 files changed, 5 insertions(+), 29 deletions(-) diff --git a/clients/tabby-agent/src/AgentConfig.ts b/clients/tabby-agent/src/AgentConfig.ts index f6f6bfb0e630..44673f7f23cd 100644 --- a/clients/tabby-agent/src/AgentConfig.ts +++ b/clients/tabby-agent/src/AgentConfig.ts @@ -19,7 +19,6 @@ export type AgentConfig = { mode: "adaptive" | "fixed"; interval: number; }; - timeout: number; }; postprocess: { limitScope: { @@ -60,7 +59,7 @@ export const defaultAgentConfig: AgentConfig = { endpoint: "http://localhost:8080", token: "", requestHeaders: {}, - requestTimeout: 30000, // 30s + requestTimeout: 2 * 60 * 1000, // 2 minutes }, completion: { prompt: { @@ -76,7 +75,6 @@ export const defaultAgentConfig: AgentConfig = { mode: "adaptive", interval: 250, // ms }, - timeout: 4000, // ms }, postprocess: { limitScope: { diff --git a/clients/tabby-agent/src/CompletionProviderStats.ts b/clients/tabby-agent/src/CompletionProviderStats.ts index 43b2218b498c..67db9a222fb7 100644 --- a/clients/tabby-agent/src/CompletionProviderStats.ts +++ b/clients/tabby-agent/src/CompletionProviderStats.ts @@ -62,11 +62,11 @@ export class CompletionProviderStats { checks: { disable: false, // Mark status as healthy if the latency is less than the threshold for each latest windowSize requests. - healthy: { windowSize: 3, latency: 2400 }, + healthy: { windowSize: 1, latency: 3000 }, // If there is at least {count} requests, and the average response time is higher than the {latency}, show warning - slowResponseTime: { latency: 3200, count: 3 }, + slowResponseTime: { latency: 5000, count: 1 }, // If there is at least {count} timeouts, and the timeout rate is higher than the {rate}, show warning - highTimeoutRate: { rate: 0.5, count: 3 }, + highTimeoutRate: { rate: 0.5, count: 1 }, }, }; @@ -83,12 +83,6 @@ export class CompletionProviderStats { private recentCompletionRequestLatencies: Windowed = new Windowed(this.config.windowSize); - updateConfigByRequestTimeout(timeout: number) { - this.config.checks.healthy.latency = timeout * 0.6; - this.config.checks.slowResponseTime.latency = timeout * 0.8; - this.resetWindowed(); - } - add(value: CompletionProviderStatsEntry): void { const { triggerMode, cacheHit, aborted, requestSent, requestLatency, requestCanceled, requestTimeout } = value; if (!aborted) { diff --git a/clients/tabby-agent/src/TabbyAgent.ts b/clients/tabby-agent/src/TabbyAgent.ts index e59af4246467..70326a0f5ad2 100644 --- a/clients/tabby-agent/src/TabbyAgent.ts +++ b/clients/tabby-agent/src/TabbyAgent.ts @@ -110,12 +110,6 @@ export class TabbyAgent extends EventEmitter implements Agent { } } - if (oldConfig.completion.timeout !== this.config.completion.timeout) { - this.completionProviderStats.updateConfigByRequestTimeout(this.config.completion.timeout); - this.popIssue("slowCompletionResponseTime"); - this.popIssue("highCompletionTimeoutRate"); - } - const event: AgentEvent = { event: "configUpdated", config: this.config }; this.logger.debug({ event }, "Config updated"); super.emit("configUpdated", event); @@ -496,10 +490,7 @@ export class TabbyAgent extends EventEmitter implements Agent { segments, user: this.auth?.user, }, - signal: this.createAbortSignal({ - signal, - timeout: this.config.completion.timeout, - }), + signal: this.createAbortSignal({ signal }), }; this.logger.debug( { requestId, requestOptions, url: this.config.server.endpoint + requestPath }, diff --git a/clients/tabby-agent/src/configFile.ts b/clients/tabby-agent/src/configFile.ts index f7f8d94f0d3b..21b496a43d78 100644 --- a/clients/tabby-agent/src/configFile.ts +++ b/clients/tabby-agent/src/configFile.ts @@ -27,12 +27,6 @@ const configTomlTemplate = `## Tabby agent configuration file # Header1 = "Value1" # list your custom headers here # Header2 = "Value2" # values can be strings, numbers or booleans -## Completion -## (Since 1.1.0) You can set the completion request timeout here. -## Note that there is also a timeout config at the server side. -# [completion] -# timeout = 4000 # 4s - ## Logs ## You can set the log level here. The log file is located at ~/.tabby-client/agent/logs/. # [logs] @@ -65,7 +59,6 @@ const typeCheckSchema: Record = { "completion.debounce": "object", "completion.debounce.mode": "string", "completion.debounce.interval": "number", - "completion.timeout": "number", postprocess: "object", "postprocess.limitScopeByIndentation": "object", "postprocess.limitScopeByIndentation.experimentalKeepBlockScopeWhenCompletingLine": "boolean", From d0bb2740b1559e92c1939fc1d20ca806a1651b86 Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Mon, 22 Jan 2024 07:37:35 +0800 Subject: [PATCH 2/4] fix(agent): fix response time health check sample window. --- clients/tabby-agent/src/CompletionProviderStats.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/tabby-agent/src/CompletionProviderStats.ts b/clients/tabby-agent/src/CompletionProviderStats.ts index 67db9a222fb7..031bdff769c8 100644 --- a/clients/tabby-agent/src/CompletionProviderStats.ts +++ b/clients/tabby-agent/src/CompletionProviderStats.ts @@ -193,7 +193,7 @@ export class CompletionProviderStats { if ( latencies - .slice(-Math.max(this.config.windowSize, config.healthy.windowSize)) + .slice(-Math.min(this.config.windowSize, config.healthy.windowSize)) .every((latency) => latency < config.healthy.latency) ) { return "healthy"; From d20c8a7b1df5963e26befd1db11203445880ebbc Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Mon, 22 Jan 2024 07:38:44 +0800 Subject: [PATCH 3/4] fix(vscode): show only status bar warning icon instead of notification for response time issues. --- clients/vscode/src/TabbyStatusBarItem.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/clients/vscode/src/TabbyStatusBarItem.ts b/clients/vscode/src/TabbyStatusBarItem.ts index d80caba5f573..1557c3a0fa77 100644 --- a/clients/vscode/src/TabbyStatusBarItem.ts +++ b/clients/vscode/src/TabbyStatusBarItem.ts @@ -22,7 +22,6 @@ export class TabbyStatusBarItem { private item = window.createStatusBarItem(StatusBarAlignment.Right); private extensionContext: ExtensionContext; private completionProvider: TabbyCompletionProvider; - private completionResponseWarningShown = false; private subStatusForReady = [ { @@ -158,23 +157,11 @@ export class TabbyStatusBarItem { console.debug("Tabby agent issuesUpdated", { event }); const status = agent().getStatus(); this.fsmService.send(status); - const showCompletionResponseWarnings = - !this.completionResponseWarningShown && - !this.extensionContext.globalState - .get("notifications.muted", []) - .includes("completionResponseTimeIssues"); if (event.issues.includes("connectionFailed")) { - // Only show this notification when user modifies the settings, do not show it when initializing - // FIXME: refactor this use a flag marks the event is trigger by modifying settings or initializing + // Do not show it when initializing if (status !== "notInitialized") { notifications.showInformationWhenDisconnected(); } - } else if (showCompletionResponseWarnings && event.issues.includes("highCompletionTimeoutRate")) { - this.completionResponseWarningShown = true; - notifications.showInformationWhenHighCompletionTimeoutRate(); - } else if (showCompletionResponseWarnings && event.issues.includes("slowCompletionResponseTime")) { - this.completionResponseWarningShown = true; - notifications.showInformationWhenSlowCompletionResponseTime(); } }); } From eacc8de6fa8a4b19a3b91db00b47576e150bc2e6 Mon Sep 17 00:00:00 2001 From: Zhiming Ma Date: Mon, 22 Jan 2024 08:02:12 +0800 Subject: [PATCH 4/4] fix(intellij): show only status bar warning icon instead of notification for response time issues. --- clients/intellij/node_scripts/tabby-agent.js | 204 ++++++++++-------- clients/intellij/node_scripts/wasm/LICENSES | 153 +++++++++++++ .../intellijtabby/actions/CheckIssueDetail.kt | 6 + .../intellijtabby/agent/AgentService.kt | 42 +--- 4 files changed, 286 insertions(+), 119 deletions(-) create mode 100644 clients/intellij/node_scripts/wasm/LICENSES diff --git a/clients/intellij/node_scripts/tabby-agent.js b/clients/intellij/node_scripts/tabby-agent.js index 0c9ba14ea307..07736e24de30 100755 --- a/clients/intellij/node_scripts/tabby-agent.js +++ b/clients/intellij/node_scripts/tabby-agent.js @@ -2,66 +2,66 @@ 'use strict'; var events = require('events'); -var zE = require('crypto'); -var XS = require('path'); -var pv = require('os'); -var PL = require('readline'); +var OO = require('crypto'); +var Gx = require('path'); +var aT = require('os'); +var g3 = require('readline'); function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; } -var zE__default = /*#__PURE__*/_interopDefault(zE); -var XS__default = /*#__PURE__*/_interopDefault(XS); -var pv__default = /*#__PURE__*/_interopDefault(pv); -var PL__default = /*#__PURE__*/_interopDefault(PL); +var OO__default = /*#__PURE__*/_interopDefault(OO); +var Gx__default = /*#__PURE__*/_interopDefault(Gx); +var aT__default = /*#__PURE__*/_interopDefault(aT); +var g3__default = /*#__PURE__*/_interopDefault(g3); -var $E=Object.create;var Jn=Object.defineProperty;var DE=Object.getOwnPropertyDescriptor;var qE=Object.getOwnPropertyNames;var BE=Object.getPrototypeOf,UE=Object.prototype.hasOwnProperty;var K=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var HE=(t,e)=>()=>(t&&(e=t(t=0)),e);var x=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),jE=(t,e)=>{for(var r in e)Jn(t,r,{get:e[r],enumerable:!0});},Jc=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of qE(e))!UE.call(t,s)&&s!==r&&Jn(t,s,{get:()=>e[s],enumerable:!(n=DE(e,s))||n.enumerable});return t};var He=(t,e,r)=>(r=t!=null?$E(BE(t)):{},Jc(e||!t||!t.__esModule?Jn(r,"default",{value:t,enumerable:!0}):r,t)),WE=t=>Jc(Jn({},"__esModule",{value:!0}),t);var fo=x((KL,ef)=>{var Qc=Object.prototype.toString;ef.exports=function(e){var r=Qc.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Qc.call(e.callee)==="[object Function]"),n};});var cf=x((ZL,uf)=>{var lf;Object.keys||(en=Object.prototype.hasOwnProperty,ho=Object.prototype.toString,tf=fo(),po=Object.prototype.propertyIsEnumerable,rf=!po.call({toString:null},"toString"),nf=po.call(function(){},"prototype"),tn=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],ei=function(t){var e=t.constructor;return e&&e.prototype===t},sf={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},of=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!sf["$"+t]&&en.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{ei(window[t]);}catch{return !0}}catch{return !0}return !1}(),af=function(t){if(typeof window>"u"||!of)return ei(t);try{return ei(t)}catch{return !1}},lf=function(e){var r=e!==null&&typeof e=="object",n=ho.call(e)==="[object Function]",s=tf(e),i=r&&ho.call(e)==="[object String]",o=[];if(!r&&!n&&!s)throw new TypeError("Object.keys called on a non-object");var l=nf&&n;if(i&&e.length>0&&!en.call(e,0))for(var f=0;f0)for(var d=0;d{var KE=Array.prototype.slice,ZE=fo(),ff=Object.keys,ti=ff?function(e){return ff(e)}:cf(),hf=Object.keys;ti.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(n){return ZE(n)?hf(KE.call(n)):hf(n)});}else Object.keys=ti;return Object.keys||ti};df.exports=ti;});var ni=x((JL,pf)=>{pf.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return !1;if(typeof Symbol.iterator=="symbol")return !0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return !1;var s=42;e[r]=s;for(r in e)return !1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return !1;var i=Object.getOwnPropertySymbols(e);if(i.length!==1||i[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return !1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==s||o.enumerable!==!0)return !1}return !0};});var mo=x((XL,gf)=>{var mf=typeof Symbol<"u"&&Symbol,YE=ni();gf.exports=function(){return typeof mf!="function"||typeof Symbol!="function"||typeof mf("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:YE()};});var wf=x((QL,yf)=>{var _f={foo:{}},JE=Object;yf.exports=function(){return {__proto__:_f}.foo===_f.foo&&!({__proto__:null}instanceof JE)};});var vf=x((e2,Sf)=>{var XE="Function.prototype.bind called on incompatible ",QE=Object.prototype.toString,e0=Math.max,t0="[object Function]",bf=function(e,r){for(var n=[],s=0;s{var i0=vf();Ef.exports=Function.prototype.bind||i0;});var xf=x((r2,Af)=>{var s0=Function.prototype.call,o0=Object.prototype.hasOwnProperty,a0=ii();Af.exports=a0.call(s0,o0);});var ot=x((n2,Pf)=>{var ae,wr=SyntaxError,If=Function,yr=TypeError,go=function(t){try{return If('"use strict"; return ('+t+").constructor;")()}catch{}},Kt=Object.getOwnPropertyDescriptor;var _o=function(){throw new yr},l0=Kt?function(){try{return _o}catch{try{return Kt(arguments,"callee").get}catch{return _o}}}():_o,gr=mo()(),u0=wf()(),Ee=Object.getPrototypeOf||(u0?function(t){return t.__proto__}:null),_r={},c0=typeof Uint8Array>"u"||!Ee?ae:Ee(Uint8Array),Zt={"%AggregateError%":typeof AggregateError>"u"?ae:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?ae:ArrayBuffer,"%ArrayIteratorPrototype%":gr&&Ee?Ee([][Symbol.iterator]()):ae,"%AsyncFromSyncIteratorPrototype%":ae,"%AsyncFunction%":_r,"%AsyncGenerator%":_r,"%AsyncGeneratorFunction%":_r,"%AsyncIteratorPrototype%":_r,"%Atomics%":typeof Atomics>"u"?ae:Atomics,"%BigInt%":typeof BigInt>"u"?ae:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?ae:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?ae:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?ae:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?ae:Float32Array,"%Float64Array%":typeof Float64Array>"u"?ae:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?ae:FinalizationRegistry,"%Function%":If,"%GeneratorFunction%":_r,"%Int8Array%":typeof Int8Array>"u"?ae:Int8Array,"%Int16Array%":typeof Int16Array>"u"?ae:Int16Array,"%Int32Array%":typeof Int32Array>"u"?ae:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":gr&&Ee?Ee(Ee([][Symbol.iterator]())):ae,"%JSON%":typeof JSON=="object"?JSON:ae,"%Map%":typeof Map>"u"?ae:Map,"%MapIteratorPrototype%":typeof Map>"u"||!gr||!Ee?ae:Ee(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?ae:Promise,"%Proxy%":typeof Proxy>"u"?ae:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?ae:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?ae:Set,"%SetIteratorPrototype%":typeof Set>"u"||!gr||!Ee?ae:Ee(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?ae:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":gr&&Ee?Ee(""[Symbol.iterator]()):ae,"%Symbol%":gr?Symbol:ae,"%SyntaxError%":wr,"%ThrowTypeError%":l0,"%TypedArray%":c0,"%TypeError%":yr,"%Uint8Array%":typeof Uint8Array>"u"?ae:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?ae:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?ae:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?ae:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?ae:WeakMap,"%WeakRef%":typeof WeakRef>"u"?ae:WeakRef,"%WeakSet%":typeof WeakSet>"u"?ae:WeakSet};var f0=function t(e){var r;if(e==="%AsyncFunction%")r=go("async function () {}");else if(e==="%GeneratorFunction%")r=go("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=go("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype);}else if(e==="%AsyncIteratorPrototype%"){var s=t("%AsyncGenerator%");s&&Ee&&(r=Ee(s.prototype));}return Zt[e]=r,r},Rf={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},rn=ii(),si=xf(),h0=rn.call(Function.call,Array.prototype.concat),d0=rn.call(Function.apply,Array.prototype.splice),Tf=rn.call(Function.call,String.prototype.replace),oi=rn.call(Function.call,String.prototype.slice),p0=rn.call(Function.call,RegExp.prototype.exec),m0=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,g0=/\\(\\)?/g,_0=function(e){var r=oi(e,0,1),n=oi(e,-1);if(r==="%"&&n!=="%")throw new wr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new wr("invalid intrinsic syntax, expected opening `%`");var s=[];return Tf(e,m0,function(i,o,l,f){s[s.length]=l?Tf(f,g0,"$1"):o||i;}),s},y0=function(e,r){var n=e,s;if(si(Rf,n)&&(s=Rf[n],n="%"+s[0]+"%"),si(Zt,n)){var i=Zt[n];if(i===_r&&(i=f0(n)),typeof i>"u"&&!r)throw new yr("intrinsic "+e+" exists, but is not available. Please file an issue!");return {alias:s,name:n,value:i}}throw new wr("intrinsic "+e+" does not exist!")};Pf.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new yr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new yr('"allowMissing" argument must be a boolean');if(p0(/^%?[^%]*%?$/,e)===null)throw new wr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=_0(e),s=n.length>0?n[0]:"",i=y0("%"+s+"%",r),o=i.name,l=i.value,f=!1,d=i.alias;d&&(s=d[0],d0(n,h0([0,1],d)));for(var u=1,p=!0;u=n.length){var S=Kt(l,m);p=!!S,p&&"get"in S&&!("originalValue"in S.get)?l=S.get:l=l[m];}else p=si(l,m),l=l[m];p&&!f&&(Zt[o]=l);}}return l};});var nn=x((i2,Of)=>{var w0=ot(),yo=w0("%Object.defineProperty%",!0),wo=function(){if(yo)try{return yo({},"a",{value:1}),!0}catch{return !1}return !1};wo.hasArrayLengthDefineBug=function(){if(!wo())return null;try{return yo([],"length",{value:1}).length!==1}catch{return !0}};Of.exports=wo;});var li=x((s2,Ff)=>{var b0=ot(),ai=b0("%Object.getOwnPropertyDescriptor%",!0);if(ai)try{ai([],"length");}catch{ai=null;}Ff.exports=ai;});var ui=x((o2,Nf)=>{var S0=nn()(),bo=ot(),sn=S0&&bo("%Object.defineProperty%",!0);if(sn)try{sn({},"a",{value:1});}catch{sn=!1;}var v0=bo("%SyntaxError%"),br=bo("%TypeError%"),Mf=li();Nf.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new br("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new br("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new br("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new br("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new br("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new br("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,i=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,f=!!Mf&&Mf(e,r);if(sn)sn(e,r,{configurable:o===null&&f?f.configurable:!o,enumerable:s===null&&f?f.enumerable:!s,value:n,writable:i===null&&f?f.writable:!i});else if(l||!s&&!i&&!o)e[r]=n;else throw new v0("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")};});var Nt=x((a2,Df)=>{var E0=ri(),A0=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",x0=Object.prototype.toString,C0=Array.prototype.concat,kf=ui(),R0=function(t){return typeof t=="function"&&x0.call(t)==="[object Function]"},Lf=nn()(),T0=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!R0(n)||!n())return}Lf?kf(t,e,r,!0):kf(t,e,r);},$f=function(t,e){var r=arguments.length>2?arguments[2]:{},n=E0(e);A0&&(n=C0.call(n,Object.getOwnPropertySymbols(e)));for(var s=0;s{var Hf=ot(),qf=ui(),I0=nn()(),Bf=li(),Uf=Hf("%TypeError%"),P0=Hf("%Math.floor%");jf.exports=function(e,r){if(typeof e!="function")throw new Uf("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||P0(r)!==r)throw new Uf("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],s=!0,i=!0;if("length"in e&&Bf){var o=Bf(e,"length");o&&!o.configurable&&(s=!1),o&&!o.writable&&(i=!1);}return (s||i||!n)&&(I0?qf(e,"length",r,!0,!0):qf(e,"length",r)),e};});var Yt=x((u2,ci)=>{var So=ii(),Sr=ot(),O0=Wf(),F0=Sr("%TypeError%"),Gf=Sr("%Function.prototype.apply%"),Vf=Sr("%Function.prototype.call%"),Kf=Sr("%Reflect.apply%",!0)||So.call(Vf,Gf),on=Sr("%Object.defineProperty%",!0),M0=Sr("%Math.max%");if(on)try{on({},"a",{value:1});}catch{on=null;}ci.exports=function(e){if(typeof e!="function")throw new F0("a function is required");var r=Kf(So,Vf,arguments);return O0(r,1+M0(0,e.length-(arguments.length-1)),!0)};var zf=function(){return Kf(So,Gf,arguments)};on?on(ci.exports,"apply",{value:zf}):ci.exports.apply=zf;});var tt=x((c2,Jf)=>{var Zf=ot(),Yf=Yt(),N0=Yf(Zf("String.prototype.indexOf"));Jf.exports=function(e,r){var n=Zf(e,!!r);return typeof n=="function"&&N0(e,".prototype.")>-1?Yf(n):n};});var vo=x((f2,rh)=>{var k0=ri(),eh=ni()(),th=tt(),Xf=Object,L0=th("Array.prototype.push"),Qf=th("Object.prototype.propertyIsEnumerable"),$0=eh?Object.getOwnPropertySymbols:null;rh.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=Xf(e);if(arguments.length===1)return n;for(var s=1;s{var Eo=vo(),D0=function(){if(!Object.assign)return !1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n{var B0=Nt(),U0=Ao();ih.exports=function(){var e=U0();return B0(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e};});var uh=x((p2,lh)=>{var H0=Nt(),j0=Yt(),W0=vo(),oh=Ao(),z0=sh(),G0=j0.apply(oh()),ah=function(e,r){return G0(Object,arguments)};H0(ah,{getPolyfill:oh,implementation:W0,shim:z0});lh.exports=ah;});var fh=x((m2,ch)=>{var ln=function(){return typeof function(){}.name=="string"},an=Object.getOwnPropertyDescriptor;ln.functionsHaveConfigurableNames=function(){if(!ln()||!an)return !1;var e=an(function(){},"name");return !!e&&!!e.configurable};var V0=Function.prototype.bind;ln.boundFunctionsHaveNames=function(){return ln()&&typeof V0=="function"&&function(){}.bind().name!==""};ch.exports=ln;});var ph=x((g2,dh)=>{var hh=ui(),K0=nn()(),Z0=fh().functionsHaveConfigurableNames(),Y0=TypeError;dh.exports=function(e,r){if(typeof e!="function")throw new Y0("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return (!n||Z0)&&(K0?hh(e,"name",r,!0,!0):hh(e,"name",r)),e};});var xo=x((_2,mh)=>{var J0=ph(),X0=Object,Q0=TypeError;mh.exports=J0(function(){if(this!=null&&this!==X0(this))throw new Q0("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0);});var Co=x((y2,gh)=>{var eA=xo(),tA=Nt().supportsDescriptors,rA=Object.getOwnPropertyDescriptor;gh.exports=function(){if(tA&&/a/mig.flags==="gim"){var e=rA(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d";}}),Object.defineProperty(n,"sticky",{get:function(){r+="y";}}),r==="dy")return e.get}}return eA};});var wh=x((w2,yh)=>{var nA=Nt().supportsDescriptors,iA=Co(),sA=Object.getOwnPropertyDescriptor,oA=Object.defineProperty,aA=TypeError,_h=Object.getPrototypeOf,lA=/a/;yh.exports=function(){if(!nA||!_h)throw new aA("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=iA(),r=_h(lA),n=sA(r,"flags");return (!n||n.get!==e)&&oA(r,"flags",{configurable:!0,enumerable:!1,get:e}),e};});var Eh=x((b2,vh)=>{var uA=Nt(),cA=Yt(),fA=xo(),bh=Co(),hA=wh(),Sh=cA(bh());uA(Sh,{getPolyfill:bh,implementation:fA,shim:hA});vh.exports=Sh;});var Ch=x((S2,xh)=>{var Ah=Symbol.iterator;xh.exports=function(e){if(e!=null&&typeof e[Ah]<"u")return e[Ah]()};});var Th=x((v2,Rh)=>{Rh.exports=K("util").inspect;});var Kh=x((E2,Vh)=>{var Lo=typeof Map=="function"&&Map.prototype,Ro=Object.getOwnPropertyDescriptor&&Lo?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,hi=Lo&&Ro&&typeof Ro.get=="function"?Ro.get:null,Ih=Lo&&Map.prototype.forEach,$o=typeof Set=="function"&&Set.prototype,To=Object.getOwnPropertyDescriptor&&$o?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,di=$o&&To&&typeof To.get=="function"?To.get:null,Ph=$o&&Set.prototype.forEach,dA=typeof WeakMap=="function"&&WeakMap.prototype,cn=dA?WeakMap.prototype.has:null,pA=typeof WeakSet=="function"&&WeakSet.prototype,fn=pA?WeakSet.prototype.has:null,mA=typeof WeakRef=="function"&&WeakRef.prototype,Oh=mA?WeakRef.prototype.deref:null,gA=Boolean.prototype.valueOf,_A=Object.prototype.toString,yA=Function.prototype.toString,wA=String.prototype.match,Do=String.prototype.slice,Lt=String.prototype.replace,bA=String.prototype.toUpperCase,Fh=String.prototype.toLowerCase,Uh=RegExp.prototype.test,Mh=Array.prototype.concat,dt=Array.prototype.join,SA=Array.prototype.slice,Nh=Math.floor,Oo=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Io=Object.getOwnPropertySymbols,Fo=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,vr=typeof Symbol=="function"&&typeof Symbol.iterator=="object",ke=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===vr||!0)?Symbol.toStringTag:null,Hh=Object.prototype.propertyIsEnumerable,kh=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Lh(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Uh.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Nh(-t):Nh(t);if(n!==t){var s=String(n),i=Do.call(e,s.length+1);return Lt.call(s,r,"$&_")+"."+Lt.call(Lt.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Lt.call(e,r,"$&_")}var Mo=Th(),$h=Mo.custom,Dh=Wh($h)?$h:null;Vh.exports=function t(e,r,n,s){var i=r||{};if(kt(i,"quoteStyle")&&i.quoteStyle!=="single"&&i.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(kt(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=kt(i,"customInspect")?i.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(kt(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(kt(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=i.numericSeparator;if(typeof e>"u")return "undefined";if(e===null)return "null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Gh(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return l?Lh(e,f):f}if(typeof e=="bigint"){var d=String(e)+"n";return l?Lh(e,d):d}var u=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=u&&u>0&&typeof e=="object")return No(e)?"[Array]":"[Object]";var p=qA(i,n);if(typeof s>"u")s=[];else if(zh(s,e)>=0)return "[Circular]";function m(G,te,I){if(te&&(s=SA.call(s),s.push(te)),I){var O={depth:i.depth};return kt(i,"quoteStyle")&&(O.quoteStyle=i.quoteStyle),t(G,O,n+1,s)}return t(G,i,n+1,s)}if(typeof e=="function"&&!qh(e)){var g=PA(e),y=fi(e,m);return "[Function"+(g?": "+g:" (anonymous)")+"]"+(y.length>0?" { "+dt.call(y,", ")+" }":"")}if(Wh(e)){var S=vr?Lt.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Fo.call(e);return typeof e=="object"&&!vr?un(S):S}if(LA(e)){for(var E="<"+Fh.call(String(e.nodeName)),A=e.attributes||[],b=0;b",E}if(No(e)){if(e.length===0)return "[]";var T=fi(e,m);return p&&!DA(T)?"["+ko(T,p)+"]":"[ "+dt.call(T,", ")+" ]"}if(AA(e)){var F=fi(e,m);return !("cause"in Error.prototype)&&"cause"in e&&!Hh.call(e,"cause")?"{ ["+String(e)+"] "+dt.call(Mh.call("[cause]: "+m(e.cause),F),", ")+" }":F.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+dt.call(F,", ")+" }"}if(typeof e=="object"&&o){if(Dh&&typeof e[Dh]=="function"&&Mo)return Mo(e,{depth:u-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(OA(e)){var k=[];return Ih&&Ih.call(e,function(G,te){k.push(m(te,e,!0)+" => "+m(G,e));}),Bh("Map",hi.call(e),k,p)}if(NA(e)){var H=[];return Ph&&Ph.call(e,function(G){H.push(m(G,e));}),Bh("Set",di.call(e),H,p)}if(FA(e))return Po("WeakMap");if(kA(e))return Po("WeakSet");if(MA(e))return Po("WeakRef");if(CA(e))return un(m(Number(e)));if(TA(e))return un(m(Oo.call(e)));if(RA(e))return un(gA.call(e));if(xA(e))return un(m(String(e)));if(typeof window<"u"&&e===window)return "{ [object Window] }";if(e===global)return "{ [object globalThis] }";if(!EA(e)&&!qh(e)){var B=fi(e,m),L=kh?kh(e)===Object.prototype:e instanceof Object||e.constructor===Object,M=e instanceof Object?"":"null prototype",U=!L&&ke&&Object(e)===e&&ke in e?Do.call($t(e),8,-1):M?"Object":"",R=L||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",z=R+(U||M?"["+dt.call(Mh.call([],U||[],M||[]),": ")+"] ":"");return B.length===0?z+"{}":p?z+"{"+ko(B,p)+"}":z+"{ "+dt.call(B,", ")+" }"}return String(e)};function jh(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function vA(t){return Lt.call(String(t),/"/g,""")}function No(t){return $t(t)==="[object Array]"&&(!ke||!(typeof t=="object"&&ke in t))}function EA(t){return $t(t)==="[object Date]"&&(!ke||!(typeof t=="object"&&ke in t))}function qh(t){return $t(t)==="[object RegExp]"&&(!ke||!(typeof t=="object"&&ke in t))}function AA(t){return $t(t)==="[object Error]"&&(!ke||!(typeof t=="object"&&ke in t))}function xA(t){return $t(t)==="[object String]"&&(!ke||!(typeof t=="object"&&ke in t))}function CA(t){return $t(t)==="[object Number]"&&(!ke||!(typeof t=="object"&&ke in t))}function RA(t){return $t(t)==="[object Boolean]"&&(!ke||!(typeof t=="object"&&ke in t))}function Wh(t){if(vr)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return !0;if(!t||typeof t!="object"||!Fo)return !1;try{return Fo.call(t),!0}catch{}return !1}function TA(t){if(!t||typeof t!="object"||!Oo)return !1;try{return Oo.call(t),!0}catch{}return !1}var IA=Object.prototype.hasOwnProperty||function(t){return t in this};function kt(t,e){return IA.call(t,e)}function $t(t){return _A.call(t)}function PA(t){if(t.name)return t.name;var e=wA.call(yA.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function zh(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Gh(Do.call(t,0,e.maxStringLength),e)+n}var s=Lt.call(Lt.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,$A);return jh(s,"single",e)}function $A(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+bA.call(e.toString(16))}function un(t){return "Object("+t+")"}function Po(t){return t+" { ? }"}function Bh(t,e,r,n){var s=n?ko(r,n):dt.call(r,", ");return t+" ("+e+") {"+s+"}"}function DA(t){for(var e=0;e=0)return !1;return !0}function qA(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=dt.call(Array(t.indent+1)," ");else return null;return {base:r,prev:dt.call(Array(e+1),r)}}function ko(t,e){if(t.length===0)return "";var r=` -`+e.prev+e.base;return r+dt.call(t,","+r)+` -`+e.prev}function fi(t,e){var r=No(t),n=[];if(r){n.length=t.length;for(var s=0;s{var qo=ot(),Er=tt(),BA=Kh(),UA=qo("%TypeError%"),pi=qo("%WeakMap%",!0),mi=qo("%Map%",!0),HA=Er("WeakMap.prototype.get",!0),jA=Er("WeakMap.prototype.set",!0),WA=Er("WeakMap.prototype.has",!0),zA=Er("Map.prototype.get",!0),GA=Er("Map.prototype.set",!0),VA=Er("Map.prototype.has",!0),Bo=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},KA=function(t,e){var r=Bo(t,e);return r&&r.value},ZA=function(t,e,r){var n=Bo(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r};},YA=function(t,e){return !!Bo(t,e)};Zh.exports=function(){var e,r,n,s={assert:function(i){if(!s.has(i))throw new UA("Side channel does not contain "+BA(i))},get:function(i){if(pi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return HA(e,i)}else if(mi){if(r)return zA(r,i)}else if(n)return KA(n,i)},has:function(i){if(pi&&i&&(typeof i=="object"||typeof i=="function")){if(e)return WA(e,i)}else if(mi){if(r)return VA(r,i)}else if(n)return YA(n,i);return !1},set:function(i,o){pi&&i&&(typeof i=="object"||typeof i=="function")?(e||(e=new pi),jA(e,i,o)):mi?(r||(r=new mi),GA(r,i,o)):(n||(n={key:{},next:null}),ZA(n,i,o));}};return s};});var Uo=x((x2,Xh)=>{var Jh=function(t){return t!==t};Xh.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||Jh(e)&&Jh(r))};});var Ho=x((C2,Qh)=>{var JA=Uo();Qh.exports=function(){return typeof Object.is=="function"?Object.is:JA};});var td=x((R2,ed)=>{var XA=Ho(),QA=Nt();ed.exports=function(){var e=XA();return QA(Object,{is:e},{is:function(){return Object.is!==e}}),e};});var sd=x((T2,id)=>{var ex=Nt(),tx=Yt(),rx=Uo(),rd=Ho(),nx=td(),nd=tx(rd(),Object);ex(nd,{getPolyfill:rd,implementation:rx,shim:nx});id.exports=nd;});var Dt=x((I2,od)=>{var ix=ni();od.exports=function(){return ix()&&!!Symbol.toStringTag};});var ud=x((P2,ld)=>{var sx=Dt()(),ox=tt(),jo=ox("Object.prototype.toString"),gi=function(e){return sx&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:jo(e)==="[object Arguments]"},ad=function(e){return gi(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&jo(e)!=="[object Array]"&&jo(e.callee)==="[object Function]"},ax=function(){return gi(arguments)}();gi.isLegacyArguments=ad;ld.exports=ax?gi:ad;});var fd=x((O2,cd)=>{var lx={}.toString;cd.exports=Array.isArray||function(t){return lx.call(t)=="[object Array]"};});var md=x((F2,pd)=>{var dd=Function.prototype.toString,Ar=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,zo,_i;if(typeof Ar=="function"&&typeof Object.defineProperty=="function")try{zo=Object.defineProperty({},"length",{get:function(){throw _i}}),_i={},Ar(function(){throw 42},null,zo);}catch(t){t!==_i&&(Ar=null);}else Ar=null;var ux=/^\s*class\b/,Go=function(e){try{var r=dd.call(e);return ux.test(r)}catch{return !1}},Wo=function(e){try{return Go(e)?!1:(dd.call(e),!0)}catch{return !1}},yi=Object.prototype.toString,cx="[object Object]",fx="[object Function]",hx="[object GeneratorFunction]",dx="[object HTMLAllCollection]",px="[object HTML document.all class]",mx="[object HTMLCollection]",gx=typeof Symbol=="function"&&!!Symbol.toStringTag,_x=!(0 in[,]),Vo=function(){return !1};typeof document=="object"&&(hd=document.all,yi.call(hd)===yi.call(document.all)&&(Vo=function(e){if((_x||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=yi.call(e);return (r===dx||r===px||r===mx||r===cx)&&e("")==null}catch{}return !1}));var hd;pd.exports=Ar?function(e){if(Vo(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;try{Ar(e,null,zo);}catch(r){if(r!==_i)return !1}return !Go(e)&&Wo(e)}:function(e){if(Vo(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;if(gx)return Wo(e);if(Go(e))return !1;var r=yi.call(e);return r!==fx&&r!==hx&&!/^\[object HTML/.test(r)?!1:Wo(e)};});var yd=x((M2,_d)=>{var yx=md(),wx=Object.prototype.toString,gd=Object.prototype.hasOwnProperty,bx=function(e,r,n){for(var s=0,i=e.length;s=3&&(s=n),wx.call(e)==="[object Array]"?bx(e,r,s):typeof e=="string"?Sx(e,r,s):vx(e,r,s);};_d.exports=Ex;});var bd=x((N2,wd)=>{var Ko=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],Ax=typeof globalThis>"u"?global:globalThis;wd.exports=function(){for(var e=[],r=0;r{var bi=yd(),xx=bd(),Sd=Yt(),Jo=tt(),wi=li(),Cx=Jo("Object.prototype.toString"),Ed=Dt()(),vd=typeof globalThis>"u"?global:globalThis,Yo=xx(),Xo=Jo("String.prototype.slice"),Zo=Object.getPrototypeOf,Rx=Jo("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n-1?r:r!=="Object"?!1:Ix(e)}return wi?Tx(e):null};});var Cd=x((L2,xd)=>{var Px=Qo();xd.exports=function(e){return !!Px(e)};});var ea=x(($2,Fd)=>{var Ox=Yt(),Fx=tt(),Od=ot(),Mx=Cd(),Rd=Od("ArrayBuffer",!0),Td=Od("Float32Array",!0),vi=Fx("ArrayBuffer.prototype.byteLength",!0),Id=Rd&&!vi&&new Rd().slice,Pd=Id&&Ox(Id);Fd.exports=vi||Pd?function(e){if(!e||typeof e!="object")return !1;try{return vi?vi(e):Pd(e,0),!0}catch{return !1}}:Td?function(e){try{return new Td(e).buffer===e&&!Mx(e)}catch(r){return typeof e=="object"&&r.name==="RangeError"}}:function(e){return !1};});var Nd=x((D2,Md)=>{var Nx=Date.prototype.getDay,kx=function(e){try{return Nx.call(e),!0}catch{return !1}},Lx=Object.prototype.toString,$x="[object Date]",Dx=Dt()();Md.exports=function(e){return typeof e!="object"||e===null?!1:Dx?kx(e):Lx.call(e)===$x};});var qd=x((q2,Dd)=>{var ta=tt(),kd=Dt()(),Ld,$d,ra,na;kd&&(Ld=ta("Object.prototype.hasOwnProperty"),$d=ta("RegExp.prototype.exec"),ra={},Ei=function(){throw ra},na={toString:Ei,valueOf:Ei},typeof Symbol.toPrimitive=="symbol"&&(na[Symbol.toPrimitive]=Ei));var Ei,qx=ta("Object.prototype.toString"),Bx=Object.getOwnPropertyDescriptor,Ux="[object RegExp]";Dd.exports=kd?function(e){if(!e||typeof e!="object")return !1;var r=Bx(e,"lastIndex"),n=r&&Ld(r,"value");if(!n)return !1;try{$d(e,na);}catch(s){return s===ra}}:function(e){return !e||typeof e!="object"&&typeof e!="function"?!1:qx(e)===Ux};});var Hd=x((B2,Ud)=>{var Hx=tt(),Bd=Hx("SharedArrayBuffer.prototype.byteLength",!0);Ud.exports=Bd?function(e){if(!e||typeof e!="object")return !1;try{return Bd(e),!0}catch{return !1}}:function(e){return !1};});var Wd=x((U2,jd)=>{var jx=String.prototype.valueOf,Wx=function(e){try{return jx.call(e),!0}catch{return !1}},zx=Object.prototype.toString,Gx="[object String]",Vx=Dt()();jd.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:Vx?Wx(e):zx.call(e)===Gx};});var Gd=x((H2,zd)=>{var Kx=Number.prototype.toString,Zx=function(e){try{return Kx.call(e),!0}catch{return !1}},Yx=Object.prototype.toString,Jx="[object Number]",Xx=Dt()();zd.exports=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:Xx?Zx(e):Yx.call(e)===Jx};});var Zd=x((j2,Kd)=>{var Vd=tt(),Qx=Vd("Boolean.prototype.toString"),eC=Vd("Object.prototype.toString"),tC=function(e){try{return Qx(e),!0}catch{return !1}},rC="[object Boolean]",nC=Dt()();Kd.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:nC&&Symbol.toStringTag in e?tC(e):eC(e)===rC};});var Qd=x((W2,ia)=>{var iC=Object.prototype.toString,sC=mo()();sC?(Yd=Symbol.prototype.toString,Jd=/^Symbol\(.*\)$/,Xd=function(e){return typeof e.valueOf()!="symbol"?!1:Jd.test(Yd.call(e))},ia.exports=function(e){if(typeof e=="symbol")return !0;if(iC.call(e)!=="[object Symbol]")return !1;try{return Xd(e)}catch{return !1}}):ia.exports=function(e){return !1};var Yd,Jd,Xd;});var rp=x((z2,tp)=>{var ep=typeof BigInt<"u"&&BigInt;tp.exports=function(){return typeof ep=="function"&&typeof BigInt=="function"&&typeof ep(42)=="bigint"&&typeof BigInt(42)=="bigint"};});var sp=x((G2,sa)=>{var oC=rp()();oC?(np=BigInt.prototype.valueOf,ip=function(e){try{return np.call(e),!0}catch{}return !1},sa.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:ip(e)}):sa.exports=function(e){return !1};var np,ip;});var ap=x((V2,op)=>{var aC=Wd(),lC=Gd(),uC=Zd(),cC=Qd(),fC=sp();op.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(aC(e))return "String";if(lC(e))return "Number";if(uC(e))return "Boolean";if(cC(e))return "Symbol";if(fC(e))return "BigInt"};});var fp=x((K2,cp)=>{var oa=typeof Map=="function"&&Map.prototype?Map:null,hC=typeof Set=="function"&&Set.prototype?Set:null,Ai;oa||(Ai=function(e){return !1});var up=oa?Map.prototype.has:null,lp=hC?Set.prototype.has:null;!Ai&&!up&&(Ai=function(e){return !1});cp.exports=Ai||function(e){if(!e||typeof e!="object")return !1;try{if(up.call(e),lp)try{lp.call(e);}catch{return !0}return e instanceof oa}catch{}return !1};});var mp=x((Z2,pp)=>{var dC=typeof Map=="function"&&Map.prototype?Map:null,aa=typeof Set=="function"&&Set.prototype?Set:null,xi;aa||(xi=function(e){return !1});var hp=dC?Map.prototype.has:null,dp=aa?Set.prototype.has:null;!xi&&!dp&&(xi=function(e){return !1});pp.exports=xi||function(e){if(!e||typeof e!="object")return !1;try{if(dp.call(e),hp)try{hp.call(e);}catch{return !0}return e instanceof aa}catch{}return !1};});var yp=x((Y2,_p)=>{var Ci=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,gp=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,Ri;Ci||(Ri=function(e){return !1});var ua=Ci?Ci.prototype.has:null,la=gp?gp.prototype.has:null;!Ri&&!ua&&(Ri=function(e){return !1});_p.exports=Ri||function(e){if(!e||typeof e!="object")return !1;try{if(ua.call(e,ua),la)try{la.call(e,la);}catch{return !0}return e instanceof Ci}catch{}return !1};});var bp=x((J2,fa)=>{var pC=ot(),wp=tt(),mC=pC("%WeakSet%",!0),ca=wp("WeakSet.prototype.has",!0);ca?(Ti=wp("WeakMap.prototype.has",!0),fa.exports=function(e){if(!e||typeof e!="object")return !1;try{if(ca(e,ca),Ti)try{Ti(e,Ti);}catch{return !0}return e instanceof mC}catch{}return !1}):fa.exports=function(e){return !1};var Ti;});var vp=x((X2,Sp)=>{var gC=fp(),_C=mp(),yC=yp(),wC=bp();Sp.exports=function(e){if(e&&typeof e=="object"){if(gC(e))return "Map";if(_C(e))return "Set";if(yC(e))return "WeakMap";if(wC(e))return "WeakSet"}return !1};});var xp=x((Q2,Ap)=>{var bC=tt(),Ep=bC("ArrayBuffer.prototype.byteLength",!0),SC=ea();Ap.exports=function(e){return SC(e)?Ep?Ep(e):e.byteLength:NaN};});var Ni=x((e$,Zp)=>{var Gp=uh(),pt=tt(),Cp=Eh(),vC=ot(),xr=Ch(),EC=Yh(),Rp=sd(),Tp=ud(),Ip=fd(),Pp=ea(),Op=Nd(),Fp=qd(),Mp=Hd(),Np=ri(),kp=ap(),Lp=vp(),$p=Qo(),Dp=xp(),qp=pt("SharedArrayBuffer.prototype.byteLength",!0),Bp=pt("Date.prototype.getTime"),ha=Object.getPrototypeOf,Up=pt("Object.prototype.toString"),Pi=vC("%Set%",!0),da=pt("Map.prototype.has",!0),Oi=pt("Map.prototype.get",!0),Hp=pt("Map.prototype.size",!0),Fi=pt("Set.prototype.add",!0),Vp=pt("Set.prototype.delete",!0),Mi=pt("Set.prototype.has",!0),Ii=pt("Set.prototype.size",!0);function jp(t,e,r,n){for(var s=xr(t),i;(i=s.next())&&!i.done;)if(at(e,i.value,r,n))return Vp(t,i.value),!0;return !1}function Kp(t){if(typeof t>"u")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function AC(t,e,r,n,s,i){var o=Kp(r);if(o!=null)return o;var l=Oi(e,o),f=Gp({},s,{strict:!1});return typeof l>"u"&&!da(e,o)||!at(n,l,f,i)?!1:!da(t,o)&&at(n,l,f,i)}function xC(t,e,r){var n=Kp(r);return n??(Mi(e,n)&&!Mi(t,n))}function Wp(t,e,r,n,s,i){for(var o=xr(t),l,f;(l=o.next())&&!l.done;)if(f=l.value,at(r,f,s,i)&&at(n,Oi(e,f),s,i))return Vp(t,f),!0;return !1}function at(t,e,r,n){var s=r||{};if(s.strict?Rp(t,e):t===e)return !0;var i=kp(t),o=kp(e);if(i!==o)return !1;if(!t||!e||typeof t!="object"&&typeof e!="object")return s.strict?Rp(t,e):t==e;var l=n.has(t),f=n.has(e),d;if(l&&f){if(n.get(t)===n.get(e))return !0}else d={};return l||n.set(t,d),f||n.set(e,d),TC(t,e,s,n)}function zp(t){return !t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function CC(t,e,r,n){if(Ii(t)!==Ii(e))return !1;for(var s=xr(t),i=xr(e),o,l,f;(o=s.next())&&!o.done;)if(o.value&&typeof o.value=="object")f||(f=new Pi),Fi(f,o.value);else if(!Mi(e,o.value)){if(r.strict||!xC(t,e,o.value))return !1;f||(f=new Pi),Fi(f,o.value);}if(f){for(;(l=i.next())&&!l.done;)if(l.value&&typeof l.value=="object"){if(!jp(f,l.value,r.strict,n))return !1}else if(!r.strict&&!Mi(t,l.value)&&!jp(f,l.value,r.strict,n))return !1;return Ii(f)===0}return !0}function RC(t,e,r,n){if(Hp(t)!==Hp(e))return !1;for(var s=xr(t),i=xr(e),o,l,f,d,u,p;(o=s.next())&&!o.done;)if(d=o.value[0],u=o.value[1],d&&typeof d=="object")f||(f=new Pi),Fi(f,d);else if(p=Oi(e,d),typeof p>"u"&&!da(e,d)||!at(u,p,r,n)){if(r.strict||!AC(t,e,d,u,r,n))return !1;f||(f=new Pi),Fi(f,d);}if(f){for(;(l=i.next())&&!l.done;)if(d=l.value[0],p=l.value[1],d&&typeof d=="object"){if(!Wp(f,t,d,p,r,n))return !1}else if(!r.strict&&(!t.has(d)||!at(Oi(t,d),p,r,n))&&!Wp(f,t,d,p,Gp({},r,{strict:!1}),n))return !1;return Ii(f)===0}return !0}function TC(t,e,r,n){var s,i;if(typeof t!=typeof e||t==null||e==null||Up(t)!==Up(e)||Tp(t)!==Tp(e))return !1;var o=Ip(t),l=Ip(e);if(o!==l)return !1;var f=t instanceof Error,d=e instanceof Error;if(f!==d||(f||d)&&(t.name!==e.name||t.message!==e.message))return !1;var u=Fp(t),p=Fp(e);if(u!==p||(u||p)&&(t.source!==e.source||Cp(t)!==Cp(e)))return !1;var m=Op(t),g=Op(e);if(m!==g||(m||g)&&Bp(t)!==Bp(e)||r.strict&&ha&&ha(t)!==ha(e))return !1;var y=$p(t),S=$p(e);if(y!==S)return !1;if(y||S){if(t.length!==e.length)return !1;for(s=0;s=0;s--)if(H[s]!=B[s])return !1;for(s=H.length-1;s>=0;s--)if(i=H[s],!at(t[i],e[i],r,n))return !1;var L=Lp(t),M=Lp(e);return L!==M?!1:L==="Set"||M==="Set"?CC(t,e,r,n):L==="Map"?RC(t,e,r,n):!0}Zp.exports=function(e,r,n){return at(e,r,n,EC())};});var sm={};jE(sm,{closest:()=>JC,distance:()=>im});var vt,ZC,YC,im,JC,om=HE(()=>{vt=new Uint32Array(65536),ZC=(t,e)=>{let r=t.length,n=e.length,s=1<{let r=e.length,n=t.length,s=[],i=[],o=Math.ceil(r/32),l=Math.ceil(n/32);for(let y=0;y>>b&1,k=s[b/32|0]>>>b&1,H=T|y,B=((T|k)&S)+S^S|T|k,L=y|~(B|S),M=S&B;L>>>31^F&&(i[b/32|0]^=1<>>31^k&&(s[b/32|0]^=1<>>y&1,A=s[y/32|0]>>>y&1,b=S|d,T=((S|A)&u)+u^u|S|A,F=d|~(T|u),k=u&T;g+=F>>>n-1&1,g-=k>>>n-1&1,F>>>31^E&&(i[y/32|0]^=1<>>31^A&&(s[y/32|0]^=1<{if(t.length{let r=1/0,n=0;for(let s=0;s{(function(){var t;try{t=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null;}catch{console.log("Collator could not be initialized and wouldn't be used");}var e=(om(),WE(sm)),r=[],n=[],s={get:function(i,o,l){var f=l&&t&&l.useCollator;if(f){var d=i.length,u=o.length;if(d===0)return u;if(u===0)return d;var p,m,g,y,S;for(g=0;gS&&(m=S),S=r[y+1]+1,m>S&&(m=S),r[y]=p;r[y]=m;}return m}return e.distance(i,o)}};typeof define<"u"&&define!==null&&define.amd?define(function(){return s}):typeof dn<"u"&&dn!==null&&typeof ya<"u"&&dn.exports===ya?dn.exports=s:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=s:typeof window<"u"&&window!==null&&(window.Levenshtein=s);})();});var Ae=x(va=>{va.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((s,i)=>s!=null?n(s):r(i)),t.apply(this,e);})},"name",{value:t.name})};va.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r);},"name",{value:t.name})};});var dm=x((l$,hm)=>{var Bt=K("constants"),eR=process.cwd,Hi=null,tR=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Hi||(Hi=eR.call(process)),Hi};try{process.cwd();}catch{}typeof process.chdir=="function"&&(Ea=process.chdir,process.chdir=function(t){Hi=null,Ea.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,Ea));var Ea;hm.exports=rR;function rR(t){Bt.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=i(t.chown),t.fchown=i(t.fchown),t.lchown=i(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=s(t.chmodSync),t.fchmodSync=s(t.fchmodSync),t.lchmodSync=s(t.lchmodSync),t.stat=l(t.stat),t.fstat=l(t.fstat),t.lstat=l(t.lstat),t.statSync=f(t.statSync),t.fstatSync=f(t.fstatSync),t.lstatSync=f(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(u,p,m){m&&process.nextTick(m);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(u,p,m,g){g&&process.nextTick(g);},t.lchownSync=function(){}),tR==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(u){function p(m,g,y){var S=Date.now(),E=0;u(m,g,function A(b){if(b&&(b.code==="EACCES"||b.code==="EPERM"||b.code==="EBUSY")&&Date.now()-S<6e4){setTimeout(function(){t.stat(g,function(T,F){T&&T.code==="ENOENT"?u(m,g,A):y(b);});},E),E<100&&(E+=10);return}y&&y(b);});}return Object.setPrototypeOf&&Object.setPrototypeOf(p,u),p}(t.rename)),t.read=typeof t.read!="function"?t.read:function(u){function p(m,g,y,S,E,A){var b;if(A&&typeof A=="function"){var T=0;b=function(F,k,H){if(F&&F.code==="EAGAIN"&&T<10)return T++,u.call(t,m,g,y,S,E,b);A.apply(this,arguments);};}return u.call(t,m,g,y,S,E,b)}return Object.setPrototypeOf&&Object.setPrototypeOf(p,u),p}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(u){return function(p,m,g,y,S){for(var E=0;;)try{return u.call(t,p,m,g,y,S)}catch(A){if(A.code==="EAGAIN"&&E<10){E++;continue}throw A}}}(t.readSync);function e(u){u.lchmod=function(p,m,g){u.open(p,Bt.O_WRONLY|Bt.O_SYMLINK,m,function(y,S){if(y){g&&g(y);return}u.fchmod(S,m,function(E){u.close(S,function(A){g&&g(E||A);});});});},u.lchmodSync=function(p,m){var g=u.openSync(p,Bt.O_WRONLY|Bt.O_SYMLINK,m),y=!0,S;try{S=u.fchmodSync(g,m),y=!1;}finally{if(y)try{u.closeSync(g);}catch{}else u.closeSync(g);}return S};}function r(u){Bt.hasOwnProperty("O_SYMLINK")&&u.futimes?(u.lutimes=function(p,m,g,y){u.open(p,Bt.O_SYMLINK,function(S,E){if(S){y&&y(S);return}u.futimes(E,m,g,function(A){u.close(E,function(b){y&&y(A||b);});});});},u.lutimesSync=function(p,m,g){var y=u.openSync(p,Bt.O_SYMLINK),S,E=!0;try{S=u.futimesSync(y,m,g),E=!1;}finally{if(E)try{u.closeSync(y);}catch{}else u.closeSync(y);}return S}):u.futimes&&(u.lutimes=function(p,m,g,y){y&&process.nextTick(y);},u.lutimesSync=function(){});}function n(u){return u&&function(p,m,g){return u.call(t,p,m,function(y){d(y)&&(y=null),g&&g.apply(this,arguments);})}}function s(u){return u&&function(p,m){try{return u.call(t,p,m)}catch(g){if(!d(g))throw g}}}function i(u){return u&&function(p,m,g,y){return u.call(t,p,m,g,function(S){d(S)&&(S=null),y&&y.apply(this,arguments);})}}function o(u){return u&&function(p,m,g){try{return u.call(t,p,m,g)}catch(y){if(!d(y))throw y}}}function l(u){return u&&function(p,m,g){typeof m=="function"&&(g=m,m=null);function y(S,E){E&&(E.uid<0&&(E.uid+=4294967296),E.gid<0&&(E.gid+=4294967296)),g&&g.apply(this,arguments);}return m?u.call(t,p,m,y):u.call(t,p,y)}}function f(u){return u&&function(p,m){var g=m?u.call(t,p,m):u.call(t,p);return g&&(g.uid<0&&(g.uid+=4294967296),g.gid<0&&(g.gid+=4294967296)),g}}function d(u){if(!u||u.code==="ENOSYS")return !0;var p=!process.getuid||process.getuid()!==0;return !!(p&&(u.code==="EINVAL"||u.code==="EPERM"))}}});var gm=x((u$,mm)=>{var pm=K("stream").Stream;mm.exports=nR;function nR(t){return {ReadStream:e,WriteStream:r};function e(n,s){if(!(this instanceof e))return new e(n,s);pm.call(this);var i=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,s=s||{};for(var o=Object.keys(s),l=0,f=o.length;lthis.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){i._read();});return}t.open(this.path,this.flags,this.mode,function(u,p){if(u){i.emit("error",u),i.readable=!1;return}i.fd=p,i.emit("open",p),i._read();});}function r(n,s){if(!(this instanceof r))return new r(n,s);pm.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var i=Object.keys(s),o=0,l=i.length;o= zero");this.pos=this.start;}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var ym=x((c$,_m)=>{_m.exports=sR;var iR=Object.getPrototypeOf||function(t){return t.__proto__};function sR(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:iR(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var Tr=x((f$,Ca)=>{var _e=K("fs"),oR=dm(),aR=gm(),lR=ym(),ji=K("util"),Ne,zi;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Ne=Symbol.for("graceful-fs.queue"),zi=Symbol.for("graceful-fs.previous")):(Ne="___graceful-fs.queue",zi="___graceful-fs.previous");function uR(){}function Sm(t,e){Object.defineProperty(t,Ne,{get:function(){return e}});}var er=uR;ji.debuglog?er=ji.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(er=function(){var t=ji.format.apply(ji,arguments);t="GFS4: "+t.split(/\n/).join(` -GFS4: `),console.error(t);});_e[Ne]||(wm=global[Ne]||[],Sm(_e,wm),_e.close=function(t){function e(r,n){return t.call(_e,r,function(s){s||bm(),typeof n=="function"&&n.apply(this,arguments);})}return Object.defineProperty(e,zi,{value:t}),e}(_e.close),_e.closeSync=function(t){function e(r){t.apply(_e,arguments),bm();}return Object.defineProperty(e,zi,{value:t}),e}(_e.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){er(_e[Ne]),K("assert").equal(_e[Ne].length,0);}));var wm;global[Ne]||Sm(global,_e[Ne]);Ca.exports=Aa(lR(_e));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!_e.__patched&&(Ca.exports=Aa(_e),_e.__patched=!0);function Aa(t){oR(t),t.gracefulify=Aa,t.createReadStream=k,t.createWriteStream=H;var e=t.readFile;t.readFile=r;function r(M,U,R){return typeof U=="function"&&(R=U,U=null),z(M,U,R);function z(G,te,I,O){return e(G,te,function(X){X&&(X.code==="EMFILE"||X.code==="ENFILE")?Rr([z,[G,te,I],X,O||Date.now(),Date.now()]):typeof I=="function"&&I.apply(this,arguments);})}}var n=t.writeFile;t.writeFile=s;function s(M,U,R,z){return typeof R=="function"&&(z=R,R=null),G(M,U,R,z);function G(te,I,O,X,Q){return n(te,I,O,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Rr([G,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}var i=t.appendFile;i&&(t.appendFile=o);function o(M,U,R,z){return typeof R=="function"&&(z=R,R=null),G(M,U,R,z);function G(te,I,O,X,Q){return i(te,I,O,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Rr([G,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}var l=t.copyFile;l&&(t.copyFile=f);function f(M,U,R,z){return typeof R=="function"&&(z=R,R=0),G(M,U,R,z);function G(te,I,O,X,Q){return l(te,I,O,function(ie){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Rr([G,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}var d=t.readdir;t.readdir=p;var u=/^v[0-5]\./;function p(M,U,R){typeof U=="function"&&(R=U,U=null);var z=u.test(process.version)?function(I,O,X,Q){return d(I,G(I,O,X,Q))}:function(I,O,X,Q){return d(I,O,G(I,O,X,Q))};return z(M,U,R);function G(te,I,O,X){return function(Q,ie){Q&&(Q.code==="EMFILE"||Q.code==="ENFILE")?Rr([z,[te,I,O],Q,X||Date.now(),Date.now()]):(ie&&ie.sort&&ie.sort(),typeof O=="function"&&O.call(this,Q,ie));}}}if(process.version.substr(0,4)==="v0.8"){var m=aR(t);A=m.ReadStream,T=m.WriteStream;}var g=t.ReadStream;g&&(A.prototype=Object.create(g.prototype),A.prototype.open=b);var y=t.WriteStream;y&&(T.prototype=Object.create(y.prototype),T.prototype.open=F),Object.defineProperty(t,"ReadStream",{get:function(){return A},set:function(M){A=M;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return T},set:function(M){T=M;},enumerable:!0,configurable:!0});var S=A;Object.defineProperty(t,"FileReadStream",{get:function(){return S},set:function(M){S=M;},enumerable:!0,configurable:!0});var E=T;Object.defineProperty(t,"FileWriteStream",{get:function(){return E},set:function(M){E=M;},enumerable:!0,configurable:!0});function A(M,U){return this instanceof A?(g.apply(this,arguments),this):A.apply(Object.create(A.prototype),arguments)}function b(){var M=this;L(M.path,M.flags,M.mode,function(U,R){U?(M.autoClose&&M.destroy(),M.emit("error",U)):(M.fd=R,M.emit("open",R),M.read());});}function T(M,U){return this instanceof T?(y.apply(this,arguments),this):T.apply(Object.create(T.prototype),arguments)}function F(){var M=this;L(M.path,M.flags,M.mode,function(U,R){U?(M.destroy(),M.emit("error",U)):(M.fd=R,M.emit("open",R));});}function k(M,U){return new t.ReadStream(M,U)}function H(M,U){return new t.WriteStream(M,U)}var B=t.open;t.open=L;function L(M,U,R,z){return typeof R=="function"&&(z=R,R=null),G(M,U,R,z);function G(te,I,O,X,Q){return B(te,I,O,function(ie,$e){ie&&(ie.code==="EMFILE"||ie.code==="ENFILE")?Rr([G,[te,I,O,X],ie,Q||Date.now(),Date.now()]):typeof X=="function"&&X.apply(this,arguments);})}}return t}function Rr(t){er("ENQUEUE",t[0].name,t[1]),_e[Ne].push(t),xa();}var Wi;function bm(){for(var t=Date.now(),e=0;e<_e[Ne].length;++e)_e[Ne][e].length>2&&(_e[Ne][e][3]=t,_e[Ne][e][4]=t);xa();}function xa(){if(clearTimeout(Wi),Wi=void 0,_e[Ne].length!==0){var t=_e[Ne].shift(),e=t[0],r=t[1],n=t[2],s=t[3],i=t[4];if(s===void 0)er("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-s>=6e4){er("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n);}else {var l=Date.now()-i,f=Math.max(i-s,1),d=Math.min(f*1.2,100);l>=d?(er("RETRY",e.name,r),e.apply(null,r.concat([s]))):_e[Ne].push(t);}Wi===void 0&&(Wi=setTimeout(xa,0));}}});var qe=x(Et=>{var vm=Ae().fromCallback,De=Tr(),cR=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof De[t]=="function");Object.assign(Et,De);cR.forEach(t=>{Et[t]=vm(De[t]);});Et.exists=function(t,e){return typeof e=="function"?De.exists(t,e):new Promise(r=>De.exists(t,r))};Et.read=function(t,e,r,n,s,i){return typeof i=="function"?De.read(t,e,r,n,s,i):new Promise((o,l)=>{De.read(t,e,r,n,s,(f,d,u)=>{if(f)return l(f);o({bytesRead:d,buffer:u});});})};Et.write=function(t,e,...r){return typeof r[r.length-1]=="function"?De.write(t,e,...r):new Promise((n,s)=>{De.write(t,e,...r,(i,o,l)=>{if(i)return s(i);n({bytesWritten:o,buffer:l});});})};Et.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?De.readv(t,e,...r):new Promise((n,s)=>{De.readv(t,e,...r,(i,o,l)=>{if(i)return s(i);n({bytesRead:o,buffers:l});});})};Et.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?De.writev(t,e,...r):new Promise((n,s)=>{De.writev(t,e,...r,(i,o,l)=>{if(i)return s(i);n({bytesWritten:o,buffers:l});});})};typeof De.realpath.native=="function"?Et.realpath.native=vm(De.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var Am=x((d$,Em)=>{var fR=K("path");Em.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(fR.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}};});var Tm=x((p$,Ra)=>{var xm=qe(),{checkPath:Cm}=Am(),Rm=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};Ra.exports.makeDir=async(t,e)=>(Cm(t),xm.mkdir(t,{mode:Rm(e),recursive:!0}));Ra.exports.makeDirSync=(t,e)=>(Cm(t),xm.mkdirSync(t,{mode:Rm(e),recursive:!0}));});var lt=x((m$,Im)=>{var hR=Ae().fromPromise,{makeDir:dR,makeDirSync:Ta}=Tm(),Ia=hR(dR);Im.exports={mkdirs:Ia,mkdirsSync:Ta,mkdirp:Ia,mkdirpSync:Ta,ensureDir:Ia,ensureDirSync:Ta};});var Ut=x((g$,Om)=>{var pR=Ae().fromPromise,Pm=qe();function mR(t){return Pm.access(t).then(()=>!0).catch(()=>!1)}Om.exports={pathExists:pR(mR),pathExistsSync:Pm.existsSync};});var Pa=x((_$,Fm)=>{var Ir=qe(),gR=Ae().fromPromise;async function _R(t,e,r){let n=await Ir.open(t,"r+"),s=null;try{await Ir.futimes(n,e,r);}finally{try{await Ir.close(n);}catch(i){s=i;}}if(s)throw s}function yR(t,e,r){let n=Ir.openSync(t,"r+");return Ir.futimesSync(n,e,r),Ir.closeSync(n)}Fm.exports={utimesMillis:gR(_R),utimesMillisSync:yR};});var tr=x((y$,Lm)=>{var Pr=qe(),xe=K("path"),Mm=Ae().fromPromise;function wR(t,e,r){let n=r.dereference?s=>Pr.stat(s,{bigint:!0}):s=>Pr.lstat(s,{bigint:!0});return Promise.all([n(t),n(e).catch(s=>{if(s.code==="ENOENT")return null;throw s})]).then(([s,i])=>({srcStat:s,destStat:i}))}function bR(t,e,r){let n,s=r.dereference?o=>Pr.statSync(o,{bigint:!0}):o=>Pr.lstatSync(o,{bigint:!0}),i=s(t);try{n=s(e);}catch(o){if(o.code==="ENOENT")return {srcStat:i,destStat:null};throw o}return {srcStat:i,destStat:n}}async function SR(t,e,r,n){let{srcStat:s,destStat:i}=await wR(t,e,n);if(i){if(gn(s,i)){let o=xe.basename(t),l=xe.basename(e);if(r==="move"&&o!==l&&o.toLowerCase()===l.toLowerCase())return {srcStat:s,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(s.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!s.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(s.isDirectory()&&Oa(t,e))throw new Error(Gi(t,e,r));return {srcStat:s,destStat:i}}function vR(t,e,r,n){let{srcStat:s,destStat:i}=bR(t,e,n);if(i){if(gn(s,i)){let o=xe.basename(t),l=xe.basename(e);if(r==="move"&&o!==l&&o.toLowerCase()===l.toLowerCase())return {srcStat:s,destStat:i,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(s.isDirectory()&&!i.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!s.isDirectory()&&i.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(s.isDirectory()&&Oa(t,e))throw new Error(Gi(t,e,r));return {srcStat:s,destStat:i}}async function Nm(t,e,r,n){let s=xe.resolve(xe.dirname(t)),i=xe.resolve(xe.dirname(r));if(i===s||i===xe.parse(i).root)return;let o;try{o=await Pr.stat(i,{bigint:!0});}catch(l){if(l.code==="ENOENT")return;throw l}if(gn(e,o))throw new Error(Gi(t,r,n));return Nm(t,e,i,n)}function km(t,e,r,n){let s=xe.resolve(xe.dirname(t)),i=xe.resolve(xe.dirname(r));if(i===s||i===xe.parse(i).root)return;let o;try{o=Pr.statSync(i,{bigint:!0});}catch(l){if(l.code==="ENOENT")return;throw l}if(gn(e,o))throw new Error(Gi(t,r,n));return km(t,e,i,n)}function gn(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function Oa(t,e){let r=xe.resolve(t).split(xe.sep).filter(s=>s),n=xe.resolve(e).split(xe.sep).filter(s=>s);return r.every((s,i)=>n[i]===s)}function Gi(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}Lm.exports={checkPaths:Mm(SR),checkPathsSync:vR,checkParentPaths:Mm(Nm),checkParentPathsSync:km,isSrcSubdir:Oa,areIdentical:gn};});var Um=x((w$,Bm)=>{var Le=qe(),_n=K("path"),{mkdirs:ER}=lt(),{pathExists:AR}=Ut(),{utimesMillis:xR}=Pa(),yn=tr();async function CR(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; +var EO=Object.create;var Bo=Object.defineProperty;var RO=Object.getOwnPropertyDescriptor;var CO=Object.getOwnPropertyNames;var xO=Object.getPrototypeOf,TO=Object.prototype.hasOwnProperty;var oe=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var AO=(t,e)=>()=>(t&&(e=t(t=0)),e);var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),PO=(t,e)=>{for(var r in e)Bo(t,r,{get:e[r],enumerable:!0});},Gg=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of CO(e))!TO.call(t,i)&&i!==r&&Bo(t,i,{get:()=>e[i],enumerable:!(n=RO(e,i))||n.enumerable});return t};var $t=(t,e,r)=>(r=t!=null?EO(xO(t)):{},Gg(e||!t||!t.__esModule?Bo(r,"default",{value:t,enumerable:!0}):r,t)),DO=t=>Gg(Bo({},"__esModule",{value:!0}),t);var wl=A((Yz,Jg)=>{var Zg=Object.prototype.toString;Jg.exports=function(e){var r=Zg.call(e),n=r==="[object Arguments]";return n||(n=r!=="[object Array]"&&e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Zg.call(e.callee)==="[object Function]"),n};});var s_=A((Xz,i_)=>{var n_;Object.keys||(Ts=Object.prototype.hasOwnProperty,Sl=Object.prototype.toString,Yg=wl(),El=Object.prototype.propertyIsEnumerable,Xg=!El.call({toString:null},"toString"),Qg=El.call(function(){},"prototype"),As=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Vo=function(t){var e=t.constructor;return e&&e.prototype===t},e_={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},t_=function(){if(typeof window>"u")return !1;for(var t in window)try{if(!e_["$"+t]&&Ts.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{Vo(window[t]);}catch{return !0}}catch{return !0}return !1}(),r_=function(t){if(typeof window>"u"||!t_)return Vo(t);try{return Vo(t)}catch{return !1}},n_=function(e){var r=e!==null&&typeof e=="object",n=Sl.call(e)==="[object Function]",i=Yg(e),s=r&&Sl.call(e)==="[object String]",o=[];if(!r&&!n&&!i)throw new TypeError("Object.keys called on a non-object");var a=Qg&&n;if(s&&e.length>0&&!Ts.call(e,0))for(var l=0;l0)for(var d=0;d{var MO=Array.prototype.slice,FO=wl(),o_=Object.keys,Go=o_?function(e){return o_(e)}:s_(),a_=Object.keys;Go.shim=function(){if(Object.keys){var e=function(){var r=Object.keys(arguments);return r&&r.length===arguments.length}(1,2);e||(Object.keys=function(n){return FO(n)?a_(MO.call(n)):a_(n)});}else Object.keys=Go;return Object.keys||Go};u_.exports=Go;});var Zo=A((e6,c_)=>{c_.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return !1;if(typeof Symbol.iterator=="symbol")return !0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return !1;var i=42;e[r]=i;for(r in e)return !1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return !1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return !1;if(typeof Object.getOwnPropertyDescriptor=="function"){var o=Object.getOwnPropertyDescriptor(e,r);if(o.value!==i||o.enumerable!==!0)return !1}return !0};});var Rl=A((t6,f_)=>{var l_=typeof Symbol<"u"&&Symbol,NO=Zo();f_.exports=function(){return typeof l_!="function"||typeof Symbol!="function"||typeof l_("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:NO()};});var p_=A((r6,h_)=>{var d_={foo:{}},qO=Object;h_.exports=function(){return {__proto__:d_}.foo===d_.foo&&!({__proto__:null}instanceof qO)};});var __=A((n6,g_)=>{var LO="Function.prototype.bind called on incompatible ",$O=Object.prototype.toString,jO=Math.max,HO="[object Function]",m_=function(e,r){for(var n=[],i=0;i{var UO=__();y_.exports=Function.prototype.bind||UO;});var v_=A((s6,b_)=>{var zO=Function.prototype.call,VO=Object.prototype.hasOwnProperty,GO=Jo();b_.exports=GO.call(zO,VO);});var Ar=A((o6,C_)=>{var De,xi=SyntaxError,R_=Function,Ci=TypeError,Cl=function(t){try{return R_('"use strict"; return ('+t+").constructor;")()}catch{}},Vn=Object.getOwnPropertyDescriptor;var xl=function(){throw new Ci},KO=Vn?function(){try{return xl}catch{try{return Vn(arguments,"callee").get}catch{return xl}}}():xl,Ei=Rl()(),ZO=p_()(),gt=Object.getPrototypeOf||(ZO?function(t){return t.__proto__}:null),Ri={},JO=typeof Uint8Array>"u"||!gt?De:gt(Uint8Array),Gn={"%AggregateError%":typeof AggregateError>"u"?De:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?De:ArrayBuffer,"%ArrayIteratorPrototype%":Ei&>?gt([][Symbol.iterator]()):De,"%AsyncFromSyncIteratorPrototype%":De,"%AsyncFunction%":Ri,"%AsyncGenerator%":Ri,"%AsyncGeneratorFunction%":Ri,"%AsyncIteratorPrototype%":Ri,"%Atomics%":typeof Atomics>"u"?De:Atomics,"%BigInt%":typeof BigInt>"u"?De:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?De:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?De:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?De:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":typeof Float32Array>"u"?De:Float32Array,"%Float64Array%":typeof Float64Array>"u"?De:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?De:FinalizationRegistry,"%Function%":R_,"%GeneratorFunction%":Ri,"%Int8Array%":typeof Int8Array>"u"?De:Int8Array,"%Int16Array%":typeof Int16Array>"u"?De:Int16Array,"%Int32Array%":typeof Int32Array>"u"?De:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ei&>?gt(gt([][Symbol.iterator]())):De,"%JSON%":typeof JSON=="object"?JSON:De,"%Map%":typeof Map>"u"?De:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ei||!gt?De:gt(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?De:Promise,"%Proxy%":typeof Proxy>"u"?De:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":typeof Reflect>"u"?De:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?De:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ei||!gt?De:gt(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?De:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ei&>?gt(""[Symbol.iterator]()):De,"%Symbol%":Ei?Symbol:De,"%SyntaxError%":xi,"%ThrowTypeError%":KO,"%TypedArray%":JO,"%TypeError%":Ci,"%Uint8Array%":typeof Uint8Array>"u"?De:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?De:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?De:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?De:Uint32Array,"%URIError%":URIError,"%WeakMap%":typeof WeakMap>"u"?De:WeakMap,"%WeakRef%":typeof WeakRef>"u"?De:WeakRef,"%WeakSet%":typeof WeakSet>"u"?De:WeakSet};var YO=function t(e){var r;if(e==="%AsyncFunction%")r=Cl("async function () {}");else if(e==="%GeneratorFunction%")r=Cl("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Cl("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype);}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&>&&(r=gt(i.prototype));}return Gn[e]=r,r},S_={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Ps=Jo(),Yo=v_(),XO=Ps.call(Function.call,Array.prototype.concat),QO=Ps.call(Function.apply,Array.prototype.splice),E_=Ps.call(Function.call,String.prototype.replace),Xo=Ps.call(Function.call,String.prototype.slice),eI=Ps.call(Function.call,RegExp.prototype.exec),tI=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,rI=/\\(\\)?/g,nI=function(e){var r=Xo(e,0,1),n=Xo(e,-1);if(r==="%"&&n!=="%")throw new xi("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new xi("invalid intrinsic syntax, expected opening `%`");var i=[];return E_(e,tI,function(s,o,a,l){i[i.length]=a?E_(l,rI,"$1"):o||s;}),i},iI=function(e,r){var n=e,i;if(Yo(S_,n)&&(i=S_[n],n="%"+i[0]+"%"),Yo(Gn,n)){var s=Gn[n];if(s===Ri&&(s=YO(n)),typeof s>"u"&&!r)throw new Ci("intrinsic "+e+" exists, but is not available. Please file an issue!");return {alias:i,name:n,value:s}}throw new xi("intrinsic "+e+" does not exist!")};C_.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new Ci("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new Ci('"allowMissing" argument must be a boolean');if(eI(/^%?[^%]*%?$/,e)===null)throw new xi("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=nI(e),i=n.length>0?n[0]:"",s=iI("%"+i+"%",r),o=s.name,a=s.value,l=!1,d=s.alias;d&&(i=d[0],QO(n,XO([0,1],d)));for(var c=1,p=!0;c=n.length){var E=Vn(a,m);p=!!E,p&&"get"in E&&!("originalValue"in E.get)?a=E.get:a=a[m];}else p=Yo(a,m),a=a[m];p&&!l&&(Gn[o]=a);}}return a};});var Ds=A((a6,x_)=>{var sI=Ar(),Tl=sI("%Object.defineProperty%",!0),Al=function(){if(Tl)try{return Tl({},"a",{value:1}),!0}catch{return !1}return !1};Al.hasArrayLengthDefineBug=function(){if(!Al())return null;try{return Tl([],"length",{value:1}).length!==1}catch{return !0}};x_.exports=Al;});var ea=A((u6,T_)=>{var oI=Ar(),Qo=oI("%Object.getOwnPropertyDescriptor%",!0);if(Qo)try{Qo([],"length");}catch{Qo=null;}T_.exports=Qo;});var ta=A((c6,P_)=>{var aI=Ds()(),Pl=Ar(),Os=aI&&Pl("%Object.defineProperty%",!0);if(Os)try{Os({},"a",{value:1});}catch{Os=!1;}var uI=Pl("%SyntaxError%"),Ti=Pl("%TypeError%"),A_=ea();P_.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new Ti("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Ti("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Ti("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Ti("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Ti("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Ti("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,s=arguments.length>4?arguments[4]:null,o=arguments.length>5?arguments[5]:null,a=arguments.length>6?arguments[6]:!1,l=!!A_&&A_(e,r);if(Os)Os(e,r,{configurable:o===null&&l?l.configurable:!o,enumerable:i===null&&l?l.enumerable:!i,value:n,writable:s===null&&l?l.writable:!s});else if(a||!i&&!s&&!o)e[r]=n;else throw new uI("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")};});var gn=A((l6,k_)=>{var cI=Ko(),lI=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",fI=Object.prototype.toString,dI=Array.prototype.concat,D_=ta(),hI=function(t){return typeof t=="function"&&fI.call(t)==="[object Function]"},O_=Ds()(),pI=function(t,e,r,n){if(e in t){if(n===!0){if(t[e]===r)return}else if(!hI(n)||!n())return}O_?D_(t,e,r,!0):D_(t,e,r);},I_=function(t,e){var r=arguments.length>2?arguments[2]:{},n=cI(e);lI&&(n=dI.call(n,Object.getOwnPropertySymbols(e)));for(var i=0;i{var q_=Ar(),M_=ta(),mI=Ds()(),F_=ea(),N_=q_("%TypeError%"),gI=q_("%Math.floor%");L_.exports=function(e,r){if(typeof e!="function")throw new N_("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||gI(r)!==r)throw new N_("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,s=!0;if("length"in e&&F_){var o=F_(e,"length");o&&!o.configurable&&(i=!1),o&&!o.writable&&(s=!1);}return (i||s||!n)&&(mI?M_(e,"length",r,!0,!0):M_(e,"length",r)),e};});var Kn=A((d6,ra)=>{var Dl=Jo(),Ai=Ar(),_I=$_(),yI=Ai("%TypeError%"),H_=Ai("%Function.prototype.apply%"),W_=Ai("%Function.prototype.call%"),B_=Ai("%Reflect.apply%",!0)||Dl.call(W_,H_),Is=Ai("%Object.defineProperty%",!0),bI=Ai("%Math.max%");if(Is)try{Is({},"a",{value:1});}catch{Is=null;}ra.exports=function(e){if(typeof e!="function")throw new yI("a function is required");var r=B_(Dl,W_,arguments);return _I(r,1+bI(0,e.length-(arguments.length-1)),!0)};var j_=function(){return B_(Dl,H_,arguments)};Is?Is(ra.exports,"apply",{value:j_}):ra.exports.apply=j_;});var mr=A((h6,V_)=>{var U_=Ar(),z_=Kn(),vI=z_(U_("String.prototype.indexOf"));V_.exports=function(e,r){var n=U_(e,!!r);return typeof n=="function"&&vI(e,".prototype.")>-1?z_(n):n};});var Ol=A((p6,Y_)=>{var wI=Ko(),Z_=Zo()(),J_=mr(),G_=Object,SI=J_("Array.prototype.push"),K_=J_("Object.prototype.propertyIsEnumerable"),EI=Z_?Object.getOwnPropertySymbols:null;Y_.exports=function(e,r){if(e==null)throw new TypeError("target must be an object");var n=G_(e);if(arguments.length===1)return n;for(var i=1;i{var Il=Ol(),RI=function(){if(!Object.assign)return !1;for(var t="abcdefghijklmnopqrst",e=t.split(""),r={},n=0;n{var xI=gn(),TI=kl();Q_.exports=function(){var e=TI();return xI(Object,{assign:e},{assign:function(){return Object.assign!==e}}),e};});var iy=A((_6,ny)=>{var AI=gn(),PI=Kn(),DI=Ol(),ty=kl(),OI=ey(),II=PI.apply(ty()),ry=function(e,r){return II(Object,arguments)};AI(ry,{getPolyfill:ty,implementation:DI,shim:OI});ny.exports=ry;});var oy=A((y6,sy)=>{var Ms=function(){return typeof function(){}.name=="string"},ks=Object.getOwnPropertyDescriptor;Ms.functionsHaveConfigurableNames=function(){if(!Ms()||!ks)return !1;var e=ks(function(){},"name");return !!e&&!!e.configurable};var kI=Function.prototype.bind;Ms.boundFunctionsHaveNames=function(){return Ms()&&typeof kI=="function"&&function(){}.bind().name!==""};sy.exports=Ms;});var cy=A((b6,uy)=>{var ay=ta(),MI=Ds()(),FI=oy().functionsHaveConfigurableNames(),NI=TypeError;uy.exports=function(e,r){if(typeof e!="function")throw new NI("`fn` is not a function");var n=arguments.length>2&&!!arguments[2];return (!n||FI)&&(MI?ay(e,"name",r,!0,!0):ay(e,"name",r)),e};});var Ml=A((v6,ly)=>{var qI=cy(),LI=Object,$I=TypeError;ly.exports=qI(function(){if(this!=null&&this!==LI(this))throw new $I("RegExp.prototype.flags getter called on non-object");var e="";return this.hasIndices&&(e+="d"),this.global&&(e+="g"),this.ignoreCase&&(e+="i"),this.multiline&&(e+="m"),this.dotAll&&(e+="s"),this.unicode&&(e+="u"),this.unicodeSets&&(e+="v"),this.sticky&&(e+="y"),e},"get flags",!0);});var Fl=A((w6,fy)=>{var jI=Ml(),HI=gn().supportsDescriptors,WI=Object.getOwnPropertyDescriptor;fy.exports=function(){if(HI&&/a/mig.flags==="gim"){var e=WI(RegExp.prototype,"flags");if(e&&typeof e.get=="function"&&typeof RegExp.prototype.dotAll=="boolean"&&typeof RegExp.prototype.hasIndices=="boolean"){var r="",n={};if(Object.defineProperty(n,"hasIndices",{get:function(){r+="d";}}),Object.defineProperty(n,"sticky",{get:function(){r+="y";}}),r==="dy")return e.get}}return jI};});var py=A((S6,hy)=>{var BI=gn().supportsDescriptors,UI=Fl(),zI=Object.getOwnPropertyDescriptor,VI=Object.defineProperty,GI=TypeError,dy=Object.getPrototypeOf,KI=/a/;hy.exports=function(){if(!BI||!dy)throw new GI("RegExp.prototype.flags requires a true ES5 environment that supports property descriptors");var e=UI(),r=dy(KI),n=zI(r,"flags");return (!n||n.get!==e)&&VI(r,"flags",{configurable:!0,enumerable:!1,get:e}),e};});var yy=A((E6,_y)=>{var ZI=gn(),JI=Kn(),YI=Ml(),my=Fl(),XI=py(),gy=JI(my());ZI(gy,{getPolyfill:my,implementation:YI,shim:XI});_y.exports=gy;});var wy=A((R6,vy)=>{var by=Symbol.iterator;vy.exports=function(e){if(e!=null&&typeof e[by]<"u")return e[by]()};});var Ey=A((C6,Sy)=>{Sy.exports=oe("util").inspect;});var By=A((x6,Wy)=>{var zl=typeof Map=="function"&&Map.prototype,Nl=Object.getOwnPropertyDescriptor&&zl?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ia=zl&&Nl&&typeof Nl.get=="function"?Nl.get:null,Ry=zl&&Map.prototype.forEach,Vl=typeof Set=="function"&&Set.prototype,ql=Object.getOwnPropertyDescriptor&&Vl?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,sa=Vl&&ql&&typeof ql.get=="function"?ql.get:null,Cy=Vl&&Set.prototype.forEach,QI=typeof WeakMap=="function"&&WeakMap.prototype,Ns=QI?WeakMap.prototype.has:null,ek=typeof WeakSet=="function"&&WeakSet.prototype,qs=ek?WeakSet.prototype.has:null,tk=typeof WeakRef=="function"&&WeakRef.prototype,xy=tk?WeakRef.prototype.deref:null,rk=Boolean.prototype.valueOf,nk=Object.prototype.toString,ik=Function.prototype.toString,sk=String.prototype.match,Gl=String.prototype.slice,yn=String.prototype.replace,ok=String.prototype.toUpperCase,Ty=String.prototype.toLowerCase,Ny=RegExp.prototype.test,Ay=Array.prototype.concat,$r=Array.prototype.join,ak=Array.prototype.slice,Py=Math.floor,jl=typeof BigInt=="function"?BigInt.prototype.valueOf:null,Ll=Object.getOwnPropertySymbols,Hl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,Pi=typeof Symbol=="function"&&typeof Symbol.iterator=="object",Dt=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===Pi||!0)?Symbol.toStringTag:null,qy=Object.prototype.propertyIsEnumerable,Dy=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Oy(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Ny.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-Py(-t):Py(t);if(n!==t){var i=String(n),s=Gl.call(e,i.length+1);return yn.call(i,r,"$&_")+"."+yn.call(yn.call(s,/([0-9]{3})/g,"$&_"),/_$/,"")}}return yn.call(e,r,"$&_")}var Wl=Ey(),Iy=Wl.custom,ky=$y(Iy)?Iy:null;Wy.exports=function t(e,r,n,i){var s=r||{};if(_n(s,"quoteStyle")&&s.quoteStyle!=="single"&&s.quoteStyle!=="double")throw new TypeError('option "quoteStyle" must be "single" or "double"');if(_n(s,"maxStringLength")&&(typeof s.maxStringLength=="number"?s.maxStringLength<0&&s.maxStringLength!==1/0:s.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var o=_n(s,"customInspect")?s.customInspect:!0;if(typeof o!="boolean"&&o!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(_n(s,"indent")&&s.indent!==null&&s.indent!==" "&&!(parseInt(s.indent,10)===s.indent&&s.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(_n(s,"numericSeparator")&&typeof s.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var a=s.numericSeparator;if(typeof e>"u")return "undefined";if(e===null)return "null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Hy(e,s);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var l=String(e);return a?Oy(e,l):l}if(typeof e=="bigint"){var d=String(e)+"n";return a?Oy(e,d):d}var c=typeof s.depth>"u"?5:s.depth;if(typeof n>"u"&&(n=0),n>=c&&c>0&&typeof e=="object")return Bl(e)?"[Array]":"[Object]";var p=Ck(s,n);if(typeof i>"u")i=[];else if(jy(i,e)>=0)return "[Circular]";function m(ae,ye,q){if(ye&&(i=ak.call(i),i.push(ye)),q){var W={depth:s.depth};return _n(s,"quoteStyle")&&(W.quoteStyle=s.quoteStyle),t(ae,W,n+1,i)}return t(ae,s,n+1,i)}if(typeof e=="function"&&!My(e)){var _=gk(e),w=na(e,m);return "[Function"+(_?": "+_:" (anonymous)")+"]"+(w.length>0?" { "+$r.call(w,", ")+" }":"")}if($y(e)){var E=Pi?yn.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):Hl.call(e);return typeof e=="object"&&!Pi?Fs(E):E}if(Sk(e)){for(var P="<"+Ty.call(String(e.nodeName)),D=e.attributes||[],g=0;g",P}if(Bl(e)){if(e.length===0)return "[]";var S=na(e,m);return p&&!Rk(S)?"["+Ul(S,p)+"]":"[ "+$r.call(S,", ")+" ]"}if(lk(e)){var I=na(e,m);return !("cause"in Error.prototype)&&"cause"in e&&!qy.call(e,"cause")?"{ ["+String(e)+"] "+$r.call(Ay.call("[cause]: "+m(e.cause),I),", ")+" }":I.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+$r.call(I,", ")+" }"}if(typeof e=="object"&&o){if(ky&&typeof e[ky]=="function"&&Wl)return Wl(e,{depth:c-n});if(o!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(_k(e)){var L=[];return Ry&&Ry.call(e,function(ae,ye){L.push(m(ye,e,!0)+" => "+m(ae,e));}),Fy("Map",ia.call(e),L,p)}if(vk(e)){var Z=[];return Cy&&Cy.call(e,function(ae){Z.push(m(ae,e));}),Fy("Set",sa.call(e),Z,p)}if(yk(e))return $l("WeakMap");if(wk(e))return $l("WeakSet");if(bk(e))return $l("WeakRef");if(dk(e))return Fs(m(Number(e)));if(pk(e))return Fs(m(jl.call(e)));if(hk(e))return Fs(rk.call(e));if(fk(e))return Fs(m(String(e)));if(typeof window<"u"&&e===window)return "{ [object Window] }";if(e===global)return "{ [object globalThis] }";if(!ck(e)&&!My(e)){var K=na(e,m),U=Dy?Dy(e)===Object.prototype:e instanceof Object||e.constructor===Object,B=e instanceof Object?"":"null prototype",Q=!U&&Dt&&Object(e)===e&&Dt in e?Gl.call(bn(e),8,-1):B?"Object":"",N=U||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",te=N+(Q||B?"["+$r.call(Ay.call([],Q||[],B||[]),": ")+"] ":"");return K.length===0?te+"{}":p?te+"{"+Ul(K,p)+"}":te+"{ "+$r.call(K,", ")+" }"}return String(e)};function Ly(t,e,r){var n=(r.quoteStyle||e)==="double"?'"':"'";return n+t+n}function uk(t){return yn.call(String(t),/"/g,""")}function Bl(t){return bn(t)==="[object Array]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function ck(t){return bn(t)==="[object Date]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function My(t){return bn(t)==="[object RegExp]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function lk(t){return bn(t)==="[object Error]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function fk(t){return bn(t)==="[object String]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function dk(t){return bn(t)==="[object Number]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function hk(t){return bn(t)==="[object Boolean]"&&(!Dt||!(typeof t=="object"&&Dt in t))}function $y(t){if(Pi)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return !0;if(!t||typeof t!="object"||!Hl)return !1;try{return Hl.call(t),!0}catch{}return !1}function pk(t){if(!t||typeof t!="object"||!jl)return !1;try{return jl.call(t),!0}catch{}return !1}var mk=Object.prototype.hasOwnProperty||function(t){return t in this};function _n(t,e){return mk.call(t,e)}function bn(t){return nk.call(t)}function gk(t){if(t.name)return t.name;var e=sk.call(ik.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function jy(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return Hy(Gl.call(t,0,e.maxStringLength),e)+n}var i=yn.call(yn.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,Ek);return Ly(i,"single",e)}function Ek(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+ok.call(e.toString(16))}function Fs(t){return "Object("+t+")"}function $l(t){return t+" { ? }"}function Fy(t,e,r,n){var i=n?Ul(r,n):$r.call(r,", ");return t+" ("+e+") {"+i+"}"}function Rk(t){for(var e=0;e=0)return !1;return !0}function Ck(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=$r.call(Array(t.indent+1)," ");else return null;return {base:r,prev:$r.call(Array(e+1),r)}}function Ul(t,e){if(t.length===0)return "";var r=` +`+e.prev+e.base;return r+$r.call(t,","+r)+` +`+e.prev}function na(t,e){var r=Bl(t),n=[];if(r){n.length=t.length;for(var i=0;i{var Kl=Ar(),Di=mr(),xk=By(),Tk=Kl("%TypeError%"),oa=Kl("%WeakMap%",!0),aa=Kl("%Map%",!0),Ak=Di("WeakMap.prototype.get",!0),Pk=Di("WeakMap.prototype.set",!0),Dk=Di("WeakMap.prototype.has",!0),Ok=Di("Map.prototype.get",!0),Ik=Di("Map.prototype.set",!0),kk=Di("Map.prototype.has",!0),Zl=function(t,e){for(var r=t,n;(n=r.next)!==null;r=n)if(n.key===e)return r.next=n.next,n.next=t.next,t.next=n,n},Mk=function(t,e){var r=Zl(t,e);return r&&r.value},Fk=function(t,e,r){var n=Zl(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r};},Nk=function(t,e){return !!Zl(t,e)};Uy.exports=function(){var e,r,n,i={assert:function(s){if(!i.has(s))throw new Tk("Side channel does not contain "+xk(s))},get:function(s){if(oa&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Ak(e,s)}else if(aa){if(r)return Ok(r,s)}else if(n)return Mk(n,s)},has:function(s){if(oa&&s&&(typeof s=="object"||typeof s=="function")){if(e)return Dk(e,s)}else if(aa){if(r)return kk(r,s)}else if(n)return Nk(n,s);return !1},set:function(s,o){oa&&s&&(typeof s=="object"||typeof s=="function")?(e||(e=new oa),Pk(e,s,o)):aa?(r||(r=new aa),Ik(r,s,o)):(n||(n={key:{},next:null}),Fk(n,s,o));}};return i};});var Jl=A((A6,Gy)=>{var Vy=function(t){return t!==t};Gy.exports=function(e,r){return e===0&&r===0?1/e===1/r:!!(e===r||Vy(e)&&Vy(r))};});var Yl=A((P6,Ky)=>{var qk=Jl();Ky.exports=function(){return typeof Object.is=="function"?Object.is:qk};});var Jy=A((D6,Zy)=>{var Lk=Yl(),$k=gn();Zy.exports=function(){var e=Lk();return $k(Object,{is:e},{is:function(){return Object.is!==e}}),e};});var eb=A((O6,Qy)=>{var jk=gn(),Hk=Kn(),Wk=Jl(),Yy=Yl(),Bk=Jy(),Xy=Hk(Yy(),Object);jk(Xy,{getPolyfill:Yy,implementation:Wk,shim:Bk});Qy.exports=Xy;});var vn=A((I6,tb)=>{var Uk=Zo();tb.exports=function(){return Uk()&&!!Symbol.toStringTag};});var ib=A((k6,nb)=>{var zk=vn()(),Vk=mr(),Xl=Vk("Object.prototype.toString"),ua=function(e){return zk&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:Xl(e)==="[object Arguments]"},rb=function(e){return ua(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&Xl(e)!=="[object Array]"&&Xl(e.callee)==="[object Function]"},Gk=function(){return ua(arguments)}();ua.isLegacyArguments=rb;nb.exports=Gk?ua:rb;});var ob=A((M6,sb)=>{var Kk={}.toString;sb.exports=Array.isArray||function(t){return Kk.call(t)=="[object Array]"};});var lb=A((F6,cb)=>{var ub=Function.prototype.toString,Oi=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,ef,ca;if(typeof Oi=="function"&&typeof Object.defineProperty=="function")try{ef=Object.defineProperty({},"length",{get:function(){throw ca}}),ca={},Oi(function(){throw 42},null,ef);}catch(t){t!==ca&&(Oi=null);}else Oi=null;var Zk=/^\s*class\b/,tf=function(e){try{var r=ub.call(e);return Zk.test(r)}catch{return !1}},Ql=function(e){try{return tf(e)?!1:(ub.call(e),!0)}catch{return !1}},la=Object.prototype.toString,Jk="[object Object]",Yk="[object Function]",Xk="[object GeneratorFunction]",Qk="[object HTMLAllCollection]",eM="[object HTML document.all class]",tM="[object HTMLCollection]",rM=typeof Symbol=="function"&&!!Symbol.toStringTag,nM=!(0 in[,]),rf=function(){return !1};typeof document=="object"&&(ab=document.all,la.call(ab)===la.call(document.all)&&(rf=function(e){if((nM||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=la.call(e);return (r===Qk||r===eM||r===tM||r===Jk)&&e("")==null}catch{}return !1}));var ab;cb.exports=Oi?function(e){if(rf(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;try{Oi(e,null,ef);}catch(r){if(r!==ca)return !1}return !tf(e)&&Ql(e)}:function(e){if(rf(e))return !0;if(!e||typeof e!="function"&&typeof e!="object")return !1;if(rM)return Ql(e);if(tf(e))return !1;var r=la.call(e);return r!==Yk&&r!==Xk&&!/^\[object HTML/.test(r)?!1:Ql(e)};});var hb=A((N6,db)=>{var iM=lb(),sM=Object.prototype.toString,fb=Object.prototype.hasOwnProperty,oM=function(e,r,n){for(var i=0,s=e.length;i=3&&(i=n),sM.call(e)==="[object Array]"?oM(e,r,i):typeof e=="string"?aM(e,r,i):uM(e,r,i);};db.exports=cM;});var mb=A((q6,pb)=>{var nf=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],lM=typeof globalThis>"u"?global:globalThis;pb.exports=function(){for(var e=[],r=0;r{var da=hb(),fM=mb(),gb=Kn(),af=mr(),fa=ea(),dM=af("Object.prototype.toString"),yb=vn()(),_b=typeof globalThis>"u"?global:globalThis,of=fM(),uf=af("String.prototype.slice"),sf=Object.getPrototypeOf,hM=af("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n-1?r:r!=="Object"?!1:mM(e)}return fa?pM(e):null};});var wb=A(($6,vb)=>{var gM=cf();vb.exports=function(e){return !!gM(e)};});var lf=A((j6,Tb)=>{var _M=Kn(),yM=mr(),xb=Ar(),bM=wb(),Sb=xb("ArrayBuffer",!0),Eb=xb("Float32Array",!0),pa=yM("ArrayBuffer.prototype.byteLength",!0),Rb=Sb&&!pa&&new Sb().slice,Cb=Rb&&_M(Rb);Tb.exports=pa||Cb?function(e){if(!e||typeof e!="object")return !1;try{return pa?pa(e):Cb(e,0),!0}catch{return !1}}:Eb?function(e){try{return new Eb(e).buffer===e&&!bM(e)}catch(r){return typeof e=="object"&&r.name==="RangeError"}}:function(e){return !1};});var Pb=A((H6,Ab)=>{var vM=Date.prototype.getDay,wM=function(e){try{return vM.call(e),!0}catch{return !1}},SM=Object.prototype.toString,EM="[object Date]",RM=vn()();Ab.exports=function(e){return typeof e!="object"||e===null?!1:RM?wM(e):SM.call(e)===EM};});var Mb=A((W6,kb)=>{var ff=mr(),Db=vn()(),Ob,Ib,df,hf;Db&&(Ob=ff("Object.prototype.hasOwnProperty"),Ib=ff("RegExp.prototype.exec"),df={},ma=function(){throw df},hf={toString:ma,valueOf:ma},typeof Symbol.toPrimitive=="symbol"&&(hf[Symbol.toPrimitive]=ma));var ma,CM=ff("Object.prototype.toString"),xM=Object.getOwnPropertyDescriptor,TM="[object RegExp]";kb.exports=Db?function(e){if(!e||typeof e!="object")return !1;var r=xM(e,"lastIndex"),n=r&&Ob(r,"value");if(!n)return !1;try{Ib(e,hf);}catch(i){return i===df}}:function(e){return !e||typeof e!="object"&&typeof e!="function"?!1:CM(e)===TM};});var qb=A((B6,Nb)=>{var AM=mr(),Fb=AM("SharedArrayBuffer.prototype.byteLength",!0);Nb.exports=Fb?function(e){if(!e||typeof e!="object")return !1;try{return Fb(e),!0}catch{return !1}}:function(e){return !1};});var $b=A((U6,Lb)=>{var PM=String.prototype.valueOf,DM=function(e){try{return PM.call(e),!0}catch{return !1}},OM=Object.prototype.toString,IM="[object String]",kM=vn()();Lb.exports=function(e){return typeof e=="string"?!0:typeof e!="object"?!1:kM?DM(e):OM.call(e)===IM};});var Hb=A((z6,jb)=>{var MM=Number.prototype.toString,FM=function(e){try{return MM.call(e),!0}catch{return !1}},NM=Object.prototype.toString,qM="[object Number]",LM=vn()();jb.exports=function(e){return typeof e=="number"?!0:typeof e!="object"?!1:LM?FM(e):NM.call(e)===qM};});var Ub=A((V6,Bb)=>{var Wb=mr(),$M=Wb("Boolean.prototype.toString"),jM=Wb("Object.prototype.toString"),HM=function(e){try{return $M(e),!0}catch{return !1}},WM="[object Boolean]",BM=vn()();Bb.exports=function(e){return typeof e=="boolean"?!0:e===null||typeof e!="object"?!1:BM&&Symbol.toStringTag in e?HM(e):jM(e)===WM};});var Kb=A((G6,pf)=>{var UM=Object.prototype.toString,zM=Rl()();zM?(zb=Symbol.prototype.toString,Vb=/^Symbol\(.*\)$/,Gb=function(e){return typeof e.valueOf()!="symbol"?!1:Vb.test(zb.call(e))},pf.exports=function(e){if(typeof e=="symbol")return !0;if(UM.call(e)!=="[object Symbol]")return !1;try{return Gb(e)}catch{return !1}}):pf.exports=function(e){return !1};var zb,Vb,Gb;});var Yb=A((K6,Jb)=>{var Zb=typeof BigInt<"u"&&BigInt;Jb.exports=function(){return typeof Zb=="function"&&typeof BigInt=="function"&&typeof Zb(42)=="bigint"&&typeof BigInt(42)=="bigint"};});var ev=A((Z6,mf)=>{var VM=Yb()();VM?(Xb=BigInt.prototype.valueOf,Qb=function(e){try{return Xb.call(e),!0}catch{}return !1},mf.exports=function(e){return e===null||typeof e>"u"||typeof e=="boolean"||typeof e=="string"||typeof e=="number"||typeof e=="symbol"||typeof e=="function"?!1:typeof e=="bigint"?!0:Qb(e)}):mf.exports=function(e){return !1};var Xb,Qb;});var rv=A((J6,tv)=>{var GM=$b(),KM=Hb(),ZM=Ub(),JM=Kb(),YM=ev();tv.exports=function(e){if(e==null||typeof e!="object"&&typeof e!="function")return null;if(GM(e))return "String";if(KM(e))return "Number";if(ZM(e))return "Boolean";if(JM(e))return "Symbol";if(YM(e))return "BigInt"};});var ov=A((Y6,sv)=>{var gf=typeof Map=="function"&&Map.prototype?Map:null,XM=typeof Set=="function"&&Set.prototype?Set:null,ga;gf||(ga=function(e){return !1});var iv=gf?Map.prototype.has:null,nv=XM?Set.prototype.has:null;!ga&&!iv&&(ga=function(e){return !1});sv.exports=ga||function(e){if(!e||typeof e!="object")return !1;try{if(iv.call(e),nv)try{nv.call(e);}catch{return !0}return e instanceof gf}catch{}return !1};});var lv=A((X6,cv)=>{var QM=typeof Map=="function"&&Map.prototype?Map:null,_f=typeof Set=="function"&&Set.prototype?Set:null,_a;_f||(_a=function(e){return !1});var av=QM?Map.prototype.has:null,uv=_f?Set.prototype.has:null;!_a&&!uv&&(_a=function(e){return !1});cv.exports=_a||function(e){if(!e||typeof e!="object")return !1;try{if(uv.call(e),av)try{av.call(e);}catch{return !0}return e instanceof _f}catch{}return !1};});var hv=A((Q6,dv)=>{var ya=typeof WeakMap=="function"&&WeakMap.prototype?WeakMap:null,fv=typeof WeakSet=="function"&&WeakSet.prototype?WeakSet:null,ba;ya||(ba=function(e){return !1});var bf=ya?ya.prototype.has:null,yf=fv?fv.prototype.has:null;!ba&&!bf&&(ba=function(e){return !1});dv.exports=ba||function(e){if(!e||typeof e!="object")return !1;try{if(bf.call(e,bf),yf)try{yf.call(e,yf);}catch{return !0}return e instanceof ya}catch{}return !1};});var mv=A((e9,wf)=>{var eF=Ar(),pv=mr(),tF=eF("%WeakSet%",!0),vf=pv("WeakSet.prototype.has",!0);vf?(va=pv("WeakMap.prototype.has",!0),wf.exports=function(e){if(!e||typeof e!="object")return !1;try{if(vf(e,vf),va)try{va(e,va);}catch{return !0}return e instanceof tF}catch{}return !1}):wf.exports=function(e){return !1};var va;});var _v=A((t9,gv)=>{var rF=ov(),nF=lv(),iF=hv(),sF=mv();gv.exports=function(e){if(e&&typeof e=="object"){if(rF(e))return "Map";if(nF(e))return "Set";if(iF(e))return "WeakMap";if(sF(e))return "WeakSet"}return !1};});var vv=A((r9,bv)=>{var oF=mr(),yv=oF("ArrayBuffer.prototype.byteLength",!0),aF=lf();bv.exports=function(e){return aF(e)?yv?yv(e):e.byteLength:NaN};});var xa=A((n9,Uv)=>{var Hv=iy(),jr=mr(),wv=yy(),uF=Ar(),Ii=wy(),cF=zy(),Sv=eb(),Ev=ib(),Rv=ob(),Cv=lf(),xv=Pb(),Tv=Mb(),Av=qb(),Pv=Ko(),Dv=rv(),Ov=_v(),Iv=cf(),kv=vv(),Mv=jr("SharedArrayBuffer.prototype.byteLength",!0),Fv=jr("Date.prototype.getTime"),Sf=Object.getPrototypeOf,Nv=jr("Object.prototype.toString"),Sa=uF("%Set%",!0),Ef=jr("Map.prototype.has",!0),Ea=jr("Map.prototype.get",!0),qv=jr("Map.prototype.size",!0),Ra=jr("Set.prototype.add",!0),Wv=jr("Set.prototype.delete",!0),Ca=jr("Set.prototype.has",!0),wa=jr("Set.prototype.size",!0);function Lv(t,e,r,n){for(var i=Ii(t),s;(s=i.next())&&!s.done;)if(Pr(e,s.value,r,n))return Wv(t,s.value),!0;return !1}function Bv(t){if(typeof t>"u")return null;if(typeof t!="object")return typeof t=="symbol"?!1:typeof t=="string"||typeof t=="number"?+t==+t:!0}function lF(t,e,r,n,i,s){var o=Bv(r);if(o!=null)return o;var a=Ea(e,o),l=Hv({},i,{strict:!1});return typeof a>"u"&&!Ef(e,o)||!Pr(n,a,l,s)?!1:!Ef(t,o)&&Pr(n,a,l,s)}function fF(t,e,r){var n=Bv(r);return n??(Ca(e,n)&&!Ca(t,n))}function $v(t,e,r,n,i,s){for(var o=Ii(t),a,l;(a=o.next())&&!a.done;)if(l=a.value,Pr(r,l,i,s)&&Pr(n,Ea(e,l),i,s))return Wv(t,l),!0;return !1}function Pr(t,e,r,n){var i=r||{};if(i.strict?Sv(t,e):t===e)return !0;var s=Dv(t),o=Dv(e);if(s!==o)return !1;if(!t||!e||typeof t!="object"&&typeof e!="object")return i.strict?Sv(t,e):t==e;var a=n.has(t),l=n.has(e),d;if(a&&l){if(n.get(t)===n.get(e))return !0}else d={};return a||n.set(t,d),l||n.set(e,d),pF(t,e,i,n)}function jv(t){return !t||typeof t!="object"||typeof t.length!="number"||typeof t.copy!="function"||typeof t.slice!="function"||t.length>0&&typeof t[0]!="number"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function dF(t,e,r,n){if(wa(t)!==wa(e))return !1;for(var i=Ii(t),s=Ii(e),o,a,l;(o=i.next())&&!o.done;)if(o.value&&typeof o.value=="object")l||(l=new Sa),Ra(l,o.value);else if(!Ca(e,o.value)){if(r.strict||!fF(t,e,o.value))return !1;l||(l=new Sa),Ra(l,o.value);}if(l){for(;(a=s.next())&&!a.done;)if(a.value&&typeof a.value=="object"){if(!Lv(l,a.value,r.strict,n))return !1}else if(!r.strict&&!Ca(t,a.value)&&!Lv(l,a.value,r.strict,n))return !1;return wa(l)===0}return !0}function hF(t,e,r,n){if(qv(t)!==qv(e))return !1;for(var i=Ii(t),s=Ii(e),o,a,l,d,c,p;(o=i.next())&&!o.done;)if(d=o.value[0],c=o.value[1],d&&typeof d=="object")l||(l=new Sa),Ra(l,d);else if(p=Ea(e,d),typeof p>"u"&&!Ef(e,d)||!Pr(c,p,r,n)){if(r.strict||!lF(t,e,d,c,r,n))return !1;l||(l=new Sa),Ra(l,d);}if(l){for(;(a=s.next())&&!a.done;)if(d=a.value[0],p=a.value[1],d&&typeof d=="object"){if(!$v(l,t,d,p,r,n))return !1}else if(!r.strict&&(!t.has(d)||!Pr(Ea(t,d),p,r,n))&&!$v(l,t,d,p,Hv({},r,{strict:!1}),n))return !1;return wa(l)===0}return !0}function pF(t,e,r,n){var i,s;if(typeof t!=typeof e||t==null||e==null||Nv(t)!==Nv(e)||Ev(t)!==Ev(e))return !1;var o=Rv(t),a=Rv(e);if(o!==a)return !1;var l=t instanceof Error,d=e instanceof Error;if(l!==d||(l||d)&&(t.name!==e.name||t.message!==e.message))return !1;var c=Tv(t),p=Tv(e);if(c!==p||(c||p)&&(t.source!==e.source||wv(t)!==wv(e)))return !1;var m=xv(t),_=xv(e);if(m!==_||(m||_)&&Fv(t)!==Fv(e)||r.strict&&Sf&&Sf(t)!==Sf(e))return !1;var w=Iv(t),E=Iv(e);if(w!==E)return !1;if(w||E){if(t.length!==e.length)return !1;for(i=0;i=0;i--)if(Z[i]!=K[i])return !1;for(i=Z.length-1;i>=0;i--)if(s=Z[i],!Pr(t[s],e[s],r,n))return !1;var U=Ov(t),B=Ov(e);return U!==B?!1:U==="Set"||B==="Set"?dF(t,e,r,n):U==="Map"?hF(t,e,r,n):!0}Uv.exports=function(e,r,n){return Pr(e,r,n,cF())};});var ew={};PO(ew,{closest:()=>qF,distance:()=>Qv});var Qr,FF,NF,Qv,qF,tw=AO(()=>{Qr=new Uint32Array(65536),FF=(t,e)=>{let r=t.length,n=e.length,i=1<{let r=e.length,n=t.length,i=[],s=[],o=Math.ceil(r/32),a=Math.ceil(n/32);for(let w=0;w>>g&1,L=i[g/32|0]>>>g&1,Z=S|w,K=((S|L)&E)+E^E|S|L,U=w|~(K|E),B=E&K;U>>>31^I&&(s[g/32|0]^=1<>>31^L&&(i[g/32|0]^=1<>>w&1,D=i[w/32|0]>>>w&1,g=E|d,S=((E|D)&c)+c^c|E|D,I=d|~(S|c),L=c&S;_+=I>>>n-1&1,_-=L>>>n-1&1,I>>>31^P&&(s[w/32|0]^=1<>>31^D&&(i[w/32|0]^=1<{if(t.length{let r=1/0,n=0;for(let i=0;i{(function(){var t;try{t=typeof Intl<"u"&&typeof Intl.Collator<"u"?Intl.Collator("generic",{sensitivity:"base"}):null;}catch{console.log("Collator could not be initialized and wouldn't be used");}var e=(tw(),DO(ew)),r=[],n=[],i={get:function(s,o,a){var l=a&&t&&a.useCollator;if(l){var d=s.length,c=o.length;if(d===0)return c;if(c===0)return d;var p,m,_,w,E;for(_=0;_E&&(m=E),E=r[w+1]+1,m>E&&(m=E),r[w]=p;r[w]=m;}return m}return e.distance(s,o)}};typeof define<"u"&&define!==null&&define.amd?define(function(){return i}):typeof $s<"u"&&$s!==null&&typeof Af<"u"&&$s.exports===Af?$s.exports=i:typeof self<"u"&&typeof self.postMessage=="function"&&typeof self.importScripts=="function"?self.Levenshtein=i:typeof window<"u"&&window!==null&&(window.Levenshtein=i);})();});var _t=A(If=>{If.fromCallback=function(t){return Object.defineProperty(function(...e){if(typeof e[e.length-1]=="function")t.apply(this,e);else return new Promise((r,n)=>{e.push((i,s)=>i!=null?n(i):r(s)),t.apply(this,e);})},"name",{value:t.name})};If.fromPromise=function(t){return Object.defineProperty(function(...e){let r=e[e.length-1];if(typeof r!="function")return t.apply(this,e);e.pop(),t.apply(this,e).then(n=>r(null,n),r);},"name",{value:t.name})};});var uw=A((f9,aw)=>{var Sn=oe("constants"),jF=process.cwd,Ma=null,HF=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return Ma||(Ma=jF.call(process)),Ma};try{process.cwd();}catch{}typeof process.chdir=="function"&&(kf=process.chdir,process.chdir=function(t){Ma=null,kf.call(process,t);},Object.setPrototypeOf&&Object.setPrototypeOf(process.chdir,kf));var kf;aw.exports=WF;function WF(t){Sn.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&e(t),t.lutimes||r(t),t.chown=s(t.chown),t.fchown=s(t.fchown),t.lchown=s(t.lchown),t.chmod=n(t.chmod),t.fchmod=n(t.fchmod),t.lchmod=n(t.lchmod),t.chownSync=o(t.chownSync),t.fchownSync=o(t.fchownSync),t.lchownSync=o(t.lchownSync),t.chmodSync=i(t.chmodSync),t.fchmodSync=i(t.fchmodSync),t.lchmodSync=i(t.lchmodSync),t.stat=a(t.stat),t.fstat=a(t.fstat),t.lstat=a(t.lstat),t.statSync=l(t.statSync),t.fstatSync=l(t.fstatSync),t.lstatSync=l(t.lstatSync),t.chmod&&!t.lchmod&&(t.lchmod=function(c,p,m){m&&process.nextTick(m);},t.lchmodSync=function(){}),t.chown&&!t.lchown&&(t.lchown=function(c,p,m,_){_&&process.nextTick(_);},t.lchownSync=function(){}),HF==="win32"&&(t.rename=typeof t.rename!="function"?t.rename:function(c){function p(m,_,w){var E=Date.now(),P=0;c(m,_,function D(g){if(g&&(g.code==="EACCES"||g.code==="EPERM"||g.code==="EBUSY")&&Date.now()-E<6e4){setTimeout(function(){t.stat(_,function(S,I){S&&S.code==="ENOENT"?c(m,_,D):w(g);});},P),P<100&&(P+=10);return}w&&w(g);});}return Object.setPrototypeOf&&Object.setPrototypeOf(p,c),p}(t.rename)),t.read=typeof t.read!="function"?t.read:function(c){function p(m,_,w,E,P,D){var g;if(D&&typeof D=="function"){var S=0;g=function(I,L,Z){if(I&&I.code==="EAGAIN"&&S<10)return S++,c.call(t,m,_,w,E,P,g);D.apply(this,arguments);};}return c.call(t,m,_,w,E,P,g)}return Object.setPrototypeOf&&Object.setPrototypeOf(p,c),p}(t.read),t.readSync=typeof t.readSync!="function"?t.readSync:function(c){return function(p,m,_,w,E){for(var P=0;;)try{return c.call(t,p,m,_,w,E)}catch(D){if(D.code==="EAGAIN"&&P<10){P++;continue}throw D}}}(t.readSync);function e(c){c.lchmod=function(p,m,_){c.open(p,Sn.O_WRONLY|Sn.O_SYMLINK,m,function(w,E){if(w){_&&_(w);return}c.fchmod(E,m,function(P){c.close(E,function(D){_&&_(P||D);});});});},c.lchmodSync=function(p,m){var _=c.openSync(p,Sn.O_WRONLY|Sn.O_SYMLINK,m),w=!0,E;try{E=c.fchmodSync(_,m),w=!1;}finally{if(w)try{c.closeSync(_);}catch{}else c.closeSync(_);}return E};}function r(c){Sn.hasOwnProperty("O_SYMLINK")&&c.futimes?(c.lutimes=function(p,m,_,w){c.open(p,Sn.O_SYMLINK,function(E,P){if(E){w&&w(E);return}c.futimes(P,m,_,function(D){c.close(P,function(g){w&&w(D||g);});});});},c.lutimesSync=function(p,m,_){var w=c.openSync(p,Sn.O_SYMLINK),E,P=!0;try{E=c.futimesSync(w,m,_),P=!1;}finally{if(P)try{c.closeSync(w);}catch{}else c.closeSync(w);}return E}):c.futimes&&(c.lutimes=function(p,m,_,w){w&&process.nextTick(w);},c.lutimesSync=function(){});}function n(c){return c&&function(p,m,_){return c.call(t,p,m,function(w){d(w)&&(w=null),_&&_.apply(this,arguments);})}}function i(c){return c&&function(p,m){try{return c.call(t,p,m)}catch(_){if(!d(_))throw _}}}function s(c){return c&&function(p,m,_,w){return c.call(t,p,m,_,function(E){d(E)&&(E=null),w&&w.apply(this,arguments);})}}function o(c){return c&&function(p,m,_){try{return c.call(t,p,m,_)}catch(w){if(!d(w))throw w}}}function a(c){return c&&function(p,m,_){typeof m=="function"&&(_=m,m=null);function w(E,P){P&&(P.uid<0&&(P.uid+=4294967296),P.gid<0&&(P.gid+=4294967296)),_&&_.apply(this,arguments);}return m?c.call(t,p,m,w):c.call(t,p,w)}}function l(c){return c&&function(p,m){var _=m?c.call(t,p,m):c.call(t,p);return _&&(_.uid<0&&(_.uid+=4294967296),_.gid<0&&(_.gid+=4294967296)),_}}function d(c){if(!c||c.code==="ENOSYS")return !0;var p=!process.getuid||process.getuid()!==0;return !!(p&&(c.code==="EINVAL"||c.code==="EPERM"))}}});var fw=A((d9,lw)=>{var cw=oe("stream").Stream;lw.exports=BF;function BF(t){return {ReadStream:e,WriteStream:r};function e(n,i){if(!(this instanceof e))return new e(n,i);cw.call(this);var s=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=64*1024,i=i||{};for(var o=Object.keys(i),a=0,l=o.length;athis.end)throw new Error("start must be <= end");this.pos=this.start;}if(this.fd!==null){process.nextTick(function(){s._read();});return}t.open(this.path,this.flags,this.mode,function(c,p){if(c){s.emit("error",c),s.readable=!1;return}s.fd=p,s.emit("open",p),s._read();});}function r(n,i){if(!(this instanceof r))return new r(n,i);cw.call(this),this.path=n,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,i=i||{};for(var s=Object.keys(i),o=0,a=s.length;o= zero");this.pos=this.start;}this.busy=!1,this._queue=[],this.fd===null&&(this._open=t.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush());}}});var hw=A((h9,dw)=>{dw.exports=zF;var UF=Object.getPrototypeOf||function(t){return t.__proto__};function zF(t){if(t===null||typeof t!="object")return t;if(t instanceof Object)var e={__proto__:UF(t)};else var e=Object.create(null);return Object.getOwnPropertyNames(t).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));}),e}});var Fi=A((p9,Nf)=>{var it=oe("fs"),VF=uw(),GF=fw(),KF=hw(),Fa=oe("util"),Tt,qa;typeof Symbol=="function"&&typeof Symbol.for=="function"?(Tt=Symbol.for("graceful-fs.queue"),qa=Symbol.for("graceful-fs.previous")):(Tt="___graceful-fs.queue",qa="___graceful-fs.previous");function ZF(){}function gw(t,e){Object.defineProperty(t,Tt,{get:function(){return e}});}var Yn=ZF;Fa.debuglog?Yn=Fa.debuglog("gfs4"):/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&(Yn=function(){var t=Fa.format.apply(Fa,arguments);t="GFS4: "+t.split(/\n/).join(` +GFS4: `),console.error(t);});it[Tt]||(pw=global[Tt]||[],gw(it,pw),it.close=function(t){function e(r,n){return t.call(it,r,function(i){i||mw(),typeof n=="function"&&n.apply(this,arguments);})}return Object.defineProperty(e,qa,{value:t}),e}(it.close),it.closeSync=function(t){function e(r){t.apply(it,arguments),mw();}return Object.defineProperty(e,qa,{value:t}),e}(it.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){Yn(it[Tt]),oe("assert").equal(it[Tt].length,0);}));var pw;global[Tt]||gw(global,it[Tt]);Nf.exports=Mf(KF(it));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!it.__patched&&(Nf.exports=Mf(it),it.__patched=!0);function Mf(t){VF(t),t.gracefulify=Mf,t.createReadStream=L,t.createWriteStream=Z;var e=t.readFile;t.readFile=r;function r(B,Q,N){return typeof Q=="function"&&(N=Q,Q=null),te(B,Q,N);function te(ae,ye,q,W){return e(ae,ye,function(me){me&&(me.code==="EMFILE"||me.code==="ENFILE")?Mi([te,[ae,ye,q],me,W||Date.now(),Date.now()]):typeof q=="function"&&q.apply(this,arguments);})}}var n=t.writeFile;t.writeFile=i;function i(B,Q,N,te){return typeof N=="function"&&(te=N,N=null),ae(B,Q,N,te);function ae(ye,q,W,me,pe){return n(ye,q,W,function(we){we&&(we.code==="EMFILE"||we.code==="ENFILE")?Mi([ae,[ye,q,W,me],we,pe||Date.now(),Date.now()]):typeof me=="function"&&me.apply(this,arguments);})}}var s=t.appendFile;s&&(t.appendFile=o);function o(B,Q,N,te){return typeof N=="function"&&(te=N,N=null),ae(B,Q,N,te);function ae(ye,q,W,me,pe){return s(ye,q,W,function(we){we&&(we.code==="EMFILE"||we.code==="ENFILE")?Mi([ae,[ye,q,W,me],we,pe||Date.now(),Date.now()]):typeof me=="function"&&me.apply(this,arguments);})}}var a=t.copyFile;a&&(t.copyFile=l);function l(B,Q,N,te){return typeof N=="function"&&(te=N,N=0),ae(B,Q,N,te);function ae(ye,q,W,me,pe){return a(ye,q,W,function(we){we&&(we.code==="EMFILE"||we.code==="ENFILE")?Mi([ae,[ye,q,W,me],we,pe||Date.now(),Date.now()]):typeof me=="function"&&me.apply(this,arguments);})}}var d=t.readdir;t.readdir=p;var c=/^v[0-5]\./;function p(B,Q,N){typeof Q=="function"&&(N=Q,Q=null);var te=c.test(process.version)?function(q,W,me,pe){return d(q,ae(q,W,me,pe))}:function(q,W,me,pe){return d(q,W,ae(q,W,me,pe))};return te(B,Q,N);function ae(ye,q,W,me){return function(pe,we){pe&&(pe.code==="EMFILE"||pe.code==="ENFILE")?Mi([te,[ye,q,W],pe,me||Date.now(),Date.now()]):(we&&we.sort&&we.sort(),typeof W=="function"&&W.call(this,pe,we));}}}if(process.version.substr(0,4)==="v0.8"){var m=GF(t);D=m.ReadStream,S=m.WriteStream;}var _=t.ReadStream;_&&(D.prototype=Object.create(_.prototype),D.prototype.open=g);var w=t.WriteStream;w&&(S.prototype=Object.create(w.prototype),S.prototype.open=I),Object.defineProperty(t,"ReadStream",{get:function(){return D},set:function(B){D=B;},enumerable:!0,configurable:!0}),Object.defineProperty(t,"WriteStream",{get:function(){return S},set:function(B){S=B;},enumerable:!0,configurable:!0});var E=D;Object.defineProperty(t,"FileReadStream",{get:function(){return E},set:function(B){E=B;},enumerable:!0,configurable:!0});var P=S;Object.defineProperty(t,"FileWriteStream",{get:function(){return P},set:function(B){P=B;},enumerable:!0,configurable:!0});function D(B,Q){return this instanceof D?(_.apply(this,arguments),this):D.apply(Object.create(D.prototype),arguments)}function g(){var B=this;U(B.path,B.flags,B.mode,function(Q,N){Q?(B.autoClose&&B.destroy(),B.emit("error",Q)):(B.fd=N,B.emit("open",N),B.read());});}function S(B,Q){return this instanceof S?(w.apply(this,arguments),this):S.apply(Object.create(S.prototype),arguments)}function I(){var B=this;U(B.path,B.flags,B.mode,function(Q,N){Q?(B.destroy(),B.emit("error",Q)):(B.fd=N,B.emit("open",N));});}function L(B,Q){return new t.ReadStream(B,Q)}function Z(B,Q){return new t.WriteStream(B,Q)}var K=t.open;t.open=U;function U(B,Q,N,te){return typeof N=="function"&&(te=N,N=null),ae(B,Q,N,te);function ae(ye,q,W,me,pe){return K(ye,q,W,function(we,Xe){we&&(we.code==="EMFILE"||we.code==="ENFILE")?Mi([ae,[ye,q,W,me],we,pe||Date.now(),Date.now()]):typeof me=="function"&&me.apply(this,arguments);})}}return t}function Mi(t){Yn("ENQUEUE",t[0].name,t[1]),it[Tt].push(t),Ff();}var Na;function mw(){for(var t=Date.now(),e=0;e2&&(it[Tt][e][3]=t,it[Tt][e][4]=t);Ff();}function Ff(){if(clearTimeout(Na),Na=void 0,it[Tt].length!==0){var t=it[Tt].shift(),e=t[0],r=t[1],n=t[2],i=t[3],s=t[4];if(i===void 0)Yn("RETRY",e.name,r),e.apply(null,r);else if(Date.now()-i>=6e4){Yn("TIMEOUT",e.name,r);var o=r.pop();typeof o=="function"&&o.call(null,n);}else {var a=Date.now()-s,l=Math.max(s-i,1),d=Math.min(l*1.2,100);a>=d?(Yn("RETRY",e.name,r),e.apply(null,r.concat([i]))):it[Tt].push(t);}Na===void 0&&(Na=setTimeout(Ff,0));}}});var Ht=A(tn=>{var _w=_t().fromCallback,jt=Fi(),JF=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter(t=>typeof jt[t]=="function");Object.assign(tn,jt);JF.forEach(t=>{tn[t]=_w(jt[t]);});tn.exists=function(t,e){return typeof e=="function"?jt.exists(t,e):new Promise(r=>jt.exists(t,r))};tn.read=function(t,e,r,n,i,s){return typeof s=="function"?jt.read(t,e,r,n,i,s):new Promise((o,a)=>{jt.read(t,e,r,n,i,(l,d,c)=>{if(l)return a(l);o({bytesRead:d,buffer:c});});})};tn.write=function(t,e,...r){return typeof r[r.length-1]=="function"?jt.write(t,e,...r):new Promise((n,i)=>{jt.write(t,e,...r,(s,o,a)=>{if(s)return i(s);n({bytesWritten:o,buffer:a});});})};tn.readv=function(t,e,...r){return typeof r[r.length-1]=="function"?jt.readv(t,e,...r):new Promise((n,i)=>{jt.readv(t,e,...r,(s,o,a)=>{if(s)return i(s);n({bytesRead:o,buffers:a});});})};tn.writev=function(t,e,...r){return typeof r[r.length-1]=="function"?jt.writev(t,e,...r):new Promise((n,i)=>{jt.writev(t,e,...r,(s,o,a)=>{if(s)return i(s);n({bytesWritten:o,buffers:a});});})};typeof jt.realpath.native=="function"?tn.realpath.native=_w(jt.realpath.native):process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003");});var bw=A((g9,yw)=>{var YF=oe("path");yw.exports.checkPath=function(e){if(process.platform==="win32"&&/[<>:"|?*]/.test(e.replace(YF.parse(e).root,""))){let n=new Error(`Path contains invalid characters: ${e}`);throw n.code="EINVAL",n}};});var Ew=A((_9,qf)=>{var vw=Ht(),{checkPath:ww}=bw(),Sw=t=>{let e={mode:511};return typeof t=="number"?t:{...e,...t}.mode};qf.exports.makeDir=async(t,e)=>(ww(t),vw.mkdir(t,{mode:Sw(e),recursive:!0}));qf.exports.makeDirSync=(t,e)=>(ww(t),vw.mkdirSync(t,{mode:Sw(e),recursive:!0}));});var Dr=A((y9,Rw)=>{var XF=_t().fromPromise,{makeDir:QF,makeDirSync:Lf}=Ew(),$f=XF(QF);Rw.exports={mkdirs:$f,mkdirsSync:Lf,mkdirp:$f,mkdirpSync:Lf,ensureDir:$f,ensureDirSync:Lf};});var En=A((b9,xw)=>{var eN=_t().fromPromise,Cw=Ht();function tN(t){return Cw.access(t).then(()=>!0).catch(()=>!1)}xw.exports={pathExists:eN(tN),pathExistsSync:Cw.existsSync};});var jf=A((v9,Tw)=>{var Ni=Ht(),rN=_t().fromPromise;async function nN(t,e,r){let n=await Ni.open(t,"r+"),i=null;try{await Ni.futimes(n,e,r);}finally{try{await Ni.close(n);}catch(s){i=s;}}if(i)throw i}function iN(t,e,r){let n=Ni.openSync(t,"r+");return Ni.futimesSync(n,e,r),Ni.closeSync(n)}Tw.exports={utimesMillis:rN(nN),utimesMillisSync:iN};});var Xn=A((w9,Ow)=>{var qi=Ht(),yt=oe("path"),Aw=_t().fromPromise;function sN(t,e,r){let n=r.dereference?i=>qi.stat(i,{bigint:!0}):i=>qi.lstat(i,{bigint:!0});return Promise.all([n(t),n(e).catch(i=>{if(i.code==="ENOENT")return null;throw i})]).then(([i,s])=>({srcStat:i,destStat:s}))}function oN(t,e,r){let n,i=r.dereference?o=>qi.statSync(o,{bigint:!0}):o=>qi.lstatSync(o,{bigint:!0}),s=i(t);try{n=i(e);}catch(o){if(o.code==="ENOENT")return {srcStat:s,destStat:null};throw o}return {srcStat:s,destStat:n}}async function aN(t,e,r,n){let{srcStat:i,destStat:s}=await sN(t,e,n);if(s){if(Ws(i,s)){let o=yt.basename(t),a=yt.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return {srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&Hf(t,e))throw new Error(La(t,e,r));return {srcStat:i,destStat:s}}function uN(t,e,r,n){let{srcStat:i,destStat:s}=oN(t,e,n);if(s){if(Ws(i,s)){let o=yt.basename(t),a=yt.basename(e);if(r==="move"&&o!==a&&o.toLowerCase()===a.toLowerCase())return {srcStat:i,destStat:s,isChangingCase:!0};throw new Error("Source and destination must not be the same.")}if(i.isDirectory()&&!s.isDirectory())throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`);if(!i.isDirectory()&&s.isDirectory())throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}if(i.isDirectory()&&Hf(t,e))throw new Error(La(t,e,r));return {srcStat:i,destStat:s}}async function Pw(t,e,r,n){let i=yt.resolve(yt.dirname(t)),s=yt.resolve(yt.dirname(r));if(s===i||s===yt.parse(s).root)return;let o;try{o=await qi.stat(s,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(Ws(e,o))throw new Error(La(t,r,n));return Pw(t,e,s,n)}function Dw(t,e,r,n){let i=yt.resolve(yt.dirname(t)),s=yt.resolve(yt.dirname(r));if(s===i||s===yt.parse(s).root)return;let o;try{o=qi.statSync(s,{bigint:!0});}catch(a){if(a.code==="ENOENT")return;throw a}if(Ws(e,o))throw new Error(La(t,r,n));return Dw(t,e,s,n)}function Ws(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function Hf(t,e){let r=yt.resolve(t).split(yt.sep).filter(i=>i),n=yt.resolve(e).split(yt.sep).filter(i=>i);return r.every((i,s)=>n[s]===i)}function La(t,e,r){return `Cannot ${r} '${t}' to a subdirectory of itself, '${e}'.`}Ow.exports={checkPaths:Aw(aN),checkPathsSync:uN,checkParentPaths:Aw(Pw),checkParentPathsSync:Dw,isSrcSubdir:Hf,areIdentical:Ws};});var Nw=A((S9,Fw)=>{var Ot=Ht(),Bs=oe("path"),{mkdirs:cN}=Dr(),{pathExists:lN}=En(),{utimesMillis:fN}=jf(),Us=Xn();async function dN(t,e,r={}){typeof r=="function"&&(r={filter:r}),r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:s}=await yn.checkPaths(t,e,"copy",r);if(await yn.checkParentPaths(t,n,e,"copy"),!await Dm(t,e,r))return;let o=_n.dirname(e);await AR(o)||await ER(o),await qm(s,t,e,r);}async function Dm(t,e,r){return r.filter?r.filter(t,e):!0}async function qm(t,e,r,n){let i=await(n.dereference?Le.stat:Le.lstat)(e);if(i.isDirectory())return PR(i,t,e,r,n);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return RR(i,t,e,r,n);if(i.isSymbolicLink())return OR(t,e,r,n);throw i.isSocket()?new Error(`Cannot copy a socket file: ${e}`):i.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function RR(t,e,r,n,s){if(!e)return $m(t,r,n,s);if(s.overwrite)return await Le.unlink(n),$m(t,r,n,s);if(s.errorOnExist)throw new Error(`'${n}' already exists`)}async function $m(t,e,r,n){if(await Le.copyFile(e,r),n.preserveTimestamps){TR(t.mode)&&await IR(r,t.mode);let s=await Le.stat(e);await xR(r,s.atime,s.mtime);}return Le.chmod(r,t.mode)}function TR(t){return (t&128)===0}function IR(t,e){return Le.chmod(t,e|128)}async function PR(t,e,r,n,s){e||await Le.mkdir(n);let i=await Le.readdir(r);await Promise.all(i.map(async o=>{let l=_n.join(r,o),f=_n.join(n,o);if(!await Dm(l,f,s))return;let{destStat:u}=await yn.checkPaths(l,f,"copy",s);return qm(u,l,f,s)})),e||await Le.chmod(n,t.mode);}async function OR(t,e,r,n){let s=await Le.readlink(e);if(n.dereference&&(s=_n.resolve(process.cwd(),s)),!t)return Le.symlink(s,r);let i=null;try{i=await Le.readlink(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Le.symlink(s,r);throw o}if(n.dereference&&(i=_n.resolve(process.cwd(),i)),yn.isSrcSubdir(s,i))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${i}'.`);if(yn.isSrcSubdir(i,s))throw new Error(`Cannot overwrite '${i}' with '${s}'.`);return await Le.unlink(r),Le.symlink(s,r)}Bm.exports=CR;});var Gm=x((b$,zm)=>{var Be=Tr(),wn=K("path"),FR=lt().mkdirsSync,MR=Pa().utimesMillisSync,bn=tr();function NR(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; + see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0001");let{srcStat:n,destStat:i}=await Us.checkPaths(t,e,"copy",r);if(await Us.checkParentPaths(t,n,e,"copy"),!await kw(t,e,r))return;let o=Bs.dirname(e);await lN(o)||await cN(o),await Mw(i,t,e,r);}async function kw(t,e,r){return r.filter?r.filter(t,e):!0}async function Mw(t,e,r,n){let s=await(n.dereference?Ot.stat:Ot.lstat)(e);if(s.isDirectory())return gN(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return hN(s,t,e,r,n);if(s.isSymbolicLink())return _N(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}async function hN(t,e,r,n,i){if(!e)return Iw(t,r,n,i);if(i.overwrite)return await Ot.unlink(n),Iw(t,r,n,i);if(i.errorOnExist)throw new Error(`'${n}' already exists`)}async function Iw(t,e,r,n){if(await Ot.copyFile(e,r),n.preserveTimestamps){pN(t.mode)&&await mN(r,t.mode);let i=await Ot.stat(e);await fN(r,i.atime,i.mtime);}return Ot.chmod(r,t.mode)}function pN(t){return (t&128)===0}function mN(t,e){return Ot.chmod(t,e|128)}async function gN(t,e,r,n,i){e||await Ot.mkdir(n);let s=await Ot.readdir(r);await Promise.all(s.map(async o=>{let a=Bs.join(r,o),l=Bs.join(n,o);if(!await kw(a,l,i))return;let{destStat:c}=await Us.checkPaths(a,l,"copy",i);return Mw(c,a,l,i)})),e||await Ot.chmod(n,t.mode);}async function _N(t,e,r,n){let i=await Ot.readlink(e);if(n.dereference&&(i=Bs.resolve(process.cwd(),i)),!t)return Ot.symlink(i,r);let s=null;try{s=await Ot.readlink(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Ot.symlink(i,r);throw o}if(n.dereference&&(s=Bs.resolve(process.cwd(),s)),Us.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Us.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return await Ot.unlink(r),Ot.symlink(i,r)}Fw.exports=dN;});var Hw=A((E9,jw)=>{var Wt=Fi(),zs=oe("path"),yN=Dr().mkdirsSync,bN=jf().utimesMillisSync,Vs=Xn();function vN(t,e,r){typeof r=="function"&&(r={filter:r}),r=r||{},r.clobber="clobber"in r?!!r.clobber:!0,r.overwrite="overwrite"in r?!!r.overwrite:r.clobber,r.preserveTimestamps&&process.arch==="ia32"&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended; - see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:s}=bn.checkPathsSync(t,e,"copy",r);if(bn.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let i=wn.dirname(e);return Be.existsSync(i)||FR(i),Hm(s,t,e,r)}function Hm(t,e,r,n){let i=(n.dereference?Be.statSync:Be.lstatSync)(e);if(i.isDirectory())return UR(i,t,e,r,n);if(i.isFile()||i.isCharacterDevice()||i.isBlockDevice())return kR(i,t,e,r,n);if(i.isSymbolicLink())return WR(t,e,r,n);throw i.isSocket()?new Error(`Cannot copy a socket file: ${e}`):i.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function kR(t,e,r,n,s){return e?LR(t,r,n,s):jm(t,r,n,s)}function LR(t,e,r,n){if(n.overwrite)return Be.unlinkSync(r),jm(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function jm(t,e,r,n){return Be.copyFileSync(e,r),n.preserveTimestamps&&$R(t.mode,e,r),Fa(r,t.mode)}function $R(t,e,r){return DR(t)&&qR(r,t),BR(e,r)}function DR(t){return (t&128)===0}function qR(t,e){return Fa(t,e|128)}function Fa(t,e){return Be.chmodSync(t,e)}function BR(t,e){let r=Be.statSync(t);return MR(e,r.atime,r.mtime)}function UR(t,e,r,n,s){return e?Wm(r,n,s):HR(t.mode,r,n,s)}function HR(t,e,r,n){return Be.mkdirSync(r),Wm(e,r,n),Fa(r,t)}function Wm(t,e,r){Be.readdirSync(t).forEach(n=>jR(n,t,e,r));}function jR(t,e,r,n){let s=wn.join(e,t),i=wn.join(r,t);if(n.filter&&!n.filter(s,i))return;let{destStat:o}=bn.checkPathsSync(s,i,"copy",n);return Hm(o,s,i,n)}function WR(t,e,r,n){let s=Be.readlinkSync(e);if(n.dereference&&(s=wn.resolve(process.cwd(),s)),t){let i;try{i=Be.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Be.symlinkSync(s,r);throw o}if(n.dereference&&(i=wn.resolve(process.cwd(),i)),bn.isSrcSubdir(s,i))throw new Error(`Cannot copy '${s}' to a subdirectory of itself, '${i}'.`);if(bn.isSrcSubdir(i,s))throw new Error(`Cannot overwrite '${i}' with '${s}'.`);return zR(s,r)}else return Be.symlinkSync(s,r)}function zR(t,e){return Be.unlinkSync(e),Be.symlinkSync(t,e)}zm.exports=NR;});var Vi=x((S$,Vm)=>{var GR=Ae().fromPromise;Vm.exports={copy:GR(Um()),copySync:Gm()};});var Sn=x((v$,Zm)=>{var Km=Tr(),VR=Ae().fromCallback;function KR(t,e){Km.rm(t,{recursive:!0,force:!0},e);}function ZR(t){Km.rmSync(t,{recursive:!0,force:!0});}Zm.exports={remove:VR(KR),removeSync:ZR};});var ng=x((E$,rg)=>{var YR=Ae().fromPromise,Xm=qe(),Qm=K("path"),eg=lt(),tg=Sn(),Ym=YR(async function(e){let r;try{r=await Xm.readdir(e);}catch{return eg.mkdirs(e)}return Promise.all(r.map(n=>tg.remove(Qm.join(e,n))))});function Jm(t){let e;try{e=Xm.readdirSync(t);}catch{return eg.mkdirsSync(t)}e.forEach(r=>{r=Qm.join(t,r),tg.removeSync(r);});}rg.exports={emptyDirSync:Jm,emptydirSync:Jm,emptyDir:Ym,emptydir:Ym};});var ag=x((A$,og)=>{var JR=Ae().fromPromise,ig=K("path"),At=qe(),sg=lt();async function XR(t){let e;try{e=await At.stat(t);}catch{}if(e&&e.isFile())return;let r=ig.dirname(t),n=null;try{n=await At.stat(r);}catch(s){if(s.code==="ENOENT"){await sg.mkdirs(r),await At.writeFile(t,"");return}else throw s}n.isDirectory()?await At.writeFile(t,""):await At.readdir(r);}function QR(t){let e;try{e=At.statSync(t);}catch{}if(e&&e.isFile())return;let r=ig.dirname(t);try{At.statSync(r).isDirectory()||At.readdirSync(r);}catch(n){if(n&&n.code==="ENOENT")sg.mkdirsSync(r);else throw n}At.writeFileSync(t,"");}og.exports={createFile:JR(XR),createFileSync:QR};});var hg=x((x$,fg)=>{var eT=Ae().fromPromise,lg=K("path"),Ht=qe(),ug=lt(),{pathExists:tT}=Ut(),{areIdentical:cg}=tr();async function rT(t,e){let r;try{r=await Ht.lstat(e);}catch{}let n;try{n=await Ht.lstat(t);}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(r&&cg(n,r))return;let s=lg.dirname(e);await tT(s)||await ug.mkdirs(s),await Ht.link(t,e);}function nT(t,e){let r;try{r=Ht.lstatSync(e);}catch{}try{let i=Ht.lstatSync(t);if(r&&cg(i,r))return}catch(i){throw i.message=i.message.replace("lstat","ensureLink"),i}let n=lg.dirname(e);return Ht.existsSync(n)||ug.mkdirsSync(n),Ht.linkSync(t,e)}fg.exports={createLink:eT(rT),createLinkSync:nT};});var pg=x((C$,dg)=>{var jt=K("path"),vn=qe(),{pathExists:iT}=Ut(),sT=Ae().fromPromise;async function oT(t,e){if(jt.isAbsolute(t)){try{await vn.lstat(t);}catch(i){throw i.message=i.message.replace("lstat","ensureSymlink"),i}return {toCwd:t,toDst:t}}let r=jt.dirname(e),n=jt.join(r,t);if(await iT(n))return {toCwd:n,toDst:t};try{await vn.lstat(t);}catch(i){throw i.message=i.message.replace("lstat","ensureSymlink"),i}return {toCwd:t,toDst:jt.relative(r,t)}}function aT(t,e){if(jt.isAbsolute(t)){if(!vn.existsSync(t))throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}let r=jt.dirname(e),n=jt.join(r,t);if(vn.existsSync(n))return {toCwd:n,toDst:t};if(!vn.existsSync(t))throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:jt.relative(r,t)}}dg.exports={symlinkPaths:sT(oT),symlinkPathsSync:aT};});var _g=x((R$,gg)=>{var mg=qe(),lT=Ae().fromPromise;async function uT(t,e){if(e)return e;let r;try{r=await mg.lstat(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}function cT(t,e){if(e)return e;let r;try{r=mg.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}gg.exports={symlinkType:lT(uT),symlinkTypeSync:cT};});var Sg=x((T$,bg)=>{var fT=Ae().fromPromise,yg=K("path"),gt=qe(),{mkdirs:hT,mkdirsSync:dT}=lt(),{symlinkPaths:pT,symlinkPathsSync:mT}=pg(),{symlinkType:gT,symlinkTypeSync:_T}=_g(),{pathExists:yT}=Ut(),{areIdentical:wg}=tr();async function wT(t,e,r){let n;try{n=await gt.lstat(e);}catch{}if(n&&n.isSymbolicLink()){let[l,f]=await Promise.all([gt.stat(t),gt.stat(e)]);if(wg(l,f))return}let s=await pT(t,e);t=s.toDst;let i=await gT(s.toCwd,r),o=yg.dirname(e);return await yT(o)||await hT(o),gt.symlink(t,e,i)}function bT(t,e,r){let n;try{n=gt.lstatSync(e);}catch{}if(n&&n.isSymbolicLink()){let l=gt.statSync(t),f=gt.statSync(e);if(wg(l,f))return}let s=mT(t,e);t=s.toDst,r=_T(s.toCwd,r);let i=yg.dirname(e);return gt.existsSync(i)||dT(i),gt.symlinkSync(t,e,r)}bg.exports={createSymlink:fT(wT),createSymlinkSync:bT};});var Ig=x((I$,Tg)=>{var{createFile:vg,createFileSync:Eg}=ag(),{createLink:Ag,createLinkSync:xg}=hg(),{createSymlink:Cg,createSymlinkSync:Rg}=Sg();Tg.exports={createFile:vg,createFileSync:Eg,ensureFile:vg,ensureFileSync:Eg,createLink:Ag,createLinkSync:xg,ensureLink:Ag,ensureLinkSync:xg,createSymlink:Cg,createSymlinkSync:Rg,ensureSymlink:Cg,ensureSymlinkSync:Rg};});var Ki=x((P$,Pg)=>{function ST(t,{EOL:e=` -`,finalEOL:r=!0,replacer:n=null,spaces:s}={}){let i=r?e:"";return JSON.stringify(t,n,s).replace(/\n/g,e)+i}function vT(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}Pg.exports={stringify:ST,stripBom:vT};});var Ng=x((O$,Mg)=>{var Or;try{Or=Tr();}catch{Or=K("fs");}var Zi=Ae(),{stringify:Og,stripBom:Fg}=Ki();async function ET(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Or,n="throws"in e?e.throws:!0,s=await Zi.fromCallback(r.readFile)(t,e);s=Fg(s);let i;try{i=JSON.parse(s,e?e.reviver:null);}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}return i}var AT=Zi.fromPromise(ET);function xT(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Or,n="throws"in e?e.throws:!0;try{let s=r.readFileSync(t,e);return s=Fg(s),JSON.parse(s,e.reviver)}catch(s){if(n)throw s.message=`${t}: ${s.message}`,s;return null}}async function CT(t,e,r={}){let n=r.fs||Or,s=Og(e,r);await Zi.fromCallback(n.writeFile)(t,s,r);}var RT=Zi.fromPromise(CT);function TT(t,e,r={}){let n=r.fs||Or,s=Og(e,r);return n.writeFileSync(t,s,r)}var IT={readFile:AT,readFileSync:xT,writeFile:RT,writeFileSync:TT};Mg.exports=IT;});var Lg=x((F$,kg)=>{var Yi=Ng();kg.exports={readJson:Yi.readFile,readJsonSync:Yi.readFileSync,writeJson:Yi.writeFile,writeJsonSync:Yi.writeFileSync};});var Ji=x((M$,qg)=>{var PT=Ae().fromPromise,Ma=qe(),$g=K("path"),Dg=lt(),OT=Ut().pathExists;async function FT(t,e,r="utf-8"){let n=$g.dirname(t);return await OT(n)||await Dg.mkdirs(n),Ma.writeFile(t,e,r)}function MT(t,...e){let r=$g.dirname(t);Ma.existsSync(r)||Dg.mkdirsSync(r),Ma.writeFileSync(t,...e);}qg.exports={outputFile:PT(FT),outputFileSync:MT};});var Ug=x((N$,Bg)=>{var{stringify:NT}=Ki(),{outputFile:kT}=Ji();async function LT(t,e,r={}){let n=NT(e,r);await kT(t,n,r);}Bg.exports=LT;});var jg=x((k$,Hg)=>{var{stringify:$T}=Ki(),{outputFileSync:DT}=Ji();function qT(t,e,r){let n=$T(e,r);DT(t,n,r);}Hg.exports=qT;});var zg=x((L$,Wg)=>{var BT=Ae().fromPromise,Ue=Lg();Ue.outputJson=BT(Ug());Ue.outputJsonSync=jg();Ue.outputJSON=Ue.outputJson;Ue.outputJSONSync=Ue.outputJsonSync;Ue.writeJSON=Ue.writeJson;Ue.writeJSONSync=Ue.writeJsonSync;Ue.readJSON=Ue.readJson;Ue.readJSONSync=Ue.readJsonSync;Wg.exports=Ue;});var Yg=x(($$,Zg)=>{var UT=qe(),Gg=K("path"),{copy:HT}=Vi(),{remove:Kg}=Sn(),{mkdirp:jT}=lt(),{pathExists:WT}=Ut(),Vg=tr();async function zT(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:s,isChangingCase:i=!1}=await Vg.checkPaths(t,e,"move",r);await Vg.checkParentPaths(t,s,e,"move");let o=Gg.dirname(e);return Gg.parse(o).root!==o&&await jT(o),GT(t,e,n,i)}async function GT(t,e,r,n){if(!n){if(r)await Kg(e);else if(await WT(e))throw new Error("dest already exists.")}try{await UT.rename(t,e);}catch(s){if(s.code!=="EXDEV")throw s;await VT(t,e,r);}}async function VT(t,e,r){return await HT(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Kg(t)}Zg.exports=zT;});var t_=x((D$,e_)=>{var Xg=Tr(),ka=K("path"),KT=Vi().copySync,Qg=Sn().removeSync,ZT=lt().mkdirpSync,Jg=tr();function YT(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:s,isChangingCase:i=!1}=Jg.checkPathsSync(t,e,"move",r);return Jg.checkParentPathsSync(t,s,e,"move"),JT(e)||ZT(ka.dirname(e)),XT(t,e,n,i)}function JT(t){let e=ka.dirname(t);return ka.parse(e).root===e}function XT(t,e,r,n){if(n)return Na(t,e,r);if(r)return Qg(e),Na(t,e,r);if(Xg.existsSync(e))throw new Error("dest already exists.");return Na(t,e,r)}function Na(t,e,r){try{Xg.renameSync(t,e);}catch(n){if(n.code!=="EXDEV")throw n;return QT(t,e,r)}}function QT(t,e,r){return KT(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),Qg(t)}e_.exports=YT;});var n_=x((q$,r_)=>{var e1=Ae().fromPromise;r_.exports={move:e1(Yg()),moveSync:t_()};});var La=x((B$,i_)=>{i_.exports={...qe(),...Vi(),...ng(),...Ig(),...zg(),...lt(),...n_(),...Ji(),...Ut(),...Sn()};});var En=x((U$,u_)=>{var t1=K("path"),_t="\\\\/",s_=`[^${_t}]`,xt="\\.",r1="\\+",n1="\\?",Xi="\\/",i1="(?=.)",o_="[^/]",$a=`(?:${Xi}|$)`,a_=`(?:^|${Xi})`,Da=`${xt}{1,2}${$a}`,s1=`(?!${xt})`,o1=`(?!${a_}${Da})`,a1=`(?!${xt}{0,1}${$a})`,l1=`(?!${Da})`,u1=`[^.${Xi}]`,c1=`${o_}*?`,l_={DOT_LITERAL:xt,PLUS_LITERAL:r1,QMARK_LITERAL:n1,SLASH_LITERAL:Xi,ONE_CHAR:i1,QMARK:o_,END_ANCHOR:$a,DOTS_SLASH:Da,NO_DOT:s1,NO_DOTS:o1,NO_DOT_SLASH:a1,NO_DOTS_SLASH:l1,QMARK_NO_DOT:u1,STAR:c1,START_ANCHOR:a_},f1={...l_,SLASH_LITERAL:`[${_t}]`,QMARK:s_,STAR:`${s_}*?`,DOTS_SLASH:`${xt}{1,2}(?:[${_t}]|$)`,NO_DOT:`(?!${xt})`,NO_DOTS:`(?!(?:^|[${_t}])${xt}{1,2}(?:[${_t}]|$))`,NO_DOT_SLASH:`(?!${xt}{0,1}(?:[${_t}]|$))`,NO_DOTS_SLASH:`(?!${xt}{1,2}(?:[${_t}]|$))`,QMARK_NO_DOT:`[^.${_t}]`,START_ANCHOR:`(?:^|[${_t}])`,END_ANCHOR:`(?:[${_t}]|$)`},h1={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};u_.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:h1,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:t1.sep,extglobChars(t){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?f1:l_}};});var Qi=x(We=>{var d1=K("path"),p1=process.platform==="win32",{REGEX_BACKSLASH:m1,REGEX_REMOVE_BACKSLASH:g1,REGEX_SPECIAL_CHARS:_1,REGEX_SPECIAL_CHARS_GLOBAL:y1}=En();We.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);We.hasRegexChars=t=>_1.test(t);We.isRegexChar=t=>t.length===1&&We.hasRegexChars(t);We.escapeRegex=t=>t.replace(y1,"\\$1");We.toPosixSlashes=t=>t.replace(m1,"/");We.removeBackslashes=t=>t.replace(g1,e=>e==="\\"?"":e);We.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};We.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:p1===!0||d1.sep==="\\";We.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?We.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};We.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};We.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",s=r.contains?"":"$",i=`${n}(?:${t})${s}`;return e.negated===!0&&(i=`(?:^(?!${i}).*$)`),i};});var __=x((j$,g_)=>{var c_=Qi(),{CHAR_ASTERISK:qa,CHAR_AT:w1,CHAR_BACKWARD_SLASH:An,CHAR_COMMA:b1,CHAR_DOT:Ba,CHAR_EXCLAMATION_MARK:Ua,CHAR_FORWARD_SLASH:m_,CHAR_LEFT_CURLY_BRACE:Ha,CHAR_LEFT_PARENTHESES:ja,CHAR_LEFT_SQUARE_BRACKET:S1,CHAR_PLUS:v1,CHAR_QUESTION_MARK:f_,CHAR_RIGHT_CURLY_BRACE:E1,CHAR_RIGHT_PARENTHESES:h_,CHAR_RIGHT_SQUARE_BRACKET:A1}=En(),d_=t=>t===m_||t===An,p_=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1);},x1=(t,e)=>{let r=e||{},n=t.length-1,s=r.parts===!0||r.scanToEnd===!0,i=[],o=[],l=[],f=t,d=-1,u=0,p=0,m=!1,g=!1,y=!1,S=!1,E=!1,A=!1,b=!1,T=!1,F=!1,k=!1,H=0,B,L,M={value:"",depth:0,isGlob:!1},U=()=>d>=n,R=()=>f.charCodeAt(d+1),z=()=>(B=L,f.charCodeAt(++d));for(;d0&&(te=f.slice(0,u),f=f.slice(u),p-=u),G&&y===!0&&p>0?(G=f.slice(0,p),I=f.slice(p)):y===!0?(G="",I=f):G=f,G&&G!==""&&G!=="/"&&G!==f&&d_(G.charCodeAt(G.length-1))&&(G=G.slice(0,-1)),r.unescape===!0&&(I&&(I=c_.removeBackslashes(I)),G&&b===!0&&(G=c_.removeBackslashes(G)));let O={prefix:te,input:t,start:u,base:G,glob:I,isBrace:m,isBracket:g,isGlob:y,isExtglob:S,isGlobstar:E,negated:T,negatedExtglob:F};if(r.tokens===!0&&(O.maxDepth=0,d_(L)||o.push(M),O.tokens=o),r.parts===!0||r.tokens===!0){let X;for(let Q=0;Q{var es=En(),Ze=Qi(),{MAX_LENGTH:ts,POSIX_REGEX_SOURCE:C1,REGEX_NON_SPECIAL_CHARS:R1,REGEX_SPECIAL_CHARS_BACKREF:T1,REPLACEMENTS:y_}=es,I1=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;return r},Fr=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,Wa=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=y_[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(ts,r.maxLength):ts,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);let i={type:"bos",value:"",output:r.prepend||""},o=[i],l=r.capture?"":"?:",f=Ze.isWindows(e),d=es.globChars(f),u=es.extglobChars(d),{DOT_LITERAL:p,PLUS_LITERAL:m,SLASH_LITERAL:g,ONE_CHAR:y,DOTS_SLASH:S,NO_DOT:E,NO_DOT_SLASH:A,NO_DOTS_SLASH:b,QMARK:T,QMARK_NO_DOT:F,STAR:k,START_ANCHOR:H}=d,B=Z=>`(${l}(?:(?!${H}${Z.dot?S:p}).)*?)`,L=r.dot?"":E,M=r.dot?T:F,U=r.bash===!0?B(r):k;r.capture&&(U=`(${U})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let R={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=Ze.removePrefix(t,R),s=t.length;let z=[],G=[],te=[],I=i,O,X=()=>R.index===s-1,Q=R.peek=(Z=1)=>t[R.index+Z],ie=R.advance=()=>t[++R.index]||"",$e=()=>t.slice(R.index+1),ve=(Z="",de=0)=>{R.consumed+=Z,R.index+=de;},Pt=Z=>{R.output+=Z.output!=null?Z.output:Z.value,ve(Z.value);},Gr=()=>{let Z=1;for(;Q()==="!"&&(Q(2)!=="("||Q(3)==="?");)ie(),R.start++,Z++;return Z%2===0?!1:(R.negated=!0,R.start++,!0)},Ot=Z=>{R[Z]++,te.push(Z);},st=Z=>{R[Z]--,te.pop();},oe=Z=>{if(I.type==="globstar"){let de=R.braces>0&&(Z.type==="comma"||Z.type==="brace"),W=Z.extglob===!0||z.length&&(Z.type==="pipe"||Z.type==="paren");Z.type!=="slash"&&Z.type!=="paren"&&!de&&!W&&(R.output=R.output.slice(0,-I.output.length),I.type="star",I.value="*",I.output=U,R.output+=I.output);}if(z.length&&Z.type!=="paren"&&(z[z.length-1].inner+=Z.value),(Z.value||Z.output)&&Pt(Z),I&&I.type==="text"&&Z.type==="text"){I.value+=Z.value,I.output=(I.output||"")+Z.value;return}Z.prev=I,o.push(Z),I=Z;},dr=(Z,de)=>{let W={...u[de],conditions:1,inner:""};W.prev=I,W.parens=R.parens,W.output=R.output;let ne=(r.capture?"(":"")+W.open;Ot("parens"),oe({type:Z,value:de,output:R.output?"":y}),oe({type:"paren",extglob:!0,value:ie(),output:ne}),z.push(W);},eo=Z=>{let de=Z.close+(r.capture?")":""),W;if(Z.type==="negate"){let ne=U;if(Z.inner&&Z.inner.length>1&&Z.inner.includes("/")&&(ne=B(r)),(ne!==U||X()||/^\)+$/.test($e()))&&(de=Z.close=`)$))${ne}`),Z.inner.includes("*")&&(W=$e())&&/^\.[^\\/.]+$/.test(W)){let pe=Wa(W,{...e,fastpaths:!1}).output;de=Z.close=`)${pe})${ne})`;}Z.prev.type==="bos"&&(R.negatedExtglob=!0);}oe({type:"paren",extglob:!0,value:O,output:de}),st("parens");};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let Z=!1,de=t.replace(T1,(W,ne,pe,Ie,ye,Vt)=>Ie==="\\"?(Z=!0,W):Ie==="?"?ne?ne+Ie+(ye?T.repeat(ye.length):""):Vt===0?M+(ye?T.repeat(ye.length):""):T.repeat(pe.length):Ie==="."?p.repeat(pe.length):Ie==="*"?ne?ne+Ie+(ye?U:""):U:ne?W:`\\${W}`);return Z===!0&&(r.unescape===!0?de=de.replace(/\\/g,""):de=de.replace(/\\+/g,W=>W.length%2===0?"\\\\":W?"\\":"")),de===t&&r.contains===!0?(R.output=t,R):(R.output=Ze.wrapOutput(de,R,e),R)}for(;!X();){if(O=ie(),O==="\0")continue;if(O==="\\"){let W=Q();if(W==="/"&&r.bash!==!0||W==="."||W===";")continue;if(!W){O+="\\",oe({type:"text",value:O});continue}let ne=/^\\+/.exec($e()),pe=0;if(ne&&ne[0].length>2&&(pe=ne[0].length,R.index+=pe,pe%2!==0&&(O+="\\")),r.unescape===!0?O=ie():O+=ie(),R.brackets===0){oe({type:"text",value:O});continue}}if(R.brackets>0&&(O!=="]"||I.value==="["||I.value==="[^")){if(r.posix!==!1&&O===":"){let W=I.value.slice(1);if(W.includes("[")&&(I.posix=!0,W.includes(":"))){let ne=I.value.lastIndexOf("["),pe=I.value.slice(0,ne),Ie=I.value.slice(ne+2),ye=C1[Ie];if(ye){I.value=pe+ye,R.backtrack=!0,ie(),!i.output&&o.indexOf(I)===1&&(i.output=y);continue}}}(O==="["&&Q()!==":"||O==="-"&&Q()==="]")&&(O=`\\${O}`),O==="]"&&(I.value==="["||I.value==="[^")&&(O=`\\${O}`),r.posix===!0&&O==="!"&&I.value==="["&&(O="^"),I.value+=O,Pt({value:O});continue}if(R.quotes===1&&O!=='"'){O=Ze.escapeRegex(O),I.value+=O,Pt({value:O});continue}if(O==='"'){R.quotes=R.quotes===1?0:1,r.keepQuotes===!0&&oe({type:"text",value:O});continue}if(O==="("){Ot("parens"),oe({type:"paren",value:O});continue}if(O===")"){if(R.parens===0&&r.strictBrackets===!0)throw new SyntaxError(Fr("opening","("));let W=z[z.length-1];if(W&&R.parens===W.parens+1){eo(z.pop());continue}oe({type:"paren",value:O,output:R.parens?")":"\\)"}),st("parens");continue}if(O==="["){if(r.nobracket===!0||!$e().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError(Fr("closing","]"));O=`\\${O}`;}else Ot("brackets");oe({type:"bracket",value:O});continue}if(O==="]"){if(r.nobracket===!0||I&&I.type==="bracket"&&I.value.length===1){oe({type:"text",value:O,output:`\\${O}`});continue}if(R.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError(Fr("opening","["));oe({type:"text",value:O,output:`\\${O}`});continue}st("brackets");let W=I.value.slice(1);if(I.posix!==!0&&W[0]==="^"&&!W.includes("/")&&(O=`/${O}`),I.value+=O,Pt({value:O}),r.literalBrackets===!1||Ze.hasRegexChars(W))continue;let ne=Ze.escapeRegex(I.value);if(R.output=R.output.slice(0,-I.value.length),r.literalBrackets===!0){R.output+=ne,I.value=ne;continue}I.value=`(${l}${ne}|${I.value})`,R.output+=I.value;continue}if(O==="{"&&r.nobrace!==!0){Ot("braces");let W={type:"brace",value:O,output:"(",outputIndex:R.output.length,tokensIndex:R.tokens.length};G.push(W),oe(W);continue}if(O==="}"){let W=G[G.length-1];if(r.nobrace===!0||!W){oe({type:"text",value:O,output:O});continue}let ne=")";if(W.dots===!0){let pe=o.slice(),Ie=[];for(let ye=pe.length-1;ye>=0&&(o.pop(),pe[ye].type!=="brace");ye--)pe[ye].type!=="dots"&&Ie.unshift(pe[ye].value);ne=I1(Ie,r),R.backtrack=!0;}if(W.comma!==!0&&W.dots!==!0){let pe=R.output.slice(0,W.outputIndex),Ie=R.tokens.slice(W.tokensIndex);W.value=W.output="\\{",O=ne="\\}",R.output=pe;for(let ye of Ie)R.output+=ye.output||ye.value;}oe({type:"brace",value:O,output:ne}),st("braces"),G.pop();continue}if(O==="|"){z.length>0&&z[z.length-1].conditions++,oe({type:"text",value:O});continue}if(O===","){let W=O,ne=G[G.length-1];ne&&te[te.length-1]==="braces"&&(ne.comma=!0,W="|"),oe({type:"comma",value:O,output:W});continue}if(O==="/"){if(I.type==="dot"&&R.index===R.start+1){R.start=R.index+1,R.consumed="",R.output="",o.pop(),I=i;continue}oe({type:"slash",value:O,output:g});continue}if(O==="."){if(R.braces>0&&I.type==="dot"){I.value==="."&&(I.output=p);let W=G[G.length-1];I.type="dots",I.output+=O,I.value+=O,W.dots=!0;continue}if(R.braces+R.parens===0&&I.type!=="bos"&&I.type!=="slash"){oe({type:"text",value:O,output:p});continue}oe({type:"dot",value:O,output:p});continue}if(O==="?"){if(!(I&&I.value==="(")&&r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){dr("qmark",O);continue}if(I&&I.type==="paren"){let ne=Q(),pe=O;if(ne==="<"&&!Ze.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(I.value==="("&&!/[!=<:]/.test(ne)||ne==="<"&&!/<([!=]|\w+>)/.test($e()))&&(pe=`\\${O}`),oe({type:"text",value:O,output:pe});continue}if(r.dot!==!0&&(I.type==="slash"||I.type==="bos")){oe({type:"qmark",value:O,output:F});continue}oe({type:"qmark",value:O,output:T});continue}if(O==="!"){if(r.noextglob!==!0&&Q()==="("&&(Q(2)!=="?"||!/[!=<:]/.test(Q(3)))){dr("negate",O);continue}if(r.nonegate!==!0&&R.index===0){Gr();continue}}if(O==="+"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){dr("plus",O);continue}if(I&&I.value==="("||r.regex===!1){oe({type:"plus",value:O,output:m});continue}if(I&&(I.type==="bracket"||I.type==="paren"||I.type==="brace")||R.parens>0){oe({type:"plus",value:O});continue}oe({type:"plus",value:m});continue}if(O==="@"){if(r.noextglob!==!0&&Q()==="("&&Q(2)!=="?"){oe({type:"at",extglob:!0,value:O,output:""});continue}oe({type:"text",value:O});continue}if(O!=="*"){(O==="$"||O==="^")&&(O=`\\${O}`);let W=R1.exec($e());W&&(O+=W[0],R.index+=W[0].length),oe({type:"text",value:O});continue}if(I&&(I.type==="globstar"||I.star===!0)){I.type="star",I.star=!0,I.value+=O,I.output=U,R.backtrack=!0,R.globstar=!0,ve(O);continue}let Z=$e();if(r.noextglob!==!0&&/^\([^?]/.test(Z)){dr("star",O);continue}if(I.type==="star"){if(r.noglobstar===!0){ve(O);continue}let W=I.prev,ne=W.prev,pe=W.type==="slash"||W.type==="bos",Ie=ne&&(ne.type==="star"||ne.type==="globstar");if(r.bash===!0&&(!pe||Z[0]&&Z[0]!=="/")){oe({type:"star",value:O,output:""});continue}let ye=R.braces>0&&(W.type==="comma"||W.type==="brace"),Vt=z.length&&(W.type==="pipe"||W.type==="paren");if(!pe&&W.type!=="paren"&&!ye&&!Vt){oe({type:"star",value:O,output:""});continue}for(;Z.slice(0,3)==="/**";){let Ft=t[R.index+4];if(Ft&&Ft!=="/")break;Z=Z.slice(3),ve("/**",3);}if(W.type==="bos"&&X()){I.type="globstar",I.value+=O,I.output=B(r),R.output=I.output,R.globstar=!0,ve(O);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&!Ie&&X()){R.output=R.output.slice(0,-(W.output+I.output).length),W.output=`(?:${W.output}`,I.type="globstar",I.output=B(r)+(r.strictSlashes?")":"|$)"),I.value+=O,R.globstar=!0,R.output+=W.output+I.output,ve(O);continue}if(W.type==="slash"&&W.prev.type!=="bos"&&Z[0]==="/"){let Ft=Z[1]!==void 0?"|$":"";R.output=R.output.slice(0,-(W.output+I.output).length),W.output=`(?:${W.output}`,I.type="globstar",I.output=`${B(r)}${g}|${g}${Ft})`,I.value+=O,R.output+=W.output+I.output,R.globstar=!0,ve(O+ie()),oe({type:"slash",value:"/",output:""});continue}if(W.type==="bos"&&Z[0]==="/"){I.type="globstar",I.value+=O,I.output=`(?:^|${g}|${B(r)}${g})`,R.output=I.output,R.globstar=!0,ve(O+ie()),oe({type:"slash",value:"/",output:""});continue}R.output=R.output.slice(0,-I.output.length),I.type="globstar",I.output=B(r),I.value+=O,R.output+=I.output,R.globstar=!0,ve(O);continue}let de={type:"star",value:O,output:U};if(r.bash===!0){de.output=".*?",(I.type==="bos"||I.type==="slash")&&(de.output=L+de.output),oe(de);continue}if(I&&(I.type==="bracket"||I.type==="paren")&&r.regex===!0){de.output=O,oe(de);continue}(R.index===R.start||I.type==="slash"||I.type==="dot")&&(I.type==="dot"?(R.output+=A,I.output+=A):r.dot===!0?(R.output+=b,I.output+=b):(R.output+=L,I.output+=L),Q()!=="*"&&(R.output+=y,I.output+=y)),oe(de);}for(;R.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError(Fr("closing","]"));R.output=Ze.escapeLast(R.output,"["),st("brackets");}for(;R.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError(Fr("closing",")"));R.output=Ze.escapeLast(R.output,"("),st("parens");}for(;R.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError(Fr("closing","}"));R.output=Ze.escapeLast(R.output,"{"),st("braces");}if(r.strictSlashes!==!0&&(I.type==="star"||I.type==="bracket")&&oe({type:"maybe_slash",value:"",output:`${g}?`}),R.backtrack===!0){R.output="";for(let Z of R.tokens)R.output+=Z.output!=null?Z.output:Z.value,Z.suffix&&(R.output+=Z.suffix);}return R};Wa.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(ts,r.maxLength):ts,s=t.length;if(s>n)throw new SyntaxError(`Input length: ${s}, exceeds maximum allowed length: ${n}`);t=y_[t]||t;let i=Ze.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:l,ONE_CHAR:f,DOTS_SLASH:d,NO_DOT:u,NO_DOTS:p,NO_DOTS_SLASH:m,STAR:g,START_ANCHOR:y}=es.globChars(i),S=r.dot?p:u,E=r.dot?m:u,A=r.capture?"":"?:",b={negated:!1,prefix:""},T=r.bash===!0?".*?":g;r.capture&&(T=`(${T})`);let F=L=>L.noglobstar===!0?T:`(${A}(?:(?!${y}${L.dot?d:o}).)*?)`,k=L=>{switch(L){case"*":return `${S}${f}${T}`;case".*":return `${o}${f}${T}`;case"*.*":return `${S}${T}${o}${f}${T}`;case"*/*":return `${S}${T}${l}${f}${E}${T}`;case"**":return S+F(r);case"**/*":return `(?:${S}${F(r)}${l})?${E}${f}${T}`;case"**/*.*":return `(?:${S}${F(r)}${l})?${E}${T}${o}${f}${T}`;case"**/.*":return `(?:${S}${F(r)}${l})?${o}${f}${T}`;default:{let M=/^(.*?)\.(\w+)$/.exec(L);if(!M)return;let U=k(M[1]);return U?U+o+M[2]:void 0}}},H=Ze.removePrefix(t,b),B=k(H);return B&&r.strictSlashes!==!0&&(B+=`${l}?`),B};w_.exports=Wa;});var v_=x((z$,S_)=>{var P1=K("path"),O1=__(),za=b_(),Ga=Qi(),F1=En(),M1=t=>t&&typeof t=="object"&&!Array.isArray(t),be=(t,e,r=!1)=>{if(Array.isArray(t)){let u=t.map(m=>be(m,e,r));return m=>{for(let g of u){let y=g(m);if(y)return y}return !1}}let n=M1(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let s=e||{},i=Ga.isWindows(e),o=n?be.compileRe(t,e):be.makeRe(t,e,!1,!0),l=o.state;delete o.state;let f=()=>!1;if(s.ignore){let u={...e,ignore:null,onMatch:null,onResult:null};f=be(s.ignore,u,r);}let d=(u,p=!1)=>{let{isMatch:m,match:g,output:y}=be.test(u,o,e,{glob:t,posix:i}),S={glob:t,state:l,regex:o,posix:i,input:u,output:y,match:g,isMatch:m};return typeof s.onResult=="function"&&s.onResult(S),m===!1?(S.isMatch=!1,p?S:!1):f(u)?(typeof s.onIgnore=="function"&&s.onIgnore(S),S.isMatch=!1,p?S:!1):(typeof s.onMatch=="function"&&s.onMatch(S),p?S:!0)};return r&&(d.state=l),d};be.test=(t,e,r,{glob:n,posix:s}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return {isMatch:!1,output:""};let i=r||{},o=i.format||(s?Ga.toPosixSlashes:null),l=t===n,f=l&&o?o(t):t;return l===!1&&(f=o?o(t):t,l=f===n),(l===!1||i.capture===!0)&&(i.matchBase===!0||i.basename===!0?l=be.matchBase(t,e,r,s):l=e.exec(f)),{isMatch:!!l,match:l,output:f}};be.matchBase=(t,e,r,n=Ga.isWindows(r))=>(e instanceof RegExp?e:be.makeRe(e,r)).test(P1.basename(t));be.isMatch=(t,e,r)=>be(e,r)(t);be.parse=(t,e)=>Array.isArray(t)?t.map(r=>be.parse(r,e)):za(t,{...e,fastpaths:!1});be.scan=(t,e)=>O1(t,e);be.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let s=e||{},i=s.contains?"":"^",o=s.contains?"":"$",l=`${i}(?:${t.output})${o}`;t&&t.negated===!0&&(l=`^(?!${l}).*$`);let f=be.toRegex(l,e);return n===!0&&(f.state=t),f};be.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let s={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(s.output=za.fastpaths(t,e)),s.output||(s=za(t,e)),be.compileRe(s,e,r,n)};be.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return /$^/}};be.constants=F1;S_.exports=be;});var Va=x((G$,E_)=>{E_.exports=v_();});var O_=x((V$,P_)=>{var Cn=K("fs"),{Readable:N1}=K("stream"),xn=K("path"),{promisify:ss}=K("util"),Ka=Va(),k1=ss(Cn.readdir),L1=ss(Cn.stat),A_=ss(Cn.lstat),$1=ss(Cn.realpath),D1="!",T_="READDIRP_RECURSIVE_ERROR",q1=new Set(["ENOENT","EPERM","EACCES","ELOOP",T_]),Za="files",I_="directories",ns="files_directories",rs="all",x_=[Za,I_,ns,rs],B1=t=>q1.has(t.code),[C_,U1]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),H1=process.platform==="win32"&&(C_>10||C_===10&&U1>=5),R_=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=Ka(t.trim());return r=>e(r.basename)}if(Array.isArray(t)){let e=[],r=[];for(let n of t){let s=n.trim();s.charAt(0)===D1?r.push(Ka(s.slice(1))):e.push(Ka(s));}return r.length>0?e.length>0?n=>e.some(s=>s(n.basename))&&!r.some(s=>s(n.basename)):n=>!r.some(s=>s(n.basename)):n=>e.some(s=>s(n.basename))}}},is=class t extends N1{static get defaultOptions(){return {root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:Za,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let r={...t.defaultOptions,...e},{root:n,type:s}=r;this._fileFilter=R_(r.fileFilter),this._directoryFilter=R_(r.directoryFilter);let i=r.lstat?A_:L1;H1?this._stat=o=>i(o,{bigint:!0}):this._stat=i,this._maxDepth=r.depth,this._wantsDir=[I_,ns,rs].includes(s),this._wantsFile=[Za,ns,rs].includes(s),this._wantsEverything=s===rs,this._root=xn.resolve(n),this._isDirent="Dirent"in Cn&&!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0;}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:r,depth:n,files:s=[]}=this.parent||{};if(s.length>0){let i=s.splice(0,e).map(o=>this._formatEntry(o,r));for(let o of await Promise.all(i)){if(this.destroyed)return;let l=await this._getEntryType(o);l==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(l==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--);}}else {let i=this.parents.pop();if(!i){this.push(null);break}if(this.parent=await i,this.destroyed)return}}}catch(r){this.destroy(r);}finally{this.reading=!1;}}}async _exploreDir(e,r){let n;try{n=await k1(e,this._rdOptions);}catch(s){this._onError(s);}return {files:n,depth:r,path:e}}async _formatEntry(e,r){let n;try{let s=this._isDirent?e.name:e,i=xn.resolve(xn.join(r,s));n={path:xn.relative(this._root,i),fullPath:i,basename:s},n[this._statsProp]=this._isDirent?e:await this._stat(i);}catch(s){this._onError(s);}return n}_onError(e){B1(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e);}async _getEntryType(e){let r=e&&e[this._statsProp];if(r){if(r.isFile())return "file";if(r.isDirectory())return "directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let s=await $1(n),i=await A_(s);if(i.isFile())return "file";if(i.isDirectory()){let o=s.length;if(n.startsWith(s)&&n.substr(o,1)===xn.sep){let l=new Error(`Circular symlink detected: "${n}" points to "${s}"`);return l.code=T_,this._onError(l)}return "directory"}}catch(s){this._onError(s);}}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},Mr=(t,e={})=>{let r=e.entryType||e.type;if(r==="both"&&(r=ns),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!x_.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${x_.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new is(e)},j1=(t,e={})=>new Promise((r,n)=>{let s=[];Mr(t,e).on("data",i=>s.push(i)).on("end",()=>r(s)).on("error",i=>n(i));});Mr.promise=j1;Mr.ReaddirpStream=is;Mr.default=Mr;P_.exports=Mr;});var Ya=x((K$,F_)=>{F_.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return "/";var r=t.length;if(r<=1)return t;var n="";if(r>4&&t[3]==="\\"){var s=t[2];(s==="?"||s===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),n="//");}var i=t.split(/[/\\]+/);return e!==!1&&i[i.length-1]===""&&i.pop(),n+i.join("/")};});var D_=x((L_,$_)=>{Object.defineProperty(L_,"__esModule",{value:!0});var k_=Va(),W1=Ya(),M_="!",z1={returnIndex:!1},G1=t=>Array.isArray(t)?t:[t],V1=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let r=k_(t,e);return n=>t===n||r(n)}return t instanceof RegExp?r=>t.test(r):r=>!1},N_=(t,e,r,n)=>{let s=Array.isArray(r),i=s?r[0]:r;if(!s&&typeof i!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(i));let o=W1(i,!1);for(let f=0;f{if(t==null)throw new TypeError("anymatch: specify first argument");let n=typeof r=="boolean"?{returnIndex:r}:r,s=n.returnIndex||!1,i=G1(t),o=i.filter(f=>typeof f=="string"&&f.charAt(0)===M_).map(f=>f.slice(1)).map(f=>k_(f,n)),l=i.filter(f=>typeof f!="string"||typeof f=="string"&&f.charAt(0)!==M_).map(f=>V1(f,n));return e==null?(f,d=!1)=>N_(l,o,f,typeof d=="boolean"?d:!1):N_(l,o,e,s)};Ja.default=Ja;$_.exports=Ja;});var B_=x((Z$,q_)=>{q_.exports=function(e){if(typeof e!="string"||e==="")return !1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return !0;e=e.slice(r.index+r[0].length);}return !1};});var Xa=x((Y$,H_)=>{var K1=B_(),U_={"{":"}","(":")","[":"]"},Z1=function(t){if(t[0]==="!")return !0;for(var e=0,r=-2,n=-2,s=-2,i=-2,o=-2;ee&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||s!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(s=t.indexOf("}",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||i!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(i=t.indexOf(")",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(o=t.indexOf("\\",r),o===-1||o>i))))return !0;if(t[e]==="\\"){var l=t[e+1];e+=2;var f=U_[l];if(f){var d=t.indexOf(f,e);d!==-1&&(e=d+1);}if(t[e]==="!")return !0}else e++;}return !1},Y1=function(t){if(t[0]==="!")return !0;for(var e=0;e{var J1=Xa(),X1=K("path").posix.dirname,Q1=K("os").platform()==="win32",Qa="/",eI=/\\/g,tI=/[\{\[].*[\}\]]$/,rI=/(^|[^\\])([\{\[]|\([^\)]+$)/,nI=/\\([\!\*\?\|\[\]\(\)\{\}])/g;j_.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&Q1&&e.indexOf(Qa)<0&&(e=e.replace(eI,Qa)),tI.test(e)&&(e+=Qa),e+="a";do e=X1(e);while(J1(e)||rI.test(e));return e.replace(nI,"$1")};});var os=x(rt=>{rt.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;rt.find=(t,e)=>t.nodes.find(r=>r.type===e);rt.exceedsLimit=(t,e,r=1,n)=>n===!1||!rt.isInteger(t)||!rt.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;rt.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0);};rt.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);rt.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;rt.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;rt.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);rt.flatten=(...t)=>{let e=[],r=n=>{for(let s=0;s{var z_=os();G_.exports=(t,e={})=>{let r=(n,s={})=>{let i=e.escapeInvalid&&z_.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,l="";if(n.value)return (i||o)&&z_.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let f of n.nodes)l+=r(f);return l};return r(t)};});var K_=x((eD,V_)=>{V_.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};});var ny=x((tD,ry)=>{var Z_=K_(),rr=(t,e,r)=>{if(Z_(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(Z_(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let s=String(n.relaxZeros),i=String(n.shorthand),o=String(n.capture),l=String(n.wrap),f=t+":"+e+"="+s+i+o+l;if(rr.cache.hasOwnProperty(f))return rr.cache[f].result;let d=Math.min(t,e),u=Math.max(t,e);if(Math.abs(d-u)===1){let S=t+"|"+e;return n.capture?`(${S})`:n.wrap===!1?S:`(?:${S})`}let p=ty(t)||ty(e),m={min:t,max:e,a:d,b:u},g=[],y=[];if(p&&(m.isPadded=p,m.maxLen=String(m.max).length),d<0){let S=u<0?Math.abs(u):1;y=Y_(S,Math.abs(d),m,n),d=m.a=0;}return u>=0&&(g=Y_(d,u,m,n)),m.negatives=y,m.positives=g,m.result=iI(y,g),n.capture===!0?m.result=`(${m.result})`:n.wrap!==!1&&g.length+y.length>1&&(m.result=`(?:${m.result})`),rr.cache[f]=m,m.result};function iI(t,e,r){let n=el(t,e,"-",!1)||[],s=el(e,t,"",!1)||[],i=el(t,e,"-?",!0)||[];return n.concat(i).concat(s).join("|")}function sI(t,e){let r=1,n=1,s=X_(t,r),i=new Set([e]);for(;t<=s&&s<=e;)i.add(s),r+=1,s=X_(t,r);for(s=Q_(e+1,n)-1;t1&&l.count.pop(),l.count.push(u.count[0]),l.string=l.pattern+ey(l.count),o=d+1;continue}r.isPadded&&(p=cI(d,r,n)),u.string=p+u.pattern+ey(u.count),i.push(u),o=d+1,l=u;}return i}function el(t,e,r,n,s){let i=[];for(let o of t){let{string:l}=o;!n&&!J_(e,"string",l)&&i.push(r+l),n&&J_(e,"string",l)&&i.push(r+l);}return i}function aI(t,e){let r=[];for(let n=0;ne?1:e>t?-1:0}function J_(t,e,r){return t.some(n=>n[e]===r)}function X_(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function Q_(t,e){return t-t%Math.pow(10,e)}function ey(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function uI(t,e,r){return `[${t}${e-t===1?"":"-"}${e}]`}function ty(t){return /^-?(0+)\d/.test(t)}function cI(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),s=r.relaxZeros!==!1;switch(n){case 0:return "";case 1:return s?"0?":"0";case 2:return s?"0{0,2}":"00";default:return s?`0{0,${n}}`:`0{${n}}`}}rr.cache={};rr.clearCache=()=>rr.cache={};ry.exports=rr;});var nl=x((rD,fy)=>{var fI=K("util"),oy=ny(),iy=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),hI=t=>e=>t===!0?Number(e):String(e),tl=t=>typeof t=="number"||typeof t=="string"&&t!=="",Rn=t=>Number.isInteger(+t),rl=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return !1;for(;e[++r]==="0";);return r>0},dI=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,pI=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0");}return r===!1?String(t):t},sy=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length{t.negatives.sort((o,l)=>ol?1:0),t.positives.sort((o,l)=>ol?1:0);let r=e.capture?"":"?:",n="",s="",i;return t.positives.length&&(n=t.positives.join("|")),t.negatives.length&&(s=`-(${r}${t.negatives.join("|")})`),n&&s?i=`${n}|${s}`:i=n||s,e.wrap?`(${r}${i})`:i},ay=(t,e,r,n)=>{if(r)return oy(t,e,{wrap:!1,...n});let s=String.fromCharCode(t);if(t===e)return s;let i=String.fromCharCode(e);return `[${s}-${i}]`},ly=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,s=r.capture?"":"?:";return n?`(${s}${t.join("|")})`:t.join("|")}return oy(t,e,r)},uy=(...t)=>new RangeError("Invalid range arguments: "+fI.inspect(...t)),cy=(t,e,r)=>{if(r.strictRanges===!0)throw uy([t,e]);return []},gI=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return []},_I=(t,e,r=1,n={})=>{let s=Number(t),i=Number(e);if(!Number.isInteger(s)||!Number.isInteger(i)){if(n.strictRanges===!0)throw uy([t,e]);return []}s===0&&(s=0),i===0&&(i=0);let o=s>i,l=String(t),f=String(e),d=String(r);r=Math.max(Math.abs(r),1);let u=rl(l)||rl(f)||rl(d),p=u?Math.max(l.length,f.length,d.length):0,m=u===!1&&dI(t,e,n)===!1,g=n.transform||hI(m);if(n.toRegex&&r===1)return ay(sy(t,p),sy(e,p),!0,n);let y={negatives:[],positives:[]},S=b=>y[b<0?"negatives":"positives"].push(Math.abs(b)),E=[],A=0;for(;o?s>=i:s<=i;)n.toRegex===!0&&r>1?S(s):E.push(pI(g(s,A),p,m)),s=o?s-r:s+r,A++;return n.toRegex===!0?r>1?mI(y,n):ly(E,null,{wrap:!1,...n}):E},yI=(t,e,r=1,n={})=>{if(!Rn(t)&&t.length>1||!Rn(e)&&e.length>1)return cy(t,e,n);let s=n.transform||(m=>String.fromCharCode(m)),i=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),l=i>o,f=Math.min(i,o),d=Math.max(i,o);if(n.toRegex&&r===1)return ay(f,d,!1,n);let u=[],p=0;for(;l?i>=o:i<=o;)u.push(s(i,p)),i=l?i-r:i+r,p++;return n.toRegex===!0?ly(u,null,{wrap:!1,options:n}):u},ls=(t,e,r,n={})=>{if(e==null&&tl(t))return [t];if(!tl(t)||!tl(e))return cy(t,e,n);if(typeof r=="function")return ls(t,e,1,{transform:r});if(iy(r))return ls(t,e,0,r);let s={...n};return s.capture===!0&&(s.wrap=!0),r=r||s.step||1,Rn(r)?Rn(t)&&Rn(e)?_I(t,e,r,s):yI(t,e,Math.max(Math.abs(r),1),s):r!=null&&!iy(r)?gI(r,s):ls(t,e,1,r)};fy.exports=ls;});var py=x((nD,dy)=>{var wI=nl(),hy=os(),bI=(t,e={})=>{let r=(n,s={})=>{let i=hy.isInvalidBrace(s),o=n.invalid===!0&&e.escapeInvalid===!0,l=i===!0||o===!0,f=e.escapeInvalid===!0?"\\":"",d="";if(n.isOpen===!0||n.isClose===!0)return f+n.value;if(n.type==="open")return l?f+n.value:"(";if(n.type==="close")return l?f+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":l?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let u=hy.reduce(n.nodes),p=wI(...u,{...e,wrap:!1,toRegex:!0});if(p.length!==0)return u.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let u of n.nodes)d+=r(u,n);return d};return r(t)};dy.exports=bI;});var _y=x((iD,gy)=>{var SI=nl(),my=as(),Nr=os(),nr=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?Nr.flatten(e).map(s=>`{${s}}`):e;for(let s of t)if(Array.isArray(s))for(let i of s)n.push(nr(i,e,r));else for(let i of e)r===!0&&typeof i=="string"&&(i=`{${i}}`),n.push(Array.isArray(i)?nr(s,i,r):s+i);return Nr.flatten(n)},vI=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(s,i={})=>{s.queue=[];let o=i,l=i.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,l=o.queue;if(s.invalid||s.dollar){l.push(nr(l.pop(),my(s,e)));return}if(s.type==="brace"&&s.invalid!==!0&&s.nodes.length===2){l.push(nr(l.pop(),["{}"]));return}if(s.nodes&&s.ranges>0){let p=Nr.reduce(s.nodes);if(Nr.exceedsLimit(...p,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let m=SI(...p,e);m.length===0&&(m=my(s,e)),l.push(nr(l.pop(),m)),s.nodes=[];return}let f=Nr.encloseBrace(s),d=s.queue,u=s;for(;u.type!=="brace"&&u.type!=="root"&&u.parent;)u=u.parent,d=u.queue;for(let p=0;p{yy.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` -`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};});var Ay=x((oD,Ey)=>{var EI=as(),{MAX_LENGTH:by,CHAR_BACKSLASH:il,CHAR_BACKTICK:AI,CHAR_COMMA:xI,CHAR_DOT:CI,CHAR_LEFT_PARENTHESES:RI,CHAR_RIGHT_PARENTHESES:TI,CHAR_LEFT_CURLY_BRACE:II,CHAR_RIGHT_CURLY_BRACE:PI,CHAR_LEFT_SQUARE_BRACKET:Sy,CHAR_RIGHT_SQUARE_BRACKET:vy,CHAR_DOUBLE_QUOTE:OI,CHAR_SINGLE_QUOTE:FI,CHAR_NO_BREAK_SPACE:MI,CHAR_ZERO_WIDTH_NOBREAK_SPACE:NI}=wy(),kI=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(by,r.maxLength):by;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let s={type:"root",input:t,nodes:[]},i=[s],o=s,l=s,f=0,d=t.length,u=0,p=0,m,y=()=>t[u++],S=E=>{if(E.type==="text"&&l.type==="dot"&&(l.type="text"),l&&l.type==="text"&&E.type==="text"){l.value+=E.value;return}return o.nodes.push(E),E.parent=o,E.prev=l,l=E,E};for(S({type:"bos"});u0){if(o.ranges>0){o.ranges=0;let E=o.nodes.shift();o.nodes=[E,{type:"text",value:EI(o)}];}S({type:"comma",value:m}),o.commas++;continue}if(m===CI&&p>0&&o.commas===0){let E=o.nodes;if(p===0||E.length===0){S({type:"text",value:m});continue}if(l.type==="dot"){if(o.range=[],l.value+=m,l.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,l.type="text";continue}o.ranges++,o.args=[];continue}if(l.type==="range"){E.pop();let A=E[E.length-1];A.value+=l.value+m,l=A,o.ranges--;continue}S({type:"dot",value:m});continue}S({type:"text",value:m});}do if(o=i.pop(),o.type!=="root"){o.nodes.forEach(b=>{b.nodes||(b.type==="open"&&(b.isOpen=!0),b.type==="close"&&(b.isClose=!0),b.nodes||(b.type="text"),b.invalid=!0);});let E=i[i.length-1],A=E.nodes.indexOf(o);E.nodes.splice(A,1,...o.nodes);}while(i.length>0);return S({type:"eos"}),s};Ey.exports=kI;});var Ry=x((aD,Cy)=>{var xy=as(),LI=py(),$I=_y(),DI=Ay(),Ye=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let s=Ye.create(n,e);Array.isArray(s)?r.push(...s):r.push(s);}else r=[].concat(Ye.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};Ye.parse=(t,e={})=>DI(t,e);Ye.stringify=(t,e={})=>xy(typeof t=="string"?Ye.parse(t,e):t,e);Ye.compile=(t,e={})=>(typeof t=="string"&&(t=Ye.parse(t,e)),LI(t,e));Ye.expand=(t,e={})=>{typeof t=="string"&&(t=Ye.parse(t,e));let r=$I(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};Ye.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?Ye.compile(t,e):Ye.expand(t,e);Cy.exports=Ye;});var Ty=x((lD,qI)=>{qI.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];});var Py=x((uD,Iy)=>{Iy.exports=Ty();});var Fy=x((cD,Oy)=>{var BI=K("path"),UI=Py(),HI=new Set(UI);Oy.exports=t=>HI.has(BI.extname(t).slice(1).toLowerCase());});var us=x(ee=>{var{sep:jI}=K("path"),{platform:sl}=process,WI=K("os");ee.EV_ALL="all";ee.EV_READY="ready";ee.EV_ADD="add";ee.EV_CHANGE="change";ee.EV_ADD_DIR="addDir";ee.EV_UNLINK="unlink";ee.EV_UNLINK_DIR="unlinkDir";ee.EV_RAW="raw";ee.EV_ERROR="error";ee.STR_DATA="data";ee.STR_END="end";ee.STR_CLOSE="close";ee.FSEVENT_CREATED="created";ee.FSEVENT_MODIFIED="modified";ee.FSEVENT_DELETED="deleted";ee.FSEVENT_MOVED="moved";ee.FSEVENT_CLONED="cloned";ee.FSEVENT_UNKNOWN="unknown";ee.FSEVENT_TYPE_FILE="file";ee.FSEVENT_TYPE_DIRECTORY="directory";ee.FSEVENT_TYPE_SYMLINK="symlink";ee.KEY_LISTENERS="listeners";ee.KEY_ERR="errHandlers";ee.KEY_RAW="rawEmitters";ee.HANDLER_KEYS=[ee.KEY_LISTENERS,ee.KEY_ERR,ee.KEY_RAW];ee.DOT_SLASH=`.${jI}`;ee.BACK_SLASH_RE=/\\/g;ee.DOUBLE_SLASH_RE=/\/\//;ee.SLASH_OR_BACK_SLASH_RE=/[/\\]/;ee.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;ee.REPLACER_RE=/^\.[/\\]/;ee.SLASH="/";ee.SLASH_SLASH="//";ee.BRACE_START="{";ee.BANG="!";ee.ONE_DOT=".";ee.TWO_DOTS="..";ee.STAR="*";ee.GLOBSTAR="**";ee.ROOT_GLOBSTAR="/**/*";ee.SLASH_GLOBSTAR="/**";ee.DIR_SUFFIX="Dir";ee.ANYMATCH_OPTS={dot:!0};ee.STRING_TYPE="string";ee.FUNCTION_TYPE="function";ee.EMPTY_STR="";ee.EMPTY_FN=()=>{};ee.IDENTITY_FN=t=>t;ee.isWindows=sl==="win32";ee.isMacos=sl==="darwin";ee.isLinux=sl==="linux";ee.isIBMi=WI.type()==="OS400";});var Dy=x((hD,$y)=>{var Ct=K("fs"),Ce=K("path"),{promisify:On}=K("util"),zI=Fy(),{isWindows:GI,isLinux:VI,EMPTY_FN:KI,EMPTY_STR:ZI,KEY_LISTENERS:kr,KEY_ERR:ol,KEY_RAW:Tn,HANDLER_KEYS:YI,EV_CHANGE:hs,EV_ADD:cs,EV_ADD_DIR:JI,EV_ERROR:Ny,STR_DATA:XI,STR_END:QI,BRACE_START:eP,STAR:tP}=us(),rP="watch",nP=On(Ct.open),ky=On(Ct.stat),iP=On(Ct.lstat),sP=On(Ct.close),al=On(Ct.realpath),oP={lstat:iP,stat:ky},ul=(t,e)=>{t instanceof Set?t.forEach(e):e(t);},In=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r);},aP=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e];},Pn=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e];},Ly=t=>t instanceof Set?t.size===0:!t,ds=new Map;function My(t,e,r,n,s){let i=(o,l)=>{r(t),s(o,l,{watchedPath:t}),l&&t!==l&&ps(Ce.resolve(t,l),kr,Ce.join(t,l));};try{return Ct.watch(t,e,i)}catch(o){n(o);}}var ps=(t,e,r,n,s)=>{let i=ds.get(t);i&&ul(i[e],o=>{o(r,n,s);});},lP=(t,e,r,n)=>{let{listener:s,errHandler:i,rawEmitter:o}=n,l=ds.get(e),f;if(!r.persistent)return f=My(t,r,s,i,o),f.close.bind(f);if(l)In(l,kr,s),In(l,ol,i),In(l,Tn,o);else {if(f=My(t,r,ps.bind(null,e,kr),i,ps.bind(null,e,Tn)),!f)return;f.on(Ny,async d=>{let u=ps.bind(null,e,ol);if(l.watcherUnusable=!0,GI&&d.code==="EPERM")try{let p=await nP(t,"r");await sP(p),u(d);}catch{}else u(d);}),l={listeners:s,errHandlers:i,rawEmitters:o,watcher:f},ds.set(e,l);}return ()=>{Pn(l,kr,s),Pn(l,ol,i),Pn(l,Tn,o),Ly(l.listeners)&&(l.watcher.close(),ds.delete(e),YI.forEach(aP(l)),l.watcher=void 0,Object.freeze(l));}},ll=new Map,uP=(t,e,r,n)=>{let {listener:s,rawEmitter:i}=n,o=ll.get(e),d=o&&o.options;return d&&(d.persistentr.interval)&&(Ct.unwatchFile(e),o=void 0),o?(In(o,kr,s),In(o,Tn,i)):(o={listeners:s,rawEmitters:i,options:r,watcher:Ct.watchFile(e,r,(u,p)=>{ul(o.rawEmitters,g=>{g(hs,e,{curr:u,prev:p});});let m=u.mtimeMs;(u.size!==p.size||m>p.mtimeMs||m===0)&&ul(o.listeners,g=>g(t,u));})},ll.set(e,o)),()=>{Pn(o,kr,s),Pn(o,Tn,i),Ly(o.listeners)&&(ll.delete(e),Ct.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o));}},cl=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r);}_watchWithNodeFs(e,r){let n=this.fsw.options,s=Ce.dirname(e),i=Ce.basename(e);this.fsw._getWatchedDir(s).add(i);let l=Ce.resolve(e),f={persistent:n.persistent};r||(r=KI);let d;return n.usePolling?(f.interval=n.enableBinaryInterval&&zI(i)?n.binaryInterval:n.interval,d=uP(e,l,f,{listener:r,rawEmitter:this.fsw._emitRaw})):d=lP(e,l,f,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),d}_handleFile(e,r,n){if(this.fsw.closed)return;let s=Ce.dirname(e),i=Ce.basename(e),o=this.fsw._getWatchedDir(s),l=r;if(o.has(i))return;let f=async(u,p)=>{if(this.fsw._throttle(rP,e,5)){if(!p||p.mtimeMs===0)try{let m=await ky(e);if(this.fsw.closed)return;let g=m.atimeMs,y=m.mtimeMs;(!g||g<=y||y!==l.mtimeMs)&&this.fsw._emit(hs,e,m),VI&&l.ino!==m.ino?(this.fsw._closeFile(u),l=m,this.fsw._addPathCloser(u,this._watchWithNodeFs(e,f))):l=m;}catch{this.fsw._remove(s,i);}else if(o.has(i)){let m=p.atimeMs,g=p.mtimeMs;(!m||m<=g||g!==l.mtimeMs)&&this.fsw._emit(hs,e,p),l=p;}}},d=this._watchWithNodeFs(e,f);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(cs,e,0))return;this.fsw._emit(cs,e,r);}return d}async _handleSymlink(e,r,n,s){if(this.fsw.closed)return;let i=e.fullPath,o=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let l;try{l=await al(n);}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(s)?this.fsw._symlinkPaths.get(i)!==l&&(this.fsw._symlinkPaths.set(i,l),this.fsw._emit(hs,n,e.stats)):(o.add(s),this.fsw._symlinkPaths.set(i,l),this.fsw._emit(cs,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(i))return !0;this.fsw._symlinkPaths.set(i,!0);}_handleRead(e,r,n,s,i,o,l){if(e=Ce.join(e,ZI),!n.hasGlob&&(l=this.fsw._throttle("readdir",e,1e3),!l))return;let f=this.fsw._getWatchedDir(n.path),d=new Set,u=this.fsw._readdirp(e,{fileFilter:p=>n.filterPath(p),directoryFilter:p=>n.filterDir(p),depth:0}).on(XI,async p=>{if(this.fsw.closed){u=void 0;return}let m=p.path,g=Ce.join(e,m);if(d.add(m),!(p.stats.isSymbolicLink()&&await this._handleSymlink(p,e,g,m))){if(this.fsw.closed){u=void 0;return}(m===s||!s&&!f.has(m))&&(this.fsw._incrReadyCount(),g=Ce.join(i,Ce.relative(i,g)),this._addToNodeFs(g,r,n,o+1));}}).on(Ny,this._boundHandleError);return new Promise(p=>u.once(QI,()=>{if(this.fsw.closed){u=void 0;return}let m=l?l.clear():!1;p(),f.getChildren().filter(g=>g!==e&&!d.has(g)&&(!n.hasGlob||n.filterPath({fullPath:Ce.resolve(e,g)}))).forEach(g=>{this.fsw._remove(e,g);}),u=void 0,m&&this._handleRead(e,!1,n,s,i,o,l);}))}async _handleDir(e,r,n,s,i,o,l){let f=this.fsw._getWatchedDir(Ce.dirname(e)),d=f.has(Ce.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!i&&!d&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(JI,e,r),f.add(Ce.basename(e)),this.fsw._getWatchedDir(e);let u,p,m=this.fsw.options.depth;if((m==null||s<=m)&&!this.fsw._symlinkPaths.has(l)){if(!i&&(await this._handleRead(e,n,o,i,e,s,u),this.fsw.closed))return;p=this._watchWithNodeFs(e,(g,y)=>{y&&y.mtimeMs===0||this._handleRead(g,!1,o,i,e,s,u);});}return p}async _addToNodeFs(e,r,n,s,i){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let l=this.fsw._getWatchHelpers(e,s);!l.hasGlob&&n&&(l.hasGlob=n.hasGlob,l.globFilter=n.globFilter,l.filterPath=f=>n.filterPath(f),l.filterDir=f=>n.filterDir(f));try{let f=await oP[l.statMethod](l.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(l.watchPath,f))return o(),!1;let d=this.fsw.options.followSymlinks&&!e.includes(tP)&&!e.includes(eP),u;if(f.isDirectory()){let p=Ce.resolve(e),m=d?await al(e):e;if(this.fsw.closed||(u=await this._handleDir(l.watchPath,f,r,s,i,l,m),this.fsw.closed))return;p!==m&&m!==void 0&&this.fsw._symlinkPaths.set(p,m);}else if(f.isSymbolicLink()){let p=d?await al(e):e;if(this.fsw.closed)return;let m=Ce.dirname(l.watchPath);if(this.fsw._getWatchedDir(m).add(l.watchPath),this.fsw._emit(cs,l.watchPath,f),u=await this._handleDir(m,f,r,s,e,l,p),this.fsw.closed)return;p!==void 0&&this.fsw._symlinkPaths.set(Ce.resolve(e),p);}else u=this._handleFile(l.watchPath,f,r);return o(),this.fsw._addPathCloser(e,u),!1}catch(f){if(this.fsw._handleError(f))return o(),e}}};$y.exports=cl;});var zy=x((dD,yl)=>{var gl=K("fs"),Re=K("path"),{promisify:_l}=K("util"),Lr;try{Lr=K("fsevents");}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t);}if(Lr){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);e===8&&r<16&&(Lr=void 0);}}var{EV_ADD:fl,EV_CHANGE:cP,EV_ADD_DIR:qy,EV_UNLINK:ms,EV_ERROR:fP,STR_DATA:hP,STR_END:dP,FSEVENT_CREATED:pP,FSEVENT_MODIFIED:mP,FSEVENT_DELETED:gP,FSEVENT_MOVED:_P,FSEVENT_UNKNOWN:yP,FSEVENT_TYPE_FILE:wP,FSEVENT_TYPE_DIRECTORY:Fn,FSEVENT_TYPE_SYMLINK:Wy,ROOT_GLOBSTAR:By,DIR_SUFFIX:bP,DOT_SLASH:Uy,FUNCTION_TYPE:hl,EMPTY_FN:SP,IDENTITY_FN:vP}=us(),EP=t=>isNaN(t)?{}:{depth:t},pl=_l(gl.stat),AP=_l(gl.lstat),Hy=_l(gl.realpath),xP={stat:pl,lstat:AP},ir=new Map,CP=10,RP=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),TP=(t,e)=>({stop:Lr.watch(t,e)});function IP(t,e,r,n){let s=Re.extname(e)?Re.dirname(e):e,i=Re.dirname(s),o=ir.get(s);PP(i)&&(s=i);let l=Re.resolve(t),f=l!==e,d=(p,m,g)=>{f&&(p=p.replace(e,l)),(p===l||!p.indexOf(l+Re.sep))&&r(p,m,g);},u=!1;for(let p of ir.keys())if(e.indexOf(Re.resolve(p)+Re.sep)===0){s=p,o=ir.get(s),u=!0;break}return o||u?o.listeners.add(d):(o={listeners:new Set([d]),rawEmitter:n,watcher:TP(s,(p,m)=>{if(!o.listeners.size)return;let g=Lr.getInfo(p,m);o.listeners.forEach(y=>{y(p,m,g);}),o.rawEmitter(g.event,p,g);})},ir.set(s,o)),()=>{let p=o.listeners;if(p.delete(d),!p.size&&(ir.delete(s),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o);})}}var PP=t=>{let e=0;for(let r of ir.keys())if(r.indexOf(t)===0&&(e++,e>=CP))return !0;return !1},OP=()=>Lr&&ir.size<128,dl=(t,e)=>{let r=0;for(;!t.indexOf(e)&&(t=Re.dirname(t))!==e;)r++;return r},jy=(t,e)=>t.type===Fn&&e.isDirectory()||t.type===Wy&&e.isSymbolicLink()||t.type===wP&&e.isFile(),ml=class{constructor(e){this.fsw=e;}checkIgnored(e,r){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,r))return n.add(e),r&&r.isDirectory()&&n.add(e+By),!0;n.delete(e),n.delete(e+By);}addOrChange(e,r,n,s,i,o,l,f){let d=i.has(o)?cP:fl;this.handleEvent(d,e,r,n,s,i,o,l,f);}async checkExists(e,r,n,s,i,o,l,f){try{let d=await pl(e);if(this.fsw.closed)return;jy(l,d)?this.addOrChange(e,r,n,s,i,o,l,f):this.handleEvent(ms,e,r,n,s,i,o,l,f);}catch(d){d.code==="EACCES"?this.addOrChange(e,r,n,s,i,o,l,f):this.handleEvent(ms,e,r,n,s,i,o,l,f);}}handleEvent(e,r,n,s,i,o,l,f,d){if(!(this.fsw.closed||this.checkIgnored(r)))if(e===ms){let u=f.type===Fn;(u||o.has(l))&&this.fsw._remove(i,l,u);}else {if(e===fl){if(f.type===Fn&&this.fsw._getWatchedDir(r),f.type===Wy&&d.followSymlinks){let p=d.depth===void 0?void 0:dl(n,s)+1;return this._addToFsEvents(r,!1,!0,p)}this.fsw._getWatchedDir(i).add(l);}let u=f.type===Fn?e+bP:e;this.fsw._emit(u,r),u===qy&&this._addToFsEvents(r,!1,!0);}}_watchWithFsEvents(e,r,n,s){if(this.fsw.closed||this.fsw._isIgnored(e))return;let i=this.fsw.options,l=IP(e,r,async(f,d,u)=>{if(this.fsw.closed||i.depth!==void 0&&dl(f,r)>i.depth)return;let p=n(Re.join(e,Re.relative(e,f)));if(s&&!s(p))return;let m=Re.dirname(p),g=Re.basename(p),y=this.fsw._getWatchedDir(u.type===Fn?p:m);if(RP.has(d)||u.event===yP)if(typeof i.ignored===hl){let S;try{S=await pl(p);}catch{}if(this.fsw.closed||this.checkIgnored(p,S))return;jy(u,S)?this.addOrChange(p,f,r,m,y,g,u,i):this.handleEvent(ms,p,f,r,m,y,g,u,i);}else this.checkExists(p,f,r,m,y,g,u,i);else switch(u.event){case pP:case mP:return this.addOrChange(p,f,r,m,y,g,u,i);case gP:case _P:return this.checkExists(p,f,r,m,y,g,u,i)}},this.fsw._emitRaw);return this.fsw._emitReady(),l}async _handleFsEventsSymlink(e,r,n,s){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(r))){this.fsw._symlinkPaths.set(r,!0),this.fsw._incrReadyCount();try{let i=await Hy(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(i))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(i||e,o=>{let l=e;return i&&i!==Uy?l=o.replace(i,e):o!==Uy&&(l=Re.join(e,o)),n(l)},!1,s);}catch(i){if(this.fsw._handleError(i))return this.fsw._emitReady()}}}emitAdd(e,r,n,s,i){let o=n(e),l=r.isDirectory(),f=this.fsw._getWatchedDir(Re.dirname(o)),d=Re.basename(o);l&&this.fsw._getWatchedDir(o),!f.has(d)&&(f.add(d),(!s.ignoreInitial||i===!0)&&this.fsw._emit(l?qy:fl,o,r));}initWatch(e,r,n,s){if(this.fsw.closed)return;let i=this._watchWithFsEvents(n.watchPath,Re.resolve(e||n.watchPath),s,n.globFilter);this.fsw._addPathCloser(r,i);}async _addToFsEvents(e,r,n,s){if(this.fsw.closed)return;let i=this.fsw.options,o=typeof r===hl?r:vP,l=this.fsw._getWatchHelpers(e);try{let f=await xP[l.statMethod](l.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(l.watchPath,f))throw null;if(f.isDirectory()){if(l.globFilter||this.emitAdd(o(e),f,o,i,n),s&&s>i.depth)return;this.fsw._readdirp(l.watchPath,{fileFilter:d=>l.filterPath(d),directoryFilter:d=>l.filterDir(d),...EP(i.depth-(s||0))}).on(hP,d=>{if(this.fsw.closed||d.stats.isDirectory()&&!l.filterPath(d))return;let u=Re.join(l.watchPath,d.path),{fullPath:p}=d;if(l.followSymlinks&&d.stats.isSymbolicLink()){let m=i.depth===void 0?void 0:dl(u,Re.resolve(l.watchPath))+1;this._handleFsEventsSymlink(u,p,o,m);}else this.emitAdd(u,d.stats,o,i,n);}).on(fP,SP).on(dP,()=>{this.fsw._emitReady();});}else this.emitAdd(l.watchPath,f,o,i,n),this.fsw._emitReady();}catch(f){(!f||this.fsw._handleError(f))&&(this.fsw._emitReady(),this.fsw._emitReady());}if(i.persistent&&n!==!0)if(typeof r===hl)this.initWatch(void 0,e,l,o);else {let f;try{f=await Hy(l.watchPath);}catch{}this.initWatch(f,e,l,o);}}};yl.exports=ml;yl.exports.canUse=OP;});var Nl=x(Ml=>{var{EventEmitter:FP}=K("events"),Ol=K("fs"),fe=K("path"),{promisify:Xy}=K("util"),MP=O_(),Al=D_().default,NP=W_(),wl=Xa(),kP=Ry(),LP=Ya(),$P=Dy(),Gy=zy(),{EV_ALL:bl,EV_READY:DP,EV_ADD:gs,EV_CHANGE:Mn,EV_UNLINK:Vy,EV_ADD_DIR:qP,EV_UNLINK_DIR:BP,EV_RAW:UP,EV_ERROR:Sl,STR_CLOSE:HP,STR_END:jP,BACK_SLASH_RE:WP,DOUBLE_SLASH_RE:Ky,SLASH_OR_BACK_SLASH_RE:zP,DOT_RE:GP,REPLACER_RE:VP,SLASH:vl,SLASH_SLASH:KP,BRACE_START:ZP,BANG:xl,ONE_DOT:Qy,TWO_DOTS:YP,GLOBSTAR:JP,SLASH_GLOBSTAR:El,ANYMATCH_OPTS:Cl,STRING_TYPE:Fl,FUNCTION_TYPE:XP,EMPTY_STR:Rl,EMPTY_FN:QP,isWindows:eO,isMacos:tO,isIBMi:rO}=us(),nO=Xy(Ol.stat),iO=Xy(Ol.readdir),Tl=(t=[])=>Array.isArray(t)?t:[t],ew=(t,e=[])=>(t.forEach(r=>{Array.isArray(r)?ew(r,e):e.push(r);}),e),Zy=t=>{let e=ew(Tl(t));if(!e.every(r=>typeof r===Fl))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(tw)},Yy=t=>{let e=t.replace(WP,vl),r=!1;for(e.startsWith(KP)&&(r=!0);e.match(Ky);)e=e.replace(Ky,vl);return r&&(e=vl+e),e},tw=t=>Yy(fe.normalize(Yy(t))),Jy=(t=Rl)=>e=>typeof e!==Fl?e:tw(fe.isAbsolute(e)?e:fe.join(t,e)),sO=(t,e)=>fe.isAbsolute(t)?t:t.startsWith(xl)?xl+fe.join(e,t.slice(1)):fe.join(e,t),ut=(t,e)=>t[e]===void 0,Il=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set;}add(e){let{items:r}=this;r&&e!==Qy&&e!==YP&&r.add(e);}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await iO(n);}catch{this._removeWatcher&&this._removeWatcher(fe.dirname(n),fe.basename(n));}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;if(e)return [...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this);}},oO="stat",aO="lstat",Pl=class{constructor(e,r,n,s){this.fsw=s,this.path=e=e.replace(VP,Rl),this.watchPath=r,this.fullWatchPath=fe.resolve(r),this.hasGlob=r!==e,e===Rl&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?Al(e,void 0,Cl):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(i=>{i.length>1&&i.pop();}),this.followSymlinks=n,this.statMethod=n?oO:aO;}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return fe.join(this.watchPath,fe.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return (this.hasGlob&&typeof this.globFilter===XP?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(e){if(!this.hasGlob)return [];let r=[];return (e.includes(ZP)?kP.expand(e):[e]).forEach(s=>{r.push(fe.relative(this.watchPath,s).split(zP));}),r}filterDir(e){if(this.hasGlob){let r=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(s=>s.every((i,o)=>(i===JP&&(n=!0),n||!r[0][o]||Al(i,r[0][o],Cl))));}return !this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},_s=class extends FP{constructor(e){super();let r={};e&&Object.assign(r,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,ut(r,"persistent")&&(r.persistent=!0),ut(r,"ignoreInitial")&&(r.ignoreInitial=!1),ut(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),ut(r,"interval")&&(r.interval=100),ut(r,"binaryInterval")&&(r.binaryInterval=300),ut(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,ut(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),Gy.canUse()||(r.useFsEvents=!1),ut(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=tO),rO&&(r.usePolling=!0);let s=process.env.CHOKIDAR_USEPOLLING;if(s!==void 0){let f=s.toLowerCase();f==="false"||f==="0"?r.usePolling=!1:f==="true"||f==="1"?r.usePolling=!0:r.usePolling=!!f;}let i=process.env.CHOKIDAR_INTERVAL;i&&(r.interval=Number.parseInt(i,10)),ut(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),ut(r,"followSymlinks")&&(r.followSymlinks=!0),ut(r,"awaitWriteFinish")&&(r.awaitWriteFinish=!1),r.awaitWriteFinish===!0&&(r.awaitWriteFinish={});let o=r.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),r.ignored&&(r.ignored=Tl(r.ignored));let l=0;this._emitReady=()=>{l++,l>=this._readyCount&&(this._emitReady=QP,this._readyEmitted=!0,process.nextTick(()=>this.emit(DP)));},this._emitRaw=(...f)=>this.emit(UP,...f),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new Gy(this):this._nodeFsHandler=new $P(this),Object.freeze(r);}add(e,r,n){let{cwd:s,disableGlobbing:i}=this.options;this.closed=!1;let o=Zy(e);return s&&(o=o.map(l=>{let f=sO(l,s);return i||!wl(l)?f:LP(f)})),o=o.filter(l=>l.startsWith(xl)?(this._ignoredPaths.add(l.slice(1)),!1):(this._ignoredPaths.delete(l),this._ignoredPaths.delete(l+El),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount*=2),o.forEach(l=>this._fsEventsHandler._addToFsEvents(l))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async l=>{let f=await this._nodeFsHandler._addToNodeFs(l,!n,0,0,r);return f&&this._emitReady(),f})).then(l=>{this.closed||l.filter(f=>f).forEach(f=>{this.add(fe.dirname(f),fe.basename(r||f));});})),this}unwatch(e){if(this.closed)return this;let r=Zy(e),{cwd:n}=this.options;return r.forEach(s=>{!fe.isAbsolute(s)&&!this._closers.has(s)&&(n&&(s=fe.join(n,s)),s=fe.resolve(s)),this._closePath(s),this._ignoredPaths.add(s),this._watched.has(s)&&this._ignoredPaths.add(s+El),this._userIgnored=void 0;}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let s=n();s instanceof Promise&&e.push(s);})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(r=>{this[`_${r}`].clear();}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let s=this.options.cwd?fe.relative(this.options.cwd,n):n;e[s||Qy]=r.getChildren().sort();}),e}emitWithAll(e,r){this.emit(...r),e!==Sl&&this.emit(bl,...r);}async _emit(e,r,n,s,i){if(this.closed)return;let o=this.options;eO&&(r=fe.normalize(r)),o.cwd&&(r=fe.relative(o.cwd,r));let l=[e,r];i!==void 0?l.push(n,s,i):s!==void 0?l.push(n,s):n!==void 0&&l.push(n);let f=o.awaitWriteFinish,d;if(f&&(d=this._pendingWrites.get(r)))return d.lastChange=new Date,this;if(o.atomic){if(e===Vy)return this._pendingUnlinks.set(r,l),setTimeout(()=>{this._pendingUnlinks.forEach((u,p)=>{this.emit(...u),this.emit(bl,...u),this._pendingUnlinks.delete(p);});},typeof o.atomic=="number"?o.atomic:100),this;e===gs&&this._pendingUnlinks.has(r)&&(e=l[0]=Mn,this._pendingUnlinks.delete(r));}if(f&&(e===gs||e===Mn)&&this._readyEmitted){let u=(p,m)=>{p?(e=l[0]=Sl,l[1]=p,this.emitWithAll(e,l)):m&&(l.length>2?l[2]=m:l.push(m),this.emitWithAll(e,l));};return this._awaitWriteFinish(r,f.stabilityThreshold,e,u),this}if(e===Mn&&!this._throttle(Mn,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===gs||e===qP||e===Mn)){let u=o.cwd?fe.join(o.cwd,r):r,p;try{p=await nO(u);}catch{}if(!p||this.closed)return;l.push(p);}return this.emitWithAll(e,l),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(Sl,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let s=this._throttled.get(e),i=s.get(r);if(i)return i.count++,!1;let o,l=()=>{let d=s.get(r),u=d?d.count:0;return s.delete(r),clearTimeout(o),d&&clearTimeout(d.timeoutObject),u};o=setTimeout(l,n);let f={timeoutObject:o,clear:l,count:0};return s.set(r,f),f}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,s){let i,o=e;this.options.cwd&&!fe.isAbsolute(e)&&(o=fe.join(this.options.cwd,e));let l=new Date,f=d=>{Ol.stat(o,(u,p)=>{if(u||!this._pendingWrites.has(e)){u&&u.code!=="ENOENT"&&s(u);return}let m=Number(new Date);d&&p.size!==d.size&&(this._pendingWrites.get(e).lastChange=m);let g=this._pendingWrites.get(e);m-g.lastChange>=r?(this._pendingWrites.delete(e),s(void 0,p)):i=setTimeout(f,this.options.awaitWriteFinish.pollInterval,p);});};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:l,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(i),n)}),i=setTimeout(f,this.options.awaitWriteFinish.pollInterval));}_getGlobIgnored(){return [...this._ignoredPaths.values()]}_isIgnored(e,r){if(this.options.atomic&&GP.test(e))return !0;if(!this._userIgnored){let{cwd:n}=this.options,s=this.options.ignored,i=s&&s.map(Jy(n)),o=Tl(i).filter(f=>typeof f===Fl&&!wl(f)).map(f=>f+El),l=this._getGlobIgnored().map(Jy(n)).concat(i,o);this._userIgnored=Al(l,void 0,Cl);}return this._userIgnored([e,r])}_isntIgnored(e,r){return !this._isIgnored(e,r)}_getWatchHelpers(e,r){let n=r||this.options.disableGlobbing||!wl(e)?e:NP(e),s=this.options.followSymlinks;return new Pl(e,n,s,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let r=fe.resolve(e);return this._watched.has(r)||this._watched.set(r,new Il(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return !0;let n=(e&&Number.parseInt(e.mode,10))&511;return !!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,r,n){let s=fe.join(e,r),i=fe.resolve(s);if(n=n??(this._watched.has(s)||this._watched.has(i)),!this._throttle("remove",s,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(s).getChildren().forEach(m=>this._remove(s,m));let f=this._getWatchedDir(e),d=f.has(r);f.remove(r),this._symlinkPaths.has(i)&&this._symlinkPaths.delete(i);let u=s;if(this.options.cwd&&(u=fe.relative(this.options.cwd,s)),this.options.awaitWriteFinish&&this._pendingWrites.has(u)&&this._pendingWrites.get(u).cancelWait()===gs)return;this._watched.delete(s),this._watched.delete(i);let p=n?BP:Vy;d&&!this._isIgnored(s)&&this._emit(p,s),this.options.useFsEvents||this._closePath(s);}_closePath(e){this._closeFile(e);let r=fe.dirname(e);this._getWatchedDir(r).remove(fe.basename(e));}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e));}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r);}_readdirp(e,r){if(this.closed)return;let n={type:bl,alwaysStat:!0,lstat:!0,...r},s=MP(e,n);return this._streams.add(s),s.once(HP,()=>{s=void 0;}),s.once(jP,()=>{s&&(this._streams.delete(s),s=void 0);}),s}};Ml.FSWatcher=_s;var lO=(t,e)=>{let r=new _s(e);return r.add(t),r};Ml.watch=lO;});var ql=x((SD,aw)=>{var Nn=t=>t&&typeof t.message=="string",Dl=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return Nn(r)?r:void 0}else return Nn(e)?e:void 0},sw=(t,e)=>{if(!Nn(t))return "";let r=t.stack||"";if(e.has(t))return r+` -causes have become circular...`;let n=Dl(t);return n?(e.add(t),r+` -caused by: `+sw(n,e)):r},hO=t=>sw(t,new Set),ow=(t,e,r)=>{if(!Nn(t))return "";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let s=Dl(t);if(s){e.add(t);let i=typeof t.cause=="function";return n+(i?"":": ")+ow(s,e,i)}else return n},dO=t=>ow(t,new Set);aw.exports={isErrorLike:Nn,getErrorCause:Dl,stackWithCauses:hO,messageWithCauses:dO};});var Bl=x((vD,uw)=>{var pO=Symbol("circular-ref-tag"),ys=Symbol("pino-raw-err-ref"),lw=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[ys]},set:function(t){this[ys]=t;}}});Object.defineProperty(lw,ys,{writable:!0,value:{}});uw.exports={pinoErrProto:lw,pinoErrorSymbols:{seen:pO,rawSymbol:ys}};});var hw=x((ED,fw)=>{fw.exports=Hl;var{messageWithCauses:mO,stackWithCauses:gO,isErrorLike:cw}=ql(),{pinoErrProto:_O,pinoErrorSymbols:yO}=Bl(),{seen:Ul}=yO,{toString:wO}=Object.prototype;function Hl(t){if(!cw(t))return t;t[Ul]=void 0;let e=Object.create(_O);e.type=wO.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=mO(t),e.stack=gO(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Hl(r)));for(let r in t)if(e[r]===void 0){let n=t[r];cw(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Ul)&&(e[r]=Hl(n)):e[r]=n;}return delete t[Ul],e.raw=t,e}});var pw=x((AD,dw)=>{dw.exports=bs;var{isErrorLike:jl}=ql(),{pinoErrProto:bO,pinoErrorSymbols:SO}=Bl(),{seen:ws}=SO,{toString:vO}=Object.prototype;function bs(t){if(!jl(t))return t;t[ws]=void 0;let e=Object.create(bO);e.type=vO.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>bs(r))),jl(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,ws)&&(e.cause=bs(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];jl(n)?Object.prototype.hasOwnProperty.call(n,ws)||(e[r]=bs(n)):e[r]=n;}return delete t[ws],e.raw=t,e}});var yw=x((xD,_w)=>{_w.exports={mapHttpRequest:EO,reqSerializer:gw};var Wl=Symbol("pino-raw-req-ref"),mw=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[Wl]},set:function(t){this[Wl]=t;}}});Object.defineProperty(mw,Wl,{writable:!0,value:{}});function gw(t){let e=t.info||t.socket,r=Object.create(mw);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else {let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0;}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function EO(t){return {req:gw(t)}}});var vw=x((CD,Sw)=>{Sw.exports={mapHttpResponse:AO,resSerializer:bw};var zl=Symbol("pino-raw-res-ref"),ww=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[zl]},set:function(t){this[zl]=t;}}});Object.defineProperty(ww,zl,{writable:!0,value:{}});function bw(t){let e=Object.create(ww);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function AO(t){return {res:bw(t)}}});var Vl=x((RD,Ew)=>{var Gl=hw(),xO=pw(),Ss=yw(),vs=vw();Ew.exports={err:Gl,errWithCause:xO,mapHttpRequest:Ss.mapHttpRequest,mapHttpResponse:vs.mapHttpResponse,req:Ss.reqSerializer,res:vs.resSerializer,wrapErrorSerializer:function(e){return e===Gl?e:function(n){return e(Gl(n))}},wrapRequestSerializer:function(e){return e===Ss.reqSerializer?e:function(n){return e(Ss.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===vs.resSerializer?e:function(n){return e(vs.resSerializer(n))}}};});var Kl=x((TD,Aw)=>{function CO(t,e){return e}Aw.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=CO;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),s=[];for(let i of n)i&&s.push(i.getFileName());return s};});var Cw=x((ID,xw)=>{xw.exports=RO;function RO(t={}){let{ERR_PATHS_MUST_BE_STRINGS:e=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=n=>`fast-redact \u2013 Invalid path (${n})`}=t;return function({paths:s}){s.forEach(i=>{if(typeof i!="string")throw Error(e());try{if(/〇/.test(i))throw Error();let o=(i[0]==="["?"":".")+i.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(o)||/\/\*/.test(o))throw Error();Function(` + see https://github.com/jprichardson/node-fs-extra/issues/269`,"Warning","fs-extra-WARN0002");let{srcStat:n,destStat:i}=Vs.checkPathsSync(t,e,"copy",r);if(Vs.checkParentPathsSync(t,n,e,"copy"),r.filter&&!r.filter(t,e))return;let s=zs.dirname(e);return Wt.existsSync(s)||yN(s),qw(i,t,e,r)}function qw(t,e,r,n){let s=(n.dereference?Wt.statSync:Wt.lstatSync)(e);if(s.isDirectory())return TN(s,t,e,r,n);if(s.isFile()||s.isCharacterDevice()||s.isBlockDevice())return wN(s,t,e,r,n);if(s.isSymbolicLink())return DN(t,e,r,n);throw s.isSocket()?new Error(`Cannot copy a socket file: ${e}`):s.isFIFO()?new Error(`Cannot copy a FIFO pipe: ${e}`):new Error(`Unknown file: ${e}`)}function wN(t,e,r,n,i){return e?SN(t,r,n,i):Lw(t,r,n,i)}function SN(t,e,r,n){if(n.overwrite)return Wt.unlinkSync(r),Lw(t,e,r,n);if(n.errorOnExist)throw new Error(`'${r}' already exists`)}function Lw(t,e,r,n){return Wt.copyFileSync(e,r),n.preserveTimestamps&&EN(t.mode,e,r),Wf(r,t.mode)}function EN(t,e,r){return RN(t)&&CN(r,t),xN(e,r)}function RN(t){return (t&128)===0}function CN(t,e){return Wf(t,e|128)}function Wf(t,e){return Wt.chmodSync(t,e)}function xN(t,e){let r=Wt.statSync(t);return bN(e,r.atime,r.mtime)}function TN(t,e,r,n,i){return e?$w(r,n,i):AN(t.mode,r,n,i)}function AN(t,e,r,n){return Wt.mkdirSync(r),$w(e,r,n),Wf(r,t)}function $w(t,e,r){Wt.readdirSync(t).forEach(n=>PN(n,t,e,r));}function PN(t,e,r,n){let i=zs.join(e,t),s=zs.join(r,t);if(n.filter&&!n.filter(i,s))return;let{destStat:o}=Vs.checkPathsSync(i,s,"copy",n);return qw(o,i,s,n)}function DN(t,e,r,n){let i=Wt.readlinkSync(e);if(n.dereference&&(i=zs.resolve(process.cwd(),i)),t){let s;try{s=Wt.readlinkSync(r);}catch(o){if(o.code==="EINVAL"||o.code==="UNKNOWN")return Wt.symlinkSync(i,r);throw o}if(n.dereference&&(s=zs.resolve(process.cwd(),s)),Vs.isSrcSubdir(i,s))throw new Error(`Cannot copy '${i}' to a subdirectory of itself, '${s}'.`);if(Vs.isSrcSubdir(s,i))throw new Error(`Cannot overwrite '${s}' with '${i}'.`);return ON(i,r)}else return Wt.symlinkSync(i,r)}function ON(t,e){return Wt.unlinkSync(e),Wt.symlinkSync(t,e)}jw.exports=vN;});var $a=A((R9,Ww)=>{var IN=_t().fromPromise;Ww.exports={copy:IN(Nw()),copySync:Hw()};});var Gs=A((C9,Uw)=>{var Bw=Fi(),kN=_t().fromCallback;function MN(t,e){Bw.rm(t,{recursive:!0,force:!0},e);}function FN(t){Bw.rmSync(t,{recursive:!0,force:!0});}Uw.exports={remove:kN(MN),removeSync:FN};});var Xw=A((x9,Yw)=>{var NN=_t().fromPromise,Gw=Ht(),Kw=oe("path"),Zw=Dr(),Jw=Gs(),zw=NN(async function(e){let r;try{r=await Gw.readdir(e);}catch{return Zw.mkdirs(e)}return Promise.all(r.map(n=>Jw.remove(Kw.join(e,n))))});function Vw(t){let e;try{e=Gw.readdirSync(t);}catch{return Zw.mkdirsSync(t)}e.forEach(r=>{r=Kw.join(t,r),Jw.removeSync(r);});}Yw.exports={emptyDirSync:Vw,emptydirSync:Vw,emptyDir:zw,emptydir:zw};});var rS=A((T9,tS)=>{var qN=_t().fromPromise,Qw=oe("path"),rn=Ht(),eS=Dr();async function LN(t){let e;try{e=await rn.stat(t);}catch{}if(e&&e.isFile())return;let r=Qw.dirname(t),n=null;try{n=await rn.stat(r);}catch(i){if(i.code==="ENOENT"){await eS.mkdirs(r),await rn.writeFile(t,"");return}else throw i}n.isDirectory()?await rn.writeFile(t,""):await rn.readdir(r);}function $N(t){let e;try{e=rn.statSync(t);}catch{}if(e&&e.isFile())return;let r=Qw.dirname(t);try{rn.statSync(r).isDirectory()||rn.readdirSync(r);}catch(n){if(n&&n.code==="ENOENT")eS.mkdirsSync(r);else throw n}rn.writeFileSync(t,"");}tS.exports={createFile:qN(LN),createFileSync:$N};});var aS=A((A9,oS)=>{var jN=_t().fromPromise,nS=oe("path"),Rn=Ht(),iS=Dr(),{pathExists:HN}=En(),{areIdentical:sS}=Xn();async function WN(t,e){let r;try{r=await Rn.lstat(e);}catch{}let n;try{n=await Rn.lstat(t);}catch(o){throw o.message=o.message.replace("lstat","ensureLink"),o}if(r&&sS(n,r))return;let i=nS.dirname(e);await HN(i)||await iS.mkdirs(i),await Rn.link(t,e);}function BN(t,e){let r;try{r=Rn.lstatSync(e);}catch{}try{let s=Rn.lstatSync(t);if(r&&sS(s,r))return}catch(s){throw s.message=s.message.replace("lstat","ensureLink"),s}let n=nS.dirname(e);return Rn.existsSync(n)||iS.mkdirsSync(n),Rn.linkSync(t,e)}oS.exports={createLink:jN(WN),createLinkSync:BN};});var cS=A((P9,uS)=>{var Cn=oe("path"),Ks=Ht(),{pathExists:UN}=En(),zN=_t().fromPromise;async function VN(t,e){if(Cn.isAbsolute(t)){try{await Ks.lstat(t);}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return {toCwd:t,toDst:t}}let r=Cn.dirname(e),n=Cn.join(r,t);if(await UN(n))return {toCwd:n,toDst:t};try{await Ks.lstat(t);}catch(s){throw s.message=s.message.replace("lstat","ensureSymlink"),s}return {toCwd:t,toDst:Cn.relative(r,t)}}function GN(t,e){if(Cn.isAbsolute(t)){if(!Ks.existsSync(t))throw new Error("absolute srcpath does not exist");return {toCwd:t,toDst:t}}let r=Cn.dirname(e),n=Cn.join(r,t);if(Ks.existsSync(n))return {toCwd:n,toDst:t};if(!Ks.existsSync(t))throw new Error("relative srcpath does not exist");return {toCwd:t,toDst:Cn.relative(r,t)}}uS.exports={symlinkPaths:zN(VN),symlinkPathsSync:GN};});var dS=A((D9,fS)=>{var lS=Ht(),KN=_t().fromPromise;async function ZN(t,e){if(e)return e;let r;try{r=await lS.lstat(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}function JN(t,e){if(e)return e;let r;try{r=lS.lstatSync(t);}catch{return "file"}return r&&r.isDirectory()?"dir":"file"}fS.exports={symlinkType:KN(ZN),symlinkTypeSync:JN};});var gS=A((O9,mS)=>{var YN=_t().fromPromise,hS=oe("path"),Wr=Ht(),{mkdirs:XN,mkdirsSync:QN}=Dr(),{symlinkPaths:eq,symlinkPathsSync:tq}=cS(),{symlinkType:rq,symlinkTypeSync:nq}=dS(),{pathExists:iq}=En(),{areIdentical:pS}=Xn();async function sq(t,e,r){let n;try{n=await Wr.lstat(e);}catch{}if(n&&n.isSymbolicLink()){let[a,l]=await Promise.all([Wr.stat(t),Wr.stat(e)]);if(pS(a,l))return}let i=await eq(t,e);t=i.toDst;let s=await rq(i.toCwd,r),o=hS.dirname(e);return await iq(o)||await XN(o),Wr.symlink(t,e,s)}function oq(t,e,r){let n;try{n=Wr.lstatSync(e);}catch{}if(n&&n.isSymbolicLink()){let a=Wr.statSync(t),l=Wr.statSync(e);if(pS(a,l))return}let i=tq(t,e);t=i.toDst,r=nq(i.toCwd,r);let s=hS.dirname(e);return Wr.existsSync(s)||QN(s),Wr.symlinkSync(t,e,r)}mS.exports={createSymlink:YN(sq),createSymlinkSync:oq};});var RS=A((I9,ES)=>{var{createFile:_S,createFileSync:yS}=rS(),{createLink:bS,createLinkSync:vS}=aS(),{createSymlink:wS,createSymlinkSync:SS}=gS();ES.exports={createFile:_S,createFileSync:yS,ensureFile:_S,ensureFileSync:yS,createLink:bS,createLinkSync:vS,ensureLink:bS,ensureLinkSync:vS,createSymlink:wS,createSymlinkSync:SS,ensureSymlink:wS,ensureSymlinkSync:SS};});var ja=A((k9,CS)=>{function aq(t,{EOL:e=` +`,finalEOL:r=!0,replacer:n=null,spaces:i}={}){let s=r?e:"";return JSON.stringify(t,n,i).replace(/\n/g,e)+s}function uq(t){return Buffer.isBuffer(t)&&(t=t.toString("utf8")),t.replace(/^\uFEFF/,"")}CS.exports={stringify:aq,stripBom:uq};});var PS=A((M9,AS)=>{var Li;try{Li=Fi();}catch{Li=oe("fs");}var Ha=_t(),{stringify:xS,stripBom:TS}=ja();async function cq(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Li,n="throws"in e?e.throws:!0,i=await Ha.fromCallback(r.readFile)(t,e);i=TS(i);let s;try{s=JSON.parse(i,e?e.reviver:null);}catch(o){if(n)throw o.message=`${t}: ${o.message}`,o;return null}return s}var lq=Ha.fromPromise(cq);function fq(t,e={}){typeof e=="string"&&(e={encoding:e});let r=e.fs||Li,n="throws"in e?e.throws:!0;try{let i=r.readFileSync(t,e);return i=TS(i),JSON.parse(i,e.reviver)}catch(i){if(n)throw i.message=`${t}: ${i.message}`,i;return null}}async function dq(t,e,r={}){let n=r.fs||Li,i=xS(e,r);await Ha.fromCallback(n.writeFile)(t,i,r);}var hq=Ha.fromPromise(dq);function pq(t,e,r={}){let n=r.fs||Li,i=xS(e,r);return n.writeFileSync(t,i,r)}var mq={readFile:lq,readFileSync:fq,writeFile:hq,writeFileSync:pq};AS.exports=mq;});var OS=A((F9,DS)=>{var Wa=PS();DS.exports={readJson:Wa.readFile,readJsonSync:Wa.readFileSync,writeJson:Wa.writeFile,writeJsonSync:Wa.writeFileSync};});var Ba=A((N9,MS)=>{var gq=_t().fromPromise,Bf=Ht(),IS=oe("path"),kS=Dr(),_q=En().pathExists;async function yq(t,e,r="utf-8"){let n=IS.dirname(t);return await _q(n)||await kS.mkdirs(n),Bf.writeFile(t,e,r)}function bq(t,...e){let r=IS.dirname(t);Bf.existsSync(r)||kS.mkdirsSync(r),Bf.writeFileSync(t,...e);}MS.exports={outputFile:gq(yq),outputFileSync:bq};});var qS=A((q9,NS)=>{var{stringify:vq}=ja(),{outputFile:wq}=Ba();async function Sq(t,e,r={}){let n=vq(e,r);await wq(t,n,r);}NS.exports=Sq;});var $S=A((L9,LS)=>{var{stringify:Eq}=ja(),{outputFileSync:Rq}=Ba();function Cq(t,e,r){let n=Eq(e,r);Rq(t,n,r);}LS.exports=Cq;});var HS=A(($9,jS)=>{var xq=_t().fromPromise,Bt=OS();Bt.outputJson=xq(qS());Bt.outputJsonSync=$S();Bt.outputJSON=Bt.outputJson;Bt.outputJSONSync=Bt.outputJsonSync;Bt.writeJSON=Bt.writeJson;Bt.writeJSONSync=Bt.writeJsonSync;Bt.readJSON=Bt.readJson;Bt.readJSONSync=Bt.readJsonSync;jS.exports=Bt;});var VS=A((j9,zS)=>{var Tq=Ht(),WS=oe("path"),{copy:Aq}=$a(),{remove:US}=Gs(),{mkdirp:Pq}=Dr(),{pathExists:Dq}=En(),BS=Xn();async function Oq(t,e,r={}){let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:s=!1}=await BS.checkPaths(t,e,"move",r);await BS.checkParentPaths(t,i,e,"move");let o=WS.dirname(e);return WS.parse(o).root!==o&&await Pq(o),Iq(t,e,n,s)}async function Iq(t,e,r,n){if(!n){if(r)await US(e);else if(await Dq(e))throw new Error("dest already exists.")}try{await Tq.rename(t,e);}catch(i){if(i.code!=="EXDEV")throw i;await kq(t,e,r);}}async function kq(t,e,r){return await Aq(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),US(t)}zS.exports=Oq;});var YS=A((H9,JS)=>{var KS=Fi(),zf=oe("path"),Mq=$a().copySync,ZS=Gs().removeSync,Fq=Dr().mkdirpSync,GS=Xn();function Nq(t,e,r){r=r||{};let n=r.overwrite||r.clobber||!1,{srcStat:i,isChangingCase:s=!1}=GS.checkPathsSync(t,e,"move",r);return GS.checkParentPathsSync(t,i,e,"move"),qq(e)||Fq(zf.dirname(e)),Lq(t,e,n,s)}function qq(t){let e=zf.dirname(t);return zf.parse(e).root===e}function Lq(t,e,r,n){if(n)return Uf(t,e,r);if(r)return ZS(e),Uf(t,e,r);if(KS.existsSync(e))throw new Error("dest already exists.");return Uf(t,e,r)}function Uf(t,e,r){try{KS.renameSync(t,e);}catch(n){if(n.code!=="EXDEV")throw n;return $q(t,e,r)}}function $q(t,e,r){return Mq(t,e,{overwrite:r,errorOnExist:!0,preserveTimestamps:!0}),ZS(t)}JS.exports=Nq;});var QS=A((W9,XS)=>{var jq=_t().fromPromise;XS.exports={move:jq(VS()),moveSync:YS()};});var Vf=A((B9,eE)=>{eE.exports={...Ht(),...$a(),...Xw(),...RS(),...HS(),...Dr(),...QS(),...Ba(),...En(),...Gs()};});var Zs=A((U9,sE)=>{var Hq=oe("path"),Br="\\\\/",tE=`[^${Br}]`,nn="\\.",Wq="\\+",Bq="\\?",Ua="\\/",Uq="(?=.)",rE="[^/]",Gf=`(?:${Ua}|$)`,nE=`(?:^|${Ua})`,Kf=`${nn}{1,2}${Gf}`,zq=`(?!${nn})`,Vq=`(?!${nE}${Kf})`,Gq=`(?!${nn}{0,1}${Gf})`,Kq=`(?!${Kf})`,Zq=`[^.${Ua}]`,Jq=`${rE}*?`,iE={DOT_LITERAL:nn,PLUS_LITERAL:Wq,QMARK_LITERAL:Bq,SLASH_LITERAL:Ua,ONE_CHAR:Uq,QMARK:rE,END_ANCHOR:Gf,DOTS_SLASH:Kf,NO_DOT:zq,NO_DOTS:Vq,NO_DOT_SLASH:Gq,NO_DOTS_SLASH:Kq,QMARK_NO_DOT:Zq,STAR:Jq,START_ANCHOR:nE},Yq={...iE,SLASH_LITERAL:`[${Br}]`,QMARK:tE,STAR:`${tE}*?`,DOTS_SLASH:`${nn}{1,2}(?:[${Br}]|$)`,NO_DOT:`(?!${nn})`,NO_DOTS:`(?!(?:^|[${Br}])${nn}{1,2}(?:[${Br}]|$))`,NO_DOT_SLASH:`(?!${nn}{0,1}(?:[${Br}]|$))`,NO_DOTS_SLASH:`(?!${nn}{1,2}(?:[${Br}]|$))`,QMARK_NO_DOT:`[^.${Br}]`,START_ANCHOR:`(?:^|[${Br}])`,END_ANCHOR:`(?:[${Br}]|$)`},Xq={alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};sE.exports={MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:Xq,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,SEP:Hq.sep,extglobChars(t){return {"!":{type:"negate",open:"(?:(?!(?:",close:`))${t.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(t){return t===!0?Yq:iE}};});var za=A(Gt=>{var Qq=oe("path"),eL=process.platform==="win32",{REGEX_BACKSLASH:tL,REGEX_REMOVE_BACKSLASH:rL,REGEX_SPECIAL_CHARS:nL,REGEX_SPECIAL_CHARS_GLOBAL:iL}=Zs();Gt.isObject=t=>t!==null&&typeof t=="object"&&!Array.isArray(t);Gt.hasRegexChars=t=>nL.test(t);Gt.isRegexChar=t=>t.length===1&&Gt.hasRegexChars(t);Gt.escapeRegex=t=>t.replace(iL,"\\$1");Gt.toPosixSlashes=t=>t.replace(tL,"/");Gt.removeBackslashes=t=>t.replace(rL,e=>e==="\\"?"":e);Gt.supportsLookbehinds=()=>{let t=process.version.slice(1).split(".").map(Number);return t.length===3&&t[0]>=9||t[0]===8&&t[1]>=10};Gt.isWindows=t=>t&&typeof t.windows=="boolean"?t.windows:eL===!0||Qq.sep==="\\";Gt.escapeLast=(t,e,r)=>{let n=t.lastIndexOf(e,r);return n===-1?t:t[n-1]==="\\"?Gt.escapeLast(t,e,n-1):`${t.slice(0,n)}\\${t.slice(n)}`};Gt.removePrefix=(t,e={})=>{let r=t;return r.startsWith("./")&&(r=r.slice(2),e.prefix="./"),r};Gt.wrapOutput=(t,e={},r={})=>{let n=r.contains?"":"^",i=r.contains?"":"$",s=`${n}(?:${t})${i}`;return e.negated===!0&&(s=`(?:^(?!${s}).*$)`),s};});var hE=A((V9,dE)=>{var oE=za(),{CHAR_ASTERISK:Zf,CHAR_AT:sL,CHAR_BACKWARD_SLASH:Js,CHAR_COMMA:oL,CHAR_DOT:Jf,CHAR_EXCLAMATION_MARK:Yf,CHAR_FORWARD_SLASH:fE,CHAR_LEFT_CURLY_BRACE:Xf,CHAR_LEFT_PARENTHESES:Qf,CHAR_LEFT_SQUARE_BRACKET:aL,CHAR_PLUS:uL,CHAR_QUESTION_MARK:aE,CHAR_RIGHT_CURLY_BRACE:cL,CHAR_RIGHT_PARENTHESES:uE,CHAR_RIGHT_SQUARE_BRACKET:lL}=Zs(),cE=t=>t===fE||t===Js,lE=t=>{t.isPrefix!==!0&&(t.depth=t.isGlobstar?1/0:1);},fL=(t,e)=>{let r=e||{},n=t.length-1,i=r.parts===!0||r.scanToEnd===!0,s=[],o=[],a=[],l=t,d=-1,c=0,p=0,m=!1,_=!1,w=!1,E=!1,P=!1,D=!1,g=!1,S=!1,I=!1,L=!1,Z=0,K,U,B={value:"",depth:0,isGlob:!1},Q=()=>d>=n,N=()=>l.charCodeAt(d+1),te=()=>(K=U,l.charCodeAt(++d));for(;d0&&(ye=l.slice(0,c),l=l.slice(c),p-=c),ae&&w===!0&&p>0?(ae=l.slice(0,p),q=l.slice(p)):w===!0?(ae="",q=l):ae=l,ae&&ae!==""&&ae!=="/"&&ae!==l&&cE(ae.charCodeAt(ae.length-1))&&(ae=ae.slice(0,-1)),r.unescape===!0&&(q&&(q=oE.removeBackslashes(q)),ae&&g===!0&&(ae=oE.removeBackslashes(ae)));let W={prefix:ye,input:t,start:c,base:ae,glob:q,isBrace:m,isBracket:_,isGlob:w,isExtglob:E,isGlobstar:P,negated:S,negatedExtglob:I};if(r.tokens===!0&&(W.maxDepth=0,cE(U)||o.push(B),W.tokens=o),r.parts===!0||r.tokens===!0){let me;for(let pe=0;pe{var Va=Zs(),or=za(),{MAX_LENGTH:Ga,POSIX_REGEX_SOURCE:dL,REGEX_NON_SPECIAL_CHARS:hL,REGEX_SPECIAL_CHARS_BACKREF:pL,REPLACEMENTS:pE}=Va,mL=(t,e)=>{if(typeof e.expandRange=="function")return e.expandRange(...t,e);t.sort();let r=`[${t.join("-")}]`;return r},$i=(t,e)=>`Missing ${t}: "${e}" - use "\\\\${e}" to match literal characters`,ed=(t,e)=>{if(typeof t!="string")throw new TypeError("Expected a string");t=pE[t]||t;let r={...e},n=typeof r.maxLength=="number"?Math.min(Ga,r.maxLength):Ga,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);let s={type:"bos",value:"",output:r.prepend||""},o=[s],a=r.capture?"":"?:",l=or.isWindows(e),d=Va.globChars(l),c=Va.extglobChars(d),{DOT_LITERAL:p,PLUS_LITERAL:m,SLASH_LITERAL:_,ONE_CHAR:w,DOTS_SLASH:E,NO_DOT:P,NO_DOT_SLASH:D,NO_DOTS_SLASH:g,QMARK:S,QMARK_NO_DOT:I,STAR:L,START_ANCHOR:Z}=d,K=ce=>`(${a}(?:(?!${Z}${ce.dot?E:p}).)*?)`,U=r.dot?"":P,B=r.dot?S:I,Q=r.bash===!0?K(r):L;r.capture&&(Q=`(${Q})`),typeof r.noext=="boolean"&&(r.noextglob=r.noext);let N={input:t,index:-1,start:0,dot:r.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:o};t=or.removePrefix(t,N),i=t.length;let te=[],ae=[],ye=[],q=s,W,me=()=>N.index===i-1,pe=N.peek=(ce=1)=>t[N.index+ce],we=N.advance=()=>t[++N.index]||"",Xe=()=>t.slice(N.index+1),Ke=(ce="",Me=0)=>{N.consumed+=ce,N.index+=Me;},Pt=ce=>{N.output+=ce.output!=null?ce.output:ce.value,Ke(ce.value);},Lr=()=>{let ce=1;for(;pe()==="!"&&(pe(2)!=="("||pe(3)==="?");)we(),N.start++,ce++;return ce%2===0?!1:(N.negated=!0,N.start++,!0)},Ut=ce=>{N[ce]++,ye.push(ce);},St=ce=>{N[ce]--,ye.pop();},Ce=ce=>{if(q.type==="globstar"){let Me=N.braces>0&&(ce.type==="comma"||ce.type==="brace"),ie=ce.extglob===!0||te.length&&(ce.type==="pipe"||ce.type==="paren");ce.type!=="slash"&&ce.type!=="paren"&&!Me&&!ie&&(N.output=N.output.slice(0,-q.output.length),q.type="star",q.value="*",q.output=Q,N.output+=q.output);}if(te.length&&ce.type!=="paren"&&(te[te.length-1].inner+=ce.value),(ce.value||ce.output)&&Pt(ce),q&&q.type==="text"&&ce.type==="text"){q.value+=ce.value,q.output=(q.output||"")+ce.value;return}ce.prev=q,o.push(ce),q=ce;},Cr=(ce,Me)=>{let ie={...c[Me],conditions:1,inner:""};ie.prev=q,ie.parens=N.parens,ie.output=N.output;let be=(r.capture?"(":"")+ie.open;Ut("parens"),Ce({type:ce,value:Me,output:N.output?"":w}),Ce({type:"paren",extglob:!0,value:we(),output:be}),te.push(ie);},fn=ce=>{let Me=ce.close+(r.capture?")":""),ie;if(ce.type==="negate"){let be=Q;if(ce.inner&&ce.inner.length>1&&ce.inner.includes("/")&&(be=K(r)),(be!==Q||me()||/^\)+$/.test(Xe()))&&(Me=ce.close=`)$))${be}`),ce.inner.includes("*")&&(ie=Xe())&&/^\.[^\\/.]+$/.test(ie)){let $e=ed(ie,{...e,fastpaths:!1}).output;Me=ce.close=`)${$e})${be})`;}ce.prev.type==="bos"&&(N.negatedExtglob=!0);}Ce({type:"paren",extglob:!0,value:W,output:Me}),St("parens");};if(r.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(t)){let ce=!1,Me=t.replace(pL,(ie,be,$e,ot,He,fr)=>ot==="\\"?(ce=!0,ie):ot==="?"?be?be+ot+(He?S.repeat(He.length):""):fr===0?B+(He?S.repeat(He.length):""):S.repeat($e.length):ot==="."?p.repeat($e.length):ot==="*"?be?be+ot+(He?Q:""):Q:be?ie:`\\${ie}`);return ce===!0&&(r.unescape===!0?Me=Me.replace(/\\/g,""):Me=Me.replace(/\\+/g,ie=>ie.length%2===0?"\\\\":ie?"\\":"")),Me===t&&r.contains===!0?(N.output=t,N):(N.output=or.wrapOutput(Me,N,e),N)}for(;!me();){if(W=we(),W==="\0")continue;if(W==="\\"){let ie=pe();if(ie==="/"&&r.bash!==!0||ie==="."||ie===";")continue;if(!ie){W+="\\",Ce({type:"text",value:W});continue}let be=/^\\+/.exec(Xe()),$e=0;if(be&&be[0].length>2&&($e=be[0].length,N.index+=$e,$e%2!==0&&(W+="\\")),r.unescape===!0?W=we():W+=we(),N.brackets===0){Ce({type:"text",value:W});continue}}if(N.brackets>0&&(W!=="]"||q.value==="["||q.value==="[^")){if(r.posix!==!1&&W===":"){let ie=q.value.slice(1);if(ie.includes("[")&&(q.posix=!0,ie.includes(":"))){let be=q.value.lastIndexOf("["),$e=q.value.slice(0,be),ot=q.value.slice(be+2),He=dL[ot];if(He){q.value=$e+He,N.backtrack=!0,we(),!s.output&&o.indexOf(q)===1&&(s.output=w);continue}}}(W==="["&&pe()!==":"||W==="-"&&pe()==="]")&&(W=`\\${W}`),W==="]"&&(q.value==="["||q.value==="[^")&&(W=`\\${W}`),r.posix===!0&&W==="!"&&q.value==="["&&(W="^"),q.value+=W,Pt({value:W});continue}if(N.quotes===1&&W!=='"'){W=or.escapeRegex(W),q.value+=W,Pt({value:W});continue}if(W==='"'){N.quotes=N.quotes===1?0:1,r.keepQuotes===!0&&Ce({type:"text",value:W});continue}if(W==="("){Ut("parens"),Ce({type:"paren",value:W});continue}if(W===")"){if(N.parens===0&&r.strictBrackets===!0)throw new SyntaxError($i("opening","("));let ie=te[te.length-1];if(ie&&N.parens===ie.parens+1){fn(te.pop());continue}Ce({type:"paren",value:W,output:N.parens?")":"\\)"}),St("parens");continue}if(W==="["){if(r.nobracket===!0||!Xe().includes("]")){if(r.nobracket!==!0&&r.strictBrackets===!0)throw new SyntaxError($i("closing","]"));W=`\\${W}`;}else Ut("brackets");Ce({type:"bracket",value:W});continue}if(W==="]"){if(r.nobracket===!0||q&&q.type==="bracket"&&q.value.length===1){Ce({type:"text",value:W,output:`\\${W}`});continue}if(N.brackets===0){if(r.strictBrackets===!0)throw new SyntaxError($i("opening","["));Ce({type:"text",value:W,output:`\\${W}`});continue}St("brackets");let ie=q.value.slice(1);if(q.posix!==!0&&ie[0]==="^"&&!ie.includes("/")&&(W=`/${W}`),q.value+=W,Pt({value:W}),r.literalBrackets===!1||or.hasRegexChars(ie))continue;let be=or.escapeRegex(q.value);if(N.output=N.output.slice(0,-q.value.length),r.literalBrackets===!0){N.output+=be,q.value=be;continue}q.value=`(${a}${be}|${q.value})`,N.output+=q.value;continue}if(W==="{"&&r.nobrace!==!0){Ut("braces");let ie={type:"brace",value:W,output:"(",outputIndex:N.output.length,tokensIndex:N.tokens.length};ae.push(ie),Ce(ie);continue}if(W==="}"){let ie=ae[ae.length-1];if(r.nobrace===!0||!ie){Ce({type:"text",value:W,output:W});continue}let be=")";if(ie.dots===!0){let $e=o.slice(),ot=[];for(let He=$e.length-1;He>=0&&(o.pop(),$e[He].type!=="brace");He--)$e[He].type!=="dots"&&ot.unshift($e[He].value);be=mL(ot,r),N.backtrack=!0;}if(ie.comma!==!0&&ie.dots!==!0){let $e=N.output.slice(0,ie.outputIndex),ot=N.tokens.slice(ie.tokensIndex);ie.value=ie.output="\\{",W=be="\\}",N.output=$e;for(let He of ot)N.output+=He.output||He.value;}Ce({type:"brace",value:W,output:be}),St("braces"),ae.pop();continue}if(W==="|"){te.length>0&&te[te.length-1].conditions++,Ce({type:"text",value:W});continue}if(W===","){let ie=W,be=ae[ae.length-1];be&&ye[ye.length-1]==="braces"&&(be.comma=!0,ie="|"),Ce({type:"comma",value:W,output:ie});continue}if(W==="/"){if(q.type==="dot"&&N.index===N.start+1){N.start=N.index+1,N.consumed="",N.output="",o.pop(),q=s;continue}Ce({type:"slash",value:W,output:_});continue}if(W==="."){if(N.braces>0&&q.type==="dot"){q.value==="."&&(q.output=p);let ie=ae[ae.length-1];q.type="dots",q.output+=W,q.value+=W,ie.dots=!0;continue}if(N.braces+N.parens===0&&q.type!=="bos"&&q.type!=="slash"){Ce({type:"text",value:W,output:p});continue}Ce({type:"dot",value:W,output:p});continue}if(W==="?"){if(!(q&&q.value==="(")&&r.noextglob!==!0&&pe()==="("&&pe(2)!=="?"){Cr("qmark",W);continue}if(q&&q.type==="paren"){let be=pe(),$e=W;if(be==="<"&&!or.supportsLookbehinds())throw new Error("Node.js v10 or higher is required for regex lookbehinds");(q.value==="("&&!/[!=<:]/.test(be)||be==="<"&&!/<([!=]|\w+>)/.test(Xe()))&&($e=`\\${W}`),Ce({type:"text",value:W,output:$e});continue}if(r.dot!==!0&&(q.type==="slash"||q.type==="bos")){Ce({type:"qmark",value:W,output:I});continue}Ce({type:"qmark",value:W,output:S});continue}if(W==="!"){if(r.noextglob!==!0&&pe()==="("&&(pe(2)!=="?"||!/[!=<:]/.test(pe(3)))){Cr("negate",W);continue}if(r.nonegate!==!0&&N.index===0){Lr();continue}}if(W==="+"){if(r.noextglob!==!0&&pe()==="("&&pe(2)!=="?"){Cr("plus",W);continue}if(q&&q.value==="("||r.regex===!1){Ce({type:"plus",value:W,output:m});continue}if(q&&(q.type==="bracket"||q.type==="paren"||q.type==="brace")||N.parens>0){Ce({type:"plus",value:W});continue}Ce({type:"plus",value:m});continue}if(W==="@"){if(r.noextglob!==!0&&pe()==="("&&pe(2)!=="?"){Ce({type:"at",extglob:!0,value:W,output:""});continue}Ce({type:"text",value:W});continue}if(W!=="*"){(W==="$"||W==="^")&&(W=`\\${W}`);let ie=hL.exec(Xe());ie&&(W+=ie[0],N.index+=ie[0].length),Ce({type:"text",value:W});continue}if(q&&(q.type==="globstar"||q.star===!0)){q.type="star",q.star=!0,q.value+=W,q.output=Q,N.backtrack=!0,N.globstar=!0,Ke(W);continue}let ce=Xe();if(r.noextglob!==!0&&/^\([^?]/.test(ce)){Cr("star",W);continue}if(q.type==="star"){if(r.noglobstar===!0){Ke(W);continue}let ie=q.prev,be=ie.prev,$e=ie.type==="slash"||ie.type==="bos",ot=be&&(be.type==="star"||be.type==="globstar");if(r.bash===!0&&(!$e||ce[0]&&ce[0]!=="/")){Ce({type:"star",value:W,output:""});continue}let He=N.braces>0&&(ie.type==="comma"||ie.type==="brace"),fr=te.length&&(ie.type==="pipe"||ie.type==="paren");if(!$e&&ie.type!=="paren"&&!He&&!fr){Ce({type:"star",value:W,output:""});continue}for(;ce.slice(0,3)==="/**";){let Nt=t[N.index+4];if(Nt&&Nt!=="/")break;ce=ce.slice(3),Ke("/**",3);}if(ie.type==="bos"&&me()){q.type="globstar",q.value+=W,q.output=K(r),N.output=q.output,N.globstar=!0,Ke(W);continue}if(ie.type==="slash"&&ie.prev.type!=="bos"&&!ot&&me()){N.output=N.output.slice(0,-(ie.output+q.output).length),ie.output=`(?:${ie.output}`,q.type="globstar",q.output=K(r)+(r.strictSlashes?")":"|$)"),q.value+=W,N.globstar=!0,N.output+=ie.output+q.output,Ke(W);continue}if(ie.type==="slash"&&ie.prev.type!=="bos"&&ce[0]==="/"){let Nt=ce[1]!==void 0?"|$":"";N.output=N.output.slice(0,-(ie.output+q.output).length),ie.output=`(?:${ie.output}`,q.type="globstar",q.output=`${K(r)}${_}|${_}${Nt})`,q.value+=W,N.output+=ie.output+q.output,N.globstar=!0,Ke(W+we()),Ce({type:"slash",value:"/",output:""});continue}if(ie.type==="bos"&&ce[0]==="/"){q.type="globstar",q.value+=W,q.output=`(?:^|${_}|${K(r)}${_})`,N.output=q.output,N.globstar=!0,Ke(W+we()),Ce({type:"slash",value:"/",output:""});continue}N.output=N.output.slice(0,-q.output.length),q.type="globstar",q.output=K(r),q.value+=W,N.output+=q.output,N.globstar=!0,Ke(W);continue}let Me={type:"star",value:W,output:Q};if(r.bash===!0){Me.output=".*?",(q.type==="bos"||q.type==="slash")&&(Me.output=U+Me.output),Ce(Me);continue}if(q&&(q.type==="bracket"||q.type==="paren")&&r.regex===!0){Me.output=W,Ce(Me);continue}(N.index===N.start||q.type==="slash"||q.type==="dot")&&(q.type==="dot"?(N.output+=D,q.output+=D):r.dot===!0?(N.output+=g,q.output+=g):(N.output+=U,q.output+=U),pe()!=="*"&&(N.output+=w,q.output+=w)),Ce(Me);}for(;N.brackets>0;){if(r.strictBrackets===!0)throw new SyntaxError($i("closing","]"));N.output=or.escapeLast(N.output,"["),St("brackets");}for(;N.parens>0;){if(r.strictBrackets===!0)throw new SyntaxError($i("closing",")"));N.output=or.escapeLast(N.output,"("),St("parens");}for(;N.braces>0;){if(r.strictBrackets===!0)throw new SyntaxError($i("closing","}"));N.output=or.escapeLast(N.output,"{"),St("braces");}if(r.strictSlashes!==!0&&(q.type==="star"||q.type==="bracket")&&Ce({type:"maybe_slash",value:"",output:`${_}?`}),N.backtrack===!0){N.output="";for(let ce of N.tokens)N.output+=ce.output!=null?ce.output:ce.value,ce.suffix&&(N.output+=ce.suffix);}return N};ed.fastpaths=(t,e)=>{let r={...e},n=typeof r.maxLength=="number"?Math.min(Ga,r.maxLength):Ga,i=t.length;if(i>n)throw new SyntaxError(`Input length: ${i}, exceeds maximum allowed length: ${n}`);t=pE[t]||t;let s=or.isWindows(e),{DOT_LITERAL:o,SLASH_LITERAL:a,ONE_CHAR:l,DOTS_SLASH:d,NO_DOT:c,NO_DOTS:p,NO_DOTS_SLASH:m,STAR:_,START_ANCHOR:w}=Va.globChars(s),E=r.dot?p:c,P=r.dot?m:c,D=r.capture?"":"?:",g={negated:!1,prefix:""},S=r.bash===!0?".*?":_;r.capture&&(S=`(${S})`);let I=U=>U.noglobstar===!0?S:`(${D}(?:(?!${w}${U.dot?d:o}).)*?)`,L=U=>{switch(U){case"*":return `${E}${l}${S}`;case".*":return `${o}${l}${S}`;case"*.*":return `${E}${S}${o}${l}${S}`;case"*/*":return `${E}${S}${a}${l}${P}${S}`;case"**":return E+I(r);case"**/*":return `(?:${E}${I(r)}${a})?${P}${l}${S}`;case"**/*.*":return `(?:${E}${I(r)}${a})?${P}${S}${o}${l}${S}`;case"**/.*":return `(?:${E}${I(r)}${a})?${o}${l}${S}`;default:{let B=/^(.*?)\.(\w+)$/.exec(U);if(!B)return;let Q=L(B[1]);return Q?Q+o+B[2]:void 0}}},Z=or.removePrefix(t,g),K=L(Z);return K&&r.strictSlashes!==!0&&(K+=`${a}?`),K};mE.exports=ed;});var yE=A((K9,_E)=>{var gL=oe("path"),_L=hE(),td=gE(),rd=za(),yL=Zs(),bL=t=>t&&typeof t=="object"&&!Array.isArray(t),lt=(t,e,r=!1)=>{if(Array.isArray(t)){let c=t.map(m=>lt(m,e,r));return m=>{for(let _ of c){let w=_(m);if(w)return w}return !1}}let n=bL(t)&&t.tokens&&t.input;if(t===""||typeof t!="string"&&!n)throw new TypeError("Expected pattern to be a non-empty string");let i=e||{},s=rd.isWindows(e),o=n?lt.compileRe(t,e):lt.makeRe(t,e,!1,!0),a=o.state;delete o.state;let l=()=>!1;if(i.ignore){let c={...e,ignore:null,onMatch:null,onResult:null};l=lt(i.ignore,c,r);}let d=(c,p=!1)=>{let{isMatch:m,match:_,output:w}=lt.test(c,o,e,{glob:t,posix:s}),E={glob:t,state:a,regex:o,posix:s,input:c,output:w,match:_,isMatch:m};return typeof i.onResult=="function"&&i.onResult(E),m===!1?(E.isMatch=!1,p?E:!1):l(c)?(typeof i.onIgnore=="function"&&i.onIgnore(E),E.isMatch=!1,p?E:!1):(typeof i.onMatch=="function"&&i.onMatch(E),p?E:!0)};return r&&(d.state=a),d};lt.test=(t,e,r,{glob:n,posix:i}={})=>{if(typeof t!="string")throw new TypeError("Expected input to be a string");if(t==="")return {isMatch:!1,output:""};let s=r||{},o=s.format||(i?rd.toPosixSlashes:null),a=t===n,l=a&&o?o(t):t;return a===!1&&(l=o?o(t):t,a=l===n),(a===!1||s.capture===!0)&&(s.matchBase===!0||s.basename===!0?a=lt.matchBase(t,e,r,i):a=e.exec(l)),{isMatch:!!a,match:a,output:l}};lt.matchBase=(t,e,r,n=rd.isWindows(r))=>(e instanceof RegExp?e:lt.makeRe(e,r)).test(gL.basename(t));lt.isMatch=(t,e,r)=>lt(e,r)(t);lt.parse=(t,e)=>Array.isArray(t)?t.map(r=>lt.parse(r,e)):td(t,{...e,fastpaths:!1});lt.scan=(t,e)=>_L(t,e);lt.compileRe=(t,e,r=!1,n=!1)=>{if(r===!0)return t.output;let i=e||{},s=i.contains?"":"^",o=i.contains?"":"$",a=`${s}(?:${t.output})${o}`;t&&t.negated===!0&&(a=`^(?!${a}).*$`);let l=lt.toRegex(a,e);return n===!0&&(l.state=t),l};lt.makeRe=(t,e={},r=!1,n=!1)=>{if(!t||typeof t!="string")throw new TypeError("Expected a non-empty string");let i={negated:!1,fastpaths:!0};return e.fastpaths!==!1&&(t[0]==="."||t[0]==="*")&&(i.output=td.fastpaths(t,e)),i.output||(i=td(t,e)),lt.compileRe(i,e,r,n)};lt.toRegex=(t,e)=>{try{let r=e||{};return new RegExp(t,r.flags||(r.nocase?"i":""))}catch(r){if(e&&e.debug===!0)throw r;return /$^/}};lt.constants=yL;_E.exports=lt;});var nd=A((Z9,bE)=>{bE.exports=yE();});var TE=A((J9,xE)=>{var Xs=oe("fs"),{Readable:vL}=oe("stream"),Ys=oe("path"),{promisify:Ya}=oe("util"),id=nd(),wL=Ya(Xs.readdir),SL=Ya(Xs.stat),vE=Ya(Xs.lstat),EL=Ya(Xs.realpath),RL="!",RE="READDIRP_RECURSIVE_ERROR",CL=new Set(["ENOENT","EPERM","EACCES","ELOOP",RE]),sd="files",CE="directories",Za="files_directories",Ka="all",wE=[sd,CE,Za,Ka],xL=t=>CL.has(t.code),[SE,TL]=process.versions.node.split(".").slice(0,2).map(t=>Number.parseInt(t,10)),AL=process.platform==="win32"&&(SE>10||SE===10&&TL>=5),EE=t=>{if(t!==void 0){if(typeof t=="function")return t;if(typeof t=="string"){let e=id(t.trim());return r=>e(r.basename)}if(Array.isArray(t)){let e=[],r=[];for(let n of t){let i=n.trim();i.charAt(0)===RL?r.push(id(i.slice(1))):e.push(id(i));}return r.length>0?e.length>0?n=>e.some(i=>i(n.basename))&&!r.some(i=>i(n.basename)):n=>!r.some(i=>i(n.basename)):n=>e.some(i=>i(n.basename))}}},Ja=class t extends vL{static get defaultOptions(){return {root:".",fileFilter:e=>!0,directoryFilter:e=>!0,type:sd,lstat:!1,depth:2147483648,alwaysStat:!1}}constructor(e={}){super({objectMode:!0,autoDestroy:!0,highWaterMark:e.highWaterMark||4096});let r={...t.defaultOptions,...e},{root:n,type:i}=r;this._fileFilter=EE(r.fileFilter),this._directoryFilter=EE(r.directoryFilter);let s=r.lstat?vE:SL;AL?this._stat=o=>s(o,{bigint:!0}):this._stat=s,this._maxDepth=r.depth,this._wantsDir=[CE,Za,Ka].includes(i),this._wantsFile=[sd,Za,Ka].includes(i),this._wantsEverything=i===Ka,this._root=Ys.resolve(n),this._isDirent="Dirent"in Xs&&!r.alwaysStat,this._statsProp=this._isDirent?"dirent":"stats",this._rdOptions={encoding:"utf8",withFileTypes:this._isDirent},this.parents=[this._exploreDir(n,1)],this.reading=!1,this.parent=void 0;}async _read(e){if(!this.reading){this.reading=!0;try{for(;!this.destroyed&&e>0;){let{path:r,depth:n,files:i=[]}=this.parent||{};if(i.length>0){let s=i.splice(0,e).map(o=>this._formatEntry(o,r));for(let o of await Promise.all(s)){if(this.destroyed)return;let a=await this._getEntryType(o);a==="directory"&&this._directoryFilter(o)?(n<=this._maxDepth&&this.parents.push(this._exploreDir(o.fullPath,n+1)),this._wantsDir&&(this.push(o),e--)):(a==="file"||this._includeAsFile(o))&&this._fileFilter(o)&&this._wantsFile&&(this.push(o),e--);}}else {let s=this.parents.pop();if(!s){this.push(null);break}if(this.parent=await s,this.destroyed)return}}}catch(r){this.destroy(r);}finally{this.reading=!1;}}}async _exploreDir(e,r){let n;try{n=await wL(e,this._rdOptions);}catch(i){this._onError(i);}return {files:n,depth:r,path:e}}async _formatEntry(e,r){let n;try{let i=this._isDirent?e.name:e,s=Ys.resolve(Ys.join(r,i));n={path:Ys.relative(this._root,s),fullPath:s,basename:i},n[this._statsProp]=this._isDirent?e:await this._stat(s);}catch(i){this._onError(i);}return n}_onError(e){xL(e)&&!this.destroyed?this.emit("warn",e):this.destroy(e);}async _getEntryType(e){let r=e&&e[this._statsProp];if(r){if(r.isFile())return "file";if(r.isDirectory())return "directory";if(r&&r.isSymbolicLink()){let n=e.fullPath;try{let i=await EL(n),s=await vE(i);if(s.isFile())return "file";if(s.isDirectory()){let o=i.length;if(n.startsWith(i)&&n.substr(o,1)===Ys.sep){let a=new Error(`Circular symlink detected: "${n}" points to "${i}"`);return a.code=RE,this._onError(a)}return "directory"}}catch(i){this._onError(i);}}}}_includeAsFile(e){let r=e&&e[this._statsProp];return r&&this._wantsEverything&&!r.isDirectory()}},ji=(t,e={})=>{let r=e.entryType||e.type;if(r==="both"&&(r=Za),r&&(e.type=r),t){if(typeof t!="string")throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");if(r&&!wE.includes(r))throw new Error(`readdirp: Invalid type passed. Use one of ${wE.join(", ")}`)}else throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");return e.root=t,new Ja(e)},PL=(t,e={})=>new Promise((r,n)=>{let i=[];ji(t,e).on("data",s=>i.push(s)).on("end",()=>r(i)).on("error",s=>n(s));});ji.promise=PL;ji.ReaddirpStream=Ja;ji.default=ji;xE.exports=ji;});var od=A((Y9,AE)=>{AE.exports=function(t,e){if(typeof t!="string")throw new TypeError("expected path to be a string");if(t==="\\"||t==="/")return "/";var r=t.length;if(r<=1)return t;var n="";if(r>4&&t[3]==="\\"){var i=t[2];(i==="?"||i===".")&&t.slice(0,2)==="\\\\"&&(t=t.slice(2),n="//");}var s=t.split(/[/\\]+/);return e!==!1&&s[s.length-1]===""&&s.pop(),n+s.join("/")};});var ME=A((IE,kE)=>{Object.defineProperty(IE,"__esModule",{value:!0});var OE=nd(),DL=od(),PE="!",OL={returnIndex:!1},IL=t=>Array.isArray(t)?t:[t],kL=(t,e)=>{if(typeof t=="function")return t;if(typeof t=="string"){let r=OE(t,e);return n=>t===n||r(n)}return t instanceof RegExp?r=>t.test(r):r=>!1},DE=(t,e,r,n)=>{let i=Array.isArray(r),s=i?r[0]:r;if(!i&&typeof s!="string")throw new TypeError("anymatch: second argument must be a string: got "+Object.prototype.toString.call(s));let o=DL(s,!1);for(let l=0;l{if(t==null)throw new TypeError("anymatch: specify first argument");let n=typeof r=="boolean"?{returnIndex:r}:r,i=n.returnIndex||!1,s=IL(t),o=s.filter(l=>typeof l=="string"&&l.charAt(0)===PE).map(l=>l.slice(1)).map(l=>OE(l,n)),a=s.filter(l=>typeof l!="string"||typeof l=="string"&&l.charAt(0)!==PE).map(l=>kL(l,n));return e==null?(l,d=!1)=>DE(a,o,l,typeof d=="boolean"?d:!1):DE(a,o,e,i)};ad.default=ad;kE.exports=ad;});var NE=A((X9,FE)=>{FE.exports=function(e){if(typeof e!="string"||e==="")return !1;for(var r;r=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(r[2])return !0;e=e.slice(r.index+r[0].length);}return !1};});var ud=A((Q9,LE)=>{var ML=NE(),qE={"{":"}","(":")","[":"]"},FL=function(t){if(t[0]==="!")return !0;for(var e=0,r=-2,n=-2,i=-2,s=-2,o=-2;ee&&(o===-1||o>n||(o=t.indexOf("\\",e),o===-1||o>n)))||i!==-1&&t[e]==="{"&&t[e+1]!=="}"&&(i=t.indexOf("}",e),i>e&&(o=t.indexOf("\\",e),o===-1||o>i))||s!==-1&&t[e]==="("&&t[e+1]==="?"&&/[:!=]/.test(t[e+2])&&t[e+3]!==")"&&(s=t.indexOf(")",e),s>e&&(o=t.indexOf("\\",e),o===-1||o>s))||r!==-1&&t[e]==="("&&t[e+1]!=="|"&&(rr&&(o=t.indexOf("\\",r),o===-1||o>s))))return !0;if(t[e]==="\\"){var a=t[e+1];e+=2;var l=qE[a];if(l){var d=t.indexOf(l,e);d!==-1&&(e=d+1);}if(t[e]==="!")return !0}else e++;}return !1},NL=function(t){if(t[0]==="!")return !0;for(var e=0;e{var qL=ud(),LL=oe("path").posix.dirname,$L=oe("os").platform()==="win32",cd="/",jL=/\\/g,HL=/[\{\[].*[\}\]]$/,WL=/(^|[^\\])([\{\[]|\([^\)]+$)/,BL=/\\([\!\*\?\|\[\]\(\)\{\}])/g;$E.exports=function(e,r){var n=Object.assign({flipBackslashes:!0},r);n.flipBackslashes&&$L&&e.indexOf(cd)<0&&(e=e.replace(jL,cd)),HL.test(e)&&(e+=cd),e+="a";do e=LL(e);while(qL(e)||WL.test(e));return e.replace(BL,"$1")};});var Xa=A(gr=>{gr.isInteger=t=>typeof t=="number"?Number.isInteger(t):typeof t=="string"&&t.trim()!==""?Number.isInteger(Number(t)):!1;gr.find=(t,e)=>t.nodes.find(r=>r.type===e);gr.exceedsLimit=(t,e,r=1,n)=>n===!1||!gr.isInteger(t)||!gr.isInteger(e)?!1:(Number(e)-Number(t))/Number(r)>=n;gr.escapeNode=(t,e=0,r)=>{let n=t.nodes[e];n&&(r&&n.type===r||n.type==="open"||n.type==="close")&&n.escaped!==!0&&(n.value="\\"+n.value,n.escaped=!0);};gr.encloseBrace=t=>t.type!=="brace"||t.commas>>0+t.ranges>>0?!1:(t.invalid=!0,!0);gr.isInvalidBrace=t=>t.type!=="brace"?!1:t.invalid===!0||t.dollar?!0:!(t.commas>>0+t.ranges>>0)||t.open!==!0||t.close!==!0?(t.invalid=!0,!0):!1;gr.isOpenOrClose=t=>t.type==="open"||t.type==="close"?!0:t.open===!0||t.close===!0;gr.reduce=t=>t.reduce((e,r)=>(r.type==="text"&&e.push(r.value),r.type==="range"&&(r.type="text"),e),[]);gr.flatten=(...t)=>{let e=[],r=n=>{for(let i=0;i{var HE=Xa();WE.exports=(t,e={})=>{let r=(n,i={})=>{let s=e.escapeInvalid&&HE.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a="";if(n.value)return (s||o)&&HE.isOpenOrClose(n)?"\\"+n.value:n.value;if(n.value)return n.value;if(n.nodes)for(let l of n.nodes)a+=r(l);return a};return r(t)};});var UE=A((nV,BE)=>{BE.exports=function(t){return typeof t=="number"?t-t===0:typeof t=="string"&&t.trim()!==""?Number.isFinite?Number.isFinite(+t):isFinite(+t):!1};});var QE=A((iV,XE)=>{var zE=UE(),Qn=(t,e,r)=>{if(zE(t)===!1)throw new TypeError("toRegexRange: expected the first argument to be a number");if(e===void 0||t===e)return String(t);if(zE(e)===!1)throw new TypeError("toRegexRange: expected the second argument to be a number.");let n={relaxZeros:!0,...r};typeof n.strictZeros=="boolean"&&(n.relaxZeros=n.strictZeros===!1);let i=String(n.relaxZeros),s=String(n.shorthand),o=String(n.capture),a=String(n.wrap),l=t+":"+e+"="+i+s+o+a;if(Qn.cache.hasOwnProperty(l))return Qn.cache[l].result;let d=Math.min(t,e),c=Math.max(t,e);if(Math.abs(d-c)===1){let E=t+"|"+e;return n.capture?`(${E})`:n.wrap===!1?E:`(?:${E})`}let p=YE(t)||YE(e),m={min:t,max:e,a:d,b:c},_=[],w=[];if(p&&(m.isPadded=p,m.maxLen=String(m.max).length),d<0){let E=c<0?Math.abs(c):1;w=VE(E,Math.abs(d),m,n),d=m.a=0;}return c>=0&&(_=VE(d,c,m,n)),m.negatives=w,m.positives=_,m.result=UL(w,_),n.capture===!0?m.result=`(${m.result})`:n.wrap!==!1&&_.length+w.length>1&&(m.result=`(?:${m.result})`),Qn.cache[l]=m,m.result};function UL(t,e,r){let n=ld(t,e,"-",!1)||[],i=ld(e,t,"",!1)||[],s=ld(t,e,"-?",!0)||[];return n.concat(s).concat(i).join("|")}function zL(t,e){let r=1,n=1,i=KE(t,r),s=new Set([e]);for(;t<=i&&i<=e;)s.add(i),r+=1,i=KE(t,r);for(i=ZE(e+1,n)-1;t1&&a.count.pop(),a.count.push(c.count[0]),a.string=a.pattern+JE(a.count),o=d+1;continue}r.isPadded&&(p=JL(d,r,n)),c.string=p+c.pattern+JE(c.count),s.push(c),o=d+1,a=c;}return s}function ld(t,e,r,n,i){let s=[];for(let o of t){let{string:a}=o;!n&&!GE(e,"string",a)&&s.push(r+a),n&&GE(e,"string",a)&&s.push(r+a);}return s}function GL(t,e){let r=[];for(let n=0;ne?1:e>t?-1:0}function GE(t,e,r){return t.some(n=>n[e]===r)}function KE(t,e){return Number(String(t).slice(0,-e)+"9".repeat(e))}function ZE(t,e){return t-t%Math.pow(10,e)}function JE(t){let[e=0,r=""]=t;return r||e>1?`{${e+(r?","+r:"")}}`:""}function ZL(t,e,r){return `[${t}${e-t===1?"":"-"}${e}]`}function YE(t){return /^-?(0+)\d/.test(t)}function JL(t,e,r){if(!e.isPadded)return t;let n=Math.abs(e.maxLen-String(t).length),i=r.relaxZeros!==!1;switch(n){case 0:return "";case 1:return i?"0?":"0";case 2:return i?"0{0,2}":"00";default:return i?`0{0,${n}}`:`0{${n}}`}}Qn.cache={};Qn.clearCache=()=>Qn.cache={};XE.exports=Qn;});var hd=A((sV,a0)=>{var YL=oe("util"),r0=QE(),e0=t=>t!==null&&typeof t=="object"&&!Array.isArray(t),XL=t=>e=>t===!0?Number(e):String(e),fd=t=>typeof t=="number"||typeof t=="string"&&t!=="",Qs=t=>Number.isInteger(+t),dd=t=>{let e=`${t}`,r=-1;if(e[0]==="-"&&(e=e.slice(1)),e==="0")return !1;for(;e[++r]==="0";);return r>0},QL=(t,e,r)=>typeof t=="string"||typeof e=="string"?!0:r.stringify===!0,e2=(t,e,r)=>{if(e>0){let n=t[0]==="-"?"-":"";n&&(t=t.slice(1)),t=n+t.padStart(n?e-1:e,"0");}return r===!1?String(t):t},t0=(t,e)=>{let r=t[0]==="-"?"-":"";for(r&&(t=t.slice(1),e--);t.length{t.negatives.sort((o,a)=>oa?1:0),t.positives.sort((o,a)=>oa?1:0);let r=e.capture?"":"?:",n="",i="",s;return t.positives.length&&(n=t.positives.join("|")),t.negatives.length&&(i=`-(${r}${t.negatives.join("|")})`),n&&i?s=`${n}|${i}`:s=n||i,e.wrap?`(${r}${s})`:s},n0=(t,e,r,n)=>{if(r)return r0(t,e,{wrap:!1,...n});let i=String.fromCharCode(t);if(t===e)return i;let s=String.fromCharCode(e);return `[${i}-${s}]`},i0=(t,e,r)=>{if(Array.isArray(t)){let n=r.wrap===!0,i=r.capture?"":"?:";return n?`(${i}${t.join("|")})`:t.join("|")}return r0(t,e,r)},s0=(...t)=>new RangeError("Invalid range arguments: "+YL.inspect(...t)),o0=(t,e,r)=>{if(r.strictRanges===!0)throw s0([t,e]);return []},r2=(t,e)=>{if(e.strictRanges===!0)throw new TypeError(`Expected step "${t}" to be a number`);return []},n2=(t,e,r=1,n={})=>{let i=Number(t),s=Number(e);if(!Number.isInteger(i)||!Number.isInteger(s)){if(n.strictRanges===!0)throw s0([t,e]);return []}i===0&&(i=0),s===0&&(s=0);let o=i>s,a=String(t),l=String(e),d=String(r);r=Math.max(Math.abs(r),1);let c=dd(a)||dd(l)||dd(d),p=c?Math.max(a.length,l.length,d.length):0,m=c===!1&&QL(t,e,n)===!1,_=n.transform||XL(m);if(n.toRegex&&r===1)return n0(t0(t,p),t0(e,p),!0,n);let w={negatives:[],positives:[]},E=g=>w[g<0?"negatives":"positives"].push(Math.abs(g)),P=[],D=0;for(;o?i>=s:i<=s;)n.toRegex===!0&&r>1?E(i):P.push(e2(_(i,D),p,m)),i=o?i-r:i+r,D++;return n.toRegex===!0?r>1?t2(w,n):i0(P,null,{wrap:!1,...n}):P},i2=(t,e,r=1,n={})=>{if(!Qs(t)&&t.length>1||!Qs(e)&&e.length>1)return o0(t,e,n);let i=n.transform||(m=>String.fromCharCode(m)),s=`${t}`.charCodeAt(0),o=`${e}`.charCodeAt(0),a=s>o,l=Math.min(s,o),d=Math.max(s,o);if(n.toRegex&&r===1)return n0(l,d,!1,n);let c=[],p=0;for(;a?s>=o:s<=o;)c.push(i(s,p)),s=a?s-r:s+r,p++;return n.toRegex===!0?i0(c,null,{wrap:!1,options:n}):c},eu=(t,e,r,n={})=>{if(e==null&&fd(t))return [t];if(!fd(t)||!fd(e))return o0(t,e,n);if(typeof r=="function")return eu(t,e,1,{transform:r});if(e0(r))return eu(t,e,0,r);let i={...n};return i.capture===!0&&(i.wrap=!0),r=r||i.step||1,Qs(r)?Qs(t)&&Qs(e)?n2(t,e,r,i):i2(t,e,Math.max(Math.abs(r),1),i):r!=null&&!e0(r)?r2(r,i):eu(t,e,1,r)};a0.exports=eu;});var l0=A((oV,c0)=>{var s2=hd(),u0=Xa(),o2=(t,e={})=>{let r=(n,i={})=>{let s=u0.isInvalidBrace(i),o=n.invalid===!0&&e.escapeInvalid===!0,a=s===!0||o===!0,l=e.escapeInvalid===!0?"\\":"",d="";if(n.isOpen===!0||n.isClose===!0)return l+n.value;if(n.type==="open")return a?l+n.value:"(";if(n.type==="close")return a?l+n.value:")";if(n.type==="comma")return n.prev.type==="comma"?"":a?n.value:"|";if(n.value)return n.value;if(n.nodes&&n.ranges>0){let c=u0.reduce(n.nodes),p=s2(...c,{...e,wrap:!1,toRegex:!0});if(p.length!==0)return c.length>1&&p.length>1?`(${p})`:p}if(n.nodes)for(let c of n.nodes)d+=r(c,n);return d};return r(t)};c0.exports=o2;});var h0=A((aV,d0)=>{var a2=hd(),f0=Qa(),Hi=Xa(),ei=(t="",e="",r=!1)=>{let n=[];if(t=[].concat(t),e=[].concat(e),!e.length)return t;if(!t.length)return r?Hi.flatten(e).map(i=>`{${i}}`):e;for(let i of t)if(Array.isArray(i))for(let s of i)n.push(ei(s,e,r));else for(let s of e)r===!0&&typeof s=="string"&&(s=`{${s}}`),n.push(Array.isArray(s)?ei(i,s,r):i+s);return Hi.flatten(n)},u2=(t,e={})=>{let r=e.rangeLimit===void 0?1e3:e.rangeLimit,n=(i,s={})=>{i.queue=[];let o=s,a=s.queue;for(;o.type!=="brace"&&o.type!=="root"&&o.parent;)o=o.parent,a=o.queue;if(i.invalid||i.dollar){a.push(ei(a.pop(),f0(i,e)));return}if(i.type==="brace"&&i.invalid!==!0&&i.nodes.length===2){a.push(ei(a.pop(),["{}"]));return}if(i.nodes&&i.ranges>0){let p=Hi.reduce(i.nodes);if(Hi.exceedsLimit(...p,e.step,r))throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");let m=a2(...p,e);m.length===0&&(m=f0(i,e)),a.push(ei(a.pop(),m)),i.nodes=[];return}let l=Hi.encloseBrace(i),d=i.queue,c=i;for(;c.type!=="brace"&&c.type!=="root"&&c.parent;)c=c.parent,d=c.queue;for(let p=0;p{p0.exports={MAX_LENGTH:1024*64,CHAR_0:"0",CHAR_9:"9",CHAR_UPPERCASE_A:"A",CHAR_LOWERCASE_A:"a",CHAR_UPPERCASE_Z:"Z",CHAR_LOWERCASE_Z:"z",CHAR_LEFT_PARENTHESES:"(",CHAR_RIGHT_PARENTHESES:")",CHAR_ASTERISK:"*",CHAR_AMPERSAND:"&",CHAR_AT:"@",CHAR_BACKSLASH:"\\",CHAR_BACKTICK:"`",CHAR_CARRIAGE_RETURN:"\r",CHAR_CIRCUMFLEX_ACCENT:"^",CHAR_COLON:":",CHAR_COMMA:",",CHAR_DOLLAR:"$",CHAR_DOT:".",CHAR_DOUBLE_QUOTE:'"',CHAR_EQUAL:"=",CHAR_EXCLAMATION_MARK:"!",CHAR_FORM_FEED:"\f",CHAR_FORWARD_SLASH:"/",CHAR_HASH:"#",CHAR_HYPHEN_MINUS:"-",CHAR_LEFT_ANGLE_BRACKET:"<",CHAR_LEFT_CURLY_BRACE:"{",CHAR_LEFT_SQUARE_BRACKET:"[",CHAR_LINE_FEED:` +`,CHAR_NO_BREAK_SPACE:"\xA0",CHAR_PERCENT:"%",CHAR_PLUS:"+",CHAR_QUESTION_MARK:"?",CHAR_RIGHT_ANGLE_BRACKET:">",CHAR_RIGHT_CURLY_BRACE:"}",CHAR_RIGHT_SQUARE_BRACKET:"]",CHAR_SEMICOLON:";",CHAR_SINGLE_QUOTE:"'",CHAR_SPACE:" ",CHAR_TAB:" ",CHAR_UNDERSCORE:"_",CHAR_VERTICAL_LINE:"|",CHAR_ZERO_WIDTH_NOBREAK_SPACE:"\uFEFF"};});var v0=A((cV,b0)=>{var c2=Qa(),{MAX_LENGTH:g0,CHAR_BACKSLASH:pd,CHAR_BACKTICK:l2,CHAR_COMMA:f2,CHAR_DOT:d2,CHAR_LEFT_PARENTHESES:h2,CHAR_RIGHT_PARENTHESES:p2,CHAR_LEFT_CURLY_BRACE:m2,CHAR_RIGHT_CURLY_BRACE:g2,CHAR_LEFT_SQUARE_BRACKET:_0,CHAR_RIGHT_SQUARE_BRACKET:y0,CHAR_DOUBLE_QUOTE:_2,CHAR_SINGLE_QUOTE:y2,CHAR_NO_BREAK_SPACE:b2,CHAR_ZERO_WIDTH_NOBREAK_SPACE:v2}=m0(),w2=(t,e={})=>{if(typeof t!="string")throw new TypeError("Expected a string");let r=e||{},n=typeof r.maxLength=="number"?Math.min(g0,r.maxLength):g0;if(t.length>n)throw new SyntaxError(`Input length (${t.length}), exceeds max characters (${n})`);let i={type:"root",input:t,nodes:[]},s=[i],o=i,a=i,l=0,d=t.length,c=0,p=0,m,w=()=>t[c++],E=P=>{if(P.type==="text"&&a.type==="dot"&&(a.type="text"),a&&a.type==="text"&&P.type==="text"){a.value+=P.value;return}return o.nodes.push(P),P.parent=o,P.prev=a,a=P,P};for(E({type:"bos"});c0){if(o.ranges>0){o.ranges=0;let P=o.nodes.shift();o.nodes=[P,{type:"text",value:c2(o)}];}E({type:"comma",value:m}),o.commas++;continue}if(m===d2&&p>0&&o.commas===0){let P=o.nodes;if(p===0||P.length===0){E({type:"text",value:m});continue}if(a.type==="dot"){if(o.range=[],a.value+=m,a.type="range",o.nodes.length!==3&&o.nodes.length!==5){o.invalid=!0,o.ranges=0,a.type="text";continue}o.ranges++,o.args=[];continue}if(a.type==="range"){P.pop();let D=P[P.length-1];D.value+=a.value+m,a=D,o.ranges--;continue}E({type:"dot",value:m});continue}E({type:"text",value:m});}do if(o=s.pop(),o.type!=="root"){o.nodes.forEach(g=>{g.nodes||(g.type==="open"&&(g.isOpen=!0),g.type==="close"&&(g.isClose=!0),g.nodes||(g.type="text"),g.invalid=!0);});let P=s[s.length-1],D=P.nodes.indexOf(o);P.nodes.splice(D,1,...o.nodes);}while(s.length>0);return E({type:"eos"}),i};b0.exports=w2;});var E0=A((lV,S0)=>{var w0=Qa(),S2=l0(),E2=h0(),R2=v0(),ar=(t,e={})=>{let r=[];if(Array.isArray(t))for(let n of t){let i=ar.create(n,e);Array.isArray(i)?r.push(...i):r.push(i);}else r=[].concat(ar.create(t,e));return e&&e.expand===!0&&e.nodupes===!0&&(r=[...new Set(r)]),r};ar.parse=(t,e={})=>R2(t,e);ar.stringify=(t,e={})=>w0(typeof t=="string"?ar.parse(t,e):t,e);ar.compile=(t,e={})=>(typeof t=="string"&&(t=ar.parse(t,e)),S2(t,e));ar.expand=(t,e={})=>{typeof t=="string"&&(t=ar.parse(t,e));let r=E2(t,e);return e.noempty===!0&&(r=r.filter(Boolean)),e.nodupes===!0&&(r=[...new Set(r)]),r};ar.create=(t,e={})=>t===""||t.length<3?[t]:e.expand!==!0?ar.compile(t,e):ar.expand(t,e);S0.exports=ar;});var R0=A((fV,C2)=>{C2.exports=["3dm","3ds","3g2","3gp","7z","a","aac","adp","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"];});var x0=A((dV,C0)=>{C0.exports=R0();});var A0=A((hV,T0)=>{var x2=oe("path"),T2=x0(),A2=new Set(T2);T0.exports=t=>A2.has(x2.extname(t).slice(1).toLowerCase());});var tu=A(ge=>{var{sep:P2}=oe("path"),{platform:md}=process,D2=oe("os");ge.EV_ALL="all";ge.EV_READY="ready";ge.EV_ADD="add";ge.EV_CHANGE="change";ge.EV_ADD_DIR="addDir";ge.EV_UNLINK="unlink";ge.EV_UNLINK_DIR="unlinkDir";ge.EV_RAW="raw";ge.EV_ERROR="error";ge.STR_DATA="data";ge.STR_END="end";ge.STR_CLOSE="close";ge.FSEVENT_CREATED="created";ge.FSEVENT_MODIFIED="modified";ge.FSEVENT_DELETED="deleted";ge.FSEVENT_MOVED="moved";ge.FSEVENT_CLONED="cloned";ge.FSEVENT_UNKNOWN="unknown";ge.FSEVENT_TYPE_FILE="file";ge.FSEVENT_TYPE_DIRECTORY="directory";ge.FSEVENT_TYPE_SYMLINK="symlink";ge.KEY_LISTENERS="listeners";ge.KEY_ERR="errHandlers";ge.KEY_RAW="rawEmitters";ge.HANDLER_KEYS=[ge.KEY_LISTENERS,ge.KEY_ERR,ge.KEY_RAW];ge.DOT_SLASH=`.${P2}`;ge.BACK_SLASH_RE=/\\/g;ge.DOUBLE_SLASH_RE=/\/\//;ge.SLASH_OR_BACK_SLASH_RE=/[/\\]/;ge.DOT_RE=/\..*\.(sw[px])$|~$|\.subl.*\.tmp/;ge.REPLACER_RE=/^\.[/\\]/;ge.SLASH="/";ge.SLASH_SLASH="//";ge.BRACE_START="{";ge.BANG="!";ge.ONE_DOT=".";ge.TWO_DOTS="..";ge.STAR="*";ge.GLOBSTAR="**";ge.ROOT_GLOBSTAR="/**/*";ge.SLASH_GLOBSTAR="/**";ge.DIR_SUFFIX="Dir";ge.ANYMATCH_OPTS={dot:!0};ge.STRING_TYPE="string";ge.FUNCTION_TYPE="function";ge.EMPTY_STR="";ge.EMPTY_FN=()=>{};ge.IDENTITY_FN=t=>t;ge.isWindows=md==="win32";ge.isMacos=md==="darwin";ge.isLinux=md==="linux";ge.isIBMi=D2.type()==="OS400";});var M0=A((mV,k0)=>{var sn=oe("fs"),bt=oe("path"),{promisify:no}=oe("util"),O2=A0(),{isWindows:I2,isLinux:k2,EMPTY_FN:M2,EMPTY_STR:F2,KEY_LISTENERS:Wi,KEY_ERR:gd,KEY_RAW:eo,HANDLER_KEYS:N2,EV_CHANGE:nu,EV_ADD:ru,EV_ADD_DIR:q2,EV_ERROR:D0,STR_DATA:L2,STR_END:$2,BRACE_START:j2,STAR:H2}=tu(),W2="watch",B2=no(sn.open),O0=no(sn.stat),U2=no(sn.lstat),z2=no(sn.close),_d=no(sn.realpath),V2={lstat:U2,stat:O0},bd=(t,e)=>{t instanceof Set?t.forEach(e):e(t);},to=(t,e,r)=>{let n=t[e];n instanceof Set||(t[e]=n=new Set([n])),n.add(r);},G2=t=>e=>{let r=t[e];r instanceof Set?r.clear():delete t[e];},ro=(t,e,r)=>{let n=t[e];n instanceof Set?n.delete(r):n===r&&delete t[e];},I0=t=>t instanceof Set?t.size===0:!t,iu=new Map;function P0(t,e,r,n,i){let s=(o,a)=>{r(t),i(o,a,{watchedPath:t}),a&&t!==a&&su(bt.resolve(t,a),Wi,bt.join(t,a));};try{return sn.watch(t,e,s)}catch(o){n(o);}}var su=(t,e,r,n,i)=>{let s=iu.get(t);s&&bd(s[e],o=>{o(r,n,i);});},K2=(t,e,r,n)=>{let{listener:i,errHandler:s,rawEmitter:o}=n,a=iu.get(e),l;if(!r.persistent)return l=P0(t,r,i,s,o),l.close.bind(l);if(a)to(a,Wi,i),to(a,gd,s),to(a,eo,o);else {if(l=P0(t,r,su.bind(null,e,Wi),s,su.bind(null,e,eo)),!l)return;l.on(D0,async d=>{let c=su.bind(null,e,gd);if(a.watcherUnusable=!0,I2&&d.code==="EPERM")try{let p=await B2(t,"r");await z2(p),c(d);}catch{}else c(d);}),a={listeners:i,errHandlers:s,rawEmitters:o,watcher:l},iu.set(e,a);}return ()=>{ro(a,Wi,i),ro(a,gd,s),ro(a,eo,o),I0(a.listeners)&&(a.watcher.close(),iu.delete(e),N2.forEach(G2(a)),a.watcher=void 0,Object.freeze(a));}},yd=new Map,Z2=(t,e,r,n)=>{let {listener:i,rawEmitter:s}=n,o=yd.get(e),d=o&&o.options;return d&&(d.persistentr.interval)&&(sn.unwatchFile(e),o=void 0),o?(to(o,Wi,i),to(o,eo,s)):(o={listeners:i,rawEmitters:s,options:r,watcher:sn.watchFile(e,r,(c,p)=>{bd(o.rawEmitters,_=>{_(nu,e,{curr:c,prev:p});});let m=c.mtimeMs;(c.size!==p.size||m>p.mtimeMs||m===0)&&bd(o.listeners,_=>_(t,c));})},yd.set(e,o)),()=>{ro(o,Wi,i),ro(o,eo,s),I0(o.listeners)&&(yd.delete(e),sn.unwatchFile(e),o.options=o.watcher=void 0,Object.freeze(o));}},vd=class{constructor(e){this.fsw=e,this._boundHandleError=r=>e._handleError(r);}_watchWithNodeFs(e,r){let n=this.fsw.options,i=bt.dirname(e),s=bt.basename(e);this.fsw._getWatchedDir(i).add(s);let a=bt.resolve(e),l={persistent:n.persistent};r||(r=M2);let d;return n.usePolling?(l.interval=n.enableBinaryInterval&&O2(s)?n.binaryInterval:n.interval,d=Z2(e,a,l,{listener:r,rawEmitter:this.fsw._emitRaw})):d=K2(e,a,l,{listener:r,errHandler:this._boundHandleError,rawEmitter:this.fsw._emitRaw}),d}_handleFile(e,r,n){if(this.fsw.closed)return;let i=bt.dirname(e),s=bt.basename(e),o=this.fsw._getWatchedDir(i),a=r;if(o.has(s))return;let l=async(c,p)=>{if(this.fsw._throttle(W2,e,5)){if(!p||p.mtimeMs===0)try{let m=await O0(e);if(this.fsw.closed)return;let _=m.atimeMs,w=m.mtimeMs;(!_||_<=w||w!==a.mtimeMs)&&this.fsw._emit(nu,e,m),k2&&a.ino!==m.ino?(this.fsw._closeFile(c),a=m,this.fsw._addPathCloser(c,this._watchWithNodeFs(e,l))):a=m;}catch{this.fsw._remove(i,s);}else if(o.has(s)){let m=p.atimeMs,_=p.mtimeMs;(!m||m<=_||_!==a.mtimeMs)&&this.fsw._emit(nu,e,p),a=p;}}},d=this._watchWithNodeFs(e,l);if(!(n&&this.fsw.options.ignoreInitial)&&this.fsw._isntIgnored(e)){if(!this.fsw._throttle(ru,e,0))return;this.fsw._emit(ru,e,r);}return d}async _handleSymlink(e,r,n,i){if(this.fsw.closed)return;let s=e.fullPath,o=this.fsw._getWatchedDir(r);if(!this.fsw.options.followSymlinks){this.fsw._incrReadyCount();let a;try{a=await _d(n);}catch{return this.fsw._emitReady(),!0}return this.fsw.closed?void 0:(o.has(i)?this.fsw._symlinkPaths.get(s)!==a&&(this.fsw._symlinkPaths.set(s,a),this.fsw._emit(nu,n,e.stats)):(o.add(i),this.fsw._symlinkPaths.set(s,a),this.fsw._emit(ru,n,e.stats)),this.fsw._emitReady(),!0)}if(this.fsw._symlinkPaths.has(s))return !0;this.fsw._symlinkPaths.set(s,!0);}_handleRead(e,r,n,i,s,o,a){if(e=bt.join(e,F2),!n.hasGlob&&(a=this.fsw._throttle("readdir",e,1e3),!a))return;let l=this.fsw._getWatchedDir(n.path),d=new Set,c=this.fsw._readdirp(e,{fileFilter:p=>n.filterPath(p),directoryFilter:p=>n.filterDir(p),depth:0}).on(L2,async p=>{if(this.fsw.closed){c=void 0;return}let m=p.path,_=bt.join(e,m);if(d.add(m),!(p.stats.isSymbolicLink()&&await this._handleSymlink(p,e,_,m))){if(this.fsw.closed){c=void 0;return}(m===i||!i&&!l.has(m))&&(this.fsw._incrReadyCount(),_=bt.join(s,bt.relative(s,_)),this._addToNodeFs(_,r,n,o+1));}}).on(D0,this._boundHandleError);return new Promise(p=>c.once($2,()=>{if(this.fsw.closed){c=void 0;return}let m=a?a.clear():!1;p(),l.getChildren().filter(_=>_!==e&&!d.has(_)&&(!n.hasGlob||n.filterPath({fullPath:bt.resolve(e,_)}))).forEach(_=>{this.fsw._remove(e,_);}),c=void 0,m&&this._handleRead(e,!1,n,i,s,o,a);}))}async _handleDir(e,r,n,i,s,o,a){let l=this.fsw._getWatchedDir(bt.dirname(e)),d=l.has(bt.basename(e));!(n&&this.fsw.options.ignoreInitial)&&!s&&!d&&(!o.hasGlob||o.globFilter(e))&&this.fsw._emit(q2,e,r),l.add(bt.basename(e)),this.fsw._getWatchedDir(e);let c,p,m=this.fsw.options.depth;if((m==null||i<=m)&&!this.fsw._symlinkPaths.has(a)){if(!s&&(await this._handleRead(e,n,o,s,e,i,c),this.fsw.closed))return;p=this._watchWithNodeFs(e,(_,w)=>{w&&w.mtimeMs===0||this._handleRead(_,!1,o,s,e,i,c);});}return p}async _addToNodeFs(e,r,n,i,s){let o=this.fsw._emitReady;if(this.fsw._isIgnored(e)||this.fsw.closed)return o(),!1;let a=this.fsw._getWatchHelpers(e,i);!a.hasGlob&&n&&(a.hasGlob=n.hasGlob,a.globFilter=n.globFilter,a.filterPath=l=>n.filterPath(l),a.filterDir=l=>n.filterDir(l));try{let l=await V2[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,l))return o(),!1;let d=this.fsw.options.followSymlinks&&!e.includes(H2)&&!e.includes(j2),c;if(l.isDirectory()){let p=bt.resolve(e),m=d?await _d(e):e;if(this.fsw.closed||(c=await this._handleDir(a.watchPath,l,r,i,s,a,m),this.fsw.closed))return;p!==m&&m!==void 0&&this.fsw._symlinkPaths.set(p,m);}else if(l.isSymbolicLink()){let p=d?await _d(e):e;if(this.fsw.closed)return;let m=bt.dirname(a.watchPath);if(this.fsw._getWatchedDir(m).add(a.watchPath),this.fsw._emit(ru,a.watchPath,l),c=await this._handleDir(m,l,r,i,e,a,p),this.fsw.closed)return;p!==void 0&&this.fsw._symlinkPaths.set(bt.resolve(e),p);}else c=this._handleFile(a.watchPath,l,r);return o(),this.fsw._addPathCloser(e,c),!1}catch(l){if(this.fsw._handleError(l))return o(),e}}};k0.exports=vd;});var H0=A((gV,Ad)=>{var xd=oe("fs"),vt=oe("path"),{promisify:Td}=oe("util"),Bi;try{Bi=oe("fsevents");}catch(t){process.env.CHOKIDAR_PRINT_FSEVENTS_REQUIRE_ERROR&&console.error(t);}if(Bi){let t=process.version.match(/v(\d+)\.(\d+)/);if(t&&t[1]&&t[2]){let e=Number.parseInt(t[1],10),r=Number.parseInt(t[2],10);e===8&&r<16&&(Bi=void 0);}}var{EV_ADD:wd,EV_CHANGE:J2,EV_ADD_DIR:F0,EV_UNLINK:ou,EV_ERROR:Y2,STR_DATA:X2,STR_END:Q2,FSEVENT_CREATED:e$,FSEVENT_MODIFIED:t$,FSEVENT_DELETED:r$,FSEVENT_MOVED:n$,FSEVENT_UNKNOWN:i$,FSEVENT_TYPE_FILE:s$,FSEVENT_TYPE_DIRECTORY:io,FSEVENT_TYPE_SYMLINK:j0,ROOT_GLOBSTAR:N0,DIR_SUFFIX:o$,DOT_SLASH:q0,FUNCTION_TYPE:Sd,EMPTY_FN:a$,IDENTITY_FN:u$}=tu(),c$=t=>isNaN(t)?{}:{depth:t},Rd=Td(xd.stat),l$=Td(xd.lstat),L0=Td(xd.realpath),f$={stat:Rd,lstat:l$},ti=new Map,d$=10,h$=new Set([69888,70400,71424,72704,73472,131328,131840,262912]),p$=(t,e)=>({stop:Bi.watch(t,e)});function m$(t,e,r,n){let i=vt.extname(e)?vt.dirname(e):e,s=vt.dirname(i),o=ti.get(i);g$(s)&&(i=s);let a=vt.resolve(t),l=a!==e,d=(p,m,_)=>{l&&(p=p.replace(e,a)),(p===a||!p.indexOf(a+vt.sep))&&r(p,m,_);},c=!1;for(let p of ti.keys())if(e.indexOf(vt.resolve(p)+vt.sep)===0){i=p,o=ti.get(i),c=!0;break}return o||c?o.listeners.add(d):(o={listeners:new Set([d]),rawEmitter:n,watcher:p$(i,(p,m)=>{if(!o.listeners.size)return;let _=Bi.getInfo(p,m);o.listeners.forEach(w=>{w(p,m,_);}),o.rawEmitter(_.event,p,_);})},ti.set(i,o)),()=>{let p=o.listeners;if(p.delete(d),!p.size&&(ti.delete(i),o.watcher))return o.watcher.stop().then(()=>{o.rawEmitter=o.watcher=void 0,Object.freeze(o);})}}var g$=t=>{let e=0;for(let r of ti.keys())if(r.indexOf(t)===0&&(e++,e>=d$))return !0;return !1},_$=()=>Bi&&ti.size<128,Ed=(t,e)=>{let r=0;for(;!t.indexOf(e)&&(t=vt.dirname(t))!==e;)r++;return r},$0=(t,e)=>t.type===io&&e.isDirectory()||t.type===j0&&e.isSymbolicLink()||t.type===s$&&e.isFile(),Cd=class{constructor(e){this.fsw=e;}checkIgnored(e,r){let n=this.fsw._ignoredPaths;if(this.fsw._isIgnored(e,r))return n.add(e),r&&r.isDirectory()&&n.add(e+N0),!0;n.delete(e),n.delete(e+N0);}addOrChange(e,r,n,i,s,o,a,l){let d=s.has(o)?J2:wd;this.handleEvent(d,e,r,n,i,s,o,a,l);}async checkExists(e,r,n,i,s,o,a,l){try{let d=await Rd(e);if(this.fsw.closed)return;$0(a,d)?this.addOrChange(e,r,n,i,s,o,a,l):this.handleEvent(ou,e,r,n,i,s,o,a,l);}catch(d){d.code==="EACCES"?this.addOrChange(e,r,n,i,s,o,a,l):this.handleEvent(ou,e,r,n,i,s,o,a,l);}}handleEvent(e,r,n,i,s,o,a,l,d){if(!(this.fsw.closed||this.checkIgnored(r)))if(e===ou){let c=l.type===io;(c||o.has(a))&&this.fsw._remove(s,a,c);}else {if(e===wd){if(l.type===io&&this.fsw._getWatchedDir(r),l.type===j0&&d.followSymlinks){let p=d.depth===void 0?void 0:Ed(n,i)+1;return this._addToFsEvents(r,!1,!0,p)}this.fsw._getWatchedDir(s).add(a);}let c=l.type===io?e+o$:e;this.fsw._emit(c,r),c===F0&&this._addToFsEvents(r,!1,!0);}}_watchWithFsEvents(e,r,n,i){if(this.fsw.closed||this.fsw._isIgnored(e))return;let s=this.fsw.options,a=m$(e,r,async(l,d,c)=>{if(this.fsw.closed||s.depth!==void 0&&Ed(l,r)>s.depth)return;let p=n(vt.join(e,vt.relative(e,l)));if(i&&!i(p))return;let m=vt.dirname(p),_=vt.basename(p),w=this.fsw._getWatchedDir(c.type===io?p:m);if(h$.has(d)||c.event===i$)if(typeof s.ignored===Sd){let E;try{E=await Rd(p);}catch{}if(this.fsw.closed||this.checkIgnored(p,E))return;$0(c,E)?this.addOrChange(p,l,r,m,w,_,c,s):this.handleEvent(ou,p,l,r,m,w,_,c,s);}else this.checkExists(p,l,r,m,w,_,c,s);else switch(c.event){case e$:case t$:return this.addOrChange(p,l,r,m,w,_,c,s);case r$:case n$:return this.checkExists(p,l,r,m,w,_,c,s)}},this.fsw._emitRaw);return this.fsw._emitReady(),a}async _handleFsEventsSymlink(e,r,n,i){if(!(this.fsw.closed||this.fsw._symlinkPaths.has(r))){this.fsw._symlinkPaths.set(r,!0),this.fsw._incrReadyCount();try{let s=await L0(e);if(this.fsw.closed)return;if(this.fsw._isIgnored(s))return this.fsw._emitReady();this.fsw._incrReadyCount(),this._addToFsEvents(s||e,o=>{let a=e;return s&&s!==q0?a=o.replace(s,e):o!==q0&&(a=vt.join(e,o)),n(a)},!1,i);}catch(s){if(this.fsw._handleError(s))return this.fsw._emitReady()}}}emitAdd(e,r,n,i,s){let o=n(e),a=r.isDirectory(),l=this.fsw._getWatchedDir(vt.dirname(o)),d=vt.basename(o);a&&this.fsw._getWatchedDir(o),!l.has(d)&&(l.add(d),(!i.ignoreInitial||s===!0)&&this.fsw._emit(a?F0:wd,o,r));}initWatch(e,r,n,i){if(this.fsw.closed)return;let s=this._watchWithFsEvents(n.watchPath,vt.resolve(e||n.watchPath),i,n.globFilter);this.fsw._addPathCloser(r,s);}async _addToFsEvents(e,r,n,i){if(this.fsw.closed)return;let s=this.fsw.options,o=typeof r===Sd?r:u$,a=this.fsw._getWatchHelpers(e);try{let l=await f$[a.statMethod](a.watchPath);if(this.fsw.closed)return;if(this.fsw._isIgnored(a.watchPath,l))throw null;if(l.isDirectory()){if(a.globFilter||this.emitAdd(o(e),l,o,s,n),i&&i>s.depth)return;this.fsw._readdirp(a.watchPath,{fileFilter:d=>a.filterPath(d),directoryFilter:d=>a.filterDir(d),...c$(s.depth-(i||0))}).on(X2,d=>{if(this.fsw.closed||d.stats.isDirectory()&&!a.filterPath(d))return;let c=vt.join(a.watchPath,d.path),{fullPath:p}=d;if(a.followSymlinks&&d.stats.isSymbolicLink()){let m=s.depth===void 0?void 0:Ed(c,vt.resolve(a.watchPath))+1;this._handleFsEventsSymlink(c,p,o,m);}else this.emitAdd(c,d.stats,o,s,n);}).on(Y2,a$).on(Q2,()=>{this.fsw._emitReady();});}else this.emitAdd(a.watchPath,l,o,s,n),this.fsw._emitReady();}catch(l){(!l||this.fsw._handleError(l))&&(this.fsw._emitReady(),this.fsw._emitReady());}if(s.persistent&&n!==!0)if(typeof r===Sd)this.initWatch(void 0,e,a,o);else {let l;try{l=await L0(a.watchPath);}catch{}this.initWatch(l,e,a,o);}}};Ad.exports=Cd;Ad.exports.canUse=_$;});var Ud=A(Bd=>{var{EventEmitter:y$}=oe("events"),Hd=oe("fs"),Ue=oe("path"),{promisify:K0}=oe("util"),b$=TE(),Md=ME().default,v$=jE(),Pd=ud(),w$=E0(),S$=od(),E$=M0(),W0=H0(),{EV_ALL:Dd,EV_READY:R$,EV_ADD:au,EV_CHANGE:so,EV_UNLINK:B0,EV_ADD_DIR:C$,EV_UNLINK_DIR:x$,EV_RAW:T$,EV_ERROR:Od,STR_CLOSE:A$,STR_END:P$,BACK_SLASH_RE:D$,DOUBLE_SLASH_RE:U0,SLASH_OR_BACK_SLASH_RE:O$,DOT_RE:I$,REPLACER_RE:k$,SLASH:Id,SLASH_SLASH:M$,BRACE_START:F$,BANG:Fd,ONE_DOT:Z0,TWO_DOTS:N$,GLOBSTAR:q$,SLASH_GLOBSTAR:kd,ANYMATCH_OPTS:Nd,STRING_TYPE:Wd,FUNCTION_TYPE:L$,EMPTY_STR:qd,EMPTY_FN:$$,isWindows:j$,isMacos:H$,isIBMi:W$}=tu(),B$=K0(Hd.stat),U$=K0(Hd.readdir),Ld=(t=[])=>Array.isArray(t)?t:[t],J0=(t,e=[])=>(t.forEach(r=>{Array.isArray(r)?J0(r,e):e.push(r);}),e),z0=t=>{let e=J0(Ld(t));if(!e.every(r=>typeof r===Wd))throw new TypeError(`Non-string provided as watch path: ${e}`);return e.map(Y0)},V0=t=>{let e=t.replace(D$,Id),r=!1;for(e.startsWith(M$)&&(r=!0);e.match(U0);)e=e.replace(U0,Id);return r&&(e=Id+e),e},Y0=t=>V0(Ue.normalize(V0(t))),G0=(t=qd)=>e=>typeof e!==Wd?e:Y0(Ue.isAbsolute(e)?e:Ue.join(t,e)),z$=(t,e)=>Ue.isAbsolute(t)?t:t.startsWith(Fd)?Fd+Ue.join(e,t.slice(1)):Ue.join(e,t),Or=(t,e)=>t[e]===void 0,$d=class{constructor(e,r){this.path=e,this._removeWatcher=r,this.items=new Set;}add(e){let{items:r}=this;r&&e!==Z0&&e!==N$&&r.add(e);}async remove(e){let{items:r}=this;if(!r||(r.delete(e),r.size>0))return;let n=this.path;try{await U$(n);}catch{this._removeWatcher&&this._removeWatcher(Ue.dirname(n),Ue.basename(n));}}has(e){let{items:r}=this;if(r)return r.has(e)}getChildren(){let{items:e}=this;if(e)return [...e.values()]}dispose(){this.items.clear(),delete this.path,delete this._removeWatcher,delete this.items,Object.freeze(this);}},V$="stat",G$="lstat",jd=class{constructor(e,r,n,i){this.fsw=i,this.path=e=e.replace(k$,qd),this.watchPath=r,this.fullWatchPath=Ue.resolve(r),this.hasGlob=r!==e,e===qd&&(this.hasGlob=!1),this.globSymlink=this.hasGlob&&n?void 0:!1,this.globFilter=this.hasGlob?Md(e,void 0,Nd):!1,this.dirParts=this.getDirParts(e),this.dirParts.forEach(s=>{s.length>1&&s.pop();}),this.followSymlinks=n,this.statMethod=n?V$:G$;}checkGlobSymlink(e){return this.globSymlink===void 0&&(this.globSymlink=e.fullParentDir===this.fullWatchPath?!1:{realPath:e.fullParentDir,linkPath:this.fullWatchPath}),this.globSymlink?e.fullPath.replace(this.globSymlink.realPath,this.globSymlink.linkPath):e.fullPath}entryPath(e){return Ue.join(this.watchPath,Ue.relative(this.watchPath,this.checkGlobSymlink(e)))}filterPath(e){let{stats:r}=e;if(r&&r.isSymbolicLink())return this.filterDir(e);let n=this.entryPath(e);return (this.hasGlob&&typeof this.globFilter===L$?this.globFilter(n):!0)&&this.fsw._isntIgnored(n,r)&&this.fsw._hasReadPermissions(r)}getDirParts(e){if(!this.hasGlob)return [];let r=[];return (e.includes(F$)?w$.expand(e):[e]).forEach(i=>{r.push(Ue.relative(this.watchPath,i).split(O$));}),r}filterDir(e){if(this.hasGlob){let r=this.getDirParts(this.checkGlobSymlink(e)),n=!1;this.unmatchedGlob=!this.dirParts.some(i=>i.every((s,o)=>(s===q$&&(n=!0),n||!r[0][o]||Md(s,r[0][o],Nd))));}return !this.unmatchedGlob&&this.fsw._isntIgnored(this.entryPath(e),e.stats)}},uu=class extends y${constructor(e){super();let r={};e&&Object.assign(r,e),this._watched=new Map,this._closers=new Map,this._ignoredPaths=new Set,this._throttled=new Map,this._symlinkPaths=new Map,this._streams=new Set,this.closed=!1,Or(r,"persistent")&&(r.persistent=!0),Or(r,"ignoreInitial")&&(r.ignoreInitial=!1),Or(r,"ignorePermissionErrors")&&(r.ignorePermissionErrors=!1),Or(r,"interval")&&(r.interval=100),Or(r,"binaryInterval")&&(r.binaryInterval=300),Or(r,"disableGlobbing")&&(r.disableGlobbing=!1),r.enableBinaryInterval=r.binaryInterval!==r.interval,Or(r,"useFsEvents")&&(r.useFsEvents=!r.usePolling),W0.canUse()||(r.useFsEvents=!1),Or(r,"usePolling")&&!r.useFsEvents&&(r.usePolling=H$),W$&&(r.usePolling=!0);let i=process.env.CHOKIDAR_USEPOLLING;if(i!==void 0){let l=i.toLowerCase();l==="false"||l==="0"?r.usePolling=!1:l==="true"||l==="1"?r.usePolling=!0:r.usePolling=!!l;}let s=process.env.CHOKIDAR_INTERVAL;s&&(r.interval=Number.parseInt(s,10)),Or(r,"atomic")&&(r.atomic=!r.usePolling&&!r.useFsEvents),r.atomic&&(this._pendingUnlinks=new Map),Or(r,"followSymlinks")&&(r.followSymlinks=!0),Or(r,"awaitWriteFinish")&&(r.awaitWriteFinish=!1),r.awaitWriteFinish===!0&&(r.awaitWriteFinish={});let o=r.awaitWriteFinish;o&&(o.stabilityThreshold||(o.stabilityThreshold=2e3),o.pollInterval||(o.pollInterval=100),this._pendingWrites=new Map),r.ignored&&(r.ignored=Ld(r.ignored));let a=0;this._emitReady=()=>{a++,a>=this._readyCount&&(this._emitReady=$$,this._readyEmitted=!0,process.nextTick(()=>this.emit(R$)));},this._emitRaw=(...l)=>this.emit(T$,...l),this._readyEmitted=!1,this.options=r,r.useFsEvents?this._fsEventsHandler=new W0(this):this._nodeFsHandler=new E$(this),Object.freeze(r);}add(e,r,n){let{cwd:i,disableGlobbing:s}=this.options;this.closed=!1;let o=z0(e);return i&&(o=o.map(a=>{let l=z$(a,i);return s||!Pd(a)?l:S$(l)})),o=o.filter(a=>a.startsWith(Fd)?(this._ignoredPaths.add(a.slice(1)),!1):(this._ignoredPaths.delete(a),this._ignoredPaths.delete(a+kd),this._userIgnored=void 0,!0)),this.options.useFsEvents&&this._fsEventsHandler?(this._readyCount||(this._readyCount=o.length),this.options.persistent&&(this._readyCount*=2),o.forEach(a=>this._fsEventsHandler._addToFsEvents(a))):(this._readyCount||(this._readyCount=0),this._readyCount+=o.length,Promise.all(o.map(async a=>{let l=await this._nodeFsHandler._addToNodeFs(a,!n,0,0,r);return l&&this._emitReady(),l})).then(a=>{this.closed||a.filter(l=>l).forEach(l=>{this.add(Ue.dirname(l),Ue.basename(r||l));});})),this}unwatch(e){if(this.closed)return this;let r=z0(e),{cwd:n}=this.options;return r.forEach(i=>{!Ue.isAbsolute(i)&&!this._closers.has(i)&&(n&&(i=Ue.join(n,i)),i=Ue.resolve(i)),this._closePath(i),this._ignoredPaths.add(i),this._watched.has(i)&&this._ignoredPaths.add(i+kd),this._userIgnored=void 0;}),this}close(){if(this.closed)return this._closePromise;this.closed=!0,this.removeAllListeners();let e=[];return this._closers.forEach(r=>r.forEach(n=>{let i=n();i instanceof Promise&&e.push(i);})),this._streams.forEach(r=>r.destroy()),this._userIgnored=void 0,this._readyCount=0,this._readyEmitted=!1,this._watched.forEach(r=>r.dispose()),["closers","watched","streams","symlinkPaths","throttled"].forEach(r=>{this[`_${r}`].clear();}),this._closePromise=e.length?Promise.all(e).then(()=>{}):Promise.resolve(),this._closePromise}getWatched(){let e={};return this._watched.forEach((r,n)=>{let i=this.options.cwd?Ue.relative(this.options.cwd,n):n;e[i||Z0]=r.getChildren().sort();}),e}emitWithAll(e,r){this.emit(...r),e!==Od&&this.emit(Dd,...r);}async _emit(e,r,n,i,s){if(this.closed)return;let o=this.options;j$&&(r=Ue.normalize(r)),o.cwd&&(r=Ue.relative(o.cwd,r));let a=[e,r];s!==void 0?a.push(n,i,s):i!==void 0?a.push(n,i):n!==void 0&&a.push(n);let l=o.awaitWriteFinish,d;if(l&&(d=this._pendingWrites.get(r)))return d.lastChange=new Date,this;if(o.atomic){if(e===B0)return this._pendingUnlinks.set(r,a),setTimeout(()=>{this._pendingUnlinks.forEach((c,p)=>{this.emit(...c),this.emit(Dd,...c),this._pendingUnlinks.delete(p);});},typeof o.atomic=="number"?o.atomic:100),this;e===au&&this._pendingUnlinks.has(r)&&(e=a[0]=so,this._pendingUnlinks.delete(r));}if(l&&(e===au||e===so)&&this._readyEmitted){let c=(p,m)=>{p?(e=a[0]=Od,a[1]=p,this.emitWithAll(e,a)):m&&(a.length>2?a[2]=m:a.push(m),this.emitWithAll(e,a));};return this._awaitWriteFinish(r,l.stabilityThreshold,e,c),this}if(e===so&&!this._throttle(so,r,50))return this;if(o.alwaysStat&&n===void 0&&(e===au||e===C$||e===so)){let c=o.cwd?Ue.join(o.cwd,r):r,p;try{p=await B$(c);}catch{}if(!p||this.closed)return;a.push(p);}return this.emitWithAll(e,a),this}_handleError(e){let r=e&&e.code;return e&&r!=="ENOENT"&&r!=="ENOTDIR"&&(!this.options.ignorePermissionErrors||r!=="EPERM"&&r!=="EACCES")&&this.emit(Od,e),e||this.closed}_throttle(e,r,n){this._throttled.has(e)||this._throttled.set(e,new Map);let i=this._throttled.get(e),s=i.get(r);if(s)return s.count++,!1;let o,a=()=>{let d=i.get(r),c=d?d.count:0;return i.delete(r),clearTimeout(o),d&&clearTimeout(d.timeoutObject),c};o=setTimeout(a,n);let l={timeoutObject:o,clear:a,count:0};return i.set(r,l),l}_incrReadyCount(){return this._readyCount++}_awaitWriteFinish(e,r,n,i){let s,o=e;this.options.cwd&&!Ue.isAbsolute(e)&&(o=Ue.join(this.options.cwd,e));let a=new Date,l=d=>{Hd.stat(o,(c,p)=>{if(c||!this._pendingWrites.has(e)){c&&c.code!=="ENOENT"&&i(c);return}let m=Number(new Date);d&&p.size!==d.size&&(this._pendingWrites.get(e).lastChange=m);let _=this._pendingWrites.get(e);m-_.lastChange>=r?(this._pendingWrites.delete(e),i(void 0,p)):s=setTimeout(l,this.options.awaitWriteFinish.pollInterval,p);});};this._pendingWrites.has(e)||(this._pendingWrites.set(e,{lastChange:a,cancelWait:()=>(this._pendingWrites.delete(e),clearTimeout(s),n)}),s=setTimeout(l,this.options.awaitWriteFinish.pollInterval));}_getGlobIgnored(){return [...this._ignoredPaths.values()]}_isIgnored(e,r){if(this.options.atomic&&I$.test(e))return !0;if(!this._userIgnored){let{cwd:n}=this.options,i=this.options.ignored,s=i&&i.map(G0(n)),o=Ld(s).filter(l=>typeof l===Wd&&!Pd(l)).map(l=>l+kd),a=this._getGlobIgnored().map(G0(n)).concat(s,o);this._userIgnored=Md(a,void 0,Nd);}return this._userIgnored([e,r])}_isntIgnored(e,r){return !this._isIgnored(e,r)}_getWatchHelpers(e,r){let n=r||this.options.disableGlobbing||!Pd(e)?e:v$(e),i=this.options.followSymlinks;return new jd(e,n,i,this)}_getWatchedDir(e){this._boundRemove||(this._boundRemove=this._remove.bind(this));let r=Ue.resolve(e);return this._watched.has(r)||this._watched.set(r,new $d(r,this._boundRemove)),this._watched.get(r)}_hasReadPermissions(e){if(this.options.ignorePermissionErrors)return !0;let n=(e&&Number.parseInt(e.mode,10))&511;return !!(4&Number.parseInt(n.toString(8)[0],10))}_remove(e,r,n){let i=Ue.join(e,r),s=Ue.resolve(i);if(n=n??(this._watched.has(i)||this._watched.has(s)),!this._throttle("remove",i,100))return;!n&&!this.options.useFsEvents&&this._watched.size===1&&this.add(e,r,!0),this._getWatchedDir(i).getChildren().forEach(m=>this._remove(i,m));let l=this._getWatchedDir(e),d=l.has(r);l.remove(r),this._symlinkPaths.has(s)&&this._symlinkPaths.delete(s);let c=i;if(this.options.cwd&&(c=Ue.relative(this.options.cwd,i)),this.options.awaitWriteFinish&&this._pendingWrites.has(c)&&this._pendingWrites.get(c).cancelWait()===au)return;this._watched.delete(i),this._watched.delete(s);let p=n?x$:B0;d&&!this._isIgnored(i)&&this._emit(p,i),this.options.useFsEvents||this._closePath(i);}_closePath(e){this._closeFile(e);let r=Ue.dirname(e);this._getWatchedDir(r).remove(Ue.basename(e));}_closeFile(e){let r=this._closers.get(e);r&&(r.forEach(n=>n()),this._closers.delete(e));}_addPathCloser(e,r){if(!r)return;let n=this._closers.get(e);n||(n=[],this._closers.set(e,n)),n.push(r);}_readdirp(e,r){if(this.closed)return;let n={type:Dd,alwaysStat:!0,lstat:!0,...r},i=b$(e,n);return this._streams.add(i),i.once(A$,()=>{i=void 0;}),i.once(P$,()=>{i&&(this._streams.delete(i),i=void 0);}),i}};Bd.FSWatcher=uu;var K$=(t,e)=>{let r=new uu(e);return r.add(t),r};Bd.watch=K$;});var Zd=A((RV,nR)=>{var oo=t=>t&&typeof t.message=="string",Kd=t=>{if(!t)return;let e=t.cause;if(typeof e=="function"){let r=t.cause();return oo(r)?r:void 0}else return oo(e)?e:void 0},tR=(t,e)=>{if(!oo(t))return "";let r=t.stack||"";if(e.has(t))return r+` +causes have become circular...`;let n=Kd(t);return n?(e.add(t),r+` +caused by: `+tR(n,e)):r},X$=t=>tR(t,new Set),rR=(t,e,r)=>{if(!oo(t))return "";let n=r?"":t.message||"";if(e.has(t))return n+": ...";let i=Kd(t);if(i){e.add(t);let s=typeof t.cause=="function";return n+(s?"":": ")+rR(i,e,s)}else return n},Q$=t=>rR(t,new Set);nR.exports={isErrorLike:oo,getErrorCause:Kd,stackWithCauses:X$,messageWithCauses:Q$};});var Jd=A((CV,sR)=>{var ej=Symbol("circular-ref-tag"),cu=Symbol("pino-raw-err-ref"),iR=Object.create({},{type:{enumerable:!0,writable:!0,value:void 0},message:{enumerable:!0,writable:!0,value:void 0},stack:{enumerable:!0,writable:!0,value:void 0},aggregateErrors:{enumerable:!0,writable:!0,value:void 0},raw:{enumerable:!1,get:function(){return this[cu]},set:function(t){this[cu]=t;}}});Object.defineProperty(iR,cu,{writable:!0,value:{}});sR.exports={pinoErrProto:iR,pinoErrorSymbols:{seen:ej,rawSymbol:cu}};});var uR=A((xV,aR)=>{aR.exports=Xd;var{messageWithCauses:tj,stackWithCauses:rj,isErrorLike:oR}=Zd(),{pinoErrProto:nj,pinoErrorSymbols:ij}=Jd(),{seen:Yd}=ij,{toString:sj}=Object.prototype;function Xd(t){if(!oR(t))return t;t[Yd]=void 0;let e=Object.create(nj);e.type=sj.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=tj(t),e.stack=rj(t),Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>Xd(r)));for(let r in t)if(e[r]===void 0){let n=t[r];oR(n)?r!=="cause"&&!Object.prototype.hasOwnProperty.call(n,Yd)&&(e[r]=Xd(n)):e[r]=n;}return delete t[Yd],e.raw=t,e}});var lR=A((TV,cR)=>{cR.exports=fu;var{isErrorLike:Qd}=Zd(),{pinoErrProto:oj,pinoErrorSymbols:aj}=Jd(),{seen:lu}=aj,{toString:uj}=Object.prototype;function fu(t){if(!Qd(t))return t;t[lu]=void 0;let e=Object.create(oj);e.type=uj.call(t.constructor)==="[object Function]"?t.constructor.name:t.name,e.message=t.message,e.stack=t.stack,Array.isArray(t.errors)&&(e.aggregateErrors=t.errors.map(r=>fu(r))),Qd(t.cause)&&!Object.prototype.hasOwnProperty.call(t.cause,lu)&&(e.cause=fu(t.cause));for(let r in t)if(e[r]===void 0){let n=t[r];Qd(n)?Object.prototype.hasOwnProperty.call(n,lu)||(e[r]=fu(n)):e[r]=n;}return delete t[lu],e.raw=t,e}});var pR=A((AV,hR)=>{hR.exports={mapHttpRequest:cj,reqSerializer:dR};var eh=Symbol("pino-raw-req-ref"),fR=Object.create({},{id:{enumerable:!0,writable:!0,value:""},method:{enumerable:!0,writable:!0,value:""},url:{enumerable:!0,writable:!0,value:""},query:{enumerable:!0,writable:!0,value:""},params:{enumerable:!0,writable:!0,value:""},headers:{enumerable:!0,writable:!0,value:{}},remoteAddress:{enumerable:!0,writable:!0,value:""},remotePort:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[eh]},set:function(t){this[eh]=t;}}});Object.defineProperty(fR,eh,{writable:!0,value:{}});function dR(t){let e=t.info||t.socket,r=Object.create(fR);if(r.id=typeof t.id=="function"?t.id():t.id||(t.info?t.info.id:void 0),r.method=t.method,t.originalUrl)r.url=t.originalUrl;else {let n=t.path;r.url=typeof n=="string"?n:t.url?t.url.path||t.url:void 0;}return t.query&&(r.query=t.query),t.params&&(r.params=t.params),r.headers=t.headers,r.remoteAddress=e&&e.remoteAddress,r.remotePort=e&&e.remotePort,r.raw=t.raw||t,r}function cj(t){return {req:dR(t)}}});var yR=A((PV,_R)=>{_R.exports={mapHttpResponse:lj,resSerializer:gR};var th=Symbol("pino-raw-res-ref"),mR=Object.create({},{statusCode:{enumerable:!0,writable:!0,value:0},headers:{enumerable:!0,writable:!0,value:""},raw:{enumerable:!1,get:function(){return this[th]},set:function(t){this[th]=t;}}});Object.defineProperty(mR,th,{writable:!0,value:{}});function gR(t){let e=Object.create(mR);return e.statusCode=t.headersSent?t.statusCode:null,e.headers=t.getHeaders?t.getHeaders():t._headers,e.raw=t,e}function lj(t){return {res:gR(t)}}});var nh=A((DV,bR)=>{var rh=uR(),fj=lR(),du=pR(),hu=yR();bR.exports={err:rh,errWithCause:fj,mapHttpRequest:du.mapHttpRequest,mapHttpResponse:hu.mapHttpResponse,req:du.reqSerializer,res:hu.resSerializer,wrapErrorSerializer:function(e){return e===rh?e:function(n){return e(rh(n))}},wrapRequestSerializer:function(e){return e===du.reqSerializer?e:function(n){return e(du.reqSerializer(n))}},wrapResponseSerializer:function(e){return e===hu.resSerializer?e:function(n){return e(hu.resSerializer(n))}}};});var ih=A((OV,vR)=>{function dj(t,e){return e}vR.exports=function(){let e=Error.prepareStackTrace;Error.prepareStackTrace=dj;let r=new Error().stack;if(Error.prepareStackTrace=e,!Array.isArray(r))return;let n=r.slice(2),i=[];for(let s of n)s&&i.push(s.getFileName());return i};});var SR=A((IV,wR)=>{wR.exports=hj;function hj(t={}){let{ERR_PATHS_MUST_BE_STRINGS:e=()=>"fast-redact - Paths must be (non-empty) strings",ERR_INVALID_PATH:r=n=>`fast-redact \u2013 Invalid path (${n})`}=t;return function({paths:i}){i.forEach(s=>{if(typeof s!="string")throw Error(e());try{if(/〇/.test(s))throw Error();let o=(s[0]==="["?"":".")+s.replace(/^\*/,"\u3007").replace(/\.\*/g,".\u3007").replace(/\[\*\]/g,"[\u3007]");if(/\n|\r|;/.test(o)||/\/\*/.test(o))throw Error();Function(` 'use strict' const o = new Proxy({}, { get: () => o, set: () => { throw Error() } }); const \u3007 = null; o${o} - if ([o${o}].length !== 1) throw Error()`)();}catch{throw Error(r(i))}});}}});var Es=x((PD,Rw)=>{Rw.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var Iw=x((OD,Tw)=>{var TO=Es();Tw.exports=IO;function IO({paths:t}){let e=[];var r=0;let n=t.reduce(function(s,i,o){var l=i.match(TO).map(u=>u.replace(/'|"|`/g,""));let f=i[0]==="[";l=l.map(u=>u[0]==="["?u.substr(1,u.length-2):u);let d=l.indexOf("*");if(d>-1){let u=l.slice(0,d),p=u.join("."),m=l.slice(d+1,l.length),g=m.length>0;r++,e.push({before:u,beforeStr:p,after:m,nested:g});}else s[i]={path:l,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(i),leadingBracket:f};return s},{});return {wildcards:e,wcLen:r,secret:n}}});var Ow=x((FD,Pw)=>{var PO=Es();Pw.exports=OO;function OO({secret:t,serialize:e,wcLen:r,strict:n,isCensorFct:s,censorFctTakesPath:i},o){let l=Function("o",` + if ([o${o}].length !== 1) throw Error()`)();}catch{throw Error(r(s))}});}}});var pu=A((kV,ER)=>{ER.exports=/[^.[\]]+|\[((?:.)*?)\]/g;});var CR=A((MV,RR)=>{var pj=pu();RR.exports=mj;function mj({paths:t}){let e=[];var r=0;let n=t.reduce(function(i,s,o){var a=s.match(pj).map(c=>c.replace(/'|"|`/g,""));let l=s[0]==="[";a=a.map(c=>c[0]==="["?c.substr(1,c.length-2):c);let d=a.indexOf("*");if(d>-1){let c=a.slice(0,d),p=c.join("."),m=a.slice(d+1,a.length),_=m.length>0;r++,e.push({before:c,beforeStr:p,after:m,nested:_});}else i[s]={path:a,val:void 0,precensored:!1,circle:"",escPath:JSON.stringify(s),leadingBracket:l};return i},{});return {wildcards:e,wcLen:r,secret:n}}});var TR=A((FV,xR)=>{var gj=pu();xR.exports=_j;function _j({secret:t,serialize:e,wcLen:r,strict:n,isCensorFct:i,censorFctTakesPath:s},o){let a=Function("o",` if (typeof o !== 'object' || o == null) { - ${kO(n,e)} + ${wj(n,e)} } const { censor, secret } = this - ${FO(t,s,i)} + ${yj(t,i,s)} this.compileRestore() - ${MO(r>0,s,i)} - ${NO(e)} - `).bind(o);return e===!1&&(l.restore=f=>o.restore(f)),l}function FO(t,e,r){return Object.keys(t).map(n=>{let{escPath:s,leadingBracket:i,path:o}=t[n],l=i?1:0,f=i?"":".",d=[];for(var u;(u=PO.exec(n))!==null;){let[,y]=u,{index:S,input:E}=u;S>l&&d.push(E.substring(0,S-(y?0:1)));}var p=d.map(y=>`o${f}${y}`).join(" && ");p.length===0?p+=`o${f}${n} != null`:p+=` && o${f}${n} != null`;let m=` + ${bj(r>0,i,s)} + ${vj(e)} + `).bind(o);return e===!1&&(a.restore=l=>o.restore(l)),a}function yj(t,e,r){return Object.keys(t).map(n=>{let{escPath:i,leadingBracket:s,path:o}=t[n],a=s?1:0,l=s?"":".",d=[];for(var c;(c=gj.exec(n))!==null;){let[,w]=c,{index:E,input:P}=c;E>a&&d.push(P.substring(0,E-(w?0:1)));}var p=d.map(w=>`o${l}${w}`).join(" && ");p.length===0?p+=`o${l}${n} != null`:p+=` && o${l}${n} != null`;let m=` switch (true) { - ${d.reverse().map(y=>` - case o${f}${y} === censor: - secret[${s}].circle = ${JSON.stringify(y)} + ${d.reverse().map(w=>` + case o${l}${w} === censor: + secret[${i}].circle = ${JSON.stringify(w)} break `).join(` `)} } - `,g=r?`val, ${JSON.stringify(o)}`:"val";return ` + `,_=r?`val, ${JSON.stringify(o)}`:"val";return ` if (${p}) { - const val = o${f}${n} + const val = o${l}${n} if (val === censor) { - secret[${s}].precensored = true + secret[${i}].precensored = true } else { - secret[${s}].val = val - o${f}${n} = ${e?`censor(${g})`:"censor"} + secret[${i}].val = val + o${l}${n} = ${e?`censor(${_})`:"censor"} ${m} } } `}).join(` -`)}function MO(t,e,r){return t===!0?` +`)}function bj(t,e,r){return t===!0?` { const { wildcards, wcLen, groupRedact, nestedRedact } = this for (var i = 0; i < wcLen; i++) { @@ -72,16 +72,16 @@ caused by: `+sw(n,e)):r},hO=t=>sw(t,new Set),ow=(t,e,r)=>{if(!Nn(t))return "";le } else secret[beforeStr] = groupRedact(o, before, censor, ${e}, ${r}) } } - `:""}function NO(t){return t===!1?"return o":` + `:""}function vj(t){return t===!1?"return o":` var s = this.serialize(o) this.restore(o) return s - `}function kO(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var Yl=x((MD,Nw)=>{Nw.exports={groupRedact:$O,groupRestore:LO,nestedRedact:qO,nestedRestore:DO};function LO({keys:t,values:e,target:r}){if(r==null)return;let n=t.length;for(var s=0;s0;o--)i=i[n[o]];i[n[0]]=s;}}function qO(t,e,r,n,s,i,o){let l=Fw(e,r);if(l==null)return;let f=Object.keys(l),d=f.length;for(var u=0;u{var{groupRestore:HO,nestedRestore:jO}=Yl();kw.exports=WO;function WO({secret:t,wcLen:e}){return function(){if(this.restore)return;let n=Object.keys(t),s=zO(t,n),i=e>0,o=i?{secret:t,groupRestore:HO,nestedRestore:jO}:{secret:t};this.restore=Function("o",GO(s,n,i)).bind(o);}}function zO(t,e){return e.map(r=>{let{circle:n,escPath:s,leadingBracket:i}=t[r],l=n?`o.${n} = secret[${s}].val`:`o${i?"":"."}${r} = secret[${s}].val`,f=`secret[${s}].val = undefined`;return ` - if (secret[${s}].val !== undefined) { - try { ${l} } catch (e) {} - ${f} + `}function wj(t,e){return t===!0?"throw Error('fast-redact: primitives cannot be redacted')":e===!1?"return o":"return this.serialize(o)"}});var oh=A((NV,DR)=>{DR.exports={groupRedact:Ej,groupRestore:Sj,nestedRedact:Cj,nestedRestore:Rj};function Sj({keys:t,values:e,target:r}){if(r==null)return;let n=t.length;for(var i=0;i0;o--)s=s[n[o]];s[n[0]]=i;}}function Cj(t,e,r,n,i,s,o){let a=AR(e,r);if(a==null)return;let l=Object.keys(a),d=l.length;for(var c=0;c{var{groupRestore:Aj,nestedRestore:Pj}=oh();OR.exports=Dj;function Dj({secret:t,wcLen:e}){return function(){if(this.restore)return;let n=Object.keys(t),i=Oj(t,n),s=e>0,o=s?{secret:t,groupRestore:Aj,nestedRestore:Pj}:{secret:t};this.restore=Function("o",Ij(i,n,s)).bind(o);}}function Oj(t,e){return e.map(r=>{let{circle:n,escPath:i,leadingBracket:s}=t[r],a=n?`o.${n} = secret[${i}].val`:`o${s?"":"."}${r} = secret[${i}].val`,l=`secret[${i}].val = undefined`;return ` + if (secret[${i}].val !== undefined) { + try { ${a} } catch (e) {} + ${l} } - `}).join("")}function GO(t,e,r){return ` + `}).join("")}function Ij(t,e,r){return ` const secret = this.secret ${r===!0?` const keys = Object.keys(secret) @@ -96,40 +96,75 @@ caused by: `+sw(n,e)):r},hO=t=>sw(t,new Set),ow=(t,e,r)=>{if(!Nn(t))return "";le `:""} ${t} return o - `}});var Dw=x((kD,$w)=>{$w.exports=VO;function VO(t){let{secret:e,censor:r,compileRestore:n,serialize:s,groupRedact:i,nestedRedact:o,wildcards:l,wcLen:f}=t,d=[{secret:e,censor:r,compileRestore:n}];return s!==!1&&d.push({serialize:s}),f>0&&d.push({groupRedact:i,nestedRedact:o,wildcards:l,wcLen:f}),Object.assign(...d)}});var Uw=x((LD,Bw)=>{var qw=Cw(),KO=Iw(),ZO=Ow(),YO=Lw(),{groupRedact:JO,nestedRedact:XO}=Yl(),QO=Dw(),eF=Es(),tF=qw(),Jl=t=>t;Jl.restore=Jl;var rF="[REDACTED]";Xl.rx=eF;Xl.validator=qw;Bw.exports=Xl;function Xl(t={}){let e=Array.from(new Set(t.paths||[])),r="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,n=t.remove;if(n===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let s=n===!0?void 0:"censor"in t?t.censor:rF,i=typeof s=="function",o=i&&s.length>1;if(e.length===0)return r||Jl;tF({paths:e,serialize:r,censor:s});let{wildcards:l,wcLen:f,secret:d}=KO({paths:e,censor:s}),u=YO({secret:d,wcLen:f}),p="strict"in t?t.strict:!0;return ZO({secret:d,wcLen:f,serialize:r,strict:p,isCensorFct:i,censorFctTakesPath:o},QO({secret:d,censor:s,compileRestore:u,serialize:r,groupRedact:JO,nestedRedact:XO,wildcards:l,wcLen:f}))}});var $r=x(($D,Hw)=>{var nF=Symbol("pino.setLevel"),iF=Symbol("pino.getLevel"),sF=Symbol("pino.levelVal"),oF=Symbol("pino.useLevelLabels"),aF=Symbol("pino.useOnlyCustomLevels"),lF=Symbol("pino.mixin"),uF=Symbol("pino.lsCache"),cF=Symbol("pino.chindings"),fF=Symbol("pino.asJson"),hF=Symbol("pino.write"),dF=Symbol("pino.redactFmt"),pF=Symbol("pino.time"),mF=Symbol("pino.timeSliceIndex"),gF=Symbol("pino.stream"),_F=Symbol("pino.stringify"),yF=Symbol("pino.stringifySafe"),wF=Symbol("pino.stringifiers"),bF=Symbol("pino.end"),SF=Symbol("pino.formatOpts"),vF=Symbol("pino.messageKey"),EF=Symbol("pino.errorKey"),AF=Symbol("pino.nestedKey"),xF=Symbol("pino.nestedKeyStr"),CF=Symbol("pino.mixinMergeStrategy"),RF=Symbol("pino.msgPrefix"),TF=Symbol("pino.wildcardFirst"),IF=Symbol.for("pino.serializers"),PF=Symbol.for("pino.formatters"),OF=Symbol.for("pino.hooks"),FF=Symbol.for("pino.metadata");Hw.exports={setLevelSym:nF,getLevelSym:iF,levelValSym:sF,useLevelLabelsSym:oF,mixinSym:lF,lsCacheSym:uF,chindingsSym:cF,asJsonSym:fF,writeSym:hF,serializersSym:IF,redactFmtSym:dF,timeSym:pF,timeSliceIndexSym:mF,streamSym:gF,stringifySym:_F,stringifySafeSym:yF,stringifiersSym:wF,endSym:bF,formatOptsSym:SF,messageKeySym:vF,errorKeySym:EF,nestedKeySym:AF,wildcardFirstSym:TF,needsMetadataGsym:FF,useOnlyCustomLevelsSym:aF,formattersSym:PF,hooksSym:OF,nestedKeyStrSym:xF,mixinMergeStrategySym:CF,msgPrefixSym:RF};});var tu=x((DD,Gw)=>{var eu=Uw(),{redactFmtSym:MF,wildcardFirstSym:As}=$r(),{rx:Ql,validator:NF}=eu,jw=NF({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),Ww="[Redacted]",zw=!1;function kF(t,e){let{paths:r,censor:n}=LF(t),s=r.reduce((l,f)=>{Ql.lastIndex=0;let d=Ql.exec(f),u=Ql.exec(f),p=d[1]!==void 0?d[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):d[0];if(p==="*"&&(p=As),u===null)return l[p]=null,l;if(l[p]===null)return l;let{index:m}=u,g=`${f.substr(m,f.length-1)}`;return l[p]=l[p]||[],p!==As&&l[p].length===0&&l[p].push(...l[As]||[]),p===As&&Object.keys(l).forEach(function(y){l[y]&&l[y].push(g);}),l[p].push(g),l},{}),i={[MF]:eu({paths:r,censor:n,serialize:e,strict:zw})},o=(...l)=>e(typeof n=="function"?n(...l):n);return [...Object.keys(s),...Object.getOwnPropertySymbols(s)].reduce((l,f)=>{if(s[f]===null)l[f]=d=>o(d,[f]);else {let d=typeof n=="function"?(u,p)=>n(u,[f,...p]):n;l[f]=eu({paths:s[f],censor:d,serialize:e,strict:zw});}return l},i)}function LF(t){if(Array.isArray(t))return t={paths:t,censor:Ww},jw(t),t;let{paths:e,censor:r=Ww,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),jw({paths:e,censor:r}),{paths:e,censor:r}}Gw.exports=kF;});var Kw=x((qD,Vw)=>{var $F=()=>"",DF=()=>`,"time":${Date.now()}`,qF=()=>`,"time":${Math.round(Date.now()/1e3)}`,BF=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;Vw.exports={nullTime:$F,epochTime:DF,unixTime:qF,isoTime:BF};});var Yw=x((BD,Zw)=>{function UF(t){try{return JSON.stringify(t)}catch{return '"[Circular]"'}}Zw.exports=HF;function HF(t,e,r){var n=r&&r.stringify||UF,s=1;if(typeof t=="object"&&t!==null){var i=e.length+s;if(i===1)return t;var o=new Array(i);o[0]=n(t);for(var l=1;l-1?p:0,t.charCodeAt(g+1)){case 100:case 102:if(u>=f||e[u]==null)break;p=f||e[u]==null)break;p=f||e[u]===void 0)break;p",p=g+2,g++;break}d+=n(e[u]),p=g+2,g++;break;case 115:if(u>=f)break;p{if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r));},t=new Int32Array(new SharedArrayBuffer(4));ru.exports=e;}else {let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");};ru.exports=t;}});var ib=x((HD,nb)=>{var Se=K("fs"),jF=K("events"),WF=K("util").inherits,Jw=K("path"),iu=nu(),xs=100,Cs=Buffer.allocUnsafe(0),zF=16*1024,Xw="buffer",Qw="utf8";function eb(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(i,o){if(i){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",i);}):e.emit("error",i);return}e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!(e._reopening||e.destroyed)&&(!e._writing&&e._len>e.minLength||e._flushPending)&&e._actualWrite();}let n=e.append?"a":"w",s=e.mode;if(e.sync)try{e.mkdir&&Se.mkdirSync(Jw.dirname(t),{recursive:!0});let i=Se.openSync(t,n,s);r(null,i);}catch(i){throw r(i),i}else e.mkdir?Se.mkdir(Jw.dirname(t),{recursive:!0},i=>{if(i)return r(i);Se.open(t,n,s,r);}):Se.open(t,n,s,r);}function ct(t){if(!(this instanceof ct))return new ct(t);let{fd:e,dest:r,minLength:n,maxLength:s,maxWrite:i,sync:o,append:l=!0,mkdir:f,retryEAGAIN:d,fsync:u,contentMode:p,mode:m}=t||{};e=e||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=s||0,this.maxWrite=i||zF,this.sync=o||!1,this.writable=!0,this._fsync=u||!1,this.append=l||!1,this.mode=m,this.retryEAGAIN=d||(()=>!0),this.mkdir=f||!1;let g,y;if(p===Xw)this._writingBuf=Cs,this.write=KF,this.flush=YF,this.flushSync=XF,this._actualWrite=eM,g=()=>Se.writeSync(this.fd,this._writingBuf),y=()=>Se.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===Qw)this._writingBuf="",this.write=VF,this.flush=ZF,this.flushSync=JF,this._actualWrite=QF,g=()=>Se.writeSync(this.fd,this._writingBuf,"utf8"),y=()=>Se.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${Qw}" and "${Xw}", but passed ${p}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")eb(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(S,E)=>{if(S){if((S.code==="EAGAIN"||S.code==="EBUSY")&&this.retryEAGAIN(S,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{iu(xs),this.release(void 0,0);}catch(b){this.release(b);}else setTimeout(y,xs);else this._writing=!1,this.emit("error",S);return}if(this.emit("write",E),this._len-=E,this._len<0&&(this._len=0),this._writingBuf=this._writingBuf.slice(E),this._writingBuf.length){if(!this.sync){y();return}try{do{let b=g();this._len-=b,this._writingBuf=this._writingBuf.slice(b);}while(this._writingBuf.length)}catch(b){this.release(b);return}}this._fsync&&Se.fsyncSync(this.fd);let A=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):A>this.minLength?this._actualWrite():this._ending?A>0?this._actualWrite():(this._writing=!1,Rs(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(GF,this)):this.emit("drain"));},this.on("newListener",function(S){S==="drain"&&(this._asyncDrainScheduled=!1);});}function GF(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"));}WF(ct,jF);function tb(t,e){return t.length===0?Cs:t.length===1?t[0]:Buffer.concat(t,e)}function VF(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._lenthis.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._lenthis.maxLength?(this.emit("drop",t),this._lenthis.maxWrite?(r.push([t]),n.push(t.length)):(r[r.length-1].push(t),n[n.length-1]+=t.length),this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len{this._fsync?(this._flushPending=!1,t()):Se.fsync(this.fd,n=>{this._flushPending=!1,t(n);}),this.off("error",r);},r=n=>{this._flushPending=!1,t(n),this.off("drain",e);};this.once("drain",e),this.once("error",r);}function ZF(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&rb.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite());}function YF(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&rb.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite());}ct.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t);});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&Se.close(e,r=>{if(r)return this.emit("error",r)});}),eb(t||this.file,this);};ct.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end();});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():Rs(this)));};function JF(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t;){t.length<=0&&(t=this._bufs[0]);try{let e=Se.writeSync(this.fd,t,"utf8");t=t.slice(e),this._len=Math.max(this._len-e,0),t.length<=0&&this._bufs.shift();}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;iu(xs);}}try{Se.fsyncSync(this.fd);}catch{}}function XF(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=Cs);let t=Cs;for(;this._bufs.length||t.length;){t.length<=0&&(t=tb(this._bufs[0],this._lens[0]));try{let e=Se.writeSync(this.fd,t);t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift());}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;iu(xs);}}}ct.prototype.destroy=function(){this.destroyed||Rs(this);};function QF(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf||this._bufs.shift()||"",this.sync)try{let e=Se.writeSync(this.fd,this._writingBuf,"utf8");t(null,e);}catch(e){t(e);}else Se.write(this.fd,this._writingBuf,"utf8",t);}function eM(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:tb(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=Se.writeSync(this.fd,this._writingBuf);t(null,e);}catch(e){t(e);}else Se.write(this.fd,this._writingBuf,t);}function Rs(t){if(t.fd===-1){t.once("ready",Rs.bind(null,t));return}t.destroyed=!0,t._bufs=[],t._lens=[],Se.fsync(t.fd,e);function e(){t.fd!==1&&t.fd!==2?Se.close(t.fd,r):r();}function r(n){if(n){t.emit("error",n);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close");}}ct.SonicBoom=ct;ct.default=ct;nb.exports=ct;});var su=x((jD,ub)=>{var ft={exit:[],beforeExit:[]},sb={exit:nM,beforeExit:iM},Dr;function tM(){Dr===void 0&&(Dr=new FinalizationRegistry(sM));}function rM(t){ft[t].length>0||process.on(t,sb[t]);}function ob(t){ft[t].length>0||(process.removeListener(t,sb[t]),ft.exit.length===0&&ft.beforeExit.length===0&&(Dr=void 0));}function nM(){ab("exit");}function iM(){ab("beforeExit");}function ab(t){for(let e of ft[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t);}ft[t]=[];}function sM(t){for(let e of ["exit","beforeExit"]){let r=ft[e].indexOf(t);ft[e].splice(r,r+1),ob(e);}}function lb(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");rM(t);let n=new WeakRef(e);n.fn=r,tM(),Dr.register(e,n),ft[t].push(n);}function oM(t,e){lb("exit",t,e);}function aM(t,e){lb("beforeExit",t,e);}function lM(t){if(Dr!==void 0){Dr.unregister(t);for(let e of ["exit","beforeExit"])ft[e]=ft[e].filter(r=>{let n=r.deref();return n&&n!==t}),ob(e);}}ub.exports={register:oM,registerBeforeExit:aM,unregister:lM};});var cb=x((WD,uM)=>{uM.exports={name:"thread-stream",version:"2.4.1",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^8.0.1","pino-elasticsearch":"^6.0.0","sonic-boom":"^3.0.0",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^4.7.2","why-is-node-running":"^2.2.2"},scripts:{test:"standard && npm run transpile && tap test/*.test.*js && tap --ts test/*.test.*ts","test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina ",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"};});var hb=x((zD,fb)=>{function cM(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o===r){s(null,"ok");return}let l=o,f=d=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{l=o,o=Atomics.load(t,e),o===l?f(d>=1e3?1e3:d*2):o===r?s(null,"ok"):s(null,"not-equal");},d);};f(1);}function fM(t,e,r,n,s){let i=Date.now()+n,o=Atomics.load(t,e);if(o!==r){s(null,"ok");return}let l=f=>{Date.now()>i?s(null,"timed-out"):setTimeout(()=>{o=Atomics.load(t,e),o!==r?s(null,"ok"):l(f>=1e3?1e3:f*2);},f);};l(1);}fb.exports={wait:cM,waitDiff:fM};});var pb=x((GD,db)=>{db.exports={WRITE_INDEX:4,READ_INDEX:8};});var wb=x((VD,yb)=>{var{version:hM}=cb(),{EventEmitter:dM}=K("events"),{Worker:pM}=K("worker_threads"),{join:mM}=K("path"),{pathToFileURL:gM}=K("url"),{wait:_M}=hb(),{WRITE_INDEX:ze,READ_INDEX:yt}=pb(),yM=K("buffer"),wM=K("assert"),$=Symbol("kImpl"),bM=yM.constants.MAX_STRING_LENGTH,Ln=class{constructor(e){this._value=e;}deref(){return this._value}},Is=class{register(){}unregister(){}},SM=process.env.NODE_V8_COVERAGE?Is:global.FinalizationRegistry||Is,vM=process.env.NODE_V8_COVERAGE?Ln:global.WeakRef||Ln,mb=new SM(t=>{t.exited||t.terminate();});function EM(t,e){let{filename:r,workerData:n}=e,i=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||mM(__dirname,"lib","worker.js"),o=new pM(i,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:gM(r).href,dataBuf:t[$].dataBuf,stateBuf:t[$].stateBuf,workerData:{$context:{threadStreamVersion:hM},...n}}});return o.stream=new Ln(t),o.on("message",AM),o.on("exit",_b),mb.register(t,o),o}function gb(t){wM(!t[$].sync),t[$].needDrain&&(t[$].needDrain=!1,t.emit("drain"));}function Ts(t){let e=Atomics.load(t[$].state,ze),r=t[$].data.length-e;if(r>0){if(t[$].buf.length===0){t[$].flushing=!1,t[$].ending?cu(t):t[$].needDrain&&process.nextTick(gb,t);return}let n=t[$].buf.slice(0,r),s=Buffer.byteLength(n);s<=r?(t[$].buf=t[$].buf.slice(r),Ps(t,n,Ts.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[$].state,yt,0),Atomics.store(t[$].state,ze,0);s>t[$].data.length;)r=r/2,n=t[$].buf.slice(0,r),s=Buffer.byteLength(n);t[$].buf=t[$].buf.slice(r),Ps(t,n,Ts.bind(null,t));}});}else if(r===0){if(e===0&&t[$].buf.length===0)return;t.flush(()=>{Atomics.store(t[$].state,yt,0),Atomics.store(t[$].state,ze,0),Ts(t);});}else wt(t,new Error("overwritten"));}function AM(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new vM(e),e.flush(()=>{e[$].ready=!0,e.emit("ready");});break;case"ERROR":wt(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:wt(e,new Error("this should not happen: "+t.code));}}function _b(t){let e=this.stream.deref();e!==void 0&&(mb.unregister(e),e.worker.exited=!0,e.worker.off("exit",_b),wt(e,t!==0?new Error("the worker thread exited"):null));}var au=class extends dM{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[$]={},this[$].stateBuf=new SharedArrayBuffer(128),this[$].state=new Int32Array(this[$].stateBuf),this[$].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[$].data=Buffer.from(this[$].dataBuf),this[$].sync=e.sync||!1,this[$].ending=!1,this[$].ended=!1,this[$].needDrain=!1,this[$].destroyed=!1,this[$].flushing=!1,this[$].ready=!1,this[$].finished=!1,this[$].errored=null,this[$].closed=!1,this[$].buf="",this.worker=EM(this,e);}write(e){if(this[$].destroyed)return lu(this,new Error("the worker has exited")),!1;if(this[$].ending)return lu(this,new Error("the worker is ending")),!1;if(this[$].flushing&&this[$].buf.length+e.length>=bM)try{ou(this),this[$].flushing=!0;}catch(r){return wt(this,r),!1}if(this[$].buf+=e,this[$].sync)try{return ou(this),!0}catch(r){return wt(this,r),!1}return this[$].flushing||(this[$].flushing=!0,setImmediate(Ts,this)),this[$].needDrain=this[$].data.length-this[$].buf.length-Atomics.load(this[$].state,ze)<=0,!this[$].needDrain}end(){this[$].destroyed||(this[$].ending=!0,cu(this));}flush(e){if(this[$].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[$].state,ze);_M(this[$].state,yt,r,1/0,(n,s)=>{if(n){wt(this,n),process.nextTick(e,n);return}if(s==="not-equal"){this.flush(e);return}process.nextTick(e);});}flushSync(){this[$].destroyed||(ou(this),uu(this));}unref(){this.worker.unref();}ref(){this.worker.ref();}get ready(){return this[$].ready}get destroyed(){return this[$].destroyed}get closed(){return this[$].closed}get writable(){return !this[$].destroyed&&!this[$].ending}get writableEnded(){return this[$].ending}get writableFinished(){return this[$].finished}get writableNeedDrain(){return this[$].needDrain}get writableObjectMode(){return !1}get writableErrored(){return this[$].errored}};function lu(t,e){setImmediate(()=>{t.emit("error",e);});}function wt(t,e){t[$].destroyed||(t[$].destroyed=!0,e&&(t[$].errored=e,lu(t,e)),t.worker.exited?setImmediate(()=>{t[$].closed=!0,t.emit("close");}):t.worker.terminate().catch(()=>{}).then(()=>{t[$].closed=!0,t.emit("close");}));}function Ps(t,e,r){let n=Atomics.load(t[$].state,ze),s=Buffer.byteLength(e);return t[$].data.write(e,n),Atomics.store(t[$].state,ze,n+s),Atomics.notify(t[$].state,ze),r(),!0}function cu(t){if(!(t[$].ended||!t[$].ending||t[$].flushing)){t[$].ended=!0;try{t.flushSync();let e=Atomics.load(t[$].state,yt);Atomics.store(t[$].state,ze,-1),Atomics.notify(t[$].state,ze);let r=0;for(;e!==-1;){if(Atomics.wait(t[$].state,yt,e,1e3),e=Atomics.load(t[$].state,yt),e===-2){wt(t,new Error("end() failed"));return}if(++r===10){wt(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[$].finished=!0,t.emit("finish");});}catch(e){wt(t,e);}}}function ou(t){let e=()=>{t[$].ending?cu(t):t[$].needDrain&&process.nextTick(gb,t);};for(t[$].flushing=!1;t[$].buf.length!==0;){let r=Atomics.load(t[$].state,ze),n=t[$].data.length-r;if(n===0){uu(t),Atomics.store(t[$].state,yt,0),Atomics.store(t[$].state,ze,0);continue}else if(n<0)throw new Error("overwritten");let s=t[$].buf.slice(0,n),i=Buffer.byteLength(s);if(i<=n)t[$].buf=t[$].buf.slice(n),Ps(t,s,e);else {for(uu(t),Atomics.store(t[$].state,yt,0),Atomics.store(t[$].state,ze,0);i>t[$].buf.length;)n=n/2,s=t[$].buf.slice(0,n),i=Buffer.byteLength(s);t[$].buf=t[$].buf.slice(n),Ps(t,s,e);}}}function uu(t){if(t[$].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[$].state,ze),r=0;for(;;){let n=Atomics.load(t[$].state,yt);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[$].state,yt,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}yb.exports=au;});var du=x((KD,bb)=>{var{createRequire:xM}=K("module"),CM=Kl(),{join:fu,isAbsolute:RM,sep:TM}=K("path"),IM=nu(),hu=su(),PM=wb();function OM(t){hu.register(t,MM),hu.registerBeforeExit(t,NM),t.on("close",function(){hu.unregister(t);});}function FM(t,e,r){let n=new PM({filename:t,workerData:e,workerOpts:r});n.on("ready",s),n.on("close",function(){process.removeListener("exit",i);}),process.on("exit",i);function s(){process.removeListener("exit",i),n.unref(),r.autoEnd!==!1&&OM(n);}function i(){n.closed||(n.flushSync(),IM(100),n.end());}return n}function MM(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref();});}function NM(t){t.flushSync();}function kM(t){let{pipeline:e,targets:r,levels:n,dedupe:s,options:i={},worker:o={},caller:l=CM()}=t,f=typeof l=="string"?[l]:l,d="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},u=t.target;if(u&&r)throw new Error("only one of target or targets can be specified");return r?(u=d["pino-worker"]||fu(__dirname,"worker.js"),i.targets=r.map(m=>({...m,target:p(m.target)}))):e&&(u=d["pino-pipeline-worker"]||fu(__dirname,"worker-pipeline.js"),i.targets=e.map(m=>({...m,target:p(m.target)}))),n&&(i.levels=n),s&&(i.dedupe=s),FM(p(u),i,o);function p(m){if(m=d[m]||m,RM(m)||m.indexOf("file://")===0)return m;if(m==="pino/file")return fu(__dirname,"..","file.js");let g;for(let y of f)try{let S=y==="node:repl"?process.cwd()+TM:y;g=xM(S).resolve(m);break}catch{continue}if(!g)throw new Error(`unable to determine transport target for "${m}"`);return g}}bb.exports=kM;});var Ms=x((ZD,Ob)=>{var Sb=Yw(),{mapHttpRequest:LM,mapHttpResponse:$M}=Vl(),mu=ib(),vb=su(),{lsCacheSym:DM,chindingsSym:xb,writeSym:Eb,serializersSym:Cb,formatOptsSym:Ab,endSym:qM,stringifiersSym:Rb,stringifySym:Tb,stringifySafeSym:gu,wildcardFirstSym:Ib,nestedKeySym:BM,formattersSym:Pb,messageKeySym:UM,errorKeySym:HM,nestedKeyStrSym:jM,msgPrefixSym:Os}=$r(),{isMainThread:WM}=K("worker_threads"),zM=du();function qr(){}function GM(t,e){if(!e)return r;return function(...s){e.call(this,s,r,t);};function r(n,...s){if(typeof n=="object"){let i=n;n!==null&&(n.method&&n.headers&&n.socket?n=LM(n):typeof n.setHeader=="function"&&(n=$M(n)));let o;i===null&&s.length===0?o=[null]:(i=s.shift(),o=s),typeof this[Os]=="string"&&i!==void 0&&i!==null&&(i=this[Os]+i),this[Eb](n,Sb(i,o,this[Ab]),t);}else {let i=n===void 0?s.shift():n;typeof this[Os]=="string"&&i!==void 0&&i!==null&&(i=this[Os]+i),this[Eb](null,Sb(i,s,this[Ab]),t);}}}function pu(t){let e="",r=0,n=!1,s=255,i=t.length;if(i>100)return JSON.stringify(t);for(var o=0;o=32;o++)s=t.charCodeAt(o),(s===34||s===92)&&(e+=t.slice(r,o)+"\\",r=o,n=!0);return n?e+=t.slice(r):e=t,s<32?JSON.stringify(t):'"'+e+'"'}function VM(t,e,r,n){let s=this[Tb],i=this[gu],o=this[Rb],l=this[qM],f=this[xb],d=this[Cb],u=this[Pb],p=this[UM],m=this[HM],g=this[DM][r]+n;g=g+f;let y;u.log&&(t=u.log(t));let S=o[Ib],E="";for(let b in t)if(y=t[b],Object.prototype.hasOwnProperty.call(t,b)&&y!==void 0){d[b]?y=d[b](y):b===m&&d.err&&(y=d.err(y));let T=o[b]||S;switch(typeof y){case"undefined":case"function":continue;case"number":Number.isFinite(y)===!1&&(y=null);case"boolean":T&&(y=T(y));break;case"string":y=(T||pu)(y);break;default:y=(T||s)(y,i);}if(y===void 0)continue;let F=pu(b);E+=","+F+":"+y;}let A="";if(e!==void 0){y=d[p]?d[p](e):e;let b=o[p]||S;switch(typeof y){case"function":break;case"number":Number.isFinite(y)===!1&&(y=null);case"boolean":b&&(y=b(y)),A=',"'+p+'":'+y;break;case"string":y=(b||pu)(y),A=',"'+p+'":'+y;break;default:y=(b||s)(y,i),A=',"'+p+'":'+y;}}return this[BM]&&E?g+this[jM]+E.slice(1)+"}"+A+l:g+E+A+l}function KM(t,e){let r,n=t[xb],s=t[Tb],i=t[gu],o=t[Rb],l=o[Ib],f=t[Cb],d=t[Pb].bindings;e=d(e);for(let u in e)if(r=e[u],(u!=="level"&&u!=="serializers"&&u!=="formatters"&&u!=="customLevels"&&e.hasOwnProperty(u)&&r!==void 0)===!0){if(r=f[u]?f[u](r):r,r=(o[u]||l||s)(r,i),r===void 0)continue;n+=',"'+u+'":'+r;}return n}function ZM(t){return t.write!==t.constructor.prototype.write}var YM=process.env.NODE_V8_COVERAGE||process.env.V8_COVERAGE;function Fs(t){let e=new mu(t);return e.on("error",r),!YM&&!t.sync&&WM&&(vb.register(e,JM),e.on("close",function(){vb.unregister(e);})),e;function r(n){if(n.code==="EPIPE"){e.write=qr,e.end=qr,e.flushSync=qr,e.destroy=qr;return}e.removeListener("error",r),e.emit("error",n);}}function JM(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end();})):t.flushSync());}function XM(t){return function(r,n,s={},i){if(typeof s=="string")i=Fs({dest:s}),s={};else if(typeof i=="string"){if(s&&s.transport)throw Error("only one of option.transport or stream can be specified");i=Fs({dest:i});}else if(s instanceof mu||s.writable||s._writableState)i=s,s={};else if(s.transport){if(s.transport instanceof mu||s.transport.writable||s.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(s.transport.targets&&s.transport.targets.length&&s.formatters&&typeof s.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let f;s.customLevels&&(f=s.useOnlyCustomLevels?s.customLevels:Object.assign({},s.levels,s.customLevels)),i=zM({caller:n,...s.transport,levels:f});}if(s=Object.assign({},t,s),s.serializers=Object.assign({},t.serializers,s.serializers),s.formatters=Object.assign({},t.formatters,s.formatters),s.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:l}=s;return o===!1&&(s.level="silent"),l||(s.onChild=qr),i||(ZM(process.stdout)?i=process.stdout:i=Fs({fd:process.stdout.fd||1})),{opts:s,stream:i}}}function QM(t,e){try{return JSON.stringify(t)}catch{try{return (e||this[gu])(t)}catch{return '"[unable to serialize, circular reference is too complex to analyze]"'}}}function eN(t,e,r){return {level:t,bindings:e,log:r}}function tN(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}Ob.exports={noop:qr,buildSafeSonicBoom:Fs,asChindings:KM,asJson:VM,genLog:GM,createArgsNormalizer:XM,stringify:QM,buildFormatters:eN,normalizeDestFileDescriptor:tN};});var Ns=x((YD,Mb)=>{var{lsCacheSym:rN,levelValSym:_u,useOnlyCustomLevelsSym:nN,streamSym:iN,formattersSym:sN,hooksSym:oN}=$r(),{noop:aN,genLog:or}=Ms(),ht={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},Fb={fatal:t=>{let e=or(ht.fatal,t);return function(...r){let n=this[iN];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync();}catch{}}},error:t=>or(ht.error,t),warn:t=>or(ht.warn,t),info:t=>or(ht.info,t),debug:t=>or(ht.debug,t),trace:t=>or(ht.trace,t)},yu=Object.keys(ht).reduce((t,e)=>(t[ht[e]]=e,t),{}),lN=Object.keys(yu).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function uN(t){let e=t[sN].level,{labels:r}=t.levels,n={};for(let s in r){let i=e(r[s],Number(s));n[s]=JSON.stringify(i).slice(0,-1);}return t[rN]=n,t}function cN(t,e){if(e)return !1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return !0;default:return !1}}function fN(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t];}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[_u],s=this[_u]=r[t],i=this[nN],o=this[oN].logMethod;for(let l in r){if(s>r[l]){this[l]=aN;continue}this[l]=cN(l,i)?Fb[l](o):or(r[l],o);}this.emit("level-change",t,s,e[n],n,this);}function hN(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function dN(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[_u]}function pN(t=null,e=!1){let r=t?Object.keys(t).reduce((i,o)=>(i[t[o]]=o,i),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:yu,r),s=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:ht,t);return {labels:n,values:s}}function mN(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(i=>e[i]),r?[]:Object.keys(yu).map(i=>+i),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:ht,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function gN(t,e){let{labels:r,values:n}=t;for(let s in e){if(s in n)throw Error("levels cannot be overridden");if(e[s]in r)throw Error("pre-existing level values cannot be used for new levels")}}Mb.exports={initialLsCache:lN,genLsCache:uN,levelMethods:Fb,getLevel:hN,setLevel:fN,isLevelEnabled:dN,mappings:pN,levels:ht,assertNoLevelCollisions:gN,assertDefaultLevelFound:mN};});var wu=x((JD,Nb)=>{Nb.exports={version:"8.17.1"};});var zb=x((QD,Wb)=>{var{EventEmitter:_N}=K("events"),{lsCacheSym:yN,levelValSym:wN,setLevelSym:Su,getLevelSym:kb,chindingsSym:vu,parsedChindingsSym:bN,mixinSym:SN,asJsonSym:Bb,writeSym:vN,mixinMergeStrategySym:EN,timeSym:AN,timeSliceIndexSym:xN,streamSym:Ub,serializersSym:ar,formattersSym:bu,errorKeySym:CN,messageKeySym:RN,useOnlyCustomLevelsSym:TN,needsMetadataGsym:IN,redactFmtSym:PN,stringifySym:ON,formatOptsSym:FN,stringifiersSym:MN,msgPrefixSym:Lb}=$r(),{getLevel:NN,setLevel:kN,isLevelEnabled:LN,mappings:$N,initialLsCache:DN,genLsCache:qN,assertNoLevelCollisions:BN}=Ns(),{asChindings:Hb,asJson:UN,buildFormatters:$b,stringify:Db}=Ms(),{version:HN}=wu(),jN=tu(),WN=class{},jb={constructor:WN,child:zN,bindings:GN,setBindings:VN,flush:JN,isLevelEnabled:LN,version:HN,get level(){return this[kb]()},set level(t){this[Su](t);},get levelVal(){return this[wN]},set levelVal(t){throw Error("levelVal is read-only")},[yN]:DN,[vN]:ZN,[Bb]:UN,[kb]:NN,[Su]:kN};Object.setPrototypeOf(jb,_N.prototype);Wb.exports=function(){return Object.create(jb)};var qb=t=>t;function zN(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[ar],n=this[bu],s=Object.create(this);if(e.hasOwnProperty("serializers")===!0){s[ar]=Object.create(null);for(let u in r)s[ar][u]=r[u];let f=Object.getOwnPropertySymbols(r);for(var i=0;i{var{hasOwnProperty:ks}=Object.prototype,ur=xu();ur.configure=xu;ur.stringify=ur;ur.default=ur;Cu.stringify=ur;Cu.configure=xu;Zb.exports=ur;var XN=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function Wt(t){return t.length<5e3&&!XN.test(t)?`"${t}"`:JSON.stringify(t)}function Eu(t){if(t.length>200)return t.sort();for(let e=1;er;)t[n]=t[n-1],n--;t[n]=r;}return t}var QN=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Au(t){return QN.call(t)!==void 0&&t.length!==0}function Gb(t,e,r){t.length= 1`)}return r===void 0?1/0:r}function lr(t){return t===1?"1 item":`${t} items`}function tk(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function rk(t){if(ks.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function xu(t){t={...t};let e=rk(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=ek(t),n=Vb(t,"bigint"),s=Vb(t,"deterministic"),i=Kb(t,"maximumDepth"),o=Kb(t,"maximumBreadth");function l(m,g,y,S,E,A){let b=g[m];switch(typeof b=="object"&&b!==null&&typeof b.toJSON=="function"&&(b=b.toJSON(m)),b=S.call(g,m,b),typeof b){case"string":return Wt(b);case"object":{if(b===null)return "null";if(y.indexOf(b)!==-1)return r;let T="",F=",",k=A;if(Array.isArray(b)){if(b.length===0)return "[]";if(io){let te=b.length-o-1;T+=`${F}"... ${lr(te)} not stringified"`;}return E!==""&&(T+=` -${k}`),y.pop(),`[${T}]`}let H=Object.keys(b),B=H.length;if(B===0)return "{}";if(io){let R=B-o;T+=`${M}"...":${L}"${lr(R)} not stringified"`,M=F;}return E!==""&&M.length>1&&(T=` -${A}${T} -${k}`),y.pop(),`{${T}}`}case"number":return isFinite(b)?String(b):e?e(b):"null";case"boolean":return b===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(b);default:return e?e(b):void 0}}function f(m,g,y,S,E,A){switch(typeof g=="object"&&g!==null&&typeof g.toJSON=="function"&&(g=g.toJSON(m)),typeof g){case"string":return Wt(g);case"object":{if(g===null)return "null";if(y.indexOf(g)!==-1)return r;let b=A,T="",F=",";if(Array.isArray(g)){if(g.length===0)return "[]";if(io){let U=g.length-o-1;T+=`${F}"... ${lr(U)} not stringified"`;}return E!==""&&(T+=` -${b}`),y.pop(),`[${T}]`}y.push(g);let k="";E!==""&&(A+=E,F=`, -${A}`,k=" ");let H="";for(let B of S){let L=f(B,g[B],y,S,E,A);L!==void 0&&(T+=`${H}${Wt(B)}:${k}${L}`,H=F);}return E!==""&&H.length>1&&(T=` -${A}${T} -${b}`),y.pop(),`{${T}}`}case"number":return isFinite(g)?String(g):e?e(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return e?e(g):void 0}}function d(m,g,y,S,E){switch(typeof g){case"string":return Wt(g);case"object":{if(g===null)return "null";if(typeof g.toJSON=="function"){if(g=g.toJSON(m),typeof g!="object")return d(m,g,y,S,E);if(g===null)return "null"}if(y.indexOf(g)!==-1)return r;let A=E;if(Array.isArray(g)){if(g.length===0)return "[]";if(io){let G=g.length-o-1;L+=`${M}"... ${lr(G)} not stringified"`;}return L+=` -${A}`,y.pop(),`[${L}]`}let b=Object.keys(g),T=b.length;if(T===0)return "{}";if(io){let L=T-o;k+=`${H}"...": "${lr(L)} not stringified"`,H=F;}return H!==""&&(k=` -${E}${k} -${A}`),y.pop(),`{${k}}`}case"number":return isFinite(g)?String(g):e?e(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return e?e(g):void 0}}function u(m,g,y){switch(typeof g){case"string":return Wt(g);case"object":{if(g===null)return "null";if(typeof g.toJSON=="function"){if(g=g.toJSON(m),typeof g!="object")return u(m,g,y);if(g===null)return "null"}if(y.indexOf(g)!==-1)return r;let S="";if(Array.isArray(g)){if(g.length===0)return "[]";if(io){let B=g.length-o-1;S+=`,"... ${lr(B)} not stringified"`;}return y.pop(),`[${S}]`}let E=Object.keys(g),A=E.length;if(A===0)return "{}";if(io){let F=A-o;S+=`${b}"...":"${lr(F)} not stringified"`;}return y.pop(),`{${S}}`}case"number":return isFinite(g)?String(g):e?e(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return e?e(g):void 0}}function p(m,g,y){if(arguments.length>1){let S="";if(typeof y=="number"?S=" ".repeat(Math.min(y,10)):typeof y=="string"&&(S=y.slice(0,10)),g!=null){if(typeof g=="function")return l("",{"":m},[],g,S,"");if(Array.isArray(g))return f("",m,[],tk(g),S,"")}if(S.length!==0)return d("",m,[],S,"")}return u("",m,[])}return p}});var Qb=x((eq,Xb)=>{var Ru=Symbol.for("pino.metadata"),{levels:Jb}=Ns(),nk=Jb.info;function ik(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let n=Object.create(Jb);n.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(u=>{n[u]=e.levels[u];});let s={write:i,add:l,flushSync:o,end:f,minLevel:0,streams:[],clone:d,[Ru]:!0,streamLevels:n};return Array.isArray(t)?t.forEach(l,s):l.call(s,t),t=null,s;function i(u){let p,m=this.lastLevel,{streams:g}=this,y=0,S;for(let E=ok(g.length,e.dedupe);lk(E,g.length,e.dedupe);E=ak(E,e.dedupe))if(p=g[E],p.level<=m){if(y!==0&&y!==p.level)break;if(S=p.stream,S[Ru]){let{lastTime:A,lastMsg:b,lastObj:T,lastLogger:F}=this;S.lastLevel=m,S.lastTime=A,S.lastMsg=b,S.lastObj=T,S.lastLogger=F;}S.write(u),e.dedupe&&(y=p.level);}else if(!e.dedupe)break}function o(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync();}function l(u){if(!u)return s;let p=typeof u.write=="function"||u.stream,m=u.write?u:u.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:g,streamLevels:y}=this,S;typeof u.levelVal=="number"?S=u.levelVal:typeof u.level=="string"?S=y[u.level]:typeof u.level=="number"?S=u.level:S=nk;let E={stream:m,level:S,levelVal:void 0,id:r++};return g.unshift(E),g.sort(sk),this.minLevel=g[0].level,s}function f(){for(let{stream:u}of this.streams)typeof u.flushSync=="function"&&u.flushSync(),u.end();}function d(u){let p=new Array(this.streams.length);for(let m=0;m=0:t{var uk=K("os"),aS=Vl(),ck=Kl(),fk=tu(),lS=Kw(),hk=zb(),uS=$r(),{configure:dk}=Yb(),{assertDefaultLevelFound:pk,mappings:cS,genLsCache:mk,levels:gk}=Ns(),{createArgsNormalizer:_k,asChindings:yk,buildSafeSonicBoom:eS,buildFormatters:wk,stringify:Tu,normalizeDestFileDescriptor:tS,noop:bk}=Ms(),{version:Sk}=wu(),{chindingsSym:rS,redactFmtSym:vk,serializersSym:nS,timeSym:Ek,timeSliceIndexSym:Ak,streamSym:xk,stringifySym:iS,stringifySafeSym:Iu,stringifiersSym:sS,setLevelSym:Ck,endSym:Rk,formatOptsSym:Tk,messageKeySym:Ik,errorKeySym:Pk,nestedKeySym:Ok,mixinSym:Fk,useOnlyCustomLevelsSym:Mk,formattersSym:oS,hooksSym:Nk,nestedKeyStrSym:kk,mixinMergeStrategySym:Lk,msgPrefixSym:$k}=uS,{epochTime:fS,nullTime:Dk}=lS,{pid:qk}=process,Bk=uk.hostname(),Uk=aS.err,Hk={level:"info",levels:gk,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:qk,hostname:Bk},serializers:Object.assign(Object.create(null),{err:Uk}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return {level:e}}}),hooks:{logMethod:void 0},timestamp:fS,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},jk=_k(Hk),Wk=Object.assign(Object.create(null),aS);function Pu(...t){let e={},{opts:r,stream:n}=jk(e,ck(),...t),{redact:s,crlf:i,serializers:o,timestamp:l,messageKey:f,errorKey:d,nestedKey:u,base:p,name:m,level:g,customLevels:y,mixin:S,mixinMergeStrategy:E,useOnlyCustomLevels:A,formatters:b,hooks:T,depthLimit:F,edgeLimit:k,onChild:H,msgPrefix:B}=r,L=dk({maximumDepth:F,maximumBreadth:k}),M=wk(b.level,b.bindings,b.log),U=Tu.bind({[Iu]:L}),R=s?fk(s,U):{},z=s?{stringify:R[vk]}:{stringify:U},G="}"+(i?`\r + `}});var MR=A((LV,kR)=>{kR.exports=kj;function kj(t){let{secret:e,censor:r,compileRestore:n,serialize:i,groupRedact:s,nestedRedact:o,wildcards:a,wcLen:l}=t,d=[{secret:e,censor:r,compileRestore:n}];return i!==!1&&d.push({serialize:i}),l>0&&d.push({groupRedact:s,nestedRedact:o,wildcards:a,wcLen:l}),Object.assign(...d)}});var qR=A(($V,NR)=>{var FR=SR(),Mj=CR(),Fj=TR(),Nj=IR(),{groupRedact:qj,nestedRedact:Lj}=oh(),$j=MR(),jj=pu(),Hj=FR(),ah=t=>t;ah.restore=ah;var Wj="[REDACTED]";uh.rx=jj;uh.validator=FR;NR.exports=uh;function uh(t={}){let e=Array.from(new Set(t.paths||[])),r="serialize"in t&&(t.serialize===!1||typeof t.serialize=="function")?t.serialize:JSON.stringify,n=t.remove;if(n===!0&&r!==JSON.stringify)throw Error("fast-redact \u2013 remove option may only be set when serializer is JSON.stringify");let i=n===!0?void 0:"censor"in t?t.censor:Wj,s=typeof i=="function",o=s&&i.length>1;if(e.length===0)return r||ah;Hj({paths:e,serialize:r,censor:i});let{wildcards:a,wcLen:l,secret:d}=Mj({paths:e,censor:i}),c=Nj({secret:d,wcLen:l}),p="strict"in t?t.strict:!0;return Fj({secret:d,wcLen:l,serialize:r,strict:p,isCensorFct:s,censorFctTakesPath:o},$j({secret:d,censor:i,compileRestore:c,serialize:r,groupRedact:qj,nestedRedact:Lj,wildcards:a,wcLen:l}))}});var Ui=A((jV,LR)=>{var Bj=Symbol("pino.setLevel"),Uj=Symbol("pino.getLevel"),zj=Symbol("pino.levelVal"),Vj=Symbol("pino.useLevelLabels"),Gj=Symbol("pino.useOnlyCustomLevels"),Kj=Symbol("pino.mixin"),Zj=Symbol("pino.lsCache"),Jj=Symbol("pino.chindings"),Yj=Symbol("pino.asJson"),Xj=Symbol("pino.write"),Qj=Symbol("pino.redactFmt"),eH=Symbol("pino.time"),tH=Symbol("pino.timeSliceIndex"),rH=Symbol("pino.stream"),nH=Symbol("pino.stringify"),iH=Symbol("pino.stringifySafe"),sH=Symbol("pino.stringifiers"),oH=Symbol("pino.end"),aH=Symbol("pino.formatOpts"),uH=Symbol("pino.messageKey"),cH=Symbol("pino.errorKey"),lH=Symbol("pino.nestedKey"),fH=Symbol("pino.nestedKeyStr"),dH=Symbol("pino.mixinMergeStrategy"),hH=Symbol("pino.msgPrefix"),pH=Symbol("pino.wildcardFirst"),mH=Symbol.for("pino.serializers"),gH=Symbol.for("pino.formatters"),_H=Symbol.for("pino.hooks"),yH=Symbol.for("pino.metadata");LR.exports={setLevelSym:Bj,getLevelSym:Uj,levelValSym:zj,useLevelLabelsSym:Vj,mixinSym:Kj,lsCacheSym:Zj,chindingsSym:Jj,asJsonSym:Yj,writeSym:Xj,serializersSym:mH,redactFmtSym:Qj,timeSym:eH,timeSliceIndexSym:tH,streamSym:rH,stringifySym:nH,stringifySafeSym:iH,stringifiersSym:sH,endSym:oH,formatOptsSym:aH,messageKeySym:uH,errorKeySym:cH,nestedKeySym:lH,wildcardFirstSym:pH,needsMetadataGsym:yH,useOnlyCustomLevelsSym:Gj,formattersSym:gH,hooksSym:_H,nestedKeyStrSym:fH,mixinMergeStrategySym:dH,msgPrefixSym:hH};});var fh=A((HV,WR)=>{var lh=qR(),{redactFmtSym:bH,wildcardFirstSym:mu}=Ui(),{rx:ch,validator:vH}=lh,$R=vH({ERR_PATHS_MUST_BE_STRINGS:()=>"pino \u2013 redacted paths must be strings",ERR_INVALID_PATH:t=>`pino \u2013 redact paths array contains an invalid path (${t})`}),jR="[Redacted]",HR=!1;function wH(t,e){let{paths:r,censor:n}=SH(t),i=r.reduce((a,l)=>{ch.lastIndex=0;let d=ch.exec(l),c=ch.exec(l),p=d[1]!==void 0?d[1].replace(/^(?:"|'|`)(.*)(?:"|'|`)$/,"$1"):d[0];if(p==="*"&&(p=mu),c===null)return a[p]=null,a;if(a[p]===null)return a;let{index:m}=c,_=`${l.substr(m,l.length-1)}`;return a[p]=a[p]||[],p!==mu&&a[p].length===0&&a[p].push(...a[mu]||[]),p===mu&&Object.keys(a).forEach(function(w){a[w]&&a[w].push(_);}),a[p].push(_),a},{}),s={[bH]:lh({paths:r,censor:n,serialize:e,strict:HR})},o=(...a)=>e(typeof n=="function"?n(...a):n);return [...Object.keys(i),...Object.getOwnPropertySymbols(i)].reduce((a,l)=>{if(i[l]===null)a[l]=d=>o(d,[l]);else {let d=typeof n=="function"?(c,p)=>n(c,[l,...p]):n;a[l]=lh({paths:i[l],censor:d,serialize:e,strict:HR});}return a},s)}function SH(t){if(Array.isArray(t))return t={paths:t,censor:jR},$R(t),t;let{paths:e,censor:r=jR,remove:n}=t;if(Array.isArray(e)===!1)throw Error("pino \u2013 redact must contain an array of strings");return n===!0&&(r=void 0),$R({paths:e,censor:r}),{paths:e,censor:r}}WR.exports=wH;});var UR=A((WV,BR)=>{var EH=()=>"",RH=()=>`,"time":${Date.now()}`,CH=()=>`,"time":${Math.round(Date.now()/1e3)}`,xH=()=>`,"time":"${new Date(Date.now()).toISOString()}"`;BR.exports={nullTime:EH,epochTime:RH,unixTime:CH,isoTime:xH};});var VR=A((BV,zR)=>{function TH(t){try{return JSON.stringify(t)}catch{return '"[Circular]"'}}zR.exports=AH;function AH(t,e,r){var n=r&&r.stringify||TH,i=1;if(typeof t=="object"&&t!==null){var s=e.length+i;if(s===1)return t;var o=new Array(s);o[0]=n(t);for(var a=1;a-1?p:0,t.charCodeAt(_+1)){case 100:case 102:if(c>=l||e[c]==null)break;p<_&&(d+=t.slice(p,_)),d+=Number(e[c]),p=_+2,_++;break;case 105:if(c>=l||e[c]==null)break;p<_&&(d+=t.slice(p,_)),d+=Math.floor(Number(e[c])),p=_+2,_++;break;case 79:case 111:case 106:if(c>=l||e[c]===void 0)break;p<_&&(d+=t.slice(p,_));var w=typeof e[c];if(w==="string"){d+="'"+e[c]+"'",p=_+2,_++;break}if(w==="function"){d+=e[c].name||"",p=_+2,_++;break}d+=n(e[c]),p=_+2,_++;break;case 115:if(c>=l)break;p<_&&(d+=t.slice(p,_)),d+=String(e[c]),p=_+2,_++;break;case 37:p<_&&(d+=t.slice(p,_)),d+="%",p=_+2,_++,c--;break}++c;}++_;}return p===-1?t:(p{if(typeof SharedArrayBuffer<"u"&&typeof Atomics<"u"){let e=function(r){if((r>0&&r<1/0)===!1)throw typeof r!="number"&&typeof r!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");Atomics.wait(t,0,0,Number(r));},t=new Int32Array(new SharedArrayBuffer(4));dh.exports=e;}else {let t=function(e){if((e>0&&e<1/0)===!1)throw typeof e!="number"&&typeof e!="bigint"?TypeError("sleep: ms must be a number"):RangeError("sleep: ms must be a number that is greater than 0 but less than Infinity");};dh.exports=t;}});var eC=A((zV,QR)=>{var ft=oe("fs"),PH=oe("events"),DH=oe("util").inherits,GR=oe("path"),ph=hh(),gu=100,_u=Buffer.allocUnsafe(0),OH=16*1024,KR="buffer",ZR="utf8";function JR(t,e){e._opening=!0,e._writing=!0,e._asyncDrainScheduled=!1;function r(s,o){if(s){e._reopening=!1,e._writing=!1,e._opening=!1,e.sync?process.nextTick(()=>{e.listenerCount("error")>0&&e.emit("error",s);}):e.emit("error",s);return}e.fd=o,e.file=t,e._reopening=!1,e._opening=!1,e._writing=!1,e.sync?process.nextTick(()=>e.emit("ready")):e.emit("ready"),!(e._reopening||e.destroyed)&&(!e._writing&&e._len>e.minLength||e._flushPending)&&e._actualWrite();}let n=e.append?"a":"w",i=e.mode;if(e.sync)try{e.mkdir&&ft.mkdirSync(GR.dirname(t),{recursive:!0});let s=ft.openSync(t,n,i);r(null,s);}catch(s){throw r(s),s}else e.mkdir?ft.mkdir(GR.dirname(t),{recursive:!0},s=>{if(s)return r(s);ft.open(t,n,i,r);}):ft.open(t,n,i,r);}function Ir(t){if(!(this instanceof Ir))return new Ir(t);let{fd:e,dest:r,minLength:n,maxLength:i,maxWrite:s,sync:o,append:a=!0,mkdir:l,retryEAGAIN:d,fsync:c,contentMode:p,mode:m}=t||{};e=e||r,this._len=0,this.fd=-1,this._bufs=[],this._lens=[],this._writing=!1,this._ending=!1,this._reopening=!1,this._asyncDrainScheduled=!1,this._flushPending=!1,this._hwm=Math.max(n||0,16387),this.file=null,this.destroyed=!1,this.minLength=n||0,this.maxLength=i||0,this.maxWrite=s||OH,this.sync=o||!1,this.writable=!0,this._fsync=c||!1,this.append=a||!1,this.mode=m,this.retryEAGAIN=d||(()=>!0),this.mkdir=l||!1;let _,w;if(p===KR)this._writingBuf=_u,this.write=MH,this.flush=NH,this.flushSync=LH,this._actualWrite=jH,_=()=>ft.writeSync(this.fd,this._writingBuf),w=()=>ft.write(this.fd,this._writingBuf,this.release);else if(p===void 0||p===ZR)this._writingBuf="",this.write=kH,this.flush=FH,this.flushSync=qH,this._actualWrite=$H,_=()=>ft.writeSync(this.fd,this._writingBuf,"utf8"),w=()=>ft.write(this.fd,this._writingBuf,"utf8",this.release);else throw new Error(`SonicBoom supports "${ZR}" and "${KR}", but passed ${p}`);if(typeof e=="number")this.fd=e,process.nextTick(()=>this.emit("ready"));else if(typeof e=="string")JR(e,this);else throw new Error("SonicBoom supports only file descriptors and files");if(this.minLength>=this.maxWrite)throw new Error(`minLength should be smaller than maxWrite (${this.maxWrite})`);this.release=(E,P)=>{if(E){if((E.code==="EAGAIN"||E.code==="EBUSY")&&this.retryEAGAIN(E,this._writingBuf.length,this._len-this._writingBuf.length))if(this.sync)try{ph(gu),this.release(void 0,0);}catch(g){this.release(g);}else setTimeout(w,gu);else this._writing=!1,this.emit("error",E);return}if(this.emit("write",P),this._len-=P,this._len<0&&(this._len=0),this._writingBuf=this._writingBuf.slice(P),this._writingBuf.length){if(!this.sync){w();return}try{do{let g=_();this._len-=g,this._writingBuf=this._writingBuf.slice(g);}while(this._writingBuf.length)}catch(g){this.release(g);return}}this._fsync&&ft.fsyncSync(this.fd);let D=this._len;this._reopening?(this._writing=!1,this._reopening=!1,this.reopen()):D>this.minLength?this._actualWrite():this._ending?D>0?this._actualWrite():(this._writing=!1,yu(this)):(this._writing=!1,this.sync?this._asyncDrainScheduled||(this._asyncDrainScheduled=!0,process.nextTick(IH,this)):this.emit("drain"));},this.on("newListener",function(E){E==="drain"&&(this._asyncDrainScheduled=!1);});}function IH(t){t.listenerCount("drain")>0&&(t._asyncDrainScheduled=!1,t.emit("drain"));}DH(Ir,PH);function YR(t,e){return t.length===0?_u:t.length===1?t[0]:Buffer.concat(t,e)}function kH(t){if(this.destroyed)throw new Error("SonicBoom destroyed");let e=this._len+t.length,r=this._bufs;return this.maxLength&&e>this.maxLength?(this.emit("drop",t),this._lenthis.maxWrite?r.push(""+t):r[r.length-1]+=t,this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._lenthis.maxLength?(this.emit("drop",t),this._lenthis.maxWrite?(r.push([t]),n.push(t.length)):(r[r.length-1].push(t),n[n.length-1]+=t.length),this._len=e,!this._writing&&this._len>=this.minLength&&this._actualWrite(),this._len{this._fsync?(this._flushPending=!1,t()):ft.fsync(this.fd,n=>{this._flushPending=!1,t(n);}),this.off("error",r);},r=n=>{this._flushPending=!1,t(n),this.off("drain",e);};this.once("drain",e),this.once("error",r);}function FH(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&XR.call(this,t),!this._writing&&(this._bufs.length===0&&this._bufs.push(""),this._actualWrite());}function NH(t){if(t!=null&&typeof t!="function")throw new Error("flush cb must be a function");if(this.destroyed){let e=new Error("SonicBoom destroyed");if(t){t(e);return}throw e}if(this.minLength<=0){t?.();return}t&&XR.call(this,t),!this._writing&&(this._bufs.length===0&&(this._bufs.push([]),this._lens.push(0)),this._actualWrite());}Ir.prototype.reopen=function(t){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.reopen(t);});return}if(this._ending)return;if(!this.file)throw new Error("Unable to reopen a file descriptor, you must pass a file to SonicBoom");if(this._reopening=!0,this._writing)return;let e=this.fd;this.once("ready",()=>{e!==this.fd&&ft.close(e,r=>{if(r)return this.emit("error",r)});}),JR(t||this.file,this);};Ir.prototype.end=function(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this._opening){this.once("ready",()=>{this.end();});return}this._ending||(this._ending=!0,!this._writing&&(this._len>0&&this.fd>=0?this._actualWrite():yu(this)));};function qH(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift(this._writingBuf),this._writingBuf="");let t="";for(;this._bufs.length||t;){t.length<=0&&(t=this._bufs[0]);try{let e=ft.writeSync(this.fd,t,"utf8");t=t.slice(e),this._len=Math.max(this._len-e,0),t.length<=0&&this._bufs.shift();}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;ph(gu);}}try{ft.fsyncSync(this.fd);}catch{}}function LH(){if(this.destroyed)throw new Error("SonicBoom destroyed");if(this.fd<0)throw new Error("sonic boom is not ready yet");!this._writing&&this._writingBuf.length>0&&(this._bufs.unshift([this._writingBuf]),this._writingBuf=_u);let t=_u;for(;this._bufs.length||t.length;){t.length<=0&&(t=YR(this._bufs[0],this._lens[0]));try{let e=ft.writeSync(this.fd,t);t=t.subarray(e),this._len=Math.max(this._len-e,0),t.length<=0&&(this._bufs.shift(),this._lens.shift());}catch(e){if((e.code==="EAGAIN"||e.code==="EBUSY")&&!this.retryEAGAIN(e,t.length,this._len-t.length))throw e;ph(gu);}}}Ir.prototype.destroy=function(){this.destroyed||yu(this);};function $H(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf||this._bufs.shift()||"",this.sync)try{let e=ft.writeSync(this.fd,this._writingBuf,"utf8");t(null,e);}catch(e){t(e);}else ft.write(this.fd,this._writingBuf,"utf8",t);}function jH(){let t=this.release;if(this._writing=!0,this._writingBuf=this._writingBuf.length?this._writingBuf:YR(this._bufs.shift(),this._lens.shift()),this.sync)try{let e=ft.writeSync(this.fd,this._writingBuf);t(null,e);}catch(e){t(e);}else ft.write(this.fd,this._writingBuf,t);}function yu(t){if(t.fd===-1){t.once("ready",yu.bind(null,t));return}t.destroyed=!0,t._bufs=[],t._lens=[],ft.fsync(t.fd,e);function e(){t.fd!==1&&t.fd!==2?ft.close(t.fd,r):r();}function r(n){if(n){t.emit("error",n);return}t._ending&&!t._writing&&t.emit("finish"),t.emit("close");}}Ir.SonicBoom=Ir;Ir.default=Ir;QR.exports=Ir;});var mh=A((VV,sC)=>{var kr={exit:[],beforeExit:[]},tC={exit:BH,beforeExit:UH},zi;function HH(){zi===void 0&&(zi=new FinalizationRegistry(zH));}function WH(t){kr[t].length>0||process.on(t,tC[t]);}function rC(t){kr[t].length>0||(process.removeListener(t,tC[t]),kr.exit.length===0&&kr.beforeExit.length===0&&(zi=void 0));}function BH(){nC("exit");}function UH(){nC("beforeExit");}function nC(t){for(let e of kr[t]){let r=e.deref(),n=e.fn;r!==void 0&&n(r,t);}kr[t]=[];}function zH(t){for(let e of ["exit","beforeExit"]){let r=kr[e].indexOf(t);kr[e].splice(r,r+1),rC(e);}}function iC(t,e,r){if(e===void 0)throw new Error("the object can't be undefined");WH(t);let n=new WeakRef(e);n.fn=r,HH(),zi.register(e,n),kr[t].push(n);}function VH(t,e){iC("exit",t,e);}function GH(t,e){iC("beforeExit",t,e);}function KH(t){if(zi!==void 0){zi.unregister(t);for(let e of ["exit","beforeExit"])kr[e]=kr[e].filter(r=>{let n=r.deref();return n&&n!==t}),rC(e);}}sC.exports={register:VH,registerBeforeExit:GH,unregister:KH};});var oC=A((GV,ZH)=>{ZH.exports={name:"thread-stream",version:"2.4.1",description:"A streaming way to send data to a Node.js Worker Thread",main:"index.js",types:"index.d.ts",dependencies:{"real-require":"^0.2.0"},devDependencies:{"@types/node":"^20.1.0","@types/tap":"^15.0.0",desm:"^1.3.0",fastbench:"^1.0.1",husky:"^8.0.1","pino-elasticsearch":"^6.0.0","sonic-boom":"^3.0.0",standard:"^17.0.0",tap:"^16.2.0","ts-node":"^10.8.0",typescript:"^4.7.2","why-is-node-running":"^2.2.2"},scripts:{test:"standard && npm run transpile && tap test/*.test.*js && tap --ts test/*.test.*ts","test:ci":"standard && npm run transpile && npm run test:ci:js && npm run test:ci:ts","test:ci:js":'tap --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*js"',"test:ci:ts":'tap --ts --no-check-coverage --coverage-report=lcovonly "test/**/*.test.*ts"',"test:yarn":'npm run transpile && tap "test/**/*.test.js" --no-check-coverage',transpile:"sh ./test/ts/transpile.sh",prepare:"husky install"},standard:{ignore:["test/ts/**/*"]},repository:{type:"git",url:"git+https://github.com/mcollina/thread-stream.git"},keywords:["worker","thread","threads","stream"],author:"Matteo Collina ",license:"MIT",bugs:{url:"https://github.com/mcollina/thread-stream/issues"},homepage:"https://github.com/mcollina/thread-stream#readme"};});var uC=A((KV,aC)=>{function JH(t,e,r,n,i){let s=Date.now()+n,o=Atomics.load(t,e);if(o===r){i(null,"ok");return}let a=o,l=d=>{Date.now()>s?i(null,"timed-out"):setTimeout(()=>{a=o,o=Atomics.load(t,e),o===a?l(d>=1e3?1e3:d*2):o===r?i(null,"ok"):i(null,"not-equal");},d);};l(1);}function YH(t,e,r,n,i){let s=Date.now()+n,o=Atomics.load(t,e);if(o!==r){i(null,"ok");return}let a=l=>{Date.now()>s?i(null,"timed-out"):setTimeout(()=>{o=Atomics.load(t,e),o!==r?i(null,"ok"):a(l>=1e3?1e3:l*2);},l);};a(1);}aC.exports={wait:JH,waitDiff:YH};});var lC=A((ZV,cC)=>{cC.exports={WRITE_INDEX:4,READ_INDEX:8};});var mC=A((JV,pC)=>{var{version:XH}=oC(),{EventEmitter:QH}=oe("events"),{Worker:eW}=oe("worker_threads"),{join:tW}=oe("path"),{pathToFileURL:rW}=oe("url"),{wait:nW}=uC(),{WRITE_INDEX:Kt,READ_INDEX:Ur}=lC(),iW=oe("buffer"),sW=oe("assert"),Y=Symbol("kImpl"),oW=iW.constants.MAX_STRING_LENGTH,uo=class{constructor(e){this._value=e;}deref(){return this._value}},vu=class{register(){}unregister(){}},aW=process.env.NODE_V8_COVERAGE?vu:global.FinalizationRegistry||vu,uW=process.env.NODE_V8_COVERAGE?uo:global.WeakRef||uo,fC=new aW(t=>{t.exited||t.terminate();});function cW(t,e){let{filename:r,workerData:n}=e,s=("__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{})["thread-stream-worker"]||tW(__dirname,"lib","worker.js"),o=new eW(s,{...e.workerOpts,trackUnmanagedFds:!1,workerData:{filename:r.indexOf("file://")===0?r:rW(r).href,dataBuf:t[Y].dataBuf,stateBuf:t[Y].stateBuf,workerData:{$context:{threadStreamVersion:XH},...n}}});return o.stream=new uo(t),o.on("message",lW),o.on("exit",hC),fC.register(t,o),o}function dC(t){sW(!t[Y].sync),t[Y].needDrain&&(t[Y].needDrain=!1,t.emit("drain"));}function bu(t){let e=Atomics.load(t[Y].state,Kt),r=t[Y].data.length-e;if(r>0){if(t[Y].buf.length===0){t[Y].flushing=!1,t[Y].ending?vh(t):t[Y].needDrain&&process.nextTick(dC,t);return}let n=t[Y].buf.slice(0,r),i=Buffer.byteLength(n);i<=r?(t[Y].buf=t[Y].buf.slice(r),wu(t,n,bu.bind(null,t))):t.flush(()=>{if(!t.destroyed){for(Atomics.store(t[Y].state,Ur,0),Atomics.store(t[Y].state,Kt,0);i>t[Y].data.length;)r=r/2,n=t[Y].buf.slice(0,r),i=Buffer.byteLength(n);t[Y].buf=t[Y].buf.slice(r),wu(t,n,bu.bind(null,t));}});}else if(r===0){if(e===0&&t[Y].buf.length===0)return;t.flush(()=>{Atomics.store(t[Y].state,Ur,0),Atomics.store(t[Y].state,Kt,0),bu(t);});}else zr(t,new Error("overwritten"));}function lW(t){let e=this.stream.deref();if(e===void 0){this.exited=!0,this.terminate();return}switch(t.code){case"READY":this.stream=new uW(e),e.flush(()=>{e[Y].ready=!0,e.emit("ready");});break;case"ERROR":zr(e,t.err);break;case"EVENT":Array.isArray(t.args)?e.emit(t.name,...t.args):e.emit(t.name,t.args);break;case"WARNING":process.emitWarning(t.err);break;default:zr(e,new Error("this should not happen: "+t.code));}}function hC(t){let e=this.stream.deref();e!==void 0&&(fC.unregister(e),e.worker.exited=!0,e.worker.off("exit",hC),zr(e,t!==0?new Error("the worker thread exited"):null));}var _h=class extends QH{constructor(e={}){if(super(),e.bufferSize<4)throw new Error("bufferSize must at least fit a 4-byte utf-8 char");this[Y]={},this[Y].stateBuf=new SharedArrayBuffer(128),this[Y].state=new Int32Array(this[Y].stateBuf),this[Y].dataBuf=new SharedArrayBuffer(e.bufferSize||4*1024*1024),this[Y].data=Buffer.from(this[Y].dataBuf),this[Y].sync=e.sync||!1,this[Y].ending=!1,this[Y].ended=!1,this[Y].needDrain=!1,this[Y].destroyed=!1,this[Y].flushing=!1,this[Y].ready=!1,this[Y].finished=!1,this[Y].errored=null,this[Y].closed=!1,this[Y].buf="",this.worker=cW(this,e);}write(e){if(this[Y].destroyed)return yh(this,new Error("the worker has exited")),!1;if(this[Y].ending)return yh(this,new Error("the worker is ending")),!1;if(this[Y].flushing&&this[Y].buf.length+e.length>=oW)try{gh(this),this[Y].flushing=!0;}catch(r){return zr(this,r),!1}if(this[Y].buf+=e,this[Y].sync)try{return gh(this),!0}catch(r){return zr(this,r),!1}return this[Y].flushing||(this[Y].flushing=!0,setImmediate(bu,this)),this[Y].needDrain=this[Y].data.length-this[Y].buf.length-Atomics.load(this[Y].state,Kt)<=0,!this[Y].needDrain}end(){this[Y].destroyed||(this[Y].ending=!0,vh(this));}flush(e){if(this[Y].destroyed){typeof e=="function"&&process.nextTick(e,new Error("the worker has exited"));return}let r=Atomics.load(this[Y].state,Kt);nW(this[Y].state,Ur,r,1/0,(n,i)=>{if(n){zr(this,n),process.nextTick(e,n);return}if(i==="not-equal"){this.flush(e);return}process.nextTick(e);});}flushSync(){this[Y].destroyed||(gh(this),bh(this));}unref(){this.worker.unref();}ref(){this.worker.ref();}get ready(){return this[Y].ready}get destroyed(){return this[Y].destroyed}get closed(){return this[Y].closed}get writable(){return !this[Y].destroyed&&!this[Y].ending}get writableEnded(){return this[Y].ending}get writableFinished(){return this[Y].finished}get writableNeedDrain(){return this[Y].needDrain}get writableObjectMode(){return !1}get writableErrored(){return this[Y].errored}};function yh(t,e){setImmediate(()=>{t.emit("error",e);});}function zr(t,e){t[Y].destroyed||(t[Y].destroyed=!0,e&&(t[Y].errored=e,yh(t,e)),t.worker.exited?setImmediate(()=>{t[Y].closed=!0,t.emit("close");}):t.worker.terminate().catch(()=>{}).then(()=>{t[Y].closed=!0,t.emit("close");}));}function wu(t,e,r){let n=Atomics.load(t[Y].state,Kt),i=Buffer.byteLength(e);return t[Y].data.write(e,n),Atomics.store(t[Y].state,Kt,n+i),Atomics.notify(t[Y].state,Kt),r(),!0}function vh(t){if(!(t[Y].ended||!t[Y].ending||t[Y].flushing)){t[Y].ended=!0;try{t.flushSync();let e=Atomics.load(t[Y].state,Ur);Atomics.store(t[Y].state,Kt,-1),Atomics.notify(t[Y].state,Kt);let r=0;for(;e!==-1;){if(Atomics.wait(t[Y].state,Ur,e,1e3),e=Atomics.load(t[Y].state,Ur),e===-2){zr(t,new Error("end() failed"));return}if(++r===10){zr(t,new Error("end() took too long (10s)"));return}}process.nextTick(()=>{t[Y].finished=!0,t.emit("finish");});}catch(e){zr(t,e);}}}function gh(t){let e=()=>{t[Y].ending?vh(t):t[Y].needDrain&&process.nextTick(dC,t);};for(t[Y].flushing=!1;t[Y].buf.length!==0;){let r=Atomics.load(t[Y].state,Kt),n=t[Y].data.length-r;if(n===0){bh(t),Atomics.store(t[Y].state,Ur,0),Atomics.store(t[Y].state,Kt,0);continue}else if(n<0)throw new Error("overwritten");let i=t[Y].buf.slice(0,n),s=Buffer.byteLength(i);if(s<=n)t[Y].buf=t[Y].buf.slice(n),wu(t,i,e);else {for(bh(t),Atomics.store(t[Y].state,Ur,0),Atomics.store(t[Y].state,Kt,0);s>t[Y].buf.length;)n=n/2,i=t[Y].buf.slice(0,n),s=Buffer.byteLength(i);t[Y].buf=t[Y].buf.slice(n),wu(t,i,e);}}}function bh(t){if(t[Y].flushing)throw new Error("unable to flush while flushing");let e=Atomics.load(t[Y].state,Kt),r=0;for(;;){let n=Atomics.load(t[Y].state,Ur);if(n===-2)throw Error("_flushSync failed");if(n!==e)Atomics.wait(t[Y].state,Ur,n,1e3);else break;if(++r===10)throw new Error("_flushSync took too long (10s)")}}pC.exports=_h;});var Eh=A((YV,gC)=>{var{createRequire:fW}=oe("module"),dW=ih(),{join:wh,isAbsolute:hW,sep:pW}=oe("path"),mW=hh(),Sh=mh(),gW=mC();function _W(t){Sh.register(t,bW),Sh.registerBeforeExit(t,vW),t.on("close",function(){Sh.unregister(t);});}function yW(t,e,r){let n=new gW({filename:t,workerData:e,workerOpts:r});n.on("ready",i),n.on("close",function(){process.removeListener("exit",s);}),process.on("exit",s);function i(){process.removeListener("exit",s),n.unref(),r.autoEnd!==!1&&_W(n);}function s(){n.closed||(n.flushSync(),mW(100),n.end());}return n}function bW(t){t.ref(),t.flushSync(),t.end(),t.once("close",function(){t.unref();});}function vW(t){t.flushSync();}function wW(t){let{pipeline:e,targets:r,levels:n,dedupe:i,options:s={},worker:o={},caller:a=dW()}=t,l=typeof a=="string"?[a]:a,d="__bundlerPathsOverrides"in globalThis?globalThis.__bundlerPathsOverrides:{},c=t.target;if(c&&r)throw new Error("only one of target or targets can be specified");return r?(c=d["pino-worker"]||wh(__dirname,"worker.js"),s.targets=r.map(m=>({...m,target:p(m.target)}))):e&&(c=d["pino-pipeline-worker"]||wh(__dirname,"worker-pipeline.js"),s.targets=e.map(m=>({...m,target:p(m.target)}))),n&&(s.levels=n),i&&(s.dedupe=i),yW(p(c),s,o);function p(m){if(m=d[m]||m,hW(m)||m.indexOf("file://")===0)return m;if(m==="pino/file")return wh(__dirname,"..","file.js");let _;for(let w of l)try{let E=w==="node:repl"?process.cwd()+pW:w;_=fW(E).resolve(m);break}catch{continue}if(!_)throw new Error(`unable to determine transport target for "${m}"`);return _}}gC.exports=wW;});var Ru=A((XV,TC)=>{var _C=VR(),{mapHttpRequest:SW,mapHttpResponse:EW}=nh(),Ch=eC(),yC=mh(),{lsCacheSym:RW,chindingsSym:wC,writeSym:bC,serializersSym:SC,formatOptsSym:vC,endSym:CW,stringifiersSym:EC,stringifySym:RC,stringifySafeSym:xh,wildcardFirstSym:CC,nestedKeySym:xW,formattersSym:xC,messageKeySym:TW,errorKeySym:AW,nestedKeyStrSym:PW,msgPrefixSym:Su}=Ui(),{isMainThread:DW}=oe("worker_threads"),OW=Eh();function Vi(){}function IW(t,e){if(!e)return r;return function(...i){e.call(this,i,r,t);};function r(n,...i){if(typeof n=="object"){let s=n;n!==null&&(n.method&&n.headers&&n.socket?n=SW(n):typeof n.setHeader=="function"&&(n=EW(n)));let o;s===null&&i.length===0?o=[null]:(s=i.shift(),o=i),typeof this[Su]=="string"&&s!==void 0&&s!==null&&(s=this[Su]+s),this[bC](n,_C(s,o,this[vC]),t);}else {let s=n===void 0?i.shift():n;typeof this[Su]=="string"&&s!==void 0&&s!==null&&(s=this[Su]+s),this[bC](null,_C(s,i,this[vC]),t);}}}function Rh(t){let e="",r=0,n=!1,i=255,s=t.length;if(s>100)return JSON.stringify(t);for(var o=0;o=32;o++)i=t.charCodeAt(o),(i===34||i===92)&&(e+=t.slice(r,o)+"\\",r=o,n=!0);return n?e+=t.slice(r):e=t,i<32?JSON.stringify(t):'"'+e+'"'}function kW(t,e,r,n){let i=this[RC],s=this[xh],o=this[EC],a=this[CW],l=this[wC],d=this[SC],c=this[xC],p=this[TW],m=this[AW],_=this[RW][r]+n;_=_+l;let w;c.log&&(t=c.log(t));let E=o[CC],P="";for(let g in t)if(w=t[g],Object.prototype.hasOwnProperty.call(t,g)&&w!==void 0){d[g]?w=d[g](w):g===m&&d.err&&(w=d.err(w));let S=o[g]||E;switch(typeof w){case"undefined":case"function":continue;case"number":Number.isFinite(w)===!1&&(w=null);case"boolean":S&&(w=S(w));break;case"string":w=(S||Rh)(w);break;default:w=(S||i)(w,s);}if(w===void 0)continue;let I=Rh(g);P+=","+I+":"+w;}let D="";if(e!==void 0){w=d[p]?d[p](e):e;let g=o[p]||E;switch(typeof w){case"function":break;case"number":Number.isFinite(w)===!1&&(w=null);case"boolean":g&&(w=g(w)),D=',"'+p+'":'+w;break;case"string":w=(g||Rh)(w),D=',"'+p+'":'+w;break;default:w=(g||i)(w,s),D=',"'+p+'":'+w;}}return this[xW]&&P?_+this[PW]+P.slice(1)+"}"+D+a:_+P+D+a}function MW(t,e){let r,n=t[wC],i=t[RC],s=t[xh],o=t[EC],a=o[CC],l=t[SC],d=t[xC].bindings;e=d(e);for(let c in e)if(r=e[c],(c!=="level"&&c!=="serializers"&&c!=="formatters"&&c!=="customLevels"&&e.hasOwnProperty(c)&&r!==void 0)===!0){if(r=l[c]?l[c](r):r,r=(o[c]||a||i)(r,s),r===void 0)continue;n+=',"'+c+'":'+r;}return n}function FW(t){return t.write!==t.constructor.prototype.write}var NW=process.env.NODE_V8_COVERAGE||process.env.V8_COVERAGE;function Eu(t){let e=new Ch(t);return e.on("error",r),!NW&&!t.sync&&DW&&(yC.register(e,qW),e.on("close",function(){yC.unregister(e);})),e;function r(n){if(n.code==="EPIPE"){e.write=Vi,e.end=Vi,e.flushSync=Vi,e.destroy=Vi;return}e.removeListener("error",r),e.emit("error",n);}}function qW(t,e){t.destroyed||(e==="beforeExit"?(t.flush(),t.on("drain",function(){t.end();})):t.flushSync());}function LW(t){return function(r,n,i={},s){if(typeof i=="string")s=Eu({dest:i}),i={};else if(typeof s=="string"){if(i&&i.transport)throw Error("only one of option.transport or stream can be specified");s=Eu({dest:s});}else if(i instanceof Ch||i.writable||i._writableState)s=i,i={};else if(i.transport){if(i.transport instanceof Ch||i.transport.writable||i.transport._writableState)throw Error("option.transport do not allow stream, please pass to option directly. e.g. pino(transport)");if(i.transport.targets&&i.transport.targets.length&&i.formatters&&typeof i.formatters.level=="function")throw Error("option.transport.targets do not allow custom level formatters");let l;i.customLevels&&(l=i.useOnlyCustomLevels?i.customLevels:Object.assign({},i.levels,i.customLevels)),s=OW({caller:n,...i.transport,levels:l});}if(i=Object.assign({},t,i),i.serializers=Object.assign({},t.serializers,i.serializers),i.formatters=Object.assign({},t.formatters,i.formatters),i.prettyPrint)throw new Error("prettyPrint option is no longer supported, see the pino-pretty package (https://github.com/pinojs/pino-pretty)");let{enabled:o,onChild:a}=i;return o===!1&&(i.level="silent"),a||(i.onChild=Vi),s||(FW(process.stdout)?s=process.stdout:s=Eu({fd:process.stdout.fd||1})),{opts:i,stream:s}}}function $W(t,e){try{return JSON.stringify(t)}catch{try{return (e||this[xh])(t)}catch{return '"[unable to serialize, circular reference is too complex to analyze]"'}}}function jW(t,e,r){return {level:t,bindings:e,log:r}}function HW(t){let e=Number(t);return typeof t=="string"&&Number.isFinite(e)?e:t===void 0?1:t}TC.exports={noop:Vi,buildSafeSonicBoom:Eu,asChindings:MW,asJson:kW,genLog:IW,createArgsNormalizer:LW,stringify:$W,buildFormatters:jW,normalizeDestFileDescriptor:HW};});var Cu=A((QV,PC)=>{var{lsCacheSym:WW,levelValSym:Th,useOnlyCustomLevelsSym:BW,streamSym:UW,formattersSym:zW,hooksSym:VW}=Ui(),{noop:GW,genLog:ni}=Ru(),Mr={trace:10,debug:20,info:30,warn:40,error:50,fatal:60},AC={fatal:t=>{let e=ni(Mr.fatal,t);return function(...r){let n=this[UW];if(e.call(this,...r),typeof n.flushSync=="function")try{n.flushSync();}catch{}}},error:t=>ni(Mr.error,t),warn:t=>ni(Mr.warn,t),info:t=>ni(Mr.info,t),debug:t=>ni(Mr.debug,t),trace:t=>ni(Mr.trace,t)},Ah=Object.keys(Mr).reduce((t,e)=>(t[Mr[e]]=e,t),{}),KW=Object.keys(Ah).reduce((t,e)=>(t[e]='{"level":'+Number(e),t),{});function ZW(t){let e=t[zW].level,{labels:r}=t.levels,n={};for(let i in r){let s=e(r[i],Number(i));n[i]=JSON.stringify(s).slice(0,-1);}return t[WW]=n,t}function JW(t,e){if(e)return !1;switch(t){case"fatal":case"error":case"warn":case"info":case"debug":case"trace":return !0;default:return !1}}function YW(t){let{labels:e,values:r}=this.levels;if(typeof t=="number"){if(e[t]===void 0)throw Error("unknown level value"+t);t=e[t];}if(r[t]===void 0)throw Error("unknown level "+t);let n=this[Th],i=this[Th]=r[t],s=this[BW],o=this[VW].logMethod;for(let a in r){if(i>r[a]){this[a]=GW;continue}this[a]=JW(a,s)?AC[a](o):ni(r[a],o);}this.emit("level-change",t,i,e[n],n,this);}function XW(t){let{levels:e,levelVal:r}=this;return e&&e.labels?e.labels[r]:""}function QW(t){let{values:e}=this.levels,r=e[t];return r!==void 0&&r>=this[Th]}function eB(t=null,e=!1){let r=t?Object.keys(t).reduce((s,o)=>(s[t[o]]=o,s),{}):null,n=Object.assign(Object.create(Object.prototype,{Infinity:{value:"silent"}}),e?null:Ah,r),i=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),e?null:Mr,t);return {labels:n,values:i}}function tB(t,e,r){if(typeof t=="number"){if(![].concat(Object.keys(e||{}).map(s=>e[s]),r?[]:Object.keys(Ah).map(s=>+s),1/0).includes(t))throw Error(`default level:${t} must be included in custom levels`);return}let n=Object.assign(Object.create(Object.prototype,{silent:{value:1/0}}),r?null:Mr,e);if(!(t in n))throw Error(`default level:${t} must be included in custom levels`)}function rB(t,e){let{labels:r,values:n}=t;for(let i in e){if(i in n)throw Error("levels cannot be overridden");if(e[i]in r)throw Error("pre-existing level values cannot be used for new levels")}}PC.exports={initialLsCache:KW,genLsCache:ZW,levelMethods:AC,getLevel:XW,setLevel:YW,isLevelEnabled:QW,mappings:eB,levels:Mr,assertNoLevelCollisions:rB,assertDefaultLevelFound:tB};});var Ph=A((e8,DC)=>{DC.exports={version:"8.17.1"};});var HC=A((r8,jC)=>{var{EventEmitter:nB}=oe("events"),{lsCacheSym:iB,levelValSym:sB,setLevelSym:Oh,getLevelSym:OC,chindingsSym:Ih,parsedChindingsSym:oB,mixinSym:aB,asJsonSym:NC,writeSym:uB,mixinMergeStrategySym:cB,timeSym:lB,timeSliceIndexSym:fB,streamSym:qC,serializersSym:ii,formattersSym:Dh,errorKeySym:dB,messageKeySym:hB,useOnlyCustomLevelsSym:pB,needsMetadataGsym:mB,redactFmtSym:gB,stringifySym:_B,formatOptsSym:yB,stringifiersSym:bB,msgPrefixSym:IC}=Ui(),{getLevel:vB,setLevel:wB,isLevelEnabled:SB,mappings:EB,initialLsCache:RB,genLsCache:CB,assertNoLevelCollisions:xB}=Cu(),{asChindings:LC,asJson:TB,buildFormatters:kC,stringify:MC}=Ru(),{version:AB}=Ph(),PB=fh(),DB=class{},$C={constructor:DB,child:OB,bindings:IB,setBindings:kB,flush:qB,isLevelEnabled:SB,version:AB,get level(){return this[OC]()},set level(t){this[Oh](t);},get levelVal(){return this[sB]},set levelVal(t){throw Error("levelVal is read-only")},[iB]:RB,[uB]:FB,[NC]:TB,[OC]:vB,[Oh]:wB};Object.setPrototypeOf($C,nB.prototype);jC.exports=function(){return Object.create($C)};var FC=t=>t;function OB(t,e){if(!t)throw Error("missing bindings for child Pino");e=e||{};let r=this[ii],n=this[Dh],i=Object.create(this);if(e.hasOwnProperty("serializers")===!0){i[ii]=Object.create(null);for(let c in r)i[ii][c]=r[c];let l=Object.getOwnPropertySymbols(r);for(var s=0;s{var{hasOwnProperty:xu}=Object.prototype,oi=Fh();oi.configure=Fh;oi.stringify=oi;oi.default=oi;Nh.stringify=oi;Nh.configure=Fh;zC.exports=oi;var LB=/[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/;function xn(t){return t.length<5e3&&!LB.test(t)?`"${t}"`:JSON.stringify(t)}function kh(t){if(t.length>200)return t.sort();for(let e=1;er;)t[n]=t[n-1],n--;t[n]=r;}return t}var $B=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Int8Array)),Symbol.toStringTag).get;function Mh(t){return $B.call(t)!==void 0&&t.length!==0}function WC(t,e,r){t.length= 1`)}return r===void 0?1/0:r}function si(t){return t===1?"1 item":`${t} items`}function HB(t){let e=new Set;for(let r of t)(typeof r=="string"||typeof r=="number")&&e.add(String(r));return e}function WB(t){if(xu.call(t,"strict")){let e=t.strict;if(typeof e!="boolean")throw new TypeError('The "strict" argument must be of type boolean');if(e)return r=>{let n=`Object can not safely be stringified. Received type ${typeof r}`;throw typeof r!="function"&&(n+=` (${r.toString()})`),new Error(n)}}}function Fh(t){t={...t};let e=WB(t);e&&(t.bigint===void 0&&(t.bigint=!1),"circularValue"in t||(t.circularValue=Error));let r=jB(t),n=BC(t,"bigint"),i=BC(t,"deterministic"),s=UC(t,"maximumDepth"),o=UC(t,"maximumBreadth");function a(m,_,w,E,P,D){let g=_[m];switch(typeof g=="object"&&g!==null&&typeof g.toJSON=="function"&&(g=g.toJSON(m)),g=E.call(_,m,g),typeof g){case"string":return xn(g);case"object":{if(g===null)return "null";if(w.indexOf(g)!==-1)return r;let S="",I=",",L=D;if(Array.isArray(g)){if(g.length===0)return "[]";if(so){let ye=g.length-o-1;S+=`${I}"... ${si(ye)} not stringified"`;}return P!==""&&(S+=` +${L}`),w.pop(),`[${S}]`}let Z=Object.keys(g),K=Z.length;if(K===0)return "{}";if(so){let N=K-o;S+=`${B}"...":${U}"${si(N)} not stringified"`,B=I;}return P!==""&&B.length>1&&(S=` +${D}${S} +${L}`),w.pop(),`{${S}}`}case"number":return isFinite(g)?String(g):e?e(g):"null";case"boolean":return g===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(g);default:return e?e(g):void 0}}function l(m,_,w,E,P,D){switch(typeof _=="object"&&_!==null&&typeof _.toJSON=="function"&&(_=_.toJSON(m)),typeof _){case"string":return xn(_);case"object":{if(_===null)return "null";if(w.indexOf(_)!==-1)return r;let g=D,S="",I=",";if(Array.isArray(_)){if(_.length===0)return "[]";if(so){let Q=_.length-o-1;S+=`${I}"... ${si(Q)} not stringified"`;}return P!==""&&(S+=` +${g}`),w.pop(),`[${S}]`}w.push(_);let L="";P!==""&&(D+=P,I=`, +${D}`,L=" ");let Z="";for(let K of E){let U=l(K,_[K],w,E,P,D);U!==void 0&&(S+=`${Z}${xn(K)}:${L}${U}`,Z=I);}return P!==""&&Z.length>1&&(S=` +${D}${S} +${g}`),w.pop(),`{${S}}`}case"number":return isFinite(_)?String(_):e?e(_):"null";case"boolean":return _===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(_);default:return e?e(_):void 0}}function d(m,_,w,E,P){switch(typeof _){case"string":return xn(_);case"object":{if(_===null)return "null";if(typeof _.toJSON=="function"){if(_=_.toJSON(m),typeof _!="object")return d(m,_,w,E,P);if(_===null)return "null"}if(w.indexOf(_)!==-1)return r;let D=P;if(Array.isArray(_)){if(_.length===0)return "[]";if(so){let ae=_.length-o-1;U+=`${B}"... ${si(ae)} not stringified"`;}return U+=` +${D}`,w.pop(),`[${U}]`}let g=Object.keys(_),S=g.length;if(S===0)return "{}";if(so){let U=S-o;L+=`${Z}"...": "${si(U)} not stringified"`,Z=I;}return Z!==""&&(L=` +${P}${L} +${D}`),w.pop(),`{${L}}`}case"number":return isFinite(_)?String(_):e?e(_):"null";case"boolean":return _===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(_);default:return e?e(_):void 0}}function c(m,_,w){switch(typeof _){case"string":return xn(_);case"object":{if(_===null)return "null";if(typeof _.toJSON=="function"){if(_=_.toJSON(m),typeof _!="object")return c(m,_,w);if(_===null)return "null"}if(w.indexOf(_)!==-1)return r;let E="";if(Array.isArray(_)){if(_.length===0)return "[]";if(so){let K=_.length-o-1;E+=`,"... ${si(K)} not stringified"`;}return w.pop(),`[${E}]`}let P=Object.keys(_),D=P.length;if(D===0)return "{}";if(so){let I=D-o;E+=`${g}"...":"${si(I)} not stringified"`;}return w.pop(),`{${E}}`}case"number":return isFinite(_)?String(_):e?e(_):"null";case"boolean":return _===!0?"true":"false";case"undefined":return;case"bigint":if(n)return String(_);default:return e?e(_):void 0}}function p(m,_,w){if(arguments.length>1){let E="";if(typeof w=="number"?E=" ".repeat(Math.min(w,10)):typeof w=="string"&&(E=w.slice(0,10)),_!=null){if(typeof _=="function")return a("",{"":m},[],_,E,"");if(Array.isArray(_))return l("",m,[],HB(_),E,"")}if(E.length!==0)return d("",m,[],E,"")}return c("",m,[])}return p}});var ZC=A((n8,KC)=>{var qh=Symbol.for("pino.metadata"),{levels:GC}=Cu(),BB=GC.info;function UB(t,e){let r=0;t=t||[],e=e||{dedupe:!1};let n=Object.create(GC);n.silent=1/0,e.levels&&typeof e.levels=="object"&&Object.keys(e.levels).forEach(c=>{n[c]=e.levels[c];});let i={write:s,add:a,flushSync:o,end:l,minLevel:0,streams:[],clone:d,[qh]:!0,streamLevels:n};return Array.isArray(t)?t.forEach(a,i):a.call(i,t),t=null,i;function s(c){let p,m=this.lastLevel,{streams:_}=this,w=0,E;for(let P=VB(_.length,e.dedupe);KB(P,_.length,e.dedupe);P=GB(P,e.dedupe))if(p=_[P],p.level<=m){if(w!==0&&w!==p.level)break;if(E=p.stream,E[qh]){let{lastTime:D,lastMsg:g,lastObj:S,lastLogger:I}=this;E.lastLevel=m,E.lastTime=D,E.lastMsg=g,E.lastObj=S,E.lastLogger=I;}E.write(c),e.dedupe&&(w=p.level);}else if(!e.dedupe)break}function o(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync();}function a(c){if(!c)return i;let p=typeof c.write=="function"||c.stream,m=c.write?c:c.stream;if(!p)throw Error("stream object needs to implement either StreamEntry or DestinationStream interface");let{streams:_,streamLevels:w}=this,E;typeof c.levelVal=="number"?E=c.levelVal:typeof c.level=="string"?E=w[c.level]:typeof c.level=="number"?E=c.level:E=BB;let P={stream:m,level:E,levelVal:void 0,id:r++};return _.unshift(P),_.sort(zB),this.minLevel=_[0].level,i}function l(){for(let{stream:c}of this.streams)typeof c.flushSync=="function"&&c.flushSync(),c.end();}function d(c){let p=new Array(this.streams.length);for(let m=0;m=0:t{var ZB=oe("os"),nx=nh(),JB=ih(),YB=fh(),ix=UR(),XB=HC(),sx=Ui(),{configure:QB}=VC(),{assertDefaultLevelFound:eU,mappings:ox,genLsCache:tU,levels:rU}=Cu(),{createArgsNormalizer:nU,asChindings:iU,buildSafeSonicBoom:JC,buildFormatters:sU,stringify:Lh,normalizeDestFileDescriptor:YC,noop:oU}=Ru(),{version:aU}=Ph(),{chindingsSym:XC,redactFmtSym:uU,serializersSym:QC,timeSym:cU,timeSliceIndexSym:lU,streamSym:fU,stringifySym:ex,stringifySafeSym:$h,stringifiersSym:tx,setLevelSym:dU,endSym:hU,formatOptsSym:pU,messageKeySym:mU,errorKeySym:gU,nestedKeySym:_U,mixinSym:yU,useOnlyCustomLevelsSym:bU,formattersSym:rx,hooksSym:vU,nestedKeyStrSym:wU,mixinMergeStrategySym:SU,msgPrefixSym:EU}=sx,{epochTime:ax,nullTime:RU}=ix,{pid:CU}=process,xU=ZB.hostname(),TU=nx.err,AU={level:"info",levels:rU,messageKey:"msg",errorKey:"err",nestedKey:null,enabled:!0,base:{pid:CU,hostname:xU},serializers:Object.assign(Object.create(null),{err:TU}),formatters:Object.assign(Object.create(null),{bindings(t){return t},level(t,e){return {level:e}}}),hooks:{logMethod:void 0},timestamp:ax,name:void 0,redact:null,customLevels:null,useOnlyCustomLevels:!1,depthLimit:5,edgeLimit:100},PU=nU(AU),DU=Object.assign(Object.create(null),nx);function jh(...t){let e={},{opts:r,stream:n}=PU(e,JB(),...t),{redact:i,crlf:s,serializers:o,timestamp:a,messageKey:l,errorKey:d,nestedKey:c,base:p,name:m,level:_,customLevels:w,mixin:E,mixinMergeStrategy:P,useOnlyCustomLevels:D,formatters:g,hooks:S,depthLimit:I,edgeLimit:L,onChild:Z,msgPrefix:K}=r,U=QB({maximumDepth:I,maximumBreadth:L}),B=sU(g.level,g.bindings,g.log),Q=Lh.bind({[$h]:U}),N=i?YB(i,Q):{},te=i?{stringify:N[uU]}:{stringify:Q},ae="}"+(s?`\r `:` -`),te=yk.bind(null,{[rS]:"",[nS]:o,[sS]:R,[iS]:Tu,[Iu]:L,[oS]:M}),I="";p!==null&&(m===void 0?I=te(p):I=te(Object.assign({},p,{name:m})));let O=l instanceof Function?l:l?fS:Dk,X=O().indexOf(":")+1;if(A&&!y)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(S&&typeof S!="function")throw Error(`Unknown mixin type "${typeof S}" - expected "function"`);if(B&&typeof B!="string")throw Error(`Unknown msgPrefix type "${typeof B}" - expected "string"`);pk(g,y,A);let Q=cS(y,A);return Object.assign(e,{levels:Q,[Mk]:A,[xk]:n,[Ek]:O,[Ak]:X,[iS]:Tu,[Iu]:L,[sS]:R,[Rk]:G,[Tk]:z,[Ik]:f,[Pk]:d,[Ok]:u,[kk]:u?`,${JSON.stringify(u)}:{`:"",[nS]:o,[Fk]:S,[Lk]:E,[rS]:I,[oS]:M,[Nk]:T,silent:bk,onChild:H,[$k]:B}),Object.setPrototypeOf(e,hk()),mk(e),e[Ck](g),e}it.exports=Pu;it.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=tS(t.dest||process.stdout.fd),eS(t)):eS({dest:tS(t),minLength:0});it.exports.transport=du();it.exports.multistream=Qb();it.exports.levels=cS();it.exports.stdSerializers=Wk;it.exports.stdTimeFunctions=Object.assign({},lS);it.exports.symbols=uS;it.exports.version=Sk;it.exports.default=Pu;it.exports.pino=Pu;});var $n=x(zt=>{Object.defineProperty(zt,"__esModule",{value:!0});zt.Frequency=zt.KeepLogFiles=void 0;(function(t){t[t.days=1]="days",t[t.fileCount=2]="fileCount";})(zt.KeepLogFiles||(zt.KeepLogFiles={}));(function(t){t[t.daily=1]="daily",t[t.minutes=2]="minutes",t[t.hours=3]="hours",t[t.date=4]="date",t[t.none=5]="none";})(zt.Frequency||(zt.Frequency={}));});var pS=x(Fu=>{Object.defineProperty(Fu,"__esModule",{value:!0});var dS=$n(),Ou=class{static fileStreamRotatorOptions(e){return Object.assign(Object.assign({},{filename:"",verbose:!1,end_stream:!1,utc:!1,create_symlink:!1,symlink_name:"current.log"}),e)}static fileOptions(e){return Object.assign(Object.assign({},{flags:"a"}),e)}static auditSettings(e){let r={keepSettings:{type:dS.KeepLogFiles.fileCount,amount:10},auditFilename:"audit.json",hashType:"md5",extension:"",files:[]};return Object.assign(Object.assign({},r),e)}static rotationSettings(e){let r={filename:"",frequency:dS.Frequency.none,utc:!1};return Object.assign(Object.assign({},r),e)}static extractParam(e,r=!0){let n=e.toString().match(/(\w)$/),s={number:0};n?.length==2&&(s.letter=n[1].toLowerCase());let i=e.toString().match(/^(\d+)/);return i?.length==2&&(s.number=Number(i[1])),s}};Fu.default=Ou;});var Ls=x(Br=>{Object.defineProperty(Br,"__esModule",{value:!0});Br.Logger=Br.makeDirectory=void 0;var Vk=K("fs"),Kk=K("path");function Zk(t){if(t.trim()!==""){var e=Kk.dirname(t);try{Vk.mkdirSync(e,{recursive:!0});}catch(r){if(r.code!=="EEXIST")throw r}}}Br.makeDirectory=Zk;var Mu=class t{constructor(){this.isVerbose=!1,this.allowDebug=!1;}static getInstance(e,r){return t.instance||(t.instance=new t,t.instance.isVerbose=e??!1,t.instance.allowDebug=r??!1),t.instance}static verbose(...e){t.getInstance().isVerbose&&console.log.apply(null,[new Date,"[FileStreamRotator:VERBOSE]",...e]);}static log(...e){console.log.apply(null,[new Date,"[FileStreamRotator]",...e]);}static debug(...e){t.getInstance().allowDebug&&console.debug.apply(null,[new Date,"[FileStreamRotator:DEBUG]",...e]);}};Br.Logger=Mu;});var gS=x(ku=>{Object.defineProperty(ku,"__esModule",{value:!0});var mS=K("fs"),Je=$n(),cr=Ls(),Nu=class t{constructor(e,r){var n;switch(this.currentSize=0,this.lastDate="",this.fileIndx=0,this.settings=e,this.settings.frequency){case Je.Frequency.hours:this.settings.amount&&this.settings.amount<13?this.settings.amount&&this.settings.amount>0||(this.settings.amount=1):this.settings.amount=12,this.isFormatValidForHour()||(cr.Logger.log("Date format not suitable for X hours rotation. Changing date format to 'YMDHm'"),this.settings.format="YMDHm");break;case Je.Frequency.minutes:this.settings.amount&&this.settings.amount<31?this.settings.amount&&this.settings.amount>0||(this.settings.amount=1):this.settings.amount=30,this.isFormatValidForMinutes()||(this.settings.format="YMDHm",cr.Logger.log("Date format not suitable for X minutes rotation. Changing date format to 'YMDHm'"));break;case Je.Frequency.daily:this.isFormatValidForDaily()||(this.settings.format="YMD",cr.Logger.log("Date format not suitable for daily rotation. Changing date format to 'YMD'"));break}if(this.settings.frequency!==Je.Frequency.none&&!this.settings.filename.match("%DATE%")&&(this.settings.filename+=".%DATE%",cr.Logger.log("Appending date to the end of the filename")),this.lastDate=this.getDateString(),this.settings.maxSize&&r){let i=new Date(r.date),o=(n=this.settings.extension)!==null&&n!==void 0?n:"";if(cr.Logger.debug(this.getDateString(i)==this.getDateString(new Date),this.getDateString(i),this.getDateString(new Date)),this.getDateString(i)==this.getDateString(new Date)){let l=r.name.match(RegExp("(\\d+)"+o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")));l&&(this.fileIndx=Number(l[1]));var s=this.getSizeForFile(this.getNewFilename());s&&(this.currentSize=s),this.lastDate=this.getDateString(i),cr.Logger.debug("LOADED LAST ENTRY",this.currentSize,this.lastDate,this.fileIndx);}else {var s=this.getSizeForFile(this.getNewFilename());s&&(this.currentSize=s),cr.Logger.debug("CURRENT FILE:",this.getNewFilename(),this.currentSize);}}}getSizeForFile(e){try{if(mS.existsSync(e)){var r=mS.statSync(this.getNewFilename());if(r)return r.size}}catch{return}}hasMaxSizeReached(){return this.settings.maxSize?this.currentSize>this.settings.maxSize:!1}shouldRotate(){let e=this.hasMaxSizeReached();switch(this.settings.frequency){case Je.Frequency.none:return e;case Je.Frequency.hours:case Je.Frequency.minutes:case Je.Frequency.date:case Je.Frequency.daily:default:let r=this.getDateString();return this.lastDate!=r?!0:e}}isFormatValidForDaily(){let e=new Date(2022,2,20,1,2,3),r=new Date(2022,2,20,23,55,45),n=new Date(2022,2,21,2,55,45);return this.getDateString(e)===this.getDateString(r)&&this.getDateString(e)!==this.getDateString(n)}isFormatValidForHour(){if(!this.settings.amount||this.settings.frequency!=Je.Frequency.hours)return !1;let e=new Date(2022,2,20,1,2,3),r=new Date(2022,2,20,2+this.settings.amount,55,45);return this.getDateString(e)!==this.getDateString(r)}isFormatValidForMinutes(){if(!this.settings.amount||this.settings.frequency!=Je.Frequency.minutes)return !1;let e=new Date(2022,2,20,1,2,3),r=new Date(2022,2,20,1,2+this.settings.amount,45);return this.getDateString(e)!==this.getDateString(r)}getDateString(e){let r=e||new Date,n=t.getDateComponents(r,this.settings.utc),s=this.settings.format;if(s){switch(this.settings.frequency){case Je.Frequency.hours:if(this.settings.amount){var i=Math.floor(n.hour/this.settings.amount)*this.settings.amount;n.hour=i,n.minute=0,n.second=0;}case Je.Frequency.minutes:if(this.settings.amount){var o=Math.floor(n.minute/this.settings.amount)*this.settings.amount;n.minute=o,n.second=0;}}return s?.replace(/D+/,n.day.toString().padStart(2,"0")).replace(/M+/,n.month.toString().padStart(2,"0")).replace(/Y+/,n.year.toString()).replace(/H+/,n.hour.toString().padStart(2,"0")).replace(/m+/,n.minute.toString().padStart(2,"0")).replace(/s+/,n.second.toString().padStart(2,"0")).replace(/A+/,n.hour>11?"PM":"AM")}return ""}getFilename(e,r){return e.replace("%DATE%",this.lastDate)+(this.settings.maxSize||this.fileIndx>0?"."+this.fileIndx:"")+(r||"")}getNewFilename(){return this.getFilename(this.settings.filename,this.settings.extension)}addBytes(e){this.currentSize+=e;}rotate(e=!1){return e?(this.fileIndx+=1,this.currentSize=0,this.lastDate=this.getDateString()):this.shouldRotate()&&(this.hasMaxSizeReached()?this.fileIndx+=1:this.fileIndx=0,this.currentSize=0,this.lastDate=this.getDateString()),this.getNewFilename()}static getDateComponents(e,r){return r?{day:e.getUTCDate(),month:e.getUTCMonth()+1,year:e.getUTCFullYear(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),utc:r,source:e}:{day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),utc:r,source:e}}static createDate(e,r){return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second)}};ku.default=Nu;});var _S=x(Du=>{Object.defineProperty(Du,"__esModule",{value:!0});var $s=K("fs"),Yk=K("path"),Jk=$n(),bt=Ls(),Lu=K("crypto"),$u=class{constructor(e,r){this.config=e,this.emitter=r,this.loadLog();}loadLog(){var e;if(!this.config.keepSettings||((e=this.config.keepSettings)===null||e===void 0?void 0:e.amount)==0||!this.config.auditFilename||this.config.auditFilename==""){bt.Logger.verbose("no existing audit settings found",this.config);return}try{let r=Yk.resolve(this.config.auditFilename),n=JSON.parse($s.readFileSync(r,{encoding:"utf-8"}));this.config.files=n.files;}catch(r){if(r.code!=="ENOENT"){bt.Logger.log("Failed to load config file",r);return}}}writeLog(){if(this.config.auditFilename)try{(0, bt.makeDirectory)(this.config.auditFilename),$s.writeFileSync(this.config.auditFilename,JSON.stringify(this.config,null,4));}catch(e){bt.Logger.verbose("ERROR: Failed to store log audit",e);}}addLog(e){var r;if(!this.config.keepSettings||((r=this.config.keepSettings)===null||r===void 0?void 0:r.amount)==0||!this.config.auditFilename||this.config.auditFilename==""){bt.Logger.verbose("audit log missing");return}if(this.config.files.findIndex(i=>i.name===e)!==-1){bt.Logger.debug("file already in the log",e);return}var n=Date.now();if(this.config.files.push({date:n,name:e,hash:Lu.createHash(this.config.hashType).update(e+"LOG_FILE"+n).digest("hex")}),bt.Logger.debug(`added file ${e} to log`),this.config.keepSettings&&this.config.keepSettings.amount){if(this.config.keepSettings.type==Jk.KeepLogFiles.days){let i=Date.now()-86400*this.config.keepSettings.amount*1e3,o=this.config.files.filter(l=>{if(l.date>=i)return !0;this.removeLog(l);});this.config.files=o;}else if(this.config.files.length>this.config.keepSettings.amount){var s=this.config.files.splice(-this.config.keepSettings.amount);this.config.files.length>0&&this.config.files.filter(i=>(this.removeLog(i),!1)),this.config.files=s;}}this.writeLog();}removeLog(e){if(e.hash===Lu.createHash(this.config.hashType).update(e.name+"LOG_FILE"+e.date).digest("hex"))try{$s.existsSync(e.name)&&(bt.Logger.debug("removing log file",e.name),$s.unlinkSync(e.name),this.emitter.emit("logRemoved",e.name));}catch{bt.Logger.verbose("Could not remove old log file: ",e.name);}else bt.Logger.debug("incorrect hash",e.name,e.hash,Lu.createHash(this.config.hashType).update(e.name+"LOG_FILE"+e.date).digest("hex"));}};Du.default=$u;});var wS=x(Uu=>{Object.defineProperty(Uu,"__esModule",{value:!0});var Xk=K("stream"),Ur=K("fs"),qu=K("path"),Tt=$n(),It=pS(),yS=gS(),Qk=_S(),Dn=Ls(),Bu=class t extends Xk.EventEmitter{constructor(e,r=!1){var n,s;super(),this.config={},this.config=this.parseOptions(e),Dn.Logger.getInstance(e.verbose,r),this.auditManager=new Qk.default((n=this.config.auditSettings)!==null&&n!==void 0?n:It.default.auditSettings({}),this);let i=this.auditManager.config.files.slice(-1).shift();this.rotator=new yS.default((s=this.config.rotationSettings)!==null&&s!==void 0?s:It.default.rotationSettings({}),i),this.rotate();}static getStream(e){return new t(e)}parseOptions(e){var r,n,s,i;let o={};o.options=It.default.fileStreamRotatorOptions(e),o.fileOptions=It.default.fileOptions((r=e.file_options)!==null&&r!==void 0?r:{});let l=It.default.auditSettings({});if(e.audit_file&&(l.auditFilename=e.audit_file),e.audit_hash_type&&(l.hashType=e.audit_hash_type),e.extension&&(l.extension=e.extension),e.max_logs){let d=It.default.extractParam(e.max_logs);l.keepSettings={type:((n=d.letter)===null||n===void 0?void 0:n.toLowerCase())=="d"?Tt.KeepLogFiles.days:Tt.KeepLogFiles.fileCount,amount:d.number};}switch(o.auditSettings=l,o.rotationSettings=It.default.rotationSettings({filename:e.filename,extension:e.extension}),e.date_format&&!e.frequency?o.rotationSettings.frequency=Tt.Frequency.date:o.rotationSettings.frequency=Tt.Frequency.none,e.date_format&&(o.rotationSettings.format=e.date_format),o.rotationSettings.utc=(s=e.utc)!==null&&s!==void 0?s:!1,e.frequency){case"daily":o.rotationSettings.frequency=Tt.Frequency.daily;break;case"custom":case"date":o.rotationSettings.frequency=Tt.Frequency.date;break;case"test":o.rotationSettings.frequency=Tt.Frequency.minutes,o.rotationSettings.amount=1;break;default:if(e.frequency){let d=It.default.extractParam(e.frequency);!((i=d.letter)===null||i===void 0)&&i.match(/^([mh])$/)&&(o.rotationSettings.frequency=d.letter=="h"?Tt.Frequency.hours:Tt.Frequency.minutes,o.rotationSettings.amount=d.number);}}if(e.size){let d=It.default.extractParam(e.size);switch(d.letter){case"k":o.rotationSettings.maxSize=d.number*1024;break;case"m":o.rotationSettings.maxSize=d.number*1024*1024;break;case"g":o.rotationSettings.maxSize=d.number*1024*1024*1024;break}}this.rotator=new yS.default(o.rotationSettings);this.rotator.getNewFilename();return o}rotate(e=!1){var r;let n=this.currentFile;this.rotator.rotate(e),this.currentFile=this.rotator.getNewFilename(),this.currentFile!=n&&(this.fs&&(((r=this.config.options)===null||r===void 0?void 0:r.end_stream)===!0?this.fs.end():this.fs.destroy()),n&&this.auditManager.addLog(n),this.createNewLog(this.currentFile),this.emit("new",this.currentFile),this.emit("rotate",n,this.currentFile,e));}createNewLog(e){var r;(0, Dn.makeDirectory)(e),this.auditManager.addLog(e);let n={};this.config.fileOptions&&(n=this.config.fileOptions),this.fs=Ur.createWriteStream(e,n),this.bubbleEvents(this.fs,e),!((r=this.config.options)===null||r===void 0)&&r.create_symlink&&this.createCurrentSymLink(e);}write(e,r){this.fs&&(this.rotator.shouldRotate()&&this.rotate(),this.fs.write(e,r??"utf8"),this.rotator.addBytes(Buffer.byteLength(e,r)),this.rotator.hasMaxSizeReached()&&this.rotate());}end(e){this.fs&&(this.fs.end(e),this.fs=void 0);}bubbleEvents(e,r){e.on("close",()=>{this.emit("close");}),e.on("finish",()=>{this.emit("finish");}),e.on("error",n=>{this.emit("error",n);}),e.on("open",n=>{this.emit("open",r);});}createCurrentSymLink(e){var r,n;if(!e)return;let s=(n=(r=this.config.options)===null||r===void 0?void 0:r.symlink_name)!==null&&n!==void 0?n:"current.log",i=qu.dirname(e),o=qu.basename(e),l=i+qu.sep+s;try{if(Ur.existsSync(l)){if(Ur.lstatSync(l).isSymbolicLink()){Ur.unlinkSync(l),Ur.symlinkSync(o,l);return}Dn.Logger.verbose("Could not create symlink file as file with the same name exists: ",l);}else Ur.symlinkSync(o,l);}catch(f){Dn.Logger.verbose("[Could not create symlink file: ",l," -> ",o),Dn.Logger.debug("error creating sym link",l,f);}}test(){return {config:this.config,rotator:this.rotator}}};Uu.default=Bu;});var bS=x(Ds=>{Object.defineProperty(Ds,"__esModule",{value:!0});Ds.getStream=void 0;var eL=wS();function tL(t){return new eL.default(t)}Ds.getStream=tL;});var xS=x((vq,AS)=>{AS.exports=function(){function t(n,s){function i(){this.constructor=n;}i.prototype=s.prototype,n.prototype=new i;}function e(n,s,i,o,l,f){this.message=n,this.expected=s,this.found=i,this.offset=o,this.line=l,this.column=f,this.name="SyntaxError";}t(e,Error);function r(n){var s=arguments.length>1?arguments[1]:{},i={},o={start:Pc},l=Pc,d=function(){return Zc},u=i,p="#",m={type:"literal",value:"#",description:'"#"'},g=void 0,y={type:"any",description:"any character"},S="[",E={type:"literal",value:"[",description:'"["'},A="]",b={type:"literal",value:"]",description:'"]"'},T=function(a){ao(Fe("ObjectPath",a,Pe,Oe));},F=function(a){ao(Fe("ArrayPath",a,Pe,Oe));},k=function(a,h){return a.concat(h)},H=function(a){return [a]},B=function(a){return a},L=".",M={type:"literal",value:".",description:'"."'},U="=",R={type:"literal",value:"=",description:'"="'},z=function(a,h){ao(Fe("Assign",h,Pe,Oe,a));},G=function(a){return a.join("")},te=function(a){return a.value},I='"""',O={type:"literal",value:'"""',description:'"\\"\\"\\""'},X=null,Q=function(a){return Fe("String",a.join(""),Pe,Oe)},ie='"',$e={type:"literal",value:'"',description:'"\\""'},ve="'''",Pt={type:"literal",value:"'''",description:`"'''"`},Gr="'",Ot={type:"literal",value:"'",description:`"'"`},st=function(a){return a},oe=function(a){return a},dr="\\",eo={type:"literal",value:"\\",description:'"\\\\"'},Z=function(){return ""},de="e",W={type:"literal",value:"e",description:'"e"'},ne="E",pe={type:"literal",value:"E",description:'"E"'},Ie=function(a,h){return Fe("Float",parseFloat(a+"e"+h),Pe,Oe)},ye=function(a){return Fe("Float",parseFloat(a),Pe,Oe)},Vt="+",Ft={type:"literal",value:"+",description:'"+"'},ac=function(a){return a.join("")},Vr="-",Kr={type:"literal",value:"-",description:'"-"'},lc=function(a){return "-"+a.join("")},Sv=function(a){return Fe("Integer",parseInt(a,10),Pe,Oe)},uc="true",vv={type:"literal",value:"true",description:'"true"'},Ev=function(){return Fe("Boolean",!0,Pe,Oe)},cc="false",Av={type:"literal",value:"false",description:'"false"'},xv=function(){return Fe("Boolean",!1,Pe,Oe)},Cv=function(){return Fe("Array",[],Pe,Oe)},Rv=function(a){return Fe("Array",a?[a]:[],Pe,Oe)},Tv=function(a){return Fe("Array",a,Pe,Oe)},Iv=function(a,h){return Fe("Array",a.concat(h),Pe,Oe)},fc=function(a){return a},hc=",",dc={type:"literal",value:",",description:'","'},Pv="{",Ov={type:"literal",value:"{",description:'"{"'},Fv="}",Mv={type:"literal",value:"}",description:'"}"'},Nv=function(a){return Fe("InlineTable",a,Pe,Oe)},pc=function(a,h){return Fe("InlineTableValue",h,Pe,Oe,a)},kv=function(a){return "."+a},Lv=function(a){return a.join("")},Zr=":",Yr={type:"literal",value:":",description:'":"'},mc=function(a){return a.join("")},gc="T",_c={type:"literal",value:"T",description:'"T"'},$v="Z",Dv={type:"literal",value:"Z",description:'"Z"'},qv=function(a,h){return Fe("Date",new Date(a+"T"+h+"Z"),Pe,Oe)},Bv=function(a,h){return Fe("Date",new Date(a+"T"+h),Pe,Oe)},Uv=/^[ \t]/,Hv={type:"class",value:"[ \\t]",description:"[ \\t]"},yc=` -`,wc={type:"literal",value:` -`,description:'"\\n"'},jv="\r",Wv={type:"literal",value:"\r",description:'"\\r"'},zv=/^[0-9a-f]/i,Gv={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},Vv=/^[0-9]/,Kv={type:"class",value:"[0-9]",description:"[0-9]"},Zv="_",Yv={type:"literal",value:"_",description:'"_"'},Jv=function(){return ""},Xv=/^[A-Za-z0-9_\-]/,Qv={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},eE=function(a){return a.join("")},bc='\\"',tE={type:"literal",value:'\\"',description:'"\\\\\\""'},rE=function(){return '"'},Sc="\\\\",nE={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},iE=function(){return "\\"},vc="\\b",sE={type:"literal",value:"\\b",description:'"\\\\b"'},oE=function(){return "\b"},Ec="\\t",aE={type:"literal",value:"\\t",description:'"\\\\t"'},lE=function(){return " "},Ac="\\n",uE={type:"literal",value:"\\n",description:'"\\\\n"'},cE=function(){return ` -`},xc="\\f",fE={type:"literal",value:"\\f",description:'"\\\\f"'},hE=function(){return "\f"},Cc="\\r",dE={type:"literal",value:"\\r",description:'"\\\\r"'},pE=function(){return "\r"},Rc="\\U",mE={type:"literal",value:"\\U",description:'"\\\\U"'},Tc=function(a){return kE(a.join(""))},Ic="\\u",gE={type:"literal",value:"\\u",description:'"\\\\u"'},c=0,Y=0,Jr=0,to={line:1,column:1,seenCR:!1},Gn=0,ro=[],D=0,q={},Vn;if("startRule"in s){if(!(s.startRule in o))throw new Error(`Can't start parsing from rule "`+s.startRule+'".');l=o[s.startRule];}function Pe(){return no(Y).line}function Oe(){return no(Y).column}function no(a){function h(_,w,v){var P,N;for(P=w;Pa&&(Jr=0,to={line:1,column:1,seenCR:!1}),h(to,Jr,a),Jr=a),to}function j(a){cGn&&(Gn=c,ro=[]),ro.push(a));}function io(a,h,_){function w(V){var re=1;for(V.sort(function(ce,le){return ce.descriptionle.description?1:0});re1?le.slice(0,-1).join(", ")+" or "+le[V.length-1]:le[0],we=re?'"'+ce(re)+'"':"end of input","Expected "+ge+" but "+we+" found."}var P=no(_),N=_c?(P=n.charAt(c),c++):(P=i,D===0&&j(y)),P!==i?(v=[v,P],w=v):(c=w,w=u)):(c=w,w=u);w!==i;)_.push(w),w=c,v=c,D++,P=Qe(),P===i&&(P=Yn()),D--,P===i?v=g:(c=v,v=u),v!==i?(n.length>c?(P=n.charAt(c),c++):(P=i,D===0&&j(y)),P!==i?(v=[v,P],w=v):(c=w,w=u)):(c=w,w=u);_!==i?(h=[h,_],a=h):(c=a,a=u);}else c=a,a=u;return q[N]={nextPos:c,result:a},a}function yE(){var a,h,_,w,v,P,N=c*49+4,V=q[N];if(V)return c=V.nextPos,V.result;if(a=c,n.charCodeAt(c)===91?(h=S,c++):(h=i,D===0&&j(E)),h!==i){for(_=[],w=J();w!==i;)_.push(w),w=J();if(_!==i)if(w=Fc(),w!==i){for(v=[],P=J();P!==i;)v.push(P),P=J();v!==i?(n.charCodeAt(c)===93?(P=A,c++):(P=i,D===0&&j(b)),P!==i?(Y=a,h=T(w),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;else c=a,a=u;}else c=a,a=u;return q[N]={nextPos:c,result:a},a}function wE(){var a,h,_,w,v,P,N,V,re=c*49+5,ce=q[re];if(ce)return c=ce.nextPos,ce.result;if(a=c,n.charCodeAt(c)===91?(h=S,c++):(h=i,D===0&&j(E)),h!==i)if(n.charCodeAt(c)===91?(_=S,c++):(_=i,D===0&&j(E)),_!==i){for(w=[],v=J();v!==i;)w.push(v),v=J();if(w!==i)if(v=Fc(),v!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(n.charCodeAt(c)===93?(N=A,c++):(N=i,D===0&&j(b)),N!==i?(n.charCodeAt(c)===93?(V=A,c++):(V=i,D===0&&j(b)),V!==i?(Y=a,h=F(v),a=h):(c=a,a=u)):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;else c=a,a=u;}else c=a,a=u;else c=a,a=u;return q[re]={nextPos:c,result:a},a}function Fc(){var a,h,_,w=c*49+6,v=q[w];if(v)return c=v.nextPos,v.result;if(a=c,h=[],_=Nc(),_!==i)for(;_!==i;)h.push(_),_=Nc();else h=u;return h!==i?(_=Mc(),_!==i?(Y=a,h=k(h,_),a=h):(c=a,a=u)):(c=a,a=u),a===i&&(a=c,h=Mc(),h!==i&&(Y=a,h=H(h)),a=h),q[w]={nextPos:c,result:a},a}function Mc(){var a,h,_,w,v,P=c*49+7,N=q[P];if(N)return c=N.nextPos,N.result;for(a=c,h=[],_=J();_!==i;)h.push(_),_=J();if(h!==i)if(_=Xr(),_!==i){for(w=[],v=J();v!==i;)w.push(v),v=J();w!==i?(Y=a,h=B(_),a=h):(c=a,a=u);}else c=a,a=u;else c=a,a=u;if(a===i){for(a=c,h=[],_=J();_!==i;)h.push(_),_=J();if(h!==i)if(_=so(),_!==i){for(w=[],v=J();v!==i;)w.push(v),v=J();w!==i?(Y=a,h=B(_),a=h):(c=a,a=u);}else c=a,a=u;else c=a,a=u;}return q[P]={nextPos:c,result:a},a}function Nc(){var a,h,_,w,v,P,N,V=c*49+8,re=q[V];if(re)return c=re.nextPos,re.result;for(a=c,h=[],_=J();_!==i;)h.push(_),_=J();if(h!==i)if(_=Xr(),_!==i){for(w=[],v=J();v!==i;)w.push(v),v=J();if(w!==i)if(n.charCodeAt(c)===46?(v=L,c++):(v=i,D===0&&j(M)),v!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(Y=a,h=B(_),a=h):(c=a,a=u);}else c=a,a=u;else c=a,a=u;}else c=a,a=u;else c=a,a=u;if(a===i){for(a=c,h=[],_=J();_!==i;)h.push(_),_=J();if(h!==i)if(_=so(),_!==i){for(w=[],v=J();v!==i;)w.push(v),v=J();if(w!==i)if(n.charCodeAt(c)===46?(v=L,c++):(v=i,D===0&&j(M)),v!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(Y=a,h=B(_),a=h):(c=a,a=u);}else c=a,a=u;else c=a,a=u;}else c=a,a=u;else c=a,a=u;}return q[V]={nextPos:c,result:a},a}function bE(){var a,h,_,w,v,P,N=c*49+9,V=q[N];if(V)return c=V.nextPos,V.result;if(a=c,h=Xr(),h!==i){for(_=[],w=J();w!==i;)_.push(w),w=J();if(_!==i)if(n.charCodeAt(c)===61?(w=U,c++):(w=i,D===0&&j(R)),w!==i){for(v=[],P=J();P!==i;)v.push(P),P=J();v!==i?(P=pr(),P!==i?(Y=a,h=z(h,P),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;else c=a,a=u;}else c=a,a=u;if(a===i)if(a=c,h=so(),h!==i){for(_=[],w=J();w!==i;)_.push(w),w=J();if(_!==i)if(n.charCodeAt(c)===61?(w=U,c++):(w=i,D===0&&j(R)),w!==i){for(v=[],P=J();P!==i;)v.push(P),P=J();v!==i?(P=pr(),P!==i?(Y=a,h=z(h,P),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;else c=a,a=u;}else c=a,a=u;return q[N]={nextPos:c,result:a},a}function Xr(){var a,h,_,w=c*49+10,v=q[w];if(v)return c=v.nextPos,v.result;if(a=c,h=[],_=Vc(),_!==i)for(;_!==i;)h.push(_),_=Vc();else h=u;return h!==i&&(Y=a,h=G(h)),a=h,q[w]={nextPos:c,result:a},a}function so(){var a,h,_=c*49+11,w=q[_];return w?(c=w.nextPos,w.result):(a=c,h=kc(),h!==i&&(Y=a,h=te(h)),a=h,a===i&&(a=c,h=Lc(),h!==i&&(Y=a,h=te(h)),a=h),q[_]={nextPos:c,result:a},a)}function pr(){var a,h=c*49+12,_=q[h];return _?(c=_.nextPos,_.result):(a=SE(),a===i&&(a=FE(),a===i&&(a=xE(),a===i&&(a=CE(),a===i&&(a=RE(),a===i&&(a=TE(),a===i&&(a=IE())))))),q[h]={nextPos:c,result:a},a)}function SE(){var a,h=c*49+13,_=q[h];return _?(c=_.nextPos,_.result):(a=vE(),a===i&&(a=kc(),a===i&&(a=EE(),a===i&&(a=Lc()))),q[h]={nextPos:c,result:a},a)}function vE(){var a,h,_,w,v,P=c*49+14,N=q[P];if(N)return c=N.nextPos,N.result;if(a=c,n.substr(c,3)===I?(h=I,c+=3):(h=i,D===0&&j(O)),h!==i)if(_=Qe(),_===i&&(_=X),_!==i){for(w=[],v=qc();v!==i;)w.push(v),v=qc();w!==i?(n.substr(c,3)===I?(v=I,c+=3):(v=i,D===0&&j(O)),v!==i?(Y=a,h=Q(w),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;else c=a,a=u;return q[P]={nextPos:c,result:a},a}function kc(){var a,h,_,w,v=c*49+15,P=q[v];if(P)return c=P.nextPos,P.result;if(a=c,n.charCodeAt(c)===34?(h=ie,c++):(h=i,D===0&&j($e)),h!==i){for(_=[],w=$c();w!==i;)_.push(w),w=$c();_!==i?(n.charCodeAt(c)===34?(w=ie,c++):(w=i,D===0&&j($e)),w!==i?(Y=a,h=Q(_),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;return q[v]={nextPos:c,result:a},a}function EE(){var a,h,_,w,v,P=c*49+16,N=q[P];if(N)return c=N.nextPos,N.result;if(a=c,n.substr(c,3)===ve?(h=ve,c+=3):(h=i,D===0&&j(Pt)),h!==i)if(_=Qe(),_===i&&(_=X),_!==i){for(w=[],v=Bc();v!==i;)w.push(v),v=Bc();w!==i?(n.substr(c,3)===ve?(v=ve,c+=3):(v=i,D===0&&j(Pt)),v!==i?(Y=a,h=Q(w),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;else c=a,a=u;return q[P]={nextPos:c,result:a},a}function Lc(){var a,h,_,w,v=c*49+17,P=q[v];if(P)return c=P.nextPos,P.result;if(a=c,n.charCodeAt(c)===39?(h=Gr,c++):(h=i,D===0&&j(Ot)),h!==i){for(_=[],w=Dc();w!==i;)_.push(w),w=Dc();_!==i?(n.charCodeAt(c)===39?(w=Gr,c++):(w=i,D===0&&j(Ot)),w!==i?(Y=a,h=Q(_),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;return q[v]={nextPos:c,result:a},a}function $c(){var a,h,_,w=c*49+18,v=q[w];return v?(c=v.nextPos,v.result):(a=Kc(),a===i&&(a=c,h=c,D++,n.charCodeAt(c)===34?(_=ie,c++):(_=i,D===0&&j($e)),D--,_===i?h=g:(c=h,h=u),h!==i?(n.length>c?(_=n.charAt(c),c++):(_=i,D===0&&j(y)),_!==i?(Y=a,h=st(_),a=h):(c=a,a=u)):(c=a,a=u)),q[w]={nextPos:c,result:a},a)}function Dc(){var a,h,_,w=c*49+19,v=q[w];return v?(c=v.nextPos,v.result):(a=c,h=c,D++,n.charCodeAt(c)===39?(_=Gr,c++):(_=i,D===0&&j(Ot)),D--,_===i?h=g:(c=h,h=u),h!==i?(n.length>c?(_=n.charAt(c),c++):(_=i,D===0&&j(y)),_!==i?(Y=a,h=st(_),a=h):(c=a,a=u)):(c=a,a=u),q[w]={nextPos:c,result:a},a)}function qc(){var a,h,_,w=c*49+20,v=q[w];return v?(c=v.nextPos,v.result):(a=Kc(),a===i&&(a=AE(),a===i&&(a=c,h=c,D++,n.substr(c,3)===I?(_=I,c+=3):(_=i,D===0&&j(O)),D--,_===i?h=g:(c=h,h=u),h!==i?(n.length>c?(_=n.charAt(c),c++):(_=i,D===0&&j(y)),_!==i?(Y=a,h=oe(_),a=h):(c=a,a=u)):(c=a,a=u))),q[w]={nextPos:c,result:a},a)}function AE(){var a,h,_,w,v,P=c*49+21,N=q[P];if(N)return c=N.nextPos,N.result;if(a=c,n.charCodeAt(c)===92?(h=dr,c++):(h=i,D===0&&j(eo)),h!==i)if(_=Qe(),_!==i){for(w=[],v=Gc();v!==i;)w.push(v),v=Gc();w!==i?(Y=a,h=Z(),a=h):(c=a,a=u);}else c=a,a=u;else c=a,a=u;return q[P]={nextPos:c,result:a},a}function Bc(){var a,h,_,w=c*49+22,v=q[w];return v?(c=v.nextPos,v.result):(a=c,h=c,D++,n.substr(c,3)===ve?(_=ve,c+=3):(_=i,D===0&&j(Pt)),D--,_===i?h=g:(c=h,h=u),h!==i?(n.length>c?(_=n.charAt(c),c++):(_=i,D===0&&j(y)),_!==i?(Y=a,h=st(_),a=h):(c=a,a=u)):(c=a,a=u),q[w]={nextPos:c,result:a},a)}function xE(){var a,h,_,w,v=c*49+23,P=q[v];return P?(c=P.nextPos,P.result):(a=c,h=Uc(),h===i&&(h=oo()),h!==i?(n.charCodeAt(c)===101?(_=de,c++):(_=i,D===0&&j(W)),_===i&&(n.charCodeAt(c)===69?(_=ne,c++):(_=i,D===0&&j(pe))),_!==i?(w=oo(),w!==i?(Y=a,h=Ie(h,w),a=h):(c=a,a=u)):(c=a,a=u)):(c=a,a=u),a===i&&(a=c,h=Uc(),h!==i&&(Y=a,h=ye(h)),a=h),q[v]={nextPos:c,result:a},a)}function Uc(){var a,h,_,w,v,P,N=c*49+24,V=q[N];return V?(c=V.nextPos,V.result):(a=c,n.charCodeAt(c)===43?(h=Vt,c++):(h=i,D===0&&j(Ft)),h===i&&(h=X),h!==i?(_=c,w=Qr(),w!==i?(n.charCodeAt(c)===46?(v=L,c++):(v=i,D===0&&j(M)),v!==i?(P=Qr(),P!==i?(w=[w,v,P],_=w):(c=_,_=u)):(c=_,_=u)):(c=_,_=u),_!==i?(Y=a,h=ac(_),a=h):(c=a,a=u)):(c=a,a=u),a===i&&(a=c,n.charCodeAt(c)===45?(h=Vr,c++):(h=i,D===0&&j(Kr)),h!==i?(_=c,w=Qr(),w!==i?(n.charCodeAt(c)===46?(v=L,c++):(v=i,D===0&&j(M)),v!==i?(P=Qr(),P!==i?(w=[w,v,P],_=w):(c=_,_=u)):(c=_,_=u)):(c=_,_=u),_!==i?(Y=a,h=lc(_),a=h):(c=a,a=u)):(c=a,a=u)),q[N]={nextPos:c,result:a},a)}function CE(){var a,h,_=c*49+25,w=q[_];return w?(c=w.nextPos,w.result):(a=c,h=oo(),h!==i&&(Y=a,h=Sv(h)),a=h,q[_]={nextPos:c,result:a},a)}function oo(){var a,h,_,w,v,P=c*49+26,N=q[P];if(N)return c=N.nextPos,N.result;if(a=c,n.charCodeAt(c)===43?(h=Vt,c++):(h=i,D===0&&j(Ft)),h===i&&(h=X),h!==i){if(_=[],w=ue(),w!==i)for(;w!==i;)_.push(w),w=ue();else _=u;_!==i?(w=c,D++,n.charCodeAt(c)===46?(v=L,c++):(v=i,D===0&&j(M)),D--,v===i?w=g:(c=w,w=u),w!==i?(Y=a,h=ac(_),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;if(a===i)if(a=c,n.charCodeAt(c)===45?(h=Vr,c++):(h=i,D===0&&j(Kr)),h!==i){if(_=[],w=ue(),w!==i)for(;w!==i;)_.push(w),w=ue();else _=u;_!==i?(w=c,D++,n.charCodeAt(c)===46?(v=L,c++):(v=i,D===0&&j(M)),D--,v===i?w=g:(c=w,w=u),w!==i?(Y=a,h=lc(_),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;return q[P]={nextPos:c,result:a},a}function RE(){var a,h,_=c*49+27,w=q[_];return w?(c=w.nextPos,w.result):(a=c,n.substr(c,4)===uc?(h=uc,c+=4):(h=i,D===0&&j(vv)),h!==i&&(Y=a,h=Ev()),a=h,a===i&&(a=c,n.substr(c,5)===cc?(h=cc,c+=5):(h=i,D===0&&j(Av)),h!==i&&(Y=a,h=xv()),a=h),q[_]={nextPos:c,result:a},a)}function TE(){var a,h,_,w,v,P=c*49+28,N=q[P];if(N)return c=N.nextPos,N.result;if(a=c,n.charCodeAt(c)===91?(h=S,c++):(h=i,D===0&&j(E)),h!==i){for(_=[],w=Xe();w!==i;)_.push(w),w=Xe();_!==i?(n.charCodeAt(c)===93?(w=A,c++):(w=i,D===0&&j(b)),w!==i?(Y=a,h=Cv(),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;if(a===i&&(a=c,n.charCodeAt(c)===91?(h=S,c++):(h=i,D===0&&j(E)),h!==i?(_=Hc(),_===i&&(_=X),_!==i?(n.charCodeAt(c)===93?(w=A,c++):(w=i,D===0&&j(b)),w!==i?(Y=a,h=Rv(_),a=h):(c=a,a=u)):(c=a,a=u)):(c=a,a=u),a===i)){if(a=c,n.charCodeAt(c)===91?(h=S,c++):(h=i,D===0&&j(E)),h!==i){if(_=[],w=Zn(),w!==i)for(;w!==i;)_.push(w),w=Zn();else _=u;_!==i?(n.charCodeAt(c)===93?(w=A,c++):(w=i,D===0&&j(b)),w!==i?(Y=a,h=Tv(_),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;if(a===i)if(a=c,n.charCodeAt(c)===91?(h=S,c++):(h=i,D===0&&j(E)),h!==i){if(_=[],w=Zn(),w!==i)for(;w!==i;)_.push(w),w=Zn();else _=u;_!==i?(w=Hc(),w!==i?(n.charCodeAt(c)===93?(v=A,c++):(v=i,D===0&&j(b)),v!==i?(Y=a,h=Iv(_,w),a=h):(c=a,a=u)):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;}return q[P]={nextPos:c,result:a},a}function Hc(){var a,h,_,w,v,P=c*49+29,N=q[P];if(N)return c=N.nextPos,N.result;for(a=c,h=[],_=Xe();_!==i;)h.push(_),_=Xe();if(h!==i)if(_=pr(),_!==i){for(w=[],v=Xe();v!==i;)w.push(v),v=Xe();w!==i?(Y=a,h=fc(_),a=h):(c=a,a=u);}else c=a,a=u;else c=a,a=u;return q[P]={nextPos:c,result:a},a}function Zn(){var a,h,_,w,v,P,N,V=c*49+30,re=q[V];if(re)return c=re.nextPos,re.result;for(a=c,h=[],_=Xe();_!==i;)h.push(_),_=Xe();if(h!==i)if(_=pr(),_!==i){for(w=[],v=Xe();v!==i;)w.push(v),v=Xe();if(w!==i)if(n.charCodeAt(c)===44?(v=hc,c++):(v=i,D===0&&j(dc)),v!==i){for(P=[],N=Xe();N!==i;)P.push(N),N=Xe();P!==i?(Y=a,h=fc(_),a=h):(c=a,a=u);}else c=a,a=u;else c=a,a=u;}else c=a,a=u;else c=a,a=u;return q[V]={nextPos:c,result:a},a}function Xe(){var a,h=c*49+31,_=q[h];return _?(c=_.nextPos,_.result):(a=J(),a===i&&(a=Qe(),a===i&&(a=Kn())),q[h]={nextPos:c,result:a},a)}function IE(){var a,h,_,w,v,P,N=c*49+32,V=q[N];if(V)return c=V.nextPos,V.result;if(a=c,n.charCodeAt(c)===123?(h=Pv,c++):(h=i,D===0&&j(Ov)),h!==i){for(_=[],w=J();w!==i;)_.push(w),w=J();if(_!==i){for(w=[],v=jc();v!==i;)w.push(v),v=jc();if(w!==i){for(v=[],P=J();P!==i;)v.push(P),P=J();v!==i?(n.charCodeAt(c)===125?(P=Fv,c++):(P=i,D===0&&j(Mv)),P!==i?(Y=a,h=Nv(w),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;}else c=a,a=u;}else c=a,a=u;return q[N]={nextPos:c,result:a},a}function jc(){var a,h,_,w,v,P,N,V,re,ce,le,ge=c*49+33,we=q[ge];if(we)return c=we.nextPos,we.result;for(a=c,h=[],_=J();_!==i;)h.push(_),_=J();if(h!==i)if(_=Xr(),_!==i){for(w=[],v=J();v!==i;)w.push(v),v=J();if(w!==i)if(n.charCodeAt(c)===61?(v=U,c++):(v=i,D===0&&j(R)),v!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();if(P!==i)if(N=pr(),N!==i){for(V=[],re=J();re!==i;)V.push(re),re=J();if(V!==i)if(n.charCodeAt(c)===44?(re=hc,c++):(re=i,D===0&&j(dc)),re!==i){for(ce=[],le=J();le!==i;)ce.push(le),le=J();ce!==i?(Y=a,h=pc(_,N),a=h):(c=a,a=u);}else c=a,a=u;else c=a,a=u;}else c=a,a=u;else c=a,a=u;}else c=a,a=u;else c=a,a=u;}else c=a,a=u;else c=a,a=u;if(a===i){for(a=c,h=[],_=J();_!==i;)h.push(_),_=J();if(h!==i)if(_=Xr(),_!==i){for(w=[],v=J();v!==i;)w.push(v),v=J();if(w!==i)if(n.charCodeAt(c)===61?(v=U,c++):(v=i,D===0&&j(R)),v!==i){for(P=[],N=J();N!==i;)P.push(N),N=J();P!==i?(N=pr(),N!==i?(Y=a,h=pc(_,N),a=h):(c=a,a=u)):(c=a,a=u);}else c=a,a=u;else c=a,a=u;}else c=a,a=u;else c=a,a=u;}return q[ge]={nextPos:c,result:a},a}function Wc(){var a,h,_,w=c*49+34,v=q[w];return v?(c=v.nextPos,v.result):(a=c,n.charCodeAt(c)===46?(h=L,c++):(h=i,D===0&&j(M)),h!==i?(_=Qr(),_!==i?(Y=a,h=kv(_),a=h):(c=a,a=u)):(c=a,a=u),q[w]={nextPos:c,result:a},a)}function zc(){var a,h,_,w,v,P,N,V,re,ce,le,ge,we=c*49+35,Ve=q[we];return Ve?(c=Ve.nextPos,Ve.result):(a=c,h=c,_=ue(),_!==i?(w=ue(),w!==i?(v=ue(),v!==i?(P=ue(),P!==i?(n.charCodeAt(c)===45?(N=Vr,c++):(N=i,D===0&&j(Kr)),N!==i?(V=ue(),V!==i?(re=ue(),re!==i?(n.charCodeAt(c)===45?(ce=Vr,c++):(ce=i,D===0&&j(Kr)),ce!==i?(le=ue(),le!==i?(ge=ue(),ge!==i?(_=[_,w,v,P,N,V,re,ce,le,ge],h=_):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u),h!==i&&(Y=a,h=Lv(h)),a=h,q[we]={nextPos:c,result:a},a)}function PE(){var a,h,_,w,v,P,N,V,re,ce,le,ge=c*49+36,we=q[ge];return we?(c=we.nextPos,we.result):(a=c,h=c,_=ue(),_!==i?(w=ue(),w!==i?(n.charCodeAt(c)===58?(v=Zr,c++):(v=i,D===0&&j(Yr)),v!==i?(P=ue(),P!==i?(N=ue(),N!==i?(n.charCodeAt(c)===58?(V=Zr,c++):(V=i,D===0&&j(Yr)),V!==i?(re=ue(),re!==i?(ce=ue(),ce!==i?(le=Wc(),le===i&&(le=X),le!==i?(_=[_,w,v,P,N,V,re,ce,le],h=_):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u),h!==i&&(Y=a,h=mc(h)),a=h,q[ge]={nextPos:c,result:a},a)}function OE(){var a,h,_,w,v,P,N,V,re,ce,le,ge,we,Ve,mr,Mt,Ke,Yc=c*49+37,lo=q[Yc];return lo?(c=lo.nextPos,lo.result):(a=c,h=c,_=ue(),_!==i?(w=ue(),w!==i?(n.charCodeAt(c)===58?(v=Zr,c++):(v=i,D===0&&j(Yr)),v!==i?(P=ue(),P!==i?(N=ue(),N!==i?(n.charCodeAt(c)===58?(V=Zr,c++):(V=i,D===0&&j(Yr)),V!==i?(re=ue(),re!==i?(ce=ue(),ce!==i?(le=Wc(),le===i&&(le=X),le!==i?(n.charCodeAt(c)===45?(ge=Vr,c++):(ge=i,D===0&&j(Kr)),ge===i&&(n.charCodeAt(c)===43?(ge=Vt,c++):(ge=i,D===0&&j(Ft))),ge!==i?(we=ue(),we!==i?(Ve=ue(),Ve!==i?(n.charCodeAt(c)===58?(mr=Zr,c++):(mr=i,D===0&&j(Yr)),mr!==i?(Mt=ue(),Mt!==i?(Ke=ue(),Ke!==i?(_=[_,w,v,P,N,V,re,ce,le,ge,we,Ve,mr,Mt,Ke],h=_):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u)):(c=h,h=u),h!==i&&(Y=a,h=mc(h)),a=h,q[Yc]={nextPos:c,result:a},a)}function FE(){var a,h,_,w,v,P=c*49+38,N=q[P];return N?(c=N.nextPos,N.result):(a=c,h=zc(),h!==i?(n.charCodeAt(c)===84?(_=gc,c++):(_=i,D===0&&j(_c)),_!==i?(w=PE(),w!==i?(n.charCodeAt(c)===90?(v=$v,c++):(v=i,D===0&&j(Dv)),v!==i?(Y=a,h=qv(h,w),a=h):(c=a,a=u)):(c=a,a=u)):(c=a,a=u)):(c=a,a=u),a===i&&(a=c,h=zc(),h!==i?(n.charCodeAt(c)===84?(_=gc,c++):(_=i,D===0&&j(_c)),_!==i?(w=OE(),w!==i?(Y=a,h=Bv(h,w),a=h):(c=a,a=u)):(c=a,a=u)):(c=a,a=u)),q[P]={nextPos:c,result:a},a)}function J(){var a,h=c*49+39,_=q[h];return _?(c=_.nextPos,_.result):(Uv.test(n.charAt(c))?(a=n.charAt(c),c++):(a=i,D===0&&j(Hv)),q[h]={nextPos:c,result:a},a)}function Qe(){var a,h,_,w=c*49+40,v=q[w];return v?(c=v.nextPos,v.result):(n.charCodeAt(c)===10?(a=yc,c++):(a=i,D===0&&j(wc)),a===i&&(a=c,n.charCodeAt(c)===13?(h=jv,c++):(h=i,D===0&&j(Wv)),h!==i?(n.charCodeAt(c)===10?(_=yc,c++):(_=i,D===0&&j(wc)),_!==i?(h=[h,_],a=h):(c=a,a=u)):(c=a,a=u)),q[w]={nextPos:c,result:a},a)}function Gc(){var a,h=c*49+41,_=q[h];return _?(c=_.nextPos,_.result):(a=Qe(),a===i&&(a=J()),q[h]={nextPos:c,result:a},a)}function Yn(){var a,h,_=c*49+42,w=q[_];return w?(c=w.nextPos,w.result):(a=c,D++,n.length>c?(h=n.charAt(c),c++):(h=i,D===0&&j(y)),D--,h===i?a=g:(c=a,a=u),q[_]={nextPos:c,result:a},a)}function et(){var a,h=c*49+43,_=q[h];return _?(c=_.nextPos,_.result):(zv.test(n.charAt(c))?(a=n.charAt(c),c++):(a=i,D===0&&j(Gv)),q[h]={nextPos:c,result:a},a)}function ue(){var a,h,_=c*49+44,w=q[_];return w?(c=w.nextPos,w.result):(Vv.test(n.charAt(c))?(a=n.charAt(c),c++):(a=i,D===0&&j(Kv)),a===i&&(a=c,n.charCodeAt(c)===95?(h=Zv,c++):(h=i,D===0&&j(Yv)),h!==i&&(Y=a,h=Jv()),a=h),q[_]={nextPos:c,result:a},a)}function Vc(){var a,h=c*49+45,_=q[h];return _?(c=_.nextPos,_.result):(Xv.test(n.charAt(c))?(a=n.charAt(c),c++):(a=i,D===0&&j(Qv)),q[h]={nextPos:c,result:a},a)}function Qr(){var a,h,_,w=c*49+46,v=q[w];if(v)return c=v.nextPos,v.result;if(a=c,h=[],_=ue(),_!==i)for(;_!==i;)h.push(_),_=ue();else h=u;return h!==i&&(Y=a,h=eE(h)),a=h,q[w]={nextPos:c,result:a},a}function Kc(){var a,h,_=c*49+47,w=q[_];return w?(c=w.nextPos,w.result):(a=c,n.substr(c,2)===bc?(h=bc,c+=2):(h=i,D===0&&j(tE)),h!==i&&(Y=a,h=rE()),a=h,a===i&&(a=c,n.substr(c,2)===Sc?(h=Sc,c+=2):(h=i,D===0&&j(nE)),h!==i&&(Y=a,h=iE()),a=h,a===i&&(a=c,n.substr(c,2)===vc?(h=vc,c+=2):(h=i,D===0&&j(sE)),h!==i&&(Y=a,h=oE()),a=h,a===i&&(a=c,n.substr(c,2)===Ec?(h=Ec,c+=2):(h=i,D===0&&j(aE)),h!==i&&(Y=a,h=lE()),a=h,a===i&&(a=c,n.substr(c,2)===Ac?(h=Ac,c+=2):(h=i,D===0&&j(uE)),h!==i&&(Y=a,h=cE()),a=h,a===i&&(a=c,n.substr(c,2)===xc?(h=xc,c+=2):(h=i,D===0&&j(fE)),h!==i&&(Y=a,h=hE()),a=h,a===i&&(a=c,n.substr(c,2)===Cc?(h=Cc,c+=2):(h=i,D===0&&j(dE)),h!==i&&(Y=a,h=pE()),a=h,a===i&&(a=ME()))))))),q[_]={nextPos:c,result:a},a)}function ME(){var a,h,_,w,v,P,N,V,re,ce,le,ge=c*49+48,we=q[ge];return we?(c=we.nextPos,we.result):(a=c,n.substr(c,2)===Rc?(h=Rc,c+=2):(h=i,D===0&&j(mE)),h!==i?(_=c,w=et(),w!==i?(v=et(),v!==i?(P=et(),P!==i?(N=et(),N!==i?(V=et(),V!==i?(re=et(),re!==i?(ce=et(),ce!==i?(le=et(),le!==i?(w=[w,v,P,N,V,re,ce,le],_=w):(c=_,_=u)):(c=_,_=u)):(c=_,_=u)):(c=_,_=u)):(c=_,_=u)):(c=_,_=u)):(c=_,_=u)):(c=_,_=u),_!==i?(Y=a,h=Tc(_),a=h):(c=a,a=u)):(c=a,a=u),a===i&&(a=c,n.substr(c,2)===Ic?(h=Ic,c+=2):(h=i,D===0&&j(gE)),h!==i?(_=c,w=et(),w!==i?(v=et(),v!==i?(P=et(),P!==i?(N=et(),N!==i?(w=[w,v,P,N],_=w):(c=_,_=u)):(c=_,_=u)):(c=_,_=u)):(c=_,_=u),_!==i?(Y=a,h=Tc(_),a=h):(c=a,a=u)):(c=a,a=u)),q[ge]={nextPos:c,result:a},a)}var Zc=[];function NE(a,h,_){var w=new Error(a);throw w.line=h,w.column=_,w}function ao(a){Zc.push(a);}function Fe(a,h,_,w,v){var P={type:a,value:h,line:_(),column:w()};return v&&(P.key=v),P}function kE(a,h,_){var w=parseInt("0x"+a);if(!isFinite(w)||Math.floor(w)!=w||w<0||w>1114111||w>55295&&w<57344)NE("Invalid Unicode escape code: "+a,h,_);else return LE(w)}function LE(){var a=16384,h=[],_,w,v=-1,P=arguments.length;if(!P)return "";for(var N="";++v>10)+55296,w=V%1024+56320,h.push(_,w)),(v+1==P||h.length>a)&&(N+=String.fromCharCode.apply(null,h),h.length=0);}return N}if(Vn=l(),Vn!==i&&c===n.length)return Vn;throw Vn!==i&&c{function sL(t){var e=[],r=[],n="",s=Object.create(null),i=s;return l(t);function l(b){for(var T,F=0;F"u"?R===T.length-1?U[z]=F:U[z]=Object.create(null):R!==T.length-1&&r.indexOf(L)>-1&&f("Cannot redefine existing key '"+L+"'.",k,H),U=U[z],U instanceof Array&&U.length&&R-1?'"'+b+'"':b}}CS.exports={compile:sL};});var IS=x((Aq,TS)=>{var oL=xS(),aL=RS();TS.exports={parse:function(t){var e=oL.parse(t.toString());return aL.compile(e)}};});var WS=x((fr,jS)=>{var Zu=K("crypto");fr=jS.exports=Hn;function Hn(t,e){return e=US(t,e),mL(t,e)}fr.sha1=function(t){return Hn(t)};fr.keys=function(t){return Hn(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};fr.MD5=function(t){return Hn(t,{algorithm:"md5",encoding:"hex"})};fr.keysMD5=function(t){return Hn(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var Wr=Zu.getHashes?Zu.getHashes().slice():["sha1","md5"];Wr.push("passthrough");var qS=["buffer","hex","binary","base64"];function US(t,e){e=e||{};var r={};if(r.algorithm=e.algorithm||"sha1",r.encoding=e.encoding||"hex",r.excludeValues=!!e.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=e.ignoreUnknown===!0,r.respectType=e.respectType!==!1,r.respectFunctionNames=e.respectFunctionNames!==!1,r.respectFunctionProperties=e.respectFunctionProperties!==!1,r.unorderedArrays=e.unorderedArrays===!0,r.unorderedSets=e.unorderedSets!==!1,r.unorderedObjects=e.unorderedObjects!==!1,r.replacer=e.replacer||void 0,r.excludeKeys=e.excludeKeys||void 0,typeof t>"u")throw new Error("Object argument required.");for(var n=0;n"u"&&(r.write=r.update,r.end=r.update);var n=Yu(e,r);if(n.dispatch(t),r.update||r.end(""),r.digest)return r.digest(e.encoding==="buffer"?void 0:e.encoding);var s=r.read();return e.encoding==="buffer"?s:s.toString(e.encoding)}fr.writeToStream=function(t,e,r){return typeof r>"u"&&(r=e,e={}),e=US(t,e),Yu(e,r).dispatch(t)};function Yu(t,e,r){r=r||[];var n=function(s){return e.update?e.update(s,"utf8"):e.write(s,"utf8")};return {dispatch:function(s){t.replacer&&(s=t.replacer(s));var i=typeof s;return s===null&&(i="null"),this["_"+i](s)},_object:function(s){var i=/\[object (.*)\]/i,o=Object.prototype.toString.call(s),l=i.exec(o);l?l=l[1]:l="unknown:["+o+"]",l=l.toLowerCase();var f=null;if((f=r.indexOf(s))>=0)return this.dispatch("[CIRCULAR:"+f+"]");if(r.push(s),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(s))return n("buffer:"),n(s);if(l!=="object"&&l!=="function"&&l!=="asyncfunction")if(this["_"+l])this["_"+l](s);else {if(t.ignoreUnknown)return n("["+l+"]");throw new Error('Unknown object type "'+l+'"')}else {var d=Object.keys(s);t.unorderedObjects&&(d=d.sort()),t.respectType!==!1&&!BS(s)&&d.splice(0,0,"prototype","__proto__","constructor"),t.excludeKeys&&(d=d.filter(function(p){return !t.excludeKeys(p)})),n("object:"+d.length+":");var u=this;return d.forEach(function(p){u.dispatch(p),n(":"),t.excludeValues||u.dispatch(s[p]),n(",");})}},_array:function(s,i){i=typeof i<"u"?i:t.unorderedArrays!==!1;var o=this;if(n("array:"+s.length+":"),!i||s.length<=1)return s.forEach(function(d){return o.dispatch(d)});var l=[],f=s.map(function(d){var u=new HS,p=r.slice(),m=Yu(t,u,p);return m.dispatch(d),l=l.concat(p.slice(r.length)),u.read().toString()});return r=r.concat(l),f.sort(),this._array(f,!1)},_date:function(s){return n("date:"+s.toJSON())},_symbol:function(s){return n("symbol:"+s.toString())},_error:function(s){return n("error:"+s.toString())},_boolean:function(s){return n("bool:"+s.toString())},_string:function(s){n("string:"+s.length+":"),n(s.toString());},_function:function(s){n("fn:"),BS(s)?this.dispatch("[native]"):this.dispatch(s.toString()),t.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(s.name)),t.respectFunctionProperties&&this._object(s);},_number:function(s){return n("number:"+s.toString())},_xml:function(s){return n("xml:"+s.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(s){return n("regex:"+s.toString())},_uint8array:function(s){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint8clampedarray:function(s){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(s))},_int8array:function(s){return n("int8array:"),this.dispatch(Array.prototype.slice.call(s))},_uint16array:function(s){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(s))},_int16array:function(s){return n("int16array:"),this.dispatch(Array.prototype.slice.call(s))},_uint32array:function(s){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(s))},_int32array:function(s){return n("int32array:"),this.dispatch(Array.prototype.slice.call(s))},_float32array:function(s){return n("float32array:"),this.dispatch(Array.prototype.slice.call(s))},_float64array:function(s){return n("float64array:"),this.dispatch(Array.prototype.slice.call(s))},_arraybuffer:function(s){return n("arraybuffer:"),this.dispatch(new Uint8Array(s))},_url:function(s){return n("url:"+s.toString())},_map:function(s){n("map:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_set:function(s){n("set:");var i=Array.from(s);return this._array(i,t.unorderedSets!==!1)},_file:function(s){return n("file:"),this.dispatch([s.name,s.size,s.type,s.lastModfied])},_blob:function(){if(t.ignoreUnknown)return n("[blob]");throw Error(`Hashing Blob objects is currently not supported +`),ye=iU.bind(null,{[XC]:"",[QC]:o,[tx]:N,[ex]:Lh,[$h]:U,[rx]:B}),q="";p!==null&&(m===void 0?q=ye(p):q=ye(Object.assign({},p,{name:m})));let W=a instanceof Function?a:a?ax:RU,me=W().indexOf(":")+1;if(D&&!w)throw Error("customLevels is required if useOnlyCustomLevels is set true");if(E&&typeof E!="function")throw Error(`Unknown mixin type "${typeof E}" - expected "function"`);if(K&&typeof K!="string")throw Error(`Unknown msgPrefix type "${typeof K}" - expected "string"`);eU(_,w,D);let pe=ox(w,D);return Object.assign(e,{levels:pe,[bU]:D,[fU]:n,[cU]:W,[lU]:me,[ex]:Lh,[$h]:U,[tx]:N,[hU]:ae,[pU]:te,[mU]:l,[gU]:d,[_U]:c,[wU]:c?`,${JSON.stringify(c)}:{`:"",[QC]:o,[yU]:E,[SU]:P,[XC]:q,[rx]:B,[vU]:S,silent:oU,onChild:Z,[EU]:K}),Object.setPrototypeOf(e,XB()),tU(e),e[dU](_),e}yr.exports=jh;yr.exports.destination=(t=process.stdout.fd)=>typeof t=="object"?(t.dest=YC(t.dest||process.stdout.fd),JC(t)):JC({dest:YC(t),minLength:0});yr.exports.transport=Eh();yr.exports.multistream=ZC();yr.exports.levels=ox();yr.exports.stdSerializers=DU;yr.exports.stdTimeFunctions=Object.assign({},ix);yr.exports.symbols=sx;yr.exports.version=aU;yr.exports.default=jh;yr.exports.pino=jh;});var co=A(Tn=>{Object.defineProperty(Tn,"__esModule",{value:!0});Tn.Frequency=Tn.KeepLogFiles=void 0;(function(t){t[t.days=1]="days",t[t.fileCount=2]="fileCount";})(Tn.KeepLogFiles||(Tn.KeepLogFiles={}));(function(t){t[t.daily=1]="daily",t[t.minutes=2]="minutes",t[t.hours=3]="hours",t[t.date=4]="date",t[t.none=5]="none";})(Tn.Frequency||(Tn.Frequency={}));});var lx=A(Wh=>{Object.defineProperty(Wh,"__esModule",{value:!0});var cx=co(),Hh=class{static fileStreamRotatorOptions(e){return Object.assign(Object.assign({},{filename:"",verbose:!1,end_stream:!1,utc:!1,create_symlink:!1,symlink_name:"current.log"}),e)}static fileOptions(e){return Object.assign(Object.assign({},{flags:"a"}),e)}static auditSettings(e){let r={keepSettings:{type:cx.KeepLogFiles.fileCount,amount:10},auditFilename:"audit.json",hashType:"md5",extension:"",files:[]};return Object.assign(Object.assign({},r),e)}static rotationSettings(e){let r={filename:"",frequency:cx.Frequency.none,utc:!1};return Object.assign(Object.assign({},r),e)}static extractParam(e,r=!0){let n=e.toString().match(/(\w)$/),i={number:0};n?.length==2&&(i.letter=n[1].toLowerCase());let s=e.toString().match(/^(\d+)/);return s?.length==2&&(i.number=Number(s[1])),i}};Wh.default=Hh;});var Tu=A(Gi=>{Object.defineProperty(Gi,"__esModule",{value:!0});Gi.Logger=Gi.makeDirectory=void 0;var kU=oe("fs"),MU=oe("path");function FU(t){if(t.trim()!==""){var e=MU.dirname(t);try{kU.mkdirSync(e,{recursive:!0});}catch(r){if(r.code!=="EEXIST")throw r}}}Gi.makeDirectory=FU;var Bh=class t{constructor(){this.isVerbose=!1,this.allowDebug=!1;}static getInstance(e,r){return t.instance||(t.instance=new t,t.instance.isVerbose=e??!1,t.instance.allowDebug=r??!1),t.instance}static verbose(...e){t.getInstance().isVerbose&&console.log.apply(null,[new Date,"[FileStreamRotator:VERBOSE]",...e]);}static log(...e){console.log.apply(null,[new Date,"[FileStreamRotator]",...e]);}static debug(...e){t.getInstance().allowDebug&&console.debug.apply(null,[new Date,"[FileStreamRotator:DEBUG]",...e]);}};Gi.Logger=Bh;});var dx=A(zh=>{Object.defineProperty(zh,"__esModule",{value:!0});var fx=oe("fs"),ur=co(),ai=Tu(),Uh=class t{constructor(e,r){var n;switch(this.currentSize=0,this.lastDate="",this.fileIndx=0,this.settings=e,this.settings.frequency){case ur.Frequency.hours:this.settings.amount&&this.settings.amount<13?this.settings.amount&&this.settings.amount>0||(this.settings.amount=1):this.settings.amount=12,this.isFormatValidForHour()||(ai.Logger.log("Date format not suitable for X hours rotation. Changing date format to 'YMDHm'"),this.settings.format="YMDHm");break;case ur.Frequency.minutes:this.settings.amount&&this.settings.amount<31?this.settings.amount&&this.settings.amount>0||(this.settings.amount=1):this.settings.amount=30,this.isFormatValidForMinutes()||(this.settings.format="YMDHm",ai.Logger.log("Date format not suitable for X minutes rotation. Changing date format to 'YMDHm'"));break;case ur.Frequency.daily:this.isFormatValidForDaily()||(this.settings.format="YMD",ai.Logger.log("Date format not suitable for daily rotation. Changing date format to 'YMD'"));break}if(this.settings.frequency!==ur.Frequency.none&&!this.settings.filename.match("%DATE%")&&(this.settings.filename+=".%DATE%",ai.Logger.log("Appending date to the end of the filename")),this.lastDate=this.getDateString(),this.settings.maxSize&&r){let s=new Date(r.date),o=(n=this.settings.extension)!==null&&n!==void 0?n:"";if(ai.Logger.debug(this.getDateString(s)==this.getDateString(new Date),this.getDateString(s),this.getDateString(new Date)),this.getDateString(s)==this.getDateString(new Date)){let a=r.name.match(RegExp("(\\d+)"+o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")));a&&(this.fileIndx=Number(a[1]));var i=this.getSizeForFile(this.getNewFilename());i&&(this.currentSize=i),this.lastDate=this.getDateString(s),ai.Logger.debug("LOADED LAST ENTRY",this.currentSize,this.lastDate,this.fileIndx);}else {var i=this.getSizeForFile(this.getNewFilename());i&&(this.currentSize=i),ai.Logger.debug("CURRENT FILE:",this.getNewFilename(),this.currentSize);}}}getSizeForFile(e){try{if(fx.existsSync(e)){var r=fx.statSync(this.getNewFilename());if(r)return r.size}}catch{return}}hasMaxSizeReached(){return this.settings.maxSize?this.currentSize>this.settings.maxSize:!1}shouldRotate(){let e=this.hasMaxSizeReached();switch(this.settings.frequency){case ur.Frequency.none:return e;case ur.Frequency.hours:case ur.Frequency.minutes:case ur.Frequency.date:case ur.Frequency.daily:default:let r=this.getDateString();return this.lastDate!=r?!0:e}}isFormatValidForDaily(){let e=new Date(2022,2,20,1,2,3),r=new Date(2022,2,20,23,55,45),n=new Date(2022,2,21,2,55,45);return this.getDateString(e)===this.getDateString(r)&&this.getDateString(e)!==this.getDateString(n)}isFormatValidForHour(){if(!this.settings.amount||this.settings.frequency!=ur.Frequency.hours)return !1;let e=new Date(2022,2,20,1,2,3),r=new Date(2022,2,20,2+this.settings.amount,55,45);return this.getDateString(e)!==this.getDateString(r)}isFormatValidForMinutes(){if(!this.settings.amount||this.settings.frequency!=ur.Frequency.minutes)return !1;let e=new Date(2022,2,20,1,2,3),r=new Date(2022,2,20,1,2+this.settings.amount,45);return this.getDateString(e)!==this.getDateString(r)}getDateString(e){let r=e||new Date,n=t.getDateComponents(r,this.settings.utc),i=this.settings.format;if(i){switch(this.settings.frequency){case ur.Frequency.hours:if(this.settings.amount){var s=Math.floor(n.hour/this.settings.amount)*this.settings.amount;n.hour=s,n.minute=0,n.second=0;}case ur.Frequency.minutes:if(this.settings.amount){var o=Math.floor(n.minute/this.settings.amount)*this.settings.amount;n.minute=o,n.second=0;}}return i?.replace(/D+/,n.day.toString().padStart(2,"0")).replace(/M+/,n.month.toString().padStart(2,"0")).replace(/Y+/,n.year.toString()).replace(/H+/,n.hour.toString().padStart(2,"0")).replace(/m+/,n.minute.toString().padStart(2,"0")).replace(/s+/,n.second.toString().padStart(2,"0")).replace(/A+/,n.hour>11?"PM":"AM")}return ""}getFilename(e,r){return e.replace("%DATE%",this.lastDate)+(this.settings.maxSize||this.fileIndx>0?"."+this.fileIndx:"")+(r||"")}getNewFilename(){return this.getFilename(this.settings.filename,this.settings.extension)}addBytes(e){this.currentSize+=e;}rotate(e=!1){return e?(this.fileIndx+=1,this.currentSize=0,this.lastDate=this.getDateString()):this.shouldRotate()&&(this.hasMaxSizeReached()?this.fileIndx+=1:this.fileIndx=0,this.currentSize=0,this.lastDate=this.getDateString()),this.getNewFilename()}static getDateComponents(e,r){return r?{day:e.getUTCDate(),month:e.getUTCMonth()+1,year:e.getUTCFullYear(),hour:e.getUTCHours(),minute:e.getUTCMinutes(),second:e.getUTCSeconds(),utc:r,source:e}:{day:e.getDate(),month:e.getMonth()+1,year:e.getFullYear(),hour:e.getHours(),minute:e.getMinutes(),second:e.getSeconds(),utc:r,source:e}}static createDate(e,r){return new Date(e.year,e.month,e.day,e.hour,e.minute,e.second)}};zh.default=Uh;});var hx=A(Kh=>{Object.defineProperty(Kh,"__esModule",{value:!0});var Au=oe("fs"),NU=oe("path"),qU=co(),Vr=Tu(),Vh=oe("crypto"),Gh=class{constructor(e,r){this.config=e,this.emitter=r,this.loadLog();}loadLog(){var e;if(!this.config.keepSettings||((e=this.config.keepSettings)===null||e===void 0?void 0:e.amount)==0||!this.config.auditFilename||this.config.auditFilename==""){Vr.Logger.verbose("no existing audit settings found",this.config);return}try{let r=NU.resolve(this.config.auditFilename),n=JSON.parse(Au.readFileSync(r,{encoding:"utf-8"}));this.config.files=n.files;}catch(r){if(r.code!=="ENOENT"){Vr.Logger.log("Failed to load config file",r);return}}}writeLog(){if(this.config.auditFilename)try{(0, Vr.makeDirectory)(this.config.auditFilename),Au.writeFileSync(this.config.auditFilename,JSON.stringify(this.config,null,4));}catch(e){Vr.Logger.verbose("ERROR: Failed to store log audit",e);}}addLog(e){var r;if(!this.config.keepSettings||((r=this.config.keepSettings)===null||r===void 0?void 0:r.amount)==0||!this.config.auditFilename||this.config.auditFilename==""){Vr.Logger.verbose("audit log missing");return}if(this.config.files.findIndex(s=>s.name===e)!==-1){Vr.Logger.debug("file already in the log",e);return}var n=Date.now();if(this.config.files.push({date:n,name:e,hash:Vh.createHash(this.config.hashType).update(e+"LOG_FILE"+n).digest("hex")}),Vr.Logger.debug(`added file ${e} to log`),this.config.keepSettings&&this.config.keepSettings.amount){if(this.config.keepSettings.type==qU.KeepLogFiles.days){let s=Date.now()-86400*this.config.keepSettings.amount*1e3,o=this.config.files.filter(a=>{if(a.date>=s)return !0;this.removeLog(a);});this.config.files=o;}else if(this.config.files.length>this.config.keepSettings.amount){var i=this.config.files.splice(-this.config.keepSettings.amount);this.config.files.length>0&&this.config.files.filter(s=>(this.removeLog(s),!1)),this.config.files=i;}}this.writeLog();}removeLog(e){if(e.hash===Vh.createHash(this.config.hashType).update(e.name+"LOG_FILE"+e.date).digest("hex"))try{Au.existsSync(e.name)&&(Vr.Logger.debug("removing log file",e.name),Au.unlinkSync(e.name),this.emitter.emit("logRemoved",e.name));}catch{Vr.Logger.verbose("Could not remove old log file: ",e.name);}else Vr.Logger.debug("incorrect hash",e.name,e.hash,Vh.createHash(this.config.hashType).update(e.name+"LOG_FILE"+e.date).digest("hex"));}};Kh.default=Gh;});var mx=A(Yh=>{Object.defineProperty(Yh,"__esModule",{value:!0});var LU=oe("stream"),Ki=oe("fs"),Zh=oe("path"),an=co(),un=lx(),px=dx(),$U=hx(),lo=Tu(),Jh=class t extends LU.EventEmitter{constructor(e,r=!1){var n,i;super(),this.config={},this.config=this.parseOptions(e),lo.Logger.getInstance(e.verbose,r),this.auditManager=new $U.default((n=this.config.auditSettings)!==null&&n!==void 0?n:un.default.auditSettings({}),this);let s=this.auditManager.config.files.slice(-1).shift();this.rotator=new px.default((i=this.config.rotationSettings)!==null&&i!==void 0?i:un.default.rotationSettings({}),s),this.rotate();}static getStream(e){return new t(e)}parseOptions(e){var r,n,i,s;let o={};o.options=un.default.fileStreamRotatorOptions(e),o.fileOptions=un.default.fileOptions((r=e.file_options)!==null&&r!==void 0?r:{});let a=un.default.auditSettings({});if(e.audit_file&&(a.auditFilename=e.audit_file),e.audit_hash_type&&(a.hashType=e.audit_hash_type),e.extension&&(a.extension=e.extension),e.max_logs){let d=un.default.extractParam(e.max_logs);a.keepSettings={type:((n=d.letter)===null||n===void 0?void 0:n.toLowerCase())=="d"?an.KeepLogFiles.days:an.KeepLogFiles.fileCount,amount:d.number};}switch(o.auditSettings=a,o.rotationSettings=un.default.rotationSettings({filename:e.filename,extension:e.extension}),e.date_format&&!e.frequency?o.rotationSettings.frequency=an.Frequency.date:o.rotationSettings.frequency=an.Frequency.none,e.date_format&&(o.rotationSettings.format=e.date_format),o.rotationSettings.utc=(i=e.utc)!==null&&i!==void 0?i:!1,e.frequency){case"daily":o.rotationSettings.frequency=an.Frequency.daily;break;case"custom":case"date":o.rotationSettings.frequency=an.Frequency.date;break;case"test":o.rotationSettings.frequency=an.Frequency.minutes,o.rotationSettings.amount=1;break;default:if(e.frequency){let d=un.default.extractParam(e.frequency);!((s=d.letter)===null||s===void 0)&&s.match(/^([mh])$/)&&(o.rotationSettings.frequency=d.letter=="h"?an.Frequency.hours:an.Frequency.minutes,o.rotationSettings.amount=d.number);}}if(e.size){let d=un.default.extractParam(e.size);switch(d.letter){case"k":o.rotationSettings.maxSize=d.number*1024;break;case"m":o.rotationSettings.maxSize=d.number*1024*1024;break;case"g":o.rotationSettings.maxSize=d.number*1024*1024*1024;break}}this.rotator=new px.default(o.rotationSettings);this.rotator.getNewFilename();return o}rotate(e=!1){var r;let n=this.currentFile;this.rotator.rotate(e),this.currentFile=this.rotator.getNewFilename(),this.currentFile!=n&&(this.fs&&(((r=this.config.options)===null||r===void 0?void 0:r.end_stream)===!0?this.fs.end():this.fs.destroy()),n&&this.auditManager.addLog(n),this.createNewLog(this.currentFile),this.emit("new",this.currentFile),this.emit("rotate",n,this.currentFile,e));}createNewLog(e){var r;(0, lo.makeDirectory)(e),this.auditManager.addLog(e);let n={};this.config.fileOptions&&(n=this.config.fileOptions),this.fs=Ki.createWriteStream(e,n),this.bubbleEvents(this.fs,e),!((r=this.config.options)===null||r===void 0)&&r.create_symlink&&this.createCurrentSymLink(e);}write(e,r){this.fs&&(this.rotator.shouldRotate()&&this.rotate(),this.fs.write(e,r??"utf8"),this.rotator.addBytes(Buffer.byteLength(e,r)),this.rotator.hasMaxSizeReached()&&this.rotate());}end(e){this.fs&&(this.fs.end(e),this.fs=void 0);}bubbleEvents(e,r){e.on("close",()=>{this.emit("close");}),e.on("finish",()=>{this.emit("finish");}),e.on("error",n=>{this.emit("error",n);}),e.on("open",n=>{this.emit("open",r);});}createCurrentSymLink(e){var r,n;if(!e)return;let i=(n=(r=this.config.options)===null||r===void 0?void 0:r.symlink_name)!==null&&n!==void 0?n:"current.log",s=Zh.dirname(e),o=Zh.basename(e),a=s+Zh.sep+i;try{if(Ki.existsSync(a)){if(Ki.lstatSync(a).isSymbolicLink()){Ki.unlinkSync(a),Ki.symlinkSync(o,a);return}lo.Logger.verbose("Could not create symlink file as file with the same name exists: ",a);}else Ki.symlinkSync(o,a);}catch(l){lo.Logger.verbose("[Could not create symlink file: ",a," -> ",o),lo.Logger.debug("error creating sym link",a,l);}}test(){return {config:this.config,rotator:this.rotator}}};Yh.default=Jh;});var gx=A(Pu=>{Object.defineProperty(Pu,"__esModule",{value:!0});Pu.getStream=void 0;var jU=mx();function HU(t){return new jU.default(t)}Pu.getStream=HU;});var wx=A((C8,vx)=>{vx.exports=function(){function t(n,i){function s(){this.constructor=n;}s.prototype=i.prototype,n.prototype=new s;}function e(n,i,s,o,a,l){this.message=n,this.expected=i,this.found=s,this.offset=o,this.line=a,this.column=l,this.name="SyntaxError";}t(e,Error);function r(n){var i=arguments.length>1?arguments[1]:{},s={},o={start:xg},a=xg,d=function(){return zg},c=s,p="#",m={type:"literal",value:"#",description:'"#"'},_=void 0,w={type:"any",description:"any character"},E="[",P={type:"literal",value:"[",description:'"["'},D="]",g={type:"literal",value:"]",description:'"]"'},S=function(u){_l(Ct("ObjectPath",u,Et,Rt));},I=function(u){_l(Ct("ArrayPath",u,Et,Rt));},L=function(u,h){return u.concat(h)},Z=function(u){return [u]},K=function(u){return u},U=".",B={type:"literal",value:".",description:'"."'},Q="=",N={type:"literal",value:"=",description:'"="'},te=function(u,h){_l(Ct("Assign",h,Et,Rt,u));},ae=function(u){return u.join("")},ye=function(u){return u.value},q='"""',W={type:"literal",value:'"""',description:'"\\"\\"\\""'},me=null,pe=function(u){return Ct("String",u.join(""),Et,Rt)},we='"',Xe={type:"literal",value:'"',description:'"\\""'},Ke="'''",Pt={type:"literal",value:"'''",description:`"'''"`},Lr="'",Ut={type:"literal",value:"'",description:`"'"`},St=function(u){return u},Ce=function(u){return u},Cr="\\",fn={type:"literal",value:"\\",description:'"\\\\"'},ce=function(){return ""},Me="e",ie={type:"literal",value:"e",description:'"e"'},be="E",$e={type:"literal",value:"E",description:'"E"'},ot=function(u,h){return Ct("Float",parseFloat(u+"e"+h),Et,Rt)},He=function(u){return Ct("Float",parseFloat(u),Et,Rt)},fr="+",Nt={type:"literal",value:"+",description:'"+"'},Hn=function(u){return u.join("")},qt="-",zt={type:"literal",value:"-",description:'"-"'},Wn=function(u){return "-"+u.join("")},yi=function(u){return Ct("Integer",parseInt(u,10),Et,Rt)},tr="true",Bn={type:"literal",value:"true",description:'"true"'},Un=function(){return Ct("Boolean",!0,Et,Rt)},Yr="false",zn={type:"literal",value:"false",description:'"false"'},xr=function(){return Ct("Boolean",!1,Et,Rt)},k=function(){return Ct("Array",[],Et,Rt)},G=function(u){return Ct("Array",u?[u]:[],Et,Rt)},se=function(u){return Ct("Array",u,Et,Rt)},fe=function(u,h){return Ct("Array",u.concat(h),Et,Rt)},qe=function(u){return u},ke=",",ze={type:"literal",value:",",description:'","'},Ze="{",Te={type:"literal",value:"{",description:'"{"'},We="}",Ie={type:"literal",value:"}",description:'"}"'},et=function(u){return Ct("InlineTable",u,Et,Rt)},ut=function(u,h){return Ct("InlineTableValue",h,Et,Rt,u)},Lt=function(u){return "."+u},bi=function(u){return u.join("")},dn=":",hn={type:"literal",value:":",description:'":"'},Ss=function(u){return u.join("")},Es="T",No={type:"literal",value:"T",description:'"T"'},j="Z",v={type:"literal",value:"Z",description:'"Z"'},M=function(u,h){return Ct("Date",new Date(u+"T"+h+"Z"),Et,Rt)},F=function(u,h){return Ct("Date",new Date(u+"T"+h),Et,Rt)},R=/^[ \t]/,y={type:"class",value:"[ \\t]",description:"[ \\t]"},$=` +`,J={type:"literal",value:` +`,description:'"\\n"'},Ee="\r",tt={type:"literal",value:"\r",description:'"\\r"'},Ve=/^[0-9a-f]/i,rr={type:"class",value:"[0-9a-f]i",description:"[0-9a-f]i"},nr=/^[0-9]/,Tr={type:"class",value:"[0-9]",description:"[0-9]"},Pe="_",pn={type:"literal",value:"_",description:'"_"'},vi=function(){return ""},qo=/^[A-Za-z0-9_\-]/,$1={type:"class",value:"[A-Za-z0-9_\\-]",description:"[A-Za-z0-9_\\-]"},j1=function(u){return u.join("")},gg='\\"',H1={type:"literal",value:'\\"',description:'"\\\\\\""'},W1=function(){return '"'},_g="\\\\",B1={type:"literal",value:"\\\\",description:'"\\\\\\\\"'},U1=function(){return "\\"},yg="\\b",z1={type:"literal",value:"\\b",description:'"\\\\b"'},V1=function(){return "\b"},bg="\\t",G1={type:"literal",value:"\\t",description:'"\\\\t"'},K1=function(){return " "},vg="\\n",Z1={type:"literal",value:"\\n",description:'"\\\\n"'},J1=function(){return ` +`},wg="\\f",Y1={type:"literal",value:"\\f",description:'"\\\\f"'},X1=function(){return "\f"},Sg="\\r",Q1={type:"literal",value:"\\r",description:'"\\\\r"'},eO=function(){return "\r"},Eg="\\U",tO={type:"literal",value:"\\U",description:'"\\\\U"'},Rg=function(u){return wO(u.join(""))},Cg="\\u",rO={type:"literal",value:"\\u",description:'"\\\\u"'},f=0,de=0,Rs=0,fl={line:1,column:1,seenCR:!1},Lo=0,dl=[],X=0,ee={},$o;if("startRule"in i){if(!(i.startRule in o))throw new Error(`Can't start parsing from rule "`+i.startRule+'".');a=o[i.startRule];}function Et(){return hl(de).line}function Rt(){return hl(de).column}function hl(u){function h(b,x,O){var H,V;for(H=x;Hu&&(Rs=0,fl={line:1,column:1,seenCR:!1}),h(fl,Rs,u),Rs=u),fl}function re(u){fLo&&(Lo=f,dl=[]),dl.push(u));}function pl(u,h,b){function x(le){var Se=1;for(le.sort(function(Be,Fe){return Be.descriptionFe.description?1:0});Se1?Fe.slice(0,-1).join(", ")+" or "+Fe[le.length-1]:Fe[0],ct=Se?'"'+Be(Se)+'"':"end of input","Expected "+nt+" but "+ct+" found."}var H=hl(b),V=bf?(H=n.charAt(f),f++):(H=s,X===0&&re(w)),H!==s?(O=[O,H],x=O):(f=x,x=c)):(f=x,x=c);x!==s;)b.push(x),x=f,O=f,X++,H=hr(),H===s&&(H=Wo()),X--,H===s?O=_:(f=O,O=c),O!==s?(n.length>f?(H=n.charAt(f),f++):(H=s,X===0&&re(w)),H!==s?(O=[O,H],x=O):(f=x,x=c)):(f=x,x=c);b!==s?(h=[h,b],u=h):(f=u,u=c);}else f=u,u=c;return ee[V]={nextPos:f,result:u},u}function iO(){var u,h,b,x,O,H,V=f*49+4,le=ee[V];if(le)return f=le.nextPos,le.result;if(u=f,n.charCodeAt(f)===91?(h=E,f++):(h=s,X===0&&re(P)),h!==s){for(b=[],x=he();x!==s;)b.push(x),x=he();if(b!==s)if(x=Ag(),x!==s){for(O=[],H=he();H!==s;)O.push(H),H=he();O!==s?(n.charCodeAt(f)===93?(H=D,f++):(H=s,X===0&&re(g)),H!==s?(de=u,h=S(x),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;else f=u,u=c;}else f=u,u=c;return ee[V]={nextPos:f,result:u},u}function sO(){var u,h,b,x,O,H,V,le,Se=f*49+5,Be=ee[Se];if(Be)return f=Be.nextPos,Be.result;if(u=f,n.charCodeAt(f)===91?(h=E,f++):(h=s,X===0&&re(P)),h!==s)if(n.charCodeAt(f)===91?(b=E,f++):(b=s,X===0&&re(P)),b!==s){for(x=[],O=he();O!==s;)x.push(O),O=he();if(x!==s)if(O=Ag(),O!==s){for(H=[],V=he();V!==s;)H.push(V),V=he();H!==s?(n.charCodeAt(f)===93?(V=D,f++):(V=s,X===0&&re(g)),V!==s?(n.charCodeAt(f)===93?(le=D,f++):(le=s,X===0&&re(g)),le!==s?(de=u,h=I(O),u=h):(f=u,u=c)):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;else f=u,u=c;}else f=u,u=c;else f=u,u=c;return ee[Se]={nextPos:f,result:u},u}function Ag(){var u,h,b,x=f*49+6,O=ee[x];if(O)return f=O.nextPos,O.result;if(u=f,h=[],b=Dg(),b!==s)for(;b!==s;)h.push(b),b=Dg();else h=c;return h!==s?(b=Pg(),b!==s?(de=u,h=L(h,b),u=h):(f=u,u=c)):(f=u,u=c),u===s&&(u=f,h=Pg(),h!==s&&(de=u,h=Z(h)),u=h),ee[x]={nextPos:f,result:u},u}function Pg(){var u,h,b,x,O,H=f*49+7,V=ee[H];if(V)return f=V.nextPos,V.result;for(u=f,h=[],b=he();b!==s;)h.push(b),b=he();if(h!==s)if(b=Cs(),b!==s){for(x=[],O=he();O!==s;)x.push(O),O=he();x!==s?(de=u,h=K(b),u=h):(f=u,u=c);}else f=u,u=c;else f=u,u=c;if(u===s){for(u=f,h=[],b=he();b!==s;)h.push(b),b=he();if(h!==s)if(b=ml(),b!==s){for(x=[],O=he();O!==s;)x.push(O),O=he();x!==s?(de=u,h=K(b),u=h):(f=u,u=c);}else f=u,u=c;else f=u,u=c;}return ee[H]={nextPos:f,result:u},u}function Dg(){var u,h,b,x,O,H,V,le=f*49+8,Se=ee[le];if(Se)return f=Se.nextPos,Se.result;for(u=f,h=[],b=he();b!==s;)h.push(b),b=he();if(h!==s)if(b=Cs(),b!==s){for(x=[],O=he();O!==s;)x.push(O),O=he();if(x!==s)if(n.charCodeAt(f)===46?(O=U,f++):(O=s,X===0&&re(B)),O!==s){for(H=[],V=he();V!==s;)H.push(V),V=he();H!==s?(de=u,h=K(b),u=h):(f=u,u=c);}else f=u,u=c;else f=u,u=c;}else f=u,u=c;else f=u,u=c;if(u===s){for(u=f,h=[],b=he();b!==s;)h.push(b),b=he();if(h!==s)if(b=ml(),b!==s){for(x=[],O=he();O!==s;)x.push(O),O=he();if(x!==s)if(n.charCodeAt(f)===46?(O=U,f++):(O=s,X===0&&re(B)),O!==s){for(H=[],V=he();V!==s;)H.push(V),V=he();H!==s?(de=u,h=K(b),u=h):(f=u,u=c);}else f=u,u=c;else f=u,u=c;}else f=u,u=c;else f=u,u=c;}return ee[le]={nextPos:f,result:u},u}function oO(){var u,h,b,x,O,H,V=f*49+9,le=ee[V];if(le)return f=le.nextPos,le.result;if(u=f,h=Cs(),h!==s){for(b=[],x=he();x!==s;)b.push(x),x=he();if(b!==s)if(n.charCodeAt(f)===61?(x=Q,f++):(x=s,X===0&&re(N)),x!==s){for(O=[],H=he();H!==s;)O.push(H),H=he();O!==s?(H=wi(),H!==s?(de=u,h=te(h,H),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;else f=u,u=c;}else f=u,u=c;if(u===s)if(u=f,h=ml(),h!==s){for(b=[],x=he();x!==s;)b.push(x),x=he();if(b!==s)if(n.charCodeAt(f)===61?(x=Q,f++):(x=s,X===0&&re(N)),x!==s){for(O=[],H=he();H!==s;)O.push(H),H=he();O!==s?(H=wi(),H!==s?(de=u,h=te(h,H),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;else f=u,u=c;}else f=u,u=c;return ee[V]={nextPos:f,result:u},u}function Cs(){var u,h,b,x=f*49+10,O=ee[x];if(O)return f=O.nextPos,O.result;if(u=f,h=[],b=Bg(),b!==s)for(;b!==s;)h.push(b),b=Bg();else h=c;return h!==s&&(de=u,h=ae(h)),u=h,ee[x]={nextPos:f,result:u},u}function ml(){var u,h,b=f*49+11,x=ee[b];return x?(f=x.nextPos,x.result):(u=f,h=Og(),h!==s&&(de=u,h=ye(h)),u=h,u===s&&(u=f,h=Ig(),h!==s&&(de=u,h=ye(h)),u=h),ee[b]={nextPos:f,result:u},u)}function wi(){var u,h=f*49+12,b=ee[h];return b?(f=b.nextPos,b.result):(u=aO(),u===s&&(u=yO(),u===s&&(u=fO(),u===s&&(u=dO(),u===s&&(u=hO(),u===s&&(u=pO(),u===s&&(u=mO())))))),ee[h]={nextPos:f,result:u},u)}function aO(){var u,h=f*49+13,b=ee[h];return b?(f=b.nextPos,b.result):(u=uO(),u===s&&(u=Og(),u===s&&(u=cO(),u===s&&(u=Ig()))),ee[h]={nextPos:f,result:u},u)}function uO(){var u,h,b,x,O,H=f*49+14,V=ee[H];if(V)return f=V.nextPos,V.result;if(u=f,n.substr(f,3)===q?(h=q,f+=3):(h=s,X===0&&re(W)),h!==s)if(b=hr(),b===s&&(b=me),b!==s){for(x=[],O=Fg();O!==s;)x.push(O),O=Fg();x!==s?(n.substr(f,3)===q?(O=q,f+=3):(O=s,X===0&&re(W)),O!==s?(de=u,h=pe(x),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;else f=u,u=c;return ee[H]={nextPos:f,result:u},u}function Og(){var u,h,b,x,O=f*49+15,H=ee[O];if(H)return f=H.nextPos,H.result;if(u=f,n.charCodeAt(f)===34?(h=we,f++):(h=s,X===0&&re(Xe)),h!==s){for(b=[],x=kg();x!==s;)b.push(x),x=kg();b!==s?(n.charCodeAt(f)===34?(x=we,f++):(x=s,X===0&&re(Xe)),x!==s?(de=u,h=pe(b),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;return ee[O]={nextPos:f,result:u},u}function cO(){var u,h,b,x,O,H=f*49+16,V=ee[H];if(V)return f=V.nextPos,V.result;if(u=f,n.substr(f,3)===Ke?(h=Ke,f+=3):(h=s,X===0&&re(Pt)),h!==s)if(b=hr(),b===s&&(b=me),b!==s){for(x=[],O=Ng();O!==s;)x.push(O),O=Ng();x!==s?(n.substr(f,3)===Ke?(O=Ke,f+=3):(O=s,X===0&&re(Pt)),O!==s?(de=u,h=pe(x),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;else f=u,u=c;return ee[H]={nextPos:f,result:u},u}function Ig(){var u,h,b,x,O=f*49+17,H=ee[O];if(H)return f=H.nextPos,H.result;if(u=f,n.charCodeAt(f)===39?(h=Lr,f++):(h=s,X===0&&re(Ut)),h!==s){for(b=[],x=Mg();x!==s;)b.push(x),x=Mg();b!==s?(n.charCodeAt(f)===39?(x=Lr,f++):(x=s,X===0&&re(Ut)),x!==s?(de=u,h=pe(b),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;return ee[O]={nextPos:f,result:u},u}function kg(){var u,h,b,x=f*49+18,O=ee[x];return O?(f=O.nextPos,O.result):(u=Ug(),u===s&&(u=f,h=f,X++,n.charCodeAt(f)===34?(b=we,f++):(b=s,X===0&&re(Xe)),X--,b===s?h=_:(f=h,h=c),h!==s?(n.length>f?(b=n.charAt(f),f++):(b=s,X===0&&re(w)),b!==s?(de=u,h=St(b),u=h):(f=u,u=c)):(f=u,u=c)),ee[x]={nextPos:f,result:u},u)}function Mg(){var u,h,b,x=f*49+19,O=ee[x];return O?(f=O.nextPos,O.result):(u=f,h=f,X++,n.charCodeAt(f)===39?(b=Lr,f++):(b=s,X===0&&re(Ut)),X--,b===s?h=_:(f=h,h=c),h!==s?(n.length>f?(b=n.charAt(f),f++):(b=s,X===0&&re(w)),b!==s?(de=u,h=St(b),u=h):(f=u,u=c)):(f=u,u=c),ee[x]={nextPos:f,result:u},u)}function Fg(){var u,h,b,x=f*49+20,O=ee[x];return O?(f=O.nextPos,O.result):(u=Ug(),u===s&&(u=lO(),u===s&&(u=f,h=f,X++,n.substr(f,3)===q?(b=q,f+=3):(b=s,X===0&&re(W)),X--,b===s?h=_:(f=h,h=c),h!==s?(n.length>f?(b=n.charAt(f),f++):(b=s,X===0&&re(w)),b!==s?(de=u,h=Ce(b),u=h):(f=u,u=c)):(f=u,u=c))),ee[x]={nextPos:f,result:u},u)}function lO(){var u,h,b,x,O,H=f*49+21,V=ee[H];if(V)return f=V.nextPos,V.result;if(u=f,n.charCodeAt(f)===92?(h=Cr,f++):(h=s,X===0&&re(fn)),h!==s)if(b=hr(),b!==s){for(x=[],O=Wg();O!==s;)x.push(O),O=Wg();x!==s?(de=u,h=ce(),u=h):(f=u,u=c);}else f=u,u=c;else f=u,u=c;return ee[H]={nextPos:f,result:u},u}function Ng(){var u,h,b,x=f*49+22,O=ee[x];return O?(f=O.nextPos,O.result):(u=f,h=f,X++,n.substr(f,3)===Ke?(b=Ke,f+=3):(b=s,X===0&&re(Pt)),X--,b===s?h=_:(f=h,h=c),h!==s?(n.length>f?(b=n.charAt(f),f++):(b=s,X===0&&re(w)),b!==s?(de=u,h=St(b),u=h):(f=u,u=c)):(f=u,u=c),ee[x]={nextPos:f,result:u},u)}function fO(){var u,h,b,x,O=f*49+23,H=ee[O];return H?(f=H.nextPos,H.result):(u=f,h=qg(),h===s&&(h=gl()),h!==s?(n.charCodeAt(f)===101?(b=Me,f++):(b=s,X===0&&re(ie)),b===s&&(n.charCodeAt(f)===69?(b=be,f++):(b=s,X===0&&re($e))),b!==s?(x=gl(),x!==s?(de=u,h=ot(h,x),u=h):(f=u,u=c)):(f=u,u=c)):(f=u,u=c),u===s&&(u=f,h=qg(),h!==s&&(de=u,h=He(h)),u=h),ee[O]={nextPos:f,result:u},u)}function qg(){var u,h,b,x,O,H,V=f*49+24,le=ee[V];return le?(f=le.nextPos,le.result):(u=f,n.charCodeAt(f)===43?(h=fr,f++):(h=s,X===0&&re(Nt)),h===s&&(h=me),h!==s?(b=f,x=xs(),x!==s?(n.charCodeAt(f)===46?(O=U,f++):(O=s,X===0&&re(B)),O!==s?(H=xs(),H!==s?(x=[x,O,H],b=x):(f=b,b=c)):(f=b,b=c)):(f=b,b=c),b!==s?(de=u,h=Hn(b),u=h):(f=u,u=c)):(f=u,u=c),u===s&&(u=f,n.charCodeAt(f)===45?(h=qt,f++):(h=s,X===0&&re(zt)),h!==s?(b=f,x=xs(),x!==s?(n.charCodeAt(f)===46?(O=U,f++):(O=s,X===0&&re(B)),O!==s?(H=xs(),H!==s?(x=[x,O,H],b=x):(f=b,b=c)):(f=b,b=c)):(f=b,b=c),b!==s?(de=u,h=Wn(b),u=h):(f=u,u=c)):(f=u,u=c)),ee[V]={nextPos:f,result:u},u)}function dO(){var u,h,b=f*49+25,x=ee[b];return x?(f=x.nextPos,x.result):(u=f,h=gl(),h!==s&&(de=u,h=yi(h)),u=h,ee[b]={nextPos:f,result:u},u)}function gl(){var u,h,b,x,O,H=f*49+26,V=ee[H];if(V)return f=V.nextPos,V.result;if(u=f,n.charCodeAt(f)===43?(h=fr,f++):(h=s,X===0&&re(Nt)),h===s&&(h=me),h!==s){if(b=[],x=je(),x!==s)for(;x!==s;)b.push(x),x=je();else b=c;b!==s?(x=f,X++,n.charCodeAt(f)===46?(O=U,f++):(O=s,X===0&&re(B)),X--,O===s?x=_:(f=x,x=c),x!==s?(de=u,h=Hn(b),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;if(u===s)if(u=f,n.charCodeAt(f)===45?(h=qt,f++):(h=s,X===0&&re(zt)),h!==s){if(b=[],x=je(),x!==s)for(;x!==s;)b.push(x),x=je();else b=c;b!==s?(x=f,X++,n.charCodeAt(f)===46?(O=U,f++):(O=s,X===0&&re(B)),X--,O===s?x=_:(f=x,x=c),x!==s?(de=u,h=Wn(b),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;return ee[H]={nextPos:f,result:u},u}function hO(){var u,h,b=f*49+27,x=ee[b];return x?(f=x.nextPos,x.result):(u=f,n.substr(f,4)===tr?(h=tr,f+=4):(h=s,X===0&&re(Bn)),h!==s&&(de=u,h=Un()),u=h,u===s&&(u=f,n.substr(f,5)===Yr?(h=Yr,f+=5):(h=s,X===0&&re(zn)),h!==s&&(de=u,h=xr()),u=h),ee[b]={nextPos:f,result:u},u)}function pO(){var u,h,b,x,O,H=f*49+28,V=ee[H];if(V)return f=V.nextPos,V.result;if(u=f,n.charCodeAt(f)===91?(h=E,f++):(h=s,X===0&&re(P)),h!==s){for(b=[],x=dr();x!==s;)b.push(x),x=dr();b!==s?(n.charCodeAt(f)===93?(x=D,f++):(x=s,X===0&&re(g)),x!==s?(de=u,h=k(),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;if(u===s&&(u=f,n.charCodeAt(f)===91?(h=E,f++):(h=s,X===0&&re(P)),h!==s?(b=Lg(),b===s&&(b=me),b!==s?(n.charCodeAt(f)===93?(x=D,f++):(x=s,X===0&&re(g)),x!==s?(de=u,h=G(b),u=h):(f=u,u=c)):(f=u,u=c)):(f=u,u=c),u===s)){if(u=f,n.charCodeAt(f)===91?(h=E,f++):(h=s,X===0&&re(P)),h!==s){if(b=[],x=Ho(),x!==s)for(;x!==s;)b.push(x),x=Ho();else b=c;b!==s?(n.charCodeAt(f)===93?(x=D,f++):(x=s,X===0&&re(g)),x!==s?(de=u,h=se(b),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;if(u===s)if(u=f,n.charCodeAt(f)===91?(h=E,f++):(h=s,X===0&&re(P)),h!==s){if(b=[],x=Ho(),x!==s)for(;x!==s;)b.push(x),x=Ho();else b=c;b!==s?(x=Lg(),x!==s?(n.charCodeAt(f)===93?(O=D,f++):(O=s,X===0&&re(g)),O!==s?(de=u,h=fe(b,x),u=h):(f=u,u=c)):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;}return ee[H]={nextPos:f,result:u},u}function Lg(){var u,h,b,x,O,H=f*49+29,V=ee[H];if(V)return f=V.nextPos,V.result;for(u=f,h=[],b=dr();b!==s;)h.push(b),b=dr();if(h!==s)if(b=wi(),b!==s){for(x=[],O=dr();O!==s;)x.push(O),O=dr();x!==s?(de=u,h=qe(b),u=h):(f=u,u=c);}else f=u,u=c;else f=u,u=c;return ee[H]={nextPos:f,result:u},u}function Ho(){var u,h,b,x,O,H,V,le=f*49+30,Se=ee[le];if(Se)return f=Se.nextPos,Se.result;for(u=f,h=[],b=dr();b!==s;)h.push(b),b=dr();if(h!==s)if(b=wi(),b!==s){for(x=[],O=dr();O!==s;)x.push(O),O=dr();if(x!==s)if(n.charCodeAt(f)===44?(O=ke,f++):(O=s,X===0&&re(ze)),O!==s){for(H=[],V=dr();V!==s;)H.push(V),V=dr();H!==s?(de=u,h=qe(b),u=h):(f=u,u=c);}else f=u,u=c;else f=u,u=c;}else f=u,u=c;else f=u,u=c;return ee[le]={nextPos:f,result:u},u}function dr(){var u,h=f*49+31,b=ee[h];return b?(f=b.nextPos,b.result):(u=he(),u===s&&(u=hr(),u===s&&(u=jo())),ee[h]={nextPos:f,result:u},u)}function mO(){var u,h,b,x,O,H,V=f*49+32,le=ee[V];if(le)return f=le.nextPos,le.result;if(u=f,n.charCodeAt(f)===123?(h=Ze,f++):(h=s,X===0&&re(Te)),h!==s){for(b=[],x=he();x!==s;)b.push(x),x=he();if(b!==s){for(x=[],O=$g();O!==s;)x.push(O),O=$g();if(x!==s){for(O=[],H=he();H!==s;)O.push(H),H=he();O!==s?(n.charCodeAt(f)===125?(H=We,f++):(H=s,X===0&&re(Ie)),H!==s?(de=u,h=et(x),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;}else f=u,u=c;}else f=u,u=c;return ee[V]={nextPos:f,result:u},u}function $g(){var u,h,b,x,O,H,V,le,Se,Be,Fe,nt=f*49+33,ct=ee[nt];if(ct)return f=ct.nextPos,ct.result;for(u=f,h=[],b=he();b!==s;)h.push(b),b=he();if(h!==s)if(b=Cs(),b!==s){for(x=[],O=he();O!==s;)x.push(O),O=he();if(x!==s)if(n.charCodeAt(f)===61?(O=Q,f++):(O=s,X===0&&re(N)),O!==s){for(H=[],V=he();V!==s;)H.push(V),V=he();if(H!==s)if(V=wi(),V!==s){for(le=[],Se=he();Se!==s;)le.push(Se),Se=he();if(le!==s)if(n.charCodeAt(f)===44?(Se=ke,f++):(Se=s,X===0&&re(ze)),Se!==s){for(Be=[],Fe=he();Fe!==s;)Be.push(Fe),Fe=he();Be!==s?(de=u,h=ut(b,V),u=h):(f=u,u=c);}else f=u,u=c;else f=u,u=c;}else f=u,u=c;else f=u,u=c;}else f=u,u=c;else f=u,u=c;}else f=u,u=c;else f=u,u=c;if(u===s){for(u=f,h=[],b=he();b!==s;)h.push(b),b=he();if(h!==s)if(b=Cs(),b!==s){for(x=[],O=he();O!==s;)x.push(O),O=he();if(x!==s)if(n.charCodeAt(f)===61?(O=Q,f++):(O=s,X===0&&re(N)),O!==s){for(H=[],V=he();V!==s;)H.push(V),V=he();H!==s?(V=wi(),V!==s?(de=u,h=ut(b,V),u=h):(f=u,u=c)):(f=u,u=c);}else f=u,u=c;else f=u,u=c;}else f=u,u=c;else f=u,u=c;}return ee[nt]={nextPos:f,result:u},u}function jg(){var u,h,b,x=f*49+34,O=ee[x];return O?(f=O.nextPos,O.result):(u=f,n.charCodeAt(f)===46?(h=U,f++):(h=s,X===0&&re(B)),h!==s?(b=xs(),b!==s?(de=u,h=Lt(b),u=h):(f=u,u=c)):(f=u,u=c),ee[x]={nextPos:f,result:u},u)}function Hg(){var u,h,b,x,O,H,V,le,Se,Be,Fe,nt,ct=f*49+35,ir=ee[ct];return ir?(f=ir.nextPos,ir.result):(u=f,h=f,b=je(),b!==s?(x=je(),x!==s?(O=je(),O!==s?(H=je(),H!==s?(n.charCodeAt(f)===45?(V=qt,f++):(V=s,X===0&&re(zt)),V!==s?(le=je(),le!==s?(Se=je(),Se!==s?(n.charCodeAt(f)===45?(Be=qt,f++):(Be=s,X===0&&re(zt)),Be!==s?(Fe=je(),Fe!==s?(nt=je(),nt!==s?(b=[b,x,O,H,V,le,Se,Be,Fe,nt],h=b):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c),h!==s&&(de=u,h=bi(h)),u=h,ee[ct]={nextPos:f,result:u},u)}function gO(){var u,h,b,x,O,H,V,le,Se,Be,Fe,nt=f*49+36,ct=ee[nt];return ct?(f=ct.nextPos,ct.result):(u=f,h=f,b=je(),b!==s?(x=je(),x!==s?(n.charCodeAt(f)===58?(O=dn,f++):(O=s,X===0&&re(hn)),O!==s?(H=je(),H!==s?(V=je(),V!==s?(n.charCodeAt(f)===58?(le=dn,f++):(le=s,X===0&&re(hn)),le!==s?(Se=je(),Se!==s?(Be=je(),Be!==s?(Fe=jg(),Fe===s&&(Fe=me),Fe!==s?(b=[b,x,O,H,V,le,Se,Be,Fe],h=b):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c),h!==s&&(de=u,h=Ss(h)),u=h,ee[nt]={nextPos:f,result:u},u)}function _O(){var u,h,b,x,O,H,V,le,Se,Be,Fe,nt,ct,ir,Si,mn,sr,Vg=f*49+37,yl=ee[Vg];return yl?(f=yl.nextPos,yl.result):(u=f,h=f,b=je(),b!==s?(x=je(),x!==s?(n.charCodeAt(f)===58?(O=dn,f++):(O=s,X===0&&re(hn)),O!==s?(H=je(),H!==s?(V=je(),V!==s?(n.charCodeAt(f)===58?(le=dn,f++):(le=s,X===0&&re(hn)),le!==s?(Se=je(),Se!==s?(Be=je(),Be!==s?(Fe=jg(),Fe===s&&(Fe=me),Fe!==s?(n.charCodeAt(f)===45?(nt=qt,f++):(nt=s,X===0&&re(zt)),nt===s&&(n.charCodeAt(f)===43?(nt=fr,f++):(nt=s,X===0&&re(Nt))),nt!==s?(ct=je(),ct!==s?(ir=je(),ir!==s?(n.charCodeAt(f)===58?(Si=dn,f++):(Si=s,X===0&&re(hn)),Si!==s?(mn=je(),mn!==s?(sr=je(),sr!==s?(b=[b,x,O,H,V,le,Se,Be,Fe,nt,ct,ir,Si,mn,sr],h=b):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c)):(f=h,h=c),h!==s&&(de=u,h=Ss(h)),u=h,ee[Vg]={nextPos:f,result:u},u)}function yO(){var u,h,b,x,O,H=f*49+38,V=ee[H];return V?(f=V.nextPos,V.result):(u=f,h=Hg(),h!==s?(n.charCodeAt(f)===84?(b=Es,f++):(b=s,X===0&&re(No)),b!==s?(x=gO(),x!==s?(n.charCodeAt(f)===90?(O=j,f++):(O=s,X===0&&re(v)),O!==s?(de=u,h=M(h,x),u=h):(f=u,u=c)):(f=u,u=c)):(f=u,u=c)):(f=u,u=c),u===s&&(u=f,h=Hg(),h!==s?(n.charCodeAt(f)===84?(b=Es,f++):(b=s,X===0&&re(No)),b!==s?(x=_O(),x!==s?(de=u,h=F(h,x),u=h):(f=u,u=c)):(f=u,u=c)):(f=u,u=c)),ee[H]={nextPos:f,result:u},u)}function he(){var u,h=f*49+39,b=ee[h];return b?(f=b.nextPos,b.result):(R.test(n.charAt(f))?(u=n.charAt(f),f++):(u=s,X===0&&re(y)),ee[h]={nextPos:f,result:u},u)}function hr(){var u,h,b,x=f*49+40,O=ee[x];return O?(f=O.nextPos,O.result):(n.charCodeAt(f)===10?(u=$,f++):(u=s,X===0&&re(J)),u===s&&(u=f,n.charCodeAt(f)===13?(h=Ee,f++):(h=s,X===0&&re(tt)),h!==s?(n.charCodeAt(f)===10?(b=$,f++):(b=s,X===0&&re(J)),b!==s?(h=[h,b],u=h):(f=u,u=c)):(f=u,u=c)),ee[x]={nextPos:f,result:u},u)}function Wg(){var u,h=f*49+41,b=ee[h];return b?(f=b.nextPos,b.result):(u=hr(),u===s&&(u=he()),ee[h]={nextPos:f,result:u},u)}function Wo(){var u,h,b=f*49+42,x=ee[b];return x?(f=x.nextPos,x.result):(u=f,X++,n.length>f?(h=n.charAt(f),f++):(h=s,X===0&&re(w)),X--,h===s?u=_:(f=u,u=c),ee[b]={nextPos:f,result:u},u)}function pr(){var u,h=f*49+43,b=ee[h];return b?(f=b.nextPos,b.result):(Ve.test(n.charAt(f))?(u=n.charAt(f),f++):(u=s,X===0&&re(rr)),ee[h]={nextPos:f,result:u},u)}function je(){var u,h,b=f*49+44,x=ee[b];return x?(f=x.nextPos,x.result):(nr.test(n.charAt(f))?(u=n.charAt(f),f++):(u=s,X===0&&re(Tr)),u===s&&(u=f,n.charCodeAt(f)===95?(h=Pe,f++):(h=s,X===0&&re(pn)),h!==s&&(de=u,h=vi()),u=h),ee[b]={nextPos:f,result:u},u)}function Bg(){var u,h=f*49+45,b=ee[h];return b?(f=b.nextPos,b.result):(qo.test(n.charAt(f))?(u=n.charAt(f),f++):(u=s,X===0&&re($1)),ee[h]={nextPos:f,result:u},u)}function xs(){var u,h,b,x=f*49+46,O=ee[x];if(O)return f=O.nextPos,O.result;if(u=f,h=[],b=je(),b!==s)for(;b!==s;)h.push(b),b=je();else h=c;return h!==s&&(de=u,h=j1(h)),u=h,ee[x]={nextPos:f,result:u},u}function Ug(){var u,h,b=f*49+47,x=ee[b];return x?(f=x.nextPos,x.result):(u=f,n.substr(f,2)===gg?(h=gg,f+=2):(h=s,X===0&&re(H1)),h!==s&&(de=u,h=W1()),u=h,u===s&&(u=f,n.substr(f,2)===_g?(h=_g,f+=2):(h=s,X===0&&re(B1)),h!==s&&(de=u,h=U1()),u=h,u===s&&(u=f,n.substr(f,2)===yg?(h=yg,f+=2):(h=s,X===0&&re(z1)),h!==s&&(de=u,h=V1()),u=h,u===s&&(u=f,n.substr(f,2)===bg?(h=bg,f+=2):(h=s,X===0&&re(G1)),h!==s&&(de=u,h=K1()),u=h,u===s&&(u=f,n.substr(f,2)===vg?(h=vg,f+=2):(h=s,X===0&&re(Z1)),h!==s&&(de=u,h=J1()),u=h,u===s&&(u=f,n.substr(f,2)===wg?(h=wg,f+=2):(h=s,X===0&&re(Y1)),h!==s&&(de=u,h=X1()),u=h,u===s&&(u=f,n.substr(f,2)===Sg?(h=Sg,f+=2):(h=s,X===0&&re(Q1)),h!==s&&(de=u,h=eO()),u=h,u===s&&(u=bO()))))))),ee[b]={nextPos:f,result:u},u)}function bO(){var u,h,b,x,O,H,V,le,Se,Be,Fe,nt=f*49+48,ct=ee[nt];return ct?(f=ct.nextPos,ct.result):(u=f,n.substr(f,2)===Eg?(h=Eg,f+=2):(h=s,X===0&&re(tO)),h!==s?(b=f,x=pr(),x!==s?(O=pr(),O!==s?(H=pr(),H!==s?(V=pr(),V!==s?(le=pr(),le!==s?(Se=pr(),Se!==s?(Be=pr(),Be!==s?(Fe=pr(),Fe!==s?(x=[x,O,H,V,le,Se,Be,Fe],b=x):(f=b,b=c)):(f=b,b=c)):(f=b,b=c)):(f=b,b=c)):(f=b,b=c)):(f=b,b=c)):(f=b,b=c)):(f=b,b=c),b!==s?(de=u,h=Rg(b),u=h):(f=u,u=c)):(f=u,u=c),u===s&&(u=f,n.substr(f,2)===Cg?(h=Cg,f+=2):(h=s,X===0&&re(rO)),h!==s?(b=f,x=pr(),x!==s?(O=pr(),O!==s?(H=pr(),H!==s?(V=pr(),V!==s?(x=[x,O,H,V],b=x):(f=b,b=c)):(f=b,b=c)):(f=b,b=c)):(f=b,b=c),b!==s?(de=u,h=Rg(b),u=h):(f=u,u=c)):(f=u,u=c)),ee[nt]={nextPos:f,result:u},u)}var zg=[];function vO(u,h,b){var x=new Error(u);throw x.line=h,x.column=b,x}function _l(u){zg.push(u);}function Ct(u,h,b,x,O){var H={type:u,value:h,line:b(),column:x()};return O&&(H.key=O),H}function wO(u,h,b){var x=parseInt("0x"+u);if(!isFinite(x)||Math.floor(x)!=x||x<0||x>1114111||x>55295&&x<57344)vO("Invalid Unicode escape code: "+u,h,b);else return SO(x)}function SO(){var u=16384,h=[],b,x,O=-1,H=arguments.length;if(!H)return "";for(var V="";++O>10)+55296,x=le%1024+56320,h.push(b,x)),(O+1==H||h.length>u)&&(V+=String.fromCharCode.apply(null,h),h.length=0);}return V}if($o=a(),$o!==s&&f===n.length)return $o;throw $o!==s&&f{function zU(t){var e=[],r=[],n="",i=Object.create(null),s=i;return a(t);function a(g){for(var S,I=0;I"u"?N===S.length-1?Q[te]=I:Q[te]=Object.create(null):N!==S.length-1&&r.indexOf(U)>-1&&l("Cannot redefine existing key '"+U+"'.",L,Z),Q=Q[te],Q instanceof Array&&Q.length&&N-1?'"'+g+'"':g}}Sx.exports={compile:zU};});var Cx=A((T8,Rx)=>{var VU=wx(),GU=Ex();Rx.exports={parse:function(t){var e=VU.parse(t.toString());return GU.compile(e)}};});var $x=A((ui,Lx)=>{var sp=oe("crypto");ui=Lx.exports=mo;function mo(t,e){return e=Nx(t,e),t3(t,e)}ui.sha1=function(t){return mo(t)};ui.keys=function(t){return mo(t,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})};ui.MD5=function(t){return mo(t,{algorithm:"md5",encoding:"hex"})};ui.keysMD5=function(t){return mo(t,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var Yi=sp.getHashes?sp.getHashes().slice():["sha1","md5"];Yi.push("passthrough");var Mx=["buffer","hex","binary","base64"];function Nx(t,e){e=e||{};var r={};if(r.algorithm=e.algorithm||"sha1",r.encoding=e.encoding||"hex",r.excludeValues=!!e.excludeValues,r.algorithm=r.algorithm.toLowerCase(),r.encoding=r.encoding.toLowerCase(),r.ignoreUnknown=e.ignoreUnknown===!0,r.respectType=e.respectType!==!1,r.respectFunctionNames=e.respectFunctionNames!==!1,r.respectFunctionProperties=e.respectFunctionProperties!==!1,r.unorderedArrays=e.unorderedArrays===!0,r.unorderedSets=e.unorderedSets!==!1,r.unorderedObjects=e.unorderedObjects!==!1,r.replacer=e.replacer||void 0,r.excludeKeys=e.excludeKeys||void 0,typeof t>"u")throw new Error("Object argument required.");for(var n=0;n"u"&&(r.write=r.update,r.end=r.update);var n=op(e,r);if(n.dispatch(t),r.update||r.end(""),r.digest)return r.digest(e.encoding==="buffer"?void 0:e.encoding);var i=r.read();return e.encoding==="buffer"?i:i.toString(e.encoding)}ui.writeToStream=function(t,e,r){return typeof r>"u"&&(r=e,e={}),e=Nx(t,e),op(e,r).dispatch(t)};function op(t,e,r){r=r||[];var n=function(i){return e.update?e.update(i,"utf8"):e.write(i,"utf8")};return {dispatch:function(i){t.replacer&&(i=t.replacer(i));var s=typeof i;return i===null&&(s="null"),this["_"+s](i)},_object:function(i){var s=/\[object (.*)\]/i,o=Object.prototype.toString.call(i),a=s.exec(o);a?a=a[1]:a="unknown:["+o+"]",a=a.toLowerCase();var l=null;if((l=r.indexOf(i))>=0)return this.dispatch("[CIRCULAR:"+l+"]");if(r.push(i),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(i))return n("buffer:"),n(i);if(a!=="object"&&a!=="function"&&a!=="asyncfunction")if(this["_"+a])this["_"+a](i);else {if(t.ignoreUnknown)return n("["+a+"]");throw new Error('Unknown object type "'+a+'"')}else {var d=Object.keys(i);t.unorderedObjects&&(d=d.sort()),t.respectType!==!1&&!Fx(i)&&d.splice(0,0,"prototype","__proto__","constructor"),t.excludeKeys&&(d=d.filter(function(p){return !t.excludeKeys(p)})),n("object:"+d.length+":");var c=this;return d.forEach(function(p){c.dispatch(p),n(":"),t.excludeValues||c.dispatch(i[p]),n(",");})}},_array:function(i,s){s=typeof s<"u"?s:t.unorderedArrays!==!1;var o=this;if(n("array:"+i.length+":"),!s||i.length<=1)return i.forEach(function(d){return o.dispatch(d)});var a=[],l=i.map(function(d){var c=new qx,p=r.slice(),m=op(t,c,p);return m.dispatch(d),a=a.concat(p.slice(r.length)),c.read().toString()});return r=r.concat(a),l.sort(),this._array(l,!1)},_date:function(i){return n("date:"+i.toJSON())},_symbol:function(i){return n("symbol:"+i.toString())},_error:function(i){return n("error:"+i.toString())},_boolean:function(i){return n("bool:"+i.toString())},_string:function(i){n("string:"+i.length+":"),n(i.toString());},_function:function(i){n("fn:"),Fx(i)?this.dispatch("[native]"):this.dispatch(i.toString()),t.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(i.name)),t.respectFunctionProperties&&this._object(i);},_number:function(i){return n("number:"+i.toString())},_xml:function(i){return n("xml:"+i.toString())},_null:function(){return n("Null")},_undefined:function(){return n("Undefined")},_regexp:function(i){return n("regex:"+i.toString())},_uint8array:function(i){return n("uint8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint8clampedarray:function(i){return n("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(i))},_int8array:function(i){return n("int8array:"),this.dispatch(Array.prototype.slice.call(i))},_uint16array:function(i){return n("uint16array:"),this.dispatch(Array.prototype.slice.call(i))},_int16array:function(i){return n("int16array:"),this.dispatch(Array.prototype.slice.call(i))},_uint32array:function(i){return n("uint32array:"),this.dispatch(Array.prototype.slice.call(i))},_int32array:function(i){return n("int32array:"),this.dispatch(Array.prototype.slice.call(i))},_float32array:function(i){return n("float32array:"),this.dispatch(Array.prototype.slice.call(i))},_float64array:function(i){return n("float64array:"),this.dispatch(Array.prototype.slice.call(i))},_arraybuffer:function(i){return n("arraybuffer:"),this.dispatch(new Uint8Array(i))},_url:function(i){return n("url:"+i.toString())},_map:function(i){n("map:");var s=Array.from(i);return this._array(s,t.unorderedSets!==!1)},_set:function(i){n("set:");var s=Array.from(i);return this._array(s,t.unorderedSets!==!1)},_file:function(i){return n("file:"),this.dispatch([i.name,i.size,i.type,i.lastModfied])},_blob:function(){if(t.ignoreUnknown)return n("[blob]");throw Error(`Hashing Blob objects is currently not supported (see https://github.com/puleos/object-hash/issues/26) Use "options.replacer" or "options.ignoreUnknown" -`)},_domwindow:function(){return n("domwindow")},_bigint:function(s){return n("bigint:"+s.toString())},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function HS(){return {buf:"",write:function(t){this.buf+=t;},end:function(t){this.buf+=t;},read:function(){return this.buf}}}});var JS=x((exports,module)=>{var Module=Module!==void 0?Module:{},TreeSitter=function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{constructor(){this.initialize();}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(t,e)=>{throw e},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",scriptDirectory="",read_,readAsync,readBinary;function locateFile(t){return Module.locateFile?Module.locateFile(t,scriptDirectory):scriptDirectory+t}function logExceptionOnExit(t){t instanceof ExitStatus||err("exiting due to exception: "+t);}if(ENVIRONMENT_IS_NODE){var fs=K("fs"),nodePath=K("path");scriptDirectory=ENVIRONMENT_IS_WORKER?nodePath.dirname(scriptDirectory)+"/":__dirname+"/",read_=(t,e)=>(t=isFileURI(t)?new URL(t):nodePath.normalize(t),fs.readFileSync(t,e?void 0:"utf8")),readBinary=t=>{var e=read_(t,!0);return e.buffer||(e=new Uint8Array(e)),e},readAsync=(t,e,r)=>{t=isFileURI(t)?new URL(t):nodePath.normalize(t),fs.readFile(t,function(n,s){n?r(n):e(s.buffer);});},process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=(t,e)=>{if(keepRuntimeAlive())throw process.exitCode=t,e;logExceptionOnExit(e),process.exit(t);},Module.inspect=function(){return "[Emscripten Module object]"};}else (ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:document!==void 0&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=scriptDirectory.indexOf("blob:")!==0?scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1):"",read_=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),readAsync=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{n.status==200||n.status==0&&n.response?e(n.response):r();},n.onerror=r,n.send(null);},t=>document.title=t);Module.print||console.log.bind(console);var err=Module.printErr||console.warn.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var STACK_ALIGN=16,dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var noExitRuntime=Module.noExitRuntime||!0,wasmMemory;typeof WebAssembly!="object"&&abort("no native wasm support detected");var ABORT=!1,EXITSTATUS,UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,buffer,HEAP8,HEAPU8,HEAP16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function UTF8ArrayToString(t,e,r){for(var n=e+r,s=e;t[s]&&!(s>=n);)++s;if(s-e>16&&t.buffer&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,s));for(var i="";e>10,56320|1023&d);}}else i+=String.fromCharCode((31&o)<<6|l);}else i+=String.fromCharCode(o);}return i}function UTF8ToString(t,e){return t?UTF8ArrayToString(HEAPU8,t,e):""}function stringToUTF8Array(t,e,r,n){if(!(n>0))return 0;for(var s=r,i=r+n-1,o=0;o=55296&&l<=57343&&(l=65536+((1023&l)<<10)|1023&t.charCodeAt(++o)),l<=127){if(r>=i)break;e[r++]=l;}else if(l<=2047){if(r+1>=i)break;e[r++]=192|l>>6,e[r++]=128|63&l;}else if(l<=65535){if(r+2>=i)break;e[r++]=224|l>>12,e[r++]=128|l>>6&63,e[r++]=128|63&l;}else {if(r+3>=i)break;e[r++]=240|l>>18,e[r++]=128|l>>12&63,e[r++]=128|l>>6&63,e[r++]=128|63&l;}}return e[r]=0,r-s}function stringToUTF8(t,e,r){return stringToUTF8Array(t,HEAPU8,e,r)}function lengthBytesUTF8(t){for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3;}return e}function updateGlobalBufferAndViews(t){buffer=t,Module.HEAP8=HEAP8=new Int8Array(t),Module.HEAP16=HEAP16=new Int16Array(t),Module.HEAP32=HEAP32=new Int32Array(t),Module.HEAPU8=HEAPU8=new Uint8Array(t),Module.HEAPU16=new Uint16Array(t),Module.HEAPU32=HEAPU32=new Uint32Array(t),Module.HEAPF32=HEAPF32=new Float32Array(t),Module.HEAPF64=HEAPF64=new Float64Array(t);}var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768}),wasmMemory&&(buffer=wasmMemory.buffer),INITIAL_MEMORY=buffer.byteLength,updateGlobalBufferAndViews(buffer);var wasmTable=new WebAssembly.Table({initial:20,element:"anyfunc"}),__ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__);}function preMain(){callRuntimeCallbacks(__ATMAIN__);}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(t){__ATPRERUN__.unshift(t);}function addOnInit(t){__ATINIT__.unshift(t);}function addOnPostRun(t){__ATPOSTRUN__.unshift(t);}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(t){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies);}function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),runDependencies==0&&(dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e();}}function abort(t){throw Module.onAbort&&Module.onAbort(t),err(t="Aborted("+t+")"),ABORT=!0,EXITSTATUS=1,t+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(t)}var dataURIPrefix="data:application/octet-stream;base64,",wasmBinaryFile,tempDouble,tempI64;function isDataURI(t){return t.startsWith(dataURIPrefix)}function isFileURI(t){return t.startsWith("file://")}function getBinary(t){try{if(t==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(t);throw "both async and sync fetching of the wasm failed"}catch(e){abort(e);}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile))return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw "failed to load wasm binary file at '"+wasmBinaryFile+"'";return t.arrayBuffer()}).catch(function(){return getBinary(wasmBinaryFile)});if(readAsync)return new Promise(function(t,e){readAsync(wasmBinaryFile,function(r){t(new Uint8Array(r));},e);})}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var t={env:asmLibraryArg,wasi_snapshot_preview1:asmLibraryArg,"GOT.mem":new Proxy(asmLibraryArg,GOTHandler),"GOT.func":new Proxy(asmLibraryArg,GOTHandler)};function e(s,i){var o=s.exports;o=relocateExports(o,1024);var l=getDylinkMetadata(i);l.neededDynlibs&&(dynamicLibraries=l.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(o),Module.asm=o,addOnInit(Module.asm.__wasm_call_ctors),__RELOC_FUNCS__.push(Module.asm.__wasm_apply_data_relocs),removeRunDependency();}function r(s){e(s.instance,s.module);}function n(s){return getBinaryPromise().then(function(i){return WebAssembly.instantiate(i,t)}).then(function(i){return i}).then(s,function(i){err("failed to asynchronously prepare wasm: "+i),abort(i);})}if(addRunDependency(),Module.instantiateWasm)try{return Module.instantiateWasm(t,e)}catch(s){return err("Module.instantiateWasm callback failed with error: "+s),!1}return wasmBinary||typeof WebAssembly.instantiateStreaming!="function"||isDataURI(wasmBinaryFile)||isFileURI(wasmBinaryFile)||ENVIRONMENT_IS_NODE||typeof fetch!="function"?n(r):fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(s){return WebAssembly.instantiateStreaming(s,t).then(r,function(i){return err("wasm streaming compile failed: "+i),err("falling back to ArrayBuffer instantiation"),n(r)})}),{}}wasmBinaryFile="tree-sitter.wasm",isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));function ExitStatus(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t;}var GOT={},CurrentModuleWeakSymbols=new Set([]),GOTHandler={get:function(t,e){var r=GOT[e];return r||(r=GOT[e]=new WebAssembly.Global({value:"i32",mutable:!0})),CurrentModuleWeakSymbols.has(e)||(r.required=!0),r}};function callRuntimeCallbacks(t){for(;t.length>0;)t.shift()(Module);}function getDylinkMetadata(t){var e=0,r=0;function n(){for(var A=0,b=1;;){var T=t[e++];if(A+=(127&T)*b,b*=128,!(128&T))break}return A}function s(){var A=n();return UTF8ArrayToString(t,(e+=A)-A,A)}function i(A,b){if(A)throw new Error(b)}var o="dylink.0";if(t instanceof WebAssembly.Module){var l=WebAssembly.Module.customSections(t,o);l.length===0&&(o="dylink",l=WebAssembly.Module.customSections(t,o)),i(l.length===0,"need dylink section"),r=(t=new Uint8Array(l[0])).length;}else {i(new Uint32Array(new Uint8Array(t.subarray(0,24)).buffer)[0]!=1836278016,"need to see wasm magic number"),i(t[8]!==0,"need the dylink section to be first"),e=9;var f=n();r=e+f,o=s();}var d={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(o=="dylink"){d.memorySize=n(),d.memoryAlign=n(),d.tableSize=n(),d.tableAlign=n();for(var u=n(),p=0;p>0];case"i16":return HEAP16[t>>1];case"i32":case"i64":return HEAP32[t>>2];case"float":return HEAPF32[t>>2];case"double":return HEAPF64[t>>3];case"*":return HEAPU32[t>>2];default:abort("invalid type for getValue: "+e);}return null}function asmjsMangle(t){return t.indexOf("dynCall_")==0||["stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0"].includes(t)?t:"_"+t}function mergeLibSymbols(t,e){for(var r in t)if(t.hasOwnProperty(r)){asmLibraryArg.hasOwnProperty(r)||(asmLibraryArg[r]=t[r]);var n=asmjsMangle(r);Module.hasOwnProperty(n)||(Module[n]=t[r]),r=="__main_argc_argv"&&(Module._main=t[r]);}}var LDSO={loadedLibsByName:{},loadedLibsByHandle:{}};function dynCallLegacy(t,e,r){var n=Module["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)}var wasmTableMirror=[];function getWasmTableEntry(t){var e=wasmTableMirror[t];return e||(t>=wasmTableMirror.length&&(wasmTableMirror.length=t+1),wasmTableMirror[t]=e=wasmTable.get(t)),e}function dynCall(t,e,r){return t.includes("j")?dynCallLegacy(t,e,r):getWasmTableEntry(e).apply(null,r)}function createInvokeFunction(t){return function(){var e=stackSave();try{return dynCall(t,arguments[0],Array.prototype.slice.call(arguments,1))}catch(r){if(stackRestore(e),r!==r+0)throw r;_setThrew(1,0);}}}var ___heap_base=78144;function zeroMemory(t,e){return HEAPU8.fill(0,t,t+e),t}function getMemory(t){if(runtimeInitialized)return zeroMemory(_malloc(t),t);var e=___heap_base,r=e+t+15&-16;return ___heap_base=r,GOT.__heap_base.value=r,e}function isInternalSym(t){return ["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm"].includes(t)}function uleb128Encode(t,e){t<128?e.push(t):e.push(t%128|128,t>>7);}function sigToWasmTypes(t){for(var e={i:"i32",j:"i32",f:"f32",d:"f64",p:"i32"},r={parameters:[],results:t[0]=="v"?[]:[e[t[0]]]},n=1;n>0];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign);memAlign=Math.max(memAlign,STACK_ALIGN);var memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+12>>0]=1,HEAPU32[handle+16>>2]=memoryBase,HEAP32[handle+20>>2]=metadata.memorySize,HEAPU32[handle+24>>2]=tableBase,HEAP32[handle+28>>2]=metadata.tableSize);}else memoryBase=HEAPU32[handle+16>>2],tableBase=HEAPU32[handle+24>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length,moduleExports;function resolveSymbol(t){var e=resolveGlobalSymbol(t,!1);return e||(e=moduleExports[t]),e}tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var proxyHandler={get:function(t,e){switch(e){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(e in asmLibraryArg)return asmLibraryArg[e];var r;return e in t||(t[e]=function(){return r||(r=resolveSymbol(e)),r.apply(null,arguments)}),t[e]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(instance){function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func="("+args+" ) => { "+body+"};";eval(func);}if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols(),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;startd(new Uint8Array(p)),u);});if(!readBinary)throw new Error(l+": file not found, and synchronous loading of external files is not available");return readBinary(l)}function i(){if(typeof preloadedWasm<"u"&&preloadedWasm[t]){var l=preloadedWasm[t];return e.loadAsync?Promise.resolve(l):l}return e.loadAsync?s(t).then(function(f){return loadWebAssemblyModule(f,e,r)}):loadWebAssemblyModule(s(t),e,r)}function o(l){n.global&&mergeLibSymbols(l),n.module=l;}return n={refcount:e.nodelete?1/0:1,name:t,module:"loading",global:e.global},LDSO.loadedLibsByName[t]=n,r&&(LDSO.loadedLibsByHandle[r]=n),e.loadAsync?i().then(function(l){return o(l),!0}):(o(i()),!0)}function reportUndefinedSymbols(){for(var t in GOT)if(GOT[t].value==0){var e=resolveGlobalSymbol(t,!0);if(!e&&!GOT[t].required)continue;if(typeof e=="function")GOT[t].value=addFunction(e,e.sig);else {if(typeof e!="number")throw new Error("bad export type for `"+t+"`: "+typeof e);GOT[t].value=e;}}}function preloadDylibs(){dynamicLibraries.length?(addRunDependency(),dynamicLibraries.reduce(function(t,e){return t.then(function(){return loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})})},Promise.resolve()).then(function(){reportUndefinedSymbols(),removeRunDependency();})):reportUndefinedSymbols();}function setValue(t,e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":case"i8":HEAP8[t>>0]=e;break;case"i16":HEAP16[t>>1]=e;break;case"i32":HEAP32[t>>2]=e;break;case"i64":tempI64=[e>>>0,(tempDouble=e,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t>>2]=tempI64[0],HEAP32[t+4>>2]=tempI64[1];break;case"float":HEAPF32[t>>2]=e;break;case"double":HEAPF64[t>>3]=e;break;case"*":HEAPU32[t>>2]=e;break;default:abort("invalid type for setValue: "+r);}}var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78144),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),nowIsMonotonic=!0,_emscripten_get_now;function __emscripten_get_now_is_monotonic(){return nowIsMonotonic}function _abort(){abort("");}function _emscripten_memcpy_big(t,e,r){HEAPU8.copyWithin(t,e,e+r);}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(t){try{return wasmMemory.grow(t-buffer.byteLength+65535>>>16),updateGlobalBufferAndViews(wasmMemory.buffer),1}catch{}}function _emscripten_resize_heap(t){var e=HEAPU8.length;t>>>=0;var r=getHeapMax();if(t>r)return !1;for(var n=1;n<=4;n*=2){var s=e*(1+.2/n);if(s=Math.min(s,t+100663296),emscripten_realloc_buffer(Math.min(r,(i=Math.max(t,s))+((o=65536)-i%o)%o)))return !0}var i,o;return !1}__emscripten_get_now_is_monotonic.sig="i",Module._abort=_abort,_abort.sig="v",_emscripten_get_now=ENVIRONMENT_IS_NODE?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),_emscripten_get_now.sig="d",_emscripten_memcpy_big.sig="vppp",_emscripten_resize_heap.sig="ip";var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function(t,e,r){if(PATH.isAbs(e))return e;var n;if(t===-100?n=FS.cwd():n=SYSCALLS.getStreamFromFD(t).path,e.length==0){if(!r)throw new FS.ErrnoError(44);return n}return PATH.join2(n,e)},doStat:function(t,e,r){try{var n=t(e);}catch(l){if(l&&l.node&&PATH.normalize(e)!==PATH.normalize(FS.getPath(l.node)))return -54;throw l}HEAP32[r>>2]=n.dev,HEAP32[r+8>>2]=n.ino,HEAP32[r+12>>2]=n.mode,HEAPU32[r+16>>2]=n.nlink,HEAP32[r+20>>2]=n.uid,HEAP32[r+24>>2]=n.gid,HEAP32[r+28>>2]=n.rdev,tempI64=[n.size>>>0,(tempDouble=n.size,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+40>>2]=tempI64[0],HEAP32[r+44>>2]=tempI64[1],HEAP32[r+48>>2]=4096,HEAP32[r+52>>2]=n.blocks;var s=n.atime.getTime(),i=n.mtime.getTime(),o=n.ctime.getTime();return tempI64=[Math.floor(s/1e3)>>>0,(tempDouble=Math.floor(s/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+56>>2]=tempI64[0],HEAP32[r+60>>2]=tempI64[1],HEAPU32[r+64>>2]=s%1e3*1e3,tempI64=[Math.floor(i/1e3)>>>0,(tempDouble=Math.floor(i/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+72>>2]=tempI64[0],HEAP32[r+76>>2]=tempI64[1],HEAPU32[r+80>>2]=i%1e3*1e3,tempI64=[Math.floor(o/1e3)>>>0,(tempDouble=Math.floor(o/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+88>>2]=tempI64[0],HEAP32[r+92>>2]=tempI64[1],HEAPU32[r+96>>2]=o%1e3*1e3,tempI64=[n.ino>>>0,(tempDouble=n.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+104>>2]=tempI64[0],HEAP32[r+108>>2]=tempI64[1],0},doMsync:function(t,e,r,n,s){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);if(2&n)return 0;var i=HEAPU8.slice(t,t+r);FS.msync(e,i,s,r,n);},varargs:void 0,get:function(){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(t){return UTF8ToString(t)},getStreamFromFD:function(t){var e=FS.getStream(t);if(!e)throw new FS.ErrnoError(8);return e}};function _proc_exit(t){EXITSTATUS=t,keepRuntimeAlive()||(Module.onExit&&Module.onExit(t),ABORT=!0),quit_(t,new ExitStatus(t));}function exitJS(t,e){EXITSTATUS=t,_proc_exit(t);}_proc_exit.sig="vi";var _exit=exitJS;function _fd_close(t){try{var e=SYSCALLS.getStreamFromFD(t);return FS.close(e),0}catch(r){if(typeof FS>"u"||!(r instanceof FS.ErrnoError))throw r;return r.errno}}function convertI32PairToI53Checked(t,e){return e+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*e:NaN}function _fd_seek(t,e,r,n,s){try{var i=convertI32PairToI53Checked(e,r);if(isNaN(i))return 61;var o=SYSCALLS.getStreamFromFD(t);return FS.llseek(o,i,n),tempI64=[o.position>>>0,(tempDouble=o.position,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[s>>2]=tempI64[0],HEAP32[s+4>>2]=tempI64[1],o.getdents&&i===0&&n===0&&(o.getdents=null),0}catch(l){if(typeof FS>"u"||!(l instanceof FS.ErrnoError))throw l;return l.errno}}function doWritev(t,e,r,n){for(var s=0,i=0;i>2],l=HEAPU32[e+4>>2];e+=8;var f=FS.write(t,HEAP8,o,l,n);if(f<0)return -1;s+=f,n!==void 0&&(n+=f);}return s}function _fd_write(t,e,r,n){try{var s=doWritev(SYSCALLS.getStreamFromFD(t),e,r);return HEAPU32[n>>2]=s,0}catch(i){if(typeof FS>"u"||!(i instanceof FS.ErrnoError))throw i;return i.errno}}function _tree_sitter_log_callback(t,e){if(currentLogCallback){let r=UTF8ToString(e);currentLogCallback(r,t!==0);}}function _tree_sitter_parse_callback(t,e,r,n,s){var i=currentParseCallback(e,{row:r,column:n});typeof i=="string"?(setValue(s,i.length,"i32"),stringToUTF16(i,t,10240)):setValue(s,0,"i32");}function handleException(t){if(t instanceof ExitStatus||t=="unwind")return EXITSTATUS;quit_(1,t);}function allocateUTF8OnStack(t){var e=lengthBytesUTF8(t)+1,r=stackAlloc(e);return stringToUTF8Array(t,HEAP8,r,e),r}function stringToUTF16(t,e,r){if(r===void 0&&(r=2147483647),r<2)return 0;for(var n=e,s=(r-=2)<2*t.length?r/2:t.length,i=0;i>1]=o,e+=2;}return HEAP16[e>>1]=0,e-n}function AsciiToString(t){for(var e="";;){var r=HEAPU8[t++>>0];if(!r)return e;e+=String.fromCharCode(r);}}_exit.sig="vi",_fd_close.sig="ii",_fd_seek.sig="iijip",_fd_write.sig="iippp";var asmLibraryArg={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,abort:_abort,emscripten_get_now:_emscripten_get_now,emscripten_memcpy_big:_emscripten_memcpy_big,emscripten_resize_heap:_emscripten_resize_heap,exit:_exit,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback};createWasm();Module.___wasm_call_ctors=function(){return (Module.___wasm_call_ctors=Module.asm.__wasm_call_ctors).apply(null,arguments)};Module.___wasm_apply_data_relocs=function(){return (Module.___wasm_apply_data_relocs=Module.asm.__wasm_apply_data_relocs).apply(null,arguments)};var _malloc=Module._malloc=function(){return (_malloc=Module._malloc=Module.asm.malloc).apply(null,arguments)};Module._calloc=function(){return (Module._calloc=Module.asm.calloc).apply(null,arguments)};Module._realloc=function(){return (Module._realloc=Module.asm.realloc).apply(null,arguments)};Module._free=function(){return (Module._free=Module.asm.free).apply(null,arguments)};Module._ts_language_symbol_count=function(){return (Module._ts_language_symbol_count=Module.asm.ts_language_symbol_count).apply(null,arguments)};Module._ts_language_version=function(){return (Module._ts_language_version=Module.asm.ts_language_version).apply(null,arguments)};Module._ts_language_field_count=function(){return (Module._ts_language_field_count=Module.asm.ts_language_field_count).apply(null,arguments)};Module._ts_language_symbol_name=function(){return (Module._ts_language_symbol_name=Module.asm.ts_language_symbol_name).apply(null,arguments)};Module._ts_language_symbol_for_name=function(){return (Module._ts_language_symbol_for_name=Module.asm.ts_language_symbol_for_name).apply(null,arguments)};Module._ts_language_symbol_type=function(){return (Module._ts_language_symbol_type=Module.asm.ts_language_symbol_type).apply(null,arguments)};Module._ts_language_field_name_for_id=function(){return (Module._ts_language_field_name_for_id=Module.asm.ts_language_field_name_for_id).apply(null,arguments)};Module._memset=function(){return (Module._memset=Module.asm.memset).apply(null,arguments)};Module._memcpy=function(){return (Module._memcpy=Module.asm.memcpy).apply(null,arguments)};Module._ts_parser_delete=function(){return (Module._ts_parser_delete=Module.asm.ts_parser_delete).apply(null,arguments)};Module._ts_parser_reset=function(){return (Module._ts_parser_reset=Module.asm.ts_parser_reset).apply(null,arguments)};Module._ts_parser_set_language=function(){return (Module._ts_parser_set_language=Module.asm.ts_parser_set_language).apply(null,arguments)};Module._ts_parser_timeout_micros=function(){return (Module._ts_parser_timeout_micros=Module.asm.ts_parser_timeout_micros).apply(null,arguments)};Module._ts_parser_set_timeout_micros=function(){return (Module._ts_parser_set_timeout_micros=Module.asm.ts_parser_set_timeout_micros).apply(null,arguments)};Module._memmove=function(){return (Module._memmove=Module.asm.memmove).apply(null,arguments)};Module._memcmp=function(){return (Module._memcmp=Module.asm.memcmp).apply(null,arguments)};Module._ts_query_new=function(){return (Module._ts_query_new=Module.asm.ts_query_new).apply(null,arguments)};Module._ts_query_delete=function(){return (Module._ts_query_delete=Module.asm.ts_query_delete).apply(null,arguments)};Module._iswspace=function(){return (Module._iswspace=Module.asm.iswspace).apply(null,arguments)};Module._iswalnum=function(){return (Module._iswalnum=Module.asm.iswalnum).apply(null,arguments)};Module._ts_query_pattern_count=function(){return (Module._ts_query_pattern_count=Module.asm.ts_query_pattern_count).apply(null,arguments)};Module._ts_query_capture_count=function(){return (Module._ts_query_capture_count=Module.asm.ts_query_capture_count).apply(null,arguments)};Module._ts_query_string_count=function(){return (Module._ts_query_string_count=Module.asm.ts_query_string_count).apply(null,arguments)};Module._ts_query_capture_name_for_id=function(){return (Module._ts_query_capture_name_for_id=Module.asm.ts_query_capture_name_for_id).apply(null,arguments)};Module._ts_query_string_value_for_id=function(){return (Module._ts_query_string_value_for_id=Module.asm.ts_query_string_value_for_id).apply(null,arguments)};Module._ts_query_predicates_for_pattern=function(){return (Module._ts_query_predicates_for_pattern=Module.asm.ts_query_predicates_for_pattern).apply(null,arguments)};Module._ts_tree_copy=function(){return (Module._ts_tree_copy=Module.asm.ts_tree_copy).apply(null,arguments)};Module._ts_tree_delete=function(){return (Module._ts_tree_delete=Module.asm.ts_tree_delete).apply(null,arguments)};Module._ts_init=function(){return (Module._ts_init=Module.asm.ts_init).apply(null,arguments)};Module._ts_parser_new_wasm=function(){return (Module._ts_parser_new_wasm=Module.asm.ts_parser_new_wasm).apply(null,arguments)};Module._ts_parser_enable_logger_wasm=function(){return (Module._ts_parser_enable_logger_wasm=Module.asm.ts_parser_enable_logger_wasm).apply(null,arguments)};Module._ts_parser_parse_wasm=function(){return (Module._ts_parser_parse_wasm=Module.asm.ts_parser_parse_wasm).apply(null,arguments)};Module._ts_language_type_is_named_wasm=function(){return (Module._ts_language_type_is_named_wasm=Module.asm.ts_language_type_is_named_wasm).apply(null,arguments)};Module._ts_language_type_is_visible_wasm=function(){return (Module._ts_language_type_is_visible_wasm=Module.asm.ts_language_type_is_visible_wasm).apply(null,arguments)};Module._ts_tree_root_node_wasm=function(){return (Module._ts_tree_root_node_wasm=Module.asm.ts_tree_root_node_wasm).apply(null,arguments)};Module._ts_tree_edit_wasm=function(){return (Module._ts_tree_edit_wasm=Module.asm.ts_tree_edit_wasm).apply(null,arguments)};Module._ts_tree_get_changed_ranges_wasm=function(){return (Module._ts_tree_get_changed_ranges_wasm=Module.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)};Module._ts_tree_cursor_new_wasm=function(){return (Module._ts_tree_cursor_new_wasm=Module.asm.ts_tree_cursor_new_wasm).apply(null,arguments)};Module._ts_tree_cursor_delete_wasm=function(){return (Module._ts_tree_cursor_delete_wasm=Module.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)};Module._ts_tree_cursor_reset_wasm=function(){return (Module._ts_tree_cursor_reset_wasm=Module.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_first_child_wasm=function(){return (Module._ts_tree_cursor_goto_first_child_wasm=Module.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_next_sibling_wasm=function(){return (Module._ts_tree_cursor_goto_next_sibling_wasm=Module.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_parent_wasm=function(){return (Module._ts_tree_cursor_goto_parent_wasm=Module.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_type_id_wasm=function(){return (Module._ts_tree_cursor_current_node_type_id_wasm=Module.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_is_named_wasm=function(){return (Module._ts_tree_cursor_current_node_is_named_wasm=Module.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_is_missing_wasm=function(){return (Module._ts_tree_cursor_current_node_is_missing_wasm=Module.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_id_wasm=function(){return (Module._ts_tree_cursor_current_node_id_wasm=Module.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_start_position_wasm=function(){return (Module._ts_tree_cursor_start_position_wasm=Module.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)};Module._ts_tree_cursor_end_position_wasm=function(){return (Module._ts_tree_cursor_end_position_wasm=Module.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)};Module._ts_tree_cursor_start_index_wasm=function(){return (Module._ts_tree_cursor_start_index_wasm=Module.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)};Module._ts_tree_cursor_end_index_wasm=function(){return (Module._ts_tree_cursor_end_index_wasm=Module.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_field_id_wasm=function(){return (Module._ts_tree_cursor_current_field_id_wasm=Module.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_wasm=function(){return (Module._ts_tree_cursor_current_node_wasm=Module.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)};Module._ts_node_symbol_wasm=function(){return (Module._ts_node_symbol_wasm=Module.asm.ts_node_symbol_wasm).apply(null,arguments)};Module._ts_node_child_count_wasm=function(){return (Module._ts_node_child_count_wasm=Module.asm.ts_node_child_count_wasm).apply(null,arguments)};Module._ts_node_named_child_count_wasm=function(){return (Module._ts_node_named_child_count_wasm=Module.asm.ts_node_named_child_count_wasm).apply(null,arguments)};Module._ts_node_child_wasm=function(){return (Module._ts_node_child_wasm=Module.asm.ts_node_child_wasm).apply(null,arguments)};Module._ts_node_named_child_wasm=function(){return (Module._ts_node_named_child_wasm=Module.asm.ts_node_named_child_wasm).apply(null,arguments)};Module._ts_node_child_by_field_id_wasm=function(){return (Module._ts_node_child_by_field_id_wasm=Module.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)};Module._ts_node_next_sibling_wasm=function(){return (Module._ts_node_next_sibling_wasm=Module.asm.ts_node_next_sibling_wasm).apply(null,arguments)};Module._ts_node_prev_sibling_wasm=function(){return (Module._ts_node_prev_sibling_wasm=Module.asm.ts_node_prev_sibling_wasm).apply(null,arguments)};Module._ts_node_next_named_sibling_wasm=function(){return (Module._ts_node_next_named_sibling_wasm=Module.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)};Module._ts_node_prev_named_sibling_wasm=function(){return (Module._ts_node_prev_named_sibling_wasm=Module.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)};Module._ts_node_parent_wasm=function(){return (Module._ts_node_parent_wasm=Module.asm.ts_node_parent_wasm).apply(null,arguments)};Module._ts_node_descendant_for_index_wasm=function(){return (Module._ts_node_descendant_for_index_wasm=Module.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)};Module._ts_node_named_descendant_for_index_wasm=function(){return (Module._ts_node_named_descendant_for_index_wasm=Module.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)};Module._ts_node_descendant_for_position_wasm=function(){return (Module._ts_node_descendant_for_position_wasm=Module.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)};Module._ts_node_named_descendant_for_position_wasm=function(){return (Module._ts_node_named_descendant_for_position_wasm=Module.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)};Module._ts_node_start_point_wasm=function(){return (Module._ts_node_start_point_wasm=Module.asm.ts_node_start_point_wasm).apply(null,arguments)};Module._ts_node_end_point_wasm=function(){return (Module._ts_node_end_point_wasm=Module.asm.ts_node_end_point_wasm).apply(null,arguments)};Module._ts_node_start_index_wasm=function(){return (Module._ts_node_start_index_wasm=Module.asm.ts_node_start_index_wasm).apply(null,arguments)};Module._ts_node_end_index_wasm=function(){return (Module._ts_node_end_index_wasm=Module.asm.ts_node_end_index_wasm).apply(null,arguments)};Module._ts_node_to_string_wasm=function(){return (Module._ts_node_to_string_wasm=Module.asm.ts_node_to_string_wasm).apply(null,arguments)};Module._ts_node_children_wasm=function(){return (Module._ts_node_children_wasm=Module.asm.ts_node_children_wasm).apply(null,arguments)};Module._ts_node_named_children_wasm=function(){return (Module._ts_node_named_children_wasm=Module.asm.ts_node_named_children_wasm).apply(null,arguments)};Module._ts_node_descendants_of_type_wasm=function(){return (Module._ts_node_descendants_of_type_wasm=Module.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)};Module._ts_node_is_named_wasm=function(){return (Module._ts_node_is_named_wasm=Module.asm.ts_node_is_named_wasm).apply(null,arguments)};Module._ts_node_has_changes_wasm=function(){return (Module._ts_node_has_changes_wasm=Module.asm.ts_node_has_changes_wasm).apply(null,arguments)};Module._ts_node_has_error_wasm=function(){return (Module._ts_node_has_error_wasm=Module.asm.ts_node_has_error_wasm).apply(null,arguments)};Module._ts_node_is_missing_wasm=function(){return (Module._ts_node_is_missing_wasm=Module.asm.ts_node_is_missing_wasm).apply(null,arguments)};Module._ts_query_matches_wasm=function(){return (Module._ts_query_matches_wasm=Module.asm.ts_query_matches_wasm).apply(null,arguments)};Module._ts_query_captures_wasm=function(){return (Module._ts_query_captures_wasm=Module.asm.ts_query_captures_wasm).apply(null,arguments)};Module.___cxa_atexit=function(){return (Module.___cxa_atexit=Module.asm.__cxa_atexit).apply(null,arguments)};Module._iswdigit=function(){return (Module._iswdigit=Module.asm.iswdigit).apply(null,arguments)};Module._iswalpha=function(){return (Module._iswalpha=Module.asm.iswalpha).apply(null,arguments)};Module._iswlower=function(){return (Module._iswlower=Module.asm.iswlower).apply(null,arguments)};Module._memchr=function(){return (Module._memchr=Module.asm.memchr).apply(null,arguments)};Module._strlen=function(){return (Module._strlen=Module.asm.strlen).apply(null,arguments)};Module._towupper=function(){return (Module._towupper=Module.asm.towupper).apply(null,arguments)};var _setThrew=Module._setThrew=function(){return (_setThrew=Module._setThrew=Module.asm.setThrew).apply(null,arguments)},stackSave=Module.stackSave=function(){return (stackSave=Module.stackSave=Module.asm.stackSave).apply(null,arguments)},stackRestore=Module.stackRestore=function(){return (stackRestore=Module.stackRestore=Module.asm.stackRestore).apply(null,arguments)},stackAlloc=Module.stackAlloc=function(){return (stackAlloc=Module.stackAlloc=Module.asm.stackAlloc).apply(null,arguments)};Module.__Znwm=function(){return (Module.__Znwm=Module.asm._Znwm).apply(null,arguments)};Module.__ZdlPv=function(){return (Module.__ZdlPv=Module.asm._ZdlPv).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)};Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return (Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=Module.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw).apply(null,arguments)};Module.dynCall_jiji=function(){return (Module.dynCall_jiji=Module.asm.dynCall_jiji).apply(null,arguments)};Module._orig$ts_parser_timeout_micros=function(){return (Module._orig$ts_parser_timeout_micros=Module.asm.orig$ts_parser_timeout_micros).apply(null,arguments)};Module._orig$ts_parser_set_timeout_micros=function(){return (Module._orig$ts_parser_set_timeout_micros=Module.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)};var calledRun;function callMain(t){var e=Module._main;if(e){(t=t||[]).unshift(thisProgram);var r=t.length,n=stackAlloc(4*(r+1)),s=n>>2;t.forEach(o=>{HEAP32[s++]=allocateUTF8OnStack(o);}),HEAP32[s]=0;try{var i=e(r,n);return exitJS(i),i}catch(o){return handleException(o)}}}Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,dependenciesFulfilled=function t(){calledRun||run(),calledRun||(dependenciesFulfilled=t);};var dylibsLoaded=!1;function run(t){function e(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),shouldRunNow&&callMain(t),postRun()));}t=t||arguments_,runDependencies>0||!dylibsLoaded&&(preloadDylibs(),dylibsLoaded=!0,runDependencies>0)||(preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("");},1),e();},1)):e()));}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/;var VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0;}setLanguage(e){let r;if(e){if(e.constructor!==Language)throw new Error("Argument must be a Language");{r=e[0];let n=C._ts_language_version(r);if(ne.slice(f,u);else {if(typeof e!="function")throw new Error("Argument must be a string or a function");currentParseCallback=e;}this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let s=0,i=0;if(n&&n.includedRanges){s=n.includedRanges.length,i=C._calloc(s,SIZE_OF_RANGE);let f=i;for(let d=0;d0){let i=n;for(let o=0;o0){let n=r;for(let s=0;s0){let n=r;for(let s=0;s0){let u=f;for(let p=0;p0){if(b[0].type!=="string")throw new Error("Predicates must begin with a literal value");let B=b[0].value,L=!0;switch(B){case"not-eq?":L=!1;case"eq?":if(b.length!==3)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(b.length-1));if(b[1].type!=="capture")throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${b[1].value}"`);if(b[2].type==="capture"){let z=b[1].name,G=b[2].name;y[S].push(function(te){let I,O;for(let X of te)X.name===z&&(I=X.node),X.name===G&&(O=X.node);return I===void 0||O===void 0||I.text===O.text===L});}else {let z=b[1].name,G=b[2].value;y[S].push(function(te){for(let I of te)if(I.name===z)return I.node.text===G===L;return !0});}break;case"not-match?":L=!1;case"match?":if(b.length!==3)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${b.length-1}.`);if(b[1].type!=="capture")throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${b[1].value}".`);if(b[2].type!=="string")throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${b[2].value}.`);let M=b[1].name,U=new RegExp(b[2].value);y[S].push(function(z){for(let G of z)if(G.name===M)return U.test(G.node.text)===L;return !0});break;case"set!":if(b.length<2||b.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${b.length-1}.`);if(b.some(z=>z.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');u[S]||(u[S]={}),u[S][b[1].value]=b[2]?b[2].value:null;break;case"is?":case"is-not?":if(b.length<2||b.length>3)throw new Error(`Wrong number of arguments to \`#${B}\` predicate. Expected 1 or 2. Got ${b.length-1}.`);if(b.some(z=>z.type!=="string"))throw new Error(`Arguments to \`#${B}\` predicate must be a strings.".`);let R=B==="is?"?p:m;R[S]||(R[S]={}),R[S][b[1].value]=b[2]?b[2].value:null;break;default:g[S].push({operator:B,operands:b.slice(1)});}b.length=0;}}Object.freeze(u[S]),Object.freeze(p[S]),Object.freeze(m[S]);}return C._free(n),new Query(INTERNAL,s,f,y,g,Object.freeze(u),Object.freeze(p),Object.freeze(m))}static load(e){let r;if(e instanceof Uint8Array)r=Promise.resolve(e);else {let s=e;if(typeof process<"u"&&process.versions&&process.versions.node){let i=K("fs");r=Promise.resolve(i.readFileSync(s));}else r=fetch(s).then(i=>i.arrayBuffer().then(o=>{if(i.ok)return new Uint8Array(o);{let l=new TextDecoder("utf-8").decode(o);throw new Error(`Language.load failed with status ${i.status}. +`)},_domwindow:function(){return n("domwindow")},_bigint:function(i){return n("bigint:"+i.toString())},_process:function(){return n("process")},_timer:function(){return n("timer")},_pipe:function(){return n("pipe")},_tcp:function(){return n("tcp")},_udp:function(){return n("udp")},_tty:function(){return n("tty")},_statwatcher:function(){return n("statwatcher")},_securecontext:function(){return n("securecontext")},_connection:function(){return n("connection")},_zlib:function(){return n("zlib")},_context:function(){return n("context")},_nodescript:function(){return n("nodescript")},_httpparser:function(){return n("httpparser")},_dataview:function(){return n("dataview")},_signal:function(){return n("signal")},_fsevent:function(){return n("fsevent")},_tlswrap:function(){return n("tlswrap")}}}function qx(){return {buf:"",write:function(t){this.buf+=t;},end:function(t){this.buf+=t;},read:function(){return this.buf}}}});var Vx=A((exports,module)=>{var Module=Module!==void 0?Module:{},TreeSitter=function(){var initPromise,document=typeof window=="object"?{currentScript:window.document.currentScript}:null;class Parser{constructor(){this.initialize();}initialize(){throw new Error("cannot construct a Parser before calling `init()`")}static init(moduleOptions){return initPromise||(Module=Object.assign({},Module,moduleOptions),initPromise=new Promise(resolveInitPromise=>{var moduleOverrides=Object.assign({},Module),arguments_=[],thisProgram="./this.program",quit_=(t,e)=>{throw e},ENVIRONMENT_IS_WEB=typeof window=="object",ENVIRONMENT_IS_WORKER=typeof importScripts=="function",ENVIRONMENT_IS_NODE=typeof process=="object"&&typeof process.versions=="object"&&typeof process.versions.node=="string",scriptDirectory="",read_,readAsync,readBinary;function locateFile(t){return Module.locateFile?Module.locateFile(t,scriptDirectory):scriptDirectory+t}function logExceptionOnExit(t){t instanceof ExitStatus||err("exiting due to exception: "+t);}if(ENVIRONMENT_IS_NODE){var fs=oe("fs"),nodePath=oe("path");scriptDirectory=ENVIRONMENT_IS_WORKER?nodePath.dirname(scriptDirectory)+"/":__dirname+"/",read_=(t,e)=>(t=isFileURI(t)?new URL(t):nodePath.normalize(t),fs.readFileSync(t,e?void 0:"utf8")),readBinary=t=>{var e=read_(t,!0);return e.buffer||(e=new Uint8Array(e)),e},readAsync=(t,e,r)=>{t=isFileURI(t)?new URL(t):nodePath.normalize(t),fs.readFile(t,function(n,i){n?r(n):e(i.buffer);});},process.argv.length>1&&(thisProgram=process.argv[1].replace(/\\/g,"/")),arguments_=process.argv.slice(2),typeof module<"u"&&(module.exports=Module),quit_=(t,e)=>{if(keepRuntimeAlive())throw process.exitCode=t,e;logExceptionOnExit(e),process.exit(t);},Module.inspect=function(){return "[Emscripten Module object]"};}else (ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)&&(ENVIRONMENT_IS_WORKER?scriptDirectory=self.location.href:document!==void 0&&document.currentScript&&(scriptDirectory=document.currentScript.src),scriptDirectory=scriptDirectory.indexOf("blob:")!==0?scriptDirectory.substr(0,scriptDirectory.replace(/[?#].*/,"").lastIndexOf("/")+1):"",read_=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.send(null),e.responseText},ENVIRONMENT_IS_WORKER&&(readBinary=t=>{var e=new XMLHttpRequest;return e.open("GET",t,!1),e.responseType="arraybuffer",e.send(null),new Uint8Array(e.response)}),readAsync=(t,e,r)=>{var n=new XMLHttpRequest;n.open("GET",t,!0),n.responseType="arraybuffer",n.onload=()=>{n.status==200||n.status==0&&n.response?e(n.response):r();},n.onerror=r,n.send(null);},t=>document.title=t);Module.print||console.log.bind(console);var err=Module.printErr||console.warn.bind(console);Object.assign(Module,moduleOverrides),moduleOverrides=null,Module.arguments&&(arguments_=Module.arguments),Module.thisProgram&&(thisProgram=Module.thisProgram),Module.quit&&(quit_=Module.quit);var STACK_ALIGN=16,dynamicLibraries=Module.dynamicLibraries||[],wasmBinary;Module.wasmBinary&&(wasmBinary=Module.wasmBinary);var noExitRuntime=Module.noExitRuntime||!0,wasmMemory;typeof WebAssembly!="object"&&abort("no native wasm support detected");var ABORT=!1,EXITSTATUS,UTF8Decoder=typeof TextDecoder<"u"?new TextDecoder("utf8"):void 0,buffer,HEAP8,HEAPU8,HEAP16,HEAP32,HEAPU32,HEAPF32,HEAPF64;function UTF8ArrayToString(t,e,r){for(var n=e+r,i=e;t[i]&&!(i>=n);)++i;if(i-e>16&&t.buffer&&UTF8Decoder)return UTF8Decoder.decode(t.subarray(e,i));for(var s="";e>10,56320|1023&d);}}else s+=String.fromCharCode((31&o)<<6|a);}else s+=String.fromCharCode(o);}return s}function UTF8ToString(t,e){return t?UTF8ArrayToString(HEAPU8,t,e):""}function stringToUTF8Array(t,e,r,n){if(!(n>0))return 0;for(var i=r,s=r+n-1,o=0;o=55296&&a<=57343&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++o)),a<=127){if(r>=s)break;e[r++]=a;}else if(a<=2047){if(r+1>=s)break;e[r++]=192|a>>6,e[r++]=128|63&a;}else if(a<=65535){if(r+2>=s)break;e[r++]=224|a>>12,e[r++]=128|a>>6&63,e[r++]=128|63&a;}else {if(r+3>=s)break;e[r++]=240|a>>18,e[r++]=128|a>>12&63,e[r++]=128|a>>6&63,e[r++]=128|63&a;}}return e[r]=0,r-i}function stringToUTF8(t,e,r){return stringToUTF8Array(t,HEAPU8,e,r)}function lengthBytesUTF8(t){for(var e=0,r=0;r=55296&&n<=57343?(e+=4,++r):e+=3;}return e}function updateGlobalBufferAndViews(t){buffer=t,Module.HEAP8=HEAP8=new Int8Array(t),Module.HEAP16=HEAP16=new Int16Array(t),Module.HEAP32=HEAP32=new Int32Array(t),Module.HEAPU8=HEAPU8=new Uint8Array(t),Module.HEAPU16=new Uint16Array(t),Module.HEAPU32=HEAPU32=new Uint32Array(t),Module.HEAPF32=HEAPF32=new Float32Array(t),Module.HEAPF64=HEAPF64=new Float64Array(t);}var INITIAL_MEMORY=Module.INITIAL_MEMORY||33554432;wasmMemory=Module.wasmMemory?Module.wasmMemory:new WebAssembly.Memory({initial:INITIAL_MEMORY/65536,maximum:32768}),wasmMemory&&(buffer=wasmMemory.buffer),INITIAL_MEMORY=buffer.byteLength,updateGlobalBufferAndViews(buffer);var wasmTable=new WebAssembly.Table({initial:20,element:"anyfunc"}),__ATPRERUN__=[],__ATINIT__=[],__ATMAIN__=[],__ATPOSTRUN__=[],__RELOC_FUNCS__=[],runtimeInitialized=!1;function keepRuntimeAlive(){return noExitRuntime}function preRun(){if(Module.preRun)for(typeof Module.preRun=="function"&&(Module.preRun=[Module.preRun]);Module.preRun.length;)addOnPreRun(Module.preRun.shift());callRuntimeCallbacks(__ATPRERUN__);}function initRuntime(){runtimeInitialized=!0,callRuntimeCallbacks(__RELOC_FUNCS__),callRuntimeCallbacks(__ATINIT__);}function preMain(){callRuntimeCallbacks(__ATMAIN__);}function postRun(){if(Module.postRun)for(typeof Module.postRun=="function"&&(Module.postRun=[Module.postRun]);Module.postRun.length;)addOnPostRun(Module.postRun.shift());callRuntimeCallbacks(__ATPOSTRUN__);}function addOnPreRun(t){__ATPRERUN__.unshift(t);}function addOnInit(t){__ATINIT__.unshift(t);}function addOnPostRun(t){__ATPOSTRUN__.unshift(t);}var runDependencies=0,dependenciesFulfilled=null;function addRunDependency(t){runDependencies++,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies);}function removeRunDependency(t){if(runDependencies--,Module.monitorRunDependencies&&Module.monitorRunDependencies(runDependencies),runDependencies==0&&(dependenciesFulfilled)){var e=dependenciesFulfilled;dependenciesFulfilled=null,e();}}function abort(t){throw Module.onAbort&&Module.onAbort(t),err(t="Aborted("+t+")"),ABORT=!0,EXITSTATUS=1,t+=". Build with -sASSERTIONS for more info.",new WebAssembly.RuntimeError(t)}var dataURIPrefix="data:application/octet-stream;base64,",wasmBinaryFile,tempDouble,tempI64;function isDataURI(t){return t.startsWith(dataURIPrefix)}function isFileURI(t){return t.startsWith("file://")}function getBinary(t){try{if(t==wasmBinaryFile&&wasmBinary)return new Uint8Array(wasmBinary);if(readBinary)return readBinary(t);throw "both async and sync fetching of the wasm failed"}catch(e){abort(e);}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch=="function"&&!isFileURI(wasmBinaryFile))return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw "failed to load wasm binary file at '"+wasmBinaryFile+"'";return t.arrayBuffer()}).catch(function(){return getBinary(wasmBinaryFile)});if(readAsync)return new Promise(function(t,e){readAsync(wasmBinaryFile,function(r){t(new Uint8Array(r));},e);})}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var t={env:asmLibraryArg,wasi_snapshot_preview1:asmLibraryArg,"GOT.mem":new Proxy(asmLibraryArg,GOTHandler),"GOT.func":new Proxy(asmLibraryArg,GOTHandler)};function e(i,s){var o=i.exports;o=relocateExports(o,1024);var a=getDylinkMetadata(s);a.neededDynlibs&&(dynamicLibraries=a.neededDynlibs.concat(dynamicLibraries)),mergeLibSymbols(o),Module.asm=o,addOnInit(Module.asm.__wasm_call_ctors),__RELOC_FUNCS__.push(Module.asm.__wasm_apply_data_relocs),removeRunDependency();}function r(i){e(i.instance,i.module);}function n(i){return getBinaryPromise().then(function(s){return WebAssembly.instantiate(s,t)}).then(function(s){return s}).then(i,function(s){err("failed to asynchronously prepare wasm: "+s),abort(s);})}if(addRunDependency(),Module.instantiateWasm)try{return Module.instantiateWasm(t,e)}catch(i){return err("Module.instantiateWasm callback failed with error: "+i),!1}return wasmBinary||typeof WebAssembly.instantiateStreaming!="function"||isDataURI(wasmBinaryFile)||isFileURI(wasmBinaryFile)||ENVIRONMENT_IS_NODE||typeof fetch!="function"?n(r):fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(i){return WebAssembly.instantiateStreaming(i,t).then(r,function(s){return err("wasm streaming compile failed: "+s),err("falling back to ArrayBuffer instantiation"),n(r)})}),{}}wasmBinaryFile="tree-sitter.wasm",isDataURI(wasmBinaryFile)||(wasmBinaryFile=locateFile(wasmBinaryFile));function ExitStatus(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t;}var GOT={},CurrentModuleWeakSymbols=new Set([]),GOTHandler={get:function(t,e){var r=GOT[e];return r||(r=GOT[e]=new WebAssembly.Global({value:"i32",mutable:!0})),CurrentModuleWeakSymbols.has(e)||(r.required=!0),r}};function callRuntimeCallbacks(t){for(;t.length>0;)t.shift()(Module);}function getDylinkMetadata(t){var e=0,r=0;function n(){for(var D=0,g=1;;){var S=t[e++];if(D+=(127&S)*g,g*=128,!(128&S))break}return D}function i(){var D=n();return UTF8ArrayToString(t,(e+=D)-D,D)}function s(D,g){if(D)throw new Error(g)}var o="dylink.0";if(t instanceof WebAssembly.Module){var a=WebAssembly.Module.customSections(t,o);a.length===0&&(o="dylink",a=WebAssembly.Module.customSections(t,o)),s(a.length===0,"need dylink section"),r=(t=new Uint8Array(a[0])).length;}else {s(new Uint32Array(new Uint8Array(t.subarray(0,24)).buffer)[0]!=1836278016,"need to see wasm magic number"),s(t[8]!==0,"need the dylink section to be first"),e=9;var l=n();r=e+l,o=i();}var d={neededDynlibs:[],tlsExports:new Set,weakImports:new Set};if(o=="dylink"){d.memorySize=n(),d.memoryAlign=n(),d.tableSize=n(),d.tableAlign=n();for(var c=n(),p=0;p>0];case"i16":return HEAP16[t>>1];case"i32":case"i64":return HEAP32[t>>2];case"float":return HEAPF32[t>>2];case"double":return HEAPF64[t>>3];case"*":return HEAPU32[t>>2];default:abort("invalid type for getValue: "+e);}return null}function asmjsMangle(t){return t.indexOf("dynCall_")==0||["stackAlloc","stackSave","stackRestore","getTempRet0","setTempRet0"].includes(t)?t:"_"+t}function mergeLibSymbols(t,e){for(var r in t)if(t.hasOwnProperty(r)){asmLibraryArg.hasOwnProperty(r)||(asmLibraryArg[r]=t[r]);var n=asmjsMangle(r);Module.hasOwnProperty(n)||(Module[n]=t[r]),r=="__main_argc_argv"&&(Module._main=t[r]);}}var LDSO={loadedLibsByName:{},loadedLibsByHandle:{}};function dynCallLegacy(t,e,r){var n=Module["dynCall_"+t];return r&&r.length?n.apply(null,[e].concat(r)):n.call(null,e)}var wasmTableMirror=[];function getWasmTableEntry(t){var e=wasmTableMirror[t];return e||(t>=wasmTableMirror.length&&(wasmTableMirror.length=t+1),wasmTableMirror[t]=e=wasmTable.get(t)),e}function dynCall(t,e,r){return t.includes("j")?dynCallLegacy(t,e,r):getWasmTableEntry(e).apply(null,r)}function createInvokeFunction(t){return function(){var e=stackSave();try{return dynCall(t,arguments[0],Array.prototype.slice.call(arguments,1))}catch(r){if(stackRestore(e),r!==r+0)throw r;_setThrew(1,0);}}}var ___heap_base=78144;function zeroMemory(t,e){return HEAPU8.fill(0,t,t+e),t}function getMemory(t){if(runtimeInitialized)return zeroMemory(_malloc(t),t);var e=___heap_base,r=e+t+15&-16;return ___heap_base=r,GOT.__heap_base.value=r,e}function isInternalSym(t){return ["__cpp_exception","__c_longjmp","__wasm_apply_data_relocs","__dso_handle","__tls_size","__tls_align","__set_stack_limits","_emscripten_tls_init","__wasm_init_tls","__wasm_call_ctors","__start_em_asm","__stop_em_asm"].includes(t)}function uleb128Encode(t,e){t<128?e.push(t):e.push(t%128|128,t>>7);}function sigToWasmTypes(t){for(var e={i:"i32",j:"i32",f:"f32",d:"f64",p:"i32"},r={parameters:[],results:t[0]=="v"?[]:[e[t[0]]]},n=1;n>0];if(firstLoad){var memAlign=Math.pow(2,metadata.memoryAlign);memAlign=Math.max(memAlign,STACK_ALIGN);var memoryBase=metadata.memorySize?alignMemory(getMemory(metadata.memorySize+memAlign),memAlign):0,tableBase=metadata.tableSize?wasmTable.length:0;handle&&(HEAP8[handle+12>>0]=1,HEAPU32[handle+16>>2]=memoryBase,HEAP32[handle+20>>2]=metadata.memorySize,HEAPU32[handle+24>>2]=tableBase,HEAP32[handle+28>>2]=metadata.tableSize);}else memoryBase=HEAPU32[handle+16>>2],tableBase=HEAPU32[handle+24>>2];var tableGrowthNeeded=tableBase+metadata.tableSize-wasmTable.length,moduleExports;function resolveSymbol(t){var e=resolveGlobalSymbol(t,!1);return e||(e=moduleExports[t]),e}tableGrowthNeeded>0&&wasmTable.grow(tableGrowthNeeded);var proxyHandler={get:function(t,e){switch(e){case"__memory_base":return memoryBase;case"__table_base":return tableBase}if(e in asmLibraryArg)return asmLibraryArg[e];var r;return e in t||(t[e]=function(){return r||(r=resolveSymbol(e)),r.apply(null,arguments)}),t[e]}},proxy=new Proxy({},proxyHandler),info={"GOT.mem":new Proxy({},GOTHandler),"GOT.func":new Proxy({},GOTHandler),env:proxy,wasi_snapshot_preview1:proxy};function postInstantiation(instance){function addEmAsm(addr,body){for(var args=[],arity=0;arity<16&&body.indexOf("$"+arity)!=-1;arity++)args.push("$"+arity);args=args.join(",");var func="("+args+" ) => { "+body+"};";eval(func);}if(updateTableMap(tableBase,metadata.tableSize),moduleExports=relocateExports(instance.exports,memoryBase),flags.allowUndefined||reportUndefinedSymbols(),"__start_em_asm"in moduleExports)for(var start=moduleExports.__start_em_asm,stop=moduleExports.__stop_em_asm;startd(new Uint8Array(p)),c);});if(!readBinary)throw new Error(a+": file not found, and synchronous loading of external files is not available");return readBinary(a)}function s(){if(typeof preloadedWasm<"u"&&preloadedWasm[t]){var a=preloadedWasm[t];return e.loadAsync?Promise.resolve(a):a}return e.loadAsync?i(t).then(function(l){return loadWebAssemblyModule(l,e,r)}):loadWebAssemblyModule(i(t),e,r)}function o(a){n.global&&mergeLibSymbols(a),n.module=a;}return n={refcount:e.nodelete?1/0:1,name:t,module:"loading",global:e.global},LDSO.loadedLibsByName[t]=n,r&&(LDSO.loadedLibsByHandle[r]=n),e.loadAsync?s().then(function(a){return o(a),!0}):(o(s()),!0)}function reportUndefinedSymbols(){for(var t in GOT)if(GOT[t].value==0){var e=resolveGlobalSymbol(t,!0);if(!e&&!GOT[t].required)continue;if(typeof e=="function")GOT[t].value=addFunction(e,e.sig);else {if(typeof e!="number")throw new Error("bad export type for `"+t+"`: "+typeof e);GOT[t].value=e;}}}function preloadDylibs(){dynamicLibraries.length?(addRunDependency(),dynamicLibraries.reduce(function(t,e){return t.then(function(){return loadDynamicLibrary(e,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})})},Promise.resolve()).then(function(){reportUndefinedSymbols(),removeRunDependency();})):reportUndefinedSymbols();}function setValue(t,e,r="i8"){switch(r.endsWith("*")&&(r="*"),r){case"i1":case"i8":HEAP8[t>>0]=e;break;case"i16":HEAP16[t>>1]=e;break;case"i32":HEAP32[t>>2]=e;break;case"i64":tempI64=[e>>>0,(tempDouble=e,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[t>>2]=tempI64[0],HEAP32[t+4>>2]=tempI64[1];break;case"float":HEAPF32[t>>2]=e;break;case"double":HEAPF64[t>>3]=e;break;case"*":HEAPU32[t>>2]=e;break;default:abort("invalid type for setValue: "+r);}}var ___memory_base=new WebAssembly.Global({value:"i32",mutable:!1},1024),___stack_pointer=new WebAssembly.Global({value:"i32",mutable:!0},78144),___table_base=new WebAssembly.Global({value:"i32",mutable:!1},1),nowIsMonotonic=!0,_emscripten_get_now;function __emscripten_get_now_is_monotonic(){return nowIsMonotonic}function _abort(){abort("");}function _emscripten_memcpy_big(t,e,r){HEAPU8.copyWithin(t,e,e+r);}function getHeapMax(){return 2147483648}function emscripten_realloc_buffer(t){try{return wasmMemory.grow(t-buffer.byteLength+65535>>>16),updateGlobalBufferAndViews(wasmMemory.buffer),1}catch{}}function _emscripten_resize_heap(t){var e=HEAPU8.length;t>>>=0;var r=getHeapMax();if(t>r)return !1;for(var n=1;n<=4;n*=2){var i=e*(1+.2/n);if(i=Math.min(i,t+100663296),emscripten_realloc_buffer(Math.min(r,(s=Math.max(t,i))+((o=65536)-s%o)%o)))return !0}var s,o;return !1}__emscripten_get_now_is_monotonic.sig="i",Module._abort=_abort,_abort.sig="v",_emscripten_get_now=ENVIRONMENT_IS_NODE?()=>{var t=process.hrtime();return 1e3*t[0]+t[1]/1e6}:()=>performance.now(),_emscripten_get_now.sig="d",_emscripten_memcpy_big.sig="vppp",_emscripten_resize_heap.sig="ip";var SYSCALLS={DEFAULT_POLLMASK:5,calculateAt:function(t,e,r){if(PATH.isAbs(e))return e;var n;if(t===-100?n=FS.cwd():n=SYSCALLS.getStreamFromFD(t).path,e.length==0){if(!r)throw new FS.ErrnoError(44);return n}return PATH.join2(n,e)},doStat:function(t,e,r){try{var n=t(e);}catch(a){if(a&&a.node&&PATH.normalize(e)!==PATH.normalize(FS.getPath(a.node)))return -54;throw a}HEAP32[r>>2]=n.dev,HEAP32[r+8>>2]=n.ino,HEAP32[r+12>>2]=n.mode,HEAPU32[r+16>>2]=n.nlink,HEAP32[r+20>>2]=n.uid,HEAP32[r+24>>2]=n.gid,HEAP32[r+28>>2]=n.rdev,tempI64=[n.size>>>0,(tempDouble=n.size,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+40>>2]=tempI64[0],HEAP32[r+44>>2]=tempI64[1],HEAP32[r+48>>2]=4096,HEAP32[r+52>>2]=n.blocks;var i=n.atime.getTime(),s=n.mtime.getTime(),o=n.ctime.getTime();return tempI64=[Math.floor(i/1e3)>>>0,(tempDouble=Math.floor(i/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+56>>2]=tempI64[0],HEAP32[r+60>>2]=tempI64[1],HEAPU32[r+64>>2]=i%1e3*1e3,tempI64=[Math.floor(s/1e3)>>>0,(tempDouble=Math.floor(s/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+72>>2]=tempI64[0],HEAP32[r+76>>2]=tempI64[1],HEAPU32[r+80>>2]=s%1e3*1e3,tempI64=[Math.floor(o/1e3)>>>0,(tempDouble=Math.floor(o/1e3),+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+88>>2]=tempI64[0],HEAP32[r+92>>2]=tempI64[1],HEAPU32[r+96>>2]=o%1e3*1e3,tempI64=[n.ino>>>0,(tempDouble=n.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[r+104>>2]=tempI64[0],HEAP32[r+108>>2]=tempI64[1],0},doMsync:function(t,e,r,n,i){if(!FS.isFile(e.node.mode))throw new FS.ErrnoError(43);if(2&n)return 0;var s=HEAPU8.slice(t,t+r);FS.msync(e,s,i,r,n);},varargs:void 0,get:function(){return SYSCALLS.varargs+=4,HEAP32[SYSCALLS.varargs-4>>2]},getStr:function(t){return UTF8ToString(t)},getStreamFromFD:function(t){var e=FS.getStream(t);if(!e)throw new FS.ErrnoError(8);return e}};function _proc_exit(t){EXITSTATUS=t,keepRuntimeAlive()||(Module.onExit&&Module.onExit(t),ABORT=!0),quit_(t,new ExitStatus(t));}function exitJS(t,e){EXITSTATUS=t,_proc_exit(t);}_proc_exit.sig="vi";var _exit=exitJS;function _fd_close(t){try{var e=SYSCALLS.getStreamFromFD(t);return FS.close(e),0}catch(r){if(typeof FS>"u"||!(r instanceof FS.ErrnoError))throw r;return r.errno}}function convertI32PairToI53Checked(t,e){return e+2097152>>>0<4194305-!!t?(t>>>0)+4294967296*e:NaN}function _fd_seek(t,e,r,n,i){try{var s=convertI32PairToI53Checked(e,r);if(isNaN(s))return 61;var o=SYSCALLS.getStreamFromFD(t);return FS.llseek(o,s,n),tempI64=[o.position>>>0,(tempDouble=o.position,+Math.abs(tempDouble)>=1?tempDouble>0?(0|Math.min(+Math.floor(tempDouble/4294967296),4294967295))>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[i>>2]=tempI64[0],HEAP32[i+4>>2]=tempI64[1],o.getdents&&s===0&&n===0&&(o.getdents=null),0}catch(a){if(typeof FS>"u"||!(a instanceof FS.ErrnoError))throw a;return a.errno}}function doWritev(t,e,r,n){for(var i=0,s=0;s>2],a=HEAPU32[e+4>>2];e+=8;var l=FS.write(t,HEAP8,o,a,n);if(l<0)return -1;i+=l,n!==void 0&&(n+=l);}return i}function _fd_write(t,e,r,n){try{var i=doWritev(SYSCALLS.getStreamFromFD(t),e,r);return HEAPU32[n>>2]=i,0}catch(s){if(typeof FS>"u"||!(s instanceof FS.ErrnoError))throw s;return s.errno}}function _tree_sitter_log_callback(t,e){if(currentLogCallback){let r=UTF8ToString(e);currentLogCallback(r,t!==0);}}function _tree_sitter_parse_callback(t,e,r,n,i){var s=currentParseCallback(e,{row:r,column:n});typeof s=="string"?(setValue(i,s.length,"i32"),stringToUTF16(s,t,10240)):setValue(i,0,"i32");}function handleException(t){if(t instanceof ExitStatus||t=="unwind")return EXITSTATUS;quit_(1,t);}function allocateUTF8OnStack(t){var e=lengthBytesUTF8(t)+1,r=stackAlloc(e);return stringToUTF8Array(t,HEAP8,r,e),r}function stringToUTF16(t,e,r){if(r===void 0&&(r=2147483647),r<2)return 0;for(var n=e,i=(r-=2)<2*t.length?r/2:t.length,s=0;s>1]=o,e+=2;}return HEAP16[e>>1]=0,e-n}function AsciiToString(t){for(var e="";;){var r=HEAPU8[t++>>0];if(!r)return e;e+=String.fromCharCode(r);}}_exit.sig="vi",_fd_close.sig="ii",_fd_seek.sig="iijip",_fd_write.sig="iippp";var asmLibraryArg={__heap_base:___heap_base,__indirect_function_table:wasmTable,__memory_base:___memory_base,__stack_pointer:___stack_pointer,__table_base:___table_base,_emscripten_get_now_is_monotonic:__emscripten_get_now_is_monotonic,abort:_abort,emscripten_get_now:_emscripten_get_now,emscripten_memcpy_big:_emscripten_memcpy_big,emscripten_resize_heap:_emscripten_resize_heap,exit:_exit,fd_close:_fd_close,fd_seek:_fd_seek,fd_write:_fd_write,memory:wasmMemory,tree_sitter_log_callback:_tree_sitter_log_callback,tree_sitter_parse_callback:_tree_sitter_parse_callback};createWasm();Module.___wasm_call_ctors=function(){return (Module.___wasm_call_ctors=Module.asm.__wasm_call_ctors).apply(null,arguments)};Module.___wasm_apply_data_relocs=function(){return (Module.___wasm_apply_data_relocs=Module.asm.__wasm_apply_data_relocs).apply(null,arguments)};var _malloc=Module._malloc=function(){return (_malloc=Module._malloc=Module.asm.malloc).apply(null,arguments)};Module._calloc=function(){return (Module._calloc=Module.asm.calloc).apply(null,arguments)};Module._realloc=function(){return (Module._realloc=Module.asm.realloc).apply(null,arguments)};Module._free=function(){return (Module._free=Module.asm.free).apply(null,arguments)};Module._ts_language_symbol_count=function(){return (Module._ts_language_symbol_count=Module.asm.ts_language_symbol_count).apply(null,arguments)};Module._ts_language_version=function(){return (Module._ts_language_version=Module.asm.ts_language_version).apply(null,arguments)};Module._ts_language_field_count=function(){return (Module._ts_language_field_count=Module.asm.ts_language_field_count).apply(null,arguments)};Module._ts_language_symbol_name=function(){return (Module._ts_language_symbol_name=Module.asm.ts_language_symbol_name).apply(null,arguments)};Module._ts_language_symbol_for_name=function(){return (Module._ts_language_symbol_for_name=Module.asm.ts_language_symbol_for_name).apply(null,arguments)};Module._ts_language_symbol_type=function(){return (Module._ts_language_symbol_type=Module.asm.ts_language_symbol_type).apply(null,arguments)};Module._ts_language_field_name_for_id=function(){return (Module._ts_language_field_name_for_id=Module.asm.ts_language_field_name_for_id).apply(null,arguments)};Module._memset=function(){return (Module._memset=Module.asm.memset).apply(null,arguments)};Module._memcpy=function(){return (Module._memcpy=Module.asm.memcpy).apply(null,arguments)};Module._ts_parser_delete=function(){return (Module._ts_parser_delete=Module.asm.ts_parser_delete).apply(null,arguments)};Module._ts_parser_reset=function(){return (Module._ts_parser_reset=Module.asm.ts_parser_reset).apply(null,arguments)};Module._ts_parser_set_language=function(){return (Module._ts_parser_set_language=Module.asm.ts_parser_set_language).apply(null,arguments)};Module._ts_parser_timeout_micros=function(){return (Module._ts_parser_timeout_micros=Module.asm.ts_parser_timeout_micros).apply(null,arguments)};Module._ts_parser_set_timeout_micros=function(){return (Module._ts_parser_set_timeout_micros=Module.asm.ts_parser_set_timeout_micros).apply(null,arguments)};Module._memmove=function(){return (Module._memmove=Module.asm.memmove).apply(null,arguments)};Module._memcmp=function(){return (Module._memcmp=Module.asm.memcmp).apply(null,arguments)};Module._ts_query_new=function(){return (Module._ts_query_new=Module.asm.ts_query_new).apply(null,arguments)};Module._ts_query_delete=function(){return (Module._ts_query_delete=Module.asm.ts_query_delete).apply(null,arguments)};Module._iswspace=function(){return (Module._iswspace=Module.asm.iswspace).apply(null,arguments)};Module._iswalnum=function(){return (Module._iswalnum=Module.asm.iswalnum).apply(null,arguments)};Module._ts_query_pattern_count=function(){return (Module._ts_query_pattern_count=Module.asm.ts_query_pattern_count).apply(null,arguments)};Module._ts_query_capture_count=function(){return (Module._ts_query_capture_count=Module.asm.ts_query_capture_count).apply(null,arguments)};Module._ts_query_string_count=function(){return (Module._ts_query_string_count=Module.asm.ts_query_string_count).apply(null,arguments)};Module._ts_query_capture_name_for_id=function(){return (Module._ts_query_capture_name_for_id=Module.asm.ts_query_capture_name_for_id).apply(null,arguments)};Module._ts_query_string_value_for_id=function(){return (Module._ts_query_string_value_for_id=Module.asm.ts_query_string_value_for_id).apply(null,arguments)};Module._ts_query_predicates_for_pattern=function(){return (Module._ts_query_predicates_for_pattern=Module.asm.ts_query_predicates_for_pattern).apply(null,arguments)};Module._ts_tree_copy=function(){return (Module._ts_tree_copy=Module.asm.ts_tree_copy).apply(null,arguments)};Module._ts_tree_delete=function(){return (Module._ts_tree_delete=Module.asm.ts_tree_delete).apply(null,arguments)};Module._ts_init=function(){return (Module._ts_init=Module.asm.ts_init).apply(null,arguments)};Module._ts_parser_new_wasm=function(){return (Module._ts_parser_new_wasm=Module.asm.ts_parser_new_wasm).apply(null,arguments)};Module._ts_parser_enable_logger_wasm=function(){return (Module._ts_parser_enable_logger_wasm=Module.asm.ts_parser_enable_logger_wasm).apply(null,arguments)};Module._ts_parser_parse_wasm=function(){return (Module._ts_parser_parse_wasm=Module.asm.ts_parser_parse_wasm).apply(null,arguments)};Module._ts_language_type_is_named_wasm=function(){return (Module._ts_language_type_is_named_wasm=Module.asm.ts_language_type_is_named_wasm).apply(null,arguments)};Module._ts_language_type_is_visible_wasm=function(){return (Module._ts_language_type_is_visible_wasm=Module.asm.ts_language_type_is_visible_wasm).apply(null,arguments)};Module._ts_tree_root_node_wasm=function(){return (Module._ts_tree_root_node_wasm=Module.asm.ts_tree_root_node_wasm).apply(null,arguments)};Module._ts_tree_edit_wasm=function(){return (Module._ts_tree_edit_wasm=Module.asm.ts_tree_edit_wasm).apply(null,arguments)};Module._ts_tree_get_changed_ranges_wasm=function(){return (Module._ts_tree_get_changed_ranges_wasm=Module.asm.ts_tree_get_changed_ranges_wasm).apply(null,arguments)};Module._ts_tree_cursor_new_wasm=function(){return (Module._ts_tree_cursor_new_wasm=Module.asm.ts_tree_cursor_new_wasm).apply(null,arguments)};Module._ts_tree_cursor_delete_wasm=function(){return (Module._ts_tree_cursor_delete_wasm=Module.asm.ts_tree_cursor_delete_wasm).apply(null,arguments)};Module._ts_tree_cursor_reset_wasm=function(){return (Module._ts_tree_cursor_reset_wasm=Module.asm.ts_tree_cursor_reset_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_first_child_wasm=function(){return (Module._ts_tree_cursor_goto_first_child_wasm=Module.asm.ts_tree_cursor_goto_first_child_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_next_sibling_wasm=function(){return (Module._ts_tree_cursor_goto_next_sibling_wasm=Module.asm.ts_tree_cursor_goto_next_sibling_wasm).apply(null,arguments)};Module._ts_tree_cursor_goto_parent_wasm=function(){return (Module._ts_tree_cursor_goto_parent_wasm=Module.asm.ts_tree_cursor_goto_parent_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_type_id_wasm=function(){return (Module._ts_tree_cursor_current_node_type_id_wasm=Module.asm.ts_tree_cursor_current_node_type_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_is_named_wasm=function(){return (Module._ts_tree_cursor_current_node_is_named_wasm=Module.asm.ts_tree_cursor_current_node_is_named_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_is_missing_wasm=function(){return (Module._ts_tree_cursor_current_node_is_missing_wasm=Module.asm.ts_tree_cursor_current_node_is_missing_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_id_wasm=function(){return (Module._ts_tree_cursor_current_node_id_wasm=Module.asm.ts_tree_cursor_current_node_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_start_position_wasm=function(){return (Module._ts_tree_cursor_start_position_wasm=Module.asm.ts_tree_cursor_start_position_wasm).apply(null,arguments)};Module._ts_tree_cursor_end_position_wasm=function(){return (Module._ts_tree_cursor_end_position_wasm=Module.asm.ts_tree_cursor_end_position_wasm).apply(null,arguments)};Module._ts_tree_cursor_start_index_wasm=function(){return (Module._ts_tree_cursor_start_index_wasm=Module.asm.ts_tree_cursor_start_index_wasm).apply(null,arguments)};Module._ts_tree_cursor_end_index_wasm=function(){return (Module._ts_tree_cursor_end_index_wasm=Module.asm.ts_tree_cursor_end_index_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_field_id_wasm=function(){return (Module._ts_tree_cursor_current_field_id_wasm=Module.asm.ts_tree_cursor_current_field_id_wasm).apply(null,arguments)};Module._ts_tree_cursor_current_node_wasm=function(){return (Module._ts_tree_cursor_current_node_wasm=Module.asm.ts_tree_cursor_current_node_wasm).apply(null,arguments)};Module._ts_node_symbol_wasm=function(){return (Module._ts_node_symbol_wasm=Module.asm.ts_node_symbol_wasm).apply(null,arguments)};Module._ts_node_child_count_wasm=function(){return (Module._ts_node_child_count_wasm=Module.asm.ts_node_child_count_wasm).apply(null,arguments)};Module._ts_node_named_child_count_wasm=function(){return (Module._ts_node_named_child_count_wasm=Module.asm.ts_node_named_child_count_wasm).apply(null,arguments)};Module._ts_node_child_wasm=function(){return (Module._ts_node_child_wasm=Module.asm.ts_node_child_wasm).apply(null,arguments)};Module._ts_node_named_child_wasm=function(){return (Module._ts_node_named_child_wasm=Module.asm.ts_node_named_child_wasm).apply(null,arguments)};Module._ts_node_child_by_field_id_wasm=function(){return (Module._ts_node_child_by_field_id_wasm=Module.asm.ts_node_child_by_field_id_wasm).apply(null,arguments)};Module._ts_node_next_sibling_wasm=function(){return (Module._ts_node_next_sibling_wasm=Module.asm.ts_node_next_sibling_wasm).apply(null,arguments)};Module._ts_node_prev_sibling_wasm=function(){return (Module._ts_node_prev_sibling_wasm=Module.asm.ts_node_prev_sibling_wasm).apply(null,arguments)};Module._ts_node_next_named_sibling_wasm=function(){return (Module._ts_node_next_named_sibling_wasm=Module.asm.ts_node_next_named_sibling_wasm).apply(null,arguments)};Module._ts_node_prev_named_sibling_wasm=function(){return (Module._ts_node_prev_named_sibling_wasm=Module.asm.ts_node_prev_named_sibling_wasm).apply(null,arguments)};Module._ts_node_parent_wasm=function(){return (Module._ts_node_parent_wasm=Module.asm.ts_node_parent_wasm).apply(null,arguments)};Module._ts_node_descendant_for_index_wasm=function(){return (Module._ts_node_descendant_for_index_wasm=Module.asm.ts_node_descendant_for_index_wasm).apply(null,arguments)};Module._ts_node_named_descendant_for_index_wasm=function(){return (Module._ts_node_named_descendant_for_index_wasm=Module.asm.ts_node_named_descendant_for_index_wasm).apply(null,arguments)};Module._ts_node_descendant_for_position_wasm=function(){return (Module._ts_node_descendant_for_position_wasm=Module.asm.ts_node_descendant_for_position_wasm).apply(null,arguments)};Module._ts_node_named_descendant_for_position_wasm=function(){return (Module._ts_node_named_descendant_for_position_wasm=Module.asm.ts_node_named_descendant_for_position_wasm).apply(null,arguments)};Module._ts_node_start_point_wasm=function(){return (Module._ts_node_start_point_wasm=Module.asm.ts_node_start_point_wasm).apply(null,arguments)};Module._ts_node_end_point_wasm=function(){return (Module._ts_node_end_point_wasm=Module.asm.ts_node_end_point_wasm).apply(null,arguments)};Module._ts_node_start_index_wasm=function(){return (Module._ts_node_start_index_wasm=Module.asm.ts_node_start_index_wasm).apply(null,arguments)};Module._ts_node_end_index_wasm=function(){return (Module._ts_node_end_index_wasm=Module.asm.ts_node_end_index_wasm).apply(null,arguments)};Module._ts_node_to_string_wasm=function(){return (Module._ts_node_to_string_wasm=Module.asm.ts_node_to_string_wasm).apply(null,arguments)};Module._ts_node_children_wasm=function(){return (Module._ts_node_children_wasm=Module.asm.ts_node_children_wasm).apply(null,arguments)};Module._ts_node_named_children_wasm=function(){return (Module._ts_node_named_children_wasm=Module.asm.ts_node_named_children_wasm).apply(null,arguments)};Module._ts_node_descendants_of_type_wasm=function(){return (Module._ts_node_descendants_of_type_wasm=Module.asm.ts_node_descendants_of_type_wasm).apply(null,arguments)};Module._ts_node_is_named_wasm=function(){return (Module._ts_node_is_named_wasm=Module.asm.ts_node_is_named_wasm).apply(null,arguments)};Module._ts_node_has_changes_wasm=function(){return (Module._ts_node_has_changes_wasm=Module.asm.ts_node_has_changes_wasm).apply(null,arguments)};Module._ts_node_has_error_wasm=function(){return (Module._ts_node_has_error_wasm=Module.asm.ts_node_has_error_wasm).apply(null,arguments)};Module._ts_node_is_missing_wasm=function(){return (Module._ts_node_is_missing_wasm=Module.asm.ts_node_is_missing_wasm).apply(null,arguments)};Module._ts_query_matches_wasm=function(){return (Module._ts_query_matches_wasm=Module.asm.ts_query_matches_wasm).apply(null,arguments)};Module._ts_query_captures_wasm=function(){return (Module._ts_query_captures_wasm=Module.asm.ts_query_captures_wasm).apply(null,arguments)};Module.___cxa_atexit=function(){return (Module.___cxa_atexit=Module.asm.__cxa_atexit).apply(null,arguments)};Module._iswdigit=function(){return (Module._iswdigit=Module.asm.iswdigit).apply(null,arguments)};Module._iswalpha=function(){return (Module._iswalpha=Module.asm.iswalpha).apply(null,arguments)};Module._iswlower=function(){return (Module._iswlower=Module.asm.iswlower).apply(null,arguments)};Module._memchr=function(){return (Module._memchr=Module.asm.memchr).apply(null,arguments)};Module._strlen=function(){return (Module._strlen=Module.asm.strlen).apply(null,arguments)};Module._towupper=function(){return (Module._towupper=Module.asm.towupper).apply(null,arguments)};var _setThrew=Module._setThrew=function(){return (_setThrew=Module._setThrew=Module.asm.setThrew).apply(null,arguments)},stackSave=Module.stackSave=function(){return (stackSave=Module.stackSave=Module.asm.stackSave).apply(null,arguments)},stackRestore=Module.stackRestore=function(){return (stackRestore=Module.stackRestore=Module.asm.stackRestore).apply(null,arguments)},stackAlloc=Module.stackAlloc=function(){return (stackAlloc=Module.stackAlloc=Module.asm.stackAlloc).apply(null,arguments)};Module.__Znwm=function(){return (Module.__Znwm=Module.asm._Znwm).apply(null,arguments)};Module.__ZdlPv=function(){return (Module.__ZdlPv=Module.asm._ZdlPv).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9__grow_byEmmmmmm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE7reserveEm).apply(null,arguments)};Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=function(){return (Module.__ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm=Module.asm._ZNKSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE4copyEPcmm).apply(null,arguments)};Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=function(){return (Module.__ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc=Module.asm._ZNSt3__212basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE9push_backEc).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEED2Ev).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE9push_backEw).apply(null,arguments)};Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw=function(){return (Module.__ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw=Module.asm._ZNSt3__212basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEE6resizeEmw).apply(null,arguments)};Module.dynCall_jiji=function(){return (Module.dynCall_jiji=Module.asm.dynCall_jiji).apply(null,arguments)};Module._orig$ts_parser_timeout_micros=function(){return (Module._orig$ts_parser_timeout_micros=Module.asm.orig$ts_parser_timeout_micros).apply(null,arguments)};Module._orig$ts_parser_set_timeout_micros=function(){return (Module._orig$ts_parser_set_timeout_micros=Module.asm.orig$ts_parser_set_timeout_micros).apply(null,arguments)};var calledRun;function callMain(t){var e=Module._main;if(e){(t=t||[]).unshift(thisProgram);var r=t.length,n=stackAlloc(4*(r+1)),i=n>>2;t.forEach(o=>{HEAP32[i++]=allocateUTF8OnStack(o);}),HEAP32[i]=0;try{var s=e(r,n);return exitJS(s),s}catch(o){return handleException(o)}}}Module.AsciiToString=AsciiToString,Module.stringToUTF16=stringToUTF16,dependenciesFulfilled=function t(){calledRun||run(),calledRun||(dependenciesFulfilled=t);};var dylibsLoaded=!1;function run(t){function e(){calledRun||(calledRun=!0,Module.calledRun=!0,ABORT||(initRuntime(),preMain(),Module.onRuntimeInitialized&&Module.onRuntimeInitialized(),shouldRunNow&&callMain(t),postRun()));}t=t||arguments_,runDependencies>0||!dylibsLoaded&&(preloadDylibs(),dylibsLoaded=!0,runDependencies>0)||(preRun(),runDependencies>0||(Module.setStatus?(Module.setStatus("Running..."),setTimeout(function(){setTimeout(function(){Module.setStatus("");},1),e();},1)):e()));}if(Module.preInit)for(typeof Module.preInit=="function"&&(Module.preInit=[Module.preInit]);Module.preInit.length>0;)Module.preInit.pop()();var shouldRunNow=!0;Module.noInitialRun&&(shouldRunNow=!1),run();let C=Module,INTERNAL={},SIZE_OF_INT=4,SIZE_OF_NODE=5*SIZE_OF_INT,SIZE_OF_POINT=2*SIZE_OF_INT,SIZE_OF_RANGE=2*SIZE_OF_INT+2*SIZE_OF_POINT,ZERO_POINT={row:0,column:0},QUERY_WORD_REGEX=/[\w-.]*/g,PREDICATE_STEP_TYPE_CAPTURE=1,PREDICATE_STEP_TYPE_STRING=2,LANGUAGE_FUNCTION_REGEX=/^_?tree_sitter_\w+/;var VERSION,MIN_COMPATIBLE_VERSION,TRANSFER_BUFFER,currentParseCallback,currentLogCallback;class ParserImpl{static init(){TRANSFER_BUFFER=C._ts_init(),VERSION=getValue(TRANSFER_BUFFER,"i32"),MIN_COMPATIBLE_VERSION=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");}initialize(){C._ts_parser_new_wasm(),this[0]=getValue(TRANSFER_BUFFER,"i32"),this[1]=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32");}delete(){C._ts_parser_delete(this[0]),C._free(this[1]),this[0]=0,this[1]=0;}setLanguage(e){let r;if(e){if(e.constructor!==Language)throw new Error("Argument must be a Language");{r=e[0];let n=C._ts_language_version(r);if(ne.slice(l,c);else {if(typeof e!="function")throw new Error("Argument must be a string or a function");currentParseCallback=e;}this.logCallback?(currentLogCallback=this.logCallback,C._ts_parser_enable_logger_wasm(this[0],1)):(currentLogCallback=null,C._ts_parser_enable_logger_wasm(this[0],0));let i=0,s=0;if(n&&n.includedRanges){i=n.includedRanges.length,s=C._calloc(i,SIZE_OF_RANGE);let l=s;for(let d=0;d0){let s=n;for(let o=0;o0){let n=r;for(let i=0;i0){let n=r;for(let i=0;i0){let c=l;for(let p=0;p0){if(g[0].type!=="string")throw new Error("Predicates must begin with a literal value");let K=g[0].value,U=!0;switch(K){case"not-eq?":U=!1;case"eq?":if(g.length!==3)throw new Error("Wrong number of arguments to `#eq?` predicate. Expected 2, got "+(g.length-1));if(g[1].type!=="capture")throw new Error(`First argument of \`#eq?\` predicate must be a capture. Got "${g[1].value}"`);if(g[2].type==="capture"){let te=g[1].name,ae=g[2].name;w[E].push(function(ye){let q,W;for(let me of ye)me.name===te&&(q=me.node),me.name===ae&&(W=me.node);return q===void 0||W===void 0||q.text===W.text===U});}else {let te=g[1].name,ae=g[2].value;w[E].push(function(ye){for(let q of ye)if(q.name===te)return q.node.text===ae===U;return !0});}break;case"not-match?":U=!1;case"match?":if(g.length!==3)throw new Error(`Wrong number of arguments to \`#match?\` predicate. Expected 2, got ${g.length-1}.`);if(g[1].type!=="capture")throw new Error(`First argument of \`#match?\` predicate must be a capture. Got "${g[1].value}".`);if(g[2].type!=="string")throw new Error(`Second argument of \`#match?\` predicate must be a string. Got @${g[2].value}.`);let B=g[1].name,Q=new RegExp(g[2].value);w[E].push(function(te){for(let ae of te)if(ae.name===B)return Q.test(ae.node.text)===U;return !0});break;case"set!":if(g.length<2||g.length>3)throw new Error(`Wrong number of arguments to \`#set!\` predicate. Expected 1 or 2. Got ${g.length-1}.`);if(g.some(te=>te.type!=="string"))throw new Error('Arguments to `#set!` predicate must be a strings.".');c[E]||(c[E]={}),c[E][g[1].value]=g[2]?g[2].value:null;break;case"is?":case"is-not?":if(g.length<2||g.length>3)throw new Error(`Wrong number of arguments to \`#${K}\` predicate. Expected 1 or 2. Got ${g.length-1}.`);if(g.some(te=>te.type!=="string"))throw new Error(`Arguments to \`#${K}\` predicate must be a strings.".`);let N=K==="is?"?p:m;N[E]||(N[E]={}),N[E][g[1].value]=g[2]?g[2].value:null;break;default:_[E].push({operator:K,operands:g.slice(1)});}g.length=0;}}Object.freeze(c[E]),Object.freeze(p[E]),Object.freeze(m[E]);}return C._free(n),new Query(INTERNAL,i,l,w,_,Object.freeze(c),Object.freeze(p),Object.freeze(m))}static load(e){let r;if(e instanceof Uint8Array)r=Promise.resolve(e);else {let i=e;if(typeof process<"u"&&process.versions&&process.versions.node){let s=oe("fs");r=Promise.resolve(s.readFileSync(i));}else r=fetch(i).then(s=>s.arrayBuffer().then(o=>{if(s.ok)return new Uint8Array(o);{let a=new TextDecoder("utf-8").decode(o);throw new Error(`Language.load failed with status ${s.status}. -${l}`)}}));}let n=typeof loadSideModule=="function"?loadSideModule:loadWebAssemblyModule;return r.then(s=>n(s,{loadAsync:!0})).then(s=>{let i=Object.keys(s),o=i.find(f=>LANGUAGE_FUNCTION_REGEX.test(f)&&!f.includes("external_scanner_"));o||console.log(`Couldn't find language function in WASM file. Symbols: -${JSON.stringify(i,null,2)}`);let l=s[o]();return new Language(INTERNAL,l)})}}class Query{constructor(e,r,n,s,i,o,l,f){assertInternal(e),this[0]=r,this.captureNames=n,this.textPredicates=s,this.predicates=i,this.setProperties=o,this.assertedProperties=l,this.refutedProperties=f,this.exceededMatchLimit=!1;}delete(){C._ts_query_delete(this[0]),this[0]=0;}matches(e,r,n,s){r||(r=ZERO_POINT),n||(n=ZERO_POINT),s||(s={});let i=s.matchLimit;if(i===void 0)i=0;else if(typeof i!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,i);let o=getValue(TRANSFER_BUFFER,"i32"),l=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),d=new Array(o);this.exceededMatchLimit=!!f;let u=0,p=l;for(let m=0;mE(S))){d[u++]={pattern:g,captures:S};let E=this.setProperties[g];E&&(d[m].setProperties=E);let A=this.assertedProperties[g];A&&(d[m].assertedProperties=A);let b=this.refutedProperties[g];b&&(d[m].refutedProperties=b);}}return d.length=u,C._free(l),d}captures(e,r,n,s){r||(r=ZERO_POINT),n||(n=ZERO_POINT),s||(s={});let i=s.matchLimit;if(i===void 0)i=0;else if(typeof i!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,i);let o=getValue(TRANSFER_BUFFER,"i32"),l=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),f=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),d=[];this.exceededMatchLimit=!!f;let u=[],p=l;for(let m=0;mE(u))){let E=u[S],A=this.setProperties[g];A&&(E.setProperties=A);let b=this.assertedProperties[g];b&&(E.assertedProperties=b);let T=this.refutedProperties[g];T&&(E.refutedProperties=T),d.push(E);}}return C._free(l),d}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(t,e,r){let n=r-e,s=t.textCallback(e,null,r);for(e+=s.length;e0))break;e+=i.length,s+=i;}return e>r&&(s=s.slice(0,n)),s}function unmarshalCaptures(t,e,r,n){for(let s=0,i=n.length;s{ParserImpl.init(),resolveInitPromise();};}))}}return Parser}();typeof exports=="object"&&(module.exports=TreeSitter);});var ic=x((T3,mv)=>{var nc=class{constructor(e={}){let r=e.base||1.001,n=e.precision||1e-9;if(!(r>1)||!(r<1.5))throw new Error("base must be a number between 1 and 1.5");if(r+=1e-9,r=2**(1/Math.ceil(Math.log(2)/Math.log(r))),r===1)throw new Error("base too close to 1");n=Number.parseFloat(""+n);let s=Math.ceil(1/(r-1)),i=n*s;this._thresh=i,this._precision=n,this._base=r;}getBase(){return this._base}getPrecision(){return this._precision}round(e){if(typeof e!="number"&&(e=Number.parseFloat(e)),Number.isNaN(e))throw new Error("Attempt to round a non-numeric value: "+e);return e<0?-this.round(-e):ee)return jn(e,t,r);let n=-Math.floor(Math.log(e-t)/Math.log(r));for(;Math.ceil(t*r**n)<=Math.floor(e*r**n);)n--;return n++,n>=0?Math.ceil(t*r**n)/r**n:Math.ceil(t/r**-n)*r**-n}mv.exports={Binning:nc,shorten:jn};});var _v=x((I3,gv)=>{var{Binning:RL}=ic(),TL="stats-logscale/univariate@1.0",Wn=class t extends RL{constructor(e={}){super(e),this.storage=new Map,this._count=0,this._cache={},this.neat=new zn(this),e.bins&&this.addWeighted(e.bins);}add(...e){return this._cache={},e.forEach(r=>{let n=this.round(r),s=this.storage.get(n)??0;this.storage.set(n,s+1),this._count++;}),this}addWeighted(e){return this._cache={},e.forEach(r=>{let n=r[0],s=Number.parseFloat(r[1]);if(Number.isNaN(s))throw new Error("Attempt to provide a non-numeric weight");let i=this.round(n),o=(this.storage.get(i)??0)+s;o<=0?(this.storage.delete(i),this._count+=s-o):(this.storage.set(i,o),this._count+=s);}),this}toJSON(){return {version:TL,precision:this.getPrecision(),base:this.getBase(),bins:this.getBins()}}clone(e={}){let r=this.getBins(e);return e.transform&&(r=r.map(n=>[e.transform(n[0]),n[1]])),new t({precision:e.precision??this.getPrecision(),base:e.base??this.getBase(),bins:r})}getBins(e){if(this._cache.data||(this._cache.data=[...this.storage].sort((l,f)=>l[0]-f[0])),!e)return this._cache.data;let r=Math.max(e.min??-1/0,this.percentile(e.ltrim??0)),n=Math.min(e.max??1/0,this.percentile(100-(e.rtrim??0)));if(!e.winsorize)return this._cache.data.filter(l=>l[0]>=r&&l[0]<=n);let s=[this.round(r),0],i=[this.round(n),0],o=[s];for(let[l,f]of this._cache.data)l<=s[0]?s[1]+=f:l>=i[0]?i[1]+=f:o.push([l,f]);return i[1]>0&&o.push(i),o}count(){return this._count}min(){let e=this.getBins();return this.lower(e[0][0])}max(){let e=this.getBins();return this.upper(e[e.length-1][0])}sumOf(e){let r=0;return [...this.storage].forEach(n=>{r+=n[1]*e(n[0]);}),r}E(e){return this._count?this.sumOf(e)/this._count:void 0}mean(){return this._count?this.sumOf(e=>e)/this._count:void 0}stdev(){if(this._count<2)return;let e=this.mean();return Math.sqrt(this.sumOf(r=>(r-e)*(r-e))/(this._count-1))}skewness(){let e=this.count();return e<3?void 0:e*e/((e-1)*(e-2))*this.momentStd(3)}kurtosis(){let e=this.count();if(e<4)return;let r=e*e*(e+1)/((e-1)*(e-2)*(e-3)),n=(e-1)*(e-1)/((e-2)*(e-3));return this.momentStd(4)*r-3*n}moment(e,r){if(!Number.isInteger(e))throw new Error("Cannot calculate non-integer moment (did you mean momentAbs?)");return r===void 0&&(r=this.mean()),this.E(n=>(n-r)**e)}momentAbs(e=1,r){return r===void 0&&(r=this.mean()),this.E(n=>Math.abs(n-r)**e)}momentStd(e){return this.moment(e)/this.stdev()**e}quantile(e){let r=e*this._count,n=this._cumulative(),s=0,i=n.length;for(;s+1=r?i=f:s=f;}let o=this.lower(n[s][0]),l=this.upper(n[s][0])-o;return o+l*(r-n[s][1])/(n[s][2]-n[s][1])}percentile(e){return this.quantile(e/100)}median(){return this.quantile(.5)}cdf(e){return this._rawCdf(e)/this._count}_rawCdf(e){let r=this._cumulative(),n=this.round(e),s=0,i=r.length;for(;s=r.length)return this._count;let o=s>0?r[s-1][2]:0,l=n!==r[s][0]?0:(r[s][2]-r[s][1])*(e-this.lower(e))/(this.upper(e)-this.lower(e));return o+l}histogram(e={}){if(!this._count)return [];let r=this.min(),n=this.max(),s=e.count||10,i=[],o=r,l=(n-r)/s;for(let f=0;f1;)i[f][0]-=i[f-1][0];if(i[0][0]-=this._rawCdf(r),e.scale){let f=0;for(let d=0;d{let e=!!t.match(/\+/);e&&(t=t.replace("+",""));let r=Wn.prototype[t];if(typeof r!="function")throw new Error('method "'+t+'" is cached but never defined');Wn.prototype[t]=e?function(...n){if(this._count===0)return;this._cache[t]===void 0&&(this._cache[t]={});let s=n.join(":");return this._cache[t][s]===void 0&&(this._cache[t][s]=r.apply(this,n)),this._cache[t][s]}:function(){if(this._count!==0)return this._cache[t]===void 0&&(this._cache[t]=r.apply(this)),this._cache[t]};});var zn=class{constructor(e){this._main=e;}min(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[0][0])}max(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[e.length-1][0])}};["E","kurtosis","mean","median","moment","momentAbs","momentStd","percentile","quantile","skewness","stdev","sumOf"].forEach(t=>{zn.prototype[t]=function(e){return this._main.shorten(this._main[t](e))};});["cdf","count"].forEach(t=>{zn.prototype[t]=function(e){return this._main[t](e)};});gv.exports={Univariate:Wn};});var yv=x((P3,sc)=>{(()=>{let{Binning:t}=ic(),{Univariate:e}=_v(),r={Binning:t,Univariate:e};typeof window<"u"&&(window.logstat=r),typeof sc=="object"&&(sc.exports=r);})();});var Qn=new Uint8Array(256),Xn=Qn.length;function uo(){return Xn>Qn.length-16&&(zE__default.default.randomFillSync(Qn),Xn=0),Qn.slice(Xn,Xn+=16)}var Me=[];for(let t=0;t<256;++t)Me.push((t+256).toString(16).slice(1));function Xc(t,e=0){return Me[t[e+0]]+Me[t[e+1]]+Me[t[e+2]]+Me[t[e+3]]+"-"+Me[t[e+4]]+Me[t[e+5]]+"-"+Me[t[e+6]]+Me[t[e+7]]+"-"+Me[t[e+8]]+Me[t[e+9]]+"-"+Me[t[e+10]]+Me[t[e+11]]+Me[t[e+12]]+Me[t[e+13]]+Me[t[e+14]]+Me[t[e+15]]}var co={randomUUID:zE__default.default.randomUUID};function VE(t,e,r){if(co.randomUUID&&!e&&!t)return co.randomUUID();t=t||{};let n=t.random||(t.rng||uo)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let s=0;s<16;++s)e[r+s]=n[s];return e}return Xc(n)}var St=VE;var Js=He(Ni());var qt={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function IC(t,e){return e}function Yp(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:FC(t)?1:t instanceof Set?3:t instanceof Map?4:5}function PC(t){let e=new Set;for(let r of t)for(let n of [...Object.keys(r),...Object.getOwnPropertySymbols(r)])e.add(n);return e}function OC(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Xp(t){return {*[Symbol.iterator](){for(let e of t)for(let r of e)yield r;}}}var Jp=new Set(["[object Object]","[object Module]"]);function FC(t){if(!Jp.has(Object.prototype.toString.call(t)))return !1;let{constructor:e}=t;if(e===void 0)return !0;let r=e.prototype;return !(r===null||typeof r!="object"||!Jp.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function MC(t,e,r){let n={};for(let s of PC(t)){let i=[];for(let f of t)OC(f,s)&&i.push(f[s]);if(i.length===0)continue;let o=e.metaDataUpdater(r,{key:s,parents:t}),l=tm(i,e,o);l!==qt.skip&&(s==="__proto__"?Object.defineProperty(n,s,{value:l,configurable:!0,enumerable:!0,writable:!0}):n[s]=l);}return n}function NC(t){return t.flat()}function kC(t){return new Set(Xp(t))}function LC(t){return new Map(Xp(t))}function Qp(t){return t.at(-1)}var pa=Object.freeze({__proto__:null,mergeArrays:NC,mergeMaps:LC,mergeOthers:Qp,mergeRecords:MC,mergeSets:kC});function em(...t){return $C({})(...t)}function $C(t,e){let r=DC(t,n);function n(...s){return tm(s,r,e)}return n}function DC(t,e){return {defaultMergeFunctions:pa,mergeFunctions:{...pa,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(pa,r)).map(([r,n])=>n===!1?[r,Qp]:[r,n]))},metaDataUpdater:t.metaDataUpdater??IC,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,actions:qt}}function tm(t,e,r){if(t.length===0)return;if(t.length===1)return ma(t,e,r);let n=Yp(t[0]);if(n!==0&&n!==5){for(let s=1;s{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var ga=new Set(["__proto__","prototype","constructor"]),jC=new Set("0123456789");function _a(t){let e=[],r="",n="start",s=!1;for(let i of t)switch(i){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");s&&(r+=i),n="property",s=!s;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(s){s=!1,r+=i;break}if(ga.has(r))return [];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(s){s=!1,r+=i;break}if(n==="property"){if(ga.has(r))return [];e.push(r),r="";}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!jC.has(i))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),s&&(s=!1,r+="\\"),r+=i;}}switch(s&&(r+="\\"),n){case"property":{if(ga.has(r))return [];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function rm(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return !1}function nm(t,e){if(rm(t,e))throw new Error("Cannot use string index")}function ki(t,e,r){if(!hn(t)||typeof e!="string")return r===void 0?t:r;let n=_a(e);if(n.length===0)return r;for(let s=0;s0&&e[e.length-1]?.endsWith(` -`)&&e.push(""),e}function se(t){return t.trim().length===0}function mt(t,e){if(e===void 0)return t.match(/^[ \t]*/)?.[0]?.length??0;if(e===" ")return t.match(/^\t*/g)?.[0].length??0;if(e.match(/^ *$/))return (t.match(/^ */)?.[0].length??0)/e.length;throw new Error(`Invalid indentation: ${e}`)}function wa(t,e){return e<0||e>=t.length-1?!1:mt(t[e])t.length-1?!1:mt(t[e-1])>mt(t[e])}var lm=[["(",")"],["[","]"],["{","}"],["'","'"],['"','"'],["`","`"]],um=lm.map(t=>t[0]),Di=lm.map(t=>t[1]);function qi(t){let e=[];for(let r of t)[["(",")"],["[","]"],["{","}"]].forEach(n=>{r===n[1]&&(e.length>0&&e[e.length-1]===n[0]?e.pop():e.push(r));}),"([{".includes(r)&&e.push(r),["'",'"',"`"].forEach(n=>{r===n&&(e.length>0&&e.includes(n)?e.splice(e.lastIndexOf(n),e.length-e.lastIndexOf(n)):e.push(r));});return e.join("")}function Cr(t,e){return cm.get(t,e)}function pn(t){let e=new AbortController;for(let r of t){if(r?.aborted)return e.abort(r.reason),r;r?.addEventListener("abort",()=>e.abort(r.reason),{signal:e.signal});}return e.signal}var je=class extends Error{constructor(r){super(`${r.status} ${r.statusText}`);this.name="HttpError",this.status=r.status,this.statusText=r.statusText,this.response=r;}};function mn(t){return t instanceof Error&&t.name==="TimeoutError"||t instanceof je&&[408,499].includes(t.status)}function Qt(t){return t instanceof Error&&t.name==="AbortError"}function ba(t){let e=t.message||t.toString();return t.cause&&(e+=` -Caused by: `+ba(t.cause)),e}function Sa(t){this.message=t;}Sa.prototype=new Error,Sa.prototype.name="InvalidCharacterError";var fm=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new Sa("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,s=0,i=0,o="";n=e.charAt(i++);~n&&(r=s%4?64*r+n:n,s++%4)?o+=String.fromCharCode(255&r>>(-2*s&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o};function XC(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw "Illegal base64url string!"}try{return function(r){return decodeURIComponent(fm(r).replace(/(.)/g,function(n,s){var i=s.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(e)}catch{return fm(e)}}function Bi(t){this.message=t;}function QC(t,e){if(typeof t!="string")throw new Bi("Invalid token specified");var r=(e=e||{}).header===!0?0:1;try{return JSON.parse(XC(t.split(".")[r]))}catch(n){throw new Bi("Invalid token specified: "+n.message)}}Bi.prototype=new Error,Bi.prototype.name="InvalidTokenError";var Ui=QC;var kl=He(La()),nw=He(Ni()),iw=He(Nl());var Ll=class extends events.EventEmitter{constructor(r){super();this.filepath=r;this.data={};}async load(){this.data=await kl.default.readJson($l,{throws:!1})||{};}async save(){await kl.default.outputJson($l,this.data);}watch(){this.watcher=iw.default.watch(this.filepath,{interval:1e3});let r=async()=>{let n=this.data;await this.load(),(0, nw.default)(n,this.data)||super.emit("updated",this.data);};this.watcher.on("add",r),this.watcher.on("change",r);}},$l=XS__default.default.join(pv__default.default.homedir(),".tabby-client","agent","data.json"),sr=new Ll($l);var qs=He(hS()),ES=He(bS());var Hu=class{constructor(){this.streamOptions={filename:XS__default.default.join(pv__default.default.homedir(),".tabby-client","agent","logs","%DATE%"),frequency:"daily",size:"10M",max_logs:"30d",extension:".log",create_symlink:!0};}write(e){this.stream||(this.stream=ES.getStream(this.streamOptions)),this.stream.write(e);}},SS=new Hu,vS={serializers:{error:qs.default.stdSerializers.err}},Te=SS?(0, qs.default)(vS,SS):(0, qs.default)(vS);Te.level="silent";var Bn=[Te];Te.onChild=t=>{Bn.push(t);};var ju=class extends Error{constructor(r){super();this.cause=r;this.name="RetryLimitReachedError";}},Bs=class t extends events.EventEmitter{constructor(r){super();this.endpoint=r;this.logger=Te.child({component:"Auth"});this.authApi=Xt({baseUrl:"https://app.tabbyml.com/api"});}static{this.authPageUrl="https://app.tabbyml.com/account/device-token";}static{this.tokenStrategy={polling:{interval:5e3,timeout:5*60*1e3},refresh:{interval:15*60*1e3,beforeExpire:30*60*1e3,whenLoaded:{maxTry:5,retryDelay:1e3},whenScheduled:{maxTry:60,retryDelay:30*1e3}}};}async init(r){r?.dataStore?this.dataStore=r.dataStore:(this.dataStore=sr,sr&&(sr.on("updated",async()=>{await this.load(),super.emit("updated",this.jwt);}),sr.watch())),this.scheduleRefreshToken(),await this.load();}get token(){return this.jwt?.token}get user(){return this.jwt?.payload.email}async load(){if(this.dataStore)try{await this.dataStore.load();let r=this.dataStore.data.auth?.[this.endpoint]?.jwt;if(typeof r=="string"&&this.jwt?.token!==r){this.logger.debug({storedJwt:r},"Load jwt from data store.");let n={token:r,payload:Ui(r)};n.payload.exp*1e3-Date.now()"u")return;delete this.dataStore.data.auth[this.endpoint];}await this.dataStore.save(),this.logger.debug("Save changes to data store.");}catch(r){this.logger.error({error:r},"Error when saving auth");}}async reset(){this.jwt&&(this.jwt=void 0,await this.save());}async requestAuthUrl(r){try{if(await this.reset(),r?.signal.aborted)throw r.signal.reason;this.logger.debug("Start to request device token");let n=await this.authApi.POST("/device-token",{body:{auth_url:this.endpoint},signal:r?.signal});if(n.error||!n.response.ok)throw new je(n.response);let s=n.data;this.logger.debug({deviceToken:s},"Request device token response");let i=new URL(t.authPageUrl);return i.searchParams.append("code",s.data.code),{authUrl:i.toString(),code:s.data.code}}catch(n){throw this.logger.error({error:n},"Error when requesting token"),n}}async pollingToken(r,n){return new Promise((s,i)=>{let o=pn([AbortSignal.timeout(t.tokenStrategy.polling.timeout),n?.signal]),l=setInterval(async()=>{try{let f=await this.authApi.POST("/device-token/accept",{params:{query:{code:r}},signal:o});if(f.error||!f.response.ok)throw new je(f.response);let d=f.data;this.logger.debug({result:d},"Poll jwt response"),this.jwt={token:d.data.jwt,payload:Ui(d.data.jwt)},super.emit("updated",this.jwt),await this.save(),clearInterval(l),s(!0);}catch(f){f instanceof je&&[400,401,403,405].includes(f.status)?this.logger.debug({error:f},"Expected error when polling jwt"):this.logger.error({error:f},"Error when polling jwt");}},t.tokenStrategy.polling.interval);o.aborted?(clearInterval(l),i(o.reason)):o.addEventListener("abort",()=>{clearInterval(l),i(o.reason);});})}async refreshToken(r,n={maxTry:1,retryDelay:1e3},s=0){try{this.logger.debug({retry:s},"Start to refresh token");let i=await this.authApi.POST("/device-token/refresh",{headers:{Authorization:`Bearer ${r.token}`}});if(i.error||!i.response.ok)throw new je(i.response);let o=i.data;return this.logger.debug({refreshedJwt:o},"Refresh token response"),{token:o.data.jwt,payload:Ui(o.data.jwt)}}catch(i){if(i instanceof je&&[400,401,403,405].includes(i.status))this.logger.debug({error:i},"Error when refreshing jwt");else if(this.logger.error({error:i},"Unknown error when refreshing jwt"),ssetTimeout(o,n.retryDelay)),this.refreshToken(r,n,s+1);throw new ju(i)}}scheduleRefreshToken(){setInterval(async()=>{if(this.jwt)if(this.jwt.payload.exp*1e3-Date.now()n(i,{loadAsync:!0})).then(i=>{let s=Object.keys(i),o=s.find(l=>LANGUAGE_FUNCTION_REGEX.test(l)&&!l.includes("external_scanner_"));o||console.log(`Couldn't find language function in WASM file. Symbols: +${JSON.stringify(s,null,2)}`);let a=i[o]();return new Language(INTERNAL,a)})}}class Query{constructor(e,r,n,i,s,o,a,l){assertInternal(e),this[0]=r,this.captureNames=n,this.textPredicates=i,this.predicates=s,this.setProperties=o,this.assertedProperties=a,this.refutedProperties=l,this.exceededMatchLimit=!1;}delete(){C._ts_query_delete(this[0]),this[0]=0;}matches(e,r,n,i){r||(r=ZERO_POINT),n||(n=ZERO_POINT),i||(i={});let s=i.matchLimit;if(s===void 0)s=0;else if(typeof s!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_matches_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,s);let o=getValue(TRANSFER_BUFFER,"i32"),a=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),l=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),d=new Array(o);this.exceededMatchLimit=!!l;let c=0,p=a;for(let m=0;mP(E))){d[c++]={pattern:_,captures:E};let P=this.setProperties[_];P&&(d[m].setProperties=P);let D=this.assertedProperties[_];D&&(d[m].assertedProperties=D);let g=this.refutedProperties[_];g&&(d[m].refutedProperties=g);}}return d.length=c,C._free(a),d}captures(e,r,n,i){r||(r=ZERO_POINT),n||(n=ZERO_POINT),i||(i={});let s=i.matchLimit;if(s===void 0)s=0;else if(typeof s!="number")throw new Error("Arguments must be numbers");marshalNode(e),C._ts_query_captures_wasm(this[0],e.tree[0],r.row,r.column,n.row,n.column,s);let o=getValue(TRANSFER_BUFFER,"i32"),a=getValue(TRANSFER_BUFFER+SIZE_OF_INT,"i32"),l=getValue(TRANSFER_BUFFER+2*SIZE_OF_INT,"i32"),d=[];this.exceededMatchLimit=!!l;let c=[],p=a;for(let m=0;mP(c))){let P=c[E],D=this.setProperties[_];D&&(P.setProperties=D);let g=this.assertedProperties[_];g&&(P.assertedProperties=g);let S=this.refutedProperties[_];S&&(P.refutedProperties=S),d.push(P);}}return C._free(a),d}predicatesForPattern(e){return this.predicates[e]}didExceedMatchLimit(){return this.exceededMatchLimit}}function getText(t,e,r){let n=r-e,i=t.textCallback(e,null,r);for(e+=i.length;e0))break;e+=s.length,i+=s;}return e>r&&(i=i.slice(0,n)),i}function unmarshalCaptures(t,e,r,n){for(let i=0,s=n.length;i{ParserImpl.init(),resolveInitPromise();};}))}}return Parser}();typeof exports=="object"&&(module.exports=TreeSitter);});var pp=A((O5,uT)=>{var hp=class{constructor(e={}){let r=e.base||1.001,n=e.precision||1e-9;if(!(r>1)||!(r<1.5))throw new Error("base must be a number between 1 and 1.5");if(r+=1e-9,r=2**(1/Math.ceil(Math.log(2)/Math.log(r))),r===1)throw new Error("base too close to 1");n=Number.parseFloat(""+n);let i=Math.ceil(1/(r-1)),s=n*i;this._thresh=s,this._precision=n,this._base=r;}getBase(){return this._base}getPrecision(){return this._precision}round(e){if(typeof e!="number"&&(e=Number.parseFloat(e)),Number.isNaN(e))throw new Error("Attempt to round a non-numeric value: "+e);return e<0?-this.round(-e):ee)return yo(e,t,r);let n=-Math.floor(Math.log(e-t)/Math.log(r));for(;Math.ceil(t*r**n)<=Math.floor(e*r**n);)n--;return n++,n>=0?Math.ceil(t*r**n)/r**n:Math.ceil(t/r**-n)*r**-n}uT.exports={Binning:hp,shorten:yo};});var lT=A((I5,cT)=>{var{Binning:h3}=pp(),p3="stats-logscale/univariate@1.0",bo=class t extends h3{constructor(e={}){super(e),this.storage=new Map,this._count=0,this._cache={},this.neat=new vo(this),e.bins&&this.addWeighted(e.bins);}add(...e){return this._cache={},e.forEach(r=>{let n=this.round(r),i=this.storage.get(n)??0;this.storage.set(n,i+1),this._count++;}),this}addWeighted(e){return this._cache={},e.forEach(r=>{let n=r[0],i=Number.parseFloat(r[1]);if(Number.isNaN(i))throw new Error("Attempt to provide a non-numeric weight");let s=this.round(n),o=(this.storage.get(s)??0)+i;o<=0?(this.storage.delete(s),this._count+=i-o):(this.storage.set(s,o),this._count+=i);}),this}toJSON(){return {version:p3,precision:this.getPrecision(),base:this.getBase(),bins:this.getBins()}}clone(e={}){let r=this.getBins(e);return e.transform&&(r=r.map(n=>[e.transform(n[0]),n[1]])),new t({precision:e.precision??this.getPrecision(),base:e.base??this.getBase(),bins:r})}getBins(e){if(this._cache.data||(this._cache.data=[...this.storage].sort((a,l)=>a[0]-l[0])),!e)return this._cache.data;let r=Math.max(e.min??-1/0,this.percentile(e.ltrim??0)),n=Math.min(e.max??1/0,this.percentile(100-(e.rtrim??0)));if(!e.winsorize)return this._cache.data.filter(a=>a[0]>=r&&a[0]<=n);let i=[this.round(r),0],s=[this.round(n),0],o=[i];for(let[a,l]of this._cache.data)a<=i[0]?i[1]+=l:a>=s[0]?s[1]+=l:o.push([a,l]);return s[1]>0&&o.push(s),o}count(){return this._count}min(){let e=this.getBins();return this.lower(e[0][0])}max(){let e=this.getBins();return this.upper(e[e.length-1][0])}sumOf(e){let r=0;return [...this.storage].forEach(n=>{r+=n[1]*e(n[0]);}),r}E(e){return this._count?this.sumOf(e)/this._count:void 0}mean(){return this._count?this.sumOf(e=>e)/this._count:void 0}stdev(){if(this._count<2)return;let e=this.mean();return Math.sqrt(this.sumOf(r=>(r-e)*(r-e))/(this._count-1))}skewness(){let e=this.count();return e<3?void 0:e*e/((e-1)*(e-2))*this.momentStd(3)}kurtosis(){let e=this.count();if(e<4)return;let r=e*e*(e+1)/((e-1)*(e-2)*(e-3)),n=(e-1)*(e-1)/((e-2)*(e-3));return this.momentStd(4)*r-3*n}moment(e,r){if(!Number.isInteger(e))throw new Error("Cannot calculate non-integer moment (did you mean momentAbs?)");return r===void 0&&(r=this.mean()),this.E(n=>(n-r)**e)}momentAbs(e=1,r){return r===void 0&&(r=this.mean()),this.E(n=>Math.abs(n-r)**e)}momentStd(e){return this.moment(e)/this.stdev()**e}quantile(e){let r=e*this._count,n=this._cumulative(),i=0,s=n.length;for(;i+1=r?s=l:i=l;}let o=this.lower(n[i][0]),a=this.upper(n[i][0])-o;return o+a*(r-n[i][1])/(n[i][2]-n[i][1])}percentile(e){return this.quantile(e/100)}median(){return this.quantile(.5)}cdf(e){return this._rawCdf(e)/this._count}_rawCdf(e){let r=this._cumulative(),n=this.round(e),i=0,s=r.length;for(;i=r.length)return this._count;let o=i>0?r[i-1][2]:0,a=n!==r[i][0]?0:(r[i][2]-r[i][1])*(e-this.lower(e))/(this.upper(e)-this.lower(e));return o+a}histogram(e={}){if(!this._count)return [];let r=this.min(),n=this.max(),i=e.count||10,s=[],o=r,a=(n-r)/i;for(let l=0;l1;)s[l][0]-=s[l-1][0];if(s[0][0]-=this._rawCdf(r),e.scale){let l=0;for(let d=0;d{let e=!!t.match(/\+/);e&&(t=t.replace("+",""));let r=bo.prototype[t];if(typeof r!="function")throw new Error('method "'+t+'" is cached but never defined');bo.prototype[t]=e?function(...n){if(this._count===0)return;this._cache[t]===void 0&&(this._cache[t]={});let i=n.join(":");return this._cache[t][i]===void 0&&(this._cache[t][i]=r.apply(this,n)),this._cache[t][i]}:function(){if(this._count!==0)return this._cache[t]===void 0&&(this._cache[t]=r.apply(this)),this._cache[t]};});var vo=class{constructor(e){this._main=e;}min(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[0][0])}max(){if(!this._main._count)return;let e=this._main.getBins();return this._main.shorten(e[e.length-1][0])}};["E","kurtosis","mean","median","moment","momentAbs","momentStd","percentile","quantile","skewness","stdev","sumOf"].forEach(t=>{vo.prototype[t]=function(e){return this._main.shorten(this._main[t](e))};});["cdf","count"].forEach(t=>{vo.prototype[t]=function(e){return this._main[t](e)};});cT.exports={Univariate:bo};});var fT=A((k5,mp)=>{(()=>{let{Binning:t}=pp(),{Univariate:e}=lT(),r={Binning:t,Univariate:e};typeof window<"u"&&(window.logstat=r),typeof mp=="object"&&(mp.exports=r);})();});var zu=A(pt=>{Object.defineProperty(pt,"__esModule",{value:!0});pt.thenable=pt.typedArray=pt.stringArray=pt.array=pt.func=pt.error=pt.number=pt.string=pt.boolean=void 0;function _3(t){return t===!0||t===!1}pt.boolean=_3;function hT(t){return typeof t=="string"||t instanceof String}pt.string=hT;function y3(t){return typeof t=="number"||t instanceof Number}pt.number=y3;function b3(t){return t instanceof Error}pt.error=b3;function pT(t){return typeof t=="function"}pt.func=pT;function mT(t){return Array.isArray(t)}pt.array=mT;function v3(t){return mT(t)&&t.every(e=>hT(e))}pt.stringArray=v3;function w3(t,e){return Array.isArray(t)&&t.every(e)}pt.typedArray=w3;function S3(t){return t&&pT(t.then)}pt.thenable=S3;});var Qi=A(It=>{Object.defineProperty(It,"__esModule",{value:!0});It.stringArray=It.array=It.func=It.error=It.number=It.string=It.boolean=void 0;function E3(t){return t===!0||t===!1}It.boolean=E3;function gT(t){return typeof t=="string"||t instanceof String}It.string=gT;function R3(t){return typeof t=="number"||t instanceof Number}It.number=R3;function C3(t){return t instanceof Error}It.error=C3;function x3(t){return typeof t=="function"}It.func=x3;function _T(t){return Array.isArray(t)}It.array=_T;function T3(t){return _T(t)&&t.every(e=>gT(e))}It.stringArray=T3;});var Hp=A(_e=>{Object.defineProperty(_e,"__esModule",{value:!0});_e.Message=_e.NotificationType9=_e.NotificationType8=_e.NotificationType7=_e.NotificationType6=_e.NotificationType5=_e.NotificationType4=_e.NotificationType3=_e.NotificationType2=_e.NotificationType1=_e.NotificationType0=_e.NotificationType=_e.RequestType9=_e.RequestType8=_e.RequestType7=_e.RequestType6=_e.RequestType5=_e.RequestType4=_e.RequestType3=_e.RequestType2=_e.RequestType1=_e.RequestType=_e.RequestType0=_e.AbstractMessageSignature=_e.ParameterStructures=_e.ResponseError=_e.ErrorCodes=void 0;var li=Qi(),_p;(function(t){t.ParseError=-32700,t.InvalidRequest=-32600,t.MethodNotFound=-32601,t.InvalidParams=-32602,t.InternalError=-32603,t.jsonrpcReservedErrorRangeStart=-32099,t.serverErrorStart=-32099,t.MessageWriteError=-32099,t.MessageReadError=-32098,t.PendingResponseRejected=-32097,t.ConnectionInactive=-32096,t.ServerNotInitialized=-32002,t.UnknownErrorCode=-32001,t.jsonrpcReservedErrorRangeEnd=-32e3,t.serverErrorEnd=-32e3;})(_p||(_e.ErrorCodes=_p={}));var yp=class t extends Error{constructor(e,r,n){super(r),this.code=li.number(e)?e:_p.UnknownErrorCode,this.data=n,Object.setPrototypeOf(this,t.prototype);}toJson(){let e={code:this.code,message:this.message};return this.data!==void 0&&(e.data=this.data),e}};_e.ResponseError=yp;var Jt=class t{constructor(e){this.kind=e;}static is(e){return e===t.auto||e===t.byName||e===t.byPosition}toString(){return this.kind}};_e.ParameterStructures=Jt;Jt.auto=new Jt("auto");Jt.byPosition=new Jt("byPosition");Jt.byName=new Jt("byName");var Qe=class{constructor(e,r){this.method=e,this.numberOfParams=r;}get parameterStructures(){return Jt.auto}};_e.AbstractMessageSignature=Qe;var bp=class extends Qe{constructor(e){super(e,0);}};_e.RequestType0=bp;var vp=class extends Qe{constructor(e,r=Jt.auto){super(e,1),this._parameterStructures=r;}get parameterStructures(){return this._parameterStructures}};_e.RequestType=vp;var wp=class extends Qe{constructor(e,r=Jt.auto){super(e,1),this._parameterStructures=r;}get parameterStructures(){return this._parameterStructures}};_e.RequestType1=wp;var Sp=class extends Qe{constructor(e){super(e,2);}};_e.RequestType2=Sp;var Ep=class extends Qe{constructor(e){super(e,3);}};_e.RequestType3=Ep;var Rp=class extends Qe{constructor(e){super(e,4);}};_e.RequestType4=Rp;var Cp=class extends Qe{constructor(e){super(e,5);}};_e.RequestType5=Cp;var xp=class extends Qe{constructor(e){super(e,6);}};_e.RequestType6=xp;var Tp=class extends Qe{constructor(e){super(e,7);}};_e.RequestType7=Tp;var Ap=class extends Qe{constructor(e){super(e,8);}};_e.RequestType8=Ap;var Pp=class extends Qe{constructor(e){super(e,9);}};_e.RequestType9=Pp;var Dp=class extends Qe{constructor(e,r=Jt.auto){super(e,1),this._parameterStructures=r;}get parameterStructures(){return this._parameterStructures}};_e.NotificationType=Dp;var Op=class extends Qe{constructor(e){super(e,0);}};_e.NotificationType0=Op;var Ip=class extends Qe{constructor(e,r=Jt.auto){super(e,1),this._parameterStructures=r;}get parameterStructures(){return this._parameterStructures}};_e.NotificationType1=Ip;var kp=class extends Qe{constructor(e){super(e,2);}};_e.NotificationType2=kp;var Mp=class extends Qe{constructor(e){super(e,3);}};_e.NotificationType3=Mp;var Fp=class extends Qe{constructor(e){super(e,4);}};_e.NotificationType4=Fp;var Np=class extends Qe{constructor(e){super(e,5);}};_e.NotificationType5=Np;var qp=class extends Qe{constructor(e){super(e,6);}};_e.NotificationType6=qp;var Lp=class extends Qe{constructor(e){super(e,7);}};_e.NotificationType7=Lp;var $p=class extends Qe{constructor(e){super(e,8);}};_e.NotificationType8=$p;var jp=class extends Qe{constructor(e){super(e,9);}};_e.NotificationType9=jp;var yT;(function(t){function e(i){let s=i;return s&&li.string(s.method)&&(li.string(s.id)||li.number(s.id))}t.isRequest=e;function r(i){let s=i;return s&&li.string(s.method)&&i.id===void 0}t.isNotification=r;function n(i){let s=i;return s&&(s.result!==void 0||!!s.error)&&(li.string(s.id)||li.number(s.id)||s.id===null)}t.isResponse=n;})(yT||(_e.Message=yT={}));});var Bp=A(Pn=>{var bT;Object.defineProperty(Pn,"__esModule",{value:!0});Pn.LRUCache=Pn.LinkedMap=Pn.Touch=void 0;var kt;(function(t){t.None=0,t.First=1,t.AsOld=t.First,t.Last=2,t.AsNew=t.Last;})(kt||(Pn.Touch=kt={}));var Vu=class{constructor(){this[bT]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0;}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++;}isEmpty(){return !this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(e){return this._map.has(e)}get(e,r=kt.None){let n=this._map.get(e);if(n)return r!==kt.None&&this.touch(n,r),n.value}set(e,r,n=kt.None){let i=this._map.get(e);if(i)i.value=r,n!==kt.None&&this.touch(i,n);else {switch(i={key:e,value:r,next:void 0,previous:void 0},n){case kt.None:this.addItemLast(i);break;case kt.First:this.addItemFirst(i);break;case kt.Last:this.addItemLast(i);break;default:this.addItemLast(i);break}this._map.set(e,i),this._size++;}return this}delete(e){return !!this.remove(e)}remove(e){let r=this._map.get(e);if(r)return this._map.delete(e),this.removeItem(r),this._size--,r.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");let e=this._head;return this._map.delete(e.key),this.removeItem(e),this._size--,e.value}forEach(e,r){let n=this._state,i=this._head;for(;i;){if(r?e.bind(r)(i.value,i.key,this):e(i.value,i.key,this),this._state!==n)throw new Error("LinkedMap got modified during iteration.");i=i.next;}}keys(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.key,done:!1};return r=r.next,i}else return {value:void 0,done:!0}}};return n}values(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:r.value,done:!1};return r=r.next,i}else return {value:void 0,done:!0}}};return n}entries(){let e=this._state,r=this._head,n={[Symbol.iterator]:()=>n,next:()=>{if(this._state!==e)throw new Error("LinkedMap got modified during iteration.");if(r){let i={value:[r.key,r.value],done:!1};return r=r.next,i}else return {value:void 0,done:!0}}};return n}[(bT=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(e){if(e>=this.size)return;if(e===0){this.clear();return}let r=this._head,n=this.size;for(;r&&n>e;)this._map.delete(r.key),r=r.next,n--;this._head=r,this._size=n,r&&(r.previous=void 0),this._state++;}addItemFirst(e){if(!this._head&&!this._tail)this._tail=e;else if(this._head)e.next=this._head,this._head.previous=e;else throw new Error("Invalid list");this._head=e,this._state++;}addItemLast(e){if(!this._head&&!this._tail)this._head=e;else if(this._tail)e.previous=this._tail,this._tail.next=e;else throw new Error("Invalid list");this._tail=e,this._state++;}removeItem(e){if(e===this._head&&e===this._tail)this._head=void 0,this._tail=void 0;else if(e===this._head){if(!e.next)throw new Error("Invalid list");e.next.previous=void 0,this._head=e.next;}else if(e===this._tail){if(!e.previous)throw new Error("Invalid list");e.previous.next=void 0,this._tail=e.previous;}else {let r=e.next,n=e.previous;if(!r||!n)throw new Error("Invalid list");r.previous=n,n.next=r;}e.next=void 0,e.previous=void 0,this._state++;}touch(e,r){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(r!==kt.First&&r!==kt.Last)){if(r===kt.First){if(e===this._head)return;let n=e.next,i=e.previous;e===this._tail?(i.next=void 0,this._tail=i):(n.previous=i,i.next=n),e.previous=void 0,e.next=this._head,this._head.previous=e,this._head=e,this._state++;}else if(r===kt.Last){if(e===this._tail)return;let n=e.next,i=e.previous;e===this._head?(n.previous=void 0,this._head=n):(n.previous=i,i.next=n),e.next=void 0,e.previous=this._tail,this._tail.next=e,this._tail=e,this._state++;}}}toJSON(){let e=[];return this.forEach((r,n)=>{e.push([n,r]);}),e}fromJSON(e){this.clear();for(let[r,n]of e)this.set(r,n);}};Pn.LinkedMap=Vu;var Wp=class extends Vu{constructor(e,r=1){super(),this._limit=e,this._ratio=Math.min(Math.max(0,r),1);}get limit(){return this._limit}set limit(e){this._limit=e,this.checkTrim();}get ratio(){return this._ratio}set ratio(e){this._ratio=Math.min(Math.max(0,e),1),this.checkTrim();}get(e,r=kt.AsNew){return super.get(e,r)}peek(e){return super.get(e,kt.None)}set(e,r){return super.set(e,r,kt.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio));}};Pn.LRUCache=Wp;});var wT=A(Gu=>{Object.defineProperty(Gu,"__esModule",{value:!0});Gu.Disposable=void 0;var vT;(function(t){function e(r){return {dispose:r}}t.create=e;})(vT||(Gu.Disposable=vT={}));});var Dn=A(Vp=>{Object.defineProperty(Vp,"__esModule",{value:!0});var Up;function zp(){if(Up===void 0)throw new Error("No runtime abstraction layer installed");return Up}(function(t){function e(r){if(r===void 0)throw new Error("No runtime abstraction layer provided");Up=r;}t.install=e;})(zp||(zp={}));Vp.default=zp;});var ts=A(es=>{Object.defineProperty(es,"__esModule",{value:!0});es.Emitter=es.Event=void 0;var A3=Dn(),ST;(function(t){let e={dispose(){}};t.None=function(){return e};})(ST||(es.Event=ST={}));var Gp=class{add(e,r=null,n){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(e),this._contexts.push(r),Array.isArray(n)&&n.push({dispose:()=>this.remove(e,r)});}remove(e,r=null){if(!this._callbacks)return;let n=!1;for(let i=0,s=this._callbacks.length;i{this._callbacks||(this._callbacks=new Gp),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(e,r);let i={dispose:()=>{this._callbacks&&(this._callbacks.remove(e,r),i.dispose=t._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this));}};return Array.isArray(n)&&n.push(i),i}),this._event}fire(e){this._callbacks&&this._callbacks.invoke.call(this._callbacks,e);}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0);}};es.Emitter=Ku;Ku._noop=function(){};});var Yu=A(rs=>{Object.defineProperty(rs,"__esModule",{value:!0});rs.CancellationTokenSource=rs.CancellationToken=void 0;var P3=Dn(),D3=Qi(),Kp=ts(),Zu;(function(t){t.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Kp.Event.None}),t.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Kp.Event.None});function e(r){let n=r;return n&&(n===t.None||n===t.Cancelled||D3.boolean(n.isCancellationRequested)&&!!n.onCancellationRequested)}t.is=e;})(Zu||(rs.CancellationToken=Zu={}));var O3=Object.freeze(function(t,e){let r=(0, P3.default)().timer.setTimeout(t.bind(e),0);return {dispose(){r.dispose();}}}),Ju=class{constructor(){this._isCancelled=!1;}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()));}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?O3:(this._emitter||(this._emitter=new Kp.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0);}},Zp=class{get token(){return this._token||(this._token=new Ju),this._token}cancel(){this._token?this._token.cancel():this._token=Zu.Cancelled;}dispose(){this._token?this._token instanceof Ju&&this._token.dispose():this._token=Zu.None;}};rs.CancellationTokenSource=Zp;});var ET=A(ns=>{Object.defineProperty(ns,"__esModule",{value:!0});ns.SharedArrayReceiverStrategy=ns.SharedArraySenderStrategy=void 0;var I3=Yu(),wo;(function(t){t.Continue=0,t.Cancelled=1;})(wo||(wo={}));var Jp=class{constructor(){this.buffers=new Map;}enableCancellation(e){if(e.id===null)return;let r=new SharedArrayBuffer(4),n=new Int32Array(r,0,1);n[0]=wo.Continue,this.buffers.set(e.id,r),e.$cancellationData=r;}async sendCancellation(e,r){let n=this.buffers.get(r);if(n===void 0)return;let i=new Int32Array(n,0,1);Atomics.store(i,0,wo.Cancelled);}cleanup(e){this.buffers.delete(e);}dispose(){this.buffers.clear();}};ns.SharedArraySenderStrategy=Jp;var Yp=class{constructor(e){this.data=new Int32Array(e,0,1);}get isCancellationRequested(){return Atomics.load(this.data,0)===wo.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}},Xp=class{constructor(e){this.token=new Yp(e);}cancel(){}dispose(){}},Qp=class{constructor(){this.kind="request";}createCancellationTokenSource(e){let r=e.$cancellationData;return r===void 0?new I3.CancellationTokenSource:new Xp(r)}};ns.SharedArrayReceiverStrategy=Qp;});var tm=A(Xu=>{Object.defineProperty(Xu,"__esModule",{value:!0});Xu.Semaphore=void 0;var k3=Dn(),em=class{constructor(e=1){if(e<=0)throw new Error("Capacity must be greater than 0");this._capacity=e,this._active=0,this._waiting=[];}lock(e){return new Promise((r,n)=>{this._waiting.push({thunk:e,resolve:r,reject:n}),this.runNext();})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0, k3.default)().timer.setImmediate(()=>this.doRunNext());}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;let e=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{let r=e.thunk();r instanceof Promise?r.then(n=>{this._active--,e.resolve(n),this.runNext();},n=>{this._active--,e.reject(n),this.runNext();}):(this._active--,e.resolve(r),this.runNext());}catch(r){this._active--,e.reject(r),this.runNext();}}};Xu.Semaphore=em;});var CT=A(On=>{Object.defineProperty(On,"__esModule",{value:!0});On.ReadableStreamMessageReader=On.AbstractMessageReader=On.MessageReader=void 0;var nm=Dn(),is=Qi(),rm=ts(),M3=tm(),RT;(function(t){function e(r){let n=r;return n&&is.func(n.listen)&&is.func(n.dispose)&&is.func(n.onError)&&is.func(n.onClose)&&is.func(n.onPartialMessage)}t.is=e;})(RT||(On.MessageReader=RT={}));var Qu=class{constructor(){this.errorEmitter=new rm.Emitter,this.closeEmitter=new rm.Emitter,this.partialMessageEmitter=new rm.Emitter;}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose();}get onError(){return this.errorEmitter.event}fireError(e){this.errorEmitter.fire(this.asError(e));}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0);}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(e){this.partialMessageEmitter.fire(e);}asError(e){return e instanceof Error?e:new Error(`Reader received error. Reason: ${is.string(e.message)?e.message:"unknown"}`)}};On.AbstractMessageReader=Qu;var im;(function(t){function e(r){let n,s,o=new Map,a,l=new Map;if(r===void 0||typeof r=="string")n=r??"utf-8";else {if(n=r.charset??"utf-8",r.contentDecoder!==void 0&&(s=r.contentDecoder,o.set(s.name,s)),r.contentDecoders!==void 0)for(let d of r.contentDecoders)o.set(d.name,d);if(r.contentTypeDecoder!==void 0&&(a=r.contentTypeDecoder,l.set(a.name,a)),r.contentTypeDecoders!==void 0)for(let d of r.contentTypeDecoders)l.set(d.name,d);}return a===void 0&&(a=(0, nm.default)().applicationJson.decoder,l.set(a.name,a)),{charset:n,contentDecoder:s,contentDecoders:o,contentTypeDecoder:a,contentTypeDecoders:l}}t.fromOptions=e;})(im||(im={}));var sm=class extends Qu{constructor(e,r){super(),this.readable=e,this.options=im.fromOptions(r),this.buffer=(0, nm.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new M3.Semaphore(1);}set partialMessageTimeout(e){this._partialMessageTimeout=e;}get partialMessageTimeout(){return this._partialMessageTimeout}listen(e){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=e;let r=this.readable.onData(n=>{this.onData(n);});return this.readable.onError(n=>this.fireError(n)),this.readable.onClose(()=>this.fireClose()),r}onData(e){try{for(this.buffer.append(e);;){if(this.nextMessageLength===-1){let n=this.buffer.tryReadHeaders(!0);if(!n)return;let i=n.get("content-length");if(!i){this.fireError(new Error(`Header must provide a Content-Length property. +${JSON.stringify(Object.fromEntries(n))}`));return}let s=parseInt(i);if(isNaN(s)){this.fireError(new Error(`Content-Length value must be a number. Got ${i}`));return}this.nextMessageLength=s;}let r=this.buffer.tryReadBody(this.nextMessageLength);if(r===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{let n=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(r):r,i=await this.options.contentTypeDecoder.decode(n,this.options);this.callback(i);}).catch(n=>{this.fireError(n);});}}catch(r){this.fireError(r);}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0);}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0, nm.default)().timer.setTimeout((e,r)=>{this.partialMessageTimer=void 0,e===this.messageToken&&(this.firePartialMessage({messageToken:e,waitingTime:r}),this.setPartialMessageTimer());},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout));}};On.ReadableStreamMessageReader=sm;});var DT=A(In=>{Object.defineProperty(In,"__esModule",{value:!0});In.WriteableStreamMessageWriter=In.AbstractMessageWriter=In.MessageWriter=void 0;var xT=Dn(),So=Qi(),F3=tm(),TT=ts(),N3="Content-Length: ",AT=`\r +`,PT;(function(t){function e(r){let n=r;return n&&So.func(n.dispose)&&So.func(n.onClose)&&So.func(n.onError)&&So.func(n.write)}t.is=e;})(PT||(In.MessageWriter=PT={}));var ec=class{constructor(){this.errorEmitter=new TT.Emitter,this.closeEmitter=new TT.Emitter;}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose();}get onError(){return this.errorEmitter.event}fireError(e,r,n){this.errorEmitter.fire([this.asError(e),r,n]);}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0);}asError(e){return e instanceof Error?e:new Error(`Writer received error. Reason: ${So.string(e.message)?e.message:"unknown"}`)}};In.AbstractMessageWriter=ec;var om;(function(t){function e(r){return r===void 0||typeof r=="string"?{charset:r??"utf-8",contentTypeEncoder:(0, xT.default)().applicationJson.encoder}:{charset:r.charset??"utf-8",contentEncoder:r.contentEncoder,contentTypeEncoder:r.contentTypeEncoder??(0, xT.default)().applicationJson.encoder}}t.fromOptions=e;})(om||(om={}));var am=class extends ec{constructor(e,r){super(),this.writable=e,this.options=om.fromOptions(r),this.errorCount=0,this.writeSemaphore=new F3.Semaphore(1),this.writable.onError(n=>this.fireError(n)),this.writable.onClose(()=>this.fireClose());}async write(e){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(e,this.options).then(n=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(n):n).then(n=>{let i=[];return i.push(N3,n.byteLength.toString(),AT),i.push(AT),this.doWrite(e,i,n)},n=>{throw this.fireError(n),n}))}async doWrite(e,r,n){try{return await this.writable.write(r.join(""),"ascii"),this.writable.write(n)}catch(i){return this.handleError(i,e),Promise.reject(i)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount);}end(){this.writable.end();}};In.WriteableStreamMessageWriter=am;});var OT=A(tc=>{Object.defineProperty(tc,"__esModule",{value:!0});tc.AbstractMessageBuffer=void 0;var q3=13,L3=10,$3=`\r +`,um=class{constructor(e="utf-8"){this._encoding=e,this._chunks=[],this._totalLength=0;}get encoding(){return this._encoding}append(e){let r=typeof e=="string"?this.fromString(e,this._encoding):e;this._chunks.push(r),this._totalLength+=r.byteLength;}tryReadHeaders(e=!1){if(this._chunks.length===0)return;let r=0,n=0,i=0,s=0;e:for(;nthis._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===e){let s=this._chunks[0];return this._chunks.shift(),this._totalLength-=e,this.asNative(s)}if(this._chunks[0].byteLength>e){let s=this._chunks[0],o=this.asNative(s,e);return this._chunks[0]=s.slice(e),this._totalLength-=e,o}let r=this.allocNative(e),n=0,i=0;for(;e>0;){let s=this._chunks[i];if(s.byteLength>e){let o=s.slice(0,e);r.set(o,n),n+=e,this._chunks[i]=s.slice(e),this._totalLength-=e,e-=e;}else r.set(s,n),n+=s.byteLength,this._chunks.shift(),this._totalLength-=s.byteLength,e-=s.byteLength;}return r}};tc.AbstractMessageBuffer=um;});var NT=A(xe=>{Object.defineProperty(xe,"__esModule",{value:!0});xe.createMessageConnection=xe.ConnectionOptions=xe.MessageStrategy=xe.CancellationStrategy=xe.CancellationSenderStrategy=xe.CancellationReceiverStrategy=xe.RequestCancellationReceiverStrategy=xe.IdCancellationReceiverStrategy=xe.ConnectionStrategy=xe.ConnectionError=xe.ConnectionErrors=xe.LogTraceNotification=xe.SetTraceNotification=xe.TraceFormat=xe.TraceValues=xe.Trace=xe.NullLogger=xe.ProgressType=xe.ProgressToken=void 0;var IT=Dn(),st=Qi(),ve=Hp(),kT=Bp(),Eo=ts(),cm=Yu(),xo;(function(t){t.type=new ve.NotificationType("$/cancelRequest");})(xo||(xo={}));var lm;(function(t){function e(r){return typeof r=="string"||typeof r=="number"}t.is=e;})(lm||(xe.ProgressToken=lm={}));var Ro;(function(t){t.type=new ve.NotificationType("$/progress");})(Ro||(Ro={}));var fm=class{constructor(){}};xe.ProgressType=fm;var dm;(function(t){function e(r){return st.func(r)}t.is=e;})(dm||(dm={}));xe.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var Le;(function(t){t[t.Off=0]="Off",t[t.Messages=1]="Messages",t[t.Compact=2]="Compact",t[t.Verbose=3]="Verbose";})(Le||(xe.Trace=Le={}));var MT;(function(t){t.Off="off",t.Messages="messages",t.Compact="compact",t.Verbose="verbose";})(MT||(xe.TraceValues=MT={}));(function(t){function e(n){if(!st.string(n))return t.Off;switch(n=n.toLowerCase(),n){case"off":return t.Off;case"messages":return t.Messages;case"compact":return t.Compact;case"verbose":return t.Verbose;default:return t.Off}}t.fromString=e;function r(n){switch(n){case t.Off:return "off";case t.Messages:return "messages";case t.Compact:return "compact";case t.Verbose:return "verbose";default:return "off"}}t.toString=r;})(Le||(xe.Trace=Le={}));var cr;(function(t){t.Text="text",t.JSON="json";})(cr||(xe.TraceFormat=cr={}));(function(t){function e(r){return st.string(r)?(r=r.toLowerCase(),r==="json"?t.JSON:t.Text):t.Text}t.fromString=e;})(cr||(xe.TraceFormat=cr={}));var hm;(function(t){t.type=new ve.NotificationType("$/setTrace");})(hm||(xe.SetTraceNotification=hm={}));var rc;(function(t){t.type=new ve.NotificationType("$/logTrace");})(rc||(xe.LogTraceNotification=rc={}));var Co;(function(t){t[t.Closed=1]="Closed",t[t.Disposed=2]="Disposed",t[t.AlreadyListening=3]="AlreadyListening";})(Co||(xe.ConnectionErrors=Co={}));var ss=class t extends Error{constructor(e,r){super(r),this.code=e,Object.setPrototypeOf(this,t.prototype);}};xe.ConnectionError=ss;var pm;(function(t){function e(r){let n=r;return n&&st.func(n.cancelUndispatched)}t.is=e;})(pm||(xe.ConnectionStrategy=pm={}));var nc;(function(t){function e(r){let n=r;return n&&(n.kind===void 0||n.kind==="id")&&st.func(n.createCancellationTokenSource)&&(n.dispose===void 0||st.func(n.dispose))}t.is=e;})(nc||(xe.IdCancellationReceiverStrategy=nc={}));var mm;(function(t){function e(r){let n=r;return n&&n.kind==="request"&&st.func(n.createCancellationTokenSource)&&(n.dispose===void 0||st.func(n.dispose))}t.is=e;})(mm||(xe.RequestCancellationReceiverStrategy=mm={}));var ic;(function(t){t.Message=Object.freeze({createCancellationTokenSource(r){return new cm.CancellationTokenSource}});function e(r){return nc.is(r)||mm.is(r)}t.is=e;})(ic||(xe.CancellationReceiverStrategy=ic={}));var sc;(function(t){t.Message=Object.freeze({sendCancellation(r,n){return r.sendNotification(xo.type,{id:n})},cleanup(r){}});function e(r){let n=r;return n&&st.func(n.sendCancellation)&&st.func(n.cleanup)}t.is=e;})(sc||(xe.CancellationSenderStrategy=sc={}));var oc;(function(t){t.Message=Object.freeze({receiver:ic.Message,sender:sc.Message});function e(r){let n=r;return n&&ic.is(n.receiver)&&sc.is(n.sender)}t.is=e;})(oc||(xe.CancellationStrategy=oc={}));var ac;(function(t){function e(r){let n=r;return n&&st.func(n.handleMessage)}t.is=e;})(ac||(xe.MessageStrategy=ac={}));var FT;(function(t){function e(r){let n=r;return n&&(oc.is(n.cancellationStrategy)||pm.is(n.connectionStrategy)||ac.is(n.messageStrategy))}t.is=e;})(FT||(xe.ConnectionOptions=FT={}));var Fr;(function(t){t[t.New=1]="New",t[t.Listening=2]="Listening",t[t.Closed=3]="Closed",t[t.Disposed=4]="Disposed";})(Fr||(Fr={}));function j3(t,e,r,n){let i=r!==void 0?r:xe.NullLogger,s=0,o=0,a=0,l="2.0",d,c=new Map,p,m=new Map,_=new Map,w,E=new kT.LinkedMap,P=new Map,D=new Set,g=new Map,S=Le.Off,I=cr.Text,L,Z=Fr.New,K=new Eo.Emitter,U=new Eo.Emitter,B=new Eo.Emitter,Q=new Eo.Emitter,N=new Eo.Emitter,te=n&&n.cancellationStrategy?n.cancellationStrategy:oc.Message;function ae(k){if(k===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return "req-"+k.toString()}function ye(k){return k===null?"res-unknown-"+(++a).toString():"res-"+k.toString()}function q(){return "not-"+(++o).toString()}function W(k,G){ve.Message.isRequest(G)?k.set(ae(G.id),G):ve.Message.isResponse(G)?k.set(ye(G.id),G):k.set(q(),G);}function me(k){}function pe(){return Z===Fr.Listening}function we(){return Z===Fr.Closed}function Xe(){return Z===Fr.Disposed}function Ke(){(Z===Fr.New||Z===Fr.Listening)&&(Z=Fr.Closed,U.fire(void 0));}function Pt(k){K.fire([k,void 0,void 0]);}function Lr(k){K.fire(k);}t.onClose(Ke),t.onError(Pt),e.onClose(Ke),e.onError(Lr);function Ut(){w||E.size===0||(w=(0, IT.default)().timer.setImmediate(()=>{w=void 0,Ce();}));}function St(k){ve.Message.isRequest(k)?fn(k):ve.Message.isNotification(k)?Me(k):ve.Message.isResponse(k)?ce(k):ie(k);}function Ce(){if(E.size===0)return;let k=E.shift();try{let G=n?.messageStrategy;ac.is(G)?G.handleMessage(k,St):St(k);}finally{Ut();}}let Cr=k=>{try{if(ve.Message.isNotification(k)&&k.method===xo.type.method){let G=k.params.id,se=ae(G),fe=E.get(se);if(ve.Message.isRequest(fe)){let ke=n?.connectionStrategy,ze=ke&&ke.cancelUndispatched?ke.cancelUndispatched(fe,me):void 0;if(ze&&(ze.error!==void 0||ze.result!==void 0)){E.delete(se),g.delete(G),ze.id=fe.id,He(ze,k.method,Date.now()),e.write(ze).catch(()=>i.error("Sending response for canceled message failed."));return}}let qe=g.get(G);if(qe!==void 0){qe.cancel(),Nt(k);return}else D.add(G);}W(E,k);}finally{Ut();}};function fn(k){if(Xe())return;function G(Te,We,Ie){let et={jsonrpc:l,id:k.id};Te instanceof ve.ResponseError?et.error=Te.toJson():et.result=Te===void 0?null:Te,He(et,We,Ie),e.write(et).catch(()=>i.error("Sending response failed."));}function se(Te,We,Ie){let et={jsonrpc:l,id:k.id,error:Te.toJson()};He(et,We,Ie),e.write(et).catch(()=>i.error("Sending response failed."));}function fe(Te,We,Ie){Te===void 0&&(Te=null);let et={jsonrpc:l,id:k.id,result:Te};He(et,We,Ie),e.write(et).catch(()=>i.error("Sending response failed."));}fr(k);let qe=c.get(k.method),ke,ze;qe&&(ke=qe.type,ze=qe.handler);let Ze=Date.now();if(ze||d){let Te=k.id??String(Date.now()),We=nc.is(te.receiver)?te.receiver.createCancellationTokenSource(Te):te.receiver.createCancellationTokenSource(k);k.id!==null&&D.has(k.id)&&We.cancel(),k.id!==null&&g.set(Te,We);try{let Ie;if(ze)if(k.params===void 0){if(ke!==void 0&&ke.numberOfParams!==0){se(new ve.ResponseError(ve.ErrorCodes.InvalidParams,`Request ${k.method} defines ${ke.numberOfParams} params but received none.`),k.method,Ze);return}Ie=ze(We.token);}else if(Array.isArray(k.params)){if(ke!==void 0&&ke.parameterStructures===ve.ParameterStructures.byName){se(new ve.ResponseError(ve.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by name but received parameters by position`),k.method,Ze);return}Ie=ze(...k.params,We.token);}else {if(ke!==void 0&&ke.parameterStructures===ve.ParameterStructures.byPosition){se(new ve.ResponseError(ve.ErrorCodes.InvalidParams,`Request ${k.method} defines parameters by position but received parameters by name`),k.method,Ze);return}Ie=ze(k.params,We.token);}else d&&(Ie=d(k.method,k.params,We.token));let et=Ie;Ie?et.then?et.then(ut=>{g.delete(Te),G(ut,k.method,Ze);},ut=>{g.delete(Te),ut instanceof ve.ResponseError?se(ut,k.method,Ze):ut&&st.string(ut.message)?se(new ve.ResponseError(ve.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${ut.message}`),k.method,Ze):se(new ve.ResponseError(ve.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,Ze);}):(g.delete(Te),G(Ie,k.method,Ze)):(g.delete(Te),fe(Ie,k.method,Ze));}catch(Ie){g.delete(Te),Ie instanceof ve.ResponseError?G(Ie,k.method,Ze):Ie&&st.string(Ie.message)?se(new ve.ResponseError(ve.ErrorCodes.InternalError,`Request ${k.method} failed with message: ${Ie.message}`),k.method,Ze):se(new ve.ResponseError(ve.ErrorCodes.InternalError,`Request ${k.method} failed unexpectedly without providing any details.`),k.method,Ze);}}else se(new ve.ResponseError(ve.ErrorCodes.MethodNotFound,`Unhandled method ${k.method}`),k.method,Ze);}function ce(k){if(!Xe())if(k.id===null)k.error?i.error(`Received response message without id: Error is: +${JSON.stringify(k.error,void 0,4)}`):i.error("Received response message without id. No further error information provided.");else {let G=k.id,se=P.get(G);if(Hn(k,se),se!==void 0){P.delete(G);try{if(k.error){let fe=k.error;se.reject(new ve.ResponseError(fe.code,fe.message,fe.data));}else if(k.result!==void 0)se.resolve(k.result);else throw new Error("Should never happen.")}catch(fe){fe.message?i.error(`Response handler '${se.method}' failed with message: ${fe.message}`):i.error(`Response handler '${se.method}' failed unexpectedly.`);}}}}function Me(k){if(Xe())return;let G,se;if(k.method===xo.type.method){let fe=k.params.id;D.delete(fe),Nt(k);return}else {let fe=m.get(k.method);fe&&(se=fe.handler,G=fe.type);}if(se||p)try{if(Nt(k),se)if(k.params===void 0)G!==void 0&&G.numberOfParams!==0&&G.parameterStructures!==ve.ParameterStructures.byName&&i.error(`Notification ${k.method} defines ${G.numberOfParams} params but received none.`),se();else if(Array.isArray(k.params)){let fe=k.params;k.method===Ro.type.method&&fe.length===2&&lm.is(fe[0])?se({token:fe[0],value:fe[1]}):(G!==void 0&&(G.parameterStructures===ve.ParameterStructures.byName&&i.error(`Notification ${k.method} defines parameters by name but received parameters by position`),G.numberOfParams!==k.params.length&&i.error(`Notification ${k.method} defines ${G.numberOfParams} params but received ${fe.length} arguments`)),se(...fe));}else G!==void 0&&G.parameterStructures===ve.ParameterStructures.byPosition&&i.error(`Notification ${k.method} defines parameters by position but received parameters by name`),se(k.params);else p&&p(k.method,k.params);}catch(fe){fe.message?i.error(`Notification handler '${k.method}' failed with message: ${fe.message}`):i.error(`Notification handler '${k.method}' failed unexpectedly.`);}else B.fire(k);}function ie(k){if(!k){i.error("Received empty message.");return}i.error(`Received message which is neither a response nor a notification message: +${JSON.stringify(k,null,4)}`);let G=k;if(st.string(G.id)||st.number(G.id)){let se=G.id,fe=P.get(se);fe&&fe.reject(new Error("The received response has neither a result nor an error property."));}}function be(k){if(k!=null)switch(S){case Le.Verbose:return JSON.stringify(k,null,4);case Le.Compact:return JSON.stringify(k);default:return}}function $e(k){if(!(S===Le.Off||!L))if(I===cr.Text){let G;(S===Le.Verbose||S===Le.Compact)&&k.params&&(G=`Params: ${be(k.params)} + +`),L.log(`Sending request '${k.method} - (${k.id})'.`,G);}else qt("send-request",k);}function ot(k){if(!(S===Le.Off||!L))if(I===cr.Text){let G;(S===Le.Verbose||S===Le.Compact)&&(k.params?G=`Params: ${be(k.params)} + +`:G=`No parameters provided. + +`),L.log(`Sending notification '${k.method}'.`,G);}else qt("send-notification",k);}function He(k,G,se){if(!(S===Le.Off||!L))if(I===cr.Text){let fe;(S===Le.Verbose||S===Le.Compact)&&(k.error&&k.error.data?fe=`Error data: ${be(k.error.data)} + +`:k.result?fe=`Result: ${be(k.result)} + +`:k.error===void 0&&(fe=`No result returned. + +`)),L.log(`Sending response '${G} - (${k.id})'. Processing request took ${Date.now()-se}ms`,fe);}else qt("send-response",k);}function fr(k){if(!(S===Le.Off||!L))if(I===cr.Text){let G;(S===Le.Verbose||S===Le.Compact)&&k.params&&(G=`Params: ${be(k.params)} + +`),L.log(`Received request '${k.method} - (${k.id})'.`,G);}else qt("receive-request",k);}function Nt(k){if(!(S===Le.Off||!L||k.method===rc.type.method))if(I===cr.Text){let G;(S===Le.Verbose||S===Le.Compact)&&(k.params?G=`Params: ${be(k.params)} + +`:G=`No parameters provided. + +`),L.log(`Received notification '${k.method}'.`,G);}else qt("receive-notification",k);}function Hn(k,G){if(!(S===Le.Off||!L))if(I===cr.Text){let se;if((S===Le.Verbose||S===Le.Compact)&&(k.error&&k.error.data?se=`Error data: ${be(k.error.data)} + +`:k.result?se=`Result: ${be(k.result)} + +`:k.error===void 0&&(se=`No result returned. + +`)),G){let fe=k.error?` Request failed: ${k.error.message} (${k.error.code}).`:"";L.log(`Received response '${G.method} - (${k.id})' in ${Date.now()-G.timerStart}ms.${fe}`,se);}else L.log(`Received response ${k.id} without active response promise.`,se);}else qt("receive-response",k);}function qt(k,G){if(!L||S===Le.Off)return;let se={isLSPMessage:!0,type:k,message:G,timestamp:Date.now()};L.log(se);}function zt(){if(we())throw new ss(Co.Closed,"Connection is closed.");if(Xe())throw new ss(Co.Disposed,"Connection is disposed.")}function Wn(){if(pe())throw new ss(Co.AlreadyListening,"Connection is already listening")}function yi(){if(!pe())throw new Error("Call listen() first.")}function tr(k){return k===void 0?null:k}function Bn(k){if(k!==null)return k}function Un(k){return k!=null&&!Array.isArray(k)&&typeof k=="object"}function Yr(k,G){switch(k){case ve.ParameterStructures.auto:return Un(G)?Bn(G):[tr(G)];case ve.ParameterStructures.byName:if(!Un(G))throw new Error("Received parameters by name but param is not an object literal.");return Bn(G);case ve.ParameterStructures.byPosition:return [tr(G)];default:throw new Error(`Unknown parameter structure ${k.toString()}`)}}function zn(k,G){let se,fe=k.numberOfParams;switch(fe){case 0:se=void 0;break;case 1:se=Yr(k.parameterStructures,G[0]);break;default:se=[];for(let qe=0;qe{zt();let se,fe;if(st.string(k)){se=k;let ke=G[0],ze=0,Ze=ve.ParameterStructures.auto;ve.ParameterStructures.is(ke)&&(ze=1,Ze=ke);let Te=G.length,We=Te-ze;switch(We){case 0:fe=void 0;break;case 1:fe=Yr(Ze,G[ze]);break;default:if(Ze===ve.ParameterStructures.byName)throw new Error(`Received ${We} parameters for 'by Name' notification parameter structure.`);fe=G.slice(ze,Te).map(Ie=>tr(Ie));break}}else {let ke=G;se=k.method,fe=zn(k,ke);}let qe={jsonrpc:l,method:se,params:fe};return ot(qe),e.write(qe).catch(ke=>{throw i.error("Sending notification failed."),ke})},onNotification:(k,G)=>{zt();let se;return st.func(k)?p=k:G&&(st.string(k)?(se=k,m.set(k,{type:void 0,handler:G})):(se=k.method,m.set(k.method,{type:k,handler:G}))),{dispose:()=>{se!==void 0?m.delete(se):p=void 0;}}},onProgress:(k,G,se)=>{if(_.has(G))throw new Error(`Progress handler for token ${G} already registered`);return _.set(G,se),{dispose:()=>{_.delete(G);}}},sendProgress:(k,G,se)=>xr.sendNotification(Ro.type,{token:G,value:se}),onUnhandledProgress:Q.event,sendRequest:(k,...G)=>{zt(),yi();let se,fe,qe;if(st.string(k)){se=k;let Te=G[0],We=G[G.length-1],Ie=0,et=ve.ParameterStructures.auto;ve.ParameterStructures.is(Te)&&(Ie=1,et=Te);let ut=G.length;cm.CancellationToken.is(We)&&(ut=ut-1,qe=We);let Lt=ut-Ie;switch(Lt){case 0:fe=void 0;break;case 1:fe=Yr(et,G[Ie]);break;default:if(et===ve.ParameterStructures.byName)throw new Error(`Received ${Lt} parameters for 'by Name' request parameter structure.`);fe=G.slice(Ie,ut).map(bi=>tr(bi));break}}else {let Te=G;se=k.method,fe=zn(k,Te);let We=k.numberOfParams;qe=cm.CancellationToken.is(Te[We])?Te[We]:void 0;}let ke=s++,ze;qe&&(ze=qe.onCancellationRequested(()=>{let Te=te.sender.sendCancellation(xr,ke);return Te===void 0?(i.log(`Received no promise from cancellation strategy when cancelling id ${ke}`),Promise.resolve()):Te.catch(()=>{i.log(`Sending cancellation messages for id ${ke} failed`);})}));let Ze={jsonrpc:l,id:ke,method:se,params:fe};return $e(Ze),typeof te.sender.enableCancellation=="function"&&te.sender.enableCancellation(Ze),new Promise(async(Te,We)=>{let Ie=Lt=>{Te(Lt),te.sender.cleanup(ke),ze?.dispose();},et=Lt=>{We(Lt),te.sender.cleanup(ke),ze?.dispose();},ut={method:se,timerStart:Date.now(),resolve:Ie,reject:et};try{await e.write(Ze),P.set(ke,ut);}catch(Lt){throw i.error("Sending request failed."),ut.reject(new ve.ResponseError(ve.ErrorCodes.MessageWriteError,Lt.message?Lt.message:"Unknown reason")),Lt}})},onRequest:(k,G)=>{zt();let se=null;return dm.is(k)?(se=void 0,d=k):st.string(k)?(se=null,G!==void 0&&(se=k,c.set(k,{handler:G,type:void 0}))):G!==void 0&&(se=k.method,c.set(k.method,{type:k,handler:G})),{dispose:()=>{se!==null&&(se!==void 0?c.delete(se):d=void 0);}}},hasPendingResponse:()=>P.size>0,trace:async(k,G,se)=>{let fe=!1,qe=cr.Text;se!==void 0&&(st.boolean(se)?fe=se:(fe=se.sendNotification||!1,qe=se.traceFormat||cr.Text)),S=k,I=qe,S===Le.Off?L=void 0:L=G,fe&&!we()&&!Xe()&&await xr.sendNotification(hm.type,{value:Le.toString(k)});},onError:K.event,onClose:U.event,onUnhandledNotification:B.event,onDispose:N.event,end:()=>{e.end();},dispose:()=>{if(Xe())return;Z=Fr.Disposed,N.fire(void 0);let k=new ve.ResponseError(ve.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(let G of P.values())G.reject(k);P=new Map,g=new Map,D=new Set,E=new kT.LinkedMap,st.func(e.dispose)&&e.dispose(),st.func(t.dispose)&&t.dispose();},listen:()=>{zt(),Wn(),Z=Fr.Listening,t.listen(Cr);},inspect:()=>{(0, IT.default)().console.log("inspect");}};return xr.onNotification(rc.type,k=>{if(S===Le.Off||!L)return;let G=S===Le.Verbose||S===Le.Compact;L.log(k.message,G?k.verbose:void 0);}),xr.onNotification(Ro.type,k=>{let G=_.get(k.token);G?G(k.value):Q.fire(k);}),xr}xe.createMessageConnection=j3;});var uc=A(z=>{Object.defineProperty(z,"__esModule",{value:!0});z.ProgressType=z.ProgressToken=z.createMessageConnection=z.NullLogger=z.ConnectionOptions=z.ConnectionStrategy=z.AbstractMessageBuffer=z.WriteableStreamMessageWriter=z.AbstractMessageWriter=z.MessageWriter=z.ReadableStreamMessageReader=z.AbstractMessageReader=z.MessageReader=z.SharedArrayReceiverStrategy=z.SharedArraySenderStrategy=z.CancellationToken=z.CancellationTokenSource=z.Emitter=z.Event=z.Disposable=z.LRUCache=z.Touch=z.LinkedMap=z.ParameterStructures=z.NotificationType9=z.NotificationType8=z.NotificationType7=z.NotificationType6=z.NotificationType5=z.NotificationType4=z.NotificationType3=z.NotificationType2=z.NotificationType1=z.NotificationType0=z.NotificationType=z.ErrorCodes=z.ResponseError=z.RequestType9=z.RequestType8=z.RequestType7=z.RequestType6=z.RequestType5=z.RequestType4=z.RequestType3=z.RequestType2=z.RequestType1=z.RequestType0=z.RequestType=z.Message=z.RAL=void 0;z.MessageStrategy=z.CancellationStrategy=z.CancellationSenderStrategy=z.CancellationReceiverStrategy=z.ConnectionError=z.ConnectionErrors=z.LogTraceNotification=z.SetTraceNotification=z.TraceFormat=z.TraceValues=z.Trace=void 0;var Ye=Hp();Object.defineProperty(z,"Message",{enumerable:!0,get:function(){return Ye.Message}});Object.defineProperty(z,"RequestType",{enumerable:!0,get:function(){return Ye.RequestType}});Object.defineProperty(z,"RequestType0",{enumerable:!0,get:function(){return Ye.RequestType0}});Object.defineProperty(z,"RequestType1",{enumerable:!0,get:function(){return Ye.RequestType1}});Object.defineProperty(z,"RequestType2",{enumerable:!0,get:function(){return Ye.RequestType2}});Object.defineProperty(z,"RequestType3",{enumerable:!0,get:function(){return Ye.RequestType3}});Object.defineProperty(z,"RequestType4",{enumerable:!0,get:function(){return Ye.RequestType4}});Object.defineProperty(z,"RequestType5",{enumerable:!0,get:function(){return Ye.RequestType5}});Object.defineProperty(z,"RequestType6",{enumerable:!0,get:function(){return Ye.RequestType6}});Object.defineProperty(z,"RequestType7",{enumerable:!0,get:function(){return Ye.RequestType7}});Object.defineProperty(z,"RequestType8",{enumerable:!0,get:function(){return Ye.RequestType8}});Object.defineProperty(z,"RequestType9",{enumerable:!0,get:function(){return Ye.RequestType9}});Object.defineProperty(z,"ResponseError",{enumerable:!0,get:function(){return Ye.ResponseError}});Object.defineProperty(z,"ErrorCodes",{enumerable:!0,get:function(){return Ye.ErrorCodes}});Object.defineProperty(z,"NotificationType",{enumerable:!0,get:function(){return Ye.NotificationType}});Object.defineProperty(z,"NotificationType0",{enumerable:!0,get:function(){return Ye.NotificationType0}});Object.defineProperty(z,"NotificationType1",{enumerable:!0,get:function(){return Ye.NotificationType1}});Object.defineProperty(z,"NotificationType2",{enumerable:!0,get:function(){return Ye.NotificationType2}});Object.defineProperty(z,"NotificationType3",{enumerable:!0,get:function(){return Ye.NotificationType3}});Object.defineProperty(z,"NotificationType4",{enumerable:!0,get:function(){return Ye.NotificationType4}});Object.defineProperty(z,"NotificationType5",{enumerable:!0,get:function(){return Ye.NotificationType5}});Object.defineProperty(z,"NotificationType6",{enumerable:!0,get:function(){return Ye.NotificationType6}});Object.defineProperty(z,"NotificationType7",{enumerable:!0,get:function(){return Ye.NotificationType7}});Object.defineProperty(z,"NotificationType8",{enumerable:!0,get:function(){return Ye.NotificationType8}});Object.defineProperty(z,"NotificationType9",{enumerable:!0,get:function(){return Ye.NotificationType9}});Object.defineProperty(z,"ParameterStructures",{enumerable:!0,get:function(){return Ye.ParameterStructures}});var gm=Bp();Object.defineProperty(z,"LinkedMap",{enumerable:!0,get:function(){return gm.LinkedMap}});Object.defineProperty(z,"LRUCache",{enumerable:!0,get:function(){return gm.LRUCache}});Object.defineProperty(z,"Touch",{enumerable:!0,get:function(){return gm.Touch}});var H3=wT();Object.defineProperty(z,"Disposable",{enumerable:!0,get:function(){return H3.Disposable}});var qT=ts();Object.defineProperty(z,"Event",{enumerable:!0,get:function(){return qT.Event}});Object.defineProperty(z,"Emitter",{enumerable:!0,get:function(){return qT.Emitter}});var LT=Yu();Object.defineProperty(z,"CancellationTokenSource",{enumerable:!0,get:function(){return LT.CancellationTokenSource}});Object.defineProperty(z,"CancellationToken",{enumerable:!0,get:function(){return LT.CancellationToken}});var $T=ET();Object.defineProperty(z,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return $T.SharedArraySenderStrategy}});Object.defineProperty(z,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return $T.SharedArrayReceiverStrategy}});var _m=CT();Object.defineProperty(z,"MessageReader",{enumerable:!0,get:function(){return _m.MessageReader}});Object.defineProperty(z,"AbstractMessageReader",{enumerable:!0,get:function(){return _m.AbstractMessageReader}});Object.defineProperty(z,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return _m.ReadableStreamMessageReader}});var ym=DT();Object.defineProperty(z,"MessageWriter",{enumerable:!0,get:function(){return ym.MessageWriter}});Object.defineProperty(z,"AbstractMessageWriter",{enumerable:!0,get:function(){return ym.AbstractMessageWriter}});Object.defineProperty(z,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return ym.WriteableStreamMessageWriter}});var W3=OT();Object.defineProperty(z,"AbstractMessageBuffer",{enumerable:!0,get:function(){return W3.AbstractMessageBuffer}});var At=NT();Object.defineProperty(z,"ConnectionStrategy",{enumerable:!0,get:function(){return At.ConnectionStrategy}});Object.defineProperty(z,"ConnectionOptions",{enumerable:!0,get:function(){return At.ConnectionOptions}});Object.defineProperty(z,"NullLogger",{enumerable:!0,get:function(){return At.NullLogger}});Object.defineProperty(z,"createMessageConnection",{enumerable:!0,get:function(){return At.createMessageConnection}});Object.defineProperty(z,"ProgressToken",{enumerable:!0,get:function(){return At.ProgressToken}});Object.defineProperty(z,"ProgressType",{enumerable:!0,get:function(){return At.ProgressType}});Object.defineProperty(z,"Trace",{enumerable:!0,get:function(){return At.Trace}});Object.defineProperty(z,"TraceValues",{enumerable:!0,get:function(){return At.TraceValues}});Object.defineProperty(z,"TraceFormat",{enumerable:!0,get:function(){return At.TraceFormat}});Object.defineProperty(z,"SetTraceNotification",{enumerable:!0,get:function(){return At.SetTraceNotification}});Object.defineProperty(z,"LogTraceNotification",{enumerable:!0,get:function(){return At.LogTraceNotification}});Object.defineProperty(z,"ConnectionErrors",{enumerable:!0,get:function(){return At.ConnectionErrors}});Object.defineProperty(z,"ConnectionError",{enumerable:!0,get:function(){return At.ConnectionError}});Object.defineProperty(z,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return At.CancellationReceiverStrategy}});Object.defineProperty(z,"CancellationSenderStrategy",{enumerable:!0,get:function(){return At.CancellationSenderStrategy}});Object.defineProperty(z,"CancellationStrategy",{enumerable:!0,get:function(){return At.CancellationStrategy}});Object.defineProperty(z,"MessageStrategy",{enumerable:!0,get:function(){return At.MessageStrategy}});var B3=Dn();z.RAL=B3.default;});var WT=A(Sm=>{Object.defineProperty(Sm,"__esModule",{value:!0});var jT=oe("util"),cn=uc(),cc=class t extends cn.AbstractMessageBuffer{constructor(e="utf-8"){super(e);}emptyBuffer(){return t.emptyBuffer}fromString(e,r){return Buffer.from(e,r)}toString(e,r){return e instanceof Buffer?e.toString(r):new jT.TextDecoder(r).decode(e)}asNative(e,r){return r===void 0?e instanceof Buffer?e:Buffer.from(e):e instanceof Buffer?e.slice(0,r):Buffer.from(e,0,r)}allocNative(e){return Buffer.allocUnsafe(e)}};cc.emptyBuffer=Buffer.allocUnsafe(0);var bm=class{constructor(e){this.stream=e;}onClose(e){return this.stream.on("close",e),cn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),cn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),cn.Disposable.create(()=>this.stream.off("end",e))}onData(e){return this.stream.on("data",e),cn.Disposable.create(()=>this.stream.off("data",e))}},vm=class{constructor(e){this.stream=e;}onClose(e){return this.stream.on("close",e),cn.Disposable.create(()=>this.stream.off("close",e))}onError(e){return this.stream.on("error",e),cn.Disposable.create(()=>this.stream.off("error",e))}onEnd(e){return this.stream.on("end",e),cn.Disposable.create(()=>this.stream.off("end",e))}write(e,r){return new Promise((n,i)=>{let s=o=>{o==null?n():i(o);};typeof e=="string"?this.stream.write(e,r,s):this.stream.write(e,s);})}end(){this.stream.end();}},HT=Object.freeze({messageBuffer:Object.freeze({create:t=>new cc(t)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(t,e)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(t,void 0,0),e.charset))}catch(r){return Promise.reject(r)}}}),decoder:Object.freeze({name:"application/json",decode:(t,e)=>{try{return t instanceof Buffer?Promise.resolve(JSON.parse(t.toString(e.charset))):Promise.resolve(JSON.parse(new jT.TextDecoder(e.charset).decode(t)))}catch(r){return Promise.reject(r)}}})}),stream:Object.freeze({asReadableStream:t=>new bm(t),asWritableStream:t=>new vm(t)}),console,timer:Object.freeze({setTimeout(t,e,...r){let n=setTimeout(t,e,...r);return {dispose:()=>clearTimeout(n)}},setImmediate(t,...e){let r=setImmediate(t,...e);return {dispose:()=>clearImmediate(r)}},setInterval(t,e,...r){let n=setInterval(t,e,...r);return {dispose:()=>clearInterval(n)}}})});function wm(){return HT}(function(t){function e(){cn.RAL.install(HT);}t.install=e;})(wm||(wm={}));Sm.default=wm;});var hi=A(Oe=>{var U3=Oe&&Oe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i);}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r];}),z3=Oe&&Oe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&U3(e,t,r);};Object.defineProperty(Oe,"__esModule",{value:!0});Oe.createMessageConnection=Oe.createServerSocketTransport=Oe.createClientSocketTransport=Oe.createServerPipeTransport=Oe.createClientPipeTransport=Oe.generateRandomPipeName=Oe.StreamMessageWriter=Oe.StreamMessageReader=Oe.SocketMessageWriter=Oe.SocketMessageReader=Oe.PortMessageWriter=Oe.PortMessageReader=Oe.IPCMessageWriter=Oe.IPCMessageReader=void 0;var os=WT();os.default.install();var BT=oe("path"),V3=oe("os"),G3=oe("crypto"),dc=oe("net"),lr=uc();z3(uc(),Oe);var Em=class extends lr.AbstractMessageReader{constructor(e){super(),this.process=e;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose());}listen(e){return this.process.on("message",e),lr.Disposable.create(()=>this.process.off("message",e))}};Oe.IPCMessageReader=Em;var Rm=class extends lr.AbstractMessageWriter{constructor(e){super(),this.process=e,this.errorCount=0;let r=this.process;r.on("error",n=>this.fireError(n)),r.on("close",()=>this.fireClose);}write(e){try{return typeof this.process.send=="function"&&this.process.send(e,void 0,void 0,r=>{r?(this.errorCount++,this.handleError(r,e)):this.errorCount=0;}),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount);}end(){}};Oe.IPCMessageWriter=Rm;var Cm=class extends lr.AbstractMessageReader{constructor(e){super(),this.onData=new lr.Emitter,e.on("close",()=>this.fireClose),e.on("error",r=>this.fireError(r)),e.on("message",r=>{this.onData.fire(r);});}listen(e){return this.onData.event(e)}};Oe.PortMessageReader=Cm;var xm=class extends lr.AbstractMessageWriter{constructor(e){super(),this.port=e,this.errorCount=0,e.on("close",()=>this.fireClose()),e.on("error",r=>this.fireError(r));}write(e){try{return this.port.postMessage(e),Promise.resolve()}catch(r){return this.handleError(r,e),Promise.reject(r)}}handleError(e,r){this.errorCount++,this.fireError(e,r,this.errorCount);}end(){}};Oe.PortMessageWriter=xm;var fi=class extends lr.ReadableStreamMessageReader{constructor(e,r="utf-8"){super((0, os.default)().stream.asReadableStream(e),r);}};Oe.SocketMessageReader=fi;var di=class extends lr.WriteableStreamMessageWriter{constructor(e,r){super((0, os.default)().stream.asWritableStream(e),r),this.socket=e;}dispose(){super.dispose(),this.socket.destroy();}};Oe.SocketMessageWriter=di;var lc=class extends lr.ReadableStreamMessageReader{constructor(e,r){super((0, os.default)().stream.asReadableStream(e),r);}};Oe.StreamMessageReader=lc;var fc=class extends lr.WriteableStreamMessageWriter{constructor(e,r){super((0, os.default)().stream.asWritableStream(e),r);}};Oe.StreamMessageWriter=fc;var UT=process.env.XDG_RUNTIME_DIR,K3=new Map([["linux",107],["darwin",103]]);function Z3(){let t=(0, G3.randomBytes)(21).toString("hex");if(process.platform==="win32")return `\\\\.\\pipe\\vscode-jsonrpc-${t}-sock`;let e;UT?e=BT.join(UT,`vscode-ipc-${t}.sock`):e=BT.join(V3.tmpdir(),`vscode-${t}.sock`);let r=K3.get(process.platform);return r!==void 0&&e.length>r&&(0, os.default)().console.warn(`WARNING: IPC handle "${e}" is longer than ${r} characters.`),e}Oe.generateRandomPipeName=Z3;function J3(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i;});return new Promise((i,s)=>{let o=(0, dc.createServer)(a=>{o.close(),r([new fi(a,e),new di(a,e)]);});o.on("error",s),o.listen(t,()=>{o.removeListener("error",s),i({onConnected:()=>n});});})}Oe.createClientPipeTransport=J3;function Y3(t,e="utf-8"){let r=(0, dc.createConnection)(t);return [new fi(r,e),new di(r,e)]}Oe.createServerPipeTransport=Y3;function X3(t,e="utf-8"){let r,n=new Promise((i,s)=>{r=i;});return new Promise((i,s)=>{let o=(0, dc.createServer)(a=>{o.close(),r([new fi(a,e),new di(a,e)]);});o.on("error",s),o.listen(t,"127.0.0.1",()=>{o.removeListener("error",s),i({onConnected:()=>n});});})}Oe.createClientSocketTransport=X3;function Q3(t,e="utf-8"){let r=(0, dc.createConnection)(t,"127.0.0.1");return [new fi(r,e),new di(r,e)]}Oe.createServerSocketTransport=Q3;function e4(t){let e=t;return e.read!==void 0&&e.addListener!==void 0}function t4(t){let e=t;return e.write!==void 0&&e.addListener!==void 0}function r4(t,e,r,n){r||(r=lr.NullLogger);let i=e4(t)?new lc(t):t,s=t4(e)?new fc(e):e;return lr.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0, lr.createMessageConnection)(i,s,r,n)}Oe.createMessageConnection=r4;});var Tm=A((TK,zT)=>{zT.exports=hi();});var pc=A((VT,hc)=>{(function(t){if(typeof hc=="object"&&typeof hc.exports=="object"){var e=t(oe,VT);e!==void 0&&(hc.exports=e);}else typeof define=="function"&&define.amd&&define(["require","exports"],t);})(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.TextDocument=e.EOL=e.WorkspaceFolder=e.InlineCompletionContext=e.SelectedCompletionInfo=e.InlineCompletionTriggerKind=e.InlineCompletionList=e.InlineCompletionItem=e.StringValue=e.InlayHint=e.InlayHintLabelPart=e.InlayHintKind=e.InlineValueContext=e.InlineValueEvaluatableExpression=e.InlineValueVariableLookup=e.InlineValueText=e.SemanticTokens=e.SemanticTokenModifiers=e.SemanticTokenTypes=e.SelectionRange=e.DocumentLink=e.FormattingOptions=e.CodeLens=e.CodeAction=e.CodeActionContext=e.CodeActionTriggerKind=e.CodeActionKind=e.DocumentSymbol=e.WorkspaceSymbol=e.SymbolInformation=e.SymbolTag=e.SymbolKind=e.DocumentHighlight=e.DocumentHighlightKind=e.SignatureInformation=e.ParameterInformation=e.Hover=e.MarkedString=e.CompletionList=e.CompletionItem=e.CompletionItemLabelDetails=e.InsertTextMode=e.InsertReplaceEdit=e.CompletionItemTag=e.InsertTextFormat=e.CompletionItemKind=e.MarkupContent=e.MarkupKind=e.TextDocumentItem=e.OptionalVersionedTextDocumentIdentifier=e.VersionedTextDocumentIdentifier=e.TextDocumentIdentifier=e.WorkspaceChange=e.WorkspaceEdit=e.DeleteFile=e.RenameFile=e.CreateFile=e.TextDocumentEdit=e.AnnotatedTextEdit=e.ChangeAnnotationIdentifier=e.ChangeAnnotation=e.TextEdit=e.Command=e.Diagnostic=e.CodeDescription=e.DiagnosticTag=e.DiagnosticSeverity=e.DiagnosticRelatedInformation=e.FoldingRange=e.FoldingRangeKind=e.ColorPresentation=e.ColorInformation=e.Color=e.LocationLink=e.Location=e.Range=e.Position=e.uinteger=e.integer=e.URI=e.DocumentUri=void 0;var r;(function(v){function M(F){return typeof F=="string"}v.is=M;})(r||(e.DocumentUri=r={}));var n;(function(v){function M(F){return typeof F=="string"}v.is=M;})(n||(e.URI=n={}));var i;(function(v){v.MIN_VALUE=-2147483648,v.MAX_VALUE=2147483647;function M(F){return typeof F=="number"&&v.MIN_VALUE<=F&&F<=v.MAX_VALUE}v.is=M;})(i||(e.integer=i={}));var s;(function(v){v.MIN_VALUE=0,v.MAX_VALUE=2147483647;function M(F){return typeof F=="number"&&v.MIN_VALUE<=F&&F<=v.MAX_VALUE}v.is=M;})(s||(e.uinteger=s={}));var o;(function(v){function M(R,y){return R===Number.MAX_VALUE&&(R=s.MAX_VALUE),y===Number.MAX_VALUE&&(y=s.MAX_VALUE),{line:R,character:y}}v.create=M;function F(R){var y=R;return j.objectLiteral(y)&&j.uinteger(y.line)&&j.uinteger(y.character)}v.is=F;})(o||(e.Position=o={}));var a;(function(v){function M(R,y,$,J){if(j.uinteger(R)&&j.uinteger(y)&&j.uinteger($)&&j.uinteger(J))return {start:o.create(R,y),end:o.create($,J)};if(o.is(R)&&o.is(y))return {start:R,end:y};throw new Error("Range#create called with invalid arguments[".concat(R,", ").concat(y,", ").concat($,", ").concat(J,"]"))}v.create=M;function F(R){var y=R;return j.objectLiteral(y)&&o.is(y.start)&&o.is(y.end)}v.is=F;})(a||(e.Range=a={}));var l;(function(v){function M(R,y){return {uri:R,range:y}}v.create=M;function F(R){var y=R;return j.objectLiteral(y)&&a.is(y.range)&&(j.string(y.uri)||j.undefined(y.uri))}v.is=F;})(l||(e.Location=l={}));var d;(function(v){function M(R,y,$,J){return {targetUri:R,targetRange:y,targetSelectionRange:$,originSelectionRange:J}}v.create=M;function F(R){var y=R;return j.objectLiteral(y)&&a.is(y.targetRange)&&j.string(y.targetUri)&&a.is(y.targetSelectionRange)&&(a.is(y.originSelectionRange)||j.undefined(y.originSelectionRange))}v.is=F;})(d||(e.LocationLink=d={}));var c;(function(v){function M(R,y,$,J){return {red:R,green:y,blue:$,alpha:J}}v.create=M;function F(R){var y=R;return j.objectLiteral(y)&&j.numberRange(y.red,0,1)&&j.numberRange(y.green,0,1)&&j.numberRange(y.blue,0,1)&&j.numberRange(y.alpha,0,1)}v.is=F;})(c||(e.Color=c={}));var p;(function(v){function M(R,y){return {range:R,color:y}}v.create=M;function F(R){var y=R;return j.objectLiteral(y)&&a.is(y.range)&&c.is(y.color)}v.is=F;})(p||(e.ColorInformation=p={}));var m;(function(v){function M(R,y,$){return {label:R,textEdit:y,additionalTextEdits:$}}v.create=M;function F(R){var y=R;return j.objectLiteral(y)&&j.string(y.label)&&(j.undefined(y.textEdit)||L.is(y))&&(j.undefined(y.additionalTextEdits)||j.typedArray(y.additionalTextEdits,L.is))}v.is=F;})(m||(e.ColorPresentation=m={}));var _;(function(v){v.Comment="comment",v.Imports="imports",v.Region="region";})(_||(e.FoldingRangeKind=_={}));var w;(function(v){function M(R,y,$,J,Ee,tt){var Ve={startLine:R,endLine:y};return j.defined($)&&(Ve.startCharacter=$),j.defined(J)&&(Ve.endCharacter=J),j.defined(Ee)&&(Ve.kind=Ee),j.defined(tt)&&(Ve.collapsedText=tt),Ve}v.create=M;function F(R){var y=R;return j.objectLiteral(y)&&j.uinteger(y.startLine)&&j.uinteger(y.startLine)&&(j.undefined(y.startCharacter)||j.uinteger(y.startCharacter))&&(j.undefined(y.endCharacter)||j.uinteger(y.endCharacter))&&(j.undefined(y.kind)||j.string(y.kind))}v.is=F;})(w||(e.FoldingRange=w={}));var E;(function(v){function M(R,y){return {location:R,message:y}}v.create=M;function F(R){var y=R;return j.defined(y)&&l.is(y.location)&&j.string(y.message)}v.is=F;})(E||(e.DiagnosticRelatedInformation=E={}));var P;(function(v){v.Error=1,v.Warning=2,v.Information=3,v.Hint=4;})(P||(e.DiagnosticSeverity=P={}));var D;(function(v){v.Unnecessary=1,v.Deprecated=2;})(D||(e.DiagnosticTag=D={}));var g;(function(v){function M(F){var R=F;return j.objectLiteral(R)&&j.string(R.href)}v.is=M;})(g||(e.CodeDescription=g={}));var S;(function(v){function M(R,y,$,J,Ee,tt){var Ve={range:R,message:y};return j.defined($)&&(Ve.severity=$),j.defined(J)&&(Ve.code=J),j.defined(Ee)&&(Ve.source=Ee),j.defined(tt)&&(Ve.relatedInformation=tt),Ve}v.create=M;function F(R){var y,$=R;return j.defined($)&&a.is($.range)&&j.string($.message)&&(j.number($.severity)||j.undefined($.severity))&&(j.integer($.code)||j.string($.code)||j.undefined($.code))&&(j.undefined($.codeDescription)||j.string((y=$.codeDescription)===null||y===void 0?void 0:y.href))&&(j.string($.source)||j.undefined($.source))&&(j.undefined($.relatedInformation)||j.typedArray($.relatedInformation,E.is))}v.is=F;})(S||(e.Diagnostic=S={}));var I;(function(v){function M(R,y){for(var $=[],J=2;J0&&(Ee.arguments=$),Ee}v.create=M;function F(R){var y=R;return j.defined(y)&&j.string(y.title)&&j.string(y.command)}v.is=F;})(I||(e.Command=I={}));var L;(function(v){function M($,J){return {range:$,newText:J}}v.replace=M;function F($,J){return {range:{start:$,end:$},newText:J}}v.insert=F;function R($){return {range:$,newText:""}}v.del=R;function y($){var J=$;return j.objectLiteral(J)&&j.string(J.newText)&&a.is(J.range)}v.is=y;})(L||(e.TextEdit=L={}));var Z;(function(v){function M(R,y,$){var J={label:R};return y!==void 0&&(J.needsConfirmation=y),$!==void 0&&(J.description=$),J}v.create=M;function F(R){var y=R;return j.objectLiteral(y)&&j.string(y.label)&&(j.boolean(y.needsConfirmation)||y.needsConfirmation===void 0)&&(j.string(y.description)||y.description===void 0)}v.is=F;})(Z||(e.ChangeAnnotation=Z={}));var K;(function(v){function M(F){var R=F;return j.string(R)}v.is=M;})(K||(e.ChangeAnnotationIdentifier=K={}));var U;(function(v){function M($,J,Ee){return {range:$,newText:J,annotationId:Ee}}v.replace=M;function F($,J,Ee){return {range:{start:$,end:$},newText:J,annotationId:Ee}}v.insert=F;function R($,J){return {range:$,newText:"",annotationId:J}}v.del=R;function y($){var J=$;return L.is(J)&&(Z.is(J.annotationId)||K.is(J.annotationId))}v.is=y;})(U||(e.AnnotatedTextEdit=U={}));var B;(function(v){function M(R,y){return {textDocument:R,edits:y}}v.create=M;function F(R){var y=R;return j.defined(y)&&we.is(y.textDocument)&&Array.isArray(y.edits)}v.is=F;})(B||(e.TextDocumentEdit=B={}));var Q;(function(v){function M(R,y,$){var J={kind:"create",uri:R};return y!==void 0&&(y.overwrite!==void 0||y.ignoreIfExists!==void 0)&&(J.options=y),$!==void 0&&(J.annotationId=$),J}v.create=M;function F(R){var y=R;return y&&y.kind==="create"&&j.string(y.uri)&&(y.options===void 0||(y.options.overwrite===void 0||j.boolean(y.options.overwrite))&&(y.options.ignoreIfExists===void 0||j.boolean(y.options.ignoreIfExists)))&&(y.annotationId===void 0||K.is(y.annotationId))}v.is=F;})(Q||(e.CreateFile=Q={}));var N;(function(v){function M(R,y,$,J){var Ee={kind:"rename",oldUri:R,newUri:y};return $!==void 0&&($.overwrite!==void 0||$.ignoreIfExists!==void 0)&&(Ee.options=$),J!==void 0&&(Ee.annotationId=J),Ee}v.create=M;function F(R){var y=R;return y&&y.kind==="rename"&&j.string(y.oldUri)&&j.string(y.newUri)&&(y.options===void 0||(y.options.overwrite===void 0||j.boolean(y.options.overwrite))&&(y.options.ignoreIfExists===void 0||j.boolean(y.options.ignoreIfExists)))&&(y.annotationId===void 0||K.is(y.annotationId))}v.is=F;})(N||(e.RenameFile=N={}));var te;(function(v){function M(R,y,$){var J={kind:"delete",uri:R};return y!==void 0&&(y.recursive!==void 0||y.ignoreIfNotExists!==void 0)&&(J.options=y),$!==void 0&&(J.annotationId=$),J}v.create=M;function F(R){var y=R;return y&&y.kind==="delete"&&j.string(y.uri)&&(y.options===void 0||(y.options.recursive===void 0||j.boolean(y.options.recursive))&&(y.options.ignoreIfNotExists===void 0||j.boolean(y.options.ignoreIfNotExists)))&&(y.annotationId===void 0||K.is(y.annotationId))}v.is=F;})(te||(e.DeleteFile=te={}));var ae;(function(v){function M(F){var R=F;return R&&(R.changes!==void 0||R.documentChanges!==void 0)&&(R.documentChanges===void 0||R.documentChanges.every(function(y){return j.string(y.kind)?Q.is(y)||N.is(y)||te.is(y):B.is(y)}))}v.is=M;})(ae||(e.WorkspaceEdit=ae={}));var ye=function(){function v(M,F){this.edits=M,this.changeAnnotations=F;}return v.prototype.insert=function(M,F,R){var y,$;if(R===void 0?y=L.insert(M,F):K.is(R)?($=R,y=U.insert(M,F,R)):(this.assertChangeAnnotations(this.changeAnnotations),$=this.changeAnnotations.manage(R),y=U.insert(M,F,$)),this.edits.push(y),$!==void 0)return $},v.prototype.replace=function(M,F,R){var y,$;if(R===void 0?y=L.replace(M,F):K.is(R)?($=R,y=U.replace(M,F,R)):(this.assertChangeAnnotations(this.changeAnnotations),$=this.changeAnnotations.manage(R),y=U.replace(M,F,$)),this.edits.push(y),$!==void 0)return $},v.prototype.delete=function(M,F){var R,y;if(F===void 0?R=L.del(M):K.is(F)?(y=F,R=U.del(M,F)):(this.assertChangeAnnotations(this.changeAnnotations),y=this.changeAnnotations.manage(F),R=U.del(M,y)),this.edits.push(R),y!==void 0)return y},v.prototype.add=function(M){this.edits.push(M);},v.prototype.all=function(){return this.edits},v.prototype.clear=function(){this.edits.splice(0,this.edits.length);},v.prototype.assertChangeAnnotations=function(M){if(M===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},v}(),q=function(){function v(M){this._annotations=M===void 0?Object.create(null):M,this._counter=0,this._size=0;}return v.prototype.all=function(){return this._annotations},Object.defineProperty(v.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),v.prototype.manage=function(M,F){var R;if(K.is(M)?R=M:(R=this.nextId(),F=M),this._annotations[R]!==void 0)throw new Error("Id ".concat(R," is already in use."));if(F===void 0)throw new Error("No annotation provided for id ".concat(R));return this._annotations[R]=F,this._size++,R},v.prototype.nextId=function(){return this._counter++,this._counter.toString()},v}(),W=function(){function v(M){var F=this;this._textEditChanges=Object.create(null),M!==void 0?(this._workspaceEdit=M,M.documentChanges?(this._changeAnnotations=new q(M.changeAnnotations),M.changeAnnotations=this._changeAnnotations.all(),M.documentChanges.forEach(function(R){if(B.is(R)){var y=new ye(R.edits,F._changeAnnotations);F._textEditChanges[R.textDocument.uri]=y;}})):M.changes&&Object.keys(M.changes).forEach(function(R){var y=new ye(M.changes[R]);F._textEditChanges[R]=y;})):this._workspaceEdit={};}return Object.defineProperty(v.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),v.prototype.getTextEditChange=function(M){if(we.is(M)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var F={uri:M.uri,version:M.version},R=this._textEditChanges[F.uri];if(!R){var y=[],$={textDocument:F,edits:y};this._workspaceEdit.documentChanges.push($),R=new ye(y,this._changeAnnotations),this._textEditChanges[F.uri]=R;}return R}else {if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var R=this._textEditChanges[M];if(!R){var y=[];this._workspaceEdit.changes[M]=y,R=new ye(y),this._textEditChanges[M]=R;}return R}},v.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new q,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all());},v.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null));},v.prototype.createFile=function(M,F,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;Z.is(F)||K.is(F)?y=F:R=F;var $,J;if(y===void 0?$=Q.create(M,R):(J=K.is(y)?y:this._changeAnnotations.manage(y),$=Q.create(M,R,J)),this._workspaceEdit.documentChanges.push($),J!==void 0)return J},v.prototype.renameFile=function(M,F,R,y){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var $;Z.is(R)||K.is(R)?$=R:y=R;var J,Ee;if($===void 0?J=N.create(M,F,y):(Ee=K.is($)?$:this._changeAnnotations.manage($),J=N.create(M,F,y,Ee)),this._workspaceEdit.documentChanges.push(J),Ee!==void 0)return Ee},v.prototype.deleteFile=function(M,F,R){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var y;Z.is(F)||K.is(F)?y=F:R=F;var $,J;if(y===void 0?$=te.create(M,R):(J=K.is(y)?y:this._changeAnnotations.manage(y),$=te.create(M,R,J)),this._workspaceEdit.documentChanges.push($),J!==void 0)return J},v}();e.WorkspaceChange=W;var me;(function(v){function M(R){return {uri:R}}v.create=M;function F(R){var y=R;return j.defined(y)&&j.string(y.uri)}v.is=F;})(me||(e.TextDocumentIdentifier=me={}));var pe;(function(v){function M(R,y){return {uri:R,version:y}}v.create=M;function F(R){var y=R;return j.defined(y)&&j.string(y.uri)&&j.integer(y.version)}v.is=F;})(pe||(e.VersionedTextDocumentIdentifier=pe={}));var we;(function(v){function M(R,y){return {uri:R,version:y}}v.create=M;function F(R){var y=R;return j.defined(y)&&j.string(y.uri)&&(y.version===null||j.integer(y.version))}v.is=F;})(we||(e.OptionalVersionedTextDocumentIdentifier=we={}));var Xe;(function(v){function M(R,y,$,J){return {uri:R,languageId:y,version:$,text:J}}v.create=M;function F(R){var y=R;return j.defined(y)&&j.string(y.uri)&&j.string(y.languageId)&&j.integer(y.version)&&j.string(y.text)}v.is=F;})(Xe||(e.TextDocumentItem=Xe={}));var Ke;(function(v){v.PlainText="plaintext",v.Markdown="markdown";function M(F){var R=F;return R===v.PlainText||R===v.Markdown}v.is=M;})(Ke||(e.MarkupKind=Ke={}));var Pt;(function(v){function M(F){var R=F;return j.objectLiteral(F)&&Ke.is(R.kind)&&j.string(R.value)}v.is=M;})(Pt||(e.MarkupContent=Pt={}));var Lr;(function(v){v.Text=1,v.Method=2,v.Function=3,v.Constructor=4,v.Field=5,v.Variable=6,v.Class=7,v.Interface=8,v.Module=9,v.Property=10,v.Unit=11,v.Value=12,v.Enum=13,v.Keyword=14,v.Snippet=15,v.Color=16,v.File=17,v.Reference=18,v.Folder=19,v.EnumMember=20,v.Constant=21,v.Struct=22,v.Event=23,v.Operator=24,v.TypeParameter=25;})(Lr||(e.CompletionItemKind=Lr={}));var Ut;(function(v){v.PlainText=1,v.Snippet=2;})(Ut||(e.InsertTextFormat=Ut={}));var St;(function(v){v.Deprecated=1;})(St||(e.CompletionItemTag=St={}));var Ce;(function(v){function M(R,y,$){return {newText:R,insert:y,replace:$}}v.create=M;function F(R){var y=R;return y&&j.string(y.newText)&&a.is(y.insert)&&a.is(y.replace)}v.is=F;})(Ce||(e.InsertReplaceEdit=Ce={}));var Cr;(function(v){v.asIs=1,v.adjustIndentation=2;})(Cr||(e.InsertTextMode=Cr={}));var fn;(function(v){function M(F){var R=F;return R&&(j.string(R.detail)||R.detail===void 0)&&(j.string(R.description)||R.description===void 0)}v.is=M;})(fn||(e.CompletionItemLabelDetails=fn={}));var ce;(function(v){function M(F){return {label:F}}v.create=M;})(ce||(e.CompletionItem=ce={}));var Me;(function(v){function M(F,R){return {items:F||[],isIncomplete:!!R}}v.create=M;})(Me||(e.CompletionList=Me={}));var ie;(function(v){function M(R){return R.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}v.fromPlainText=M;function F(R){var y=R;return j.string(y)||j.objectLiteral(y)&&j.string(y.language)&&j.string(y.value)}v.is=F;})(ie||(e.MarkedString=ie={}));var be;(function(v){function M(F){var R=F;return !!R&&j.objectLiteral(R)&&(Pt.is(R.contents)||ie.is(R.contents)||j.typedArray(R.contents,ie.is))&&(F.range===void 0||a.is(F.range))}v.is=M;})(be||(e.Hover=be={}));var $e;(function(v){function M(F,R){return R?{label:F,documentation:R}:{label:F}}v.create=M;})($e||(e.ParameterInformation=$e={}));var ot;(function(v){function M(F,R){for(var y=[],$=2;$=0;rr--){var nr=tt[rr],Tr=$.offsetAt(nr.range.start),Pe=$.offsetAt(nr.range.end);if(Pe<=Ve)Ee=Ee.substring(0,Tr)+nr.newText+Ee.substring(Pe,Ee.length);else throw new Error("Overlapping edit");Ve=Tr;}return Ee}v.applyEdits=R;function y($,J){if($.length<=1)return $;var Ee=$.length/2|0,tt=$.slice(0,Ee),Ve=$.slice(Ee);y(tt,J),y(Ve,J);for(var rr=0,nr=0,Tr=0;rr0&&M.push(F.length),this._lineOffsets=M;}return this._lineOffsets},v.prototype.positionAt=function(M){M=Math.max(Math.min(M,this._content.length),0);var F=this.getLineOffsets(),R=0,y=F.length;if(y===0)return o.create(0,M);for(;RM?y=$:R=$+1;}var J=R-1;return o.create(J,M-F[J])},v.prototype.offsetAt=function(M){var F=this.getLineOffsets();if(M.line>=F.length)return this._content.length;if(M.line<0)return 0;var R=F[M.line],y=M.line+1"u"}v.undefined=R;function y(Pe){return Pe===!0||Pe===!1}v.boolean=y;function $(Pe){return M.call(Pe)==="[object String]"}v.string=$;function J(Pe){return M.call(Pe)==="[object Number]"}v.number=J;function Ee(Pe,pn,vi){return M.call(Pe)==="[object Number]"&&pn<=Pe&&Pe<=vi}v.numberRange=Ee;function tt(Pe){return M.call(Pe)==="[object Number]"&&-2147483648<=Pe&&Pe<=2147483647}v.integer=tt;function Ve(Pe){return M.call(Pe)==="[object Number]"&&0<=Pe&&Pe<=2147483647}v.uinteger=Ve;function rr(Pe){return M.call(Pe)==="[object Function]"}v.func=rr;function nr(Pe){return Pe!==null&&typeof Pe=="object"}v.objectLiteral=nr;function Tr(Pe,pn){return Array.isArray(Pe)&&Pe.every(pn)}v.typedArray=Tr;})(j||(j={}));});});var rt=A(Yt=>{Object.defineProperty(Yt,"__esModule",{value:!0});Yt.ProtocolNotificationType=Yt.ProtocolNotificationType0=Yt.ProtocolRequestType=Yt.ProtocolRequestType0=Yt.RegistrationType=Yt.MessageDirection=void 0;var as=hi(),GT;(function(t){t.clientToServer="clientToServer",t.serverToClient="serverToClient",t.both="both";})(GT||(Yt.MessageDirection=GT={}));var Am=class{constructor(e){this.method=e;}};Yt.RegistrationType=Am;var Pm=class extends as.RequestType0{constructor(e){super(e);}};Yt.ProtocolRequestType0=Pm;var Dm=class extends as.RequestType{constructor(e){super(e,as.ParameterStructures.byName);}};Yt.ProtocolRequestType=Dm;var Om=class extends as.NotificationType0{constructor(e){super(e);}};Yt.ProtocolNotificationType0=Om;var Im=class extends as.NotificationType{constructor(e){super(e,as.ParameterStructures.byName);}};Yt.ProtocolNotificationType=Im;});var mc=A(mt=>{Object.defineProperty(mt,"__esModule",{value:!0});mt.objectLiteral=mt.typedArray=mt.stringArray=mt.array=mt.func=mt.error=mt.number=mt.string=mt.boolean=void 0;function n4(t){return t===!0||t===!1}mt.boolean=n4;function KT(t){return typeof t=="string"||t instanceof String}mt.string=KT;function i4(t){return typeof t=="number"||t instanceof Number}mt.number=i4;function s4(t){return t instanceof Error}mt.error=s4;function o4(t){return typeof t=="function"}mt.func=o4;function ZT(t){return Array.isArray(t)}mt.array=ZT;function a4(t){return ZT(t)&&t.every(e=>KT(e))}mt.stringArray=a4;function u4(t,e){return Array.isArray(t)&&t.every(e)}mt.typedArray=u4;function c4(t){return t!==null&&typeof t=="object"}mt.objectLiteral=c4;});var XT=A(gc=>{Object.defineProperty(gc,"__esModule",{value:!0});gc.ImplementationRequest=void 0;var JT=rt(),YT;(function(t){t.method="textDocument/implementation",t.messageDirection=JT.MessageDirection.clientToServer,t.type=new JT.ProtocolRequestType(t.method);})(YT||(gc.ImplementationRequest=YT={}));});var tA=A(_c=>{Object.defineProperty(_c,"__esModule",{value:!0});_c.TypeDefinitionRequest=void 0;var QT=rt(),eA;(function(t){t.method="textDocument/typeDefinition",t.messageDirection=QT.MessageDirection.clientToServer,t.type=new QT.ProtocolRequestType(t.method);})(eA||(_c.TypeDefinitionRequest=eA={}));});var iA=A(us=>{Object.defineProperty(us,"__esModule",{value:!0});us.DidChangeWorkspaceFoldersNotification=us.WorkspaceFoldersRequest=void 0;var yc=rt(),rA;(function(t){t.method="workspace/workspaceFolders",t.messageDirection=yc.MessageDirection.serverToClient,t.type=new yc.ProtocolRequestType0(t.method);})(rA||(us.WorkspaceFoldersRequest=rA={}));var nA;(function(t){t.method="workspace/didChangeWorkspaceFolders",t.messageDirection=yc.MessageDirection.clientToServer,t.type=new yc.ProtocolNotificationType(t.method);})(nA||(us.DidChangeWorkspaceFoldersNotification=nA={}));});var aA=A(bc=>{Object.defineProperty(bc,"__esModule",{value:!0});bc.ConfigurationRequest=void 0;var sA=rt(),oA;(function(t){t.method="workspace/configuration",t.messageDirection=sA.MessageDirection.serverToClient,t.type=new sA.ProtocolRequestType(t.method);})(oA||(bc.ConfigurationRequest=oA={}));});var lA=A(cs=>{Object.defineProperty(cs,"__esModule",{value:!0});cs.ColorPresentationRequest=cs.DocumentColorRequest=void 0;var vc=rt(),uA;(function(t){t.method="textDocument/documentColor",t.messageDirection=vc.MessageDirection.clientToServer,t.type=new vc.ProtocolRequestType(t.method);})(uA||(cs.DocumentColorRequest=uA={}));var cA;(function(t){t.method="textDocument/colorPresentation",t.messageDirection=vc.MessageDirection.clientToServer,t.type=new vc.ProtocolRequestType(t.method);})(cA||(cs.ColorPresentationRequest=cA={}));});var hA=A(ls=>{Object.defineProperty(ls,"__esModule",{value:!0});ls.FoldingRangeRefreshRequest=ls.FoldingRangeRequest=void 0;var wc=rt(),fA;(function(t){t.method="textDocument/foldingRange",t.messageDirection=wc.MessageDirection.clientToServer,t.type=new wc.ProtocolRequestType(t.method);})(fA||(ls.FoldingRangeRequest=fA={}));var dA;(function(t){t.method="workspace/foldingRange/refresh",t.messageDirection=wc.MessageDirection.serverToClient,t.type=new wc.ProtocolRequestType0(t.method);})(dA||(ls.FoldingRangeRefreshRequest=dA={}));});var gA=A(Sc=>{Object.defineProperty(Sc,"__esModule",{value:!0});Sc.DeclarationRequest=void 0;var pA=rt(),mA;(function(t){t.method="textDocument/declaration",t.messageDirection=pA.MessageDirection.clientToServer,t.type=new pA.ProtocolRequestType(t.method);})(mA||(Sc.DeclarationRequest=mA={}));});var bA=A(Ec=>{Object.defineProperty(Ec,"__esModule",{value:!0});Ec.SelectionRangeRequest=void 0;var _A=rt(),yA;(function(t){t.method="textDocument/selectionRange",t.messageDirection=_A.MessageDirection.clientToServer,t.type=new _A.ProtocolRequestType(t.method);})(yA||(Ec.SelectionRangeRequest=yA={}));});var EA=A(kn=>{Object.defineProperty(kn,"__esModule",{value:!0});kn.WorkDoneProgressCancelNotification=kn.WorkDoneProgressCreateRequest=kn.WorkDoneProgress=void 0;var l4=hi(),Rc=rt(),vA;(function(t){t.type=new l4.ProgressType;function e(r){return r===t.type}t.is=e;})(vA||(kn.WorkDoneProgress=vA={}));var wA;(function(t){t.method="window/workDoneProgress/create",t.messageDirection=Rc.MessageDirection.serverToClient,t.type=new Rc.ProtocolRequestType(t.method);})(wA||(kn.WorkDoneProgressCreateRequest=wA={}));var SA;(function(t){t.method="window/workDoneProgress/cancel",t.messageDirection=Rc.MessageDirection.clientToServer,t.type=new Rc.ProtocolNotificationType(t.method);})(SA||(kn.WorkDoneProgressCancelNotification=SA={}));});var TA=A(Mn=>{Object.defineProperty(Mn,"__esModule",{value:!0});Mn.CallHierarchyOutgoingCallsRequest=Mn.CallHierarchyIncomingCallsRequest=Mn.CallHierarchyPrepareRequest=void 0;var ds=rt(),RA;(function(t){t.method="textDocument/prepareCallHierarchy",t.messageDirection=ds.MessageDirection.clientToServer,t.type=new ds.ProtocolRequestType(t.method);})(RA||(Mn.CallHierarchyPrepareRequest=RA={}));var CA;(function(t){t.method="callHierarchy/incomingCalls",t.messageDirection=ds.MessageDirection.clientToServer,t.type=new ds.ProtocolRequestType(t.method);})(CA||(Mn.CallHierarchyIncomingCallsRequest=CA={}));var xA;(function(t){t.method="callHierarchy/outgoingCalls",t.messageDirection=ds.MessageDirection.clientToServer,t.type=new ds.ProtocolRequestType(t.method);})(xA||(Mn.CallHierarchyOutgoingCallsRequest=xA={}));});var kA=A(Xt=>{Object.defineProperty(Xt,"__esModule",{value:!0});Xt.SemanticTokensRefreshRequest=Xt.SemanticTokensRangeRequest=Xt.SemanticTokensDeltaRequest=Xt.SemanticTokensRequest=Xt.SemanticTokensRegistrationType=Xt.TokenFormat=void 0;var ln=rt(),AA;(function(t){t.Relative="relative";})(AA||(Xt.TokenFormat=AA={}));var To;(function(t){t.method="textDocument/semanticTokens",t.type=new ln.RegistrationType(t.method);})(To||(Xt.SemanticTokensRegistrationType=To={}));var PA;(function(t){t.method="textDocument/semanticTokens/full",t.messageDirection=ln.MessageDirection.clientToServer,t.type=new ln.ProtocolRequestType(t.method),t.registrationMethod=To.method;})(PA||(Xt.SemanticTokensRequest=PA={}));var DA;(function(t){t.method="textDocument/semanticTokens/full/delta",t.messageDirection=ln.MessageDirection.clientToServer,t.type=new ln.ProtocolRequestType(t.method),t.registrationMethod=To.method;})(DA||(Xt.SemanticTokensDeltaRequest=DA={}));var OA;(function(t){t.method="textDocument/semanticTokens/range",t.messageDirection=ln.MessageDirection.clientToServer,t.type=new ln.ProtocolRequestType(t.method),t.registrationMethod=To.method;})(OA||(Xt.SemanticTokensRangeRequest=OA={}));var IA;(function(t){t.method="workspace/semanticTokens/refresh",t.messageDirection=ln.MessageDirection.serverToClient,t.type=new ln.ProtocolRequestType0(t.method);})(IA||(Xt.SemanticTokensRefreshRequest=IA={}));});var NA=A(Cc=>{Object.defineProperty(Cc,"__esModule",{value:!0});Cc.ShowDocumentRequest=void 0;var MA=rt(),FA;(function(t){t.method="window/showDocument",t.messageDirection=MA.MessageDirection.serverToClient,t.type=new MA.ProtocolRequestType(t.method);})(FA||(Cc.ShowDocumentRequest=FA={}));});var $A=A(xc=>{Object.defineProperty(xc,"__esModule",{value:!0});xc.LinkedEditingRangeRequest=void 0;var qA=rt(),LA;(function(t){t.method="textDocument/linkedEditingRange",t.messageDirection=qA.MessageDirection.clientToServer,t.type=new qA.ProtocolRequestType(t.method);})(LA||(xc.LinkedEditingRangeRequest=LA={}));});var GA=A(Mt=>{Object.defineProperty(Mt,"__esModule",{value:!0});Mt.WillDeleteFilesRequest=Mt.DidDeleteFilesNotification=Mt.DidRenameFilesNotification=Mt.WillRenameFilesRequest=Mt.DidCreateFilesNotification=Mt.WillCreateFilesRequest=Mt.FileOperationPatternKind=void 0;var br=rt(),jA;(function(t){t.file="file",t.folder="folder";})(jA||(Mt.FileOperationPatternKind=jA={}));var HA;(function(t){t.method="workspace/willCreateFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method);})(HA||(Mt.WillCreateFilesRequest=HA={}));var WA;(function(t){t.method="workspace/didCreateFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method);})(WA||(Mt.DidCreateFilesNotification=WA={}));var BA;(function(t){t.method="workspace/willRenameFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method);})(BA||(Mt.WillRenameFilesRequest=BA={}));var UA;(function(t){t.method="workspace/didRenameFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method);})(UA||(Mt.DidRenameFilesNotification=UA={}));var zA;(function(t){t.method="workspace/didDeleteFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolNotificationType(t.method);})(zA||(Mt.DidDeleteFilesNotification=zA={}));var VA;(function(t){t.method="workspace/willDeleteFiles",t.messageDirection=br.MessageDirection.clientToServer,t.type=new br.ProtocolRequestType(t.method);})(VA||(Mt.WillDeleteFilesRequest=VA={}));});var XA=A(Fn=>{Object.defineProperty(Fn,"__esModule",{value:!0});Fn.MonikerRequest=Fn.MonikerKind=Fn.UniquenessLevel=void 0;var KA=rt(),ZA;(function(t){t.document="document",t.project="project",t.group="group",t.scheme="scheme",t.global="global";})(ZA||(Fn.UniquenessLevel=ZA={}));var JA;(function(t){t.$import="import",t.$export="export",t.local="local";})(JA||(Fn.MonikerKind=JA={}));var YA;(function(t){t.method="textDocument/moniker",t.messageDirection=KA.MessageDirection.clientToServer,t.type=new KA.ProtocolRequestType(t.method);})(YA||(Fn.MonikerRequest=YA={}));});var rP=A(Nn=>{Object.defineProperty(Nn,"__esModule",{value:!0});Nn.TypeHierarchySubtypesRequest=Nn.TypeHierarchySupertypesRequest=Nn.TypeHierarchyPrepareRequest=void 0;var hs=rt(),QA;(function(t){t.method="textDocument/prepareTypeHierarchy",t.messageDirection=hs.MessageDirection.clientToServer,t.type=new hs.ProtocolRequestType(t.method);})(QA||(Nn.TypeHierarchyPrepareRequest=QA={}));var eP;(function(t){t.method="typeHierarchy/supertypes",t.messageDirection=hs.MessageDirection.clientToServer,t.type=new hs.ProtocolRequestType(t.method);})(eP||(Nn.TypeHierarchySupertypesRequest=eP={}));var tP;(function(t){t.method="typeHierarchy/subtypes",t.messageDirection=hs.MessageDirection.clientToServer,t.type=new hs.ProtocolRequestType(t.method);})(tP||(Nn.TypeHierarchySubtypesRequest=tP={}));});var sP=A(ps=>{Object.defineProperty(ps,"__esModule",{value:!0});ps.InlineValueRefreshRequest=ps.InlineValueRequest=void 0;var Tc=rt(),nP;(function(t){t.method="textDocument/inlineValue",t.messageDirection=Tc.MessageDirection.clientToServer,t.type=new Tc.ProtocolRequestType(t.method);})(nP||(ps.InlineValueRequest=nP={}));var iP;(function(t){t.method="workspace/inlineValue/refresh",t.messageDirection=Tc.MessageDirection.serverToClient,t.type=new Tc.ProtocolRequestType0(t.method);})(iP||(ps.InlineValueRefreshRequest=iP={}));});var cP=A(qn=>{Object.defineProperty(qn,"__esModule",{value:!0});qn.InlayHintRefreshRequest=qn.InlayHintResolveRequest=qn.InlayHintRequest=void 0;var ms=rt(),oP;(function(t){t.method="textDocument/inlayHint",t.messageDirection=ms.MessageDirection.clientToServer,t.type=new ms.ProtocolRequestType(t.method);})(oP||(qn.InlayHintRequest=oP={}));var aP;(function(t){t.method="inlayHint/resolve",t.messageDirection=ms.MessageDirection.clientToServer,t.type=new ms.ProtocolRequestType(t.method);})(aP||(qn.InlayHintResolveRequest=aP={}));var uP;(function(t){t.method="workspace/inlayHint/refresh",t.messageDirection=ms.MessageDirection.serverToClient,t.type=new ms.ProtocolRequestType0(t.method);})(uP||(qn.InlayHintRefreshRequest=uP={}));});var gP=A(vr=>{Object.defineProperty(vr,"__esModule",{value:!0});vr.DiagnosticRefreshRequest=vr.WorkspaceDiagnosticRequest=vr.DocumentDiagnosticRequest=vr.DocumentDiagnosticReportKind=vr.DiagnosticServerCancellationData=void 0;var mP=hi(),f4=mc(),gs=rt(),lP;(function(t){function e(r){let n=r;return n&&f4.boolean(n.retriggerRequest)}t.is=e;})(lP||(vr.DiagnosticServerCancellationData=lP={}));var fP;(function(t){t.Full="full",t.Unchanged="unchanged";})(fP||(vr.DocumentDiagnosticReportKind=fP={}));var dP;(function(t){t.method="textDocument/diagnostic",t.messageDirection=gs.MessageDirection.clientToServer,t.type=new gs.ProtocolRequestType(t.method),t.partialResult=new mP.ProgressType;})(dP||(vr.DocumentDiagnosticRequest=dP={}));var hP;(function(t){t.method="workspace/diagnostic",t.messageDirection=gs.MessageDirection.clientToServer,t.type=new gs.ProtocolRequestType(t.method),t.partialResult=new mP.ProgressType;})(hP||(vr.WorkspaceDiagnosticRequest=hP={}));var pP;(function(t){t.method="workspace/diagnostic/refresh",t.messageDirection=gs.MessageDirection.serverToClient,t.type=new gs.ProtocolRequestType0(t.method);})(pP||(vr.DiagnosticRefreshRequest=pP={}));});var EP=A(at=>{Object.defineProperty(at,"__esModule",{value:!0});at.DidCloseNotebookDocumentNotification=at.DidSaveNotebookDocumentNotification=at.DidChangeNotebookDocumentNotification=at.NotebookCellArrayChange=at.DidOpenNotebookDocumentNotification=at.NotebookDocumentSyncRegistrationType=at.NotebookDocument=at.NotebookCell=at.ExecutionSummary=at.NotebookCellKind=void 0;var Ao=pc(),Nr=mc(),Gr=rt(),km;(function(t){t.Markup=1,t.Code=2;function e(r){return r===1||r===2}t.is=e;})(km||(at.NotebookCellKind=km={}));var Mm;(function(t){function e(i,s){let o={executionOrder:i};return (s===!0||s===!1)&&(o.success=s),o}t.create=e;function r(i){let s=i;return Nr.objectLiteral(s)&&Ao.uinteger.is(s.executionOrder)&&(s.success===void 0||Nr.boolean(s.success))}t.is=r;function n(i,s){return i===s?!0:i==null||s===null||s===void 0?!1:i.executionOrder===s.executionOrder&&i.success===s.success}t.equals=n;})(Mm||(at.ExecutionSummary=Mm={}));var Ac;(function(t){function e(s,o){return {kind:s,document:o}}t.create=e;function r(s){let o=s;return Nr.objectLiteral(o)&&km.is(o.kind)&&Ao.DocumentUri.is(o.document)&&(o.metadata===void 0||Nr.objectLiteral(o.metadata))}t.is=r;function n(s,o){let a=new Set;return s.document!==o.document&&a.add("document"),s.kind!==o.kind&&a.add("kind"),s.executionSummary!==o.executionSummary&&a.add("executionSummary"),(s.metadata!==void 0||o.metadata!==void 0)&&!i(s.metadata,o.metadata)&&a.add("metadata"),(s.executionSummary!==void 0||o.executionSummary!==void 0)&&!Mm.equals(s.executionSummary,o.executionSummary)&&a.add("executionSummary"),a}t.diff=n;function i(s,o){if(s===o)return !0;if(s==null||o===null||o===void 0||typeof s!=typeof o||typeof s!="object")return !1;let a=Array.isArray(s),l=Array.isArray(o);if(a!==l)return !1;if(a&&l){if(s.length!==o.length)return !1;for(let d=0;d{Object.defineProperty(Pc,"__esModule",{value:!0});Pc.InlineCompletionRequest=void 0;var RP=rt(),CP;(function(t){t.method="textDocument/inlineCompletion",t.messageDirection=RP.MessageDirection.clientToServer,t.type=new RP.ProtocolRequestType(t.method);})(CP||(Pc.InlineCompletionRequest=CP={}));});var $D=A(T=>{Object.defineProperty(T,"__esModule",{value:!0});T.WorkspaceSymbolRequest=T.CodeActionResolveRequest=T.CodeActionRequest=T.DocumentSymbolRequest=T.DocumentHighlightRequest=T.ReferencesRequest=T.DefinitionRequest=T.SignatureHelpRequest=T.SignatureHelpTriggerKind=T.HoverRequest=T.CompletionResolveRequest=T.CompletionRequest=T.CompletionTriggerKind=T.PublishDiagnosticsNotification=T.WatchKind=T.RelativePattern=T.FileChangeType=T.DidChangeWatchedFilesNotification=T.WillSaveTextDocumentWaitUntilRequest=T.WillSaveTextDocumentNotification=T.TextDocumentSaveReason=T.DidSaveTextDocumentNotification=T.DidCloseTextDocumentNotification=T.DidChangeTextDocumentNotification=T.TextDocumentContentChangeEvent=T.DidOpenTextDocumentNotification=T.TextDocumentSyncKind=T.TelemetryEventNotification=T.LogMessageNotification=T.ShowMessageRequest=T.ShowMessageNotification=T.MessageType=T.DidChangeConfigurationNotification=T.ExitNotification=T.ShutdownRequest=T.InitializedNotification=T.InitializeErrorCodes=T.InitializeRequest=T.WorkDoneProgressOptions=T.TextDocumentRegistrationOptions=T.StaticRegistrationOptions=T.PositionEncodingKind=T.FailureHandlingKind=T.ResourceOperationKind=T.UnregistrationRequest=T.RegistrationRequest=T.DocumentSelector=T.NotebookCellTextDocumentFilter=T.NotebookDocumentFilter=T.TextDocumentFilter=void 0;T.MonikerRequest=T.MonikerKind=T.UniquenessLevel=T.WillDeleteFilesRequest=T.DidDeleteFilesNotification=T.WillRenameFilesRequest=T.DidRenameFilesNotification=T.WillCreateFilesRequest=T.DidCreateFilesNotification=T.FileOperationPatternKind=T.LinkedEditingRangeRequest=T.ShowDocumentRequest=T.SemanticTokensRegistrationType=T.SemanticTokensRefreshRequest=T.SemanticTokensRangeRequest=T.SemanticTokensDeltaRequest=T.SemanticTokensRequest=T.TokenFormat=T.CallHierarchyPrepareRequest=T.CallHierarchyOutgoingCallsRequest=T.CallHierarchyIncomingCallsRequest=T.WorkDoneProgressCancelNotification=T.WorkDoneProgressCreateRequest=T.WorkDoneProgress=T.SelectionRangeRequest=T.DeclarationRequest=T.FoldingRangeRefreshRequest=T.FoldingRangeRequest=T.ColorPresentationRequest=T.DocumentColorRequest=T.ConfigurationRequest=T.DidChangeWorkspaceFoldersNotification=T.WorkspaceFoldersRequest=T.TypeDefinitionRequest=T.ImplementationRequest=T.ApplyWorkspaceEditRequest=T.ExecuteCommandRequest=T.PrepareRenameRequest=T.RenameRequest=T.PrepareSupportDefaultBehavior=T.DocumentOnTypeFormattingRequest=T.DocumentRangesFormattingRequest=T.DocumentRangeFormattingRequest=T.DocumentFormattingRequest=T.DocumentLinkResolveRequest=T.DocumentLinkRequest=T.CodeLensRefreshRequest=T.CodeLensResolveRequest=T.CodeLensRequest=T.WorkspaceSymbolResolveRequest=void 0;T.InlineCompletionRequest=T.DidCloseNotebookDocumentNotification=T.DidSaveNotebookDocumentNotification=T.DidChangeNotebookDocumentNotification=T.NotebookCellArrayChange=T.DidOpenNotebookDocumentNotification=T.NotebookDocumentSyncRegistrationType=T.NotebookDocument=T.NotebookCell=T.ExecutionSummary=T.NotebookCellKind=T.DiagnosticRefreshRequest=T.WorkspaceDiagnosticRequest=T.DocumentDiagnosticRequest=T.DocumentDiagnosticReportKind=T.DiagnosticServerCancellationData=T.InlayHintRefreshRequest=T.InlayHintResolveRequest=T.InlayHintRequest=T.InlineValueRefreshRequest=T.InlineValueRequest=T.TypeHierarchySupertypesRequest=T.TypeHierarchySubtypesRequest=T.TypeHierarchyPrepareRequest=void 0;var ne=rt(),TP=pc(),wt=mc(),d4=XT();Object.defineProperty(T,"ImplementationRequest",{enumerable:!0,get:function(){return d4.ImplementationRequest}});var h4=tA();Object.defineProperty(T,"TypeDefinitionRequest",{enumerable:!0,get:function(){return h4.TypeDefinitionRequest}});var FD=iA();Object.defineProperty(T,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return FD.WorkspaceFoldersRequest}});Object.defineProperty(T,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return FD.DidChangeWorkspaceFoldersNotification}});var p4=aA();Object.defineProperty(T,"ConfigurationRequest",{enumerable:!0,get:function(){return p4.ConfigurationRequest}});var ND=lA();Object.defineProperty(T,"DocumentColorRequest",{enumerable:!0,get:function(){return ND.DocumentColorRequest}});Object.defineProperty(T,"ColorPresentationRequest",{enumerable:!0,get:function(){return ND.ColorPresentationRequest}});var qD=hA();Object.defineProperty(T,"FoldingRangeRequest",{enumerable:!0,get:function(){return qD.FoldingRangeRequest}});Object.defineProperty(T,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return qD.FoldingRangeRefreshRequest}});var m4=gA();Object.defineProperty(T,"DeclarationRequest",{enumerable:!0,get:function(){return m4.DeclarationRequest}});var g4=bA();Object.defineProperty(T,"SelectionRangeRequest",{enumerable:!0,get:function(){return g4.SelectionRangeRequest}});var $m=EA();Object.defineProperty(T,"WorkDoneProgress",{enumerable:!0,get:function(){return $m.WorkDoneProgress}});Object.defineProperty(T,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return $m.WorkDoneProgressCreateRequest}});Object.defineProperty(T,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return $m.WorkDoneProgressCancelNotification}});var jm=TA();Object.defineProperty(T,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return jm.CallHierarchyIncomingCallsRequest}});Object.defineProperty(T,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return jm.CallHierarchyOutgoingCallsRequest}});Object.defineProperty(T,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return jm.CallHierarchyPrepareRequest}});var ys=kA();Object.defineProperty(T,"TokenFormat",{enumerable:!0,get:function(){return ys.TokenFormat}});Object.defineProperty(T,"SemanticTokensRequest",{enumerable:!0,get:function(){return ys.SemanticTokensRequest}});Object.defineProperty(T,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return ys.SemanticTokensDeltaRequest}});Object.defineProperty(T,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return ys.SemanticTokensRangeRequest}});Object.defineProperty(T,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return ys.SemanticTokensRefreshRequest}});Object.defineProperty(T,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return ys.SemanticTokensRegistrationType}});var _4=NA();Object.defineProperty(T,"ShowDocumentRequest",{enumerable:!0,get:function(){return _4.ShowDocumentRequest}});var y4=$A();Object.defineProperty(T,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return y4.LinkedEditingRangeRequest}});var pi=GA();Object.defineProperty(T,"FileOperationPatternKind",{enumerable:!0,get:function(){return pi.FileOperationPatternKind}});Object.defineProperty(T,"DidCreateFilesNotification",{enumerable:!0,get:function(){return pi.DidCreateFilesNotification}});Object.defineProperty(T,"WillCreateFilesRequest",{enumerable:!0,get:function(){return pi.WillCreateFilesRequest}});Object.defineProperty(T,"DidRenameFilesNotification",{enumerable:!0,get:function(){return pi.DidRenameFilesNotification}});Object.defineProperty(T,"WillRenameFilesRequest",{enumerable:!0,get:function(){return pi.WillRenameFilesRequest}});Object.defineProperty(T,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return pi.DidDeleteFilesNotification}});Object.defineProperty(T,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return pi.WillDeleteFilesRequest}});var Hm=XA();Object.defineProperty(T,"UniquenessLevel",{enumerable:!0,get:function(){return Hm.UniquenessLevel}});Object.defineProperty(T,"MonikerKind",{enumerable:!0,get:function(){return Hm.MonikerKind}});Object.defineProperty(T,"MonikerRequest",{enumerable:!0,get:function(){return Hm.MonikerRequest}});var Wm=rP();Object.defineProperty(T,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return Wm.TypeHierarchyPrepareRequest}});Object.defineProperty(T,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return Wm.TypeHierarchySubtypesRequest}});Object.defineProperty(T,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return Wm.TypeHierarchySupertypesRequest}});var LD=sP();Object.defineProperty(T,"InlineValueRequest",{enumerable:!0,get:function(){return LD.InlineValueRequest}});Object.defineProperty(T,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return LD.InlineValueRefreshRequest}});var Bm=cP();Object.defineProperty(T,"InlayHintRequest",{enumerable:!0,get:function(){return Bm.InlayHintRequest}});Object.defineProperty(T,"InlayHintResolveRequest",{enumerable:!0,get:function(){return Bm.InlayHintResolveRequest}});Object.defineProperty(T,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return Bm.InlayHintRefreshRequest}});var Po=gP();Object.defineProperty(T,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return Po.DiagnosticServerCancellationData}});Object.defineProperty(T,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return Po.DocumentDiagnosticReportKind}});Object.defineProperty(T,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return Po.DocumentDiagnosticRequest}});Object.defineProperty(T,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return Po.WorkspaceDiagnosticRequest}});Object.defineProperty(T,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return Po.DiagnosticRefreshRequest}});var Kr=EP();Object.defineProperty(T,"NotebookCellKind",{enumerable:!0,get:function(){return Kr.NotebookCellKind}});Object.defineProperty(T,"ExecutionSummary",{enumerable:!0,get:function(){return Kr.ExecutionSummary}});Object.defineProperty(T,"NotebookCell",{enumerable:!0,get:function(){return Kr.NotebookCell}});Object.defineProperty(T,"NotebookDocument",{enumerable:!0,get:function(){return Kr.NotebookDocument}});Object.defineProperty(T,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return Kr.NotebookDocumentSyncRegistrationType}});Object.defineProperty(T,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return Kr.DidOpenNotebookDocumentNotification}});Object.defineProperty(T,"NotebookCellArrayChange",{enumerable:!0,get:function(){return Kr.NotebookCellArrayChange}});Object.defineProperty(T,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return Kr.DidChangeNotebookDocumentNotification}});Object.defineProperty(T,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return Kr.DidSaveNotebookDocumentNotification}});Object.defineProperty(T,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return Kr.DidCloseNotebookDocumentNotification}});var b4=xP();Object.defineProperty(T,"InlineCompletionRequest",{enumerable:!0,get:function(){return b4.InlineCompletionRequest}});var Fm;(function(t){function e(r){let n=r;return wt.string(n)||wt.string(n.language)||wt.string(n.scheme)||wt.string(n.pattern)}t.is=e;})(Fm||(T.TextDocumentFilter=Fm={}));var Nm;(function(t){function e(r){let n=r;return wt.objectLiteral(n)&&(wt.string(n.notebookType)||wt.string(n.scheme)||wt.string(n.pattern))}t.is=e;})(Nm||(T.NotebookDocumentFilter=Nm={}));var qm;(function(t){function e(r){let n=r;return wt.objectLiteral(n)&&(wt.string(n.notebook)||Nm.is(n.notebook))&&(n.language===void 0||wt.string(n.language))}t.is=e;})(qm||(T.NotebookCellTextDocumentFilter=qm={}));var Lm;(function(t){function e(r){if(!Array.isArray(r))return !1;for(let n of r)if(!wt.string(n)&&!Fm.is(n)&&!qm.is(n))return !1;return !0}t.is=e;})(Lm||(T.DocumentSelector=Lm={}));var AP;(function(t){t.method="client/registerCapability",t.messageDirection=ne.MessageDirection.serverToClient,t.type=new ne.ProtocolRequestType(t.method);})(AP||(T.RegistrationRequest=AP={}));var PP;(function(t){t.method="client/unregisterCapability",t.messageDirection=ne.MessageDirection.serverToClient,t.type=new ne.ProtocolRequestType(t.method);})(PP||(T.UnregistrationRequest=PP={}));var DP;(function(t){t.Create="create",t.Rename="rename",t.Delete="delete";})(DP||(T.ResourceOperationKind=DP={}));var OP;(function(t){t.Abort="abort",t.Transactional="transactional",t.TextOnlyTransactional="textOnlyTransactional",t.Undo="undo";})(OP||(T.FailureHandlingKind=OP={}));var IP;(function(t){t.UTF8="utf-8",t.UTF16="utf-16",t.UTF32="utf-32";})(IP||(T.PositionEncodingKind=IP={}));var kP;(function(t){function e(r){let n=r;return n&&wt.string(n.id)&&n.id.length>0}t.hasId=e;})(kP||(T.StaticRegistrationOptions=kP={}));var MP;(function(t){function e(r){let n=r;return n&&(n.documentSelector===null||Lm.is(n.documentSelector))}t.is=e;})(MP||(T.TextDocumentRegistrationOptions=MP={}));var FP;(function(t){function e(n){let i=n;return wt.objectLiteral(i)&&(i.workDoneProgress===void 0||wt.boolean(i.workDoneProgress))}t.is=e;function r(n){let i=n;return i&&wt.boolean(i.workDoneProgress)}t.hasWorkDoneProgress=r;})(FP||(T.WorkDoneProgressOptions=FP={}));var NP;(function(t){t.method="initialize",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(NP||(T.InitializeRequest=NP={}));var qP;(function(t){t.unknownProtocolVersion=1;})(qP||(T.InitializeErrorCodes=qP={}));var LP;(function(t){t.method="initialized",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolNotificationType(t.method);})(LP||(T.InitializedNotification=LP={}));var $P;(function(t){t.method="shutdown",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType0(t.method);})($P||(T.ShutdownRequest=$P={}));var jP;(function(t){t.method="exit",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolNotificationType0(t.method);})(jP||(T.ExitNotification=jP={}));var HP;(function(t){t.method="workspace/didChangeConfiguration",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolNotificationType(t.method);})(HP||(T.DidChangeConfigurationNotification=HP={}));var WP;(function(t){t.Error=1,t.Warning=2,t.Info=3,t.Log=4,t.Debug=5;})(WP||(T.MessageType=WP={}));var BP;(function(t){t.method="window/showMessage",t.messageDirection=ne.MessageDirection.serverToClient,t.type=new ne.ProtocolNotificationType(t.method);})(BP||(T.ShowMessageNotification=BP={}));var UP;(function(t){t.method="window/showMessageRequest",t.messageDirection=ne.MessageDirection.serverToClient,t.type=new ne.ProtocolRequestType(t.method);})(UP||(T.ShowMessageRequest=UP={}));var zP;(function(t){t.method="window/logMessage",t.messageDirection=ne.MessageDirection.serverToClient,t.type=new ne.ProtocolNotificationType(t.method);})(zP||(T.LogMessageNotification=zP={}));var VP;(function(t){t.method="telemetry/event",t.messageDirection=ne.MessageDirection.serverToClient,t.type=new ne.ProtocolNotificationType(t.method);})(VP||(T.TelemetryEventNotification=VP={}));var GP;(function(t){t.None=0,t.Full=1,t.Incremental=2;})(GP||(T.TextDocumentSyncKind=GP={}));var KP;(function(t){t.method="textDocument/didOpen",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolNotificationType(t.method);})(KP||(T.DidOpenTextDocumentNotification=KP={}));var ZP;(function(t){function e(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range!==void 0&&(i.rangeLength===void 0||typeof i.rangeLength=="number")}t.isIncremental=e;function r(n){let i=n;return i!=null&&typeof i.text=="string"&&i.range===void 0&&i.rangeLength===void 0}t.isFull=r;})(ZP||(T.TextDocumentContentChangeEvent=ZP={}));var JP;(function(t){t.method="textDocument/didChange",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolNotificationType(t.method);})(JP||(T.DidChangeTextDocumentNotification=JP={}));var YP;(function(t){t.method="textDocument/didClose",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolNotificationType(t.method);})(YP||(T.DidCloseTextDocumentNotification=YP={}));var XP;(function(t){t.method="textDocument/didSave",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolNotificationType(t.method);})(XP||(T.DidSaveTextDocumentNotification=XP={}));var QP;(function(t){t.Manual=1,t.AfterDelay=2,t.FocusOut=3;})(QP||(T.TextDocumentSaveReason=QP={}));var eD;(function(t){t.method="textDocument/willSave",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolNotificationType(t.method);})(eD||(T.WillSaveTextDocumentNotification=eD={}));var tD;(function(t){t.method="textDocument/willSaveWaitUntil",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(tD||(T.WillSaveTextDocumentWaitUntilRequest=tD={}));var rD;(function(t){t.method="workspace/didChangeWatchedFiles",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolNotificationType(t.method);})(rD||(T.DidChangeWatchedFilesNotification=rD={}));var nD;(function(t){t.Created=1,t.Changed=2,t.Deleted=3;})(nD||(T.FileChangeType=nD={}));var iD;(function(t){function e(r){let n=r;return wt.objectLiteral(n)&&(TP.URI.is(n.baseUri)||TP.WorkspaceFolder.is(n.baseUri))&&wt.string(n.pattern)}t.is=e;})(iD||(T.RelativePattern=iD={}));var sD;(function(t){t.Create=1,t.Change=2,t.Delete=4;})(sD||(T.WatchKind=sD={}));var oD;(function(t){t.method="textDocument/publishDiagnostics",t.messageDirection=ne.MessageDirection.serverToClient,t.type=new ne.ProtocolNotificationType(t.method);})(oD||(T.PublishDiagnosticsNotification=oD={}));var aD;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.TriggerForIncompleteCompletions=3;})(aD||(T.CompletionTriggerKind=aD={}));var uD;(function(t){t.method="textDocument/completion",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(uD||(T.CompletionRequest=uD={}));var cD;(function(t){t.method="completionItem/resolve",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(cD||(T.CompletionResolveRequest=cD={}));var lD;(function(t){t.method="textDocument/hover",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(lD||(T.HoverRequest=lD={}));var fD;(function(t){t.Invoked=1,t.TriggerCharacter=2,t.ContentChange=3;})(fD||(T.SignatureHelpTriggerKind=fD={}));var dD;(function(t){t.method="textDocument/signatureHelp",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(dD||(T.SignatureHelpRequest=dD={}));var hD;(function(t){t.method="textDocument/definition",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(hD||(T.DefinitionRequest=hD={}));var pD;(function(t){t.method="textDocument/references",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(pD||(T.ReferencesRequest=pD={}));var mD;(function(t){t.method="textDocument/documentHighlight",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(mD||(T.DocumentHighlightRequest=mD={}));var gD;(function(t){t.method="textDocument/documentSymbol",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(gD||(T.DocumentSymbolRequest=gD={}));var _D;(function(t){t.method="textDocument/codeAction",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(_D||(T.CodeActionRequest=_D={}));var yD;(function(t){t.method="codeAction/resolve",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(yD||(T.CodeActionResolveRequest=yD={}));var bD;(function(t){t.method="workspace/symbol",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(bD||(T.WorkspaceSymbolRequest=bD={}));var vD;(function(t){t.method="workspaceSymbol/resolve",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(vD||(T.WorkspaceSymbolResolveRequest=vD={}));var wD;(function(t){t.method="textDocument/codeLens",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(wD||(T.CodeLensRequest=wD={}));var SD;(function(t){t.method="codeLens/resolve",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(SD||(T.CodeLensResolveRequest=SD={}));var ED;(function(t){t.method="workspace/codeLens/refresh",t.messageDirection=ne.MessageDirection.serverToClient,t.type=new ne.ProtocolRequestType0(t.method);})(ED||(T.CodeLensRefreshRequest=ED={}));var RD;(function(t){t.method="textDocument/documentLink",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(RD||(T.DocumentLinkRequest=RD={}));var CD;(function(t){t.method="documentLink/resolve",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(CD||(T.DocumentLinkResolveRequest=CD={}));var xD;(function(t){t.method="textDocument/formatting",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(xD||(T.DocumentFormattingRequest=xD={}));var TD;(function(t){t.method="textDocument/rangeFormatting",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(TD||(T.DocumentRangeFormattingRequest=TD={}));var AD;(function(t){t.method="textDocument/rangesFormatting",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(AD||(T.DocumentRangesFormattingRequest=AD={}));var PD;(function(t){t.method="textDocument/onTypeFormatting",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(PD||(T.DocumentOnTypeFormattingRequest=PD={}));var DD;(function(t){t.Identifier=1;})(DD||(T.PrepareSupportDefaultBehavior=DD={}));var OD;(function(t){t.method="textDocument/rename",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(OD||(T.RenameRequest=OD={}));var ID;(function(t){t.method="textDocument/prepareRename",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(ID||(T.PrepareRenameRequest=ID={}));var kD;(function(t){t.method="workspace/executeCommand",t.messageDirection=ne.MessageDirection.clientToServer,t.type=new ne.ProtocolRequestType(t.method);})(kD||(T.ExecuteCommandRequest=kD={}));var MD;(function(t){t.method="workspace/applyEdit",t.messageDirection=ne.MessageDirection.serverToClient,t.type=new ne.ProtocolRequestType("workspace/applyEdit");})(MD||(T.ApplyWorkspaceEditRequest=MD={}));});var HD=A(Dc=>{Object.defineProperty(Dc,"__esModule",{value:!0});Dc.createProtocolConnection=void 0;var jD=hi();function v4(t,e,r,n){return jD.ConnectionStrategy.is(n)&&(n={connectionStrategy:n}),(0, jD.createMessageConnection)(t,e,r,n)}Dc.createProtocolConnection=v4;});var BD=A(Qt=>{var w4=Qt&&Qt.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i);}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r];}),Oc=Qt&&Qt.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&w4(e,t,r);};Object.defineProperty(Qt,"__esModule",{value:!0});Qt.LSPErrorCodes=Qt.createProtocolConnection=void 0;Oc(hi(),Qt);Oc(pc(),Qt);Oc(rt(),Qt);Oc($D(),Qt);var S4=HD();Object.defineProperty(Qt,"createProtocolConnection",{enumerable:!0,get:function(){return S4.createProtocolConnection}});var WD;(function(t){t.lspReservedErrorRangeStart=-32899,t.RequestFailed=-32803,t.ServerCancelled=-32802,t.ContentModified=-32801,t.RequestCancelled=-32800,t.lspReservedErrorRangeEnd=-32800;})(WD||(Qt.LSPErrorCodes=WD={}));});var dt=A(Zr=>{var E4=Zr&&Zr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i);}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r];}),UD=Zr&&Zr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&E4(e,t,r);};Object.defineProperty(Zr,"__esModule",{value:!0});Zr.createProtocolConnection=void 0;var R4=Tm();UD(Tm(),Zr);UD(BD(),Zr);function C4(t,e,r,n){return (0, R4.createMessageConnection)(t,e,r,n)}Zr.createProtocolConnection=C4;});var Um=A(wr=>{Object.defineProperty(wr,"__esModule",{value:!0});wr.generateUuid=wr.parse=wr.isUUID=wr.v4=wr.empty=void 0;var Do=class{constructor(e){this._value=e;}asHex(){return this._value}equals(e){return this.asHex()===e.asHex()}},Oo=class t extends Do{static _oneOf(e){return e[Math.floor(e.length*Math.random())]}static _randomHex(){return t._oneOf(t._chars)}constructor(){super([t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),"-","4",t._randomHex(),t._randomHex(),t._randomHex(),"-",t._oneOf(t._timeHighBits),t._randomHex(),t._randomHex(),t._randomHex(),"-",t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex(),t._randomHex()].join(""));}};Oo._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"];Oo._timeHighBits=["8","9","a","b"];wr.empty=new Do("00000000-0000-0000-0000-000000000000");function zD(){return new Oo}wr.v4=zD;var x4=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function VD(t){return x4.test(t)}wr.isUUID=VD;function T4(t){if(!VD(t))throw new Error("invalid uuid");return new Do(t)}wr.parse=T4;function A4(){return zD().asHex()}wr.generateUuid=A4;});var GD=A($n=>{Object.defineProperty($n,"__esModule",{value:!0});$n.attachPartialResult=$n.ProgressFeature=$n.attachWorkDone=void 0;var Ln=dt(),P4=Um(),mi=class t{constructor(e,r){this._connection=e,this._token=r,t.Instances.set(this._token,this);}begin(e,r,n,i){let s={kind:"begin",title:e,percentage:r,message:n,cancellable:i};this._connection.sendProgress(Ln.WorkDoneProgress.type,this._token,s);}report(e,r){let n={kind:"report"};typeof e=="number"?(n.percentage=e,r!==void 0&&(n.message=r)):n.message=e,this._connection.sendProgress(Ln.WorkDoneProgress.type,this._token,n);}done(){t.Instances.delete(this._token),this._connection.sendProgress(Ln.WorkDoneProgress.type,this._token,{kind:"end"});}};mi.Instances=new Map;var Ic=class extends mi{constructor(e,r){super(e,r),this._source=new Ln.CancellationTokenSource;}get token(){return this._source.token}done(){this._source.dispose(),super.done();}cancel(){this._source.cancel();}},Io=class{constructor(){}begin(){}report(){}done(){}},kc=class extends Io{constructor(){super(),this._source=new Ln.CancellationTokenSource;}get token(){return this._source.token}done(){this._source.dispose();}cancel(){this._source.cancel();}};function D4(t,e){if(e===void 0||e.workDoneToken===void 0)return new Io;let r=e.workDoneToken;return delete e.workDoneToken,new mi(t,r)}$n.attachWorkDone=D4;var O4=t=>class extends t{constructor(){super(),this._progressSupported=!1;}initialize(e){super.initialize(e),e?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(Ln.WorkDoneProgressCancelNotification.type,r=>{let n=mi.Instances.get(r.token);(n instanceof Ic||n instanceof kc)&&n.cancel();}));}attachWorkDoneProgress(e){return e===void 0?new Io:new mi(this.connection,e)}createWorkDoneProgress(){if(this._progressSupported){let e=(0, P4.generateUuid)();return this.connection.sendRequest(Ln.WorkDoneProgressCreateRequest.type,{token:e}).then(()=>new Ic(this.connection,e))}else return Promise.resolve(new kc)}};$n.ProgressFeature=O4;var zm;(function(t){t.type=new Ln.ProgressType;})(zm||(zm={}));var Vm=class{constructor(e,r){this._connection=e,this._token=r;}report(e){this._connection.sendProgress(zm.type,this._token,e);}};function I4(t,e){if(e===void 0||e.partialResultToken===void 0)return;let r=e.partialResultToken;return delete e.partialResultToken,new Vm(t,r)}$n.attachPartialResult=I4;});var KD=A(Mc=>{Object.defineProperty(Mc,"__esModule",{value:!0});Mc.ConfigurationFeature=void 0;var k4=dt(),M4=zu(),F4=t=>class extends t{getConfiguration(e){return e?M4.string(e)?this._getConfiguration({section:e}):this._getConfiguration(e):this._getConfiguration({})}_getConfiguration(e){let r={items:Array.isArray(e)?e:[e]};return this.connection.sendRequest(k4.ConfigurationRequest.type,r).then(n=>Array.isArray(n)?Array.isArray(e)?n:n[0]:Array.isArray(e)?[]:null)}};Mc.ConfigurationFeature=F4;});var ZD=A(Nc=>{Object.defineProperty(Nc,"__esModule",{value:!0});Nc.WorkspaceFoldersFeature=void 0;var Fc=dt(),N4=t=>class extends t{constructor(){super(),this._notificationIsAutoRegistered=!1;}initialize(e){super.initialize(e);let r=e.workspace;r&&r.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new Fc.Emitter,this.connection.onNotification(Fc.DidChangeWorkspaceFoldersNotification.type,n=>{this._onDidChangeWorkspaceFolders.fire(n.event);}));}fillServerCapabilities(e){super.fillServerCapabilities(e);let r=e.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=r===!0||typeof r=="string";}getWorkspaceFolders(){return this.connection.sendRequest(Fc.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return !this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(Fc.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};Nc.WorkspaceFoldersFeature=N4;});var JD=A(qc=>{Object.defineProperty(qc,"__esModule",{value:!0});qc.CallHierarchyFeature=void 0;var Gm=dt(),q4=t=>class extends t{get callHierarchy(){return {onPrepare:e=>this.connection.onRequest(Gm.CallHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onIncomingCalls:e=>{let r=Gm.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onOutgoingCalls:e=>{let r=Gm.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};qc.CallHierarchyFeature=q4;});var Zm=A(jn=>{Object.defineProperty(jn,"__esModule",{value:!0});jn.SemanticTokensBuilder=jn.SemanticTokensDiff=jn.SemanticTokensFeature=void 0;var Lc=dt(),L4=t=>class extends t{get semanticTokens(){return {refresh:()=>this.connection.sendRequest(Lc.SemanticTokensRefreshRequest.type),on:e=>{let r=Lc.SemanticTokensRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onDelta:e=>{let r=Lc.SemanticTokensDeltaRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onRange:e=>{let r=Lc.SemanticTokensRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};jn.SemanticTokensFeature=L4;var $c=class{constructor(e,r){this.originalSequence=e,this.modifiedSequence=r;}computeDiff(){let e=this.originalSequence.length,r=this.modifiedSequence.length,n=0;for(;n=n&&s>=n&&this.originalSequence[i]===this.modifiedSequence[s];)i--,s--;(i0&&(o-=this._prevLine,o===0&&(a-=this._prevChar)),this._data[this._dataLen++]=o,this._data[this._dataLen++]=a,this._data[this._dataLen++]=n,this._data[this._dataLen++]=i,this._data[this._dataLen++]=s,this._prevLine=e,this._prevChar=r;}get id(){return this._id.toString()}previousResult(e){this.id===e&&(this._prevData=this._data),this.initialize();}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new $c(this._prevData,this._data).computeDiff()}:this.build()}};jn.SemanticTokensBuilder=Km;});var YD=A(jc=>{Object.defineProperty(jc,"__esModule",{value:!0});jc.ShowDocumentFeature=void 0;var $4=dt(),j4=t=>class extends t{showDocument(e){return this.connection.sendRequest($4.ShowDocumentRequest.type,e)}};jc.ShowDocumentFeature=j4;});var XD=A(Hc=>{Object.defineProperty(Hc,"__esModule",{value:!0});Hc.FileOperationsFeature=void 0;var bs=dt(),H4=t=>class extends t{onDidCreateFiles(e){return this.connection.onNotification(bs.DidCreateFilesNotification.type,r=>{e(r);})}onDidRenameFiles(e){return this.connection.onNotification(bs.DidRenameFilesNotification.type,r=>{e(r);})}onDidDeleteFiles(e){return this.connection.onNotification(bs.DidDeleteFilesNotification.type,r=>{e(r);})}onWillCreateFiles(e){return this.connection.onRequest(bs.WillCreateFilesRequest.type,(r,n)=>e(r,n))}onWillRenameFiles(e){return this.connection.onRequest(bs.WillRenameFilesRequest.type,(r,n)=>e(r,n))}onWillDeleteFiles(e){return this.connection.onRequest(bs.WillDeleteFilesRequest.type,(r,n)=>e(r,n))}};Hc.FileOperationsFeature=H4;});var QD=A(Wc=>{Object.defineProperty(Wc,"__esModule",{value:!0});Wc.LinkedEditingRangeFeature=void 0;var W4=dt(),B4=t=>class extends t{onLinkedEditingRange(e){return this.connection.onRequest(W4.LinkedEditingRangeRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0))}};Wc.LinkedEditingRangeFeature=B4;});var e1=A(Bc=>{Object.defineProperty(Bc,"__esModule",{value:!0});Bc.TypeHierarchyFeature=void 0;var Jm=dt(),U4=t=>class extends t{get typeHierarchy(){return {onPrepare:e=>this.connection.onRequest(Jm.TypeHierarchyPrepareRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),void 0)),onSupertypes:e=>{let r=Jm.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))},onSubtypes:e=>{let r=Jm.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Bc.TypeHierarchyFeature=U4;});var r1=A(Uc=>{Object.defineProperty(Uc,"__esModule",{value:!0});Uc.InlineValueFeature=void 0;var t1=dt(),z4=t=>class extends t{get inlineValue(){return {refresh:()=>this.connection.sendRequest(t1.InlineValueRefreshRequest.type),on:e=>this.connection.onRequest(t1.InlineValueRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};Uc.InlineValueFeature=z4;});var i1=A(zc=>{Object.defineProperty(zc,"__esModule",{value:!0});zc.FoldingRangeFeature=void 0;var n1=dt(),V4=t=>class extends t{get foldingRange(){return {refresh:()=>this.connection.sendRequest(n1.FoldingRangeRefreshRequest.type),on:e=>{let r=n1.FoldingRangeRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};zc.FoldingRangeFeature=V4;});var s1=A(Vc=>{Object.defineProperty(Vc,"__esModule",{value:!0});Vc.InlayHintFeature=void 0;var Ym=dt(),G4=t=>class extends t{get inlayHint(){return {refresh:()=>this.connection.sendRequest(Ym.InlayHintRefreshRequest.type),on:e=>this.connection.onRequest(Ym.InlayHintRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r))),resolve:e=>this.connection.onRequest(Ym.InlayHintResolveRequest.type,(r,n)=>e(r,n))}}};Vc.InlayHintFeature=G4;});var o1=A(Gc=>{Object.defineProperty(Gc,"__esModule",{value:!0});Gc.DiagnosticFeature=void 0;var ko=dt(),K4=t=>class extends t{get diagnostics(){return {refresh:()=>this.connection.sendRequest(ko.DiagnosticRefreshRequest.type),on:e=>this.connection.onRequest(ko.DocumentDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(ko.DocumentDiagnosticRequest.partialResult,r))),onWorkspace:e=>this.connection.onRequest(ko.WorkspaceDiagnosticRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r),this.attachPartialResultProgress(ko.WorkspaceDiagnosticRequest.partialResult,r)))}}};Gc.DiagnosticFeature=K4;});var Qm=A(Kc=>{Object.defineProperty(Kc,"__esModule",{value:!0});Kc.TextDocuments=void 0;var gi=dt(),Xm=class{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new gi.Emitter,this._onDidOpen=new gi.Emitter,this._onDidClose=new gi.Emitter,this._onDidSave=new gi.Emitter,this._onWillSave=new gi.Emitter;}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e;}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(e)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=gi.TextDocumentSyncKind.Incremental;let r=[];return r.push(e.onDidOpenTextDocument(n=>{let i=n.textDocument,s=this._configuration.create(i.uri,i.languageId,i.version,i.text);this._syncedDocuments.set(i.uri,s);let o=Object.freeze({document:s});this._onDidOpen.fire(o),this._onDidChangeContent.fire(o);})),r.push(e.onDidChangeTextDocument(n=>{let i=n.textDocument,s=n.contentChanges;if(s.length===0)return;let{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);let a=this._syncedDocuments.get(i.uri);a!==void 0&&(a=this._configuration.update(a,s,o),this._syncedDocuments.set(i.uri,a),this._onDidChangeContent.fire(Object.freeze({document:a})));})),r.push(e.onDidCloseTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&(this._syncedDocuments.delete(n.textDocument.uri),this._onDidClose.fire(Object.freeze({document:i})));})),r.push(e.onWillSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:n.reason}));})),r.push(e.onWillSaveTextDocumentWaitUntil((n,i)=>{let s=this._syncedDocuments.get(n.textDocument.uri);return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:n.reason}),i):[]})),r.push(e.onDidSaveTextDocument(n=>{let i=this._syncedDocuments.get(n.textDocument.uri);i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}));})),gi.Disposable.create(()=>{r.forEach(n=>n.dispose());})}};Kc.TextDocuments=Xm;});var tg=A(vs=>{Object.defineProperty(vs,"__esModule",{value:!0});vs.NotebookDocuments=vs.NotebookSyncFeature=void 0;var Sr=dt(),a1=Qm(),Z4=t=>class extends t{get synchronization(){return {onDidOpenNotebookDocument:e=>this.connection.onNotification(Sr.DidOpenNotebookDocumentNotification.type,r=>{e(r);}),onDidChangeNotebookDocument:e=>this.connection.onNotification(Sr.DidChangeNotebookDocumentNotification.type,r=>{e(r);}),onDidSaveNotebookDocument:e=>this.connection.onNotification(Sr.DidSaveNotebookDocumentNotification.type,r=>{e(r);}),onDidCloseNotebookDocument:e=>this.connection.onNotification(Sr.DidCloseNotebookDocumentNotification.type,r=>{e(r);})}}};vs.NotebookSyncFeature=Z4;var Zc=class t{onDidOpenTextDocument(e){return this.openHandler=e,Sr.Disposable.create(()=>{this.openHandler=void 0;})}openTextDocument(e){this.openHandler&&this.openHandler(e);}onDidChangeTextDocument(e){return this.changeHandler=e,Sr.Disposable.create(()=>{this.changeHandler=e;})}changeTextDocument(e){this.changeHandler&&this.changeHandler(e);}onDidCloseTextDocument(e){return this.closeHandler=e,Sr.Disposable.create(()=>{this.closeHandler=void 0;})}closeTextDocument(e){this.closeHandler&&this.closeHandler(e);}onWillSaveTextDocument(){return t.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return t.NULL_DISPOSE}onDidSaveTextDocument(){return t.NULL_DISPOSE}};Zc.NULL_DISPOSE=Object.freeze({dispose:()=>{}});var eg=class{constructor(e){e instanceof a1.TextDocuments?this._cellTextDocuments=e:this._cellTextDocuments=new a1.TextDocuments(e),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new Sr.Emitter,this._onDidChange=new Sr.Emitter,this._onDidSave=new Sr.Emitter,this._onDidClose=new Sr.Emitter;}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(e){return this._cellTextDocuments.get(e.document)}getNotebookDocument(e){return this.notebookDocuments.get(e)}getNotebookCell(e){let r=this.notebookCellMap.get(e);return r&&r[0]}findNotebookDocumentForCell(e){let r=typeof e=="string"?e:e.document,n=this.notebookCellMap.get(r);return n&&n[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(e){let r=new Zc,n=[];return n.push(this.cellTextDocuments.listen(r)),n.push(e.notebooks.synchronization.onDidOpenNotebookDocument(i=>{this.notebookDocuments.set(i.notebookDocument.uri,i.notebookDocument);for(let s of i.cellTextDocuments)r.openTextDocument({textDocument:s});this.updateCellMap(i.notebookDocument),this._onDidOpen.fire(i.notebookDocument);})),n.push(e.notebooks.synchronization.onDidChangeNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s===void 0)return;s.version=i.notebookDocument.version;let o=s.metadata,a=!1,l=i.change;l.metadata!==void 0&&(a=!0,s.metadata=l.metadata);let d=[],c=[],p=[],m=[];if(l.cells!==void 0){let D=l.cells;if(D.structure!==void 0){let g=D.structure.array;if(s.cells.splice(g.start,g.deleteCount,...g.cells!==void 0?g.cells:[]),D.structure.didOpen!==void 0)for(let S of D.structure.didOpen)r.openTextDocument({textDocument:S}),d.push(S.uri);if(D.structure.didClose)for(let S of D.structure.didClose)r.closeTextDocument({textDocument:S}),c.push(S.uri);}if(D.data!==void 0){let g=new Map(D.data.map(S=>[S.document,S]));for(let S=0;S<=s.cells.length;S++){let I=g.get(s.cells[S].document);if(I!==void 0){let L=s.cells.splice(S,1,I);if(p.push({old:L[0],new:I}),g.delete(I.document),g.size===0)break}}}if(D.textContent!==void 0)for(let g of D.textContent)r.changeTextDocument({textDocument:g.document,contentChanges:g.changes}),m.push(g.document.uri);}this.updateCellMap(s);let _={notebookDocument:s};a&&(_.metadata={old:o,new:s.metadata});let w=[];for(let D of d)w.push(this.getNotebookCell(D));let E=[];for(let D of c)E.push(this.getNotebookCell(D));let P=[];for(let D of m)P.push(this.getNotebookCell(D));(w.length>0||E.length>0||p.length>0||P.length>0)&&(_.cells={added:w,removed:E,changed:{data:p,textContent:P}}),(_.metadata!==void 0||_.cells!==void 0)&&this._onDidChange.fire(_);})),n.push(e.notebooks.synchronization.onDidSaveNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);s!==void 0&&this._onDidSave.fire(s);})),n.push(e.notebooks.synchronization.onDidCloseNotebookDocument(i=>{let s=this.notebookDocuments.get(i.notebookDocument.uri);if(s!==void 0){this._onDidClose.fire(s);for(let o of i.cellTextDocuments)r.closeTextDocument({textDocument:o});this.notebookDocuments.delete(i.notebookDocument.uri);for(let o of s.cells)this.notebookCellMap.delete(o.document);}})),Sr.Disposable.create(()=>{n.forEach(i=>i.dispose());})}updateCellMap(e){for(let r of e.cells)this.notebookCellMap.set(r.document,[r,e]);}};vs.NotebookDocuments=eg;});var u1=A(Jc=>{Object.defineProperty(Jc,"__esModule",{value:!0});Jc.MonikerFeature=void 0;var J4=dt(),Y4=t=>class extends t{get moniker(){return {on:e=>{let r=J4.MonikerRequest.type;return this.connection.onRequest(r,(n,i)=>e(n,i,this.attachWorkDoneProgress(n),this.attachPartialResultProgress(r,n)))}}}};Jc.MonikerFeature=Y4;});var ag=A(Ne=>{Object.defineProperty(Ne,"__esModule",{value:!0});Ne.createConnection=Ne.combineFeatures=Ne.combineNotebooksFeatures=Ne.combineLanguagesFeatures=Ne.combineWorkspaceFeatures=Ne.combineWindowFeatures=Ne.combineClientFeatures=Ne.combineTracerFeatures=Ne.combineTelemetryFeatures=Ne.combineConsoleFeatures=Ne._NotebooksImpl=Ne._LanguagesImpl=Ne.BulkUnregistration=Ne.BulkRegistration=Ne.ErrorMessageTracker=void 0;var ue=dt(),Er=zu(),ng=Um(),Re=GD(),X4=KD(),Q4=ZD(),ez=JD(),tz=Zm(),rz=YD(),nz=XD(),iz=QD(),sz=e1(),oz=r1(),az=i1(),uz=s1(),cz=o1(),lz=tg(),fz=u1();function rg(t){if(t!==null)return t}var ig=class{constructor(){this._messages=Object.create(null);}add(e){let r=this._messages[e];r||(r=0),r++,this._messages[e]=r;}sendErrors(e){Object.keys(this._messages).forEach(r=>{e.window.showErrorMessage(r);});}};Ne.ErrorMessageTracker=ig;var Yc=class{constructor(){}rawAttach(e){this._rawConnection=e;}attach(e){this._connection=e;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(e){}initialize(e){}error(e){this.send(ue.MessageType.Error,e);}warn(e){this.send(ue.MessageType.Warning,e);}info(e){this.send(ue.MessageType.Info,e);}log(e){this.send(ue.MessageType.Log,e);}debug(e){this.send(ue.MessageType.Debug,e);}send(e,r){this._rawConnection&&this._rawConnection.sendNotification(ue.LogMessageNotification.type,{type:e,message:r}).catch(()=>{(0, ue.RAL)().console.error("Sending log message failed");});}},sg=class{constructor(){}attach(e){this._connection=e;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}showErrorMessage(e,...r){let n={type:ue.MessageType.Error,message:e,actions:r};return this.connection.sendRequest(ue.ShowMessageRequest.type,n).then(rg)}showWarningMessage(e,...r){let n={type:ue.MessageType.Warning,message:e,actions:r};return this.connection.sendRequest(ue.ShowMessageRequest.type,n).then(rg)}showInformationMessage(e,...r){let n={type:ue.MessageType.Info,message:e,actions:r};return this.connection.sendRequest(ue.ShowMessageRequest.type,n).then(rg)}},c1=(0, rz.ShowDocumentFeature)((0, Re.ProgressFeature)(sg)),l1;(function(t){function e(){return new Xc}t.create=e;})(l1||(Ne.BulkRegistration=l1={}));var Xc=class{constructor(){this._registrations=[],this._registered=new Set;}add(e,r){let n=Er.string(e)?e:e.method;if(this._registered.has(n))throw new Error(`${n} is already added to this registration`);let i=ng.generateUuid();this._registrations.push({id:i,method:n,registerOptions:r||{}}),this._registered.add(n);}asRegistrationParams(){return {registrations:this._registrations}}},f1;(function(t){function e(){return new Mo(void 0,[])}t.create=e;})(f1||(Ne.BulkUnregistration=f1={}));var Mo=class{constructor(e,r){this._connection=e,this._unregistrations=new Map,r.forEach(n=>{this._unregistrations.set(n.method,n);});}get isAttached(){return !!this._connection}attach(e){this._connection=e;}add(e){this._unregistrations.set(e.method,e);}dispose(){let e=[];for(let n of this._unregistrations.values())e.push(n);let r={unregisterations:e};this._connection.sendRequest(ue.UnregistrationRequest.type,r).catch(()=>{this._connection.console.info("Bulk unregistration failed.");});}disposeSingle(e){let r=Er.string(e)?e:e.method,n=this._unregistrations.get(r);if(!n)return !1;let i={unregisterations:[n]};return this._connection.sendRequest(ue.UnregistrationRequest.type,i).then(()=>{this._unregistrations.delete(r);},s=>{this._connection.console.info(`Un-registering request handler for ${n.id} failed.`);}),!0}},Qc=class{attach(e){this._connection=e;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}register(e,r,n){return e instanceof Xc?this.registerMany(e):e instanceof Mo?this.registerSingle1(e,r,n):this.registerSingle2(e,r)}registerSingle1(e,r,n){let i=Er.string(r)?r:r.method,s=ng.generateUuid(),o={registrations:[{id:s,method:i,registerOptions:n||{}}]};return e.isAttached||e.attach(this.connection),this.connection.sendRequest(ue.RegistrationRequest.type,o).then(a=>(e.add({id:s,method:i}),e),a=>(this.connection.console.info(`Registering request handler for ${i} failed.`),Promise.reject(a)))}registerSingle2(e,r){let n=Er.string(e)?e:e.method,i=ng.generateUuid(),s={registrations:[{id:i,method:n,registerOptions:r||{}}]};return this.connection.sendRequest(ue.RegistrationRequest.type,s).then(o=>ue.Disposable.create(()=>{this.unregisterSingle(i,n).catch(()=>{this.connection.console.info(`Un-registering capability with id ${i} failed.`);});}),o=>(this.connection.console.info(`Registering request handler for ${n} failed.`),Promise.reject(o)))}unregisterSingle(e,r){let n={unregisterations:[{id:e,method:r}]};return this.connection.sendRequest(ue.UnregistrationRequest.type,n).catch(()=>{this.connection.console.info(`Un-registering request handler for ${e} failed.`);})}registerMany(e){let r=e.asRegistrationParams();return this.connection.sendRequest(ue.RegistrationRequest.type,r).then(()=>new Mo(this._connection,r.registrations.map(n=>({id:n.id,method:n.method}))),n=>(this.connection.console.info("Bulk registration failed."),Promise.reject(n)))}},og=class{constructor(){}attach(e){this._connection=e;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}applyEdit(e){function r(i){return i&&!!i.edit}let n=r(e)?e:{edit:e};return this.connection.sendRequest(ue.ApplyWorkspaceEditRequest.type,n)}},d1=(0, nz.FileOperationsFeature)((0, Q4.WorkspaceFoldersFeature)((0, X4.ConfigurationFeature)(og))),el=class{constructor(){this._trace=ue.Trace.Off;}attach(e){this._connection=e;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}set trace(e){this._trace=e;}log(e,r){this._trace!==ue.Trace.Off&&this.connection.sendNotification(ue.LogTraceNotification.type,{message:e,verbose:this._trace===ue.Trace.Verbose?r:void 0}).catch(()=>{});}},tl=class{constructor(){}attach(e){this._connection=e;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}logEvent(e){this.connection.sendNotification(ue.TelemetryEventNotification.type,e).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed");});}},rl=class{constructor(){}attach(e){this._connection=e;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return (0, Re.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return (0, Re.attachPartialResult)(this.connection,r)}};Ne._LanguagesImpl=rl;var h1=(0, az.FoldingRangeFeature)((0, fz.MonikerFeature)((0, cz.DiagnosticFeature)((0, uz.InlayHintFeature)((0, oz.InlineValueFeature)((0, sz.TypeHierarchyFeature)((0, iz.LinkedEditingRangeFeature)((0, tz.SemanticTokensFeature)((0, ez.CallHierarchyFeature)(rl))))))))),nl=class{constructor(){}attach(e){this._connection=e;}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(e){}fillServerCapabilities(e){}attachWorkDoneProgress(e){return (0, Re.attachWorkDone)(this.connection,e)}attachPartialResultProgress(e,r){return (0, Re.attachPartialResult)(this.connection,r)}};Ne._NotebooksImpl=nl;var p1=(0, lz.NotebookSyncFeature)(nl);function m1(t,e){return function(r){return e(t(r))}}Ne.combineConsoleFeatures=m1;function g1(t,e){return function(r){return e(t(r))}}Ne.combineTelemetryFeatures=g1;function _1(t,e){return function(r){return e(t(r))}}Ne.combineTracerFeatures=_1;function y1(t,e){return function(r){return e(t(r))}}Ne.combineClientFeatures=y1;function b1(t,e){return function(r){return e(t(r))}}Ne.combineWindowFeatures=b1;function v1(t,e){return function(r){return e(t(r))}}Ne.combineWorkspaceFeatures=v1;function w1(t,e){return function(r){return e(t(r))}}Ne.combineLanguagesFeatures=w1;function S1(t,e){return function(r){return e(t(r))}}Ne.combineNotebooksFeatures=S1;function dz(t,e){function r(i,s,o){return i&&s?o(i,s):i||s}return {__brand:"features",console:r(t.console,e.console,m1),tracer:r(t.tracer,e.tracer,_1),telemetry:r(t.telemetry,e.telemetry,g1),client:r(t.client,e.client,y1),window:r(t.window,e.window,b1),workspace:r(t.workspace,e.workspace,v1),languages:r(t.languages,e.languages,w1),notebooks:r(t.notebooks,e.notebooks,S1)}}Ne.combineFeatures=dz;function hz(t,e,r){let n=r&&r.console?new(r.console(Yc)):new Yc,i=t(n);n.rawAttach(i);let s=r&&r.tracer?new(r.tracer(el)):new el,o=r&&r.telemetry?new(r.telemetry(tl)):new tl,a=r&&r.client?new(r.client(Qc)):new Qc,l=r&&r.window?new(r.window(c1)):new c1,d=r&&r.workspace?new(r.workspace(d1)):new d1,c=r&&r.languages?new(r.languages(h1)):new h1,p=r&&r.notebooks?new(r.notebooks(p1)):new p1,m=[n,s,o,a,l,d,c,p];function _(g){return g instanceof Promise?g:Er.thenable(g)?new Promise((S,I)=>{g.then(L=>S(L),L=>I(L));}):Promise.resolve(g)}let w,E,P,D={listen:()=>i.listen(),sendRequest:(g,...S)=>i.sendRequest(Er.string(g)?g:g.method,...S),onRequest:(g,S)=>i.onRequest(g,S),sendNotification:(g,S)=>{let I=Er.string(g)?g:g.method;return i.sendNotification(I,S)},onNotification:(g,S)=>i.onNotification(g,S),onProgress:i.onProgress,sendProgress:i.sendProgress,onInitialize:g=>(E=g,{dispose:()=>{E=void 0;}}),onInitialized:g=>i.onNotification(ue.InitializedNotification.type,g),onShutdown:g=>(w=g,{dispose:()=>{w=void 0;}}),onExit:g=>(P=g,{dispose:()=>{P=void 0;}}),get console(){return n},get telemetry(){return o},get tracer(){return s},get client(){return a},get window(){return l},get workspace(){return d},get languages(){return c},get notebooks(){return p},onDidChangeConfiguration:g=>i.onNotification(ue.DidChangeConfigurationNotification.type,g),onDidChangeWatchedFiles:g=>i.onNotification(ue.DidChangeWatchedFilesNotification.type,g),__textDocumentSync:void 0,onDidOpenTextDocument:g=>i.onNotification(ue.DidOpenTextDocumentNotification.type,g),onDidChangeTextDocument:g=>i.onNotification(ue.DidChangeTextDocumentNotification.type,g),onDidCloseTextDocument:g=>i.onNotification(ue.DidCloseTextDocumentNotification.type,g),onWillSaveTextDocument:g=>i.onNotification(ue.WillSaveTextDocumentNotification.type,g),onWillSaveTextDocumentWaitUntil:g=>i.onRequest(ue.WillSaveTextDocumentWaitUntilRequest.type,g),onDidSaveTextDocument:g=>i.onNotification(ue.DidSaveTextDocumentNotification.type,g),sendDiagnostics:g=>i.sendNotification(ue.PublishDiagnosticsNotification.type,g),onHover:g=>i.onRequest(ue.HoverRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),void 0)),onCompletion:g=>i.onRequest(ue.CompletionRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onCompletionResolve:g=>i.onRequest(ue.CompletionResolveRequest.type,g),onSignatureHelp:g=>i.onRequest(ue.SignatureHelpRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),void 0)),onDeclaration:g=>i.onRequest(ue.DeclarationRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onDefinition:g=>i.onRequest(ue.DefinitionRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onTypeDefinition:g=>i.onRequest(ue.TypeDefinitionRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onImplementation:g=>i.onRequest(ue.ImplementationRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onReferences:g=>i.onRequest(ue.ReferencesRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onDocumentHighlight:g=>i.onRequest(ue.DocumentHighlightRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onDocumentSymbol:g=>i.onRequest(ue.DocumentSymbolRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onWorkspaceSymbol:g=>i.onRequest(ue.WorkspaceSymbolRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onWorkspaceSymbolResolve:g=>i.onRequest(ue.WorkspaceSymbolResolveRequest.type,g),onCodeAction:g=>i.onRequest(ue.CodeActionRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onCodeActionResolve:g=>i.onRequest(ue.CodeActionResolveRequest.type,(S,I)=>g(S,I)),onCodeLens:g=>i.onRequest(ue.CodeLensRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onCodeLensResolve:g=>i.onRequest(ue.CodeLensResolveRequest.type,(S,I)=>g(S,I)),onDocumentFormatting:g=>i.onRequest(ue.DocumentFormattingRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),void 0)),onDocumentRangeFormatting:g=>i.onRequest(ue.DocumentRangeFormattingRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),void 0)),onDocumentOnTypeFormatting:g=>i.onRequest(ue.DocumentOnTypeFormattingRequest.type,(S,I)=>g(S,I)),onRenameRequest:g=>i.onRequest(ue.RenameRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),void 0)),onPrepareRename:g=>i.onRequest(ue.PrepareRenameRequest.type,(S,I)=>g(S,I)),onDocumentLinks:g=>i.onRequest(ue.DocumentLinkRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onDocumentLinkResolve:g=>i.onRequest(ue.DocumentLinkResolveRequest.type,(S,I)=>g(S,I)),onDocumentColor:g=>i.onRequest(ue.DocumentColorRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onColorPresentation:g=>i.onRequest(ue.ColorPresentationRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onFoldingRanges:g=>i.onRequest(ue.FoldingRangeRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onSelectionRanges:g=>i.onRequest(ue.SelectionRangeRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),(0, Re.attachPartialResult)(i,S))),onExecuteCommand:g=>i.onRequest(ue.ExecuteCommandRequest.type,(S,I)=>g(S,I,(0, Re.attachWorkDone)(i,S),void 0)),dispose:()=>i.dispose()};for(let g of m)g.attach(D);return i.onRequest(ue.InitializeRequest.type,g=>{e.initialize(g),Er.string(g.trace)&&(s.trace=ue.Trace.fromString(g.trace));for(let S of m)S.initialize(g.capabilities);if(E){let S=E(g,new ue.CancellationTokenSource().token,(0, Re.attachWorkDone)(i,g),void 0);return _(S).then(I=>{if(I instanceof ue.ResponseError)return I;let L=I;L||(L={capabilities:{}});let Z=L.capabilities;Z||(Z={},L.capabilities=Z),Z.textDocumentSync===void 0||Z.textDocumentSync===null?Z.textDocumentSync=Er.number(D.__textDocumentSync)?D.__textDocumentSync:ue.TextDocumentSyncKind.None:!Er.number(Z.textDocumentSync)&&!Er.number(Z.textDocumentSync.change)&&(Z.textDocumentSync.change=Er.number(D.__textDocumentSync)?D.__textDocumentSync:ue.TextDocumentSyncKind.None);for(let K of m)K.fillServerCapabilities(Z);return L})}else {let S={capabilities:{textDocumentSync:ue.TextDocumentSyncKind.None}};for(let I of m)I.fillServerCapabilities(S.capabilities);return S}}),i.onRequest(ue.ShutdownRequest.type,()=>{if(e.shutdownReceived=!0,w)return w(new ue.CancellationTokenSource().token)}),i.onNotification(ue.ExitNotification.type,()=>{try{P&&P();}finally{e.shutdownReceived?e.exit(0):e.exit(1);}}),i.onNotification(ue.SetTraceNotification.type,g=>{s.trace=ue.Trace.fromString(g.value);}),D}Ne.createConnection=hz;});var E1=A(er=>{Object.defineProperty(er,"__esModule",{value:!0});er.resolveModulePath=er.FileSystem=er.resolveGlobalYarnPath=er.resolveGlobalNodePath=er.resolve=er.uriToFilePath=void 0;var pz=oe("url"),qr=oe("path"),ug=oe("fs"),dg=oe("child_process");function mz(t){let e=pz.parse(t);if(e.protocol!=="file:"||!e.path)return;let r=e.path.split("/");for(var n=0,i=r.length;n1){let s=r[0],o=r[1];s.length===0&&o.length>1&&o[1]===":"&&r.shift();}return qr.normalize(r.join("/"))}er.uriToFilePath=mz;function cg(){return process.platform==="win32"}function il(t,e,r,n){let i="NODE_PATH",s=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((o,a)=>{let l=process.env,d=Object.create(null);Object.keys(l).forEach(c=>d[c]=l[c]),e&&ug.existsSync(e)&&(d[i]?d[i]=e+qr.delimiter+d[i]:d[i]=e,n&&n(`NODE_PATH value is: ${d[i]}`)),d.ELECTRON_RUN_AS_NODE="1";try{let c=(0, dg.fork)("",[],{cwd:r,env:d,execArgv:["-e",s]});if(c.pid===void 0){a(new Error(`Starting process to resolve node module ${t} failed`));return}c.on("error",m=>{a(m);}),c.on("message",m=>{m.c==="r"&&(c.send({c:"e"}),m.s?o(m.r):a(new Error(`Failed to resolve module: ${t}`)));});let p={c:"rs",a:t};c.send(p);}catch(c){a(c);}})}er.resolve=il;function lg(t){let e="npm",r=Object.create(null);Object.keys(process.env).forEach(s=>r[s]=process.env[s]),r.NO_UPDATE_NOTIFIER="true";let n={encoding:"utf8",env:r};cg()&&(e="npm.cmd",n.shell=!0);let i=()=>{};try{process.on("SIGPIPE",i);let s=(0, dg.spawnSync)(e,["config","get","prefix"],n).stdout;if(!s){t&&t("'npm config get prefix' didn't return a value.");return}let o=s.trim();return t&&t(`'npm config get prefix' value is: ${o}`),o.length>0?cg()?qr.join(o,"node_modules"):qr.join(o,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",i);}}er.resolveGlobalNodePath=lg;function gz(t){let e="yarn",r={encoding:"utf8"};cg()&&(e="yarn.cmd",r.shell=!0);let n=()=>{};try{process.on("SIGPIPE",n);let i=(0, dg.spawnSync)(e,["global","dir","--json"],r),s=i.stdout;if(!s){t&&(t("'yarn global dir' didn't return a value."),i.stderr&&t(i.stderr));return}let o=s.trim().split(/\r?\n/);for(let a of o)try{let l=JSON.parse(a);if(l.type==="log")return qr.join(l.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",n);}}er.resolveGlobalYarnPath=gz;var fg;(function(t){let e;function r(){return e!==void 0||(process.platform==="win32"?e=!1:e=!ug.existsSync(__filename.toUpperCase())||!ug.existsSync(__filename.toLowerCase())),e}t.isCaseSensitive=r;function n(i,s){return r()?qr.normalize(s).indexOf(qr.normalize(i))===0:qr.normalize(s).toLowerCase().indexOf(qr.normalize(i).toLowerCase())===0}t.isParent=n;})(fg||(er.FileSystem=fg={}));function _z(t,e,r,n){return r?(qr.isAbsolute(r)||(r=qr.join(t,r)),il(e,r,r,n).then(i=>fg.isParent(r,i)?i:Promise.reject(new Error(`Failed to load ${e} from node path location.`))).then(void 0,i=>il(e,lg(n),t,n))):il(e,lg(n),t,n)}er.resolveModulePath=_z;});var hg=A((NZ,R1)=>{R1.exports=dt();});var C1=A(sl=>{Object.defineProperty(sl,"__esModule",{value:!0});sl.InlineCompletionFeature=void 0;var yz=dt(),bz=t=>class extends t{get inlineCompletion(){return {on:e=>this.connection.onRequest(yz.InlineCompletionRequest.type,(r,n)=>e(r,n,this.attachWorkDoneProgress(r)))}}};sl.InlineCompletionFeature=bz;});var A1=A(Ft=>{var vz=Ft&&Ft.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i);}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r];}),T1=Ft&&Ft.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vz(e,t,r);};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.ProposedFeatures=Ft.NotebookDocuments=Ft.TextDocuments=Ft.SemanticTokensBuilder=void 0;var wz=Zm();Object.defineProperty(Ft,"SemanticTokensBuilder",{enumerable:!0,get:function(){return wz.SemanticTokensBuilder}});var Sz=C1();T1(dt(),Ft);var Ez=Qm();Object.defineProperty(Ft,"TextDocuments",{enumerable:!0,get:function(){return Ez.TextDocuments}});var Rz=tg();Object.defineProperty(Ft,"NotebookDocuments",{enumerable:!0,get:function(){return Rz.NotebookDocuments}});T1(ag(),Ft);var x1;(function(t){t.all={__brand:"features",languages:Sz.InlineCompletionFeature};})(x1||(Ft.ProposedFeatures=x1={}));});var M1=A(Rr=>{var Cz=Rr&&Rr.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,i);}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r];}),I1=Rr&&Rr.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Cz(e,t,r);};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.createConnection=Rr.Files=void 0;var P1=oe("util"),pg=zu(),xz=ag(),Fo=E1(),_i=hg();I1(hg(),Rr);I1(A1(),Rr);var D1;(function(t){t.uriToFilePath=Fo.uriToFilePath,t.resolveGlobalNodePath=Fo.resolveGlobalNodePath,t.resolveGlobalYarnPath=Fo.resolveGlobalYarnPath,t.resolve=Fo.resolve,t.resolveModulePath=Fo.resolveModulePath;})(D1||(Rr.Files=D1={}));var ws=!1,k1;function Tz(){let t="--clientProcessId";function e(r){try{let n=parseInt(r);isNaN(n)||(k1=setInterval(()=>{try{process.kill(n,0);}catch{process.exit(ws?0:1);}},3e3));}catch{}}for(let r=2;r{let e=t.processId;pg.number(e)&&k1===void 0&&setInterval(()=>{try{process.kill(e,0);}catch{process.exit(ws?0:1);}},3e3);},get shutdownReceived(){return ws},set shutdownReceived(t){ws=t;},exit:t=>{process.exit(t);}};function Pz(t,e,r,n){let i,s,o,a;return t!==void 0&&t.__brand==="features"&&(i=t,t=e,e=r,r=n),_i.ConnectionStrategy.is(t)||_i.ConnectionOptions.is(t)?a=t:(s=t,o=e,a=r),Dz(s,o,a,i)}Rr.createConnection=Pz;function Dz(t,e,r,n){let i=!1;if(!t&&!e&&process.argv.length>2){let l,d,c=process.argv.slice(2);for(let p=0;p{process.exit(ws?0:1);}),l.on("close",()=>{process.exit(ws?0:1);});}let a=l=>{let d=(0, _i.createProtocolConnection)(t,e,l,r);return i&&Oz(l),d};return (0, xz.createConnection)(a,Az,n)}function Oz(t){function e(n){return n.map(i=>typeof i=="string"?i:(0, P1.inspect)(i)).join(" ")}let r=new Map;console.assert=function(i,...s){if(!i)if(s.length===0)t.error("Assertion failed");else {let[o,...a]=s;t.error(`Assertion failed: ${o} ${e(a)}`);}},console.count=function(i="default"){let s=String(i),o=r.get(s)??0;o+=1,r.set(s,o),t.log(`${s}: ${s}`);},console.countReset=function(i){i===void 0?r.clear():r.delete(String(i));},console.debug=function(...i){t.log(e(i));},console.dir=function(i,s){t.log((0, P1.inspect)(i,s));},console.log=function(...i){t.log(e(i));},console.error=function(...i){t.error(e(i));},console.trace=function(...i){let s=new Error().stack.replace(/(.+\n){2}/,""),o="Trace";i.length!==0&&(o+=`: ${e(i)}`),t.log(`${o} +${s}`);},console.warn=function(...i){t.warn(e(i));};}});var N1=A((HZ,F1)=>{F1.exports=M1();});var zo=new Uint8Array(256),Uo=zo.length;function bl(){return Uo>zo.length-16&&(OO__default.default.randomFillSync(zo),Uo=0),zo.slice(Uo,Uo+=16)}var xt=[];for(let t=0;t<256;++t)xt.push((t+256).toString(16).slice(1));function Kg(t,e=0){return xt[t[e+0]]+xt[t[e+1]]+xt[t[e+2]]+xt[t[e+3]]+"-"+xt[t[e+4]]+xt[t[e+5]]+"-"+xt[t[e+6]]+xt[t[e+7]]+"-"+xt[t[e+8]]+xt[t[e+9]]+"-"+xt[t[e+10]]+xt[t[e+11]]+xt[t[e+12]]+xt[t[e+13]]+xt[t[e+14]]+xt[t[e+15]]}var vl={randomUUID:OO__default.default.randomUUID};function kO(t,e,r){if(vl.randomUUID&&!e&&!t)return vl.randomUUID();t=t||{};let n=t.random||(t.rng||bl)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let i=0;i<16;++i)e[r+i]=n[i];return e}return Kg(n)}var Xr=kO;var Wu=$t(xa());var wn={defaultMerge:Symbol("deepmerge-ts: default merge"),skip:Symbol("deepmerge-ts: skip")};function mF(t,e){return e}function zv(t){return typeof t!="object"||t===null?0:Array.isArray(t)?2:yF(t)?1:t instanceof Set?3:t instanceof Map?4:5}function gF(t){let e=new Set;for(let r of t)for(let n of [...Object.keys(r),...Object.getOwnPropertySymbols(r)])e.add(n);return e}function _F(t,e){return typeof t=="object"&&Object.prototype.propertyIsEnumerable.call(t,e)}function Gv(t){return {*[Symbol.iterator](){for(let e of t)for(let r of e)yield r;}}}var Vv=new Set(["[object Object]","[object Module]"]);function yF(t){if(!Vv.has(Object.prototype.toString.call(t)))return !1;let{constructor:e}=t;if(e===void 0)return !0;let r=e.prototype;return !(r===null||typeof r!="object"||!Vv.has(Object.prototype.toString.call(r))||!r.hasOwnProperty("isPrototypeOf"))}function bF(t,e,r){let n={};for(let i of gF(t)){let s=[];for(let l of t)_F(l,i)&&s.push(l[i]);if(s.length===0)continue;let o=e.metaDataUpdater(r,{key:i,parents:t}),a=Jv(s,e,o);a!==wn.skip&&(i==="__proto__"?Object.defineProperty(n,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):n[i]=a);}return n}function vF(t){return t.flat()}function wF(t){return new Set(Gv(t))}function SF(t){return new Map(Gv(t))}function Kv(t){return t.at(-1)}var Rf=Object.freeze({__proto__:null,mergeArrays:vF,mergeMaps:SF,mergeOthers:Kv,mergeRecords:bF,mergeSets:wF});function Zv(...t){return EF({})(...t)}function EF(t,e){let r=RF(t,n);function n(...i){return Jv(i,r,e)}return n}function RF(t,e){return {defaultMergeFunctions:Rf,mergeFunctions:{...Rf,...Object.fromEntries(Object.entries(t).filter(([r,n])=>Object.hasOwn(Rf,r)).map(([r,n])=>n===!1?[r,Kv]:[r,n]))},metaDataUpdater:t.metaDataUpdater??mF,deepmerge:e,useImplicitDefaultMerging:t.enableImplicitDefaultMerging??!1,actions:wn}}function Jv(t,e,r){if(t.length===0)return;if(t.length===1)return Cf(t,e,r);let n=zv(t[0]);if(n!==0&&n!==5){for(let i=1;i{let e=typeof t;return t!==null&&(e==="object"||e==="function")};var xf=new Set(["__proto__","prototype","constructor"]),PF=new Set("0123456789");function Tf(t){let e=[],r="",n="start",i=!1;for(let s of t)switch(s){case"\\":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");i&&(r+=s),n="property",i=!i;break}case".":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="property";break}if(i){i=!1,r+=s;break}if(xf.has(r))return [];e.push(r),r="",n="property";break}case"[":{if(n==="index")throw new Error("Invalid character in an index");if(n==="indexEnd"){n="index";break}if(i){i=!1,r+=s;break}if(n==="property"){if(xf.has(r))return [];e.push(r),r="";}n="index";break}case"]":{if(n==="index"){e.push(Number.parseInt(r,10)),r="",n="indexEnd";break}if(n==="indexEnd")throw new Error("Invalid character after an index")}default:{if(n==="index"&&!PF.has(s))throw new Error("Invalid character in an index");if(n==="indexEnd")throw new Error("Invalid character after an index");n==="start"&&(n="property"),i&&(i=!1,r+="\\"),r+=s;}}switch(i&&(r+="\\"),n){case"property":{if(xf.has(r))return [];e.push(r);break}case"index":throw new Error("Index was not closed");case"start":{e.push("");break}}return e}function Yv(t,e){if(typeof e!="number"&&Array.isArray(t)){let r=Number.parseInt(e,10);return Number.isInteger(r)&&t[r]===t[e]}return !1}function Xv(t,e){if(Yv(t,e))throw new Error("Cannot use string index")}function Ta(t,e,r){if(!Ls(t)||typeof e!="string")return r===void 0?t:r;let n=Tf(e);if(n.length===0)return r;for(let i=0;i0&&e[e.length-1]?.endsWith(` +`)&&e.push(""),e}function Ae(t){return t.trim().length===0}function Hr(t,e){if(e===void 0)return t.match(/^[ \t]*/)?.[0]?.length??0;if(e===" ")return t.match(/^\t*/g)?.[0].length??0;if(e.match(/^ *$/))return (t.match(/^ */)?.[0].length??0)/e.length;throw new Error(`Invalid indentation: ${e}`)}function Pf(t,e){return e<0||e>=t.length-1?!1:Hr(t[e])t.length-1?!1:Hr(t[e-1])>Hr(t[e])}var nw=[["(",")"],["[","]"],["{","}"],["'","'"],['"','"'],["`","`"]],iw=nw.map(t=>t[0]),Da=nw.map(t=>t[1]);function Oa(t){let e=[];for(let r of t)[["(",")"],["[","]"],["{","}"]].forEach(n=>{r===n[1]&&(e.length>0&&e[e.length-1]===n[0]?e.pop():e.push(r));}),"([{".includes(r)&&e.push(r),["'",'"',"`"].forEach(n=>{r===n&&(e.length>0&&e.includes(n)?e.splice(e.lastIndexOf(n),e.length-e.lastIndexOf(n)):e.push(r));});return e.join("")}function ki(t,e){return sw.get(t,e)}function js(t){let e=new AbortController;for(let r of t){if(r?.aborted)return e.abort(r.reason),r;r?.addEventListener("abort",()=>e.abort(r.reason),{signal:e.signal});}return e.signal}var Vt=class extends Error{constructor(r){super(`${r.status} ${r.statusText}`);this.name="HttpError",this.status=r.status,this.statusText=r.statusText,this.response=r;}};function Hs(t){return t instanceof Error&&t.name==="TimeoutError"||t instanceof Vt&&[408,499].includes(t.status)}function en(t){return t instanceof Error&&t.name==="AbortError"}function Df(t){let e=t.message||t.toString();return t.cause&&(e+=` +Caused by: `+Df(t.cause)),e}function Of(t){this.message=t;}Of.prototype=new Error,Of.prototype.name="InvalidCharacterError";var ow=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new Of("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,i=0,s=0,o="";n=e.charAt(s++);~n&&(r=i%4?64*r+n:n,i++%4)?o+=String.fromCharCode(255&r>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o};function LF(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw "Illegal base64url string!"}try{return function(r){return decodeURIComponent(ow(r).replace(/(.)/g,function(n,i){var s=i.charCodeAt(0).toString(16).toUpperCase();return s.length<2&&(s="0"+s),"%"+s}))}(e)}catch{return ow(e)}}function Ia(t){this.message=t;}function $F(t,e){if(typeof t!="string")throw new Ia("Invalid token specified");var r=(e=e||{}).header===!0?0:1;try{return JSON.parse(LF(t.split(".")[r]))}catch(n){throw new Ia("Invalid token specified: "+n.message)}}Ia.prototype=new Error,Ia.prototype.name="InvalidTokenError";var ka=$F;var zd=$t(Vf()),Q0=$t(xa()),eR=$t(Ud());var Vd=class extends events.EventEmitter{constructor(r){super();this.filepath=r;this.data={};}async load(){this.data=await zd.default.readJson(Gd,{throws:!1})||{};}async save(){await zd.default.outputJson(Gd,this.data);}watch(){this.watcher=eR.default.watch(this.filepath,{interval:1e3});let r=async()=>{let n=this.data;await this.load(),(0, Q0.default)(n,this.data)||super.emit("updated",this.data);};this.watcher.on("add",r),this.watcher.on("change",r);}},Gd=Gx__default.default.join(aT__default.default.homedir(),".tabby-client","agent","data.json"),ri=new Vd(Gd);var Du=$t(ux()),bx=$t(gx());var Xh=class{constructor(){this.streamOptions={filename:Gx__default.default.join(aT__default.default.homedir(),".tabby-client","agent","logs","%DATE%"),frequency:"daily",size:"10M",max_logs:"30d",extension:".log",create_symlink:!0};}write(e){this.stream||(this.stream=bx.getStream(this.streamOptions)),this.stream.write(e);}},_x=new Xh,yx={serializers:{error:Du.default.stdSerializers.err}},ht=_x?(0, Du.default)(yx,_x):(0, Du.default)(yx);ht.level="silent";var ho=[ht];ht.onChild=t=>{ho.push(t);};var Qh=class extends Error{constructor(r){super();this.cause=r;this.name="RetryLimitReachedError";}},Ou=class t extends events.EventEmitter{constructor(r){super();this.endpoint=r;this.logger=ht.child({component:"Auth"});this.authApi=Jn({baseUrl:"https://app.tabbyml.com/api"});}static{this.authPageUrl="https://app.tabbyml.com/account/device-token";}static{this.tokenStrategy={polling:{interval:5e3,timeout:5*60*1e3},refresh:{interval:15*60*1e3,beforeExpire:30*60*1e3,whenLoaded:{maxTry:5,retryDelay:1e3},whenScheduled:{maxTry:60,retryDelay:30*1e3}}};}async init(r){r?.dataStore?this.dataStore=r.dataStore:(this.dataStore=ri,ri&&(ri.on("updated",async()=>{await this.load(),super.emit("updated",this.jwt);}),ri.watch())),this.scheduleRefreshToken(),await this.load();}get token(){return this.jwt?.token}get user(){return this.jwt?.payload.email}async load(){if(this.dataStore)try{await this.dataStore.load();let r=this.dataStore.data.auth?.[this.endpoint]?.jwt;if(typeof r=="string"&&this.jwt?.token!==r){this.logger.debug({storedJwt:r},"Load jwt from data store.");let n={token:r,payload:ka(r)};n.payload.exp*1e3-Date.now()"u")return;delete this.dataStore.data.auth[this.endpoint];}await this.dataStore.save(),this.logger.debug("Save changes to data store.");}catch(r){this.logger.error({error:r},"Error when saving auth");}}async reset(){this.jwt&&(this.jwt=void 0,await this.save());}async requestAuthUrl(r){try{if(await this.reset(),r?.signal.aborted)throw r.signal.reason;this.logger.debug("Start to request device token");let n=await this.authApi.POST("/device-token",{body:{auth_url:this.endpoint},signal:r?.signal});if(n.error||!n.response.ok)throw new Vt(n.response);let i=n.data;this.logger.debug({deviceToken:i},"Request device token response");let s=new URL(t.authPageUrl);return s.searchParams.append("code",i.data.code),{authUrl:s.toString(),code:i.data.code}}catch(n){throw this.logger.error({error:n},"Error when requesting token"),n}}async pollingToken(r,n){return new Promise((i,s)=>{let o=js([AbortSignal.timeout(t.tokenStrategy.polling.timeout),n?.signal]),a=setInterval(async()=>{try{let l=await this.authApi.POST("/device-token/accept",{params:{query:{code:r}},signal:o});if(l.error||!l.response.ok)throw new Vt(l.response);let d=l.data;this.logger.debug({result:d},"Poll jwt response"),this.jwt={token:d.data.jwt,payload:ka(d.data.jwt)},super.emit("updated",this.jwt),await this.save(),clearInterval(a),i(!0);}catch(l){l instanceof Vt&&[400,401,403,405].includes(l.status)?this.logger.debug({error:l},"Expected error when polling jwt"):this.logger.error({error:l},"Error when polling jwt");}},t.tokenStrategy.polling.interval);o.aborted?(clearInterval(a),s(o.reason)):o.addEventListener("abort",()=>{clearInterval(a),s(o.reason);});})}async refreshToken(r,n={maxTry:1,retryDelay:1e3},i=0){try{this.logger.debug({retry:i},"Start to refresh token");let s=await this.authApi.POST("/device-token/refresh",{headers:{Authorization:`Bearer ${r.token}`}});if(s.error||!s.response.ok)throw new Vt(s.response);let o=s.data;return this.logger.debug({refreshedJwt:o},"Refresh token response"),{token:o.data.jwt,payload:ka(o.data.jwt)}}catch(s){if(s instanceof Vt&&[400,401,403,405].includes(s.status))this.logger.debug({error:s},"Error when refreshing jwt");else if(this.logger.error({error:s},"Unknown error when refreshing jwt"),isetTimeout(o,n.retryDelay)),this.refreshToken(r,n,i+1);throw new Qh(s)}}scheduleRefreshToken(){setInterval(async()=>{if(this.jwt)if(this.jwt.payload.exp*1e3-Date.now(){let n=this.data;await this.load(),(0, NS.default)(n,this.data)||super.emit("updated",this.data);};this.watcher.on("add",r),this.watcher.on("change",r);}async createTemplate(){try{await zu.default.outputFile(this.filepath,PS);}catch(r){this.logger.error({error:r},"Failed to create config template file");}}},dL=XS__default.default.join(pv__default.default.homedir(),".tabby-client","agent","config.toml"),Hr=new Gu(dL);var Un=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,LS=new Set,Vu=typeof process=="object"&&process?process:{},$S=(t,e,r,n)=>{typeof Vu.emitWarning=="function"?Vu.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},Us=globalThis.AbortController,kS=globalThis.AbortSignal;if(typeof Us>"u"){kS=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,s){this._onabort.push(s);}},Us=class{constructor(){e();}signal=new kS;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let s of this.signal._onabort)s(n);this.signal.onabort?.(n);}}};let t=Vu.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,$S("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var pL=t=>!LS.has(t),Gt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),DS=t=>Gt(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?jr:null:null,jr=class extends Array{constructor(e){super(e),this.fill(0);}},Ku=class t{heap;length;static#l=!1;static create(e){let r=DS(e);if(!r)return [];t.#l=!0;let n=new t(e,r);return t.#l=!1,n}constructor(e,r){if(!t.#l)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},Hs=class t{#l;#f;#y;#p;#I;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#m;#i;#r;#e;#u;#h;#a;#s;#g;#o;#v;#E;#_;#w;#x;#c;static unsafeExposeInternals(e){return {starts:e.#E,ttls:e.#_,sizes:e.#v,keyMap:e.#i,keyList:e.#r,valList:e.#e,next:e.#u,prev:e.#h,get head(){return e.#a},get tail(){return e.#s},free:e.#g,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,n,s,i)=>e.#F(r,n,s,i),moveToTail:r=>e.#T(r),indexes:r=>e.#b(r),rindexes:r=>e.#S(r),isStale:r=>e.#d(r)}}get max(){return this.#l}get maxSize(){return this.#f}get calculatedSize(){return this.#m}get size(){return this.#n}get fetchMethod(){return this.#I}get dispose(){return this.#y}get disposeAfter(){return this.#p}constructor(e){let{max:r=0,ttl:n,ttlResolution:s=1,ttlAutopurge:i,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:f,dispose:d,disposeAfter:u,noDisposeOnSet:p,noUpdateTTL:m,maxSize:g=0,maxEntrySize:y=0,sizeCalculation:S,fetchMethod:E,noDeleteOnFetchRejection:A,noDeleteOnStaleGet:b,allowStaleOnFetchRejection:T,allowStaleOnFetchAbort:F,ignoreFetchAbort:k}=e;if(r!==0&&!Gt(r))throw new TypeError("max option must be a nonnegative integer");let H=r?DS(r):Array;if(!H)throw new Error("invalid max value: "+r);if(this.#l=r,this.#f=g,this.maxEntrySize=y||this.#f,this.sizeCalculation=S,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(E!==void 0&&typeof E!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#I=E,this.#x=!!E,this.#i=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#u=new H(r),this.#h=new H(r),this.#a=0,this.#s=0,this.#g=Ku.create(r),this.#n=0,this.#m=0,typeof d=="function"&&(this.#y=d),typeof u=="function"?(this.#p=u,this.#o=[]):(this.#p=void 0,this.#o=void 0),this.#w=!!this.#y,this.#c=!!this.#p,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!A,this.allowStaleOnFetchRejection=!!T,this.allowStaleOnFetchAbort=!!F,this.ignoreFetchAbort=!!k,this.maxEntrySize!==0){if(this.#f!==0&&!Gt(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!Gt(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#D();}if(this.allowStale=!!f,this.noDeleteOnStaleGet=!!b,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=Gt(s)||s===0?s:1,this.ttlAutopurge=!!i,this.ttl=n||0,this.ttl){if(!Gt(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#M();}if(this.#l===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#l&&!this.#f){let B="LRU_CACHE_UNBOUNDED";pL(B)&&(LS.add(B),$S("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",B,t));}}getRemainingTTL(e){return this.#i.has(e)?1/0:0}#M(){let e=new jr(this.#l),r=new jr(this.#l);this.#_=e,this.#E=r,this.#N=(i,o,l=Un.now())=>{if(r[i]=o!==0?l:0,e[i]=o,o!==0&&this.ttlAutopurge){let f=setTimeout(()=>{this.#d(i)&&this.delete(this.#r[i]);},o+1);f.unref&&f.unref();}},this.#C=i=>{r[i]=e[i]!==0?Un.now():0;},this.#A=(i,o)=>{if(e[o]){let l=e[o],f=r[o];i.ttl=l,i.start=f,i.now=n||s();let d=i.now-f;i.remainingTTL=l-d;}};let n=0,s=()=>{let i=Un.now();if(this.ttlResolution>0){n=i;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return i};this.getRemainingTTL=i=>{let o=this.#i.get(i);if(o===void 0)return 0;let l=e[o],f=r[o];if(l===0||f===0)return 1/0;let d=(n||s())-f;return l-d},this.#d=i=>e[i]!==0&&r[i]!==0&&(n||s())-r[i]>e[i];}#C=()=>{};#A=()=>{};#N=()=>{};#d=()=>!1;#D(){let e=new jr(this.#l);this.#m=0,this.#v=e,this.#R=r=>{this.#m-=e[r],e[r]=0;},this.#k=(r,n,s,i)=>{if(this.#t(n))return 0;if(!Gt(s))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(s=i(n,r),!Gt(s))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return s},this.#P=(r,n,s)=>{if(e[r]=n,this.#f){let i=this.#f-e[r];for(;this.#m>i;)this.#O(!0);}this.#m+=e[r],s&&(s.entrySize=n,s.totalCalculatedSize=this.#m);};}#R=e=>{};#P=(e,r,n)=>{};#k=(e,r,n,s)=>{if(n||s)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#b({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#s;!(!this.#L(r)||((e||!this.#d(r))&&(yield r),r===this.#a));)r=this.#h[r];}*#S({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#a;!(!this.#L(r)||((e||!this.#d(r))&&(yield r),r===this.#s));)r=this.#u[r];}#L(e){return e!==void 0&&this.#i.get(this.#r[e])===e}*entries(){for(let e of this.#b())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*rentries(){for(let e of this.#S())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*keys(){for(let e of this.#b()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*rkeys(){for(let e of this.#S()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*values(){for(let e of this.#b())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#S())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of this.#b()){let s=this.#e[n],i=this.#t(s)?s.__staleWhileFetching:s;if(i!==void 0&&e(i,this.#r[n],this))return this.get(this.#r[n],r)}}forEach(e,r=this){for(let n of this.#b()){let s=this.#e[n],i=this.#t(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,this.#r[n],this);}}rforEach(e,r=this){for(let n of this.#S()){let s=this.#e[n],i=this.#t(s)?s.__staleWhileFetching:s;i!==void 0&&e.call(r,i,this.#r[n],this);}}purgeStale(){let e=!1;for(let r of this.#S({allowStale:!0}))this.#d(r)&&(this.delete(this.#r[r]),e=!0);return e}dump(){let e=[];for(let r of this.#b({allowStale:!0})){let n=this.#r[r],s=this.#e[r],i=this.#t(s)?s.__staleWhileFetching:s;if(i===void 0||n===void 0)continue;let o={value:i};if(this.#_&&this.#E){o.ttl=this.#_[r];let l=Un.now()-this.#E[r];o.start=Math.floor(Date.now()-l);}this.#v&&(o.size=this.#v[r]),e.unshift([n,o]);}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let s=Date.now()-n.start;n.start=Un.now()-s;}this.set(r,n.value,n);}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:s=this.ttl,start:i,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:f}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,u=this.#k(e,r,n.size||0,l);if(this.maxEntrySize&&u>this.maxEntrySize)return f&&(f.set="miss",f.maxEntrySizeExceeded=!0),this.delete(e),this;let p=this.#n===0?void 0:this.#i.get(e);if(p===void 0)p=this.#n===0?this.#s:this.#g.length!==0?this.#g.pop():this.#n===this.#l?this.#O(!1):this.#n,this.#r[p]=e,this.#e[p]=r,this.#i.set(e,p),this.#u[this.#s]=p,this.#h[p]=this.#s,this.#s=p,this.#n++,this.#P(p,u,f),f&&(f.set="add"),d=!1;else {this.#T(p);let m=this.#e[p];if(r!==m){if(this.#x&&this.#t(m)?m.__abortController.abort(new Error("replaced")):o||(this.#w&&this.#y?.(m,e,"set"),this.#c&&this.#o?.push([m,e,"set"])),this.#R(p),this.#P(p,u,f),this.#e[p]=r,f){f.set="replace";let g=m&&this.#t(m)?m.__staleWhileFetching:m;g!==void 0&&(f.oldValue=g);}}else f&&(f.set="update");}if(s!==0&&!this.#_&&this.#M(),this.#_&&(d||this.#N(p,s,i),f&&this.#A(f,p)),!o&&this.#c&&this.#o){let m=this.#o,g;for(;g=m?.shift();)this.#p?.(...g);}return this}pop(){try{for(;this.#n;){let e=this.#e[this.#a];if(this.#O(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#c&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#p?.(...r);}}}#O(e){let r=this.#a,n=this.#r[r],s=this.#e[r];return this.#x&&this.#t(s)?s.__abortController.abort(new Error("evicted")):(this.#w||this.#c)&&(this.#w&&this.#y?.(s,n,"evict"),this.#c&&this.#o?.push([s,n,"evict"])),this.#R(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#g.push(r)),this.#n===1?(this.#a=this.#s=0,this.#g.length=0):this.#a=this.#u[r],this.#i.delete(n),this.#n--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:s}=r,i=this.#i.get(e);if(i!==void 0){let o=this.#e[i];if(this.#t(o)&&o.__staleWhileFetching===void 0)return !1;if(this.#d(i))s&&(s.has="stale",this.#A(s,i));else return n&&this.#C(i),s&&(s.has="hit",this.#A(s,i)),!0}else s&&(s.has="miss");return !1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,s=this.#i.get(e);if(s!==void 0&&(n||!this.#d(s))){let i=this.#e[s];return this.#t(i)?i.__staleWhileFetching:i}}#F(e,r,n,s){let i=r===void 0?void 0:this.#e[r];if(this.#t(i))return i;let o=new Us,{signal:l}=n;l?.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});let f={signal:o.signal,options:n,context:s},d=(S,E=!1)=>{let{aborted:A}=o.signal,b=n.ignoreFetchAbort&&S!==void 0;if(n.status&&(A&&!E?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,b&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),A&&!b&&!E)return p(o.signal.reason);let T=g;return this.#e[r]===g&&(S===void 0?T.__staleWhileFetching?this.#e[r]=T.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,S,f.options))),S},u=S=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=S),p(S)),p=S=>{let{aborted:E}=o.signal,A=E&&n.allowStaleOnFetchAbort,b=A||n.allowStaleOnFetchRejection,T=b||n.noDeleteOnFetchRejection,F=g;if(this.#e[r]===g&&(!T||F.__staleWhileFetching===void 0?this.delete(e):A||(this.#e[r]=F.__staleWhileFetching)),b)return n.status&&F.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),F.__staleWhileFetching;if(F.__returned===F)throw S},m=(S,E)=>{let A=this.#I?.(e,i,f);A&&A instanceof Promise&&A.then(b=>S(b),E),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(S(),n.allowStaleOnFetchAbort&&(S=b=>d(b,!0)));});};n.status&&(n.status.fetchDispatched=!0);let g=new Promise(m).then(d,u),y=Object.assign(g,{__abortController:o,__staleWhileFetching:i,__returned:void 0});return r===void 0?(this.set(e,y,{...f.options,status:void 0}),r=this.#i.get(e)):this.#e[r]=y,y}#t(e){if(!this.#x)return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Us}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:f=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:u=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:g=this.ignoreFetchAbort,allowStaleOnFetchAbort:y=this.allowStaleOnFetchAbort,context:S,forceRefresh:E=!1,status:A,signal:b}=r;if(!this.#x)return A&&(A.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,status:A});let T={allowStale:n,updateAgeOnGet:s,noDeleteOnStaleGet:i,ttl:o,noDisposeOnSet:l,size:f,sizeCalculation:d,noUpdateTTL:u,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:y,ignoreFetchAbort:g,status:A,signal:b},F=this.#i.get(e);if(F===void 0){A&&(A.fetch="miss");let k=this.#F(e,F,T,S);return k.__returned=k}else {let k=this.#e[F];if(this.#t(k)){let U=n&&k.__staleWhileFetching!==void 0;return A&&(A.fetch="inflight",U&&(A.returnedStale=!0)),U?k.__staleWhileFetching:k.__returned=k}let H=this.#d(F);if(!E&&!H)return A&&(A.fetch="hit"),this.#T(F),s&&this.#C(F),A&&this.#A(A,F),k;let B=this.#F(e,F,T,S),M=B.__staleWhileFetching!==void 0&&n;return A&&(A.fetch=H?"stale":"refresh",M&&H&&(A.returnedStale=!0)),M?B.__staleWhileFetching:B.__returned=B}}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,status:o}=r,l=this.#i.get(e);if(l!==void 0){let f=this.#e[l],d=this.#t(f);return o&&this.#A(o,l),this.#d(l)?(o&&(o.get="stale"),d?(o&&n&&f.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?f.__staleWhileFetching:void 0):(i||this.delete(e),o&&n&&(o.returnedStale=!0),n?f:void 0)):(o&&(o.get="hit"),d?f.__staleWhileFetching:(this.#T(l),s&&this.#C(l),f))}else o&&(o.get="miss");}#$(e,r){this.#h[r]=e,this.#u[e]=r;}#T(e){e!==this.#s&&(e===this.#a?this.#a=this.#u[e]:this.#$(this.#h[e],this.#u[e]),this.#$(this.#s,e),this.#s=e);}delete(e){let r=!1;if(this.#n!==0){let n=this.#i.get(e);if(n!==void 0)if(r=!0,this.#n===1)this.clear();else {this.#R(n);let s=this.#e[n];this.#t(s)?s.__abortController.abort(new Error("deleted")):(this.#w||this.#c)&&(this.#w&&this.#y?.(s,e,"delete"),this.#c&&this.#o?.push([s,e,"delete"])),this.#i.delete(e),this.#r[n]=void 0,this.#e[n]=void 0,n===this.#s?this.#s=this.#h[n]:n===this.#a?this.#a=this.#u[n]:(this.#u[this.#h[n]]=this.#u[n],this.#h[this.#u[n]]=this.#h[n]),this.#n--,this.#g.push(n);}}if(this.#c&&this.#o?.length){let n=this.#o,s;for(;s=n?.shift();)this.#p?.(...s);}return r}clear(){for(let e of this.#S({allowStale:!0})){let r=this.#e[e];if(this.#t(r))r.__abortController.abort(new Error("deleted"));else {let n=this.#r[e];this.#w&&this.#y?.(r,n,"delete"),this.#c&&this.#o?.push([r,n,"delete"]);}}if(this.#i.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#_&&this.#E&&(this.#_.fill(0),this.#E.fill(0)),this.#v&&this.#v.fill(0),this.#a=0,this.#s=0,this.#g.length=0,this.#m=0,this.#n=0,this.#c&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#p?.(...r);}}};var zS=He(WS());function gL(t){return t.trimEnd().split("").every(e=>Di.includes(e))}var hr=class{constructor(e){this.filepath=e.filepath,this.language=e.language,this.text=e.text,this.position=e.position,this.indentation=e.indentation,this.prefix=e.text.slice(0,e.position),this.suffix=e.text.slice(e.position),this.prefixLines=me(this.prefix),this.suffixLines=me(this.suffix),this.currentLinePrefix=this.prefixLines[this.prefixLines.length-1]??"",this.currentLineSuffix=this.suffixLines[0]??"",this.clipboard=e.clipboard?.trim()??"";let r=gL(this.suffixLines[0]??"");this.mode=r?"default":"fill-in-line",this.hash=(0, zS.default)({filepath:this.filepath,language:this.language,text:this.text,position:this.position,clipboard:this.clipboard});}};var js=class{constructor(){this.logger=Te.child({component:"CompletionCache"});this.options={maxCount:1e4,prebuildCache:{enabled:!0,perCharacter:{lines:1,max:50},perLine:{max:10},autoClosingPairCheck:{max:3}}};this.cache=new Hs({max:this.options.maxCount});}has(e){return this.cache.has(e.hash)}buildCache(e,r){this.logger.debug({key:e,value:r},"Starting to build cache");let n=this.createCacheEntries(e,r);n.forEach(s=>{this.cache.set(s.key.hash,{value:s.value,rebuildFlag:s.rebuildFlag});}),this.logger.debug({newEntries:n.length,cacheSize:this.cache.size},"Cache updated");}get(e){let r=this.cache.get(e.hash);return r?.rebuildFlag&&this.buildCache(e,r?.value),r?.value}createCacheEntries(e,r){let n=[{key:e,value:r,rebuildFlag:!1}];if(this.options.prebuildCache.enabled)for(let i of r.choices){let o=i.text.slice(e.position-i.replaceRange.start),l=this.getPerLinePositions(o);this.logger.trace({completionText:o,perLinePositions:l},"Calculate per-line cache positions");for(let d of l){let u=o.slice(0,d),p=this.generateAutoClosedPrefixes(u);for(let m of [u,...p]){let g={key:new hr({...e,text:e.text.slice(0,e.position)+m+e.text.slice(e.position),position:e.position+d}),value:{...r,choices:[{index:i.index,text:o.slice(d),replaceRange:{start:e.position+d,end:e.position+d}}]},rebuildFlag:!0};this.logger.trace({prefix:m,entry:g},"Build per-line cache entry"),n.push(g);}}let f=this.getPerCharacterPositions(o);this.logger.trace({completionText:o,perCharacterPositions:f},"Calculate per-character cache positions");for(let d of f){let u=d;for(;u>0&&o[u-1]!==` -`;)u--;let p=o.slice(0,d),m=this.generateAutoClosedPrefixes(p);for(let g of [p,...m]){let y={key:new hr({...e,text:e.text.slice(0,e.position)+g+e.text.slice(e.position),position:e.position+d}),value:{...r,choices:[{index:i.index,text:o.slice(u),replaceRange:{start:e.position+u,end:e.position+d}}]},rebuildFlag:!1};this.logger.trace({prefix:g,entry:y},"Build per-character cache entry"),n.push(y);}}}return n.reduce((i,o)=>{let l=i.find(f=>f.key.hash===o.key.hash);return l?(l.value.choices.push(...o.value.choices),l.rebuildFlag=l.rebuildFlag||o.rebuildFlag):i.push(o),i},[])}getPerLinePositions(e){let r=[],n=this.options.prebuildCache,s=me(e),i=0,o=0;for(;is;s++){let o=um.indexOf(n[n.length-1-s]);if(o<0)break;i=i+Di[o],r.push(e+i);}return r}};function Ju(t,e,r){return Math.max(t,Math.min(e,r))}var Ws=class{constructor(){this.lastCalledTimeStamp=0;this.baseInterval=200;this.calledIntervalHistory=[];this.options={baseIntervalSlideWindowAvg:{minSize:20,maxSize:100,min:100,max:400},adaptiveRate:{min:1.5,max:3},contextScoreWeights:{triggerCharacter:.5,noSuffixInCurrentLine:.4,noSuffix:.1},requestDelay:{min:100,max:1e3}};}async debounce(e,r){let{request:n,config:s,responseTime:i}=e;if(n.manually)return this.sleep(0,r);if(s.mode==="fixed")return this.sleep(s.interval,r);let o=Date.now();this.updateBaseInterval(o-this.lastCalledTimeStamp),this.lastCalledTimeStamp=o;let l=this.calcContextScore(n),d=(this.options.adaptiveRate.max-(this.options.adaptiveRate.max-this.options.adaptiveRate.min)*l)*this.baseInterval,u=Ju(this.options.requestDelay.min,this.options.requestDelay.max,d-i);return this.sleep(u,r)}async sleep(e,r){return new Promise((n,s)=>{let i=setTimeout(n,Math.min(e,2147483647));r?.signal&&(r.signal.aborted?(clearTimeout(i),s(r.signal.reason)):r.signal.addEventListener("abort",()=>{clearTimeout(i),s(r.signal.reason);}));})}updateBaseInterval(e){if(!(e>this.options.baseIntervalSlideWindowAvg.max)&&(this.calledIntervalHistory.push(e),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.maxSize&&this.calledIntervalHistory.shift(),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.minSize)){let r=this.calledIntervalHistory.reduce((n,s)=>n+s,0)/this.calledIntervalHistory.length;this.baseInterval=Ju(this.options.baseIntervalSlideWindowAvg.min,this.options.baseIntervalSlideWindowAvg.max,r);}}calcContextScore(e){let r=0,n=this.options.contextScoreWeights,s=e.text[e.position-1]??"";r+=s.match(/^\W*$/)?n.triggerCharacter:0;let i=e.text.slice(e.position)??"",o=me(i)[0]??"";return r+=o.match(/^\W*$/)?n.noSuffixInCurrentLine:0,r+=i.match(/^\W*$/)?n.noSuffix:0,r=Ju(0,1,r),r}};var he=Te.child({component:"Postprocess"});Array.prototype.distinct||(Array.prototype.distinct=function(t){return [...new Map(this.map(e=>[t?.(e)??e,e])).values()]});Array.prototype.mapAsync||(Array.prototype.mapAsync=async function(t,e){return await Promise.all(this.map((r,n)=>t.call(e,r,n,this)))});function Ge(t,e){return Xu(async r=>{let n=e.position-r.replaceRange.start,s=r.text.slice(n),i=await t(s,e);return r.text=r.text.slice(0,n)+(i??""),r},e)}function Xu(t,e){return async r=>(r.choices=(await r.choices.mapAsync(async n=>await t(n,e))).filter(n=>!!n&&!!n.text).distinct(n=>n.text),r)}function _L(t){return /\n(\s*)\n/g}function GS(){return (t,e)=>{let r=t.split(_L()),n=0,s=2,i=r.length-2;for(;i>=1;){if(se(r[i])){i--;continue}let o=i-1;for(;o>=0&&se(r[o]);)o--;if(o<0)break;let l=r[i].trim(),f=r[o].trim(),d=Math.max(.1*l.length,.1*f.length);if(Cr(l,f)<=d)n++,i--;else break}return n>=s?(he.debug({inputBlocks:r,repetitionCount:n},"Remove repetitive blocks."),r.slice(0,i+1).join("").trimEnd()):t}}function VS(){return t=>{let e=me(t),r=0,n=5,s=e.length-2;for(;s>=1;){if(se(e[s])){s--;continue}let i=s-1;for(;i>=0&&se(e[i]);)i--;if(i<0)break;let o=e[s].trim(),l=e[i].trim(),f=Math.max(.1*o.length,.1*l.length);if(Cr(o,l)<=f)r++,s=i;else break}return r>=n?(he.debug({inputLines:e,repetitionCount:r},"Remove repetitive lines."),e.slice(0,s+1).join("").trimEnd()):t}}var yL=[/(.{3,}?)\1{5,}$/g,/(.{10,}?)\1{3,}$/g];function KS(){return t=>{let e=me(t),r=e.length-1;for(;r>=0&&se(e[r]);)r--;if(r<0)return t;for(let n of yL){let s=e[r].match(n);if(s)return he.debug({inputLines:e,lineNumber:r,match:s},"Remove line ends with repetition."),r<1?null:e.slice(0,r).join("").trimEnd()}return t}}function ZS(){return (t,e)=>{let{suffixLines:r,currentLinePrefix:n}=e,s=me(t);if(s.length<2)return t;let i=s.map((d,u)=>u===0?n+d:d);if(!$i(i,s.length-1))return t;let o=s[s.length-1],l=1;for(;l=r.length)return t;let f=r[l];return o.startsWith(f)||f.startsWith(o)?(he.debug({inputLines:s,suffixLines:r},"Removing duplicated block closing line"),s.slice(0,s.length-1).join("").trimEnd()):t}}function wL(t,e,r,n){let s={indentLevelLimit:0,allowClosingLine:!0},{prefixLines:i,suffixLines:o,currentLinePrefix:l}=r;if(t.length==0||i.length==0)return s;let f=se(l),d=i.length-1;for(;d>=0&&se(i[d]);)d--;if(d<0)return s;let u=i[d],p=mt(u),m=t[0],g=se(m),y=0;for(;y=t.length)return s;let S=t[y],E;g?E=mt(S):E=mt(l+S),!g&&!f?n.experimentalKeepBlockScopeWhenCompletingLine?s.indentLevelLimit=p:(s.indentLevelLimit=p+1,s.allowClosingLine&&=wa(e,0)):E>p?s.indentLevelLimit=p+1:(s.indentLevelLimit=p);let A=1;for(;A{let{prefixLines:n,suffixLines:s,currentLinePrefix:i}=r,o=me(e),l=o.map((u,p)=>p===0?i+u:u),f=wL(o,l,r,t),d=1;for(;d=0&&t[r]?.match(/\s/);)r--;if(r<0)return 0;let n=t.lastIndexOf(` -`,r);if(n<0)return 0;let i=t.slice(n+1,e).search(/\S/);return n+1+i}function EL(t,e){let r=e;for(;r=t.length)return t.length;let n=t.indexOf(` -`,r);return n<0?t.length:n}function AL(t,e){for(let r of e){let n=t;for(;n;){if(r.includes(n.type))return n;n=n.parent;}}return t}function rv(){return async(t,e)=>{let{position:r,text:n,language:s,prefix:i,suffix:o}=e;if(!SL.includes(s))throw new Error(`Language ${s} is not supported`);let l=zr[s],f=await Gs(l),d=i+t+o,u=f.parse(d),p=vL(d,r),m=EL(d,r),g=AL(u.rootNode.namedDescendantForIndex(p,m),tv[l]??[]);if(g.type=="ERROR")throw new Error("Cannot determine syntax scope.");return g.endIndex{if(t.experimentalSyntax)try{return await rv()(e,r)}catch(s){he.debug({error:s},"Failed to limit scope by syntax parser");}return YS(t.indentation)(e,r)}}function Qu(t){let e={" ":0," ":0," ":0};for(let r of t)if(r.match(/^\t/))e[" "]++;else {let n=r.match(/^ */)?.[0].length??0;n>0&&(n%4===0&&e[" "]++,n%2===0&&e[" "]++);}return e[" "]>0?" ":e[" "]>e[" "]?" ":e[" "]>0?" ":null}function xL(t,e){return e===" "?t.match(/^\t*/g)?.[0].length??0:(t.match(/^ */)?.[0].length??0)/e.length}function iv(){return (t,e)=>{let{prefixLines:r,suffixLines:n,currentLinePrefix:s,indentation:i}=e,o=me(t);if(!i)return t;let l=se(s)?r.slice(0,r.length-1):r;if(r.length>1&&Qu(l)!==null)return t;let f=n.slice(1);if(n.length>1&&Qu(f)!==null)return t;let d=o.map((m,g)=>g===0?s+m:m),u=Qu(d);if(u===null||u===i)return t;let p=d.map((m,g)=>{let y=xL(m,u);if(y===0)return o[g];let S=m.slice(u.length*y);return g===0?se(s)?i.repeat(y).slice(s.length)+S:o[0]:i.repeat(y)+S});return he.debug({prefixLines:r,suffixLines:n,inputLines:o,formatted:p},"Format indentation."),p.join("")}}function ec(){return (t,e)=>{let{currentLinePrefix:r,currentLineSuffix:n}=e,s=t;return !se(r)&&r.match(/\s$/)&&(s=s.trimStart()),(se(n)||!se(n)&&n.match(/^\s/))&&(s=s.trimEnd()),s}}function sv(){return (t,e)=>{let r=me(t);if(e.mode==="fill-in-line"&&r.length>1){let n=e.currentLineSuffix.trimEnd(),s=r[0].trimEnd();if(s.endsWith(n)){let i=s.slice(0,-n.length);if(i.length>0)return he.debug({inputLines:r,trimmedInputLine:i},"Trim content with multiple lines"),i}return he.debug({inputLines:r},"Drop content with multiple lines"),null}return t}}function tc(){return (t,e)=>{let{suffixLines:r}=e,n=me(t),s=0;for(;sse(t)?null:t}function ov(t,e){let{currentLineSuffix:r}=e,n=r.trimEnd();if(se(n))return t;let s=t.text.slice(e.position-t.replaceRange.start),i=qi(s);return se(i)||(n.startsWith(i)?(t.replaceRange.end=e.position+i.length,he.trace({context:e,completion:t.text,range:t.replaceRange,unpaired:i},"Adjust replace range by bracket stack")):i.startsWith(n)&&(t.replaceRange.end=e.position+n.length,he.trace({context:e,completion:t.text,range:t.replaceRange,unpaired:i},"Adjust replace range by bracket stack"))),t}var CL=Object.keys(zr);async function av(t,e){let{position:r,prefix:n,suffix:s,prefixLines:i,currentLinePrefix:o,currentLineSuffix:l,language:f}=e,d=l.trimEnd();if(se(d))return t;if(!CL.includes(f))throw new Error(`Language ${f} is not supported`);let u=zr[f],p=await Gs(u),m=t.text.slice(r-t.replaceRange.start),g=me(m),y=0,S=p.parse(n+m+s),E=S.rootNode.namedDescendantForIndex(n.length+m.length);for(;E.hasError()&&y{if(t.experimentalSyntax)try{return await av(e,r)}catch(s){he.debug({error:s},"Failed to calculate replace range by syntax parser");}return ov(e,r)}}async function uv(t,e,r){return Promise.resolve(r).then(Ge(sv(),t)).then(Ge(KS(),t)).then(Ge(tc(),t)).then(Ge(ec(),t)).then(Ge(rc(),t))}async function cv(t,e,r){return Promise.resolve(r).then(Ge(GS(),t)).then(Ge(VS(),t)).then(Ge(nv(e.limitScope),t)).then(Ge(ZS(),t)).then(Ge(iv(),t)).then(Ge(tc(),t)).then(Ge(ec(),t)).then(Ge(rc(),t)).then(Xu(lv(e.calculateReplaceRange),t))}var hv="tabby-agent",dv="1.2.0";var Vs=class{constructor(){this.anonymousUsageTrackingApi=Xt({baseUrl:"https://app.tabbyml.com/api"});this.logger=Te.child({component:"AnonymousUsage"});this.systemData={agent:`${hv}, ${dv}`,browser:void 0,node:`${process.version} ${process.platform} ${pv__default.default.arch()} ${pv__default.default.release()}`};this.sessionProperties={};this.userProperties={};this.userPropertiesUpdated=!1;this.emittedUniqueEvent=[];this.disabled=!1;}async init(e){if(this.dataStore=e?.dataStore||sr,this.dataStore){try{await this.dataStore.load();}catch(r){this.logger.debug({error:r},"Error when loading anonymousId");}if(typeof this.dataStore.data.anonymousId=="string")this.anonymousId=this.dataStore.data.anonymousId;else {this.anonymousId=St(),this.dataStore.data.anonymousId=this.anonymousId;try{await this.dataStore.save();}catch(r){this.logger.debug({error:r},"Error when saving anonymousId");}}}else this.anonymousId=St();}setSessionProperties(e,r){Jt(this.sessionProperties,e,r);}setUserProperties(e,r){Jt(this.userProperties,e,r),this.userPropertiesUpdated=!0;}async uniqueEvent(e,r={}){await this.event(e,r,!0);}async event(e,r={},n=!1){if(this.disabled||!this.anonymousId||n&&this.emittedUniqueEvent.includes(e))return;n&&this.emittedUniqueEvent.push(e);let s={...this.systemData,...this.sessionProperties,...r};this.userPropertiesUpdated&&(Jt(s,"$set",this.userProperties),this.userPropertiesUpdated=!1);try{await this.anonymousUsageTrackingApi.POST("/usage",{body:{distinctId:this.anonymousId,event:e,properties:s}});}catch(i){this.logger.error({error:i},"Error when sending anonymous usage data");}}};var oc=He(yv()),Ks=class{constructor(){this.sum=0;this.quantity=0;}add(e){this.sum+=e,this.quantity+=1;}mean(){if(this.quantity!==0)return this.sum/this.quantity}count(){return this.quantity}},Zs=class{constructor(e){this.values=[];this.maxSize=e;}add(e){this.values.push(e),this.values.length>this.maxSize&&this.values.shift();}getValues(){return this.values}},Ys=class{constructor(){this.config={windowSize:10,checks:{disable:!1,healthy:{windowSize:3,latency:2400},slowResponseTime:{latency:3200,count:3},highTimeoutRate:{rate:.5,count:3}}};this.autoCompletionCount=0;this.manualCompletionCount=0;this.cacheHitCount=0;this.cacheMissCount=0;this.eventMap=new Map;this.completionRequestLatencyStats=new oc.Univariate;this.completionRequestCanceledStats=new Ks;this.completionRequestTimeoutCount=0;this.recentCompletionRequestLatencies=new Zs(this.config.windowSize);}updateConfigByRequestTimeout(e){this.config.checks.healthy.latency=e*.6,this.config.checks.slowResponseTime.latency=e*.8,this.resetWindowed();}add(e){let{triggerMode:r,cacheHit:n,aborted:s,requestSent:i,requestLatency:o,requestCanceled:l,requestTimeout:f}=e;s||(r==="auto"?this.autoCompletionCount+=1:this.manualCompletionCount+=1,n?this.cacheHitCount+=1:this.cacheMissCount+=1),i&&(l?this.completionRequestCanceledStats.add(o):f?this.completionRequestTimeoutCount+=1:this.completionRequestLatencyStats.add(o),l||this.recentCompletionRequestLatencies.add(o));}addEvent(e){let r=this.eventMap.get(e)||0;this.eventMap.set(e,r+1);}reset(){this.autoCompletionCount=0,this.manualCompletionCount=0,this.cacheHitCount=0,this.cacheMissCount=0,this.eventMap=new Map,this.completionRequestLatencyStats=new oc.Univariate,this.completionRequestCanceledStats=new Ks,this.completionRequestTimeoutCount=0;}resetWindowed(){this.recentCompletionRequestLatencies=new Zs(this.config.windowSize);}stats(){let e=Object.fromEntries(Array.from(this.eventMap.entries()).map(([r,n])=>["count_"+r,n]));return {completion:{count_auto:this.autoCompletionCount,count_manual:this.manualCompletionCount,cache_hit:this.cacheHitCount,cache_miss:this.cacheMissCount,...e},completion_request:{count:this.completionRequestLatencyStats.count(),latency_avg:this.completionRequestLatencyStats.mean(),latency_p50:this.completionRequestLatencyStats.percentile(50),latency_p95:this.completionRequestLatencyStats.percentile(95),latency_p99:this.completionRequestLatencyStats.percentile(99)},completion_request_canceled:{count:this.completionRequestCanceledStats.count(),latency_avg:this.completionRequestCanceledStats.mean()},completion_request_timeout:{count:this.completionRequestTimeoutCount}}}windowed(){let e=this.recentCompletionRequestLatencies.getValues(),r=e.filter(i=>Number.isNaN(i)),n=e.filter(i=>!Number.isNaN(i)),s=n.reduce((i,o)=>i+o,0)/n.length;return {values:e,stats:{total:e.length,timeouts:r.length,responses:n.length,averageResponseTime:s}}}check(e){if(this.config.checks.disable)return null;let r=this.config.checks,{values:n,stats:{total:s,timeouts:i,responses:o,averageResponseTime:l}}=e;return n.slice(-Math.max(this.config.windowSize,r.healthy.windowSize)).every(f=>fr.highTimeoutRate.rate&&i>=r.highTimeoutRate.count?"highTimeoutRate":l>r.slowResponseTime.latency&&o>=r.slowResponseTime.count?"slowResponseTime":null}};var Xs=class t extends events.EventEmitter{constructor(){super();this.logger=Te.child({component:"TabbyAgent"});this.anonymousUsageLogger=new Vs;this.config=Wu;this.userConfig={};this.clientConfig={};this.status="notInitialized";this.issues=[];this.completionCache=new js;this.completionDebounce=new Ws;this.completionProviderStats=new Ys;this.tryingConnectTimer=setInterval(async()=>{this.status==="disconnected"&&(this.logger.debug("Trying to connect..."),await this.healthCheck());},t.tryConnectInterval),this.submitStatsTimer=setInterval(async()=>{await this.submitStats();},t.submitStatsInterval);}static{this.tryConnectInterval=1e3*30;}static{this.submitStatsInterval=1e3*60*60*24;}async applyConfig(){let r=this.config,n=this.status;this.config=em(Wu,this.userConfig,this.clientConfig),Bn.forEach(i=>i.level=this.config.logs.level),this.anonymousUsageLogger.disabled=this.config.anonymousUsageTracking.disable,se(this.config.server.token)&&this.config.server.requestHeaders.Authorization===void 0?this.config.server.endpoint!==this.auth?.endpoint&&(this.auth=new Bs(this.config.server.endpoint),await this.auth.init({dataStore:this.dataStore}),this.auth.on("updated",()=>{this.setupApi();})):this.auth=void 0,(0, Js.default)(r.server,this.config.server)||(this.serverHealthState=void 0,this.completionProviderStats.resetWindowed(),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"),this.popIssue("connectionFailed"),this.connectionErrorMessage=void 0),await this.setupApi(),(0, Js.default)(r.server,this.config.server)||n==="unauthorized"&&this.status==="unauthorized"&&this.emitAuthRequired(),r.completion.timeout!==this.config.completion.timeout&&(this.completionProviderStats.updateConfigByRequestTimeout(this.config.completion.timeout),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"));let s={event:"configUpdated",config:this.config};this.logger.debug({event:s},"Config updated"),super.emit("configUpdated",s);}async setupApi(){let r=se(this.config.server.token)?this.auth?.token?`Bearer ${this.auth.token}`:void 0:`Bearer ${this.config.server.token}`;this.api=Xt({baseUrl:this.config.server.endpoint.replace(/\/+$/,""),headers:{Authorization:r,...this.config.server.requestHeaders}}),await this.healthCheck();}changeStatus(r){if(this.status!=r){this.status=r;let n={event:"statusChanged",status:r};this.logger.debug({event:n},"Status changed"),super.emit("statusChanged",n),this.status==="unauthorized"&&this.emitAuthRequired();}}issueFromName(r){switch(r){case"highCompletionTimeoutRate":return {name:"highCompletionTimeoutRate",completionResponseStats:this.completionProviderStats.windowed().stats};case"slowCompletionResponseTime":return {name:"slowCompletionResponseTime",completionResponseStats:this.completionProviderStats.windowed().stats};case"connectionFailed":return {name:"connectionFailed",message:this.connectionErrorMessage}}}pushIssue(r){this.issues.includes(r)||(this.issues.push(r),this.logger.debug({issue:r},"Issues Pushed"),this.emitIssueUpdated());}popIssue(r){let n=this.issues.indexOf(r);n>=0&&(this.issues.splice(n,1),this.logger.debug({issue:r},"Issues Popped"),this.emitIssueUpdated());}emitAuthRequired(){let r={event:"authRequired",server:this.config.server};super.emit("authRequired",r);}emitIssueUpdated(){let r={event:"issuesUpdated",issues:this.issues};super.emit("issuesUpdated",r);}async submitStats(){let r=this.completionProviderStats.stats();r.completion_request.count>0&&(await this.anonymousUsageLogger.event("AgentStats",{stats:r}),this.completionProviderStats.reset(),this.logger.debug({stats:r},"Stats submitted"));}createAbortSignal(r){let n=Math.min(2147483647,r?.timeout||this.config.server.requestTimeout);return pn([AbortSignal.timeout(n),r?.signal])}async healthCheck(r){let n=St(),s="/v1/health",i=this.config.server.endpoint+s,o={signal:this.createAbortSignal(r)};try{if(!this.api)throw new Error("http client not initialized");this.logger.debug({requestId:n,requestOptions:o,url:i},"Health check request");let l=await this.api.GET(s,o);if(l.error||!l.response.ok)throw new je(l.response);this.logger.debug({requestId:n,response:l},"Health check response"),this.changeStatus("ready"),this.popIssue("connectionFailed"),this.connectionErrorMessage=void 0;let f=l.data;typeof f=="object"&&f.model!==void 0&&f.device!==void 0&&(this.serverHealthState=f,this.anonymousUsageLogger.uniqueEvent("AgentConnected",f));}catch(l){if(this.serverHealthState=void 0,l instanceof je&&[401,403,405].includes(l.status))this.logger.debug({requestId:n,error:l},"Health check error: unauthorized"),this.changeStatus("unauthorized");else {if(mn(l))this.logger.debug({requestId:n,error:l},"Health check error: timeout"),this.connectionErrorMessage=`GET ${i}: Timed out.`;else if(Qt(l))this.logger.debug({requestId:n,error:l},"Health check error: canceled"),this.connectionErrorMessage=`GET ${i}: Canceled.`;else {this.logger.error({requestId:n,error:l},"Health check error: unknown error");let f=l instanceof Error?ba(l):JSON.stringify(l);this.connectionErrorMessage=`GET ${i}: Request failed: -${f}`;}this.pushIssue("connectionFailed"),this.changeStatus("disconnected");}}}createSegments(r){let n=this.config.completion.prompt.maxPrefixLines,s=this.config.completion.prompt.maxSuffixLines,{prefixLines:i,suffixLines:o}=r,l=i.slice(Math.max(i.length-n,0)).join(""),f;this.config.completion.prompt.experimentalStripAutoClosingCharacters&&r.mode!=="fill-in-line"?f=` -`+o.slice(1,s).join(""):f=o.slice(0,s).join("");let d,u=this.config.completion.prompt.clipboard;return r.clipboard.length>=u.minChars&&r.clipboard.length<=u.maxChars&&(d=r.clipboard),{prefix:l,suffix:f,clipboard:d}}async initialize(r){if(this.dataStore=r?.dataStore,await this.anonymousUsageLogger.init({dataStore:this.dataStore}),r.clientProperties){let{user:n,session:s}=r.clientProperties;Bn.forEach(i=>i.setBindings?.({...s})),s&&Object.entries(s).forEach(([i,o])=>{this.anonymousUsageLogger.setSessionProperties(i,o);}),n&&Object.entries(n).forEach(([i,o])=>{this.anonymousUsageLogger.setUserProperties(i,o);});}return Hr&&(await Hr.load(),this.userConfig=Hr.config,Hr.on("updated",async n=>{this.userConfig=n,await this.applyConfig();}),Hr.watch()),r.config&&(this.clientConfig=r.config),await this.applyConfig(),await this.anonymousUsageLogger.uniqueEvent("AgentInitialized"),this.logger.debug({options:r},"Initialized"),this.status!=="notInitialized"}async finalize(){return this.status==="finalized"?!1:(await this.submitStats(),this.tryingConnectTimer&&clearInterval(this.tryingConnectTimer),this.submitStatsTimer&&clearInterval(this.submitStatsTimer),this.changeStatus("finalized"),!0)}async updateClientProperties(r,n,s){switch(r){case"session":Bn.forEach(i=>i.setBindings?.(Jt({},n,s))),this.anonymousUsageLogger.setSessionProperties(n,s);break;case"user":this.anonymousUsageLogger.setUserProperties(n,s);break}return !0}async updateConfig(r,n){let s=ki(this.clientConfig,r);return (0, Js.default)(s,n)||(n===void 0?Li(this.clientConfig,r):Jt(this.clientConfig,r,n),await this.applyConfig()),!0}async clearConfig(r){return await this.updateConfig(r,void 0)}getConfig(){return this.config}getStatus(){return this.status}getIssues(){return this.issues}getIssueDetail(r){let n=this.getIssues();return r.index!==void 0&&r.index({index:S.index,text:S.text,replaceRange:{start:r.position,end:r.position}}))};}catch(p){throw Qt(p)?(this.logger.debug({requestId:u,error:p},"Completion request canceled"),o.requestCanceled=!0,o.requestLatency=performance.now()-l):mn(p)?(this.logger.debug({requestId:u,error:p},"Completion request timeout"),o.requestTimeout=!0,o.requestLatency=NaN):(this.logger.error({requestId:u,error:p},"Completion request failed with unknown error"),this.healthCheck()),p}if(i=await uv(f,this.config.postprocess,i),s.aborted)throw s.reason;this.completionCache.buildCache(f,JSON.parse(JSON.stringify(i)));}}if(i=await cv(f,this.config.postprocess,i),s.aborted)throw s.reason}catch(d){throw Qt(d)||mn(d)?o&&(o.aborted=!0):o=void 0,d}finally{if(o&&(this.completionProviderStats.add(o),o.requestSent&&!o.requestCanceled)){let d=this.completionProviderStats.windowed();switch(this.completionProviderStats.check(d)){case"healthy":this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate");break;case"highTimeoutRate":this.popIssue("slowCompletionResponseTime"),this.pushIssue("highCompletionTimeoutRate");break;case"slowResponseTime":this.popIssue("highCompletionTimeoutRate"),this.pushIssue("slowCompletionResponseTime");break}}}return this.logger.trace({context:f,completionResponse:i},"Return from provideCompletions"),i}async postEvent(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.completionProviderStats.addEvent(r.type);let s=St();try{if(!this.api)throw new Error("http client not initialized");let i="/v1/events",o={body:r,params:{query:{select_kind:r.select_kind}},signal:this.createAbortSignal(n),parseAs:"text"};this.logger.debug({requestId:s,requestOptions:o,url:this.config.server.endpoint+i},"Event request");let l=await this.api.POST(i,o);if(l.error||!l.response.ok)throw new je(l.response);return this.logger.debug({requestId:s,response:l},"Event response"),!0}catch(i){return mn(i)?this.logger.debug({requestId:s,error:i},"Event request timeout"):Qt(i)?this.logger.debug({requestId:s,error:i},"Event request canceled"):this.logger.error({requestId:s,error:i},"Event request failed with unknown error"),!1}}};var wv=["statusChanged","configUpdated","authRequired","issuesUpdated"];var Qs=class{constructor(){this.process=process;this.inStream=process.stdin;this.outStream=process.stdout;this.logger=Te.child({component:"StdIO"});this.abortControllers={};}async handleLine(e){let r;try{r=JSON.parse(e);}catch(s){this.logger.error({error:s},`Failed to parse request: ${e}`);return}this.logger.debug({request:r},"Received request");let n=await this.handleRequest(r);this.sendResponse(n),this.logger.debug({response:n},"Sent response");}async handleRequest(e){let r=0,n=[0,null],s=new AbortController;try{if(!this.agent)throw new Error(`Agent not bound. -`);r=e[0],n[0]=r;let i=e[1].func;if(i==="cancelRequest")n[1]=this.cancelRequest(e);else {let o=this.agent[i];if(!o)throw new Error(`Unknown function: ${i}`);let l=e[1].args;l.length>0&&typeof l[l.length-1]=="object"&&l[l.length-1].signal&&(this.abortControllers[r]=s,l[l.length-1].signal=s.signal),n[1]=await o.apply(this.agent,l);}}catch(i){Qt(i)?this.logger.debug({error:i,request:e},"Request canceled"):this.logger.error({error:i,request:e},"Failed to handle request");}finally{this.abortControllers[r]&&delete this.abortControllers[r];}return n}cancelRequest(e){let r=e[1].args[0],n=this.abortControllers[r];return n?(n.abort(),!0):!1}sendResponse(e){this.outStream.write(JSON.stringify(e)+` -`);}bind(e){this.agent=e;for(let r of wv)this.agent.on(r,n=>{this.sendResponse([0,n]);});}listen(){PL__default.default.createInterface({input:this.inStream}).on("line",e=>{this.handleLine(e);}),["SIGTERM","SIGINT"].forEach(e=>{this.process.on(e,async()=>{this.agent&&this.agent.getStatus()!=="finalized"&&await this.agent.finalize(),this.process.exit(0);});});}};var bv=new Qs,OL=new Xs;bv.bind(OL);bv.listen(); +`,YU={server:"object","server.endpoint":"string","server.token":"string","server.requestHeaders":"object","server.requestTimeout":"number",completion:"object","completion.prompt":"object","completion.prompt.experimentalStripAutoClosingCharacters":"boolean","completion.prompt.maxPrefixLines":"number","completion.prompt.maxSuffixLines":"number","completion.prompt.clipboard":"object","completion.prompt.clipboard.minChars":"number","completion.prompt.clipboard.maxChars":"number","completion.debounce":"object","completion.debounce.mode":"string","completion.debounce.interval":"number",postprocess:"object","postprocess.limitScopeByIndentation":"object","postprocess.limitScopeByIndentation.experimentalKeepBlockScopeWhenCompletingLine":"boolean",logs:"object","logs.level":"string",anonymousUsageTracking:"object","anonymousUsageTracking.disable":"boolean"};function XU(t){for(let[e,r]of Object.entries(YU))typeof Ta(t,e)!==r&&Aa(t,e);return t}var rp=class extends events.EventEmitter{constructor(r){super();this.filepath=r;this.data={};this.logger=ht.child({component:"ConfigFile"});}get config(){return this.data}async load(){try{let r=await tp.default.readFile(this.filepath,"utf8"),n=Tx.default.parse(r);if(Object.keys(n).length===0&&r.trim()!==xx.trim()){await this.createTemplate();return}this.data=XU(n);}catch(r){r instanceof Error&&"code"in r&&r.code==="ENOENT"?await this.createTemplate():this.logger.error({error:r},"Failed to load config file");}}watch(){this.watcher=Ax.default.watch(this.filepath,{interval:1e3});let r=async()=>{let n=this.data;await this.load(),(0, Px.default)(n,this.data)||super.emit("updated",this.data);};this.watcher.on("add",r),this.watcher.on("change",r);}async createTemplate(){try{await tp.default.outputFile(this.filepath,xx);}catch(r){this.logger.error({error:r},"Failed to create config template file");}}},QU=Gx__default.default.join(aT__default.default.homedir(),".tabby-client","agent","config.toml"),Zi=new rp(QU);var po=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Ox=new Set,np=typeof process=="object"&&process?process:{},Ix=(t,e,r,n)=>{typeof np.emitWarning=="function"?np.emitWarning(t,e,r,n):console.error(`[${r}] ${e}: ${t}`);},Iu=globalThis.AbortController,Dx=globalThis.AbortSignal;if(typeof Iu>"u"){Dx=class{onabort;_onabort=[];reason;aborted=!1;addEventListener(n,i){this._onabort.push(i);}},Iu=class{constructor(){e();}signal=new Dx;abort(n){if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(let i of this.signal._onabort)i(n);this.signal.onabort?.(n);}}};let t=np.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1",e=()=>{t&&(t=!1,Ix("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e));};}var e3=t=>!Ox.has(t),An=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t),kx=t=>An(t)?t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?Ji:null:null,Ji=class extends Array{constructor(e){super(e),this.fill(0);}},ip=class t{heap;length;static#u=!1;static create(e){let r=kx(e);if(!r)return [];t.#u=!0;let n=new t(e,r);return t.#u=!1,n}constructor(e,r){if(!t.#u)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new r(e),this.length=0;}push(e){this.heap[this.length++]=e;}pop(){return this.heap[--this.length]}},ku=class t{#u;#f;#y;#p;#P;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#n;#m;#i;#r;#e;#c;#d;#a;#s;#g;#o;#S;#E;#_;#b;#C;#l;static unsafeExposeInternals(e){return {starts:e.#E,ttls:e.#_,sizes:e.#S,keyMap:e.#i,keyList:e.#r,valList:e.#e,next:e.#c,prev:e.#d,get head(){return e.#a},get tail(){return e.#s},free:e.#g,isBackgroundFetch:r=>e.#t(r),backgroundFetch:(r,n,i,s)=>e.#I(r,n,i,s),moveToTail:r=>e.#A(r),indexes:r=>e.#v(r),rindexes:r=>e.#w(r),isStale:r=>e.#h(r)}}get max(){return this.#u}get maxSize(){return this.#f}get calculatedSize(){return this.#m}get size(){return this.#n}get fetchMethod(){return this.#P}get dispose(){return this.#y}get disposeAfter(){return this.#p}constructor(e){let{max:r=0,ttl:n,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:o,updateAgeOnHas:a,allowStale:l,dispose:d,disposeAfter:c,noDisposeOnSet:p,noUpdateTTL:m,maxSize:_=0,maxEntrySize:w=0,sizeCalculation:E,fetchMethod:P,noDeleteOnFetchRejection:D,noDeleteOnStaleGet:g,allowStaleOnFetchRejection:S,allowStaleOnFetchAbort:I,ignoreFetchAbort:L}=e;if(r!==0&&!An(r))throw new TypeError("max option must be a nonnegative integer");let Z=r?kx(r):Array;if(!Z)throw new Error("invalid max value: "+r);if(this.#u=r,this.#f=_,this.maxEntrySize=w||this.#f,this.sizeCalculation=E,this.sizeCalculation){if(!this.#f&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(P!==void 0&&typeof P!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#P=P,this.#C=!!P,this.#i=new Map,this.#r=new Array(r).fill(void 0),this.#e=new Array(r).fill(void 0),this.#c=new Z(r),this.#d=new Z(r),this.#a=0,this.#s=0,this.#g=ip.create(r),this.#n=0,this.#m=0,typeof d=="function"&&(this.#y=d),typeof c=="function"?(this.#p=c,this.#o=[]):(this.#p=void 0,this.#o=void 0),this.#b=!!this.#y,this.#l=!!this.#p,this.noDisposeOnSet=!!p,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!D,this.allowStaleOnFetchRejection=!!S,this.allowStaleOnFetchAbort=!!I,this.ignoreFetchAbort=!!L,this.maxEntrySize!==0){if(this.#f!==0&&!An(this.#f))throw new TypeError("maxSize must be a positive integer if specified");if(!An(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#L();}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!g,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!a,this.ttlResolution=An(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=n||0,this.ttl){if(!An(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#k();}if(this.#u===0&&this.ttl===0&&this.#f===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#u&&!this.#f){let K="LRU_CACHE_UNBOUNDED";e3(K)&&(Ox.add(K),Ix("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",K,t));}}getRemainingTTL(e){return this.#i.has(e)?1/0:0}#k(){let e=new Ji(this.#u),r=new Ji(this.#u);this.#_=e,this.#E=r,this.#M=(s,o,a=po.now())=>{if(r[s]=o!==0?a:0,e[s]=o,o!==0&&this.ttlAutopurge){let l=setTimeout(()=>{this.#h(s)&&this.delete(this.#r[s]);},o+1);l.unref&&l.unref();}},this.#x=s=>{r[s]=e[s]!==0?po.now():0;},this.#R=(s,o)=>{if(e[o]){let a=e[o],l=r[o];s.ttl=a,s.start=l,s.now=n||i();let d=s.now-l;s.remainingTTL=a-d;}};let n=0,i=()=>{let s=po.now();if(this.ttlResolution>0){n=s;let o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref();}return s};this.getRemainingTTL=s=>{let o=this.#i.get(s);if(o===void 0)return 0;let a=e[o],l=r[o];if(a===0||l===0)return 1/0;let d=(n||i())-l;return a-d},this.#h=s=>e[s]!==0&&r[s]!==0&&(n||i())-r[s]>e[s];}#x=()=>{};#R=()=>{};#M=()=>{};#h=()=>!1;#L(){let e=new Ji(this.#u);this.#m=0,this.#S=e,this.#T=r=>{this.#m-=e[r],e[r]=0;},this.#F=(r,n,i,s)=>{if(this.#t(n))return 0;if(!An(i))if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(i=s(n,r),!An(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i},this.#D=(r,n,i)=>{if(e[r]=n,this.#f){let s=this.#f-e[r];for(;this.#m>s;)this.#O(!0);}this.#m+=e[r],i&&(i.entrySize=n,i.totalCalculatedSize=this.#m);};}#T=e=>{};#D=(e,r,n)=>{};#F=(e,r,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#v({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#s;!(!this.#N(r)||((e||!this.#h(r))&&(yield r),r===this.#a));)r=this.#d[r];}*#w({allowStale:e=this.allowStale}={}){if(this.#n)for(let r=this.#a;!(!this.#N(r)||((e||!this.#h(r))&&(yield r),r===this.#s));)r=this.#c[r];}#N(e){return e!==void 0&&this.#i.get(this.#r[e])===e}*entries(){for(let e of this.#v())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*rentries(){for(let e of this.#w())this.#e[e]!==void 0&&this.#r[e]!==void 0&&!this.#t(this.#e[e])&&(yield [this.#r[e],this.#e[e]]);}*keys(){for(let e of this.#v()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*rkeys(){for(let e of this.#w()){let r=this.#r[e];r!==void 0&&!this.#t(this.#e[e])&&(yield r);}}*values(){for(let e of this.#v())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}*rvalues(){for(let e of this.#w())this.#e[e]!==void 0&&!this.#t(this.#e[e])&&(yield this.#e[e]);}[Symbol.iterator](){return this.entries()}find(e,r={}){for(let n of this.#v()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;if(s!==void 0&&e(s,this.#r[n],this))return this.get(this.#r[n],r)}}forEach(e,r=this){for(let n of this.#v()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#r[n],this);}}rforEach(e,r=this){for(let n of this.#w()){let i=this.#e[n],s=this.#t(i)?i.__staleWhileFetching:i;s!==void 0&&e.call(r,s,this.#r[n],this);}}purgeStale(){let e=!1;for(let r of this.#w({allowStale:!0}))this.#h(r)&&(this.delete(this.#r[r]),e=!0);return e}dump(){let e=[];for(let r of this.#v({allowStale:!0})){let n=this.#r[r],i=this.#e[r],s=this.#t(i)?i.__staleWhileFetching:i;if(s===void 0||n===void 0)continue;let o={value:s};if(this.#_&&this.#E){o.ttl=this.#_[r];let a=po.now()-this.#E[r];o.start=Math.floor(Date.now()-a);}this.#S&&(o.size=this.#S[r]),e.unshift([n,o]);}return e}load(e){this.clear();for(let[r,n]of e){if(n.start){let i=Date.now()-n.start;n.start=po.now()-i;}this.set(r,n.value,n);}}set(e,r,n={}){if(r===void 0)return this.delete(e),this;let{ttl:i=this.ttl,start:s,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:a=this.sizeCalculation,status:l}=n,{noUpdateTTL:d=this.noUpdateTTL}=n,c=this.#F(e,r,n.size||0,a);if(this.maxEntrySize&&c>this.maxEntrySize)return l&&(l.set="miss",l.maxEntrySizeExceeded=!0),this.delete(e),this;let p=this.#n===0?void 0:this.#i.get(e);if(p===void 0)p=this.#n===0?this.#s:this.#g.length!==0?this.#g.pop():this.#n===this.#u?this.#O(!1):this.#n,this.#r[p]=e,this.#e[p]=r,this.#i.set(e,p),this.#c[this.#s]=p,this.#d[p]=this.#s,this.#s=p,this.#n++,this.#D(p,c,l),l&&(l.set="add"),d=!1;else {this.#A(p);let m=this.#e[p];if(r!==m){if(this.#C&&this.#t(m)?m.__abortController.abort(new Error("replaced")):o||(this.#b&&this.#y?.(m,e,"set"),this.#l&&this.#o?.push([m,e,"set"])),this.#T(p),this.#D(p,c,l),this.#e[p]=r,l){l.set="replace";let _=m&&this.#t(m)?m.__staleWhileFetching:m;_!==void 0&&(l.oldValue=_);}}else l&&(l.set="update");}if(i!==0&&!this.#_&&this.#k(),this.#_&&(d||this.#M(p,i,s),l&&this.#R(l,p)),!o&&this.#l&&this.#o){let m=this.#o,_;for(;_=m?.shift();)this.#p?.(..._);}return this}pop(){try{for(;this.#n;){let e=this.#e[this.#a];if(this.#O(!0),this.#t(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#l&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#p?.(...r);}}}#O(e){let r=this.#a,n=this.#r[r],i=this.#e[r];return this.#C&&this.#t(i)?i.__abortController.abort(new Error("evicted")):(this.#b||this.#l)&&(this.#b&&this.#y?.(i,n,"evict"),this.#l&&this.#o?.push([i,n,"evict"])),this.#T(r),e&&(this.#r[r]=void 0,this.#e[r]=void 0,this.#g.push(r)),this.#n===1?(this.#a=this.#s=0,this.#g.length=0):this.#a=this.#c[r],this.#i.delete(n),this.#n--,r}has(e,r={}){let{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=r,s=this.#i.get(e);if(s!==void 0){let o=this.#e[s];if(this.#t(o)&&o.__staleWhileFetching===void 0)return !1;if(this.#h(s))i&&(i.has="stale",this.#R(i,s));else return n&&this.#x(s),i&&(i.has="hit",this.#R(i,s)),!0}else i&&(i.has="miss");return !1}peek(e,r={}){let{allowStale:n=this.allowStale}=r,i=this.#i.get(e);if(i!==void 0&&(n||!this.#h(i))){let s=this.#e[i];return this.#t(s)?s.__staleWhileFetching:s}}#I(e,r,n,i){let s=r===void 0?void 0:this.#e[r];if(this.#t(s))return s;let o=new Iu,{signal:a}=n;a?.addEventListener("abort",()=>o.abort(a.reason),{signal:o.signal});let l={signal:o.signal,options:n,context:i},d=(E,P=!1)=>{let{aborted:D}=o.signal,g=n.ignoreFetchAbort&&E!==void 0;if(n.status&&(D&&!P?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,g&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),D&&!g&&!P)return p(o.signal.reason);let S=_;return this.#e[r]===_&&(E===void 0?S.__staleWhileFetching?this.#e[r]=S.__staleWhileFetching:this.delete(e):(n.status&&(n.status.fetchUpdated=!0),this.set(e,E,l.options))),E},c=E=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=E),p(E)),p=E=>{let{aborted:P}=o.signal,D=P&&n.allowStaleOnFetchAbort,g=D||n.allowStaleOnFetchRejection,S=g||n.noDeleteOnFetchRejection,I=_;if(this.#e[r]===_&&(!S||I.__staleWhileFetching===void 0?this.delete(e):D||(this.#e[r]=I.__staleWhileFetching)),g)return n.status&&I.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),I.__staleWhileFetching;if(I.__returned===I)throw E},m=(E,P)=>{let D=this.#P?.(e,s,l);D&&D instanceof Promise&&D.then(g=>E(g),P),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(E(),n.allowStaleOnFetchAbort&&(E=g=>d(g,!0)));});};n.status&&(n.status.fetchDispatched=!0);let _=new Promise(m).then(d,c),w=Object.assign(_,{__abortController:o,__staleWhileFetching:s,__returned:void 0});return r===void 0?(this.set(e,w,{...l.options,status:void 0}),r=this.#i.get(e)):this.#e[r]=w,w}#t(e){if(!this.#C)return !1;let r=e;return !!r&&r instanceof Promise&&r.hasOwnProperty("__staleWhileFetching")&&r.__abortController instanceof Iu}async fetch(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:l=0,sizeCalculation:d=this.sizeCalculation,noUpdateTTL:c=this.noUpdateTTL,noDeleteOnFetchRejection:p=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:_=this.ignoreFetchAbort,allowStaleOnFetchAbort:w=this.allowStaleOnFetchAbort,context:E,forceRefresh:P=!1,status:D,signal:g}=r;if(!this.#C)return D&&(D.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,status:D});let S={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:s,ttl:o,noDisposeOnSet:a,size:l,sizeCalculation:d,noUpdateTTL:c,noDeleteOnFetchRejection:p,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:w,ignoreFetchAbort:_,status:D,signal:g},I=this.#i.get(e);if(I===void 0){D&&(D.fetch="miss");let L=this.#I(e,I,S,E);return L.__returned=L}else {let L=this.#e[I];if(this.#t(L)){let Q=n&&L.__staleWhileFetching!==void 0;return D&&(D.fetch="inflight",Q&&(D.returnedStale=!0)),Q?L.__staleWhileFetching:L.__returned=L}let Z=this.#h(I);if(!P&&!Z)return D&&(D.fetch="hit"),this.#A(I),i&&this.#x(I),D&&this.#R(D,I),L;let K=this.#I(e,I,S,E),B=K.__staleWhileFetching!==void 0&&n;return D&&(D.fetch=Z?"stale":"refresh",B&&Z&&(D.returnedStale=!0)),B?K.__staleWhileFetching:K.__returned=K}}get(e,r={}){let{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:o}=r,a=this.#i.get(e);if(a!==void 0){let l=this.#e[a],d=this.#t(l);return o&&this.#R(o,a),this.#h(a)?(o&&(o.get="stale"),d?(o&&n&&l.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?l.__staleWhileFetching:void 0):(s||this.delete(e),o&&n&&(o.returnedStale=!0),n?l:void 0)):(o&&(o.get="hit"),d?l.__staleWhileFetching:(this.#A(a),i&&this.#x(a),l))}else o&&(o.get="miss");}#q(e,r){this.#d[r]=e,this.#c[e]=r;}#A(e){e!==this.#s&&(e===this.#a?this.#a=this.#c[e]:this.#q(this.#d[e],this.#c[e]),this.#q(this.#s,e),this.#s=e);}delete(e){let r=!1;if(this.#n!==0){let n=this.#i.get(e);if(n!==void 0)if(r=!0,this.#n===1)this.clear();else {this.#T(n);let i=this.#e[n];this.#t(i)?i.__abortController.abort(new Error("deleted")):(this.#b||this.#l)&&(this.#b&&this.#y?.(i,e,"delete"),this.#l&&this.#o?.push([i,e,"delete"])),this.#i.delete(e),this.#r[n]=void 0,this.#e[n]=void 0,n===this.#s?this.#s=this.#d[n]:n===this.#a?this.#a=this.#c[n]:(this.#c[this.#d[n]]=this.#c[n],this.#d[this.#c[n]]=this.#d[n]),this.#n--,this.#g.push(n);}}if(this.#l&&this.#o?.length){let n=this.#o,i;for(;i=n?.shift();)this.#p?.(...i);}return r}clear(){for(let e of this.#w({allowStale:!0})){let r=this.#e[e];if(this.#t(r))r.__abortController.abort(new Error("deleted"));else {let n=this.#r[e];this.#b&&this.#y?.(r,n,"delete"),this.#l&&this.#o?.push([r,n,"delete"]);}}if(this.#i.clear(),this.#e.fill(void 0),this.#r.fill(void 0),this.#_&&this.#E&&(this.#_.fill(0),this.#E.fill(0)),this.#S&&this.#S.fill(0),this.#a=0,this.#s=0,this.#g.length=0,this.#m=0,this.#n=0,this.#l&&this.#o){let e=this.#o,r;for(;r=e?.shift();)this.#p?.(...r);}}};var jx=$t($x());function r3(t){return t.trimEnd().split("").every(e=>Da.includes(e))}var ci=class{constructor(e){this.filepath=e.filepath,this.language=e.language,this.text=e.text,this.position=e.position,this.indentation=e.indentation,this.prefix=e.text.slice(0,e.position),this.suffix=e.text.slice(e.position),this.prefixLines=Je(this.prefix),this.suffixLines=Je(this.suffix),this.currentLinePrefix=this.prefixLines[this.prefixLines.length-1]??"",this.currentLineSuffix=this.suffixLines[0]??"",this.clipboard=e.clipboard?.trim()??"";let r=r3(this.suffixLines[0]??"");this.mode=r?"default":"fill-in-line",this.hash=(0, jx.default)({filepath:this.filepath,language:this.language,text:this.text,position:this.position,clipboard:this.clipboard});}};var Mu=class{constructor(){this.logger=ht.child({component:"CompletionCache"});this.options={maxCount:1e4,prebuildCache:{enabled:!0,perCharacter:{lines:1,max:50},perLine:{max:10},autoClosingPairCheck:{max:3}}};this.cache=new ku({max:this.options.maxCount});}has(e){return this.cache.has(e.hash)}buildCache(e,r){this.logger.debug({key:e,value:r},"Starting to build cache");let n=this.createCacheEntries(e,r);n.forEach(i=>{this.cache.set(i.key.hash,{value:i.value,rebuildFlag:i.rebuildFlag});}),this.logger.debug({newEntries:n.length,cacheSize:this.cache.size},"Cache updated");}get(e){let r=this.cache.get(e.hash);return r?.rebuildFlag&&this.buildCache(e,r?.value),r?.value}createCacheEntries(e,r){let n=[{key:e,value:r,rebuildFlag:!1}];if(this.options.prebuildCache.enabled)for(let s of r.choices){let o=s.text.slice(e.position-s.replaceRange.start),a=this.getPerLinePositions(o);this.logger.trace({completionText:o,perLinePositions:a},"Calculate per-line cache positions");for(let d of a){let c=o.slice(0,d),p=this.generateAutoClosedPrefixes(c);for(let m of [c,...p]){let _={key:new ci({...e,text:e.text.slice(0,e.position)+m+e.text.slice(e.position),position:e.position+d}),value:{...r,choices:[{index:s.index,text:o.slice(d),replaceRange:{start:e.position+d,end:e.position+d}}]},rebuildFlag:!0};this.logger.trace({prefix:m,entry:_},"Build per-line cache entry"),n.push(_);}}let l=this.getPerCharacterPositions(o);this.logger.trace({completionText:o,perCharacterPositions:l},"Calculate per-character cache positions");for(let d of l){let c=d;for(;c>0&&o[c-1]!==` +`;)c--;let p=o.slice(0,d),m=this.generateAutoClosedPrefixes(p);for(let _ of [p,...m]){let w={key:new ci({...e,text:e.text.slice(0,e.position)+_+e.text.slice(e.position),position:e.position+d}),value:{...r,choices:[{index:s.index,text:o.slice(c),replaceRange:{start:e.position+c,end:e.position+d}}]},rebuildFlag:!1};this.logger.trace({prefix:_,entry:w},"Build per-character cache entry"),n.push(w);}}}return n.reduce((s,o)=>{let a=s.find(l=>l.key.hash===o.key.hash);return a?(a.value.choices.push(...o.value.choices),a.rebuildFlag=a.rebuildFlag||o.rebuildFlag):s.push(o),s},[])}getPerLinePositions(e){let r=[],n=this.options.prebuildCache,i=Je(e),s=0,o=0;for(;si;i++){let o=iw.indexOf(n[n.length-1-i]);if(o<0)break;s=s+Da[o],r.push(e+s);}return r}};function ap(t,e,r){return Math.max(t,Math.min(e,r))}var Fu=class{constructor(){this.lastCalledTimeStamp=0;this.baseInterval=200;this.calledIntervalHistory=[];this.options={baseIntervalSlideWindowAvg:{minSize:20,maxSize:100,min:100,max:400},adaptiveRate:{min:1.5,max:3},contextScoreWeights:{triggerCharacter:.5,noSuffixInCurrentLine:.4,noSuffix:.1},requestDelay:{min:100,max:1e3}};}async debounce(e,r){let{request:n,config:i,responseTime:s}=e;if(n.manually)return this.sleep(0,r);if(i.mode==="fixed")return this.sleep(i.interval,r);let o=Date.now();this.updateBaseInterval(o-this.lastCalledTimeStamp),this.lastCalledTimeStamp=o;let a=this.calcContextScore(n),d=(this.options.adaptiveRate.max-(this.options.adaptiveRate.max-this.options.adaptiveRate.min)*a)*this.baseInterval,c=ap(this.options.requestDelay.min,this.options.requestDelay.max,d-s);return this.sleep(c,r)}async sleep(e,r){return new Promise((n,i)=>{let s=setTimeout(n,Math.min(e,2147483647));r?.signal&&(r.signal.aborted?(clearTimeout(s),i(r.signal.reason)):r.signal.addEventListener("abort",()=>{clearTimeout(s),i(r.signal.reason);}));})}updateBaseInterval(e){if(!(e>this.options.baseIntervalSlideWindowAvg.max)&&(this.calledIntervalHistory.push(e),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.maxSize&&this.calledIntervalHistory.shift(),this.calledIntervalHistory.length>this.options.baseIntervalSlideWindowAvg.minSize)){let r=this.calledIntervalHistory.reduce((n,i)=>n+i,0)/this.calledIntervalHistory.length;this.baseInterval=ap(this.options.baseIntervalSlideWindowAvg.min,this.options.baseIntervalSlideWindowAvg.max,r);}}calcContextScore(e){let r=0,n=this.options.contextScoreWeights,i=e.text[e.position-1]??"";r+=i.match(/^\W*$/)?n.triggerCharacter:0;let s=e.text.slice(e.position)??"",o=Je(s)[0]??"";return r+=o.match(/^\W*$/)?n.noSuffixInCurrentLine:0,r+=s.match(/^\W*$/)?n.noSuffix:0,r=ap(0,1,r),r}};var Ge=ht.child({component:"Postprocess"});Array.prototype.distinct||(Array.prototype.distinct=function(t){return [...new Map(this.map(e=>[t?.(e)??e,e])).values()]});Array.prototype.mapAsync||(Array.prototype.mapAsync=async function(t,e){return await Promise.all(this.map((r,n)=>t.call(e,r,n,this)))});function Zt(t,e){return up(async r=>{let n=e.position-r.replaceRange.start,i=r.text.slice(n),s=await t(i,e);return r.text=r.text.slice(0,n)+(s??""),r},e)}function up(t,e){return async r=>(r.choices=(await r.choices.mapAsync(async n=>await t(n,e))).filter(n=>!!n&&!!n.text).distinct(n=>n.text),r)}function n3(t){return /\n(\s*)\n/g}function Hx(){return (t,e)=>{let r=t.split(n3()),n=0,i=2,s=r.length-2;for(;s>=1;){if(Ae(r[s])){s--;continue}let o=s-1;for(;o>=0&&Ae(r[o]);)o--;if(o<0)break;let a=r[s].trim(),l=r[o].trim(),d=Math.max(.1*a.length,.1*l.length);if(ki(a,l)<=d)n++,s--;else break}return n>=i?(Ge.debug({inputBlocks:r,repetitionCount:n},"Remove repetitive blocks."),r.slice(0,s+1).join("").trimEnd()):t}}function Wx(){return t=>{let e=Je(t),r=0,n=5,i=e.length-2;for(;i>=1;){if(Ae(e[i])){i--;continue}let s=i-1;for(;s>=0&&Ae(e[s]);)s--;if(s<0)break;let o=e[i].trim(),a=e[s].trim(),l=Math.max(.1*o.length,.1*a.length);if(ki(o,a)<=l)r++,i=s;else break}return r>=n?(Ge.debug({inputLines:e,repetitionCount:r},"Remove repetitive lines."),e.slice(0,i+1).join("").trimEnd()):t}}var i3=[/(.{3,}?)\1{5,}$/g,/(.{10,}?)\1{3,}$/g];function Bx(){return t=>{let e=Je(t),r=e.length-1;for(;r>=0&&Ae(e[r]);)r--;if(r<0)return t;for(let n of i3){let i=e[r].match(n);if(i)return Ge.debug({inputLines:e,lineNumber:r,match:i},"Remove line ends with repetition."),r<1?null:e.slice(0,r).join("").trimEnd()}return t}}function Ux(){return (t,e)=>{let{suffixLines:r,currentLinePrefix:n}=e,i=Je(t);if(i.length<2)return t;let s=i.map((d,c)=>c===0?n+d:d);if(!Pa(s,i.length-1))return t;let o=i[i.length-1],a=1;for(;a=r.length)return t;let l=r[a];return o.startsWith(l)||l.startsWith(o)?(Ge.debug({inputLines:i,suffixLines:r},"Removing duplicated block closing line"),i.slice(0,i.length-1).join("").trimEnd()):t}}function s3(t,e,r,n){let i={indentLevelLimit:0,allowClosingLine:!0},{prefixLines:s,suffixLines:o,currentLinePrefix:a}=r;if(t.length==0||s.length==0)return i;let l=Ae(a),d=s.length-1;for(;d>=0&&Ae(s[d]);)d--;if(d<0)return i;let c=s[d],p=Hr(c),m=t[0],_=Ae(m),w=0;for(;w=t.length)return i;let E=t[w],P;_?P=Hr(E):P=Hr(a+E),!_&&!l?n.experimentalKeepBlockScopeWhenCompletingLine?i.indentLevelLimit=p:(i.indentLevelLimit=p+1,i.allowClosingLine&&=Pf(e,0)):P>p?i.indentLevelLimit=p+1:(i.indentLevelLimit=p);let D=1;for(;D{let{prefixLines:n,suffixLines:i,currentLinePrefix:s}=r,o=Je(e),a=o.map((c,p)=>p===0?s+c:c),l=s3(o,a,r,t),d=1;for(;d=0&&t[r]?.match(/\s/);)r--;if(r<0)return 0;let n=t.lastIndexOf(` +`,r);if(n<0)return 0;let s=t.slice(n+1,e).search(/\S/);return n+1+s}function c3(t,e){let r=e;for(;r=t.length)return t.length;let n=t.indexOf(` +`,r);return n<0?t.length:n}function l3(t,e){for(let r of e){let n=t;for(;n;){if(r.includes(n.type))return n;n=n.parent;}}return t}function Yx(){return async(t,e)=>{let{position:r,text:n,language:i,prefix:s,suffix:o}=e;if(!a3.includes(i))throw new Error(`Language ${i} is not supported`);let a=Xi[i],l=await qu(a),d=s+t+o,c=l.parse(d),p=u3(d,r),m=c3(d,r),_=l3(c.rootNode.namedDescendantForIndex(p,m),Jx[a]??[]);if(_.type=="ERROR")throw new Error("Cannot determine syntax scope.");return _.endIndex{if(t.experimentalSyntax)try{return await Yx()(e,r)}catch(i){Ge.debug({error:i},"Failed to limit scope by syntax parser");}return zx(t.indentation)(e,r)}}function cp(t){let e={" ":0," ":0," ":0};for(let r of t)if(r.match(/^\t/))e[" "]++;else {let n=r.match(/^ */)?.[0].length??0;n>0&&(n%4===0&&e[" "]++,n%2===0&&e[" "]++);}return e[" "]>0?" ":e[" "]>e[" "]?" ":e[" "]>0?" ":null}function f3(t,e){return e===" "?t.match(/^\t*/g)?.[0].length??0:(t.match(/^ */)?.[0].length??0)/e.length}function Qx(){return (t,e)=>{let{prefixLines:r,suffixLines:n,currentLinePrefix:i,indentation:s}=e,o=Je(t);if(!s)return t;let a=Ae(i)?r.slice(0,r.length-1):r;if(r.length>1&&cp(a)!==null)return t;let l=n.slice(1);if(n.length>1&&cp(l)!==null)return t;let d=o.map((m,_)=>_===0?i+m:m),c=cp(d);if(c===null||c===s)return t;let p=d.map((m,_)=>{let w=f3(m,c);if(w===0)return o[_];let E=m.slice(c.length*w);return _===0?Ae(i)?s.repeat(w).slice(i.length)+E:o[0]:s.repeat(w)+E});return Ge.debug({prefixLines:r,suffixLines:n,inputLines:o,formatted:p},"Format indentation."),p.join("")}}function lp(){return (t,e)=>{let{currentLinePrefix:r,currentLineSuffix:n}=e,i=t;return !Ae(r)&&r.match(/\s$/)&&(i=i.trimStart()),(Ae(n)||!Ae(n)&&n.match(/^\s/))&&(i=i.trimEnd()),i}}function eT(){return (t,e)=>{let r=Je(t);if(e.mode==="fill-in-line"&&r.length>1){let n=e.currentLineSuffix.trimEnd(),i=r[0].trimEnd();if(i.endsWith(n)){let s=i.slice(0,-n.length);if(s.length>0)return Ge.debug({inputLines:r,trimmedInputLine:s},"Trim content with multiple lines"),s}return Ge.debug({inputLines:r},"Drop content with multiple lines"),null}return t}}function fp(){return (t,e)=>{let{suffixLines:r}=e,n=Je(t),i=0;for(;iAe(t)?null:t}function tT(t,e){let{currentLineSuffix:r}=e,n=r.trimEnd();if(Ae(n))return t;let i=t.text.slice(e.position-t.replaceRange.start),s=Oa(i);return Ae(s)||(n.startsWith(s)?(t.replaceRange.end=e.position+s.length,Ge.trace({context:e,completion:t.text,range:t.replaceRange,unpaired:s},"Adjust replace range by bracket stack")):s.startsWith(n)&&(t.replaceRange.end=e.position+n.length,Ge.trace({context:e,completion:t.text,range:t.replaceRange,unpaired:s},"Adjust replace range by bracket stack"))),t}var d3=Object.keys(Xi);async function rT(t,e){let{position:r,prefix:n,suffix:i,prefixLines:s,currentLinePrefix:o,currentLineSuffix:a,language:l}=e,d=a.trimEnd();if(Ae(d))return t;if(!d3.includes(l))throw new Error(`Language ${l} is not supported`);let c=Xi[l],p=await qu(c),m=t.text.slice(r-t.replaceRange.start),_=Je(m),w=0,E=p.parse(n+m+i),P=E.rootNode.namedDescendantForIndex(n.length+m.length);for(;P.hasError()&&w{if(t.experimentalSyntax)try{return await rT(e,r)}catch(i){Ge.debug({error:i},"Failed to calculate replace range by syntax parser");}return tT(e,r)}}async function iT(t,e,r){return Promise.resolve(r).then(Zt(eT(),t)).then(Zt(Bx(),t)).then(Zt(fp(),t)).then(Zt(lp(),t)).then(Zt(dp(),t))}async function sT(t,e,r){return Promise.resolve(r).then(Zt(Hx(),t)).then(Zt(Wx(),t)).then(Zt(Xx(e.limitScope),t)).then(Zt(Ux(),t)).then(Zt(Qx(),t)).then(Zt(fp(),t)).then(Zt(lp(),t)).then(Zt(dp(),t)).then(up(nT(e.calculateReplaceRange),t))}var go="tabby-agent",_o="1.3.0";var Lu=class{constructor(){this.anonymousUsageTrackingApi=Jn({baseUrl:"https://app.tabbyml.com/api"});this.logger=ht.child({component:"AnonymousUsage"});this.systemData={agent:`${go}, ${_o}`,browser:void 0,node:`${process.version} ${process.platform} ${aT__default.default.arch()} ${aT__default.default.release()}`};this.sessionProperties={};this.userProperties={};this.userPropertiesUpdated=!1;this.emittedUniqueEvent=[];this.disabled=!1;}async init(e){if(this.dataStore=e?.dataStore||ri,this.dataStore){try{await this.dataStore.load();}catch(r){this.logger.debug({error:r},"Error when loading anonymousId");}if(typeof this.dataStore.data.anonymousId=="string")this.anonymousId=this.dataStore.data.anonymousId;else {this.anonymousId=Xr(),this.dataStore.data.anonymousId=this.anonymousId;try{await this.dataStore.save();}catch(r){this.logger.debug({error:r},"Error when saving anonymousId");}}}else this.anonymousId=Xr();}setSessionProperties(e,r){Zn(this.sessionProperties,e,r);}setUserProperties(e,r){Zn(this.userProperties,e,r),this.userPropertiesUpdated=!0;}async uniqueEvent(e,r={}){await this.event(e,r,!0);}async event(e,r={},n=!1){if(this.disabled||!this.anonymousId||n&&this.emittedUniqueEvent.includes(e))return;n&&this.emittedUniqueEvent.push(e);let i={...this.systemData,...this.sessionProperties,...r};this.userPropertiesUpdated&&(Zn(i,"$set",this.userProperties),this.userPropertiesUpdated=!1);try{await this.anonymousUsageTrackingApi.POST("/usage",{body:{distinctId:this.anonymousId,event:e,properties:i}});}catch(s){this.logger.error({error:s},"Error when sending anonymous usage data");}}};var gp=$t(fT()),$u=class{constructor(){this.sum=0;this.quantity=0;}add(e){this.sum+=e,this.quantity+=1;}mean(){if(this.quantity!==0)return this.sum/this.quantity}count(){return this.quantity}},ju=class{constructor(e){this.values=[];this.maxSize=e;}add(e){this.values.push(e),this.values.length>this.maxSize&&this.values.shift();}getValues(){return this.values}},Hu=class{constructor(){this.config={windowSize:10,checks:{disable:!1,healthy:{windowSize:1,latency:3e3},slowResponseTime:{latency:5e3,count:1},highTimeoutRate:{rate:.5,count:1}}};this.autoCompletionCount=0;this.manualCompletionCount=0;this.cacheHitCount=0;this.cacheMissCount=0;this.eventMap=new Map;this.completionRequestLatencyStats=new gp.Univariate;this.completionRequestCanceledStats=new $u;this.completionRequestTimeoutCount=0;this.recentCompletionRequestLatencies=new ju(this.config.windowSize);}add(e){let{triggerMode:r,cacheHit:n,aborted:i,requestSent:s,requestLatency:o,requestCanceled:a,requestTimeout:l}=e;i||(r==="auto"?this.autoCompletionCount+=1:this.manualCompletionCount+=1,n?this.cacheHitCount+=1:this.cacheMissCount+=1),s&&(a?this.completionRequestCanceledStats.add(o):l?this.completionRequestTimeoutCount+=1:this.completionRequestLatencyStats.add(o),a||this.recentCompletionRequestLatencies.add(o));}addEvent(e){let r=this.eventMap.get(e)||0;this.eventMap.set(e,r+1);}reset(){this.autoCompletionCount=0,this.manualCompletionCount=0,this.cacheHitCount=0,this.cacheMissCount=0,this.eventMap=new Map,this.completionRequestLatencyStats=new gp.Univariate,this.completionRequestCanceledStats=new $u,this.completionRequestTimeoutCount=0;}resetWindowed(){this.recentCompletionRequestLatencies=new ju(this.config.windowSize);}stats(){let e=Object.fromEntries(Array.from(this.eventMap.entries()).map(([r,n])=>["count_"+r,n]));return {completion:{count_auto:this.autoCompletionCount,count_manual:this.manualCompletionCount,cache_hit:this.cacheHitCount,cache_miss:this.cacheMissCount,...e},completion_request:{count:this.completionRequestLatencyStats.count(),latency_avg:this.completionRequestLatencyStats.mean(),latency_p50:this.completionRequestLatencyStats.percentile(50),latency_p95:this.completionRequestLatencyStats.percentile(95),latency_p99:this.completionRequestLatencyStats.percentile(99)},completion_request_canceled:{count:this.completionRequestCanceledStats.count(),latency_avg:this.completionRequestCanceledStats.mean()},completion_request_timeout:{count:this.completionRequestTimeoutCount}}}windowed(){let e=this.recentCompletionRequestLatencies.getValues(),r=e.filter(s=>Number.isNaN(s)),n=e.filter(s=>!Number.isNaN(s)),i=n.reduce((s,o)=>s+o,0)/n.length;return {values:e,stats:{total:e.length,timeouts:r.length,responses:n.length,averageResponseTime:i}}}check(e){if(this.config.checks.disable)return null;let r=this.config.checks,{values:n,stats:{total:i,timeouts:s,responses:o,averageResponseTime:a}}=e;return n.slice(-Math.min(this.config.windowSize,r.healthy.windowSize)).every(l=>lr.highTimeoutRate.rate&&s>=r.highTimeoutRate.count?"highTimeoutRate":a>r.slowResponseTime.latency&&o>=r.slowResponseTime.count?"slowResponseTime":null}};var Bu=class t extends events.EventEmitter{constructor(){super();this.logger=ht.child({component:"TabbyAgent"});this.anonymousUsageLogger=new Lu;this.config=ep;this.userConfig={};this.clientConfig={};this.status="notInitialized";this.issues=[];this.completionCache=new Mu;this.completionDebounce=new Fu;this.completionProviderStats=new Hu;this.tryingConnectTimer=setInterval(async()=>{this.status==="disconnected"&&(this.logger.debug("Trying to connect..."),await this.healthCheck());},t.tryConnectInterval),this.submitStatsTimer=setInterval(async()=>{await this.submitStats();},t.submitStatsInterval);}static{this.tryConnectInterval=1e3*30;}static{this.submitStatsInterval=1e3*60*60*24;}async applyConfig(){let r=this.config,n=this.status;this.config=Zv(ep,this.userConfig,this.clientConfig),ho.forEach(s=>s.level=this.config.logs.level),this.anonymousUsageLogger.disabled=this.config.anonymousUsageTracking.disable,Ae(this.config.server.token)&&this.config.server.requestHeaders.Authorization===void 0?this.config.server.endpoint!==this.auth?.endpoint&&(this.auth=new Ou(this.config.server.endpoint),await this.auth.init({dataStore:this.dataStore}),this.auth.on("updated",()=>{this.setupApi();})):this.auth=void 0,(0, Wu.default)(r.server,this.config.server)||(this.serverHealthState=void 0,this.completionProviderStats.resetWindowed(),this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate"),this.popIssue("connectionFailed"),this.connectionErrorMessage=void 0),await this.setupApi(),(0, Wu.default)(r.server,this.config.server)||n==="unauthorized"&&this.status==="unauthorized"&&this.emitAuthRequired();let i={event:"configUpdated",config:this.config};this.logger.debug({event:i},"Config updated"),super.emit("configUpdated",i);}async setupApi(){let r=Ae(this.config.server.token)?this.auth?.token?`Bearer ${this.auth.token}`:void 0:`Bearer ${this.config.server.token}`;this.api=Jn({baseUrl:this.config.server.endpoint.replace(/\/+$/,""),headers:{Authorization:r,...this.config.server.requestHeaders}}),await this.healthCheck();}changeStatus(r){if(this.status!=r){this.status=r;let n={event:"statusChanged",status:r};this.logger.debug({event:n},"Status changed"),super.emit("statusChanged",n),this.status==="unauthorized"&&this.emitAuthRequired();}}issueFromName(r){switch(r){case"highCompletionTimeoutRate":return {name:"highCompletionTimeoutRate",completionResponseStats:this.completionProviderStats.windowed().stats};case"slowCompletionResponseTime":return {name:"slowCompletionResponseTime",completionResponseStats:this.completionProviderStats.windowed().stats};case"connectionFailed":return {name:"connectionFailed",message:this.connectionErrorMessage}}}pushIssue(r){this.issues.includes(r)||(this.issues.push(r),this.logger.debug({issue:r},"Issues Pushed"),this.emitIssueUpdated());}popIssue(r){let n=this.issues.indexOf(r);n>=0&&(this.issues.splice(n,1),this.logger.debug({issue:r},"Issues Popped"),this.emitIssueUpdated());}emitAuthRequired(){let r={event:"authRequired",server:this.config.server};super.emit("authRequired",r);}emitIssueUpdated(){let r={event:"issuesUpdated",issues:this.issues};super.emit("issuesUpdated",r);}async submitStats(){let r=this.completionProviderStats.stats();r.completion_request.count>0&&(await this.anonymousUsageLogger.event("AgentStats",{stats:r}),this.completionProviderStats.reset(),this.logger.debug({stats:r},"Stats submitted"));}createAbortSignal(r){let n=Math.min(2147483647,r?.timeout||this.config.server.requestTimeout);return js([AbortSignal.timeout(n),r?.signal])}async healthCheck(r){let n=Xr(),i="/v1/health",s=this.config.server.endpoint+i,o={signal:this.createAbortSignal(r)};try{if(!this.api)throw new Error("http client not initialized");this.logger.debug({requestId:n,requestOptions:o,url:s},"Health check request");let a=await this.api.GET(i,o);if(a.error||!a.response.ok)throw new Vt(a.response);this.logger.debug({requestId:n,response:a},"Health check response"),this.changeStatus("ready"),this.popIssue("connectionFailed"),this.connectionErrorMessage=void 0;let l=a.data;typeof l=="object"&&l.model!==void 0&&l.device!==void 0&&(this.serverHealthState=l,this.anonymousUsageLogger.uniqueEvent("AgentConnected",l));}catch(a){if(this.serverHealthState=void 0,a instanceof Vt&&[401,403,405].includes(a.status))this.logger.debug({requestId:n,error:a},"Health check error: unauthorized"),this.changeStatus("unauthorized");else {if(Hs(a))this.logger.debug({requestId:n,error:a},"Health check error: timeout"),this.connectionErrorMessage=`GET ${s}: Timed out.`;else if(en(a))this.logger.debug({requestId:n,error:a},"Health check error: canceled"),this.connectionErrorMessage=`GET ${s}: Canceled.`;else {this.logger.error({requestId:n,error:a},"Health check error: unknown error");let l=a instanceof Error?Df(a):JSON.stringify(a);this.connectionErrorMessage=`GET ${s}: Request failed: +${l}`;}this.pushIssue("connectionFailed"),this.changeStatus("disconnected");}}}createSegments(r){let n=this.config.completion.prompt.maxPrefixLines,i=this.config.completion.prompt.maxSuffixLines,{prefixLines:s,suffixLines:o}=r,a=s.slice(Math.max(s.length-n,0)).join(""),l;this.config.completion.prompt.experimentalStripAutoClosingCharacters&&r.mode!=="fill-in-line"?l=` +`+o.slice(1,i).join(""):l=o.slice(0,i).join("");let d,c=this.config.completion.prompt.clipboard;return r.clipboard.length>=c.minChars&&r.clipboard.length<=c.maxChars&&(d=r.clipboard),{prefix:a,suffix:l,clipboard:d}}async initialize(r){if(this.dataStore=r?.dataStore,await this.anonymousUsageLogger.init({dataStore:this.dataStore}),r.clientProperties){let{user:n,session:i}=r.clientProperties;ho.forEach(s=>s.setBindings?.({...i})),i&&Object.entries(i).forEach(([s,o])=>{this.anonymousUsageLogger.setSessionProperties(s,o);}),n&&Object.entries(n).forEach(([s,o])=>{this.anonymousUsageLogger.setUserProperties(s,o);});}return Zi&&(await Zi.load(),this.userConfig=Zi.config,Zi.on("updated",async n=>{this.userConfig=n,await this.applyConfig();}),Zi.watch()),r.config&&(this.clientConfig=r.config),await this.applyConfig(),await this.anonymousUsageLogger.uniqueEvent("AgentInitialized"),this.logger.debug({options:r},"Initialized"),this.status!=="notInitialized"}async finalize(){return this.status==="finalized"?!1:(await this.submitStats(),this.tryingConnectTimer&&clearInterval(this.tryingConnectTimer),this.submitStatsTimer&&clearInterval(this.submitStatsTimer),this.changeStatus("finalized"),!0)}async updateClientProperties(r,n,i){switch(r){case"session":ho.forEach(s=>s.setBindings?.(Zn({},n,i))),this.anonymousUsageLogger.setSessionProperties(n,i);break;case"user":this.anonymousUsageLogger.setUserProperties(n,i);break}return !0}async updateConfig(r,n){let i=Ta(this.clientConfig,r);return (0, Wu.default)(i,n)||(n===void 0?Aa(this.clientConfig,r):Zn(this.clientConfig,r,n),await this.applyConfig()),!0}async clearConfig(r){return await this.updateConfig(r,void 0)}getConfig(){return this.config}getStatus(){return this.status}getIssues(){return this.issues}getIssueDetail(r){let n=this.getIssues();return r.index!==void 0&&r.index({index:E.index,text:E.text,replaceRange:{start:r.position,end:r.position}}))};}catch(p){throw en(p)?(this.logger.debug({requestId:c,error:p},"Completion request canceled"),o.requestCanceled=!0,o.requestLatency=performance.now()-a):Hs(p)?(this.logger.debug({requestId:c,error:p},"Completion request timeout"),o.requestTimeout=!0,o.requestLatency=NaN):(this.logger.error({requestId:c,error:p},"Completion request failed with unknown error"),this.healthCheck()),p}if(s=await iT(l,this.config.postprocess,s),i.aborted)throw i.reason;this.completionCache.buildCache(l,JSON.parse(JSON.stringify(s)));}}if(s=await sT(l,this.config.postprocess,s),i.aborted)throw i.reason}catch(d){throw en(d)||Hs(d)?o&&(o.aborted=!0):o=void 0,d}finally{if(o&&(this.completionProviderStats.add(o),o.requestSent&&!o.requestCanceled)){let d=this.completionProviderStats.windowed();switch(this.completionProviderStats.check(d)){case"healthy":this.popIssue("slowCompletionResponseTime"),this.popIssue("highCompletionTimeoutRate");break;case"highTimeoutRate":this.popIssue("slowCompletionResponseTime"),this.pushIssue("highCompletionTimeoutRate");break;case"slowResponseTime":this.popIssue("highCompletionTimeoutRate"),this.pushIssue("slowCompletionResponseTime");break}}}return this.logger.trace({context:l,completionResponse:s},"Return from provideCompletions"),s}async postEvent(r,n){if(this.status==="notInitialized")throw new Error("Agent is not initialized");this.completionProviderStats.addEvent(r.type);let i=Xr();try{if(!this.api)throw new Error("http client not initialized");let s="/v1/events",o={body:r,params:{query:{select_kind:r.select_kind}},signal:this.createAbortSignal(n),parseAs:"text"};this.logger.debug({requestId:i,requestOptions:o,url:this.config.server.endpoint+s},"Event request");let a=await this.api.POST(s,o);if(a.error||!a.response.ok)throw new Vt(a.response);return this.logger.debug({requestId:i,response:a},"Event response"),!0}catch(s){return Hs(s)?this.logger.debug({requestId:i,error:s},"Event request timeout"):en(s)?this.logger.debug({requestId:i,error:s},"Event request canceled"):this.logger.error({requestId:i,error:s},"Event request failed with unknown error"),!1}}};var dT=["statusChanged","configUpdated","authRequired","issuesUpdated"];var Uu=class{constructor(){this.process=process;this.inStream=process.stdin;this.outStream=process.stdout;this.logger=ht.child({component:"JsonLineServer"});this.abortControllers={};}async handleLine(e){let r;try{r=JSON.parse(e);}catch(i){this.logger.error({error:i},`Failed to parse request: ${e}`);return}this.logger.debug({request:r},"Received request");let n=await this.handleRequest(r);this.sendResponse(n),this.logger.debug({response:n},"Sent response");}async handleRequest(e){let r=0,n=[0,null],i=new AbortController;try{if(!this.agent)throw new Error(`Agent not bound. +`);r=e[0],n[0]=r;let s=e[1].func;if(s==="cancelRequest")n[1]=this.cancelRequest(e);else {let o=this.agent[s];if(!o)throw new Error(`Unknown function: ${s}`);let a=e[1].args;a.length>0&&typeof a[a.length-1]=="object"&&a[a.length-1].signal&&(this.abortControllers[r]=i,a[a.length-1].signal=i.signal),n[1]=await o.apply(this.agent,a);}}catch(s){en(s)?this.logger.debug({error:s,request:e},"Request canceled"):this.logger.error({error:s,request:e},"Failed to handle request");}finally{this.abortControllers[r]&&delete this.abortControllers[r];}return n}cancelRequest(e){let r=e[1].args[0],n=this.abortControllers[r];return n?(n.abort(),!0):!1}sendResponse(e){this.outStream.write(JSON.stringify(e)+` +`);}bind(e){this.agent=e;for(let r of dT)this.agent.on(r,n=>{this.sendResponse([0,n]);});}listen(){g3__default.default.createInterface({input:this.inStream}).on("line",e=>{this.handleLine(e);}),["SIGTERM","SIGINT"].forEach(e=>{this.process.on(e,async()=>{this.agent&&this.agent.getStatus()!=="finalized"&&await this.agent.finalize(),this.process.exit(0);});});}};var Jr=$t(N1());var al=class t{constructor(e,r,n,i){this._uri=e,this._languageId=r,this._version=n,this._content=i,this._lineOffsets=void 0;}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let r=this.offsetAt(e.start),n=this.offsetAt(e.end);return this._content.substring(r,n)}return this._content}update(e,r){for(let n of e)if(t.isIncremental(n)){let i=L1(n.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+n.text+this._content.substring(o,this._content.length);let a=Math.max(i.start.line,0),l=Math.max(i.end.line,0),d=this._lineOffsets,c=q1(n.text,!1,s);if(l-a===c.length)for(let m=0,_=c.length;m<_;m++)d[m+a+1]=c[m];else c.length<1e4?d.splice(a+1,l-a,...c):this._lineOffsets=d=d.slice(0,a+1).concat(c,d.slice(l+1));let p=n.text.length-(o-s);if(p!==0)for(let m=a+1+c.length,_=d.length;m<_;m++)d[m]=d[m]+p;}else if(t.isFull(n))this._content=n.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=r;}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=q1(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let r=this.getLineOffsets(),n=0,i=r.length;if(i===0)return {line:0,character:e};for(;ne?i=o:n=o+1;}let s=n-1;return {line:s,character:e-r[s]}}offsetAt(e){let r=this.getLineOffsets();if(e.line>=r.length)return this._content.length;if(e.line<0)return 0;let n=r[e.line],i=e.line+1{let m=c.range.start.line-p.range.start.line;return m===0?c.range.start.character-p.range.start.character:m}),l=0,d=[];for(let c of a){let p=i.offsetAt(c.range.start);if(pl&&d.push(o.substring(l,p)),c.newText.length&&d.push(c.newText),l=i.offsetAt(c.range.end);}return d.push(o.substr(l)),d.join("")}t.applyEdits=n;})(ul||(ul={}));function mg(t,e){if(t.length<=1)return t;let r=t.length/2|0,n=t.slice(0,r),i=t.slice(r);mg(n,e),mg(i,e);let s=0,o=0,a=0;for(;sr.line||e.line===r.line&&e.character>r.character?{start:r,end:e}:t}function Iz(t){let e=L1(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var cl=class{constructor(){this.connection=(0, Jr.createConnection)();this.documents=new Jr.TextDocuments(ul);this.logger=ht.child({component:"LspServer"});this.connection.onInitialize(async e=>await this.initialize(e)),this.connection.onShutdown(async()=>await this.shutdown()),this.connection.onExit(async()=>this.exit()),this.connection.onCompletion(async e=>await this.completion(e));}bind(e){this.agent=e,this.agent.on("statusChanged",r=>{(r.status==="disconnected"||r.status==="unauthorized")&&this.showMessage({type:Jr.MessageType.Warning,message:`Tabby agent status: ${r.status}`});});}listen(){this.documents.listen(this.connection),this.connection.listen();}async initialize(e){if(this.logger.debug({params:e},"LSP: initialize: request"),!this.agent)throw new Error(`Agent not bound. +`);let{clientInfo:r,capabilities:n}=e;return await this.agent.initialize({clientProperties:{session:{client:`${r?.name} ${r?.version??""}`,ide:{name:r?.name,version:r?.version},tabby_plugin:{name:`${go} (LSP)`,version:_o}}}}),{capabilities:{textDocumentSync:{openClose:!0,change:Jr.TextDocumentSyncKind.Incremental},completionProvider:{}},serverInfo:{name:go,version:_o}}}async shutdown(){if(this.logger.debug("LSP: shutdown: request"),!this.agent)throw new Error(`Agent not bound. +`);await this.agent.finalize();}exit(){return this.logger.debug("LSP: exit: request"),process.exit(0)}async showMessage(e){this.logger.debug({params:e},"LSP server notification: window/showMessage"),await this.connection.sendNotification("window/showMessage",e);}async completion(e){if(this.logger.debug({params:e},"LSP: textDocument/completion: request"),!this.agent)throw new Error(`Agent not bound. +`);try{let r=this.buildCompletionRequest(e),n=await this.agent.provideCompletions(r),i=this.toCompletionList(n,e);return this.logger.debug({completionList:i},"LSP: textDocument/completion: response"),i}catch(r){en(r)?this.logger.debug({error:r},"LSP: textDocument/completion: canceled"):this.logger.error({error:r},"LSP: textDocument/completion: error");}return {isIncomplete:!0,items:[]}}buildCompletionRequest(e,r=!1){let{textDocument:n,position:i}=e,s=this.documents.get(n.uri);return {filepath:s.uri,language:s.languageId,text:s.getText(),position:s.offsetAt(i),manually:r}}toCompletionList(e,r){let{textDocument:n,position:i}=r,s=this.documents.get(n.uri),o=s.getText({start:{line:i.line,character:0},end:i}),a=o.match(/(\w+)$/)?.[0]??"";return {isIncomplete:!0,items:e.choices.map(l=>{let d=l.text.slice(s.offsetAt(i)-l.replaceRange.start),c=Je(d),p=c[0]||"",m=c[1]||"";return {label:a+p,labelDetails:{detail:m,description:"Tabby"},kind:Jr.CompletionItemKind.Text,documentation:{kind:"markdown",value:`\`\`\` +${o+d} +\`\`\` + --- +Suggested by Tabby.`},textEdit:{newText:a+d,range:{start:{line:i.line,character:i.character-a.length},end:s.positionAt(l.replaceRange.end)}},data:{completionId:e.id,choiceIndex:l.index}}})}}};var kz=process.argv.slice(2),ll;kz.indexOf("--lsp")>=0?ll=new cl:ll=new Uu;var Mz=new Bu;ll.bind(Mz);ll.listen(); /*! Bundled license information: normalize-path/index.js: diff --git a/clients/intellij/node_scripts/wasm/LICENSES b/clients/intellij/node_scripts/wasm/LICENSES new file mode 100644 index 000000000000..1aec59c78271 --- /dev/null +++ b/clients/intellij/node_scripts/wasm/LICENSES @@ -0,0 +1,153 @@ +tree-sitter.wasm (https://github.com/tree-sitter/tree-sitter) + +The MIT License (MIT) + +Copyright (c) 2018-2023 Max Brunsfeld + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +tree-sitter-go.wasm (https://github.com/tree-sitter/tree-sitter-go) + +The MIT License (MIT) + +Copyright (c) 2014 Max Brunsfeld + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +tree-sitter-python.wasm (https://github.com/tree-sitter/tree-sitter-python) + +The MIT License (MIT) + +Copyright (c) 2016 Max Brunsfeld + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +tree-sitter-ruby.wasm (https://github.com/tree-sitter/tree-sitter-ruby) + +The MIT License (MIT) + +Copyright (c) 2016 Rob Rix + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +tree-sitter-rust.wasm (https://github.com/tree-sitter/tree-sitter-rust) + +The MIT License (MIT) + +Copyright (c) 2017 Maxim Sokolov + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +--- + +tree-sitter-tsx.wasm (https://github.com/tree-sitter/tree-sitter-typescript) + +The MIT License (MIT) + +Copyright (c) 2017 GitHub + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/CheckIssueDetail.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/CheckIssueDetail.kt index 9492c0599593..9ef6caae1b9e 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/CheckIssueDetail.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/actions/CheckIssueDetail.kt @@ -1,5 +1,6 @@ package com.tabbyml.intellijtabby.actions +import com.intellij.icons.AllIcons import com.intellij.openapi.actionSystem.* import com.intellij.openapi.application.invokeLater import com.intellij.openapi.components.service @@ -170,6 +171,11 @@ class CheckIssueDetail : AnAction() { muted += listOf("slowCompletionResponseTime", "highCompletionTimeoutRate") } e.presentation.isVisible = agentService.currentIssue.value != null && agentService.currentIssue.value !in muted + e.presentation.icon = if (agentService.currentIssue.value == "connectionFailed") { + AllIcons.General.Error + } else { + AllIcons.General.Warning + } } override fun getActionUpdateThread(): ActionUpdateThread { diff --git a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/AgentService.kt b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/AgentService.kt index 85592c4c1c8a..108620ead7ab 100644 --- a/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/AgentService.kt +++ b/clients/intellij/src/main/kotlin/com/tabbyml/intellijtabby/agent/AgentService.kt @@ -47,8 +47,6 @@ class AgentService : Disposable { var issueNotification: Notification? = null private set - private var completionResponseWarningShown = false - enum class Status { INITIALIZING, INITIALIZATION_FAILED, @@ -177,7 +175,6 @@ class AgentService : Disposable { scope.launch { agent.status.collect { status -> if (status == Agent.Status.READY) { - completionResponseWarningShown = false invokeLater { issueNotification?.expire() } @@ -187,22 +184,13 @@ class AgentService : Disposable { scope.launch { agent.currentIssue.collect { issueName -> - val showCompletionResponseWarnings = !completionResponseWarningShown && - !settings.notificationsMuted.contains("completionResponseTimeIssues") - val message = when (issueName) { - "connectionFailed" -> "Cannot connect to Tabby server" - "slowCompletionResponseTime" -> if (showCompletionResponseWarnings) { - completionResponseWarningShown = true - "Completion requests appear to take too much time" - } else { - return@collect - } - - "highCompletionTimeoutRate" -> if (showCompletionResponseWarnings) { - completionResponseWarningShown = true - "Most completion requests timed out" - } else { - return@collect + val notification = when (issueName) { + "connectionFailed" -> Notification( + "com.tabbyml.intellijtabby.notification.warning", + "Cannot connect to Tabby server", + NotificationType.ERROR, + ).apply { + addAction(ActionManager.getInstance().getAction("Tabby.CheckIssueDetail")) } else -> { @@ -212,22 +200,6 @@ class AgentService : Disposable { return@collect } } - val notification = Notification( - "com.tabbyml.intellijtabby.notification.warning", - message, - NotificationType.WARNING, - ) - notification.addAction(ActionManager.getInstance().getAction("Tabby.CheckIssueDetail")) - if (issueName in listOf("slowCompletionResponseTime", "highCompletionTimeoutRate")) { - notification.addAction( - object : AnAction("Don't Show Again") { - override fun actionPerformed(e: AnActionEvent) { - issueNotification?.expire() - settings.notificationsMuted += listOf("completionResponseTimeIssues") - } - } - ) - } invokeLater { issueNotification?.expire() issueNotification = notification