"use client";
import { characterEntitiesLegacy as f } from "../../../character-entities-legacy/index.js";
import { characterEntitiesHtml4 as o } from "../../../character-entities-html4/index.js";
import { dangerous as u } from "../constant/dangerous.js";
const i = {}.hasOwnProperty, n = {};
let r;
for (r in o)
  i.call(o, r) && (n[o[r]] = r);
const h = /[^\dA-Za-z]/;
function C(s, t, m, l) {
  const c = String.fromCharCode(s);
  if (i.call(n, c)) {
    const e = n[c], a = "&" + e;
    return m && f.includes(e) && !u.includes(e) && (!l || t && t !== 61 && h.test(String.fromCharCode(t))) ? a : a + ";";
  }
  return "";
}
export {
  C as toNamed
};
