"use strict";const e=require("./Toggle-oSdnI-zd.cjs"),c=require("./jsx-runtime-evvPGacs.cjs"),l=require("react"),i=require("./css-x0qKpJph.cjs"),M=require("./Center-UNXZHbuA.cjs");require("./aggregator-_DqLetA1.cjs");require("react-hook-form");const y=require("./Keyboard-9cg_1-Fc.cjs"),R=t=>{const{listen:o}=e.useContext$1(),[d,n]=l.useState([]);return l.useEffect(()=>o(({next:[r]})=>n(r??[])),[o,n]),c.jsxRuntimeExports.jsx(e.Text,{...t,children:d.join(" ")})},f=({onDrag:t,triggers:o=[["MouseLeft"],["MouseRight"]],bound:d,loose:n=!1})=>{const r=l.useRef(null),s=l.useRef(i.xy.ZERO),a=l.useCallback(u=>{const x=i.xy.construct(u);if(r.current===null)return;const{triggers:g}=r.current;t({box:i.box$1.construct(s.current,x),cursor:x,triggers:g,stage:"during"})},[t]),E=l.useCallback(u=>{const{stage:x,cursor:g}=u;x==="start"?(t({box:i.box$1.construct(g),...u}),window.addEventListener("mousemove",a),r.current=u,s.current=g):x==="end"&&r.current!=null&&(t({box:i.box$1.construct(s.current,g),...u}),window.removeEventListener("mousemove",a),r.current=null,s.current=i.xy.ZERO)},[t]);e.use$2({triggers:o,callback:E,region:d,loose:n})},m=({className:t,style:o,trigger:d,...n})=>{const r={Control:c.jsxRuntimeExports.jsx(e.Symbols.Meta,{}),Alt:c.jsxRuntimeExports.jsx(e.Symbols.Alt,{}),Shift:c.jsxRuntimeExports.jsx(e.u0.Keyboard.Shift,{}),MouseLeft:"Left Click",MouseRight:"Right Click",MouseMiddle:"Middle Click"};return c.jsxRuntimeExports.jsx(M.Space,{className:t,style:o,direction:"x",children:d.map(s=>c.jsxRuntimeExports.jsx(y.Keyboard,{...n,children:r[s]??s},s))})},S=Object.freeze(Object.defineProperty({__proto__:null,ALPHANUMERIC_KEYS:e.ALPHANUMERIC_KEYS,ALPHANUMERIC_KEYS_SET:e.ALPHANUMERIC_KEYS_SET,KEYS:e.KEYS,MOUSE_KEYS:e.MOUSE_KEYS,Provider:e.Provider$1,Status:R,Text:m,compareModeConfigs:e.compareModeConfigs,determineMode:e.determineMode,diff:e.diff,eventKey:e.eventKey,filter:e.filter,flattenConfig:e.flattenConfig,keyZ:e.keyZ,keyboardKey:e.keyboardKey,match:e.match,mouseKey:e.mouseKey,mouseKeyZ:e.mouseKeyZ,purge:e.purge,purgeMouse:e.purgeMouse,triggerZ:e.triggerZ,use:e.use$2,useContext:e.useContext$1,useDrag:f,useFlattenedMemoConfig:e.useFlattenedMemoConfig,useHeld:e.useHeld,useHeldRef:e.useHeldRef},Symbol.toStringTag,{value:"Module"}));exports.Text=m;exports.external=S;exports.useDrag=f;
//# sourceMappingURL=external-bI8uO2y9.cjs.map
