var f, y;
function M() {
  if (y) return f;
  y = 1;
  var m = "html", v = "head", a = "body", E = /<([a-zA-Z]+[0-9]?)/, l = /<head[^]*>/i, T = /<body[^]*>/i, i = function() {
    throw new Error(
      "This browser does not support `document.implementation.createHTMLDocument`"
    );
  }, c = function() {
    throw new Error(
      "This browser does not support `DOMParser.prototype.parseFromString`"
    );
  }, w = typeof window == "object" && window.DOMParser;
  if (typeof w == "function") {
    var D = new w(), S = "text/html";
    c = function(e, r) {
      return r && (e = "<" + r + ">" + e + "</" + r + ">"), D.parseFromString(e, S);
    }, i = c;
  }
  if (typeof document == "object" && document.implementation) {
    var u = document.implementation.createHTMLDocument();
    i = function(e, r) {
      if (r) {
        var n = u.documentElement.querySelector(r);
        return n.innerHTML = e, u;
      }
      return u.documentElement.innerHTML = e, u;
    };
  }
  var s = typeof document == "object" ? document.createElement("template") : {}, d;
  s.content && (d = function(e) {
    return s.innerHTML = e, s.content.childNodes;
  });
  function q(e) {
    var r, n = e.match(E);
    n && n[1] && (r = n[1].toLowerCase());
    var o, t, p;
    switch (r) {
      case m:
        return o = c(e), l.test(e) || (t = o.querySelector(v), t && t.parentNode.removeChild(t)), T.test(e) || (t = o.querySelector(a), t && t.parentNode.removeChild(t)), o.querySelectorAll(m);
      case v:
      case a:
        return o = i(e), p = o.querySelectorAll(r), T.test(e) && l.test(e) ? p[0].parentNode.childNodes : p;
      // low-level tag or text
      default:
        return d ? d(e) : (t = i(e, a).querySelector(a), t.childNodes);
    }
  }
  return f = q, f;
}
export {
  M as __require
};
