import { DefinedInfo as s } from "./util/defined-info.js";
import { Info as p } from "./util/info.js";
import { normalize as f } from "./normalize.js";
const l = /[A-Z]/g, c = /-[a-z]/g, d = /^data[-\w.:]+$/i;
function y(r, t) {
  const o = f(t);
  let i = t, a = p;
  if (o in r.normal)
    return r.property[r.normal[o]];
  if (o.length > 4 && o.slice(0, 4) === "data" && d.test(t)) {
    if (t.charAt(4) === "-") {
      const e = t.slice(5).replace(c, h);
      i = "data" + e.charAt(0).toUpperCase() + e.slice(1);
    } else {
      const e = t.slice(4);
      if (!c.test(e)) {
        let n = e.replace(l, m);
        n.charAt(0) !== "-" && (n = "-" + n), t = "data" + n;
      }
    }
    a = s;
  }
  return new a(i, t);
}
function m(r) {
  return "-" + r.toLowerCase();
}
function h(r) {
  return r.charAt(1).toUpperCase();
}
export {
  y as find
};
//# sourceMappingURL=find.js.map
