1import{r as o}from"./ErrorPage-_Vd6n00G.js";import{T as n}from"./HelperModal-CgpZwr3x.js";const E=()=>{const t=r=>{if(r.defaultPrevented)return;r.preventDefault();const{dataTransfer:e}=r;r.type==="dragover"&&e!=null&&(e.dropEffect="none")};return window.addEventListener("dragover",t),window.addEventListener("drop",t),()=>{window.removeEventListener("dragover",t),window.removeEventListener("drop",t)}};function N(){const[t,r]=o.useState(n.NORMAL),e=o.useRef(null),l=o.useRef(null);return o.useEffect(()=>()=>{e.current!=null&&clearTimeout(e.current),l.current?.abort()},[]),{status:t,run:async(i,u)=>{if(t===n.SPINNING)return;e.current!=null&&(clearTimeout(e.current),e.current=null);const s=new AbortController;l.current=s,r(n.SPINNING);let a=null;const c=u!=null?new Promise((m,f)=>{a=setTimeout(()=>{f(new Error(`AsyncButton timed out after ${u}ms`))},u)}):null;try{c!=null?await Promise.race([i(),c]):await i(),s.signal.aborted||r(n.NORMAL)}catch{s.signal.aborted||(r(n.FAILURE),e.current=setTimeout(()=>{r(n.NORMAL),e.current=null},2e3))}finally{a!=null&&clearTimeout(a)}}}}export{E as b,N as u}; 2//# sourceMappingURL=useAsyncAction-W-5facZY.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.