function C(t, e) {
  return e.forEach(function(r) {
    r && typeof r != "string" && !Array.isArray(r) && Object.keys(r).forEach(function(n) {
      if (n !== "default" && !(n in t)) {
        var a = Object.getOwnPropertyDescriptor(r, n);
        Object.defineProperty(t, n, a.get ? a : {
          enumerable: true,
          get: function() {
            return r[n];
          }
        });
      }
    });
  }), Object.freeze(t);
}
const T = Object.prototype.toString, N = Object.prototype.hasOwnProperty;
function x(t) {
  return t === void 0;
}
function A(t) {
  return T.call(t) === "[object Array]";
}
function _(t, e) {
  return N.call(t, e);
}
function h(t, e) {
  let r, n;
  if (x(t))
    return;
  const a = A(t) ? j : L;
  for (let u in t)
    if (_(t, u) && (r = t[u], n = e(r, a(u)), n === false))
      return r;
}
function L(t) {
  return t;
}
function j(t) {
  return Number(t);
}
function B(t, ...e) {
  const r = t.style;
  return h(e, function(n) {
    n && h(n, function(a, u) {
      r[u] = a;
    });
  }), t;
}
function F(t, e, r) {
  return arguments.length == 2 ? t.getAttribute(e) : r === null ? t.removeAttribute(e) : (t.setAttribute(e, r), t);
}
const M = Object.prototype.toString;
function R(t) {
  return new s(t);
}
function s(t) {
  if (!t || !t.nodeType)
    throw new Error("A DOM element reference is required");
  this.el = t, this.list = t.classList;
}
s.prototype.add = function(t) {
  return this.list.add(t), this;
};
s.prototype.remove = function(t) {
  return M.call(t) == "[object RegExp]" ? this.removeMatching(t) : (this.list.remove(t), this);
};
s.prototype.removeMatching = function(t) {
  const e = this.array();
  for (let r = 0; r < e.length; r++)
    t.test(e[r]) && this.remove(e[r]);
  return this;
};
s.prototype.toggle = function(t, e) {
  return typeof e < "u" ? e !== this.list.toggle(t, e) && this.list.toggle(t) : this.list.toggle(t), this;
};
s.prototype.array = function() {
  return Array.from(this.list);
};
s.prototype.has = s.prototype.contains = function(t) {
  return this.list.contains(t);
};
function k(t) {
  for (var e; t.childNodes.length; )
    e = t.childNodes[0], t.removeChild(e);
  return t;
}
function y(t, e) {
  return t && typeof t.matches == "function" && t.matches(e);
}
function D(t, e, r) {
  for (var n = r ? t : t.parentNode; n && n.nodeType !== document.DOCUMENT_NODE && n.nodeType !== document.DOCUMENT_FRAGMENT_NODE; ) {
    if (y(n, e))
      return n;
    n = n.parentNode;
  }
  return y(n, e) ? n : null;
}
var c = {}, d, p, v;
function b() {
  d = window.addEventListener ? "addEventListener" : "attachEvent", p = window.removeEventListener ? "removeEventListener" : "detachEvent", v = d !== "addEventListener" ? "on" : "";
}
var S = c.bind = function(t, e, r, n) {
  return d || b(), t[d](v + e, r, n || false), r;
}, q = c.unbind = function(t, e, r, n) {
  return p || b(), t[p](v + e, r, n || false), r;
}, m = /* @__PURE__ */ C({
  __proto__: null,
  bind: S,
  unbind: q,
  default: c
}, [c]), E = ["focus", "blur"];
function H(t, e, r, n, a) {
  return E.indexOf(r) !== -1 && (a = true), m.bind(t, r, function(u) {
    var l = u.target || u.srcElement;
    u.delegateTarget = D(l, e, true), u.delegateTarget && n.call(t, u);
  }, a);
}
function P(t, e, r, n) {
  return E.indexOf(e) !== -1 && (n = true), m.unbind(t, e, r, n);
}
var z = {
  bind: H,
  unbind: P
}, $ = U, w = false, f;
typeof document < "u" && (f = document.createElement("div"), f.innerHTML = '  <link/><table></table><a href="/a">a</a><input type="checkbox"/>', w = !f.getElementsByTagName("link").length, f = void 0);
var i = {
  legend: [1, "<fieldset>", "</fieldset>"],
  tr: [2, "<table><tbody>", "</tbody></table>"],
  col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
  // for script/link/style tags to work in IE6-8, you have to wrap
  // in a div with a non-whitespace character in front, ha!
  _default: w ? [1, "X<div>", "</div>"] : [0, "", ""]
};
i.td = i.th = [3, "<table><tbody><tr>", "</tr></tbody></table>"];
i.option = i.optgroup = [1, '<select multiple="multiple">', "</select>"];
i.thead = i.tbody = i.colgroup = i.caption = i.tfoot = [1, "<table>", "</table>"];
i.polyline = i.ellipse = i.polygon = i.circle = i.text = i.line = i.path = i.rect = i.g = [1, '<svg xmlns="http://www.w3.org/2000/svg" version="1.1">', "</svg>"];
function U(t, e) {
  if (typeof t != "string")
    throw new TypeError("String expected");
  e || (e = document);
  var r = /<([\w:]+)/.exec(t);
  if (!r)
    return e.createTextNode(t);
  t = t.replace(/^\s+|\s+$/g, "");
  var n = r[1];
  if (n == "body") {
    var o = e.createElement("html");
    return o.innerHTML = t, o.removeChild(o.lastChild);
  }
  var a = Object.prototype.hasOwnProperty.call(i, n) ? i[n] : i._default, u = a[0], l = a[1], O = a[2], o = e.createElement("div");
  for (o.innerHTML = l + t + O; u--; )
    o = o.lastChild;
  if (o.firstChild == o.lastChild)
    return o.removeChild(o.firstChild);
  for (var g = e.createDocumentFragment(); o.firstChild; )
    g.appendChild(o.removeChild(o.firstChild));
  return g;
}
var G = $;
function K(t, e) {
  return e = e || document, e.querySelector(t);
}
function X(t, e) {
  return e = e || document, e.querySelectorAll(t);
}
function I(t) {
  t.parentNode && t.parentNode.removeChild(t);
}
export {
  B as assignStyle,
  F as attr,
  R as classes,
  k as clear,
  D as closest,
  z as delegate,
  G as domify,
  m as event,
  y as matches,
  K as query,
  X as queryAll,
  I as remove
};
