import{l as e,n as t,r as n,u as o,g as r,o as u}from"./@vue_reactivity@3.3.8-Bd6EA3k-.js";import{x as i,t as a,k as s,g as c,n as l}from"./@vue_runtime-core@3.3.8-B4gmtzbp.js";var f,v=Object.defineProperty,m=Object.defineProperties,p=Object.getOwnPropertyDescriptors,d=Object.getOwnPropertySymbols,w=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable,g=(e,t,n)=>t in e?v(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;function b(n,o){const r=e();var u,a;return i((()=>{r.value=n()}),(u=((e,t)=>{for(var n in t||(t={}))w.call(t,n)&&g(e,n,t[n]);if(d)for(var n of d(t))y.call(t,n)&&g(e,n,t[n]);return e})({},o),a={flush:null!=void 0?void 0:"sync"},m(u,p(a)))),t(r)}const P="undefined"!=typeof window,h=e=>void 0!==e,j=e=>"function"==typeof e,O=e=>"string"==typeof e,T=()=>{},D=P&&(null==(f=null==window?void 0:window.navigator)?void 0:f.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function x(e){return"function"==typeof e?e():o(e)}function A(e,t){return function(...n){return new Promise(((o,r)=>{Promise.resolve(e((()=>t.apply(this,n)),{fn:t,thisArg:this,args:n})).then(o).catch(r)}))}}function _(e){return e}function k(e){return!!r()&&(u(e),!0)}function C(e,t=200,n={}){return A(function(e,t={}){let n,o,r=T;const u=e=>{clearTimeout(e),r(),r=T};return i=>{const a=x(e),s=x(t.maxWait);return n&&u(n),a<=0||void 0!==s&&s<=0?(o&&(u(o),o=null),Promise.resolve(i())):new Promise(((e,c)=>{r=t.rejectOnCancel?c:e,s&&!o&&(o=setTimeout((()=>{n&&u(n),o=null,e(i())}),s)),n=setTimeout((()=>{o&&u(o),o=null,e(i())}),a)}))}}(t,n),e)}function E(e,t=200,o={}){const r=n(e.value),u=C((()=>{r.value=e.value}),t,o);return a(e,(()=>u())),r}function I(e,t=200,n=!1,o=!0,r=!1){return A(function(e,t=!0,n=!0,o=!1){let r,u,i=0,a=!0,s=T;const c=()=>{r&&(clearTimeout(r),r=void 0,s(),s=T)};return l=>{const f=x(e),v=Date.now()-i,m=()=>u=l();return c(),f<=0?(i=Date.now(),m()):(v>f&&(n||!a)?(i=Date.now(),m()):t&&(u=new Promise(((e,t)=>{s=o?t:e,r=setTimeout((()=>{i=Date.now(),a=!0,e(m()),c()}),Math.max(0,f-v))}))),n||r||(r=setTimeout((()=>a=!0),f)),a=!1,u)}}(t,n,o,r),e)}function M(e,t=!0){s()?c(e):t?e():l(e)}function S(e,o,r={}){const{immediate:u=!0}=r,i=n(!1);let a=null;function s(){a&&(clearTimeout(a),a=null)}function c(){i.value=!1,s()}function l(...t){s(),i.value=!0,a=setTimeout((()=>{i.value=!1,a=null,e(...t)}),x(o))}return u&&(i.value=!0,P&&l()),k(c),{isPending:t(i),start:l,stop:c}}export{D as a,M as b,P as c,_ as d,j as e,h as f,E as g,S as h,O as i,b as j,T as n,x as r,k as t,I as u};
