"use client";
const s = /["&'<>`]/g, g = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g, o = (
  // eslint-disable-next-line no-control-regex, unicorn/no-hex-escape
  /[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g
), h = /[|\\{}()[\]^$+*?.]/g, u = /* @__PURE__ */ new WeakMap();
function f(r, e) {
  if (r = r.replace(
    e.subset ? F(e.subset) : s,
    x
  ), e.subset || e.escapeOnly)
    return r;
  return r.replace(g, c).replace(o, x);
  function c(t, a, n) {
    return e.format(
      (t.charCodeAt(0) - 55296) * 1024 + t.charCodeAt(1) - 56320 + 65536,
      n.charCodeAt(a + 2),
      e
    );
  }
  function x(t, a, n) {
    return e.format(
      t.charCodeAt(0),
      n.charCodeAt(a + 1),
      e
    );
  }
}
function F(r) {
  let e = u.get(r);
  return e || (e = d(r), u.set(r, e)), e;
}
function d(r) {
  const e = [];
  let c = -1;
  for (; ++c < r.length; )
    e.push(r[c].replace(h, "\\$&"));
  return new RegExp("(?:" + e.join("|") + ")", "g");
}
export {
  f as core
};
//# sourceMappingURL=index.esm464.js.map
