const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.js');

//#region ../../node_modules/.pnpm/decode-uri-component@0.2.2/node_modules/decode-uri-component/index.js
var require_decode_uri_component = /* @__PURE__ */ require_rolldown_runtime.__commonJS({ "../../node_modules/.pnpm/decode-uri-component@0.2.2/node_modules/decode-uri-component/index.js": ((exports, module) => {
	var token = "%[a-f0-9]{2}";
	var singleMatcher = new RegExp("(" + token + ")|([^%]+?)", "gi");
	var multiMatcher = new RegExp("(" + token + ")+", "gi");
	function decodeComponents(components, split) {
		try {
			return [decodeURIComponent(components.join(""))];
		} catch (err) {}
		if (components.length === 1) return components;
		split = split || 1;
		var left = components.slice(0, split);
		var right = components.slice(split);
		return Array.prototype.concat.call([], decodeComponents(left), decodeComponents(right));
	}
	function decode(input) {
		try {
			return decodeURIComponent(input);
		} catch (err) {
			var tokens = input.match(singleMatcher) || [];
			for (var i = 1; i < tokens.length; i++) {
				input = decodeComponents(tokens, i).join("");
				tokens = input.match(singleMatcher) || [];
			}
			return input;
		}
	}
	function customDecodeURIComponent(input) {
		var replaceMap = {
			"%FE%FF": "��",
			"%FF%FE": "��"
		};
		var match = multiMatcher.exec(input);
		while (match) {
			try {
				replaceMap[match[0]] = decodeURIComponent(match[0]);
			} catch (err) {
				var result = decode(match[0]);
				if (result !== match[0]) replaceMap[match[0]] = result;
			}
			match = multiMatcher.exec(input);
		}
		replaceMap["%C2"] = "�";
		var entries = Object.keys(replaceMap);
		for (var i = 0; i < entries.length; i++) {
			var key = entries[i];
			input = input.replace(new RegExp(key, "g"), replaceMap[key]);
		}
		return input;
	}
	module.exports = function(encodedURI) {
		if (typeof encodedURI !== "string") throw new TypeError("Expected `encodedURI` to be of type `string`, got `" + typeof encodedURI + "`");
		try {
			encodedURI = encodedURI.replace(/\+/g, " ");
			return decodeURIComponent(encodedURI);
		} catch (err) {
			return customDecodeURIComponent(encodedURI);
		}
	};
}) });

//#endregion
Object.defineProperty(exports, 'default', {
  enumerable: true,
  get: function () {
    return require_decode_uri_component();
  }
});