"use strict";const a=require("./hooks-D_-XdOAe.cjs"),e=require("./Text-DECnk5vG.cjs"),m=require("./jsx-runtime-Dszzpdy0.cjs"),u=require("react"),S=require("./Editable-BXFY3-UW.cjs"),o=require("./css-HnNQMUzV.cjs");require("./types-D-yz1qsT.cjs");const _=t=>{const{listen:i}=e.useContext(),[g,l]=u.useState([]);return u.useEffect(()=>i(({next:[r]})=>l(r??[])),[i,l]),m.jsxRuntimeExports.jsx(S.Text,{...t,children:g.join(" ")})},d=({onDrag:t,triggers:i=[["MouseLeft"],["MouseRight"]],bound:g,loose:l=!1})=>{const r=u.useRef(null),E=u.useRef(o.Q.ZERO),M=u.useCallback(s=>{const n=o.Q.construct(s);if(r.current===null)return;const{triggers:c}=r.current;t({box:o.jt.construct(E.current,n),cursor:n,triggers:c,stage:"during"})},[t]),f=u.useCallback(s=>{const{stage:n,cursor:c}=s;n==="start"?(t({box:o.jt.construct(c),...s}),window.addEventListener("mousemove",M),r.current=s,E.current=c):n==="end"&&r.current!=null&&(t({box:o.jt.construct(E.current,c),...s}),window.removeEventListener("mousemove",M),r.current=null,E.current=o.Q.ZERO)},[t]);a.use({triggers:i,callback:f,region:g,loose:l})},R=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,Status:_,Text:e.Text,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:a.use,useContext:e.useContext,useDrag:d,useFlattenedMemoConfig:e.useFlattenedMemoConfig,useHeld:a.useHeld,useHeldRef:a.useHeldRef},Symbol.toStringTag,{value:"Module"}));exports.external=R;exports.useDrag=d;
