"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function y(r,i,o={}){const{check:l=e=>!!e,interval:u=100,maxRetry:c=1/0,onTimeout:a}=o;let m=0,t=null;const n=()=>{const e=r();if(l(e)){i(e),t&&clearTimeout(t);return}if(++m>=c){t&&clearTimeout(t),a?.();return}t=window.setTimeout(n,u)};return n(),()=>{t&&clearTimeout(t)}}exports.retryUntil=y;
