import e, { useMemo as t, useLayoutEffect as n, useEffect as r, useRef as o, useCallback as i, useState as a, memo as l, useReducer as s, createContext as c, useContext as d } from "react";
import { unstable_batchedUpdates as u, createPortal as h } from "react-dom";
import { j as g, a as v, F as f } from "./common-64096f9e.js";
const p = "undefined" != typeof window && void 0 !== window.document && void 0 !== window.document.createElement;
function m(e2) {
  const t2 = Object.prototype.toString.call(e2);
  return "[object Window]" === t2 || "[object global]" === t2;
}
function b(e2) {
  return "nodeType" in e2;
}
function y(e2) {
  var t2, n2;
  return e2 ? m(e2) ? e2 : b(e2) && null != (t2 = null == (n2 = e2.ownerDocument) ? void 0 : n2.defaultView) ? t2 : window : window;
}
function w(e2) {
  const { Document: t2 } = y(e2);
  return e2 instanceof t2;
}
function x(e2) {
  return !m(e2) && e2 instanceof y(e2).HTMLElement;
}
function D(e2) {
  return e2 instanceof y(e2).SVGElement;
}
function R(e2) {
  return e2 ? m(e2) ? e2.document : b(e2) ? w(e2) ? e2 : x(e2) || D(e2) ? e2.ownerDocument : document : document : document;
}
const C = p ? n : r;
function S(e2, t2) {
  void 0 === t2 && (t2 = [e2]);
  const n2 = o(e2);
  return C(() => {
    n2.current !== e2 && (n2.current = e2);
  }, t2), n2;
}
function E(e2, n2) {
  const r2 = o();
  return t(() => {
    const t2 = e2(r2.current);
    return r2.current = t2, t2;
  }, [...n2]);
}
function N(e2) {
  const t2 = function(e3) {
    const t3 = o(e3);
    return C(() => {
      t3.current = e3;
    }), i(function() {
      for (var e4 = arguments.length, n3 = new Array(e4), r3 = 0; r3 < e4; r3++)
        n3[r3] = arguments[r3];
      return null == t3.current ? void 0 : t3.current(...n3);
    }, []);
  }(e2), n2 = o(null), r2 = i((e3) => {
    e3 !== n2.current && (null == t2 || t2(e3, n2.current)), n2.current = e3;
  }, []);
  return [n2, r2];
}
let I = {};
function T(e2, n2) {
  return t(() => {
    if (n2)
      return n2;
    const t2 = null == I[e2] ? 0 : I[e2] + 1;
    return I[e2] = t2, e2 + "-" + t2;
  }, [e2, n2]);
}
function O(e2) {
  return function(t2) {
    for (var n2 = arguments.length, r2 = new Array(n2 > 1 ? n2 - 1 : 0), o2 = 1; o2 < n2; o2++)
      r2[o2 - 1] = arguments[o2];
    return r2.reduce((t3, n3) => {
      const r3 = Object.entries(n3);
      for (const [n4, o3] of r3) {
        const r4 = t3[n4];
        null != r4 && (t3[n4] = r4 + e2 * o3);
      }
      return t3;
    }, { ...t2 });
  };
}
const A = O(1), M = O(-1);
function L(e2) {
  if (!e2)
    return false;
  const { KeyboardEvent: t2 } = y(e2.target);
  return t2 && e2 instanceof t2;
}
function k(e2) {
  if (function(e3) {
    if (!e3)
      return false;
    const { TouchEvent: t2 } = y(e3.target);
    return t2 && e3 instanceof t2;
  }(e2)) {
    if (e2.touches && e2.touches.length) {
      const { clientX: t2, clientY: n2 } = e2.touches[0];
      return { x: t2, y: n2 };
    }
    if (e2.changedTouches && e2.changedTouches.length) {
      const { clientX: t2, clientY: n2 } = e2.changedTouches[0];
      return { x: t2, y: n2 };
    }
  }
  return function(e3) {
    return "clientX" in e3 && "clientY" in e3;
  }(e2) ? { x: e2.clientX, y: e2.clientY } : null;
}
const B = Object.freeze({ Translate: { toString(e2) {
  if (!e2)
    return;
  const { x: t2, y: n2 } = e2;
  return "translate3d(" + (t2 ? Math.round(t2) : 0) + "px, " + (n2 ? Math.round(n2) : 0) + "px, 0)";
} }, Scale: { toString(e2) {
  if (!e2)
    return;
  const { scaleX: t2, scaleY: n2 } = e2;
  return "scaleX(" + t2 + ") scaleY(" + n2 + ")";
} }, Transform: { toString(e2) {
  if (e2)
    return [B.Translate.toString(e2), B.Scale.toString(e2)].join(" ");
} }, Transition: { toString(e2) {
  let { property: t2, duration: n2, easing: r2 } = e2;
  return t2 + " " + n2 + "ms " + r2;
} } }), j = { display: "none" };
function P(e2) {
  let { id: t2, value: n2 } = e2;
  return g("div", { id: t2, style: j, children: n2 });
}
function z(e2) {
  let { id: t2, announcement: n2, ariaLiveType: r2 = "assertive" } = e2;
  return g("div", { id: t2, style: { position: "fixed", width: 1, height: 1, margin: -1, border: 0, padding: 0, overflow: "hidden", clip: "rect(0 0 0 0)", clipPath: "inset(100%)", whiteSpace: "nowrap" }, role: "status", "aria-live": r2, "aria-atomic": true, children: n2 });
}
const X = { draggable: "\n    To pick up a draggable item, press the space bar.\n    While dragging, use the arrow keys to move the item.\n    Press space again to drop the item in its new position, or press escape to cancel.\n  " }, Y = { onDragStart: (e2) => `Picked up draggable item ${e2}.`, onDragOver: (e2, t2) => t2 ? `Draggable item ${e2} was moved over droppable area ${t2}.` : `Draggable item ${e2} is no longer over a droppable area.`, onDragEnd: (e2, t2) => t2 ? `Draggable item ${e2} was dropped over droppable area ${t2}` : `Draggable item ${e2} was dropped.`, onDragCancel: (e2) => `Dragging was cancelled. Draggable item ${e2} was dropped.` };
var K;
function F(...e2) {
}
!function(e2) {
  e2.DragStart = "dragStart", e2.DragMove = "dragMove", e2.DragEnd = "dragEnd", e2.DragCancel = "dragCancel", e2.DragOver = "dragOver", e2.RegisterDroppable = "registerDroppable", e2.SetDroppableDisabled = "setDroppableDisabled", e2.UnregisterDroppable = "unregisterDroppable";
}(K || (K = {}));
class W extends Map {
  get(e2) {
    var t2;
    return null != e2 && null != (t2 = super.get(e2)) ? t2 : void 0;
  }
  toArray() {
    return Array.from(this.values());
  }
  getEnabled() {
    return this.toArray().filter(({ disabled: e2 }) => !e2);
  }
  getNodeFor(e2) {
    var t2, n2;
    return null != (t2 = null == (n2 = this.get(e2)) ? void 0 : n2.node.current) ? t2 : void 0;
  }
}
const $ = { activatorEvent: null, active: null, activeNode: null, activeNodeRect: null, collisions: null, containerNodeRect: null, draggableNodes: {}, droppableRects: /* @__PURE__ */ new Map(), droppableContainers: new W(), over: null, dragOverlay: { nodeRef: { current: null }, rect: null, setRef: F }, scrollableAncestors: [], scrollableAncestorRects: [], measureDroppableContainers: F, windowRect: null, measuringScheduled: false }, U = { activatorEvent: null, activators: [], active: null, activeNodeRect: null, ariaDescribedById: { draggable: "" }, dispatch: F, draggableNodes: {}, over: null, measureDroppableContainers: F }, H = c(U), V = c($);
function q() {
  return { draggable: { active: null, initialCoordinates: { x: 0, y: 0 }, nodes: {}, translate: { x: 0, y: 0 } }, droppable: { containers: new W() } };
}
function G(e2, t2) {
  switch (t2.type) {
    case K.DragStart:
      return { ...e2, draggable: { ...e2.draggable, initialCoordinates: t2.initialCoordinates, active: t2.active } };
    case K.DragMove:
      return e2.draggable.active ? { ...e2, draggable: { ...e2.draggable, translate: { x: t2.coordinates.x - e2.draggable.initialCoordinates.x, y: t2.coordinates.y - e2.draggable.initialCoordinates.y } } } : e2;
    case K.DragEnd:
    case K.DragCancel:
      return { ...e2, draggable: { ...e2.draggable, active: null, initialCoordinates: { x: 0, y: 0 }, translate: { x: 0, y: 0 } } };
    case K.RegisterDroppable: {
      const { element: n2 } = t2, { id: r2 } = n2, o2 = new W(e2.droppable.containers);
      return o2.set(r2, n2), { ...e2, droppable: { ...e2.droppable, containers: o2 } };
    }
    case K.SetDroppableDisabled: {
      const { id: n2, key: r2, disabled: o2 } = t2, i2 = e2.droppable.containers.get(n2);
      if (!i2 || r2 !== i2.key)
        return e2;
      const a2 = new W(e2.droppable.containers);
      return a2.set(n2, { ...i2, disabled: o2 }), { ...e2, droppable: { ...e2.droppable, containers: a2 } };
    }
    case K.UnregisterDroppable: {
      const { id: n2, key: r2 } = t2, o2 = e2.droppable.containers.get(n2);
      if (!o2 || r2 !== o2.key)
        return e2;
      const i2 = new W(e2.droppable.containers);
      return i2.delete(n2), { ...e2, droppable: { ...e2.droppable, containers: i2 } };
    }
    default:
      return e2;
  }
}
const J = c({ type: null, event: null });
function Q({ announcements: e2 = Y, hiddenTextDescribedById: n2, screenReaderInstructions: l2 }) {
  const { announce: s2, announcement: c2 } = function() {
    const [e3, t2] = a("");
    return { announce: i((e4) => {
      null != e4 && t2(e4);
    }, []), announcement: e3 };
  }(), u2 = T("DndLiveRegion"), [p2, m2] = a(false);
  return r(() => {
    m2(true);
  }, []), function({ onDragStart: e3, onDragMove: t2, onDragOver: n3, onDragEnd: i2, onDragCancel: a2 }) {
    const l3 = d(J), s3 = o(l3);
    r(() => {
      if (l3 !== s3.current) {
        const { type: r2, event: o2 } = l3;
        switch (r2) {
          case K.DragStart:
            null == e3 || e3(o2);
            break;
          case K.DragMove:
            null == t2 || t2(o2);
            break;
          case K.DragOver:
            null == n3 || n3(o2);
            break;
          case K.DragCancel:
            null == a2 || a2(o2);
            break;
          case K.DragEnd:
            null == i2 || i2(o2);
        }
        s3.current = l3;
      }
    }, [l3, e3, t2, n3, i2, a2]);
  }(t(() => ({ onDragStart({ active: t2 }) {
    s2(e2.onDragStart(t2.id));
  }, onDragMove({ active: t2, over: n3 }) {
    e2.onDragMove && s2(e2.onDragMove(t2.id, null == n3 ? void 0 : n3.id));
  }, onDragOver({ active: t2, over: n3 }) {
    s2(e2.onDragOver(t2.id, null == n3 ? void 0 : n3.id));
  }, onDragEnd({ active: t2, over: n3 }) {
    s2(e2.onDragEnd(t2.id, null == n3 ? void 0 : n3.id));
  }, onDragCancel({ active: t2 }) {
    s2(e2.onDragCancel(t2.id));
  } }), [s2, e2])), p2 ? h(v(f, { children: [g(P, { id: n2, value: l2.draggable }), g(z, { id: u2, announcement: c2 })] }), document.body) : null;
}
const Z = Object.freeze({ x: 0, y: 0 });
function _(e2, t2) {
  const n2 = k(e2);
  if (!n2)
    return "0 0";
  return `${(n2.x - t2.left) / t2.width * 100}% ${(n2.y - t2.top) / t2.height * 100}%`;
}
function ee({ data: { value: e2 } }, { data: { value: t2 } }) {
  return t2 - e2;
}
function te(e2, t2) {
  const n2 = Math.max(t2.top, e2.top), r2 = Math.max(t2.left, e2.left), o2 = Math.min(t2.left + t2.width, e2.left + e2.width), i2 = Math.min(t2.top + t2.height, e2.top + e2.height), a2 = o2 - r2, l2 = i2 - n2;
  if (r2 < o2 && n2 < i2) {
    const n3 = t2.width * t2.height, r3 = e2.width * e2.height, o3 = a2 * l2;
    return Number((o3 / (n3 + r3 - o3)).toFixed(4));
  }
  return 0;
}
const ne = ({ collisionRect: e2, droppableContainers: t2 }) => {
  const n2 = [];
  for (const r2 of t2) {
    const { id: t3, rect: { current: o2 } } = r2;
    if (o2) {
      const i2 = te(o2, e2);
      i2 > 0 && n2.push({ id: t3, data: { droppableContainer: r2, value: i2 } });
    }
  }
  return n2.sort(ee);
};
function re(e2) {
  return function(t2, ...n2) {
    return n2.reduce((t3, n3) => ({ ...t3, top: t3.top + e2 * n3.y, bottom: t3.bottom + e2 * n3.y, left: t3.left + e2 * n3.x, right: t3.right + e2 * n3.x }), { ...t2 });
  };
}
const oe = re(1);
const ie = { ignoreTransform: false };
function ae(e2, t2 = ie) {
  let n2 = e2.getBoundingClientRect();
  if (t2.ignoreTransform) {
    const { getComputedStyle: t3 } = y(e2), { transform: r3, transformOrigin: o3 } = t3(e2);
    r3 && (n2 = function(e3, t4, n3) {
      let r4, o4, i3, a3, l3;
      if (t4.startsWith("matrix3d("))
        r4 = t4.slice(9, -1).split(/, /), o4 = +r4[0], i3 = +r4[5], a3 = +r4[12], l3 = +r4[13];
      else {
        if (!t4.startsWith("matrix("))
          return e3;
        r4 = t4.slice(7, -1).split(/, /), o4 = +r4[0], i3 = +r4[3], a3 = +r4[4], l3 = +r4[5];
      }
      const s3 = e3.left - a3 - (1 - o4) * parseFloat(n3), c2 = e3.top - l3 - (1 - i3) * parseFloat(n3.slice(n3.indexOf(" ") + 1)), d2 = o4 ? e3.width / o4 : e3.width, u2 = i3 ? e3.height / i3 : e3.height;
      return { width: d2, height: u2, top: c2, right: s3 + d2, bottom: c2 + u2, left: s3 };
    }(n2, r3, o3));
  }
  const { top: r2, left: o2, width: i2, height: a2, bottom: l2, right: s2 } = n2;
  return { top: r2, left: o2, width: i2, height: a2, bottom: l2, right: s2 };
}
function le(e2) {
  return ae(e2, { ignoreTransform: true });
}
function se(e2) {
  const t2 = [];
  return e2 ? function n2(r2) {
    if (!r2)
      return t2;
    if (w(r2) && null != r2.scrollingElement && !t2.includes(r2.scrollingElement))
      return t2.push(r2.scrollingElement), t2;
    if (!x(r2) || D(r2))
      return t2;
    if (t2.includes(r2))
      return t2;
    const { getComputedStyle: o2 } = y(r2), i2 = o2(r2);
    return r2 !== e2 && function(e3, t3 = y(e3).getComputedStyle(e3)) {
      const n3 = /(auto|scroll|overlay)/;
      return null != ["overflow", "overflowX", "overflowY"].find((e4) => {
        const r3 = t3[e4];
        return "string" == typeof r3 && n3.test(r3);
      });
    }(r2, i2) && t2.push(r2), function(e3, t3 = y(e3).getComputedStyle(e3)) {
      return "fixed" === t3.position;
    }(r2, i2) ? t2 : n2(r2.parentNode);
  }(e2) : t2;
}
function ce(e2) {
  return p && e2 ? m(e2) ? e2 : b(e2) ? w(e2) || e2 === R(e2).scrollingElement ? window : x(e2) ? e2 : null : null : null;
}
function de(e2) {
  return m(e2) ? e2.scrollX : e2.scrollLeft;
}
function ue(e2) {
  return m(e2) ? e2.scrollY : e2.scrollTop;
}
function he(e2) {
  return { x: de(e2), y: ue(e2) };
}
var ge;
function ve(e2) {
  const t2 = { x: 0, y: 0 }, n2 = { x: e2.scrollWidth - e2.clientWidth, y: e2.scrollHeight - e2.clientHeight };
  return { isTop: e2.scrollTop <= t2.y, isLeft: e2.scrollLeft <= t2.x, isBottom: e2.scrollTop >= n2.y, isRight: e2.scrollLeft >= n2.x, maxScroll: n2, minScroll: t2 };
}
!function(e2) {
  e2[e2.Forward = 1] = "Forward", e2[e2.Backward = -1] = "Backward";
}(ge || (ge = {}));
const fe = { x: 0.2, y: 0.2 };
function pe(e2, t2, { top: n2, left: r2, right: o2, bottom: i2 }, a2 = 10, l2 = fe) {
  const { clientHeight: s2, clientWidth: c2 } = e2, d2 = (u2 = e2, p && u2 && u2 === document.scrollingElement ? { top: 0, left: 0, right: c2, bottom: s2, width: c2, height: s2 } : t2);
  var u2;
  const { isTop: h2, isBottom: g2, isLeft: v2, isRight: f2 } = ve(e2), m2 = { x: 0, y: 0 }, b2 = { x: 0, y: 0 }, y2 = d2.height * l2.y, w2 = d2.width * l2.x;
  return !h2 && n2 <= d2.top + y2 ? (m2.y = ge.Backward, b2.y = a2 * Math.abs((d2.top + y2 - n2) / y2)) : !g2 && i2 >= d2.bottom - y2 && (m2.y = ge.Forward, b2.y = a2 * Math.abs((d2.bottom - y2 - i2) / y2)), !f2 && o2 >= d2.right - w2 ? (m2.x = ge.Forward, b2.x = a2 * Math.abs((d2.right - w2 - o2) / w2)) : !v2 && r2 <= d2.left + w2 && (m2.x = ge.Backward, b2.x = a2 * Math.abs((d2.left + w2 - r2) / w2)), { direction: m2, speed: b2 };
}
function me(e2) {
  if (e2 === document.scrollingElement) {
    const { innerWidth: e3, innerHeight: t3 } = window;
    return { top: 0, left: 0, right: e3, bottom: t3, width: e3, height: t3 };
  }
  const { top: t2, left: n2, right: r2, bottom: o2 } = e2.getBoundingClientRect();
  return { top: t2, left: n2, right: r2, bottom: o2, width: e2.clientWidth, height: e2.clientHeight };
}
function be(e2) {
  return e2.reduce((e3, t2) => A(e3, he(t2)), Z);
}
const ye = [["x", ["left", "right"], function(e2) {
  return e2.reduce((e3, t2) => e3 + de(t2), 0);
}], ["y", ["top", "bottom"], function(e2) {
  return e2.reduce((e3, t2) => e3 + ue(t2), 0);
}]];
class we {
  constructor(e2, t2) {
    this.rect = void 0, this.width = void 0, this.height = void 0, this.top = void 0, this.bottom = void 0, this.right = void 0, this.left = void 0;
    const n2 = se(t2), r2 = be(n2);
    this.rect = { ...e2 }, this.width = e2.width, this.height = e2.height;
    for (const [e3, t3, o2] of ye)
      for (const i2 of t3)
        Object.defineProperty(this, i2, { get: () => {
          const t4 = o2(n2), a2 = r2[e3] - t4;
          return this.rect[i2] + a2;
        }, enumerable: true });
    Object.defineProperty(this, "rect", { enumerable: false });
  }
}
var xe, De, Re, Ce;
function Se({ acceleration: e2, activator: n2 = xe.Pointer, canScroll: a2, draggingRect: l2, enabled: s2, interval: c2 = 5, order: d2 = De.TreeOrder, pointerCoordinates: u2, scrollableAncestors: h2, scrollableAncestorRects: g2, threshold: v2 }) {
  const [f2, p2] = function() {
    const e3 = o(null);
    return [i((t2, n3) => {
      e3.current = setInterval(t2, n3);
    }, []), i(() => {
      null !== e3.current && (clearInterval(e3.current), e3.current = null);
    }, [])];
  }(), m2 = o({ x: 1, y: 1 }), b2 = t(() => {
    switch (n2) {
      case xe.Pointer:
        return u2 ? { top: u2.y, bottom: u2.y, left: u2.x, right: u2.x } : null;
      case xe.DraggableRect:
        return l2;
    }
    return null;
  }, [n2, l2, u2]), y2 = o(Z), w2 = o(null), x2 = i(() => {
    const e3 = w2.current;
    if (!e3)
      return;
    const t2 = m2.current.x * y2.current.x, n3 = m2.current.y * y2.current.y;
    e3.scrollBy(t2, n3);
  }, []), D2 = t(() => d2 === De.TreeOrder ? [...h2].reverse() : h2, [d2, h2]);
  r(() => {
    if (s2 && h2.length && b2) {
      for (const t2 of D2) {
        if (false === (null == a2 ? void 0 : a2(t2)))
          continue;
        const n3 = h2.indexOf(t2), r2 = g2[n3];
        if (!r2)
          continue;
        const { direction: o2, speed: i2 } = pe(t2, r2, b2, e2, v2);
        if (i2.x > 0 || i2.y > 0)
          return p2(), w2.current = t2, f2(x2, c2), m2.current = i2, void (y2.current = o2);
      }
      m2.current = { x: 0, y: 0 }, y2.current = { x: 0, y: 0 }, p2();
    } else
      p2();
  }, [e2, x2, a2, p2, s2, c2, JSON.stringify(b2), f2, h2, D2, g2, JSON.stringify(v2)]);
}
!function(e2) {
  e2[e2.Pointer = 0] = "Pointer", e2[e2.DraggableRect = 1] = "DraggableRect";
}(xe || (xe = {})), function(e2) {
  e2[e2.TreeOrder = 0] = "TreeOrder", e2[e2.ReversedTreeOrder = 1] = "ReversedTreeOrder";
}(De || (De = {})), function(e2) {
  e2[e2.Always = 0] = "Always", e2[e2.BeforeDragging = 1] = "BeforeDragging", e2[e2.WhileDragging = 2] = "WhileDragging";
}(Re || (Re = {})), function(e2) {
  e2.Optimized = "optimized";
}(Ce || (Ce = {}));
const Ee = /* @__PURE__ */ new Map(), Ne = { measure: le, strategy: Re.WhileDragging, frequency: Ce.Optimized };
function Ie({ onResize: e2, disabled: n2 }) {
  const o2 = t(() => {
    if (n2 || "undefined" == typeof window || void 0 === window.ResizeObserver)
      return;
    const { ResizeObserver: t2 } = window;
    return new t2(e2);
  }, [n2, e2]);
  return r(() => () => null == o2 ? void 0 : o2.disconnect(), [o2]), o2;
}
const Te = [];
const Oe = Le(le), Ae = ke(le);
function Me(e2, t2, n2) {
  const r2 = o(e2);
  return E((o2) => e2 ? n2 || !o2 && e2 || e2 !== r2.current ? x(e2) && null == e2.parentNode ? null : new we(t2(e2), e2) : null != o2 ? o2 : null : null, [e2, n2, t2]);
}
function Le(e2) {
  return (t2, n2) => Me(t2, e2, n2);
}
function ke(e2) {
  const t2 = [];
  return function(n2, r2) {
    const i2 = o(n2);
    return E((o2) => n2.length ? r2 || !o2 && n2.length || n2 !== i2.current ? n2.map((t3) => new we(e2(t3), t3)) : null != o2 ? o2 : t2 : t2, [n2, r2]);
  };
}
function Be(e2) {
  if (!e2)
    return null;
  if (e2.children.length > 1)
    return e2;
  const t2 = e2.children[0];
  return x(t2) ? t2 : e2;
}
function je(e2, n2) {
  return t(() => ({ sensor: e2, options: null != n2 ? n2 : {} }), [e2, n2]);
}
function Pe(...e2) {
  return t(() => [...e2].filter((e3) => null != e3), [...e2]);
}
class ze {
  constructor(e2) {
    this.target = void 0, this.listeners = [], this.removeAll = () => {
      this.listeners.forEach((e3) => {
        var t2;
        return null == (t2 = this.target) ? void 0 : t2.removeEventListener(...e3);
      });
    }, this.target = e2;
  }
  add(e2, t2, n2) {
    var r2;
    null == (r2 = this.target) || r2.addEventListener(e2, t2, n2), this.listeners.push([e2, t2, n2]);
  }
}
function Xe(e2, t2) {
  const n2 = Math.abs(e2.x), r2 = Math.abs(e2.y);
  return "number" == typeof t2 ? Math.sqrt(n2 ** 2 + r2 ** 2) > t2 : "x" in t2 && "y" in t2 ? n2 > t2.x && r2 > t2.y : "x" in t2 ? n2 > t2.x : "y" in t2 && r2 > t2.y;
}
var Ye, Ke;
function Fe(e2) {
  e2.preventDefault();
}
function We(e2) {
  e2.stopPropagation();
}
!function(e2) {
  e2.Click = "click", e2.DragStart = "dragstart", e2.Keydown = "keydown", e2.ContextMenu = "contextmenu", e2.Resize = "resize", e2.SelectionChange = "selectionchange", e2.VisibilityChange = "visibilitychange";
}(Ye || (Ye = {})), function(e2) {
  e2.Space = "Space", e2.Down = "ArrowDown", e2.Right = "ArrowRight", e2.Left = "ArrowLeft", e2.Up = "ArrowUp", e2.Esc = "Escape", e2.Enter = "Enter";
}(Ke || (Ke = {}));
const $e = { start: [Ke.Space, Ke.Enter], cancel: [Ke.Esc], end: [Ke.Space, Ke.Enter] }, Ue = (e2, { currentCoordinates: t2 }) => {
  switch (e2.code) {
    case Ke.Right:
      return { ...t2, x: t2.x + 25 };
    case Ke.Left:
      return { ...t2, x: t2.x - 25 };
    case Ke.Down:
      return { ...t2, y: t2.y + 25 };
    case Ke.Up:
      return { ...t2, y: t2.y - 25 };
  }
};
class He {
  constructor(e2) {
    this.props = void 0, this.autoScrollEnabled = false, this.coordinates = Z, this.listeners = void 0, this.windowListeners = void 0, this.props = e2;
    const { event: { target: t2 } } = e2;
    this.props = e2, this.listeners = new ze(R(t2)), this.windowListeners = new ze(y(t2)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
  }
  attach() {
    this.handleStart(), this.windowListeners.add(Ye.Resize, this.handleCancel), this.windowListeners.add(Ye.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(Ye.Keydown, this.handleKeyDown));
  }
  handleStart() {
    const { activeNode: e2, onStart: t2 } = this.props;
    if (!e2.node.current)
      throw new Error("Active draggable node is undefined");
    const n2 = le(e2.node.current), r2 = { x: n2.left, y: n2.top };
    this.coordinates = r2, t2(r2);
  }
  handleKeyDown(e2) {
    if (L(e2)) {
      const { coordinates: t2 } = this, { active: n2, context: r2, options: o2 } = this.props, { keyboardCodes: i2 = $e, coordinateGetter: a2 = Ue, scrollBehavior: l2 = "smooth" } = o2, { code: s2 } = e2;
      if (i2.end.includes(s2))
        return void this.handleEnd(e2);
      if (i2.cancel.includes(s2))
        return void this.handleCancel(e2);
      const c2 = a2(e2, { active: n2, context: r2.current, currentCoordinates: t2 });
      if (c2) {
        const n3 = { x: 0, y: 0 }, { scrollableAncestors: o3 } = r2.current;
        for (const r3 of o3) {
          const o4 = e2.code, i3 = M(c2, t2), { isTop: a3, isRight: s3, isLeft: d2, isBottom: u2, maxScroll: h2, minScroll: g2 } = ve(r3), v2 = me(r3), f2 = { x: Math.min(o4 === Ke.Right ? v2.right - v2.width / 2 : v2.right, Math.max(o4 === Ke.Right ? v2.left : v2.left + v2.width / 2, c2.x)), y: Math.min(o4 === Ke.Down ? v2.bottom - v2.height / 2 : v2.bottom, Math.max(o4 === Ke.Down ? v2.top : v2.top + v2.height / 2, c2.y)) }, p2 = o4 === Ke.Right && !s3 || o4 === Ke.Left && !d2, m2 = o4 === Ke.Down && !u2 || o4 === Ke.Up && !a3;
          if (p2 && f2.x !== c2.x) {
            if (o4 === Ke.Right && r3.scrollLeft + i3.x <= h2.x || o4 === Ke.Left && r3.scrollLeft + i3.x >= g2.x)
              return void r3.scrollBy({ left: i3.x, behavior: l2 });
            n3.x = o4 === Ke.Right ? r3.scrollLeft - h2.x : r3.scrollLeft - g2.x, r3.scrollBy({ left: -n3.x, behavior: l2 });
            break;
          }
          if (m2 && f2.y !== c2.y) {
            if (o4 === Ke.Down && r3.scrollTop + i3.y <= h2.y || o4 === Ke.Up && r3.scrollTop + i3.y >= g2.y)
              return void r3.scrollBy({ top: i3.y, behavior: l2 });
            n3.y = o4 === Ke.Down ? r3.scrollTop - h2.y : r3.scrollTop - g2.y, r3.scrollBy({ top: -n3.y, behavior: l2 });
            break;
          }
        }
        this.handleMove(e2, A(c2, n3));
      }
    }
  }
  handleMove(e2, t2) {
    const { onMove: n2 } = this.props;
    e2.preventDefault(), n2(t2), this.coordinates = t2;
  }
  handleEnd(e2) {
    const { onEnd: t2 } = this.props;
    e2.preventDefault(), this.detach(), t2();
  }
  handleCancel(e2) {
    const { onCancel: t2 } = this.props;
    e2.preventDefault(), this.detach(), t2();
  }
  detach() {
    this.listeners.removeAll(), this.windowListeners.removeAll();
  }
}
function Ve(e2) {
  return Boolean(e2 && "distance" in e2);
}
function qe(e2) {
  return Boolean(e2 && "delay" in e2);
}
He.activators = [{ eventName: "onKeyDown", handler: (e2, { keyboardCodes: t2 = $e, onActivation: n2 }) => {
  const { code: r2 } = e2.nativeEvent;
  return !!t2.start.includes(r2) && (e2.preventDefault(), null == n2 || n2({ event: e2.nativeEvent }), true);
} }];
class Ge {
  constructor(e2, t2, n2 = function(e3) {
    const { EventTarget: t3 } = y(e3);
    return e3 instanceof t3 ? e3 : R(e3);
  }(e2.event.target)) {
    var r2;
    this.props = void 0, this.events = void 0, this.autoScrollEnabled = true, this.document = void 0, this.activated = false, this.initialCoordinates = void 0, this.timeoutId = null, this.listeners = void 0, this.documentListeners = void 0, this.windowListeners = void 0, this.props = e2, this.events = t2;
    const { event: o2 } = e2, { target: i2 } = o2;
    this.props = e2, this.events = t2, this.document = R(i2), this.documentListeners = new ze(this.document), this.listeners = new ze(n2), this.windowListeners = new ze(y(i2)), this.initialCoordinates = null != (r2 = k(o2)) ? r2 : Z, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
  }
  attach() {
    const { events: e2, props: { options: { activationConstraint: t2 } } } = this;
    if (this.listeners.add(e2.move.name, this.handleMove, { passive: false }), this.listeners.add(e2.end.name, this.handleEnd), this.windowListeners.add(Ye.Resize, this.handleCancel), this.windowListeners.add(Ye.DragStart, Fe), this.windowListeners.add(Ye.VisibilityChange, this.handleCancel), this.windowListeners.add(Ye.ContextMenu, Fe), this.documentListeners.add(Ye.Keydown, this.handleKeydown), t2) {
      if (Ve(t2))
        return;
      if (qe(t2))
        return void (this.timeoutId = setTimeout(this.handleStart, t2.delay));
    }
    this.handleStart();
  }
  detach() {
    this.listeners.removeAll(), this.windowListeners.removeAll(), setTimeout(this.documentListeners.removeAll, 50), null !== this.timeoutId && (clearTimeout(this.timeoutId), this.timeoutId = null);
  }
  handleStart() {
    const { initialCoordinates: e2 } = this, { onStart: t2 } = this.props;
    e2 && (this.activated = true, this.documentListeners.add(Ye.Click, We, { capture: true }), this.removeTextSelection(), this.documentListeners.add(Ye.SelectionChange, this.removeTextSelection), t2(e2));
  }
  handleMove(e2) {
    var t2;
    const { activated: n2, initialCoordinates: r2, props: o2 } = this, { onMove: i2, options: { activationConstraint: a2 } } = o2;
    if (!r2)
      return;
    const l2 = null != (t2 = k(e2)) ? t2 : Z, s2 = M(r2, l2);
    if (!n2 && a2) {
      if (qe(a2))
        return Xe(s2, a2.tolerance) ? this.handleCancel() : void 0;
      if (Ve(a2))
        return null != a2.tolerance && Xe(s2, a2.tolerance) ? this.handleCancel() : Xe(s2, a2.distance) ? this.handleStart() : void 0;
    }
    e2.cancelable && e2.preventDefault(), i2(l2);
  }
  handleEnd() {
    const { onEnd: e2 } = this.props;
    this.detach(), e2();
  }
  handleCancel() {
    const { onCancel: e2 } = this.props;
    this.detach(), e2();
  }
  handleKeydown(e2) {
    e2.code === Ke.Esc && this.handleCancel();
  }
  removeTextSelection() {
    var e2;
    null == (e2 = this.document.getSelection()) || e2.removeAllRanges();
  }
}
const Je = { move: { name: "pointermove" }, end: { name: "pointerup" } };
class Qe extends Ge {
  constructor(e2) {
    const { event: t2 } = e2, n2 = R(t2.target);
    super(e2, Je, n2);
  }
}
Qe.activators = [{ eventName: "onPointerDown", handler: ({ nativeEvent: e2 }, { onActivation: t2 }) => !(!e2.isPrimary || 0 !== e2.button) && (null == t2 || t2({ event: e2 }), true) }];
const Ze = { move: { name: "mousemove" }, end: { name: "mouseup" } };
var _e;
!function(e2) {
  e2[e2.RightClick = 2] = "RightClick";
}(_e || (_e = {}));
(class extends Ge {
  constructor(e2) {
    super(e2, Ze, R(e2.event.target));
  }
}).activators = [{ eventName: "onMouseDown", handler: ({ nativeEvent: e2 }, { onActivation: t2 }) => e2.button !== _e.RightClick && (null == t2 || t2({ event: e2 }), true) }];
const et = { move: { name: "touchmove" }, end: { name: "touchend" } };
function tt(e2, { transform: t2, ...n2 }) {
  return (null == e2 ? void 0 : e2.length) ? e2.reduce((e3, t3) => t3({ transform: e3, ...n2 }), t2) : t2;
}
(class extends Ge {
  constructor(e2) {
    super(e2, et);
  }
  static setup() {
    return window.addEventListener(et.move.name, e2, { capture: false, passive: false }), function() {
      window.removeEventListener(et.move.name, e2);
    };
    function e2() {
    }
  }
}).activators = [{ eventName: "onTouchStart", handler: ({ nativeEvent: e2 }, { onActivation: t2 }) => {
  const { touches: n2 } = e2;
  return !(n2.length > 1) && (null == t2 || t2({ event: e2 }), true);
} }];
const nt = [{ sensor: Qe, options: {} }, { sensor: He, options: {} }], rt = { current: {} }, ot = c({ ...Z, scaleX: 1, scaleY: 1 }), it = l(function({ id: e2, autoScroll: n2 = true, announcements: l2, children: c2, sensors: d2 = nt, collisionDetection: h2 = ne, measuring: f2, modifiers: m2, screenReaderInstructions: b2 = X, ...y2 }) {
  var w2, D2, R2, I2, O2, M2, L2;
  const B2 = s(G, void 0, q), [j2, P2] = B2, [z2, Y2] = a(() => ({ type: null, event: null })), [F2, W2] = a(false), { draggable: { active: $2, nodes: U2, translate: _2 }, droppable: { containers: ee2 } } = j2, te2 = $2 ? U2[$2] : null, re2 = o({ initial: null, translated: null }), ie2 = t(() => {
    var e3;
    return null != $2 ? { id: $2, data: null != (e3 = null == te2 ? void 0 : te2.data) ? e3 : rt, rect: re2 } : null;
  }, [$2, te2]), de2 = o(null), [ue2, ge2] = a(null), [ve2, fe2] = a(null), pe2 = S(y2, Object.values(y2)), me2 = T("DndDescribedBy", e2), ye2 = t(() => ee2.getEnabled(), [ee2]), { droppableRects: xe2, measureDroppableContainers: De2, measuringScheduled: Ce2 } = function(e3, { dragging: t2, dependencies: n3, config: l3 }) {
    const [s2, c3] = a(null), d3 = null != s2, { frequency: u2, measure: h3, strategy: g2 } = { ...Ne, ...l3 }, v2 = o(e3), f3 = i((e4 = []) => c3((t3) => t3 ? t3.concat(e4) : e4), []), p2 = o(null), m3 = function() {
      switch (g2) {
        case Re.Always:
          return false;
        case Re.BeforeDragging:
          return t2;
        default:
          return !t2;
      }
    }(), b3 = E((n4) => {
      if (m3 && !t2)
        return Ee;
      const r2 = s2;
      if (!n4 || n4 === Ee || v2.current !== e3 || null != r2) {
        const t3 = /* @__PURE__ */ new Map();
        for (let n5 of e3) {
          if (!n5)
            continue;
          if (r2 && r2.length > 0 && !r2.includes(n5.id) && n5.rect.current) {
            t3.set(n5.id, n5.rect.current);
            continue;
          }
          const e4 = n5.node.current, o2 = e4 ? new we(h3(e4), e4) : null;
          n5.rect.current = o2, o2 && t3.set(n5.id, o2);
        }
        return t3;
      }
      return n4;
    }, [e3, s2, t2, m3, h3]);
    return r(() => {
      v2.current = e3;
    }, [e3]), r(() => {
      m3 || requestAnimationFrame(() => f3());
    }, [t2, m3]), r(() => {
      d3 && c3(null);
    }, [d3]), r(() => {
      m3 || "number" != typeof u2 || null !== p2.current || (p2.current = setTimeout(() => {
        f3(), p2.current = null;
      }, u2));
    }, [u2, m3, f3, ...n3]), { droppableRects: b3, measureDroppableContainers: f3, measuringScheduled: d3 };
  }(ye2, { dragging: F2, dependencies: [_2.x, _2.y], config: null == f2 ? void 0 : f2.droppable }), Le2 = function(e3, t2) {
    const n3 = null !== t2 ? e3[t2] : void 0, r2 = n3 ? n3.node.current : null;
    return E((e4) => {
      var n4;
      return null === t2 ? null : null != (n4 = null != r2 ? r2 : e4) ? n4 : null;
    }, [r2, t2]);
  }(U2, $2), ke2 = ve2 ? k(ve2) : null, je2 = Me(Le2, null != (w2 = null == f2 || null == (D2 = f2.draggable) ? void 0 : D2.measure) ? w2 : le), Pe2 = Oe(Le2 ? Le2.parentElement : null), ze2 = o({ active: null, activeNode: Le2, collisionRect: null, collisions: null, droppableRects: xe2, draggableNodes: U2, draggingNode: null, draggingNodeRect: null, droppableContainers: ee2, over: null, scrollableAncestors: [], scrollAdjustedTranslate: null }), Xe2 = ee2.getNodeFor(null == (R2 = ze2.current.over) ? void 0 : R2.id), Ye2 = function({ measure: e3 = ae }) {
    const [n3, r2] = a(null), o2 = Ie({ onResize: i((t2) => {
      for (const { target: n4 } of t2)
        if (x(n4)) {
          r2((t3) => {
            const r3 = e3(n4);
            return t3 ? { ...t3, width: r3.width, height: r3.height } : r3;
          });
          break;
        }
    }, [e3]) }), l3 = i((t2) => {
      const n4 = Be(t2);
      null == o2 || o2.disconnect(), n4 && (null == o2 || o2.observe(n4)), r2(n4 ? e3(n4) : null);
    }, [e3, o2]), [s2, c3] = N(l3);
    return t(() => ({ nodeRef: s2, rect: n3, setRef: c3 }), [n3, s2, c3]);
  }({ measure: null == f2 || null == (I2 = f2.dragOverlay) ? void 0 : I2.measure }), Ke2 = null != (O2 = Ye2.nodeRef.current) ? O2 : Le2, Fe2 = null != (M2 = Ye2.rect) ? M2 : je2, We2 = o(null), $e2 = We2.current, Ue2 = Fe2 === je2 ? (Ve2 = $e2, (He2 = je2) && Ve2 ? { x: He2.left - Ve2.left, y: He2.top - Ve2.top } : Z) : Z;
  var He2, Ve2;
  const qe2 = (Ge2 = Ke2 ? Ke2.ownerDocument.defaultView : null, t(() => Ge2 ? function(e3) {
    const t2 = e3.innerWidth, n3 = e3.innerHeight;
    return { top: 0, left: 0, right: t2, bottom: n3, width: t2, height: n3 };
  }(Ge2) : null, [Ge2]));
  var Ge2;
  const Je2 = function(e3) {
    const t2 = o(e3), n3 = E((n4) => e3 ? n4 && e3 && t2.current && e3.parentNode === t2.current.parentNode ? n4 : se(e3) : Te, [e3]);
    return r(() => {
      t2.current = e3;
    }, [e3]), n3;
  }($2 ? null != Xe2 ? Xe2 : Ke2 : null), Qe2 = Ae(Je2), Ze2 = tt(m2, { transform: { x: _2.x - Ue2.x, y: _2.y - Ue2.y, scaleX: 1, scaleY: 1 }, activatorEvent: ve2, active: ie2, activeNodeRect: je2, containerNodeRect: Pe2, draggingNodeRect: Fe2, over: ze2.current.over, overlayNodeRect: Ye2.rect, scrollableAncestors: Je2, scrollableAncestorRects: Qe2, windowRect: qe2 }), _e2 = ke2 ? A(ke2, _2) : null, et2 = function(e3) {
    const [n3, l3] = a(null), s2 = o(e3), c3 = i((e4) => {
      const t2 = ce(e4.target);
      t2 && l3((e5) => e5 ? (e5.set(t2, he(t2)), new Map(e5)) : null);
    }, []);
    return r(() => {
      const t2 = s2.current;
      if (e3 !== t2) {
        n4(t2);
        const r2 = e3.map((e4) => {
          const t3 = ce(e4);
          return t3 ? (t3.addEventListener("scroll", c3, { passive: true }), [t3, he(t3)]) : null;
        }).filter((e4) => null != e4);
        l3(r2.length ? new Map(r2) : null), s2.current = e3;
      }
      return () => {
        n4(e3), n4(t2);
      };
      function n4(e4) {
        e4.forEach((e5) => {
          const t3 = ce(e5);
          null == t3 || t3.removeEventListener("scroll", c3);
        });
      }
    }, [c3, e3]), t(() => e3.length ? n3 ? Array.from(n3.values()).reduce((e4, t2) => A(e4, t2), Z) : be(e3) : Z, [e3, n3]);
  }(Je2), it2 = A(Ze2, et2), at2 = Fe2 ? oe(Fe2, Ze2) : null, lt2 = ie2 && at2 ? h2({ active: ie2, collisionRect: at2, droppableContainers: ye2, pointerCoordinates: _e2 }) : null, st2 = function(e3, t2) {
    if (!e3 || 0 === e3.length)
      return null;
    const [n3] = e3;
    return t2 ? n3[t2] : n3;
  }(lt2, "id"), [ct2, dt2] = a(null), ut2 = function(e3, t2, n3) {
    return { ...e3, scaleX: t2 && n3 ? t2.width / n3.width : 1, scaleY: t2 && n3 ? t2.height / n3.height : 1 };
  }(Ze2, null != (L2 = null == ct2 ? void 0 : ct2.rect) ? L2 : null, je2), ht2 = i((e3, { sensor: t2, options: n3 }) => {
    if (!de2.current)
      return;
    const r2 = U2[de2.current];
    if (!r2)
      return;
    const o2 = new t2({ active: de2.current, activeNode: r2, event: e3.nativeEvent, options: n3, context: ze2, onStart(e4) {
      const t3 = de2.current;
      if (!t3)
        return;
      const n4 = U2[t3];
      if (!n4)
        return;
      const { onDragStart: r3 } = pe2.current, o3 = { active: { id: t3, data: n4.data, rect: re2 } };
      u(() => {
        P2({ type: K.DragStart, initialCoordinates: e4, active: t3 }), Y2({ type: K.DragStart, event: o3 });
      }), null == r3 || r3(o3);
    }, onMove(e4) {
      P2({ type: K.DragMove, coordinates: e4 });
    }, onEnd: i2(K.DragEnd), onCancel: i2(K.DragCancel) });
    function i2(e4) {
      return async function() {
        const { active: t3, collisions: n4, over: r3, scrollAdjustedTranslate: o3 } = ze2.current;
        let i3 = null;
        if (t3 && o3) {
          const { cancelDrop: a2 } = pe2.current;
          if (i3 = { active: t3, collisions: n4, delta: o3, over: r3 }, e4 === K.DragEnd && "function" == typeof a2) {
            await Promise.resolve(a2(i3)) && (e4 = K.DragCancel);
          }
        }
        de2.current = null, u(() => {
          if (P2({ type: e4 }), dt2(null), W2(false), ge2(null), fe2(null), i3 && Y2({ type: e4, event: i3 }), i3) {
            const { onDragCancel: t4, onDragEnd: n5 } = pe2.current, r4 = e4 === K.DragEnd ? n5 : t4;
            null == r4 || r4(i3);
          }
        });
      };
    }
    u(() => {
      ge2(o2), fe2(e3.nativeEvent);
    });
  }, [U2]), gt2 = i((e3, t2) => (n3, r2) => {
    const o2 = n3.nativeEvent;
    null !== de2.current || o2.dndKit || o2.defaultPrevented || true === e3(n3, t2.options) && (o2.dndKit = { capturedBy: t2.sensor }, de2.current = r2, ht2(n3, t2));
  }, [ht2]), vt2 = function(e3, n3) {
    return t(() => e3.reduce((e4, t2) => {
      const { sensor: r2 } = t2;
      return [...e4, ...r2.activators.map((e5) => ({ eventName: e5.eventName, handler: n3(e5.handler, t2) }))];
    }, []), [e3, n3]);
  }(d2, gt2);
  !function(e3) {
    r(() => {
      if (!p)
        return;
      const t2 = e3.map(({ sensor: e4 }) => null == e4.setup ? void 0 : e4.setup());
      return () => {
        for (const e4 of t2)
          null == e4 || e4();
      };
    }, e3.map(({ sensor: e4 }) => e4));
  }(d2), r(() => {
    null != $2 && W2(true);
  }, [$2]), r(() => {
    ie2 || (We2.current = null), ie2 && je2 && !We2.current && (We2.current = je2);
  }, [je2, ie2]), r(() => {
    const { onDragMove: e3 } = pe2.current, { active: t2, collisions: n3, over: r2 } = ze2.current;
    if (!t2)
      return;
    const o2 = { active: t2, collisions: n3, delta: { x: it2.x, y: it2.y }, over: r2 };
    Y2({ type: K.DragMove, event: o2 }), null == e3 || e3(o2);
  }, [it2.x, it2.y]), r(() => {
    const { active: e3, collisions: t2, droppableContainers: n3, scrollAdjustedTranslate: r2 } = ze2.current;
    if (!e3 || !de2.current || !r2)
      return;
    const { onDragOver: o2 } = pe2.current, i2 = n3.get(st2), a2 = i2 && i2.rect.current ? { id: i2.id, rect: i2.rect.current, data: i2.data, disabled: i2.disabled } : null, l3 = { active: e3, collisions: t2, delta: { x: r2.x, y: r2.y }, over: a2 };
    u(() => {
      dt2(a2), Y2({ type: K.DragOver, event: l3 }), null == o2 || o2(l3);
    });
  }, [st2]), C(() => {
    ze2.current = { active: ie2, activeNode: Le2, collisionRect: at2, collisions: lt2, droppableRects: xe2, draggableNodes: U2, draggingNode: Ke2, draggingNodeRect: Fe2, droppableContainers: ee2, over: ct2, scrollableAncestors: Je2, scrollAdjustedTranslate: it2 }, re2.current = { initial: Fe2, translated: at2 };
  }, [ie2, Le2, lt2, at2, U2, Ke2, Fe2, xe2, ee2, ct2, Je2, it2]), Se({ ...function() {
    const e3 = false === (null == ue2 ? void 0 : ue2.autoScrollEnabled), t2 = "object" == typeof n2 ? false === n2.enabled : false === n2, r2 = !e3 && !t2;
    if ("object" == typeof n2)
      return { ...n2, enabled: r2 };
    return { enabled: r2 };
  }(), draggingRect: at2, pointerCoordinates: _e2, scrollableAncestors: Je2, scrollableAncestorRects: Qe2 });
  const ft2 = t(() => ({ active: ie2, activeNode: Le2, activeNodeRect: je2, activatorEvent: ve2, collisions: lt2, containerNodeRect: Pe2, dragOverlay: Ye2, draggableNodes: U2, droppableContainers: ee2, droppableRects: xe2, over: ct2, measureDroppableContainers: De2, scrollableAncestors: Je2, scrollableAncestorRects: Qe2, measuringScheduled: Ce2, windowRect: qe2 }), [ie2, Le2, je2, ve2, lt2, Pe2, Ye2, U2, ee2, xe2, ct2, De2, Je2, Qe2, Ce2, qe2]), pt2 = t(() => ({ activatorEvent: ve2, activators: vt2, active: ie2, activeNodeRect: je2, ariaDescribedById: { draggable: me2 }, dispatch: P2, draggableNodes: U2, over: ct2, measureDroppableContainers: De2 }), [ve2, vt2, ie2, je2, P2, me2, U2, ct2, De2]);
  return v(J.Provider, { value: z2, children: [g(H.Provider, { value: pt2, children: g(V.Provider, { value: ft2, children: g(ot.Provider, { value: ut2, children: c2 }) }) }), g(Q, { announcements: l2, hiddenTextDescribedById: me2, screenReaderInstructions: b2 })] });
}), at = c(null), lt = "button", st = "Droppable";
function ct({ id: e2, data: n2, disabled: r2 = false, attributes: o2 }) {
  const i2 = T(st), { activators: a2, activatorEvent: l2, active: s2, activeNodeRect: c2, ariaDescribedById: u2, draggableNodes: h2, over: g2 } = d(H), { role: v2 = lt, roleDescription: f2 = "draggable", tabIndex: p2 = 0 } = null != o2 ? o2 : {}, m2 = (null == s2 ? void 0 : s2.id) === e2, b2 = d(m2 ? ot : at), [y2, w2] = N(), x2 = function(e3, n3) {
    return t(() => e3.reduce((e4, { eventName: t2, handler: r3 }) => (e4[t2] = (e5) => {
      r3(e5, n3);
    }, e4), {}), [e3, n3]);
  }(a2, e2), D2 = S(n2);
  C(() => (h2[e2] = { id: e2, key: i2, node: y2, data: D2 }, () => {
    const t2 = h2[e2];
    t2 && t2.key === i2 && delete h2[e2];
  }), [h2, e2]);
  return { active: s2, activatorEvent: l2, activeNodeRect: c2, attributes: t(() => ({ role: v2, tabIndex: p2, "aria-pressed": !(!m2 || v2 !== lt) || void 0, "aria-roledescription": f2, "aria-describedby": u2.draggable }), [v2, p2, m2, f2, u2.draggable]), isDragging: m2, listeners: r2 ? void 0 : x2, node: y2, over: g2, setNodeRef: w2, transform: b2 };
}
function dt() {
  return d(V);
}
const ut = "Droppable", ht = { timeout: 25 };
function gt({ data: e2, disabled: t2 = false, id: n2, resizeObserverConfig: a2 }) {
  const l2 = T(ut), { active: s2, dispatch: c2, over: u2, measureDroppableContainers: h2 } = d(H), g2 = o(false), v2 = o(null), f2 = o(null), { disabled: p2, updateMeasurementsFor: m2, timeout: b2 } = { ...ht, ...a2 }, y2 = S(null != m2 ? m2 : n2), w2 = Ie({ onResize: i(() => {
    g2.current ? (null != f2.current && clearTimeout(f2.current), f2.current = setTimeout(() => {
      h2("string" == typeof y2.current ? [y2.current] : y2.current), f2.current = null;
    }, b2)) : g2.current = true;
  }, [b2]), disabled: p2 || !s2 }), x2 = i((e3, t3) => {
    w2 && (t3 && (w2.unobserve(t3), g2.current = false), e3 && w2.observe(e3));
  }, [w2]), [D2, R2] = N(x2), E2 = S(e2);
  return r(() => {
    w2 && D2.current && (w2.disconnect(), g2.current = false, w2.observe(D2.current));
  }, [D2, w2]), C(() => (c2({ type: K.RegisterDroppable, element: { id: n2, key: l2, disabled: t2, node: D2, rect: v2, data: E2 } }), () => c2({ type: K.UnregisterDroppable, key: l2, id: n2 })), [n2]), r(() => {
    c2({ type: K.SetDroppableDisabled, id: n2, key: l2, disabled: t2 });
  }, [t2]), { active: s2, rect: v2, isOver: (null == u2 ? void 0 : u2.id) === n2, node: D2, over: u2, setNodeRef: R2 };
}
const vt = { duration: 250, easing: "ease", dragSourceOpacity: 0 };
const ft = { x: 0, y: 0, scaleX: 1, scaleY: 1 }, pt = (e2) => L(e2) ? "transform 250ms ease" : void 0, mt = e.memo(({ adjustScale: t2 = false, children: n2, dropAnimation: i2 = vt, style: l2, transition: s2 = pt, modifiers: c2, wrapperElement: u2 = "div", className: h2, zIndex: g2 = 999 }) => {
  var v2, f2;
  const { active: p2, activeNodeRect: m2, containerNodeRect: b2, draggableNodes: y2, activatorEvent: w2, over: x2, dragOverlay: D2, scrollableAncestors: R2, scrollableAncestorRects: S2, windowRect: N2 } = dt(), I2 = d(ot), T2 = tt(c2, { activatorEvent: w2, active: p2, activeNodeRect: m2, containerNodeRect: b2, draggingNodeRect: D2.rect, over: x2, overlayNodeRect: D2.rect, scrollableAncestors: R2, scrollableAncestorRects: S2, transform: I2, windowRect: N2 }), O2 = null !== p2, A2 = t2 ? T2 : { ...T2, scaleX: 1, scaleY: 1 }, M2 = E((e2) => O2 ? e2 || (m2 ? { ...m2 } : null) : null, [O2, m2]), L2 = M2 ? { position: "fixed", width: M2.width, height: M2.height, top: M2.top, left: M2.left, zIndex: g2, transform: B.Transform.toString(A2), touchAction: "none", transformOrigin: t2 && w2 ? _(w2, M2) : void 0, transition: "function" == typeof s2 ? s2(w2) : s2, ...l2 } : void 0, k2 = O2 ? { style: L2, children: n2, className: h2, transform: A2 } : void 0, j2 = o(k2), P2 = null != k2 ? k2 : j2.current, { children: z2, transform: X2, ...Y2 } = null != P2 ? P2 : {}, K2 = o(null != (v2 = null == p2 ? void 0 : p2.id) ? v2 : null), F2 = function({ animate: e2, adjustScale: t3, activeId: n3, draggableNodes: r2, duration: o2, dragSourceOpacity: i3, easing: l3, node: s3, transform: c3 }) {
    const [d2, u3] = a(false);
    return C(() => {
      var a2;
      if (!(e2 && n3 && l3 && o2))
        return void (e2 && u3(true));
      const d3 = null == (a2 = r2[n3]) ? void 0 : a2.node.current;
      if (c3 && s3 && d3 && null !== d3.parentNode) {
        const e3 = Be(s3);
        if (e3) {
          const n4 = e3.getBoundingClientRect(), r3 = le(d3), a3 = { x: n4.left - r3.left, y: n4.top - r3.top };
          if (Math.abs(a3.x) || Math.abs(a3.y)) {
            const e4 = { scaleX: t3 ? r3.width * c3.scaleX / n4.width : 1, scaleY: t3 ? r3.height * c3.scaleY / n4.height : 1 }, h3 = B.Transform.toString({ x: c3.x - a3.x, y: c3.y - a3.y, ...e4 }), g3 = d3.style.opacity;
            return null != i3 && (d3.style.opacity = `${i3}`), void (s3.animate([{ transform: B.Transform.toString(c3) }, { transform: h3 }], { easing: l3, duration: o2 }).onfinish = () => {
              s3.style.display = "none", u3(true), d3 && null != i3 && (d3.style.opacity = g3);
            });
          }
        }
      }
      u3(true);
    }, [e2, n3, t3, r2, o2, l3, i3, s3, c3]), C(() => {
      d2 && u3(false);
    }, [d2]), d2;
  }({ animate: Boolean(i2 && K2.current && !p2), adjustScale: t2, activeId: K2.current, draggableNodes: y2, duration: null == i2 ? void 0 : i2.duration, easing: null == i2 ? void 0 : i2.easing, dragSourceOpacity: null == i2 ? void 0 : i2.dragSourceOpacity, node: D2.nodeRef.current, transform: null == (f2 = j2.current) ? void 0 : f2.transform }), W2 = Boolean(z2 && (n2 || i2 && !F2));
  return r(() => {
    var e2;
    (null == p2 ? void 0 : p2.id) !== K2.current && (K2.current = null != (e2 = null == p2 ? void 0 : p2.id) ? e2 : null);
    p2 && j2.current !== k2 && (j2.current = k2);
  }, [p2, k2]), r(() => {
    F2 && (j2.current = void 0);
  }, [F2]), W2 ? e.createElement(H.Provider, { value: U }, e.createElement(ot.Provider, { value: ft }, e.createElement(u2, { ...Y2, ref: D2.setRef }, z2))) : null;
}), bt = (e2) => {
  let { transform: t2 } = e2;
  return { ...t2, x: 0 };
};
function yt(e2, t2, n2) {
  const r2 = e2.slice();
  return r2.splice(n2 < 0 ? r2.length + n2 : n2, 0, r2.splice(t2, 1)[0]), r2;
}
function wt(e2, t2) {
  return e2.reduce((e3, n2, r2) => {
    const o2 = t2.get(n2);
    return o2 && (e3[r2] = o2), e3;
  }, Array(e2.length));
}
function xt(e2) {
  return null !== e2 && e2 >= 0;
}
const Dt = ({ rects: e2, activeIndex: t2, overIndex: n2, index: r2 }) => {
  const o2 = yt(e2, n2, t2), i2 = e2[r2], a2 = o2[r2];
  return a2 && i2 ? { x: a2.left - i2.left, y: a2.top - i2.top, scaleX: a2.width / i2.width, scaleY: a2.height / i2.height } : null;
}, Rt = { scaleX: 1, scaleY: 1 }, Ct = ({ activeIndex: e2, activeNodeRect: t2, index: n2, rects: r2, overIndex: o2 }) => {
  var i2;
  const a2 = null != (i2 = r2[e2]) ? i2 : t2;
  if (!a2)
    return null;
  if (n2 === e2) {
    const t3 = r2[o2];
    return t3 ? { x: 0, y: e2 < o2 ? t3.top + t3.height - (a2.top + a2.height) : t3.top - a2.top, ...Rt } : null;
  }
  const l2 = function(e3, t3, n3) {
    const r3 = e3[t3], o3 = e3[t3 - 1], i3 = e3[t3 + 1];
    if (!r3)
      return 0;
    if (n3 < t3)
      return o3 ? r3.top - (o3.top + o3.height) : i3 ? i3.top - (r3.top + r3.height) : 0;
    return i3 ? i3.top - (r3.top + r3.height) : o3 ? r3.top - (o3.top + o3.height) : 0;
  }(r2, n2, e2);
  return n2 > e2 && n2 <= o2 ? { x: 0, y: -a2.height - l2, ...Rt } : n2 < e2 && n2 >= o2 ? { x: 0, y: a2.height + l2, ...Rt } : { x: 0, y: 0, ...Rt };
};
const St = "Sortable", Et = e.createContext({ activeIndex: -1, containerId: St, disableTransforms: false, items: [], overIndex: -1, useDragOverlay: false, sortedRects: [], strategy: Dt });
function Nt({ children: e2, id: n2, items: i2, strategy: a2 = Dt }) {
  const { active: l2, dragOverlay: s2, droppableRects: c2, over: d2, measureDroppableContainers: u2, measuringScheduled: h2 } = dt(), v2 = T(St, n2), f2 = Boolean(null !== s2.rect), p2 = t(() => i2.map((e3) => "string" == typeof e3 ? e3 : e3.id), [i2]), m2 = null != l2, b2 = l2 ? p2.indexOf(l2.id) : -1, y2 = d2 ? p2.indexOf(d2.id) : -1, w2 = o(p2), x2 = (D2 = p2, R2 = w2.current, !(D2.join() === R2.join()));
  var D2, R2;
  const S2 = -1 !== y2 && -1 === b2 || x2;
  C(() => {
    x2 && m2 && !h2 && u2(p2);
  }, [x2, p2, m2, u2, h2]), r(() => {
    w2.current = p2;
  }, [p2]);
  const E2 = t(() => ({ activeIndex: b2, containerId: v2, disableTransforms: S2, items: p2, overIndex: y2, useDragOverlay: f2, sortedRects: wt(p2, c2), strategy: a2 }), [b2, v2, S2, p2, y2, c2, f2, a2]);
  return g(Et.Provider, { value: E2, children: e2 });
}
const It = ({ id: e2, items: t2, activeIndex: n2, overIndex: r2 }) => yt(t2, n2, r2).indexOf(e2), Tt = ({ containerId: e2, isSorting: t2, wasDragging: n2, index: r2, items: o2, newIndex: i2, previousItems: a2, previousContainerId: l2, transition: s2 }) => !(!s2 || !n2) && ((a2 === o2 || r2 !== i2) && (!!t2 || i2 !== r2 && e2 === l2)), Ot = { duration: 200, easing: "ease" }, At = "transform", Mt = B.Transition.toString({ property: At, duration: 0, easing: "linear" }), Lt = { roleDescription: "sortable" };
function kt({ animateLayoutChanges: e2 = Tt, attributes: n2, disabled: i2, data: l2, getNewIndex: s2 = It, id: c2, strategy: u2, resizeObserverConfig: h2, transition: g2 = Ot }) {
  const { items: v2, containerId: f2, activeIndex: p2, disableTransforms: m2, sortedRects: b2, overIndex: y2, useDragOverlay: w2, strategy: x2 } = d(Et), D2 = v2.indexOf(c2), R2 = t(() => ({ sortable: { containerId: f2, index: D2, items: v2 }, ...l2 }), [f2, l2, D2, v2]), S2 = t(() => v2.slice(v2.indexOf(c2)), [v2, c2]), { rect: E2, node: N2, isOver: I2, setNodeRef: T2 } = gt({ id: c2, data: R2, resizeObserverConfig: { updateMeasurementsFor: S2, ...h2 } }), { active: O2, activatorEvent: A2, activeNodeRect: M2, attributes: k2, setNodeRef: j2, listeners: P2, isDragging: z2, over: X2, transform: Y2 } = ct({ id: c2, data: R2, attributes: { ...Lt, ...n2 }, disabled: i2 }), K2 = function() {
    for (var e3 = arguments.length, n3 = new Array(e3), r2 = 0; r2 < e3; r2++)
      n3[r2] = arguments[r2];
    return t(() => (e4) => {
      n3.forEach((t2) => t2(e4));
    }, n3);
  }(T2, j2), F2 = Boolean(O2), W2 = F2 && !m2 && xt(p2) && xt(y2), $2 = !w2 && z2, U2 = $2 && W2 ? Y2 : null, H2 = W2 ? null != U2 ? U2 : (null != u2 ? u2 : x2)({ rects: b2, activeNodeRect: M2, activeIndex: p2, overIndex: y2, index: D2 }) : null, V2 = xt(p2) && xt(y2) ? s2({ id: c2, items: v2, activeIndex: p2, overIndex: y2 }) : D2, q2 = null == O2 ? void 0 : O2.id, G2 = o({ activeId: q2, items: v2, newIndex: V2, containerId: f2 }), J2 = v2 !== G2.current.items, Q2 = e2({ active: O2, containerId: f2, isDragging: z2, isSorting: F2, id: c2, index: D2, items: v2, newIndex: G2.current.newIndex, previousItems: G2.current.items, previousContainerId: G2.current.containerId, transition: g2, wasDragging: null != G2.current.activeId }), Z2 = function({ disabled: e3, index: t2, node: n3, rect: i3 }) {
    const [l3, s3] = a(null), c3 = o(t2);
    return C(() => {
      if (!e3 && t2 !== c3.current && n3.current) {
        const e4 = i3.current;
        if (e4) {
          const t3 = ae(n3.current, { ignoreTransform: true }), r2 = { x: e4.left - t3.left, y: e4.top - t3.top, scaleX: e4.width / t3.width, scaleY: e4.height / t3.height };
          (r2.x || r2.y) && s3(r2);
        }
      }
      t2 !== c3.current && (c3.current = t2);
    }, [e3, t2, n3, i3]), r(() => {
      l3 && requestAnimationFrame(() => {
        s3(null);
      });
    }, [l3]), l3;
  }({ disabled: !Q2, index: D2, node: N2, rect: E2 });
  return r(() => {
    F2 && G2.current.newIndex !== V2 && (G2.current.newIndex = V2), f2 !== G2.current.containerId && (G2.current.containerId = f2), v2 !== G2.current.items && (G2.current.items = v2), q2 !== G2.current.activeId && (G2.current.activeId = q2);
  }, [q2, F2, V2, f2, v2]), { active: O2, activeIndex: p2, attributes: k2, rect: E2, index: D2, newIndex: V2, items: v2, isOver: I2, isSorting: F2, isDragging: z2, listeners: P2, node: N2, overIndex: y2, over: X2, setNodeRef: K2, setDroppableNodeRef: T2, setDraggableNodeRef: j2, transform: null != Z2 ? Z2 : H2, transition: function() {
    if (Z2 || J2 && G2.current.newIndex === D2)
      return Mt;
    if ($2 && !L(A2) || !g2)
      return;
    if (F2 || Q2)
      return B.Transition.toString({ ...g2, property: At });
    return;
  }() };
}
export {
  B as C,
  it as D,
  Qe as P,
  Nt as S,
  gt as a,
  ct as b,
  Pe as c,
  je as d,
  mt as e,
  bt as r,
  kt as u,
  Ct as v
};
