import{i as P}from"./index-BbBXKozi.js";import{c as E,g as W}from"./__federation_shared_react-xoJ64Y1K.js";var _="Expected a function",B=NaN,$="[object Symbol]",G=/^\s+|\s+$/g,H=/^[-+]0x[0-9a-f]+$/i,U=/^0b[01]+$/i,q=/^0o[0-7]+$/i,J=parseInt,X=typeof E=="object"&&E&&E.Object===Object&&E,K=typeof self=="object"&&self&&self.Object===Object&&self,Q=X||K||Function("return this")(),Y=Object.prototype,Z=Y.toString,V=Math.max,ee=Math.min,z=function(){return Q.Date.now()};function ne(e,n,t){var r,i,u,s,o,a,c=0,d=!1,l=!1,b=!0;if(typeof e!="function")throw new TypeError(_);n=A(n)||0,k(t)&&(d=!!t.leading,l="maxWait"in t,u=l?V(A(t.maxWait)||0,n):u,b="trailing"in t?!!t.trailing:b);function m(f){var I=r,j=i;return r=i=void 0,c=f,s=e.apply(j,I),s}function g(f){return c=f,o=setTimeout(C,n),d?m(f):s}function v(f){var I=f-a,j=f-c,F=n-I;return l?ee(F,u-j):F}function S(f){var I=f-a,j=f-c;return a===void 0||I>=n||I<0||l&&j>=u}function C(){var f=z();if(S(f))return O(f);o=setTimeout(C,v(f))}function O(f){return o=void 0,b&&r?m(f):(r=i=void 0,s)}function x(){o!==void 0&&clearTimeout(o),c=0,r=a=i=o=void 0}function R(){return o===void 0?s:O(z())}function T(){var f=z(),I=S(f);if(r=arguments,i=this,a=f,I){if(o===void 0)return g(a);if(l)return o=setTimeout(C,n),m(a)}return o===void 0&&(o=setTimeout(C,n)),s}return T.cancel=x,T.flush=R,T}function k(e){var n=typeof e;return!!e&&(n=="object"||n=="function")}function te(e){return!!e&&typeof e=="object"}function re(e){return typeof e=="symbol"||te(e)&&Z.call(e)==$}function A(e){if(typeof e=="number")return e;if(re(e))return B;if(k(e)){var n=typeof e.valueOf=="function"?e.valueOf():e;e=k(n)?n+"":n}if(typeof e!="string")return e===0?e:+e;e=e.replace(G,"");var t=U.test(e);return t||q.test(e)?J(e.slice(2),t?2:8):H.test(e)?B:+e}var oe=ne;const L=W(oe),{useState:y,useCallback:p,useLayoutEffect:se,useEffect:w,useRef:h,useMemo:ie}=await P("react");function ue(e=!1){if(typeof e!="boolean")throw new Error("defaultValue must be `true` or `false`");const[n,t]=y(e),r=p(()=>{t(!0)},[]),i=p(()=>{t(!1)},[]),u=p(()=>{t(s=>!s)},[]);return{value:n,setValue:t,setTrue:r,setFalse:i,toggle:u}}var N=typeof window<"u"?se:w;function ce(e){const[n,t]=y(e??0),r=p(()=>{t(s=>s+1)},[]),i=p(()=>{t(s=>s-1)},[]),u=p(()=>{t(e??0)},[e]);return{count:n,increment:r,decrement:i,reset:u,setCount:t}}function fe(e,n){const t=h(e);N(()=>{t.current=e},[e]),w(()=>{if(n===null)return;const r=setInterval(()=>{t.current()},n);return()=>{clearInterval(r)}},[n])}function me({countStart:e,countStop:n=0,intervalMs:t=1e3,isIncrement:r=!1}){const{count:i,increment:u,decrement:s,reset:o}=ce(e),{value:a,setTrue:c,setFalse:d}=ue(!1),l=p(()=>{d(),o()},[d,o]),b=p(()=>{if(i===n){d();return}r?u():s()},[i,n,s,u,r,d]);return fe(b,a?t:null),[i,{startCountdown:c,stopCountdown:d,resetCountdown:l}]}function ae(e){const n=h(e);n.current=e,w(()=>()=>{n.current()},[])}function de(e,n=500,t){const r=h();ae(()=>{r.current&&r.current.cancel()});const i=ie(()=>{const u=L(e,n,t),s=(...o)=>u(...o);return s.cancel=()=>{u.cancel()},s.isPending=()=>!!r.current,s.flush=()=>u.flush(),s},[e,n,t]);return w(()=>{r.current=L(e,n,t)},[e,n,t]),i}function ge(e,n,t){const r=(c,d)=>c===d,i=e instanceof Function?e():e,[u,s]=y(i),o=h(i),a=de(s,n,t);return r(o.current,i)||(a(i),o.current=i),[u,a]}function he({threshold:e=0,root:n=null,rootMargin:t="0%",freezeOnceVisible:r=!1,initialIsIntersecting:i=!1,onChange:u}={}){var s;const[o,a]=y(null),[c,d]=y(()=>({isIntersecting:i,entry:void 0})),l=h();l.current=u;const b=((s=c.entry)==null?void 0:s.isIntersecting)&&r;w(()=>{if(!o||!("IntersectionObserver"in window)||b)return;let v;const S=new IntersectionObserver(C=>{const O=Array.isArray(S.thresholds)?S.thresholds:[S.thresholds];C.forEach(x=>{const R=x.isIntersecting&&O.some(T=>x.intersectionRatio>=T);d({isIntersecting:R,entry:x}),l.current&&l.current(R,x),R&&r&&v&&(v(),v=void 0)})},{threshold:e,root:n,rootMargin:t});return S.observe(o),()=>{S.disconnect()}},[o,JSON.stringify(e),n,t,b,r]);const m=h(null);w(()=>{var v;!o&&((v=c.entry)!=null&&v.target)&&!r&&!b&&m.current!==c.entry.target&&(m.current=c.entry.target,d({isIntersecting:i,entry:void 0}))},[o,c.entry,r,b,i]);const g=[a,!!c.isIntersecting,c.entry];return g.ref=g[0],g.isIntersecting=g[1],g.entry=g[2],g}function le(){const e=h(!1);return w(()=>(e.current=!0,()=>{e.current=!1}),[]),p(()=>e.current,[])}var M={width:void 0,height:void 0};function pe(e){const{ref:n,box:t="content-box"}=e,[{width:r,height:i},u]=y(M),s=le(),o=h({...M}),a=h(void 0);return a.current=e.onResize,w(()=>{if(!n.current||typeof window>"u"||!("ResizeObserver"in window))return;const c=new ResizeObserver(([d])=>{const l=t==="border-box"?"borderBoxSize":t==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",b=D(d,l,"inlineSize"),m=D(d,l,"blockSize");if(o.current.width!==b||o.current.height!==m){const v={width:b,height:m};o.current.width=b,o.current.height=m,a.current?a.current(v):s()&&u(v)}});return c.observe(n.current,{box:t}),()=>{c.disconnect()}},[t,n,s]),{width:r,height:i}}function D(e,n,t){return e[n]?Array.isArray(e[n])?e[n][0][t]:e[n][t]:n==="contentBoxSize"?e.contentRect[t==="inlineSize"?"width":"height"]:void 0}function we(e,n){const t=h(e);N(()=>{t.current=e},[e]),w(()=>{if(!n&&n!==0)return;const r=setTimeout(()=>{t.current()},n);return()=>{clearTimeout(r)}},[n])}export{ce as a,fe as b,me as c,ge as d,pe as e,he as f,de as g,we as u}; //# sourceMappingURL=index-CDnJG_qv.js.map