import { R as M, e as E, U as p, O as m, n as b, V as y, X as C, Y as R, Z as j, _ as K, $ as h, a0 as T, a1 as _, a2 as L, a3 as k, a4 as O, a5 as v, a6 as A, a7 as Z, a8 as U, a9 as Y, aa as w, ab as H, ac as P, ad as $, ae as I, x as N } from "./Toggle-E-Bsru_F.js";
import { j as n } from "./jsx-runtime-NmMXPjeo.js";
import { useState as X, useEffect as z, useRef as g, useCallback as x } from "react";
import { x as l, g as d } from "./css-fOi2x-55.js";
import { S as F } from "./Center-c6LFuqp8.js";
import "./aggregator-BIN9LAqD.js";
import "react-hook-form";
import { K as V } from "./Keyboard-7rQhBVQ1.js";
const q = (e) => {
  const { listen: r } = M(), [i, o] = X([]);
  return z(
    () => r(({ next: [s] }) => o(s ?? [])),
    [r, o]
  ), /* @__PURE__ */ n.jsx(E, { ...e, children: i.join(" ") });
}, B = ({
  onDrag: e,
  triggers: r = [["MouseLeft"], ["MouseRight"]],
  bound: i,
  loose: o = !1
}) => {
  const s = g(null), t = g(l.ZERO), f = x(
    (a) => {
      const u = l.construct(a);
      if (s.current === null)
        return;
      const { triggers: c } = s.current;
      e({
        box: d.construct(t.current, u),
        cursor: u,
        triggers: c,
        stage: "during"
      });
    },
    [e]
  ), S = x(
    (a) => {
      const { stage: u, cursor: c } = a;
      u === "start" ? (e({ box: d.construct(c), ...a }), window.addEventListener("mousemove", f), s.current = a, t.current = c) : u === "end" && s.current != null && (e({ box: d.construct(t.current, c), ...a }), window.removeEventListener("mousemove", f), s.current = null, t.current = l.ZERO);
    },
    [e]
  );
  p({ triggers: r, callback: S, region: i, loose: o });
}, G = ({
  className: e,
  style: r,
  trigger: i,
  ...o
}) => {
  const s = {
    Control: /* @__PURE__ */ n.jsx(m.Meta, {}),
    Alt: /* @__PURE__ */ n.jsx(m.Alt, {}),
    Shift: /* @__PURE__ */ n.jsx(b.Keyboard.Shift, {}),
    MouseLeft: "Left Click",
    MouseRight: "Right Click",
    MouseMiddle: "Middle Click"
  };
  return /* @__PURE__ */ n.jsx(F, { className: e, style: r, direction: "x", children: i.map((t) => (
    // @ts-expect-error
    /* @__PURE__ */ n.jsx(V, { ...o, children: s[t] ?? t }, t)
  )) });
}, oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  ALPHANUMERIC_KEYS: y,
  ALPHANUMERIC_KEYS_SET: C,
  KEYS: R,
  MOUSE_KEYS: j,
  Provider: K,
  Status: q,
  Text: G,
  compareModeConfigs: h,
  determineMode: T,
  diff: _,
  eventKey: L,
  filter: k,
  flattenConfig: O,
  keyZ: v,
  keyboardKey: A,
  match: Z,
  mouseKey: U,
  mouseKeyZ: Y,
  purge: w,
  purgeMouse: H,
  triggerZ: P,
  use: p,
  useContext: M,
  useDrag: B,
  useFlattenedMemoConfig: $,
  useHeld: I,
  useHeldRef: N
}, Symbol.toStringTag, { value: "Module" }));
export {
  G as T,
  oe as e,
  B as u
};
//# sourceMappingURL=external-M1eGfKqN.js.map
