import{b as f,c as d,k as y,n as c}from"./chunk-SQQQT7TW.js";import{a as s,g as p,h}from"./chunk-WGB426CL.js";p();function l(t){if(Array.isArray(t))t.forEach(l);else if(typeof t=="object")for(let e in t)l(t[e]);return Object.freeze(t)}s(l,"deepFreeze");function m(t){if(Array.isArray(t))return t.map(m);if(t===null)return t;if(typeof t=="object"){let e={};for(let r in t)e[r]=m(t[r]);return e}return t}s(m,"deepClone");function x(t,e){return t===e?!0:t===null||e===null||typeof t!="object"||typeof e!="object"?!1:Array.isArray(t)?Array.isArray(e)?E(t,e,x):!1:M(new Map(Object.entries(t)),new Map(Object.entries(e)),x)}s(x,"deepEquals");function E(t,e,r=(n,i)=>n===i){if(t===e)return!0;if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!r(t[n],e[n]))return!1;return!0}s(E,"arrayEquals");function M(t,e,r=(n,i)=>n===i){if(t===e)return!0;if(t.size!==e.size)return!1;for(let[n,i]of t)if(!e.has(n)||!r(i,e.get(n)))return!1;return!0}s(M,"mapEquals");async function A(t,e){try{return c(await t.realpath(e))}catch(r){if(r.code==="ENOENT")return c(e);throw r}}s(A,"getNormalizedRealPath");async function U(t,e){return f(e)?t.readUrl(e):t.readFile(e)}s(U,"readUrlOrPath");function b(t,e){return f(e)||d(e)?e:f(t)?new URL(e,t).href:y(t,e)}s(b,"resolveRelativeUrlOrPath");function z(t){return Array.isArray(t)}s(z,"isArray");function P(t){return t!==void 0}s(P,"isDefined");function F(t){return!t||/^\s*$/.test(t)}s(F,"isWhitespaceStringOrUndefined");function S(t){return t.search(/\S/)}s(S,"firstNonWhitespaceCharacterIndex");function I(t,e){let r=new Map;for(let n of t)r.set(e(n),n);return Array.from(r.values())}s(I,"distinctArray");function q(t){try{return JSON.parse(t)}catch{return}}s(q,"tryParseJson");function C(t){return Object.fromEntries(Object.entries(t).filter(([e,r])=>r!==void 0))}s(C,"omitUndefined");function N(t){if(t?.tspMain!==void 0)return t.tspMain}s(N,"resolveTspMain");var g=class{static{s(this,"MultiKeyMap")}#t=0;#e=new WeakMap;#r=new Map;get(e){return this.#r.get(this.compositeKeyFor(e))}set(e,r){let n=this.compositeKeyFor(e);this.#r.set(n,r)}compositeKeyFor(e){return e.map(r=>this.keyFor(r)).join(",")}keyFor(e){if(this.#e.has(e))return this.#e.get(e);let r=this.#t++;return this.#e.set(e,r),r}},k=class extends Map{static{s(this,"TwoLevelMap")}getOrAdd(e,r,n,i){let o=this.get(e);o===void 0&&(o=new Map,this.set(e,o));let u=o.get(r);return u===void 0&&(i!==void 0&&o.set(r,i),u=n(),o.set(r,u)),u}},w=class{static{s(this,"Queue")}#t;#e=0;constructor(e){this.#t=e?.slice()??[]}isEmpty(){return this.#e===this.#t.length}enqueue(...e){this.#t.push(...e)}dequeue(){if(this.isEmpty())throw new Error("Queue is empty.");let e=this.#t[this.#e];if(this.#t[this.#e]=void 0,this.#e++,this.#e>100&&this.#e>this.#t.length>>1){let r=this.#t.length-this.#e;this.#t.copyWithin(0,this.#e),this.#t.length=r,this.#e=0}return e}};function O(t){return new a(t)}s(O,"createRekeyableMap");var a=class{static{s(this,"RekeyableMapImpl")}#t=new Map;#e=new Map;constructor(e){if(e)for(let[r,n]of e)this.set(r,n)}clear(){this.#t.clear(),this.#e.clear()}delete(e){let r=this.#t.get(e);return r?(this.#t.delete(e),this.#e.delete(r)):!1}forEach(e,r){this.#e.forEach((n,i)=>{e(n,i.key,this)},r)}get(e){let r=this.#t.get(e);return r?this.#e.get(r):void 0}has(e){return this.#t.has(e)}set(e,r){let n=this.#t.get(e);return n||(n={key:e},this.#t.set(e,n)),this.#e.set(n,r),this}get size(){return this.#e.size}*entries(){for(let[e,r]of this.#e)yield[e.key,r]}*keys(){for(let e of this.#e.keys())yield e.key}values(){return this.#e.values()}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="RekeyableMap";rekey(e,r){let n=this.#t.get(e);if(!n)return!1;this.#t.delete(e);let i=this.#t.get(r);return i&&this.#e.delete(i),n.key=r,this.#t.set(r,n),!0}};function R(t){return!!t&&typeof t.then=="function"}s(R,"isPromise");function T(t,e){return typeof process<"u"?h?.[t]??e:e}s(T,"getEnvironmentVariable");export{l as a,m as b,x as c,M as d,A as e,U as f,b as g,z as h,P as i,F as j,S as k,I as l,q as m,C as n,N as o,g as p,k as q,w as r,O as s,R as t,T as u};
