import{n as e,s as t}from"./rolldown-runtime-BG2f4sTM.js";import{Mvt as n,Nvt as r}from"./app-initial-BHB6SClA.js";function i({height:e,topInset:t=0,width:n}){let r=Math.min(920,n-32),i=e-t,a=Math.min(840,i-32);return{height:Math.max(u,a),width:Math.max(l,r),x:Math.round((n-r)/2),y:t+Math.round((i-a)/2)}}function a(e,t,n={}){let r=t.topInset??0,i=t.height-r,a=n.minWidth??l,o=n.minHeight??u,d=Math.max(a,Math.min(e.width,t.width));return{height:Math.max(o,Math.min(e.height,i)),width:d,x:Math.min(t.width-s,Math.max(s-d,e.x)),y:Math.min(t.height-c,Math.max(r,e.y))}}function o(e,t,n,r={}){return a({...e,height:e.height+t.y,width:e.width+t.x},n,r)}var s,c,l,u,d=e((()=>{s=96,c=40,l=480,u=320}));function f(){let e=(0,p.c)(3),t=(0,m.useRef)(null),n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>()=>{t.current?.()},r=[],e[0]=n,e[1]=r):(n=e[0],r=e[1]),(0,m.useEffect)(n,r);let i;return e[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(e,n)=>{e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),t.current?.();let r=e.clientX,i=e.clientY,a=e=>{n({x:e.clientX-r,y:e.clientY-i}),r=e.clientX,i=e.clientY},o=()=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o),t.current===o&&(t.current=null)};t.current=o,window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o),window.addEventListener(`pointercancel`,o)},e[2]=i):i=e[2],i}var p,m,h=e((()=>{p=n(),m=t(r(),1)}));export{o as a,i,f as n,d as o,a as r,h as t};
//# sourceMappingURL=use-floating-window-pointer-drag-DixCbMwo.js.map