import{options as V}from"./preact.module.js";var c,r,d,b,v=0,x=[],e=V,g=e.__b,C=e.__r,A=e.diffed,D=e.__c,F=e.unmount,k=e.__;function l(t,_){e.__h&&e.__h(r,t,v||_),v=0;var u=r.__H||(r.__H={__:[],__h:[]});return t>=u.__.length&&u.__.push({}),u.__[t]}function B(t){return v=1,I(U,t)}function I(t,_,u){var n=l(c++,2);if(n.t=t,!n.__c&&(n.__=[u?u(_):U(void 0,_),function(f){var a=n.__N?n.__N[0]:n.__[0],s=n.t(a,f);a!==s&&(n.__N=[s,n.__[1]],n.__c.setState({}))}],n.__c=r,!r.__f)){var i=function(f,a,s){if(!n.__c.__H)return!0;var m=n.__c.__H.__.filter(function(o){return!!o.__c});if(m.every(function(o){return!o.__N}))return!h||h.call(this,f,a,s);var N=n.__c.props!==f;return m.forEach(function(o){if(o.__N){var P=o.__[0];o.__=o.__N,o.__N=void 0,P!==o.__[0]&&(N=!0)}}),h&&h.call(this,f,a,s)||N};r.__f=!0;var h=r.shouldComponentUpdate,E=r.componentWillUpdate;r.componentWillUpdate=function(f,a,s){if(this.__e){var m=h;h=void 0,i(f,a,s),h=m}E&&E.call(this,f,a,s)},r.shouldComponentUpdate=i}return n.__N||n.__}function w(t,_){var u=l(c++,3);!e.__s&&y(u.__H,_)&&(u.__=t,u.u=_,r.__H.__h.push(u))}function R(t,_){var u=l(c++,4);!e.__s&&y(u.__H,_)&&(u.__=t,u.u=_,r.__h.push(u))}function z(t){return v=5,T(function(){return{current:t}},[])}function L(t,_,u){v=6,R(function(){if(typeof t=="function"){var n=t(_());return function(){t(null),n&&typeof n=="function"&&n()}}if(t)return t.current=_(),function(){return t.current=null}},u==null?u:u.concat(t))}function T(t,_){var u=l(c++,7);return y(u.__H,_)&&(u.__=t(),u.__H=_,u.__h=t),u.__}function M(t,_){return v=8,T(function(){return t},_)}function $(t){var _=r.context[t.__c],u=l(c++,9);return u.c=t,_?(u.__==null&&(u.__=!0,_.sub(r)),_.props.value):t.__}function G(t,_){e.useDebugValue&&e.useDebugValue(_?_(t):t)}function J(t){var _=l(c++,10),u=B();return _.__=t,r.componentDidCatch||(r.componentDidCatch=function(n,i){_.__&&_.__(n,i),u[1](n)}),[u[0],function(){u[1](void 0)}]}function K(){var t=l(c++,11);if(!t.__){for(var _=r.__v;_!==null&&!_.__m&&_.__!==null;)_=_.__;var u=_.__m||(_.__m=[0,0]);t.__="P"+u[0]+"-"+u[1]++}return t.__}function S(){for(var t;t=x.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(p),t.__H.__h.forEach(H),t.__H.__h=[]}catch(_){t.__H.__h=[],e.__e(_,t.__v)}}e.__b=function(t){r=null,g&&g(t)},e.__=function(t,_){t&&_.__k&&_.__k.__m&&(t.__m=_.__k.__m),k&&k(t,_)},e.__r=function(t){C&&C(t),c=0;var _=(r=t.__c).__H;_&&(d===r?(_.__h=[],r.__h=[],_.__.forEach(function(u){u.__N&&(u.__=u.__N),u.u=u.__N=void 0})):(_.__h.forEach(p),_.__h.forEach(H),_.__h=[],c=0)),d=r},e.diffed=function(t){A&&A(t);var _=t.__c;_&&_.__H&&(_.__H.__h.length&&(x.push(_)!==1&&b===e.requestAnimationFrame||((b=e.requestAnimationFrame)||W)(S)),_.__H.__.forEach(function(u){u.u&&(u.__H=u.u),u.u=void 0})),d=r=null},e.__c=function(t,_){_.some(function(u){try{u.__h.forEach(p),u.__h=u.__h.filter(function(n){return!n.__||H(n)})}catch(n){_.some(function(i){i.__h&&(i.__h=[])}),_=[],e.__e(n,u.__v)}}),D&&D(t,_)},e.unmount=function(t){F&&F(t);var _,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{p(n)}catch(i){_=i}}),u.__H=void 0,_&&e.__e(_,u.__v))};var q=typeof requestAnimationFrame=="function";function W(t){var _,u=function(){clearTimeout(n),q&&cancelAnimationFrame(_),setTimeout(t)},n=setTimeout(u,35);q&&(_=requestAnimationFrame(u))}function p(t){var _=r,u=t.__c;typeof u=="function"&&(t.__c=void 0,u()),r=_}function H(t){var _=r;t.__c=t.__(),r=_}function y(t,_){return!t||t.length!==_.length||_.some(function(u,n){return u!==t[n]})}function U(t,_){return typeof _=="function"?_(t):_}export{M as useCallback,$ as useContext,G as useDebugValue,w as useEffect,J as useErrorBoundary,K as useId,L as useImperativeHandle,R as useLayoutEffect,T as useMemo,I as useReducer,z as useRef,B as useState};
