import * as s from "../../../mdurl/index.js";
import * as a from "../../../uc.micro/index.js";
import { decodeHTML as i } from "../../../entities/lib/esm/decode.js";
import o from "../../../uc.micro/categories/P/regex.js";
import x from "../../../uc.micro/categories/S/regex.js";
function u(e) {
  return Object.prototype.toString.call(e);
}
function D(e) {
  return u(e) === "[object String]";
}
const f = Object.prototype.hasOwnProperty;
function L(e, r) {
  return f.call(e, r);
}
function h(e) {
  return Array.prototype.slice.call(arguments, 1).forEach(function(t) {
    if (t) {
      if (typeof t != "object")
        throw new TypeError(t + "must be object");
      Object.keys(t).forEach(function(n) {
        e[n] = t[n];
      });
    }
  }), e;
}
function w(e, r, t) {
  return [].concat(e.slice(0, r), t, e.slice(r + 1));
}
function E(e) {
  return !(e >= 55296 && e <= 57343 || e >= 64976 && e <= 65007 || (e & 65535) === 65535 || (e & 65535) === 65534 || e >= 0 && e <= 8 || e === 11 || e >= 14 && e <= 31 || e >= 127 && e <= 159 || e > 1114111);
}
function l(e) {
  if (e > 65535) {
    e -= 65536;
    const r = 55296 + (e >> 10), t = 56320 + (e & 1023);
    return String.fromCharCode(r, t);
  }
  return String.fromCharCode(e);
}
const c = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g, p = /&([a-z#][a-z0-9]{1,31});/gi, F = new RegExp(c.source + "|" + p.source, "gi"), C = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
function d(e, r) {
  if (r.charCodeAt(0) === 35 && C.test(r)) {
    const n = r[1].toLowerCase() === "x" ? parseInt(r.slice(2), 16) : parseInt(r.slice(1), 10);
    return E(n) ? l(n) : e;
  }
  const t = i(e);
  return t !== e ? t : e;
}
function y(e) {
  return e.indexOf("\\") < 0 ? e : e.replace(c, "$1");
}
function M(e) {
  return e.indexOf("\\") < 0 && e.indexOf("&") < 0 ? e : e.replace(F, function(r, t, n) {
    return t || d(r, n);
  });
}
const _ = /[&<>"]/, g = /[&<>"]/g, A = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;"
};
function P(e) {
  return A[e];
}
function O(e) {
  return _.test(e) ? e.replace(g, P) : e;
}
const S = /[.?*+^$[\]\\(){}|-]/g;
function b(e) {
  return e.replace(S, "\\$&");
}
function B(e) {
  switch (e) {
    case 9:
    case 32:
      return !0;
  }
  return !1;
}
function I(e) {
  if (e >= 8192 && e <= 8202)
    return !0;
  switch (e) {
    case 9:
    // \t
    case 10:
    // \n
    case 11:
    // \v
    case 12:
    // \f
    case 13:
    // \r
    case 32:
    case 160:
    case 5760:
    case 8239:
    case 8287:
    case 12288:
      return !0;
  }
  return !1;
}
function $(e) {
  return o.test(e) || x.test(e);
}
function j(e) {
  switch (e) {
    case 33:
    case 34:
    case 35:
    case 36:
    case 37:
    case 38:
    case 39:
    case 40:
    case 41:
    case 42:
    case 43:
    case 44:
    case 45:
    case 46:
    case 47:
    case 58:
    case 59:
    case 60:
    case 61:
    case 62:
    case 63:
    case 64:
    case 91:
    case 92:
    case 93:
    case 94:
    case 95:
    case 96:
    case 123:
    case 124:
    case 125:
    case 126:
      return !0;
    default:
      return !1;
  }
}
function H(e) {
  return e = e.trim().replace(/\s+/g, " "), "ẞ".toLowerCase() === "Ṿ" && (e = e.replace(/ẞ/g, "ß")), e.toLowerCase().toUpperCase();
}
const N = { mdurl: s, ucmicro: a };
export {
  w as arrayReplaceAt,
  h as assign,
  O as escapeHtml,
  b as escapeRE,
  l as fromCodePoint,
  L as has,
  j as isMdAsciiPunct,
  $ as isPunctChar,
  B as isSpace,
  D as isString,
  E as isValidEntityCode,
  I as isWhiteSpace,
  N as lib,
  H as normalizeReference,
  M as unescapeAll,
  y as unescapeMd
};
