import { R as x, e as E, U as p, O as m, n as R, V as b, X as C, Y as j, Z as y, _ 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 I, ae as N, x as X } from "./Toggle-5mHDjpoq.js";
import { j as n } from "./jsx-runtime-NmMXPjeo.js";
import { useState as $, useEffect as z, useRef as g, useCallback as M } from "react";
import { R as l, M as d } from "./css-M9deYuc0.js";
import { S as F } from "./Center-ZEYtK6iF.js";
import "./aggregator-e8E2YGic.js";
import "react-hook-form";
import { K as V } from "./Keyboard-1CGTJ7G-.js";
const q = (e) => {
  const { listen: r } = x(), [u, o] = $([]);
  return z(
    () => r(({ next: [s] }) => o(s ?? [])),
    [r, o]
  ), /* @__PURE__ */ n.jsx(E, { ...e, children: u.join(" ") });
}, B = ({
  onDrag: e,
  triggers: r = [["MouseLeft"], ["MouseRight"]],
  bound: u,
  loose: o = !1
}) => {
  const s = g(null), t = g(l.ZERO), f = M(
    (a) => {
      const i = l.construct(a);
      if (s.current === null)
        return;
      const { triggers: c } = s.current;
      e({
        box: d.construct(t.current, i),
        cursor: i,
        triggers: c,
        stage: "during"
      });
    },
    [e]
  ), S = M(
    (a) => {
      const { stage: i, cursor: c } = a;
      i === "start" ? (e({ box: d.construct(c), ...a }), window.addEventListener("mousemove", f), s.current = a, t.current = c) : i === "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: u, loose: o });
}, G = ({
  className: e,
  style: r,
  trigger: u,
  ...o
}) => {
  const s = {
    Control: /* @__PURE__ */ n.jsx(m.Meta, {}),
    Alt: /* @__PURE__ */ n.jsx(m.Alt, {}),
    Shift: /* @__PURE__ */ n.jsx(R.Keyboard.Shift, {}),
    MouseLeft: "Left Click",
    MouseRight: "Right Click",
    MouseMiddle: "Middle Click"
  };
  return /* @__PURE__ */ n.jsx(F, { className: e, style: r, direction: "x", children: u.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: b,
  ALPHANUMERIC_KEYS_SET: C,
  KEYS: j,
  MOUSE_KEYS: y,
  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: x,
  useDrag: B,
  useFlattenedMemoConfig: I,
  useHeld: N,
  useHeldRef: X
}, Symbol.toStringTag, { value: "Module" }));
export {
  G as T,
  oe as e,
  B as u
};
//# sourceMappingURL=external-yDM_sq4v.js.map
