//#region ../../node_modules/vscode-uri/lib/esm/index.mjs
var e;
(() => {
	var t = { 975: (e) => {
		function t(e) {
			if (typeof e != "string") throw TypeError("Path must be a string. Received " + JSON.stringify(e));
		}
		function n(e, t) {
			for (var n, r = "", i = 0, a = -1, o = 0, s = 0; s <= e.length; ++s) {
				if (s < e.length) n = e.charCodeAt(s);
				else {
					if (n === 47) break;
					n = 47;
				}
				if (n === 47) {
					if (!(a === s - 1 || o === 1)) if (a !== s - 1 && o === 2) {
						if (r.length < 2 || i !== 2 || r.charCodeAt(r.length - 1) !== 46 || r.charCodeAt(r.length - 2) !== 46) {
							if (r.length > 2) {
								var c = r.lastIndexOf("/");
								if (c !== r.length - 1) {
									c === -1 ? (r = "", i = 0) : i = (r = r.slice(0, c)).length - 1 - r.lastIndexOf("/"), a = s, o = 0;
									continue;
								}
							} else if (r.length === 2 || r.length === 1) {
								r = "", i = 0, a = s, o = 0;
								continue;
							}
						}
						t && (r.length > 0 ? r += "/.." : r = "..", i = 2);
					} else r.length > 0 ? r += "/" + e.slice(a + 1, s) : r = e.slice(a + 1, s), i = s - a - 1;
					a = s, o = 0;
				} else n === 46 && o !== -1 ? ++o : o = -1;
			}
			return r;
		}
		var r = {
			resolve: function() {
				for (var e, r = "", i = !1, a = arguments.length - 1; a >= -1 && !i; a--) {
					var o;
					a >= 0 ? o = arguments[a] : (e === void 0 && (e = process.cwd()), o = e), t(o), o.length !== 0 && (r = o + "/" + r, i = o.charCodeAt(0) === 47);
				}
				return r = n(r, !i), i ? r.length > 0 ? "/" + r : "/" : r.length > 0 ? r : ".";
			},
			normalize: function(e) {
				if (t(e), e.length === 0) return ".";
				var r = e.charCodeAt(0) === 47, i = e.charCodeAt(e.length - 1) === 47;
				return (e = n(e, !r)).length !== 0 || r || (e = "."), e.length > 0 && i && (e += "/"), r ? "/" + e : e;
			},
			isAbsolute: function(e) {
				return t(e), e.length > 0 && e.charCodeAt(0) === 47;
			},
			join: function() {
				if (arguments.length === 0) return ".";
				for (var e, n = 0; n < arguments.length; ++n) {
					var i = arguments[n];
					t(i), i.length > 0 && (e === void 0 ? e = i : e += "/" + i);
				}
				return e === void 0 ? "." : r.normalize(e);
			},
			relative: function(e, n) {
				if (t(e), t(n), e === n || (e = r.resolve(e)) === (n = r.resolve(n))) return "";
				for (var i = 1; i < e.length && e.charCodeAt(i) === 47; ++i);
				for (var a = e.length, o = a - i, s = 1; s < n.length && n.charCodeAt(s) === 47; ++s);
				for (var c = n.length - s, l = o < c ? o : c, u = -1, d = 0; d <= l; ++d) {
					if (d === l) {
						if (c > l) {
							if (n.charCodeAt(s + d) === 47) return n.slice(s + d + 1);
							if (d === 0) return n.slice(s + d);
						} else o > l && (e.charCodeAt(i + d) === 47 ? u = d : d === 0 && (u = 0));
						break;
					}
					var f = e.charCodeAt(i + d);
					if (f !== n.charCodeAt(s + d)) break;
					f === 47 && (u = d);
				}
				var p = "";
				for (d = i + u + 1; d <= a; ++d) d !== a && e.charCodeAt(d) !== 47 || (p.length === 0 ? p += ".." : p += "/..");
				return p.length > 0 ? p + n.slice(s + u) : (s += u, n.charCodeAt(s) === 47 && ++s, n.slice(s));
			},
			_makeLong: function(e) {
				return e;
			},
			dirname: function(e) {
				if (t(e), e.length === 0) return ".";
				for (var n = e.charCodeAt(0), r = n === 47, i = -1, a = !0, o = e.length - 1; o >= 1; --o) if ((n = e.charCodeAt(o)) === 47) {
					if (!a) {
						i = o;
						break;
					}
				} else a = !1;
				return i === -1 ? r ? "/" : "." : r && i === 1 ? "//" : e.slice(0, i);
			},
			basename: function(e, n) {
				if (n !== void 0 && typeof n != "string") throw TypeError("\"ext\" argument must be a string");
				t(e);
				var r, i = 0, a = -1, o = !0;
				if (n !== void 0 && n.length > 0 && n.length <= e.length) {
					if (n.length === e.length && n === e) return "";
					var s = n.length - 1, c = -1;
					for (r = e.length - 1; r >= 0; --r) {
						var l = e.charCodeAt(r);
						if (l === 47) {
							if (!o) {
								i = r + 1;
								break;
							}
						} else c === -1 && (o = !1, c = r + 1), s >= 0 && (l === n.charCodeAt(s) ? --s == -1 && (a = r) : (s = -1, a = c));
					}
					return i === a ? a = c : a === -1 && (a = e.length), e.slice(i, a);
				}
				for (r = e.length - 1; r >= 0; --r) if (e.charCodeAt(r) === 47) {
					if (!o) {
						i = r + 1;
						break;
					}
				} else a === -1 && (o = !1, a = r + 1);
				return a === -1 ? "" : e.slice(i, a);
			},
			extname: function(e) {
				t(e);
				for (var n = -1, r = 0, i = -1, a = !0, o = 0, s = e.length - 1; s >= 0; --s) {
					var c = e.charCodeAt(s);
					if (c !== 47) i === -1 && (a = !1, i = s + 1), c === 46 ? n === -1 ? n = s : o !== 1 && (o = 1) : n !== -1 && (o = -1);
					else if (!a) {
						r = s + 1;
						break;
					}
				}
				return n === -1 || i === -1 || o === 0 || o === 1 && n === i - 1 && n === r + 1 ? "" : e.slice(n, i);
			},
			format: function(e) {
				if (typeof e != "object" || !e) throw TypeError("The \"pathObject\" argument must be of type Object. Received type " + typeof e);
				return function(e, t) {
					var n = t.dir || t.root, r = t.base || (t.name || "") + (t.ext || "");
					return n ? n === t.root ? n + r : n + "/" + r : r;
				}(0, e);
			},
			parse: function(e) {
				t(e);
				var n = {
					root: "",
					dir: "",
					base: "",
					ext: "",
					name: ""
				};
				if (e.length === 0) return n;
				var r, i = e.charCodeAt(0), a = i === 47;
				a ? (n.root = "/", r = 1) : r = 0;
				for (var o = -1, s = 0, c = -1, l = !0, u = e.length - 1, d = 0; u >= r; --u) if ((i = e.charCodeAt(u)) !== 47) c === -1 && (l = !1, c = u + 1), i === 46 ? o === -1 ? o = u : d !== 1 && (d = 1) : o !== -1 && (d = -1);
				else if (!l) {
					s = u + 1;
					break;
				}
				return o === -1 || c === -1 || d === 0 || d === 1 && o === c - 1 && o === s + 1 ? c !== -1 && (n.base = n.name = s === 0 && a ? e.slice(1, c) : e.slice(s, c)) : (s === 0 && a ? (n.name = e.slice(1, o), n.base = e.slice(1, c)) : (n.name = e.slice(s, o), n.base = e.slice(s, c)), n.ext = e.slice(o, c)), s > 0 ? n.dir = e.slice(0, s - 1) : a && (n.dir = "/"), n;
			},
			sep: "/",
			delimiter: ":",
			win32: null,
			posix: null
		};
		r.posix = r, e.exports = r;
	} }, n = {};
	function r(e) {
		var i = n[e];
		if (i !== void 0) return i.exports;
		var a = n[e] = { exports: {} };
		return t[e](a, a.exports, r), a.exports;
	}
	r.d = (e, t) => {
		for (var n in t) r.o(t, n) && !r.o(e, n) && Object.defineProperty(e, n, {
			enumerable: !0,
			get: t[n]
		});
	}, r.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t), r.r = (e) => {
		typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 });
	};
	var i = {};
	let a;
	r.r(i), r.d(i, {
		URI: () => d,
		Utils: () => w
	}), typeof process == "object" ? a = process.platform === "win32" : typeof navigator == "object" && (a = navigator.userAgent.indexOf("Windows") >= 0);
	let o = /^\w[\w\d+.-]*$/, s = /^\//, c = /^\/\//;
	function l(e, t) {
		if (!e.scheme && t) throw Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${e.authority}", path: "${e.path}", query: "${e.query}", fragment: "${e.fragment}"}`);
		if (e.scheme && !o.test(e.scheme)) throw Error("[UriError]: Scheme contains illegal characters.");
		if (e.path) {
			if (e.authority) {
				if (!s.test(e.path)) throw Error("[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash (\"/\") character");
			} else if (c.test(e.path)) throw Error("[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters (\"//\")");
		}
	}
	let u = /^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;
	class d {
		static isUri(e) {
			return e instanceof d || !!e && typeof e.authority == "string" && typeof e.fragment == "string" && typeof e.path == "string" && typeof e.query == "string" && typeof e.scheme == "string" && typeof e.fsPath == "string" && typeof e.with == "function" && typeof e.toString == "function";
		}
		scheme;
		authority;
		path;
		query;
		fragment;
		constructor(e, t, n, r, i, a = !1) {
			typeof e == "object" ? (this.scheme = e.scheme || "", this.authority = e.authority || "", this.path = e.path || "", this.query = e.query || "", this.fragment = e.fragment || "") : (this.scheme = function(e, t) {
				return e || t ? e : "file";
			}(e, a), this.authority = t || "", this.path = function(e, t) {
				switch (e) {
					case "https":
					case "http":
					case "file": t ? t[0] !== "/" && (t = "/" + t) : t = "/";
				}
				return t;
			}(this.scheme, n || ""), this.query = r || "", this.fragment = i || "", l(this, a));
		}
		get fsPath() {
			return _(this, !1);
		}
		with(e) {
			if (!e) return this;
			let { scheme: t, authority: n, path: r, query: i, fragment: a } = e;
			return t === void 0 ? t = this.scheme : t === null && (t = ""), n === void 0 ? n = this.authority : n === null && (n = ""), r === void 0 ? r = this.path : r === null && (r = ""), i === void 0 ? i = this.query : i === null && (i = ""), a === void 0 ? a = this.fragment : a === null && (a = ""), t === this.scheme && n === this.authority && r === this.path && i === this.query && a === this.fragment ? this : new p(t, n, r, i, a);
		}
		static parse(e, t = !1) {
			let n = u.exec(e);
			return n ? new p(n[2] || "", x(n[4] || ""), x(n[5] || ""), x(n[7] || ""), x(n[9] || ""), t) : new p("", "", "", "", "");
		}
		static file(e) {
			let t = "";
			if (a && (e = e.replace(/\\/g, "/")), e[0] === "/" && e[1] === "/") {
				let n = e.indexOf("/", 2);
				n === -1 ? (t = e.substring(2), e = "/") : (t = e.substring(2, n), e = e.substring(n) || "/");
			}
			return new p("file", t, e, "", "");
		}
		static from(e) {
			let t = new p(e.scheme, e.authority, e.path, e.query, e.fragment);
			return l(t, !0), t;
		}
		toString(e = !1) {
			return v(this, e);
		}
		toJSON() {
			return this;
		}
		static revive(e) {
			if (e) {
				if (e instanceof d) return e;
				{
					let t = new p(e);
					return t._formatted = e.external, t._fsPath = e._sep === f ? e.fsPath : null, t;
				}
			}
			return e;
		}
	}
	let f = a ? 1 : void 0;
	class p extends d {
		_formatted = null;
		_fsPath = null;
		get fsPath() {
			return this._fsPath ||= _(this, !1), this._fsPath;
		}
		toString(e = !1) {
			return e ? v(this, !0) : (this._formatted ||= v(this, !1), this._formatted);
		}
		toJSON() {
			let e = { $mid: 1 };
			return this._fsPath && (e.fsPath = this._fsPath, e._sep = f), this._formatted && (e.external = this._formatted), this.path && (e.path = this.path), this.scheme && (e.scheme = this.scheme), this.authority && (e.authority = this.authority), this.query && (e.query = this.query), this.fragment && (e.fragment = this.fragment), e;
		}
	}
	let m = {
		58: "%3A",
		47: "%2F",
		63: "%3F",
		35: "%23",
		91: "%5B",
		93: "%5D",
		64: "%40",
		33: "%21",
		36: "%24",
		38: "%26",
		39: "%27",
		40: "%28",
		41: "%29",
		42: "%2A",
		43: "%2B",
		44: "%2C",
		59: "%3B",
		61: "%3D",
		32: "%20"
	};
	function h(e, t, n) {
		let r, i = -1;
		for (let a = 0; a < e.length; a++) {
			let o = e.charCodeAt(a);
			if (o >= 97 && o <= 122 || o >= 65 && o <= 90 || o >= 48 && o <= 57 || o === 45 || o === 46 || o === 95 || o === 126 || t && o === 47 || n && o === 91 || n && o === 93 || n && o === 58) i !== -1 && (r += encodeURIComponent(e.substring(i, a)), i = -1), r !== void 0 && (r += e.charAt(a));
			else {
				r === void 0 && (r = e.substr(0, a));
				let t = m[o];
				t === void 0 ? i === -1 && (i = a) : (i !== -1 && (r += encodeURIComponent(e.substring(i, a)), i = -1), r += t);
			}
		}
		return i !== -1 && (r += encodeURIComponent(e.substring(i))), r === void 0 ? e : r;
	}
	function g(e) {
		let t;
		for (let n = 0; n < e.length; n++) {
			let r = e.charCodeAt(n);
			r === 35 || r === 63 ? (t === void 0 && (t = e.substr(0, n)), t += m[r]) : t !== void 0 && (t += e[n]);
		}
		return t === void 0 ? e : t;
	}
	function _(e, t) {
		let n;
		return n = e.authority && e.path.length > 1 && e.scheme === "file" ? `//${e.authority}${e.path}` : e.path.charCodeAt(0) === 47 && (e.path.charCodeAt(1) >= 65 && e.path.charCodeAt(1) <= 90 || e.path.charCodeAt(1) >= 97 && e.path.charCodeAt(1) <= 122) && e.path.charCodeAt(2) === 58 ? t ? e.path.substr(1) : e.path[1].toLowerCase() + e.path.substr(2) : e.path, a && (n = n.replace(/\//g, "\\")), n;
	}
	function v(e, t) {
		let n = t ? g : h, r = "", { scheme: i, authority: a, path: o, query: s, fragment: c } = e;
		if (i && (r += i, r += ":"), (a || i === "file") && (r += "/", r += "/"), a) {
			let e = a.indexOf("@");
			if (e !== -1) {
				let t = a.substr(0, e);
				a = a.substr(e + 1), e = t.lastIndexOf(":"), e === -1 ? r += n(t, !1, !1) : (r += n(t.substr(0, e), !1, !1), r += ":", r += n(t.substr(e + 1), !1, !0)), r += "@";
			}
			a = a.toLowerCase(), e = a.lastIndexOf(":"), e === -1 ? r += n(a, !1, !0) : (r += n(a.substr(0, e), !1, !0), r += a.substr(e));
		}
		if (o) {
			if (o.length >= 3 && o.charCodeAt(0) === 47 && o.charCodeAt(2) === 58) {
				let e = o.charCodeAt(1);
				e >= 65 && e <= 90 && (o = `/${String.fromCharCode(e + 32)}:${o.substr(3)}`);
			} else if (o.length >= 2 && o.charCodeAt(1) === 58) {
				let e = o.charCodeAt(0);
				e >= 65 && e <= 90 && (o = `${String.fromCharCode(e + 32)}:${o.substr(2)}`);
			}
			r += n(o, !0, !1);
		}
		return s && (r += "?", r += n(s, !1, !1)), c && (r += "#", r += t ? c : h(c, !1, !1)), r;
	}
	function y(e) {
		try {
			return decodeURIComponent(e);
		} catch {
			return e.length > 3 ? e.substr(0, 3) + y(e.substr(3)) : e;
		}
	}
	let b = /(%[0-9A-Za-z][0-9A-Za-z])+/g;
	function x(e) {
		return e.match(b) ? e.replace(b, ((e) => y(e))) : e;
	}
	var S = r(975);
	let C = S.posix || S;
	var w;
	(function(e) {
		e.joinPath = function(e, ...t) {
			return e.with({ path: C.join(e.path, ...t) });
		}, e.resolvePath = function(e, ...t) {
			let n = e.path, r = !1;
			n[0] !== "/" && (n = "/" + n, r = !0);
			let i = C.resolve(n, ...t);
			return r && i[0] === "/" && !e.authority && (i = i.substring(1)), e.with({ path: i });
		}, e.dirname = function(e) {
			if (e.path.length === 0 || e.path === "/") return e;
			let t = C.dirname(e.path);
			return t.length === 1 && t.charCodeAt(0) === 46 && (t = ""), e.with({ path: t });
		}, e.basename = function(e) {
			return C.basename(e.path);
		}, e.extname = function(e) {
			return C.extname(e.path);
		};
	})(w ||= {}), e = i;
})();
var { URI: t, Utils: n } = e;
//#endregion
export { t as URI, n as Utils };
