function T(e) {
  const t = structuredClone(e), n = /* @__PURE__ */ new WeakMap();
  function r(o) {
    if (!m(o))
      return o;
    const f = n.get(o);
    if (f)
      return f;
    const u = structuredClone(o);
    return y(o, u), u;
  }
  function i(o, f) {
    for (const u of Object.getOwnPropertySymbols(o)) {
      const p = k(o, u);
      if ("value" in p) {
        Object.defineProperty(f, u, {
          ...p,
          value: r(p.value)
        });
        continue;
      }
      Object.defineProperty(f, u, p);
    }
  }
  function s(o, f) {
    for (const u of Reflect.ownKeys(o))
      typeof u != "symbol" && y(o[u], f[u]);
  }
  function c(o, f) {
    const u = Array.from(o.entries()), p = Array.from(f.entries());
    for (let l = 0; l < u.length; l += 1) {
      const w = u[l], A = p[l];
      y(w[0], A[0]), y(w[1], A[1]);
    }
  }
  function a(o, f) {
    const u = Array.from(o.values()), p = Array.from(f.values());
    for (let l = 0; l < u.length; l += 1)
      y(u[l], p[l]);
  }
  function y(o, f) {
    if (!(!m(o) || !m(f)) && !n.has(o)) {
      if (n.set(o, f), o instanceof Map && f instanceof Map) {
        c(o, f), i(o, f);
        return;
      }
      if (o instanceof Set && f instanceof Set) {
        a(o, f), i(o, f);
        return;
      }
      s(o, f), i(o, f);
    }
  }
  return y(e, t), t;
}
function m(e) {
  return typeof e == "object" && e !== null;
}
function k(e, t) {
  const n = Object.getOwnPropertyDescriptor(e, t);
  if (n === void 0)
    throw new Error("Expected own symbol descriptor to exist.");
  return n;
}
function P(e, t = /* @__PURE__ */ new WeakSet()) {
  return t.has(e) || (t.add(e), Object.freeze(e), M(e, t), S(e, t), E(e, t)), e;
}
function h(e, t) {
  x(e) && !Object.isFrozen(e) && P(e, t);
}
function M(e, t) {
  if (e instanceof Map)
    for (const [n, r] of e)
      h(n, t), h(r, t);
}
function S(e, t) {
  if (e instanceof Set)
    for (const n of e)
      h(n, t);
}
function E(e, t) {
  for (const n of Reflect.ownKeys(e)) {
    const r = Object.getOwnPropertyDescriptor(e, n);
    !r || !("value" in r) || h(r.value, t);
  }
}
function x(e) {
  return typeof e == "object" && e !== null;
}
function g(e, t, n = /* @__PURE__ */ new WeakMap()) {
  return O(e, t, n, []);
}
function O(e, t, n, r) {
  return Object.is(e, t) ? !0 : typeof e != typeof t || typeof e != "object" ? !1 : e === null || t === null ? e === t : e instanceof Map != t instanceof Map || e instanceof Set != t instanceof Set || Array.isArray(e) !== Array.isArray(t) || e instanceof Date != t instanceof Date ? !1 : e instanceof Date ? e.getTime() === t.getTime() : D(e, t, n) ? !0 : (R(e, t, n, r), e instanceof Map ? z(e, t, n, r) : e instanceof Set ? K(e, t, n) : Array.isArray(e) ? W(e, t, n, r) : V(e, t, n, r));
}
function z(e, t, n, r) {
  if (e.size !== t.size)
    return !1;
  const i = e.entries(), s = t.entries();
  let c = i.next(), a = s.next();
  for (; !(c.done || a.done); ) {
    const [y, o] = c.value, [f, u] = a.value;
    if (!O(y, f, n, r) || !O(o, u, n, r))
      return !1;
    c = i.next(), a = s.next();
  }
  return !!(c.done && a.done);
}
function K(e, t, n) {
  if (e.size !== t.size)
    return !1;
  const r = Array.from(t.values());
  for (const i of e) {
    const s = r.findIndex((c) => v(i, c, n));
    if (s === -1)
      return !1;
    r.splice(s, 1);
  }
  return !0;
}
function W(e, t, n, r) {
  if (e.length !== t.length)
    return !1;
  for (let i = 0; i < e.length; i++) {
    const s = Object.hasOwn(e, i), c = Object.hasOwn(t, i);
    if (s !== c || s && !O(e[i], t[i], n, r))
      return !1;
  }
  return !0;
}
function V(e, t, n, r) {
  const i = [...Object.keys(e), ...Object.getOwnPropertySymbols(e)], s = [...Object.keys(t), ...Object.getOwnPropertySymbols(t)];
  if (i.length !== s.length)
    return !1;
  for (const c of i)
    if (!(s.includes(c) && O(e[c], t[c], n, r)))
      return !1;
  return !0;
}
function v(e, t, n) {
  const r = [], i = O(e, t, n, r);
  return i || q(n, r), i;
}
function D(e, t, n) {
  return n.get(e)?.has(t) ?? !1;
}
function R(e, t, n, r) {
  let i = n.get(e);
  i || (i = /* @__PURE__ */ new WeakMap(), n.set(e, i)), i.set(t, !0), r.push({ left: e, right: t });
}
function q(e, t) {
  for (let n = t.length - 1; n >= 0; n -= 1) {
    const r = t[n];
    e.get(r.left)?.delete(r.right);
  }
}
function B(e, t, n = /* @__PURE__ */ new WeakMap()) {
  return Array.isArray(e) && Array.isArray(t) ? t.slice() : Array.isArray(e) && d(t) ? C(e, t) : d(e) && Array.isArray(t) ? I(e, t) : d(e) && d(t) ? b(e, t, n) : d(t) ? t : d(e) ? e : t;
}
function d(e) {
  return Object.prototype.toString.call(e) === "[object Object]";
}
function C(e, t) {
  const n = [...e];
  for (const r of Reflect.ownKeys(t))
    n[r] = t[r];
  return n;
}
function I(e, t) {
  const n = j(e);
  for (let r = 0; r < t.length; r++)
    n[r] = t[r];
  return n;
}
function b(e, t, n) {
  const r = F(e, t, n);
  if (r)
    return r;
  const i = j(e);
  H(e, t, i, n);
  for (const s of Reflect.ownKeys(t)) {
    const c = t[s], a = e[s];
    if (Array.isArray(a) && Array.isArray(c)) {
      i[s] = c.slice();
      continue;
    }
    if (d(a) && d(c)) {
      i[s] = L(a, c, n);
      continue;
    }
    i[s] = g(c, a) ? a : c;
  }
  return i;
}
function L(e, t, n) {
  const r = b(e, t, n);
  return g(r, e) ? e : r;
}
function j(e) {
  const t = Object.getOwnPropertyDescriptors(e);
  for (const n of Reflect.ownKeys(t)) {
    const r = t[n];
    "value" in r && (t[n] = {
      ...r,
      configurable: !0,
      writable: !0
    });
  }
  return Object.create(Object.getPrototypeOf(e), t);
}
function F(e, t, n) {
  return n.get(t)?.get(e);
}
function H(e, t, n, r) {
  let i = r.get(t);
  i || (i = /* @__PURE__ */ new WeakMap(), r.set(t, i)), i.set(e, n);
}
export {
  P as a,
  B as b,
  g as c,
  T as d
};
//# sourceMappingURL=deep-merge.mjs.map
