ahooks-v2
Version:
react hooks library
14 lines • 105 kB
JavaScript
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("React")):"function"==typeof define&&define.amd?define(["React"],e):"object"==typeof exports?exports.ahooks=e(require("React")):t.ahooks=e(t.React)}(this,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)n.d(r,o,function(e){return t[e]}.bind(null,o));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=11)}([function(e,n){e.exports=t},function(t,e,n){
/*!
* screenfull
* v5.2.0 - 2021-11-03
* (c) Sindre Sorhus; MIT License
*/
!function(){"use strict";var e="undefined"!=typeof window&&void 0!==window.document?window.document:{},n=t.exports,r=function(){for(var t,n=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],r=0,o=n.length,i={};r<o;r++)if((t=n[r])&&t[1]in e){for(r=0;r<t.length;r++)i[n[0][r]]=t[r];return i}return!1}(),o={change:r.fullscreenchange,error:r.fullscreenerror},i={request:function(t,n){return new Promise(function(o,i){var u=function(){this.off("change",u),o()}.bind(this);this.on("change",u);var c=(t=t||e.documentElement)[r.requestFullscreen](n);c instanceof Promise&&c.then(u).catch(i)}.bind(this))},exit:function(){return new Promise(function(t,n){if(this.isFullscreen){var o=function(){this.off("change",o),t()}.bind(this);this.on("change",o);var i=e[r.exitFullscreen]();i instanceof Promise&&i.then(o).catch(n)}else t()}.bind(this))},toggle:function(t,e){return this.isFullscreen?this.exit():this.request(t,e)},onchange:function(t){this.on("change",t)},onerror:function(t){this.on("error",t)},on:function(t,n){var r=o[t];r&&e.addEventListener(r,n,!1)},off:function(t,n){var r=o[t];r&&e.removeEventListener(r,n,!1)},raw:r};r?(Object.defineProperties(i,{isFullscreen:{get:function(){return Boolean(e[r.fullscreenElement])}},element:{enumerable:!0,get:function(){return e[r.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(e[r.fullscreenEnabled])}}}),n?t.exports=i:window.screenfull=i):n?t.exports={isEnabled:!1}:window.screenfull={isEnabled:!1}}()},function(t,e){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){var r,o;
/*!
* JavaScript Cookie v2.2.1
* https://github.com/js-cookie/js-cookie
*
* Copyright 2006, 2015 Klaus Hartl & Fagner Brack
* Released under the MIT license
*/!function(i){if(void 0===(o="function"==typeof(r=i)?r.call(e,n,e,t):r)||(t.exports=o),!0,t.exports=i(),!!0){var u=window.Cookies,c=window.Cookies=i();c.noConflict=function(){return window.Cookies=u,c}}}((function(){function t(){for(var t=0,e={};t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}function e(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(r){function o(){}function i(e,n,i){if("undefined"!=typeof document){"number"==typeof(i=t({path:"/"},o.defaults,i)).expires&&(i.expires=new Date(1*new Date+864e5*i.expires)),i.expires=i.expires?i.expires.toUTCString():"";try{var u=JSON.stringify(n);/^[\{\[]/.test(u)&&(n=u)}catch(t){}n=r.write?r.write(n,e):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var c="";for(var a in i)i[a]&&(c+="; "+a,!0!==i[a]&&(c+="="+i[a].split(";")[0]));return document.cookie=e+"="+n+c}}function u(t,n){if("undefined"!=typeof document){for(var o={},i=document.cookie?document.cookie.split("; "):[],u=0;u<i.length;u++){var c=i[u].split("="),a=c.slice(1).join("=");n||'"'!==a.charAt(0)||(a=a.slice(1,-1));try{var f=e(c[0]);if(a=(r.read||r)(a,f)||e(a),n)try{a=JSON.parse(a)}catch(t){}if(o[f]=a,t===f)break}catch(t){}}return t?o[t]:o}}return o.set=i,o.get=function(t){return u(t,!1)},o.getJSON=function(t){return u(t,!0)},o.remove=function(e,n){i(e,"",t(n,{expires:-1}))},o.defaults={},o.withConverter=n,o}((function(){}))}))},function(t,e,n){(function(e){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt,c="object"==typeof e&&e&&e.Object===Object&&e,a="object"==typeof self&&self&&self.Object===Object&&self,f=c||a||Function("return this")(),l=Object.prototype.toString,s=Math.max,d=Math.min,h=function(){return f.Date.now()};function v(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function p(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==l.call(t)}(t))return NaN;if(v(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=v(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var c=o.test(t);return c||i.test(t)?u(t.slice(2),c?2:8):r.test(t)?NaN:+t}t.exports=function(t,e,n){var r,o,i,u,c,a,f=0,l=!1,y=!1,b=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(e){var n=r,i=o;return r=o=void 0,f=e,u=t.apply(i,n)}function g(t){return f=t,c=setTimeout(w,e),l?m(t):u}function O(t){var n=t-a;return void 0===a||n>=e||n<0||y&&t-f>=i}function w(){var t=h();if(O(t))return j(t);c=setTimeout(w,function(t){var n=e-(t-a);return y?d(n,i-(t-f)):n}(t))}function j(t){return c=void 0,b&&r?m(t):(r=o=void 0,u)}function S(){var t=h(),n=O(t);if(r=arguments,o=this,a=t,n){if(void 0===c)return g(a);if(y)return c=setTimeout(w,e),m(a)}return void 0===c&&(c=setTimeout(w,e)),u}return e=p(e)||0,v(n)&&(l=!!n.leading,i=(y="maxWait"in n)?s(p(n.maxWait)||0,e):i,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==c&&clearTimeout(c),f=0,r=a=o=c=void 0},S.flush=function(){return void 0===c?u:j(h())},S}}).call(this,n(2))},function(t,e,n){(function(e){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt,c="object"==typeof e&&e&&e.Object===Object&&e,a="object"==typeof self&&self&&self.Object===Object&&self,f=c||a||Function("return this")(),l=Object.prototype.toString,s=Math.max,d=Math.min,h=function(){return f.Date.now()};function v(t,e,n){var r,o,i,u,c,a,f=0,l=!1,v=!1,b=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(e){var n=r,i=o;return r=o=void 0,f=e,u=t.apply(i,n)}function g(t){return f=t,c=setTimeout(w,e),l?m(t):u}function O(t){var n=t-a;return void 0===a||n>=e||n<0||v&&t-f>=i}function w(){var t=h();if(O(t))return j(t);c=setTimeout(w,function(t){var n=e-(t-a);return v?d(n,i-(t-f)):n}(t))}function j(t){return c=void 0,b&&r?m(t):(r=o=void 0,u)}function S(){var t=h(),n=O(t);if(r=arguments,o=this,a=t,n){if(void 0===c)return g(a);if(v)return c=setTimeout(w,e),m(a)}return void 0===c&&(c=setTimeout(w,e)),u}return e=y(e)||0,p(n)&&(l=!!n.leading,i=(v="maxWait"in n)?s(y(n.maxWait)||0,e):i,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==c&&clearTimeout(c),f=0,r=a=o=c=void 0},S.flush=function(){return void 0===c?u:j(h())},S}function p(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function y(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==l.call(t)}(t))return NaN;if(p(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=p(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var c=o.test(t);return c||i.test(t)?u(t.slice(2),c?2:8):r.test(t)?NaN:+t}t.exports=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return p(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),v(t,e,{leading:r,maxWait:e,trailing:o})}}).call(this,n(2))},function(t,e,n){"use strict";(function(t){var n=function(){if("undefined"!=typeof Map)return Map;function t(t,e){var n=-1;return t.some((function(t,r){return t[0]===e&&(n=r,!0)})),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(e){var n=t(this.__entries__,e),r=this.__entries__[n];return r&&r[1]},e.prototype.set=function(e,n){var r=t(this.__entries__,e);~r?this.__entries__[r][1]=n:this.__entries__.push([e,n])},e.prototype.delete=function(e){var n=this.__entries__,r=t(n,e);~r&&n.splice(r,1)},e.prototype.has=function(e){return!!~t(this.__entries__,e)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(t,e){void 0===e&&(e=null);for(var n=0,r=this.__entries__;n<r.length;n++){var o=r[n];t.call(e,o[1],o[0])}},e}()}(),r="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,o=void 0!==t&&t.Math===Math?t:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),i="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(o):function(t){return setTimeout((function(){return t(Date.now())}),1e3/60)};var u=["top","right","bottom","left","width","height","size","weight"],c="undefined"!=typeof MutationObserver,a=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(t,e){var n=!1,r=!1,o=0;function u(){n&&(n=!1,t()),r&&a()}function c(){i(u)}function a(){var t=Date.now();if(n){if(t-o<2)return;r=!0}else n=!0,r=!1,setTimeout(c,e);o=t}return a}(this.refresh.bind(this),20)}return t.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},t.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},t.prototype.updateObservers_=function(){var t=this.observers_.filter((function(t){return t.gatherActive(),t.hasActive()}));return t.forEach((function(t){return t.broadcastActive()})),t.length>0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e;u.some((function(t){return!!~n.indexOf(t)}))&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),f=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var o=r[n];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},l=function(t){return t&&t.ownerDocument&&t.ownerDocument.defaultView||o},s=b(0,0,0,0);function d(t){return parseFloat(t)||0}function h(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce((function(e,n){return e+d(t["border-"+n+"-width"])}),0)}function v(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return s;var r=l(t).getComputedStyle(t),o=function(t){for(var e={},n=0,r=["top","right","bottom","left"];n<r.length;n++){var o=r[n],i=t["padding-"+o];e[o]=d(i)}return e}(r),i=o.left+o.right,u=o.top+o.bottom,c=d(r.width),a=d(r.height);if("border-box"===r.boxSizing&&(Math.round(c+i)!==e&&(c-=h(r,"left","right")+i),Math.round(a+u)!==n&&(a-=h(r,"top","bottom")+u)),!function(t){return t===l(t).document.documentElement}(t)){var f=Math.round(c+i)-e,v=Math.round(a+u)-n;1!==Math.abs(f)&&(c-=f),1!==Math.abs(v)&&(a-=v)}return b(o.left,o.top,c,a)}var p="undefined"!=typeof SVGGraphicsElement?function(t){return t instanceof l(t).SVGGraphicsElement}:function(t){return t instanceof l(t).SVGElement&&"function"==typeof t.getBBox};function y(t){return r?p(t)?function(t){var e=t.getBBox();return b(0,0,e.width,e.height)}(t):v(t):s}function b(t,e,n,r){return{x:t,y:e,width:n,height:r}}var m=function(){function t(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=b(0,0,0,0),this.target=t}return t.prototype.isActive=function(){var t=y(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},t}(),g=function(t,e){var n,r,o,i,u,c,a,l=(r=(n=e).x,o=n.y,i=n.width,u=n.height,c="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,a=Object.create(c.prototype),f(a,{x:r,y:o,width:i,height:u,top:o,right:r+i,bottom:u+o,left:r}),a);f(this,{target:t,contentRect:l})},O=function(){function t(t,e,r){if(this.activeObservations_=[],this.observations_=new n,"function"!=typeof t)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=r}return t.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof l(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new m(t)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(t instanceof l(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)&&(e.delete(t),e.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach((function(e){e.isActive()&&t.activeObservations_.push(e)}))},t.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map((function(t){return new g(t.target,t.broadcastRect())}));this.callback_.call(t,e,t),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),w="undefined"!=typeof WeakMap?new WeakMap:new n,j=function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=a.getInstance(),r=new O(e,n,this);w.set(this,r)};["observe","unobserve","disconnect"].forEach((function(t){j.prototype[t]=function(){var e;return(e=w.get(this))[t].apply(e,arguments)}}));var S=void 0!==o.ResizeObserver?o.ResizeObserver:j;e.a=S}).call(this,n(2))},function(t,e,n){(function(e){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt,c="object"==typeof e&&e&&e.Object===Object&&e,a="object"==typeof self&&self&&self.Object===Object&&self,f=c||a||Function("return this")(),l=Object.prototype.toString,s=Math.max,d=Math.min,h=function(){return f.Date.now()};function v(t,e,n){var r,o,i,u,c,a,f=0,l=!1,v=!1,b=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(e){var n=r,i=o;return r=o=void 0,f=e,u=t.apply(i,n)}function g(t){return f=t,c=setTimeout(w,e),l?m(t):u}function O(t){var n=t-a;return void 0===a||n>=e||n<0||v&&t-f>=i}function w(){var t=h();if(O(t))return j(t);c=setTimeout(w,function(t){var n=e-(t-a);return v?d(n,i-(t-f)):n}(t))}function j(t){return c=void 0,b&&r?m(t):(r=o=void 0,u)}function S(){var t=h(),n=O(t);if(r=arguments,o=this,a=t,n){if(void 0===c)return g(a);if(v)return c=setTimeout(w,e),m(a)}return void 0===c&&(c=setTimeout(w,e)),u}return e=y(e)||0,p(n)&&(l=!!n.leading,i=(v="maxWait"in n)?s(y(n.maxWait)||0,e):i,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==c&&clearTimeout(c),f=0,r=a=o=c=void 0},S.flush=function(){return void 0===c?u:j(h())},S}function p(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function y(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==l.call(t)}(t))return NaN;if(p(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=p(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var c=o.test(t);return c||i.test(t)?u(t.slice(2),c?2:8):r.test(t)?NaN:+t}t.exports=function(t,e,n){var r=!0,o=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return p(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),v(t,e,{leading:r,maxWait:e,trailing:o})}}).call(this,n(2))},function(t,e,n){(function(e){var n=/^\s+|\s+$/g,r=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,i=/^0o[0-7]+$/i,u=parseInt,c="object"==typeof e&&e&&e.Object===Object&&e,a="object"==typeof self&&self&&self.Object===Object&&self,f=c||a||Function("return this")(),l=Object.prototype.toString,s=Math.max,d=Math.min,h=function(){return f.Date.now()};function v(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function p(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return!!t&&"object"==typeof t}(t)&&"[object Symbol]"==l.call(t)}(t))return NaN;if(v(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=v(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(n,"");var c=o.test(t);return c||i.test(t)?u(t.slice(2),c?2:8):r.test(t)?NaN:+t}t.exports=function(t,e,n){var r,o,i,u,c,a,f=0,l=!1,y=!1,b=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function m(e){var n=r,i=o;return r=o=void 0,f=e,u=t.apply(i,n)}function g(t){return f=t,c=setTimeout(w,e),l?m(t):u}function O(t){var n=t-a;return void 0===a||n>=e||n<0||y&&t-f>=i}function w(){var t=h();if(O(t))return j(t);c=setTimeout(w,function(t){var n=e-(t-a);return y?d(n,i-(t-f)):n}(t))}function j(t){return c=void 0,b&&r?m(t):(r=o=void 0,u)}function S(){var t=h(),n=O(t);if(r=arguments,o=this,a=t,n){if(void 0===c)return g(a);if(y)return c=setTimeout(w,e),m(a)}return void 0===c&&(c=setTimeout(w,e)),u}return e=p(e)||0,v(n)&&(l=!!n.leading,i=(y="maxWait"in n)?s(p(n.maxWait)||0,e):i,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==c&&clearTimeout(c),f=0,r=a=o=c=void 0},S.flush=function(){return void 0===c?u:j(h())},S}}).call(this,n(2))},function(t,e,n){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",r="second",o="minute",i="hour",u="day",c="week",a="month",f="quarter",l="year",s="date",d="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,v=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,p={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},y=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},b={s:y,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),o=n%60;return(e<=0?"+":"-")+y(r,2,"0")+":"+y(o,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),o=e.clone().add(r,a),i=n-o<0,u=e.clone().add(r+(i?-1:1),a);return+(-(r+(n-o)/(i?o-u:u-o))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:a,y:l,w:c,d:u,D:s,h:i,m:o,s:r,ms:n,Q:f}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},m="en",g={};g[m]=p;var O=function(t){return t instanceof E},w=function(t,e,n){var r;if(!t)return m;if("string"==typeof t)g[t]&&(r=t),e&&(g[t]=e,r=t);else{var o=t.name;g[o]=t,r=o}return!n&&r&&(m=r),r||!n&&m},j=function(t,e){if(O(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new E(n)},S=b;S.l=w,S.i=O,S.w=function(t,e){return j(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var E=function(){function p(t){this.$L=w(t.locale,null,!0),this.parse(t)}var y=p.prototype;return y.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(S.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(h);if(r){var o=r[2]-1||0,i=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)):new Date(r[1],o,r[3]||1,r[4]||0,r[5]||0,r[6]||0,i)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},y.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},y.$utils=function(){return S},y.isValid=function(){return!(this.$d.toString()===d)},y.isSame=function(t,e){var n=j(t);return this.startOf(e)<=n&&n<=this.endOf(e)},y.isAfter=function(t,e){return j(t)<this.startOf(e)},y.isBefore=function(t,e){return this.endOf(e)<j(t)},y.$g=function(t,e,n){return S.u(t)?this[e]:this.set(n,t)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(t,e){var n=this,f=!!S.u(e)||e,d=S.p(t),h=function(t,e){var r=S.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return f?r:r.endOf(u)},v=function(t,e){return S.w(n.toDate()[t].apply(n.toDate("s"),(f?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},p=this.$W,y=this.$M,b=this.$D,m="set"+(this.$u?"UTC":"");switch(d){case l:return f?h(1,0):h(31,11);case a:return f?h(1,y):h(0,y+1);case c:var g=this.$locale().weekStart||0,O=(p<g?p+7:p)-g;return h(f?b-O:b+(6-O),y);case u:case s:return v(m+"Hours",0);case i:return v(m+"Minutes",1);case o:return v(m+"Seconds",2);case r:return v(m+"Milliseconds",3);default:return this.clone()}},y.endOf=function(t){return this.startOf(t,!1)},y.$set=function(t,e){var c,f=S.p(t),d="set"+(this.$u?"UTC":""),h=(c={},c[u]=d+"Date",c[s]=d+"Date",c[a]=d+"Month",c[l]=d+"FullYear",c[i]=d+"Hours",c[o]=d+"Minutes",c[r]=d+"Seconds",c[n]=d+"Milliseconds",c)[f],v=f===u?this.$D+(e-this.$W):e;if(f===a||f===l){var p=this.clone().set(s,1);p.$d[h](v),p.init(),this.$d=p.set(s,Math.min(this.$D,p.daysInMonth())).$d}else h&&this.$d[h](v);return this.init(),this},y.set=function(t,e){return this.clone().$set(t,e)},y.get=function(t){return this[S.p(t)]()},y.add=function(n,f){var s,d=this;n=Number(n);var h=S.p(f),v=function(t){var e=j(d);return S.w(e.date(e.date()+Math.round(t*n)),d)};if(h===a)return this.set(a,this.$M+n);if(h===l)return this.set(l,this.$y+n);if(h===u)return v(1);if(h===c)return v(7);var p=(s={},s[o]=t,s[i]=e,s[r]=1e3,s)[h]||1,y=this.$d.getTime()+n*p;return S.w(y,this)},y.subtract=function(t,e){return this.add(-1*t,e)},y.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||d;var r=t||"YYYY-MM-DDTHH:mm:ssZ",o=S.z(this),i=this.$H,u=this.$m,c=this.$M,a=n.weekdays,f=n.months,l=function(t,n,o,i){return t&&(t[n]||t(e,r))||o[n].substr(0,i)},s=function(t){return S.s(i%12||12,t,"0")},h=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:c+1,MM:S.s(c+1,2,"0"),MMM:l(n.monthsShort,c,f,3),MMMM:l(f,c),D:this.$D,DD:S.s(this.$D,2,"0"),d:String(this.$W),dd:l(n.weekdaysMin,this.$W,a,2),ddd:l(n.weekdaysShort,this.$W,a,3),dddd:a[this.$W],H:String(i),HH:S.s(i,2,"0"),h:s(1),hh:s(2),a:h(i,u,!0),A:h(i,u,!1),m:String(u),mm:S.s(u,2,"0"),s:String(this.$s),ss:S.s(this.$s,2,"0"),SSS:S.s(this.$ms,3,"0"),Z:o};return r.replace(v,(function(t,e){return e||p[t]||o.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,s,d){var h,v=S.p(s),p=j(n),y=(p.utcOffset()-this.utcOffset())*t,b=this-p,m=S.m(this,p);return m=(h={},h[l]=m/12,h[a]=m,h[f]=m/3,h[c]=(b-y)/6048e5,h[u]=(b-y)/864e5,h[i]=b/e,h[o]=b/t,h[r]=b/1e3,h)[v]||b,d?m:S.a(m)},y.daysInMonth=function(){return this.endOf(a).$D},y.$locale=function(){return g[this.$L]},y.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=w(t,e,!0);return r&&(n.$L=r),n},y.clone=function(){return S.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},p}(),_=E.prototype;return j.prototype=_,[["$ms",n],["$s",r],["$m",o],["$H",i],["$W",u],["$M",a],["$y",l],["$D",s]].forEach((function(t){_[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),j.extend=function(t,e){return t.$i||(t(e,E,j),t.$i=!0),j},j.locale=w,j.isDayjs=O,j.unix=function(t){return j(1e3*t)},j.en=g[m],j.Ls=g,j.p={},j}()},function(t,e){!function(){"use strict";if("object"==typeof window)if("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype)"isIntersecting"in window.IntersectionObserverEntry.prototype||Object.defineProperty(window.IntersectionObserverEntry.prototype,"isIntersecting",{get:function(){return this.intersectionRatio>0}});else{var t=window.document,e=[];r.prototype.THROTTLE_TIMEOUT=100,r.prototype.POLL_INTERVAL=null,r.prototype.USE_MUTATION_OBSERVER=!0,r.prototype.observe=function(t){if(!this._observationTargets.some((function(e){return e.element==t}))){if(!t||1!=t.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:t,entry:null}),this._monitorIntersections(),this._checkForIntersections()}},r.prototype.unobserve=function(t){this._observationTargets=this._observationTargets.filter((function(e){return e.element!=t})),this._observationTargets.length||(this._unmonitorIntersections(),this._unregisterInstance())},r.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorIntersections(),this._unregisterInstance()},r.prototype.takeRecords=function(){var t=this._queuedEntries.slice();return this._queuedEntries=[],t},r.prototype._initThresholds=function(t){var e=t||[0];return Array.isArray(e)||(e=[e]),e.sort().filter((function(t,e,n){if("number"!=typeof t||isNaN(t)||t<0||t>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return t!==n[e-1]}))},r.prototype._parseRootMargin=function(t){var e=(t||"0px").split(/\s+/).map((function(t){var e=/^(-?\d*\.?\d+)(px|%)$/.exec(t);if(!e)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(e[1]),unit:e[2]}}));return e[1]=e[1]||e[0],e[2]=e[2]||e[0],e[3]=e[3]||e[1],e},r.prototype._monitorIntersections=function(){this._monitoringIntersections||(this._monitoringIntersections=!0,this.POLL_INTERVAL?this._monitoringInterval=setInterval(this._checkForIntersections,this.POLL_INTERVAL):(o(window,"resize",this._checkForIntersections,!0),o(t,"scroll",this._checkForIntersections,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in window&&(this._domObserver=new MutationObserver(this._checkForIntersections),this._domObserver.observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0}))))},r.prototype._unmonitorIntersections=function(){this._monitoringIntersections&&(this._monitoringIntersections=!1,clearInterval(this._monitoringInterval),this._monitoringInterval=null,i(window,"resize",this._checkForIntersections,!0),i(t,"scroll",this._checkForIntersections,!0),this._domObserver&&(this._domObserver.disconnect(),this._domObserver=null))},r.prototype._checkForIntersections=function(){var t=this._rootIsInDom(),e=t?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(r){var o=r.element,i=u(o),c=this._rootContainsTarget(o),a=r.entry,f=t&&c&&this._computeTargetAndRootIntersection(o,e),l=r.entry=new n({time:window.performance&&performance.now&&performance.now(),target:o,boundingClientRect:i,rootBounds:e,intersectionRect:f});a?t&&c?this._hasCrossedThreshold(a,l)&&this._queuedEntries.push(l):a&&a.isIntersecting&&this._queuedEntries.push(l):this._queuedEntries.push(l)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)},r.prototype._computeTargetAndRootIntersection=function(e,n){if("none"!=window.getComputedStyle(e).display){for(var r,o,i,c,f,l,s,d,h=u(e),v=a(e),p=!1;!p;){var y=null,b=1==v.nodeType?window.getComputedStyle(v):{};if("none"==b.display)return;if(v==this.root||v==t?(p=!0,y=n):v!=t.body&&v!=t.documentElement&&"visible"!=b.overflow&&(y=u(v)),y&&(r=y,o=h,i=void 0,c=void 0,f=void 0,l=void 0,s=void 0,d=void 0,i=Math.max(r.top,o.top),c=Math.min(r.bottom,o.bottom),f=Math.max(r.left,o.left),l=Math.min(r.right,o.right),d=c-i,!(h=(s=l-f)>=0&&d>=0&&{top:i,bottom:c,left:f,right:l,width:s,height:d})))break;v=a(v)}return h}},r.prototype._getRootRect=function(){var e;if(this.root)e=u(this.root);else{var n=t.documentElement,r=t.body;e={top:0,left:0,right:n.clientWidth||r.clientWidth,width:n.clientWidth||r.clientWidth,bottom:n.clientHeight||r.clientHeight,height:n.clientHeight||r.clientHeight}}return this._expandRectByRootMargin(e)},r.prototype._expandRectByRootMargin=function(t){var e=this._rootMarginValues.map((function(e,n){return"px"==e.unit?e.value:e.value*(n%2?t.width:t.height)/100})),n={top:t.top-e[0],right:t.right+e[1],bottom:t.bottom+e[2],left:t.left-e[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},r.prototype._hasCrossedThreshold=function(t,e){var n=t&&t.isIntersecting?t.intersectionRatio||0:-1,r=e.isIntersecting?e.intersectionRatio||0:-1;if(n!==r)for(var o=0;o<this.thresholds.length;o++){var i=this.thresholds[o];if(i==n||i==r||i<n!=i<r)return!0}},r.prototype._rootIsInDom=function(){return!this.root||c(t,this.root)},r.prototype._rootContainsTarget=function(e){return c(this.root||t,e)},r.prototype._registerInstance=function(){e.indexOf(this)<0&&e.push(this)},r.prototype._unregisterInstance=function(){var t=e.indexOf(this);-1!=t&&e.splice(t,1)},window.IntersectionObserver=r,window.IntersectionObserverEntry=n}function n(t){this.time=t.time,this.target=t.target,this.rootBounds=t.rootBounds,this.boundingClientRect=t.boundingClientRect,this.intersectionRect=t.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0},this.isIntersecting=!!t.intersectionRect;var e=this.boundingClientRect,n=e.width*e.height,r=this.intersectionRect,o=r.width*r.height;this.intersectionRatio=n?Number((o/n).toFixed(4)):this.isIntersecting?1:0}function r(t,e){var n,r,o,i=e||{};if("function"!=typeof t)throw new Error("callback must be a function");if(i.root&&1!=i.root.nodeType)throw new Error("root must be an Element");this._checkForIntersections=(n=this._checkForIntersections.bind(this),r=this.THROTTLE_TIMEOUT,o=null,function(){o||(o=setTimeout((function(){n(),o=null}),r))}),this._callback=t,this._observationTargets=[],this._queuedEntries=[],this._rootMarginValues=this._parseRootMargin(i.rootMargin),this.thresholds=this._initThresholds(i.threshold),this.root=i.root||null,this.rootMargin=this._rootMarginValues.map((function(t){return t.value+t.unit})).join(" ")}function o(t,e,n,r){"function"==typeof t.addEventListener?t.addEventListener(e,n,r||!1):"function"==typeof t.attachEvent&&t.attachEvent("on"+e,n)}function i(t,e,n,r){"function"==typeof t.removeEventListener?t.removeEventListener(e,n,r||!1):"function"==typeof t.detatchEvent&&t.detatchEvent("on"+e,n)}function u(t){var e;try{e=t.getBoundingClientRect()}catch(t){}return e?(e.width&&e.height||(e={top:e.top,right:e.right,bottom:e.bottom,left:e.left,width:e.right-e.left,height:e.bottom-e.top}),e):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function c(t,e){for(var n=e;n;){if(n==t)return!0;n=a(n)}return!1}function a(t){var e=t.parentNode;return e&&11==e.nodeType&&e.host?e.host:e&&e.assignedSlot?e.assignedSlot.parentNode:e}}()},function(t,e,n){"use strict";n.r(e),n.d(e,"useControlledValue",(function(){return cr})),n.d(e,"useControllableValue",(function(){return Z})),n.d(e,"useDynamicList",(function(){return et})),n.d(e,"useVirtualList",(function(){return yt})),n.d(e,"useResponsive",(function(){return _t})),n.d(e,"useEventEmitter",(function(){return ot})),n.d(e,"useLocalStorageState",(function(){return Mt})),n.d(e,"useSessionStorageState",(function(){return Rt})),n.d(e,"useSize",(function(){return vt})),n.d(e,"configResponsive",(function(){return Et})),n.d(e,"useUpdateEffect",(function(){return J})),n.d(e,"useUpdateLayoutEffect",(function(){return Ct})),n.d(e,"useBoolean",(function(){return $t})),n.d(e,"useToggle",(function(){return It})),n.d(e,"useDocumentVisibility",(function(){return At})),n.d(e,"useSelections",(function(){return Vt})),n.d(e,"useThrottle",(function(){return Gt})),n.d(e,"useThrottleFn",(function(){return Kt})),n.d(e,"useThrottleEffect",(function(){return Zt})),n.d(e,"useDebounce",(function(){return ie})),n.d(e,"useDebounceFn",(function(){return re})),n.d(e,"useDebounceEffect",(function(){return hn})),n.d(e,"usePrevious",(function(){return ue})),n.d(e,"useMouse",(function(){return fe})),n.d(e,"useScroll",(function(){return se})),n.d(e,"useClickAway",(function(){return de})),n.d(e,"useFullscreen",(function(){return ye})),n.d(e,"useInViewport",(function(){return ge})),n.d(e,"useKeyPress",(function(){return ke})),n.d(e,"useEventListener",(function(){return Lt})),n.d(e,"useHover",(function(){return Re})),n.d(e,"useRequest",(function(){return K})),n.d(e,"UseRequestProvider",(function(){return B})),n.d(e,"useAntdTable",(function(){return $e})),n.d(e,"useUnmount",(function(){return ft})),n.d(e,"useSet",(function(){return ze})),n.d(e,"usePersistFn",(function(){return ct})),n.d(e,"useMap",(function(){return Ue})),n.d(e,"useCreation",(function(){return qt})),n.d(e,"useDrag",(function(){return Be})),n.d(e,"useDrop",(function(){return Ye})),n.d(e,"useMount",(function(){return Ke})),n.d(e,"useCounter",(function(){return nn})),n.d(e,"useUpdate",(function(){return on})),n.d(e,"useTextSelection",(function(){return Qe})),n.d(e,"useEventTarget",(function(){return cn})),n.d(e,"useHistoryTravel",(function(){return sn})),n.d(e,"useFusionTable",(function(){return Ne})),n.d(e,"useCookieState",(function(){return gn})),n.d(e,"useSetState",(function(){return jn})),n.d(e,"useInterval",(function(){return Sn})),n.d(e,"useWhyDidYouUpdate",(function(){return _n})),n.d(e,"useTitle",(function(){return Tn})),n.d(e,"useNetwork",(function(){return Dn})),n.d(e,"useTimeout",(function(){return In})),n.d(e,"useReactive",(function(){return Nn})),n.d(e,"useFavicon",(function(){return Wn})),n.d(e,"useCountDown",(function(){return qn})),n.d(e,"useTrackedEffect",(function(){return Qn})),n.d(e,"useWebSocket",(function(){return Bn})),n.d(e,"useLockFn",(function(){return Zn})),n.d(e,"useUnmountedRef",(function(){return tr})),n.d(e,"useExternal",(function(){return nr})),n.d(e,"useSafeState",(function(){return or}));var r=n(0),o=n.n(r),i=n(4),u=n.n(i),c=n(5),a=n.n(c);function f(){return"undefined"==typeof document||void 0===document.visibilityState||"hidden"!==document.visibilityState}var l=new Map,s=function(t){var e=l.get(t);return{data:null==e?void 0:e.data,startTime:null==e?void 0:e.startTime}},d=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u},h=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(d(arguments[e]));return t};var v=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u},p=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(v(arguments[e]));return t};var y=function(t){var e=Object(r.useRef)((function(){throw new Error("Cannot call an event handler while rendering.")}));e.current=t;var n=Object(r.useCallback)((function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=e.current;if(r)return r.apply(void 0,p(t))}),[e]);if("function"==typeof t)return n},b=function(t,e){var n=Object(r.useRef)(!1);Object(r.useEffect)((function(){return function(){n.current=!1}}),[]),Object(r.useEffect)((function(){if(n.current)return t();n.current=!0}),e)},m=[];var g=!1;if("undefined"!=typeof window&&window.addEventListener&&!g){var O=function(){if(f()&&(void 0===navigator.onLine||navigator.onLine))for(var t=0;t<m.length;t++){(0,m[t])()}};window.addEventListener("visibilitychange",O,!1),window.addEventListener("focus",O,!1),g=!0}var w=function(t){return m.push(t),function(){var e=m.indexOf(t);m.splice(e,1)}},j=[];var S=!1;if("undefined"!=typeof window&&window.addEventListener&&!S){window.addEventListener("visibilitychange",(function(){if(f())for(var t=0;t<j.length;t++){(0,j[t])()}}),!1),S=!0}var E=function(t){return j.push(t),function(){var e=j.indexOf(t);j.splice(e,1)}},_=function(){return(_=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},x=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u},T=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(x(arguments[e]));return t},k="AHOOKS_USE_REQUEST_DEFAULT_KEY",M=function(){function t(t,e,n,r){var o,i,c;this.count=0,this.pollingWhenVisibleFlag=!1,this.pollingTimer=void 0,this.loadingDelayTimer=void 0,this.unsubscribe=[],this.that=this,this.state={loading:!1,params:[],data:void 0,error:void 0,run:this.run.bind(this.that),mutate:this.mutate.bind(this.that),refresh:this.refresh.bind(this.that),cancel:this.cancel.bind(this.that),unmount:this.unmount.bind(this.that)},this.service=t,this.config=e,this.subscribe=n,r&&(this.state=_(_({},this.state),r)),this.debounceRun=this.config.debounceInterval?u()(this._run,this.config.debounceInterval):void 0,this.throttleRun=this.config.throttleInterval?a()(this._run,this.config.throttleInterval):void 0,this.limitRefresh=(o=this.refresh.bind(this),i=this.config.focusTimespan,c=!1,function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];c||(c=!0,o.apply(void 0,h(t)),setTimeout((function(){c=!1}),i))}),this.config.pollingInterval&&this.unsubscribe.push(E(this.rePolling.bind(this))),this.config.refreshOnWindowFocus&&this.unsubscribe.push(w(this.limitRefresh.bind(this)))}return t.prototype.setState=function(t){void 0===t&&(t={}),this.state=_(_({},this.state),t),this.subscribe(this.state)},t.prototype._run=function(){for(var t=this,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];this.pollingTimer&&clearTimeout(this.pollingTimer),this.loadingDelayTimer&&clearTimeout(this.loadingDelayTimer),this.count+=1;var r=this.count;return this.setState({loading:!this.config.loadingDelay,params:e}),this.config.loadingDelay&&(this.loadingDelayTimer=setTimeout((function(){t.setState({loading:!0})}),this.config.loadingDelay)),this.service.apply(this,T(e)).then((function(n){if(r!==t.count)return new Promise((function(){}));t.loadingDelayTimer&&clearTimeout(t.loadingDelayTimer);var o=t.config.formatResult?t.config.formatResult(n):n;return t.setState({data:o,error:void 0,loading:!1}),t.config.onSuccess&&t.config.onSuccess(o,e),o})).catch((function(n){if(r!==t.count)return new Promise((function(){}));if(t.loadingDelayTimer&&clearTimeout(t.loadingDelayTimer),t.setState({data:void 0,error:n,loading:!1}),t.config.onError&&t.config.onError(n,e),t.config.throwOnError)throw n;return console.error(n),Promise.reject("useRequest has caught the exception, if you need to handle the exception yourself, you can set options.throwOnError to true.")})).finally((function(){if(r===t.count&&t.config.pollingInterval){if(!f()&&!t.config.pollingWhenHidden)return void(t.pollingWhenVisibleFlag=!0);t.pollingTimer=setTimeout((function(){t._run.apply(t,T(e))}),t.config.pollingInterval)}}))},t.prototype.run=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.debounceRun?(this.debounceRun.apply(this,T(t)),Promise.resolve(null)):this.throttleRun?(this.throttleRun.apply(this,T(t)),Promise.resolve(null)):this._run.apply(this,T(t))},t.prototype.cancel=function(){this.debounceRun&&this.debounceRun.cancel(),this.throttleRun&&this.throttleRun.cancel(),this.loadingDelayTimer&&clearTimeout(this.loadingDelayTimer),this.pollingTimer&&clearTimeout(this.pollingTimer),this.pollingWhenVisibleFlag=!1,this.count+=1,this.setState({loading:!1})},t.prototype.refresh=function(){return this.run.apply(this,T(this.state.params))},t.prototype.rePolling=function(){this.pollingWhenVisibleFlag&&(this.pollingWhenVisibleFlag=!1,this.refresh())},t.prototype.mutate=function(t){"function"==typeof t?this.setState({data:t(this.state.data)||{}}):this.setState({data:t})},t.prototype.unmount=function(){this.cancel(),this.unsubscribe.forEach((function(t){t()}))},t}();var R=function(t,e){var n,o=e||{},i=o.refreshDeps,u=void 0===i?[]:i,c=o.manual,a=void 0!==c&&c,f=o.onSuccess,d=void 0===f?function(){}:f,h=o.onError,v=void 0===h?function(){}:h,p=o.defaultLoading,m=void 0!==p&&p,g=o.loadingDelay,O=o.pollingInterval,w=void 0===O?0:O,j=o.pollingWhenHidden,S=void 0===j||j,E=o.defaultParams,R=void 0===E?[]:E,C=o.refreshOnWindowFocus,D=void 0!==C&&C,I=o.focusTimespan,F=void 0===I?5e3:I,$=o.fetchKey,L=o.cacheKey,P=o.cacheTime,N=void 0===P?3e5:P,A=o.staleTime,W=void 0===A?0:A,z=o.debounceInterval,V=o.throttleInterval,H=o.initialData,U=o.ready,q=void 0===U||U,Y=o.throwOnError,B=void 0!==Y&&Y,K=Object(r.useRef)(k),J=y(t),G=y(d),X=y(v),Z=y($);"formatResult"in o&&(n=o.formatResult);var Q={formatResult:y(n),onSuccess:G,onError:X,loadingDelay:g,pollingInterval:w,pollingWhenHidden:S,refreshOnWindowFocus:!a&&D,focusTimespan:F,debounceInterval:z,throttleInterval:V,throwOnError:B},tt=y((function(t,e){rt((function(n){return n[t]=e,_({},n)}))})),et=x(Object(r.useState)((function(){var t;if(L){var e=null===(t=s(L))||void 0===t?void 0:t.data;if(e){K.current=e.newstFetchKey;var n={};return Object.keys(e.fetches).forEach((function(t){var r=e.fetches[t],o=new M(J,Q,tt.bind(null,t),{loading:r.loading,params:r.params,data:r.data,error:r.error});n[t]=o.state})),n}}return{}})),2),nt=et[0],rt=et[1],ot=Object(r.useRef)(nt);ot.current=nt;var it=Object(r.useRef)(),ut=Object(r.useCallback)((function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(q){if(Z){var n=Z.apply(void 0,T(t));K.current=void 0===n?k:n}var r=K.current,o=ot.current[r];if(!o){var i=new M(J,Q,tt.bind(null,r),{data:H});o=i.state,rt((function(t){return t[r]=o,_({},t)}))}return o.run.apply(o,T(t))}it.current=t}),[$,tt,q]),ct=Object(r.useRef)(ut);ct.current=ut,b((function(){L&&function(t,e,n){var r=l.get(t);(null==r?void 0:r.timer)&&clearTimeout(r.timer);var o=void 0;e>-1&&(o=setTimeout((function(){l.delete(t)}),e)),l.set(t,{data:n,timer:o,startTime:(new Date).getTime()})}(L,N,{fetches:nt,newstFetchKey:K.current})}),[L,nt]);var at=Object(r.useRef)(!1);b((function(){q&&(!at.current&&it.current&&ct.current.apply(ct,T(it.current)),at.current=!0)}),[q]),Object(r.useEffect)((function(){var t;if(!a)if(Object.keys(nt).length>0){var e=L&&(null===(t=s(L))||void 0===t?void 0:t.startTime)||0;-1===W||(new Date).getTime()-e<=W||Object.values(nt).forEach((function(t){t.refresh()}))}else ct.current.apply(ct,T(R))}),[]);var ft=Object(r.useCallback)((function(){Object.values(ot.current).forEach((function(t){t.unmount()})),K.current=k,rt({}),ot.current={}}),[rt]);b((function(){a||Object.values(ot.current).forEach((function(t){t.refresh()}))}),T(u)),Object(r.useEffect)((function(){return function(){Object.values(ot.current).forEach((function(t){t.unmount()}))}}),[]);var lt=Object(r.useCallback)((function(t){return function(){console.warn("You should't call "+t+" when service not executed once.")}}),[]);return _(_({loading:q&&!a||m,data:H,error:void 0,params:[],cancel:lt("cancel"),refresh:lt("refresh"),mutate:lt("mutate")},nt[K.current]||{}),{run:ut,fetches:nt,reset:ft})},C=function(){return(C=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},D=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},I=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u},F=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(I(arguments[e]));return t};var $=function(t,e){var n=e.refreshDeps,o=void 0===n?[]:n,i=e.ref,u=e.isNoMore,c=e.threshold,a=void 0===c?100:c,f=(e.fetchKey,D(e,["refreshDeps","ref","isNoMore","threshold","fetchKey"])),l=I(Object(r.useState)(!1),2),s=l[0],d=l[1];Object(r.useEffect)((function(){e.fetchKey&&console.warn("useRequest loadMore mode don't need fetchKey!")}),[]);var h=R(t,C(C({},f),{fetchKey:function(t){var e;return(null===(e=null==t?void 0:t.list)||void 0===e?void 0:e.length)||0},onSuccess:function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];d(!1),e.onSuccess&&e.onSuccess.apply(e,F(t))}})),v=h.data,p=h.run,y=h.params,m=h.reset,g=h.loading,O=h.fetches,w=Object(r.useCallback)((function(){m();var t=I(y).slice(1);p.apply(void 0,F([void 0],t))}),[p,m,y]),j=Object(r.useRef)(w);j.current=w,b((function(){e.manual||j.current()}),F(o));var S=Object(r.useMemo)((function(){var t=[],e=v;return Object.values(O).forEach((function(n){var r,o;(null===(r=n.data)||void 0===r?void 0:r.list)&&(t=t.concat(null===(o=n.data)||void 0===o?void 0:o.list)),n.loading||(e=n.data)})),C(C({},e),{list:t})}),[O,v]),E=!!u&&(!g&&!s&&u(S)),_=Object(r.useCallback)((function(){if(!E){d(!0);var t=I(y).slice(1);p.apply(void 0,F([S],t))}}),[E,p,S,y]),x=function(){!g&&!s&&i&&i.current&&i.current.scrollHeight-i.current.scrollTop<=i.current.clientHeight+a&&_()},T=Object(r.useRef)(x);return T.current=x,Object(r.useEffect)((function(){if(!i||!i.current)return function(){};var t=function(){return T.current()};return i.current.addEventListener("scroll",t),function(){i&&i.current&&i.current.removeEventListener("scroll",t)}}),[T]),C(C({},h),{data:S,reload:w,loading:g&&0===S.list.length,loadMore:_,loadingMore:s,noMore:E})},L=function(){return(L=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var o in e=arguments[n])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)},P=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)e.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(t,r[o])&&(n[r[o]]=t[r[o]])}return n},N=function(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,o,i=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u},A=function(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(N(arguments[e]));return t};var W=function(t,e){e.paginated;var n=e.defaultPageSize,o=void 0===n?10:n,i=e.refreshDeps,u=void 0===i?[]:i,c=e.fetchKey,a=P(e,["paginated","defaultPageSize","refreshDeps","fetchKey"]);Object(r.useEffect)((function(){c&&console.error("useRequest pagination's fetchKey will not work!")}),[]);var f=R(t,L({defaultParams:[{current:1,pageSize:o}]},a)),l=f.data,s=f.params,d=f.run,h=f.loading,v=P(f,["data","params","run","loading"]),p=s&&s[0]?s[0]:{},y=p.current,m=void 0===y?1:y,g=p.pageSize,O=void 0===g?o:g,w=p.sorter,j=void 0===w?{}:w,S=p.filters,E=void 0===S?{}:S,_=Object(r.use