"use strict";const e=require("./main-DCvw0wt3.cjs"),f=require("./jsx-runtime-CITbqOLs.cjs"),n=require("react"),o=require("./css-CmXY6iPo.cjs");require("./eraser-h8NIswGM.cjs");const m=t=>{const{listen:i}=e.useContext$4(),[a,l]=n.useState([]);return n.useEffect(()=>i(({next:[r]})=>l(r??[])),[i,l]),f.jsxRuntimeExports.jsx(e.Text,{...t,children:a.join(" ")})},M=({onDrag:t,triggers:i=[["MouseLeft"],["MouseRight"]],bound:a,loose:l=!1})=>{const r=n.useRef(null),E=n.useRef(o.K.ZERO),g=n.useCallback(s=>{const u=o.K.construct(s);if(r.current===null)return;const{triggers:c}=r.current;t({box:o.Ho.construct(E.current,u),cursor:u,triggers:c,stage:"during"})},[t]),d=n.useCallback(s=>{const{stage:u,cursor:c}=s;u==="start"?(t({box:o.Ho.construct(c),...s}),window.addEventListener("mousemove",g),r.current=s,E.current=c):u==="end"&&r.current!=null&&(t({box:o.Ho.construct(E.current,c),...s}),window.removeEventListener("mousemove",g),r.current=null,E.current=o.K.ZERO)},[t]);e.use$1({triggers:i,callback:d,region:a,loose:l})},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,MOUSE_LEFT_NUMBER:e.MOUSE_LEFT_NUMBER,MOUSE_MIDDLE_NUMBER:e.MOUSE_MIDDLE_NUMBER,MOUSE_RIGHT_NUMBER:e.MOUSE_RIGHT_NUMBER,Provider:e.Provider$1,Status:m,Text:e.Text$1,compareModeConfigs:e.compareModeConfigs,determineMode:e.determineMode,diff:e.diff,eventKey:e.eventKey,filter:e.filter,flattenConfig:e.flattenConfig,isAlphanumericKey:e.isAlphanumericKey,keyZ:e.keyZ,keyboardKey:e.keyboardKey,match:e.match,matchCallback:e.matchCallback,mouseKey:e.mouseKey,mouseKeyZ:e.mouseKeyZ,purge:e.purge,purgeMouse:e.purgeMouse,toSymbols:e.toSymbols,triggerZ:e.triggerZ,use:e.use$1,useContext:e.useContext$4,useDrag:M,useFlattenedMemoConfig:e.useFlattenedMemoConfig,useHeld:e.useHeld,useHeldRef:e.useHeldRef},Symbol.toStringTag,{value:"Module"}));exports.external=S;exports.useDrag=M;
