import { decodeNamedCharacterReference as e } from "../decode-named-character-reference/index.dom.js";
import { decodeNumericCharacterReference as t } from "../micromark-util-decode-numeric-character-reference/index.js";
//#region ../../node_modules/micromark-util-decode-string/index.js
var n = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
function r(e) {
	return e.replace(n, i);
}
function i(n, r, i) {
	if (r) return r;
	if (i.charCodeAt(0) === 35) {
		let e = i.charCodeAt(1), n = e === 120 || e === 88;
		return t(i.slice(n ? 2 : 1), n ? 16 : 10);
	}
	return e(i) || n;
}
//#endregion
export { r as decodeString };
