ahooks
Version:
react hooks library
2 lines • 94.4 kB
JavaScript
/*! For license information please see ahooks.js.LICENSE.txt */
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("React")):"function"==typeof define&&define.amd?define(["React"],t):"object"==typeof exports?exports.ahooks=t(require("React")):e.ahooks=t(e.React)}(this,(e=>(()=>{var t={431:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",o="minute",i="hour",u="day",c="week",a="month",s="quarter",l="year",f="date",d="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,h=/\[([^\]]+)]|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("_"),ordinal:function(e){var t=["th","st","nd","rd"],n=e%100;return"["+e+(t[(n-20)%10]||t[n]||t[0])+"]"}},m=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},g={s:m,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),o=n%60;return(t<=0?"+":"-")+m(r,2,"0")+":"+m(o,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),o=t.clone().add(r,a),i=n-o<0,u=t.clone().add(r+(i?-1:1),a);return+(-(r+(n-o)/(i?o-u:u-o))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:a,y:l,w:c,d:u,D:f,h:i,m:o,s:r,ms:n,Q:s}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},y="en",b={};b[y]=p;var w=function(e){return e instanceof O},E=function e(t,n,r){var o;if(!t)return y;if("string"==typeof t){var i=t.toLowerCase();b[i]&&(o=i),n&&(b[i]=n,o=i);var u=t.split("-");if(!o&&u.length>1)return e(u[0])}else{var c=t.name;b[c]=t,o=c}return!r&&o&&(y=o),o||!r&&y},S=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new O(n)},_=g;_.l=E,_.i=w,_.w=function(e,t){return S(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var O=function(){function p(e){this.$L=E(e.locale,null,!0),this.parse(e)}var m=p.prototype;return m.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(_.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(v);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(t)}(e),this.$x=e.x||{},this.init()},m.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},m.$utils=function(){return _},m.isValid=function(){return!(this.$d.toString()===d)},m.isSame=function(e,t){var n=S(e);return this.startOf(t)<=n&&n<=this.endOf(t)},m.isAfter=function(e,t){return S(e)<this.startOf(t)},m.isBefore=function(e,t){return this.endOf(t)<S(e)},m.$g=function(e,t,n){return _.u(e)?this[t]:this.set(n,e)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(e,t){var n=this,s=!!_.u(t)||t,d=_.p(e),v=function(e,t){var r=_.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return s?r:r.endOf(u)},h=function(e,t){return _.w(n.toDate()[e].apply(n.toDate("s"),(s?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},p=this.$W,m=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(d){case l:return s?v(1,0):v(31,11);case a:return s?v(1,m):v(0,m+1);case c:var b=this.$locale().weekStart||0,w=(p<b?p+7:p)-b;return v(s?g-w:g+(6-w),m);case u:case f:return h(y+"Hours",0);case i:return h(y+"Minutes",1);case o:return h(y+"Seconds",2);case r:return h(y+"Milliseconds",3);default:return this.clone()}},m.endOf=function(e){return this.startOf(e,!1)},m.$set=function(e,t){var c,s=_.p(e),d="set"+(this.$u?"UTC":""),v=(c={},c[u]=d+"Date",c[f]=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)[s],h=s===u?this.$D+(t-this.$W):t;if(s===a||s===l){var p=this.clone().set(f,1);p.$d[v](h),p.init(),this.$d=p.set(f,Math.min(this.$D,p.daysInMonth())).$d}else v&&this.$d[v](h);return this.init(),this},m.set=function(e,t){return this.clone().$set(e,t)},m.get=function(e){return this[_.p(e)]()},m.add=function(n,s){var f,d=this;n=Number(n);var v=_.p(s),h=function(e){var t=S(d);return _.w(t.date(t.date()+Math.round(e*n)),d)};if(v===a)return this.set(a,this.$M+n);if(v===l)return this.set(l,this.$y+n);if(v===u)return h(1);if(v===c)return h(7);var p=(f={},f[o]=e,f[i]=t,f[r]=1e3,f)[v]||1,m=this.$d.getTime()+n*p;return _.w(m,this)},m.subtract=function(e,t){return this.add(-1*e,t)},m.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||d;var r=e||"YYYY-MM-DDTHH:mm:ssZ",o=_.z(this),i=this.$H,u=this.$m,c=this.$M,a=n.weekdays,s=n.months,l=function(e,n,o,i){return e&&(e[n]||e(t,r))||o[n].slice(0,i)},f=function(e){return _.s(i%12||12,e,"0")},v=n.meridiem||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r},p={YY:String(this.$y).slice(-2),YYYY:this.$y,M:c+1,MM:_.s(c+1,2,"0"),MMM:l(n.monthsShort,c,s,3),MMMM:l(s,c),D:this.$D,DD:_.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(i,2,"0"),h:f(1),hh:f(2),a:v(i,u,!0),A:v(i,u,!1),m:String(u),mm:_.s(u,2,"0"),s:String(this.$s),ss:_.s(this.$s,2,"0"),SSS:_.s(this.$ms,3,"0"),Z:o};return r.replace(h,(function(e,t){return t||p[e]||o.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(n,f,d){var v,h=_.p(f),p=S(n),m=(p.utcOffset()-this.utcOffset())*e,g=this-p,y=_.m(this,p);return y=(v={},v[l]=y/12,v[a]=y,v[s]=y/3,v[c]=(g-m)/6048e5,v[u]=(g-m)/864e5,v[i]=g/t,v[o]=g/e,v[r]=g/1e3,v)[h]||g,d?y:_.a(y)},m.daysInMonth=function(){return this.endOf(a).$D},m.$locale=function(){return b[this.$L]},m.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=E(e,t,!0);return r&&(n.$L=r),n},m.clone=function(){return _.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},p}(),x=O.prototype;return S.prototype=x,[["$ms",n],["$s",r],["$m",o],["$H",i],["$W",u],["$M",a],["$y",l],["$D",f]].forEach((function(e){x[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),S.extend=function(e,t){return e.$i||(e(t,O,S),e.$i=!0),S},S.locale=E,S.isDayjs=w,S.unix=function(e){return S(1e3*e)},S.en=b[y],S.Ls=b,S.p={},S}()},735:()=>{!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 e=function(e){for(var t=window.document,n=o(t);n;)n=o(t=n.ownerDocument);return t}(),t=[],n=null,r=null;u.prototype.THROTTLE_TIMEOUT=100,u.prototype.POLL_INTERVAL=null,u.prototype.USE_MUTATION_OBSERVER=!0,u._setupCrossOriginUpdater=function(){return n||(n=function(e,n){r=e&&n?f(e,n):{top:0,bottom:0,left:0,right:0,width:0,height:0},t.forEach((function(e){e._checkForIntersections()}))}),n},u._resetCrossOriginUpdater=function(){n=null,r=null},u.prototype.observe=function(e){if(!this._observationTargets.some((function(t){return t.element==e}))){if(!e||1!=e.nodeType)throw new Error("target must be an Element");this._registerInstance(),this._observationTargets.push({element:e,entry:null}),this._monitorIntersections(e.ownerDocument),this._checkForIntersections()}},u.prototype.unobserve=function(e){this._observationTargets=this._observationTargets.filter((function(t){return t.element!=e})),this._unmonitorIntersections(e.ownerDocument),0==this._observationTargets.length&&this._unregisterInstance()},u.prototype.disconnect=function(){this._observationTargets=[],this._unmonitorAllIntersections(),this._unregisterInstance()},u.prototype.takeRecords=function(){var e=this._queuedEntries.slice();return this._queuedEntries=[],e},u.prototype._initThresholds=function(e){var t=e||[0];return Array.isArray(t)||(t=[t]),t.sort().filter((function(e,t,n){if("number"!=typeof e||isNaN(e)||e<0||e>1)throw new Error("threshold must be a number between 0 and 1 inclusively");return e!==n[t-1]}))},u.prototype._parseRootMargin=function(e){var t=(e||"0px").split(/\s+/).map((function(e){var t=/^(-?\d*\.?\d+)(px|%)$/.exec(e);if(!t)throw new Error("rootMargin must be specified in pixels or percent");return{value:parseFloat(t[1]),unit:t[2]}}));return t[1]=t[1]||t[0],t[2]=t[2]||t[0],t[3]=t[3]||t[1],t},u.prototype._monitorIntersections=function(t){var n=t.defaultView;if(n&&-1==this._monitoringDocuments.indexOf(t)){var r=this._checkForIntersections,i=null,u=null;this.POLL_INTERVAL?i=n.setInterval(r,this.POLL_INTERVAL):(c(n,"resize",r,!0),c(t,"scroll",r,!0),this.USE_MUTATION_OBSERVER&&"MutationObserver"in n&&(u=new n.MutationObserver(r)).observe(t,{attributes:!0,childList:!0,characterData:!0,subtree:!0})),this._monitoringDocuments.push(t),this._monitoringUnsubscribes.push((function(){var e=t.defaultView;e&&(i&&e.clearInterval(i),a(e,"resize",r,!0)),a(t,"scroll",r,!0),u&&u.disconnect()}));var s=this.root&&(this.root.ownerDocument||this.root)||e;if(t!=s){var l=o(t);l&&this._monitorIntersections(l.ownerDocument)}}},u.prototype._unmonitorIntersections=function(t){var n=this._monitoringDocuments.indexOf(t);if(-1!=n){var r=this.root&&(this.root.ownerDocument||this.root)||e,i=this._observationTargets.some((function(e){var n=e.element.ownerDocument;if(n==t)return!0;for(;n&&n!=r;){var i=o(n);if((n=i&&i.ownerDocument)==t)return!0}return!1}));if(!i){var u=this._monitoringUnsubscribes[n];if(this._monitoringDocuments.splice(n,1),this._monitoringUnsubscribes.splice(n,1),u(),t!=r){var c=o(t);c&&this._unmonitorIntersections(c.ownerDocument)}}}},u.prototype._unmonitorAllIntersections=function(){var e=this._monitoringUnsubscribes.slice(0);this._monitoringDocuments.length=0,this._monitoringUnsubscribes.length=0;for(var t=0;t<e.length;t++)e[t]()},u.prototype._checkForIntersections=function(){if(this.root||!n||r){var e=this._rootIsInDom(),t=e?this._getRootRect():{top:0,bottom:0,left:0,right:0,width:0,height:0};this._observationTargets.forEach((function(r){var o=r.element,u=s(o),c=this._rootContainsTarget(o),a=r.entry,l=e&&c&&this._computeTargetAndRootIntersection(o,u,t),f=null;this._rootContainsTarget(o)?n&&!this.root||(f=t):f={top:0,bottom:0,left:0,right:0,width:0,height:0};var d=r.entry=new i({time:window.performance&&performance.now&&performance.now(),target:o,boundingClientRect:u,rootBounds:f,intersectionRect:l});a?e&&c?this._hasCrossedThreshold(a,d)&&this._queuedEntries.push(d):a&&a.isIntersecting&&this._queuedEntries.push(d):this._queuedEntries.push(d)}),this),this._queuedEntries.length&&this._callback(this.takeRecords(),this)}},u.prototype._computeTargetAndRootIntersection=function(t,o,i){if("none"!=window.getComputedStyle(t).display){for(var u,c,a,l,d,h,p,m,g=o,y=v(t),b=!1;!b&&y;){var w=null,E=1==y.nodeType?window.getComputedStyle(y):{};if("none"==E.display)return null;if(y==this.root||9==y.nodeType)if(b=!0,y==this.root||y==e)n&&!this.root?!r||0==r.width&&0==r.height?(y=null,w=null,g=null):w=r:w=i;else{var S=v(y),_=S&&s(S),O=S&&this._computeTargetAndRootIntersection(S,_,i);_&&O?(y=S,w=f(_,O)):(y=null,g=null)}else{var x=y.ownerDocument;y!=x.body&&y!=x.documentElement&&"visible"!=E.overflow&&(w=s(y))}if(w&&(u=w,c=g,void 0,void 0,void 0,void 0,void 0,void 0,a=Math.max(u.top,c.top),l=Math.min(u.bottom,c.bottom),d=Math.max(u.left,c.left),m=l-a,g=(p=(h=Math.min(u.right,c.right))-d)>=0&&m>=0&&{top:a,bottom:l,left:d,right:h,width:p,height:m}||null),!g)break;y=y&&v(y)}return g}},u.prototype._getRootRect=function(){var t;if(this.root&&!h(this.root))t=s(this.root);else{var n=h(this.root)?this.root:e,r=n.documentElement,o=n.body;t={top:0,left:0,right:r.clientWidth||o.clientWidth,width:r.clientWidth||o.clientWidth,bottom:r.clientHeight||o.clientHeight,height:r.clientHeight||o.clientHeight}}return this._expandRectByRootMargin(t)},u.prototype._expandRectByRootMargin=function(e){var t=this._rootMarginValues.map((function(t,n){return"px"==t.unit?t.value:t.value*(n%2?e.width:e.height)/100})),n={top:e.top-t[0],right:e.right+t[1],bottom:e.bottom+t[2],left:e.left-t[3]};return n.width=n.right-n.left,n.height=n.bottom-n.top,n},u.prototype._hasCrossedThreshold=function(e,t){var n=e&&e.isIntersecting?e.intersectionRatio||0:-1,r=t.isIntersecting?t.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}},u.prototype._rootIsInDom=function(){return!this.root||d(e,this.root)},u.prototype._rootContainsTarget=function(t){var n=this.root&&(this.root.ownerDocument||this.root)||e;return d(n,t)&&(!this.root||n==t.ownerDocument)},u.prototype._registerInstance=function(){t.indexOf(this)<0&&t.push(this)},u.prototype._unregisterInstance=function(){var e=t.indexOf(this);-1!=e&&t.splice(e,1)},window.IntersectionObserver=u,window.IntersectionObserverEntry=i}function o(e){try{return e.defaultView&&e.defaultView.frameElement||null}catch(e){return null}}function i(e){this.time=e.time,this.target=e.target,this.rootBounds=l(e.rootBounds),this.boundingClientRect=l(e.boundingClientRect),this.intersectionRect=l(e.intersectionRect||{top:0,bottom:0,left:0,right:0,width:0,height:0}),this.isIntersecting=!!e.intersectionRect;var t=this.boundingClientRect,n=t.width*t.height,r=this.intersectionRect,o=r.width*r.height;this.intersectionRatio=n?Number((o/n).toFixed(4)):this.isIntersecting?1:0}function u(e,t){var n,r,o,i=t||{};if("function"!=typeof e)throw new Error("callback must be a function");if(i.root&&1!=i.root.nodeType&&9!=i.root.nodeType)throw new Error("root must be a Document or 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=e,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(e){return e.value+e.unit})).join(" "),this._monitoringDocuments=[],this._monitoringUnsubscribes=[]}function c(e,t,n,r){"function"==typeof e.addEventListener?e.addEventListener(t,n,r||!1):"function"==typeof e.attachEvent&&e.attachEvent("on"+t,n)}function a(e,t,n,r){"function"==typeof e.removeEventListener?e.removeEventListener(t,n,r||!1):"function"==typeof e.detachEvent&&e.detachEvent("on"+t,n)}function s(e){var t;try{t=e.getBoundingClientRect()}catch(e){}return t?(t.width&&t.height||(t={top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.right-t.left,height:t.bottom-t.top}),t):{top:0,bottom:0,left:0,right:0,width:0,height:0}}function l(e){return!e||"x"in e?e:{top:e.top,y:e.top,bottom:e.bottom,left:e.left,x:e.left,right:e.right,width:e.width,height:e.height}}function f(e,t){var n=t.top-e.top,r=t.left-e.left;return{top:n,left:r,height:t.height,width:t.width,bottom:n+t.height,right:r+t.width}}function d(e,t){for(var n=t;n;){if(n==e)return!0;n=v(n)}return!1}function v(t){var n=t.parentNode;return 9==t.nodeType&&t!=e?o(t):(n&&n.assignedSlot&&(n=n.assignedSlot.parentNode),n&&11==n.nodeType&&n.host?n.host:n)}function h(e){return e&&9===e.nodeType}}()},351:(e,t,n)=>{var r,o,i;void 0===(o="function"==typeof(r=i=function(){function e(){for(var e=0,t={};e<arguments.length;e++){var n=arguments[e];for(var r in n)t[r]=n[r]}return t}function t(e){return e.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function n(r){function o(){}function i(t,n,i){if("undefined"!=typeof document){"number"==typeof(i=e({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(e){}n=r.write?r.write(n,t):encodeURIComponent(String(n)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),t=encodeURIComponent(String(t)).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=t+"="+n+c}}function u(e,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 s=t(c[0]);if(a=(r.read||r)(a,s)||t(a),n)try{a=JSON.parse(a)}catch(e){}if(o[s]=a,e===s)break}catch(e){}}return e?o[e]:o}}return o.set=i,o.get=function(e){return u(e,!1)},o.getJSON=function(e){return u(e,!0)},o.remove=function(t,n){i(t,"",e(n,{expires:-1}))},o.defaults={},o.withConverter=n,o}((function(){}))})?r.call(t,n,t,e):r)||(e.exports=o),e.exports=i()},6:(e,t,n)=>{var r=n(714).Symbol;e.exports=r},271:(e,t,n)=>{var r=n(6),o=n(650),i=n(881),u=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":u&&u in Object(e)?o(e):i(e)}},103:(e,t,n)=>{var r=n(997),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},603:(e,t,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=r},556:(e,t,n)=>{var r=n(546)(Object.getPrototypeOf,Object);e.exports=r},650:(e,t,n)=>{var r=n(6),o=Object.prototype,i=o.hasOwnProperty,u=o.toString,c=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,c),n=e[c];try{e[c]=void 0;var r=!0}catch(e){}var o=u.call(e);return r&&(t?e[c]=n:delete e[c]),o}},881:e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},546:e=>{e.exports=function(e,t){return function(n){return e(t(n))}}},714:(e,t,n)=>{var r=n(603),o="object"==typeof self&&self&&self.Object===Object&&self,i=r||o||Function("return this")();e.exports=i},997:e=>{var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},12:(e,t,n)=>{var r=n(400),o=n(835),i=n(639),u=Math.max,c=Math.min;e.exports=function(e,t,n){var a,s,l,f,d,v,h=0,p=!1,m=!1,g=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function y(t){var n=a,r=s;return a=s=void 0,h=t,f=e.apply(r,n)}function b(e){var n=e-v;return void 0===v||n>=t||n<0||m&&e-h>=l}function w(){var e=o();if(b(e))return E(e);d=setTimeout(w,function(e){var n=t-(e-v);return m?c(n,l-(e-h)):n}(e))}function E(e){return d=void 0,g&&a?y(e):(a=s=void 0,f)}function S(){var e=o(),n=b(e);if(a=arguments,s=this,v=e,n){if(void 0===d)return function(e){return h=e,d=setTimeout(w,t),p?y(e):f}(v);if(m)return clearTimeout(d),d=setTimeout(w,t),y(v)}return void 0===d&&(d=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(p=!!n.leading,l=(m="maxWait"in n)?u(i(n.maxWait)||0,t):l,g="trailing"in n?!!n.trailing:g),S.cancel=function(){void 0!==d&&clearTimeout(d),h=0,a=v=s=d=void 0},S.flush=function(){return void 0===d?f:E(o())},S}},400:e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},583:e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},108:(e,t,n)=>{var r=n(271),o=n(556),i=n(583),u=Function.prototype,c=Object.prototype,a=u.toString,s=c.hasOwnProperty,l=a.call(Object);e.exports=function(e){if(!i(e)||"[object Object]"!=r(e))return!1;var t=o(e);if(null===t)return!0;var n=s.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&a.call(n)==l}},975:(e,t,n)=>{var r=n(271),o=n(583);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},835:(e,t,n)=>{var r=n(714);e.exports=function(){return r.Date.now()}},823:(e,t,n)=>{var r=n(12),o=n(400);e.exports=function(e,t,n){var i=!0,u=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return o(n)&&(i="leading"in n?!!n.leading:i,u="trailing"in n?!!n.trailing:u),r(e,t,{leading:i,maxWait:t,trailing:u})}},639:(e,t,n)=>{var r=n(103),o=n(400),i=n(975),u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,a=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=c.test(e);return n||a.test(e)?s(e.slice(2),n?2:8):u.test(e)?NaN:+e}},727:e=>{var t="undefined"!=typeof Element,n="function"==typeof Map,r="function"==typeof Set,o="function"==typeof ArrayBuffer&&!!ArrayBuffer.isView;function i(e,u){if(e===u)return!0;if(e&&u&&"object"==typeof e&&"object"==typeof u){if(e.constructor!==u.constructor)return!1;var c,a,s,l;if(Array.isArray(e)){if((c=e.length)!=u.length)return!1;for(a=c;0!=a--;)if(!i(e[a],u[a]))return!1;return!0}if(n&&e instanceof Map&&u instanceof Map){if(e.size!==u.size)return!1;for(l=e.entries();!(a=l.next()).done;)if(!u.has(a.value[0]))return!1;for(l=e.entries();!(a=l.next()).done;)if(!i(a.value[1],u.get(a.value[0])))return!1;return!0}if(r&&e instanceof Set&&u instanceof Set){if(e.size!==u.size)return!1;for(l=e.entries();!(a=l.next()).done;)if(!u.has(a.value[0]))return!1;return!0}if(o&&ArrayBuffer.isView(e)&&ArrayBuffer.isView(u)){if((c=e.length)!=u.length)return!1;for(a=c;0!=a--;)if(e[a]!==u[a])return!1;return!0}if(e.constructor===RegExp)return e.source===u.source&&e.flags===u.flags;if(e.valueOf!==Object.prototype.valueOf&&"function"==typeof e.valueOf&&"function"==typeof u.valueOf)return e.valueOf()===u.valueOf();if(e.toString!==Object.prototype.toString&&"function"==typeof e.toString&&"function"==typeof u.toString)return e.toString()===u.toString();if((c=(s=Object.keys(e)).length)!==Object.keys(u).length)return!1;for(a=c;0!=a--;)if(!Object.prototype.hasOwnProperty.call(u,s[a]))return!1;if(t&&e instanceof Element)return!1;for(a=c;0!=a--;)if(("_owner"!==s[a]&&"__v"!==s[a]&&"__o"!==s[a]||!e.$$typeof)&&!i(e[s[a]],u[s[a]]))return!1;return!0}return e!=e&&u!=u}e.exports=function(e,t){try{return i(e,t)}catch(e){if((e.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw e}}},763:e=>{!function(){"use strict";var t="undefined"!=typeof window&&void 0!==window.document?window.document:{},n=e.exports,r=function(){for(var e,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((e=n[r])&&e[1]in t){for(r=0;r<e.length;r++)i[n[0][r]]=e[r];return i}return!1}(),o={change:r.fullscreenchange,error:r.fullscreenerror},i={request:function(e,n){return new Promise(function(o,i){var u=function(){this.off("change",u),o()}.bind(this);this.on("change",u);var c=(e=e||t.documentElement)[r.requestFullscreen](n);c instanceof Promise&&c.then(u).catch(i)}.bind(this))},exit:function(){return new Promise(function(e,n){if(this.isFullscreen){var o=function(){this.off("change",o),e()}.bind(this);this.on("change",o);var i=t[r.exitFullscreen]();i instanceof Promise&&i.then(o).catch(n)}else e()}.bind(this))},toggle:function(e,t){return this.isFullscreen?this.exit():this.request(e,t)},onchange:function(e){this.on("change",e)},onerror:function(e){this.on("error",e)},on:function(e,n){var r=o[e];r&&t.addEventListener(r,n,!1)},off:function(e,n){var r=o[e];r&&t.removeEventListener(r,n,!1)},raw:r};r?(Object.defineProperties(i,{isFullscreen:{get:function(){return Boolean(t[r.fullscreenElement])}},element:{enumerable:!0,get:function(){return t[r.fullscreenElement]}},isEnabled:{enumerable:!0,get:function(){return Boolean(t[r.fullscreenEnabled])}}}),n?e.exports=i:window.screenfull=i):n?e.exports={isEnabled:!1}:window.screenfull={isEnabled:!1}}()},883:t=>{"use strict";t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{clearCache:()=>O,configResponsive:()=>Ft,createUpdateEffect:()=>t,useAntdTable:()=>J,useAsyncEffect:()=>K,useBoolean:()=>Q,useClickAway:()=>oe,useControllableValue:()=>ie,useCookieState:()=>ae,useCountDown:()=>de,useCounter:()=>he,useCreation:()=>w,useDebounce:()=>me,useDebounceEffect:()=>ge,useDebounceFn:()=>pe,useDeepCompareEffect:()=>Se,useDeepCompareLayoutEffect:()=>_e,useDocumentVisibility:()=>Te,useDrag:()=>Me,useDrop:()=>Re,useDynamicList:()=>ke,useEventEmitter:()=>Le,useEventListener:()=>Oe,useEventTarget:()=>Ae,useExternal:()=>Fe,useFavicon:()=>Ne,useFocusWithin:()=>Pe,useFullscreen:()=>ze,useFusionTable:()=>He,useGetState:()=>Ve,useHistoryTravel:()=>We,useHover:()=>Ye,useInViewport:()=>Xe,useInfiniteScroll:()=>qe,useInterval:()=>Ue,useIsomorphicLayoutEffect:()=>Ge,useKeyPress:()=>nt,useLatest:()=>E,useLocalStorageState:()=>it,useLockFn:()=>ut,useLongPress:()=>at,useMap:()=>st,useMemoizedFn:()=>p,useMount:()=>W,useMouse:()=>dt,useMutationObserver:()=>kn,useNetwork:()=>mt,usePagination:()=>G,usePrevious:()=>yt,useRafInterval:()=>bt,useRafState:()=>lt,useRafTimeout:()=>wt,useReactive:()=>Tt,useRequest:()=>X,useResetState:()=>Mt,useResponsive:()=>It,useSafeState:()=>Pt,useScroll:()=>jt,useSelections:()=>$t,useSessionStorageState:()=>zt,useSet:()=>Ht,useSetState:()=>Vt,useSize:()=>vn,useTextSelection:()=>mn,useThrottle:()=>yn,useThrottleEffect:()=>bn,useThrottleFn:()=>gn,useTimeout:()=>wn,useTitle:()=>Sn,useToggle:()=>Z,useTrackedEffect:()=>_n,useUnmount:()=>S,useUnmountedRef:()=>Nt,useUpdate:()=>Y,useUpdateEffect:()=>m,useUpdateLayoutEffect:()=>On,useVirtualList:()=>xn,useWebSocket:()=>Mn,useWhyDidYouUpdate:()=>Rn});var e=r(883),t=function(t){return function(n,r){var o=(0,e.useRef)(!1);t((function(){return function(){o.current=!1}}),[]),t((function(){if(o.current)return n();o.current=!0}),r)}},n=function(){return n=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},n.apply(this,arguments)};function i(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}function u(e,t,n,r){return new(n||(n=Promise))((function(o,i){function u(e){try{a(r.next(e))}catch(e){i(e)}}function c(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(u,c)}a((r=r.apply(e,t||[])).next())}))}function c(e,t){var n,r,o,i,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function c(c){return function(a){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,c[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!((o=(o=u.trys).length>0&&o[o.length-1])||6!==c[0]&&2!==c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=t.call(e,u)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,a])}}}function a(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),u=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)u.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return u}function l(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}Object.create,Object.create;var f=function(e){return null!==e&&"object"==typeof e},d=function(e){return"function"==typeof e},v=function(e){return"string"==typeof e},h=function(e){return"number"==typeof e};const p=function(t){var n=(0,e.useRef)(t);n.current=(0,e.useMemo)((function(){return t}),[t]);var r=(0,e.useRef)();return r.current||(r.current=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return n.current.apply(this,e)}),r.current},m=t(e.useEffect);var g=function(t,n){var r=n.manual,o=n.ready,i=void 0===o||o,u=n.defaultParams,c=void 0===u?[]:u,a=n.refreshDeps,f=void 0===a?[]:a,d=n.refreshDepsAction,v=(0,e.useRef)(!1);return v.current=!1,m((function(){!r&&i&&(v.current=!0,t.run.apply(t,l([],s(c),!1)))}),[i]),m((function(){v.current||r||(v.current=!0,d?d():t.refresh())}),l([],s(f),!1)),{onBefore:function(){if(!i)return{stopNow:!0}}}};g.onInit=function(e){var t=e.ready,n=void 0===t||t;return{loading:!e.manual&&n}};const y=g;function b(e,t){if(e===t)return!0;for(var n=0;n<e.length;n++)if(!Object.is(e[n],t[n]))return!1;return!0}function w(t,n){var r=(0,e.useRef)({deps:n,obj:void 0,initialized:!1}).current;return!1!==r.initialized&&b(r.deps,n)||(r.deps=n,r.obj=t(),r.initialized=!0),r.obj}const E=function(t){var n=(0,e.useRef)(t);return n.current=t,n},S=function(t){var n=E(t);(0,e.useEffect)((function(){return function(){n.current()}}),[])};var _=new Map,O=function(e){e?(Array.isArray(e)?e:[e]).forEach((function(e){return _.delete(e)})):_.clear()},x=new Map,T={},M=function(e,t){return T[e]||(T[e]=[]),T[e].push(t),function(){var n=T[e].indexOf(t);T[e].splice(n,1)}};const R=function(t,r){var o=r.cacheKey,i=r.cacheTime,u=void 0===i?3e5:i,c=r.staleTime,a=void 0===c?0:c,f=r.setCache,d=r.getCache,v=(0,e.useRef)(),h=(0,e.useRef)(),p=function(e,t){f?f(t):function(e,t,r){var o=_.get(e);(null==o?void 0:o.timer)&&clearTimeout(o.timer);var i=void 0;t>-1&&(i=setTimeout((function(){_.delete(e)}),t)),_.set(e,n(n({},r),{timer:i}))}(e,u,t),function(e,t){T[e]&&T[e].forEach((function(e){return e(t)}))}(e,t.data)},m=function(e,t){return void 0===t&&(t=[]),d?d(t):function(e){return _.get(e)}(e)};return w((function(){if(o){var e=m(o);e&&Object.hasOwnProperty.call(e,"data")&&(t.state.data=e.data,t.state.params=e.params,(-1===a||(new Date).getTime()-e.time<=a)&&(t.state.loading=!1)),v.current=M(o,(function(e){t.setState({data:e})}))}}),[]),S((function(){var e;null===(e=v.current)||void 0===e||e.call(v)})),o?{onBefore:function(e){var t=m(o,e);return t&&Object.hasOwnProperty.call(t,"data")?-1===a||(new Date).getTime()-t.time<=a?{loading:!1,data:null==t?void 0:t.data,error:void 0,returnNow:!0}:{data:null==t?void 0:t.data,error:void 0}:{}},onRequest:function(e,t){var n=function(e){return x.get(e)}(o);return n&&n!==h.current||(n=e.apply(void 0,l([],s(t),!1)),h.current=n,function(e,t){x.set(e,t),t.then((function(t){return x.delete(e),t})).catch((function(){x.delete(e)}))}(o,n)),{servicePromise:n}},onSuccess:function(e,n){var r;o&&(null===(r=v.current)||void 0===r||r.call(v),p(o,{data:e,params:n,time:(new Date).getTime()}),v.current=M(o,(function(e){t.setState({data:e})})))},onMutate:function(e){var n;o&&(null===(n=v.current)||void 0===n||n.call(v),p(o,{data:e,params:t.state.params,time:(new Date).getTime()}),v.current=M(o,(function(e){t.setState({data:e})})))}}:{}};var k=r(12),C=r.n(k);const L=function(t,n){var r=n.debounceWait,o=n.debounceLeading,i=n.debounceTrailing,u=n.debounceMaxWait,c=(0,e.useRef)(),a=(0,e.useMemo)((function(){var e={};return void 0!==o&&(e.leading=o),void 0!==i&&(e.trailing=i),void 0!==u&&(e.maxWait=u),e}),[o,i,u]);return(0,e.useEffect)((function(){if(r){var e=t.runAsync.bind(t);return c.current=C()((function(e){e()}),r,a),t.runAsync=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Promise((function(n,r){var o;null===(o=c.current)||void 0===o||o.call(c,(function(){e.apply(void 0,l([],s(t),!1)).then(n).catch(r)}))}))},function(){var n;null===(n=c.current)||void 0===n||n.cancel(),t.runAsync=e}}}),[r,a]),r?{onCancel:function(){var e;null===(e=c.current)||void 0===e||e.cancel()}}:{}},A=function(t,n){var r=n.loadingDelay,o=n.ready,i=(0,e.useRef)();if(!r)return{};var u=function(){i.current&&clearTimeout(i.current)};return{onBefore:function(){return u(),!1!==o&&(i.current=setTimeout((function(){t.setState({loading:!0})}),r)),{loading:!1}},onFinally:function(){u()},onCancel:function(){u()}}},D=!("undefined"==typeof window||!window.document||!window.document.createElement);function F(){return!D||"hidden"!==document.visibilityState}var I=[];D&&window.addEventListener("visibilitychange",(function(){if(F())for(var e=0;e<I.length;e++)(0,I[e])()}),!1);const N=function(t,n){var r=n.pollingInterval,o=n.pollingWhenHidden,i=void 0===o||o,u=n.pollingErrorRetryCount,c=void 0===u?-1:u,a=(0,e.useRef)(),s=(0,e.useRef)(),l=(0,e.useRef)(0),f=function(){var e;a.current&&clearTimeout(a.current),null===(e=s.current)||void 0===e||e.call(s)};return m((function(){r||f()}),[r]),r?{onBefore:function(){f()},onError:function(){l.current+=1},onSuccess:function(){l.current=0},onFinally:function(){-1===c||-1!==c&&l.current<=c?a.current=setTimeout((function(){var e;i||F()?t.refresh():s.current=(e=function(){t.refresh()},I.push(e),function(){var t=I.indexOf(e);I.splice(t,1)})}),r):l.current=0},onCancel:function(){f()}}:{}};var P=[];if(D){var j=function(){if(F()&&(!D||void 0===navigator.onLine||navigator.onLine))for(var e=0;e<P.length;e++)(0,P[e])()};window.addEventListener("visibilitychange",j,!1),window.addEventListener("focus",j,!1)}const $=function(t,n){var r=n.refreshOnWindowFocus,o=n.focusTimespan,i=void 0===o?5e3:o,u=(0,e.useRef)(),c=function(){var e;null===(e=u.current)||void 0===e||e.call(u)};return(0,e.useEffect)((function(){if(r){var e=(o=t.refresh.bind(t),a=i,f=!1,function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];f||(f=!0,o.apply(void 0,l([],s(e),!1)),setTimeout((function(){f=!1}),a))});u.current=(n=function(){e()},P.push(n),function(){var e=P.indexOf(n);e>-1&&P.splice(e,1)})}var n,o,a,f;return function(){c()}}),[r,i]),S((function(){c()})),{}},z=function(t,n){var r=n.retryInterval,o=n.retryCount,i=(0,e.useRef)(),u=(0,e.useRef)(0),c=(0,e.useRef)(!1);return o?{onBefore:function(){c.current||(u.current=0),c.current=!1,i.current&&clearTimeout(i.current)},onSuccess:function(){u.current=0},onError:function(){if(u.current+=1,-1===o||u.current<=o){var e=null!=r?r:Math.min(1e3*Math.pow(2,u.current),3e4);i.current=setTimeout((function(){c.current=!0,t.refresh()}),e)}else u.current=0},onCancel:function(){u.current=0,i.current&&clearTimeout(i.current)}}:{}};var H=r(823),V=r.n(H);const B=function(t,n){var r=n.throttleWait,o=n.throttleLeading,i=n.throttleTrailing,u=(0,e.useRef)(),c={};return void 0!==o&&(c.leading=o),void 0!==i&&(c.trailing=i),(0,e.useEffect)((function(){if(r){var e=t.runAsync.bind(t);return u.current=V()((function(e){e()}),r,c),t.runAsync=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return new Promise((function(n,r){var o;null===(o=u.current)||void 0===o||o.call(u,(function(){e.apply(void 0,l([],s(t),!1)).then(n).catch(r)}))}))},function(){var n;t.runAsync=e,null===(n=u.current)||void 0===n||n.cancel()}}}),[r,o,i]),r?{onCancel:function(){var e;null===(e=u.current)||void 0===e||e.cancel()}}:{}},W=function(t){(0,e.useEffect)((function(){null==t||t()}),[])},Y=function(){var t=s((0,e.useState)({}),2)[1];return(0,e.useCallback)((function(){return t({})}),[])};var q=function(){function e(e,t,r,o){void 0===o&&(o={}),this.serviceRef=e,this.options=t,this.subscribe=r,this.initState=o,this.count=0,this.state={loading:!1,params:void 0,data:void 0,error:void 0},this.state=n(n(n({},this.state),{loading:!t.manual}),o)}return e.prototype.setState=function(e){void 0===e&&(e={}),this.state=n(n({},this.state),e),this.subscribe()},e.prototype.runPluginHandler=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=this.pluginImpls.map((function(n){var r;return null===(r=n[e])||void 0===r?void 0:r.call.apply(r,l([n],s(t),!1))})).filter(Boolean);return Object.assign.apply(Object,l([{}],s(r),!1))},e.prototype.runAsync=function(){for(var e,t,r,o,a,f,d,v,h,p,m=[],g=0;g<arguments.length;g++)m[g]=arguments[g];return u(this,void 0,void 0,(function(){var u,g,y,b,w,E,S,_,O,x,T;return c(this,(function(c){switch(c.label){case 0:if(this.count+=1,u=this.count,g=this.runPluginHandler("onBefore",m),y=g.stopNow,b=void 0!==y&&y,w=g.returnNow,E=void 0!==w&&w,S=i(g,["stopNow","returnNow"]),b)return[2,new Promise((function(){}))];if(this.setState(n({loading:!0,params:m},S)),E)return[2,Promise.resolve(S.data)];null===(t=(e=this.options).onBefore)||void 0===t||t.call(e,m),c.label=1;case 1:return c.trys.push([1,3,,4]),(_=this.runPluginHandler("onRequest",this.serviceRef.current,m).servicePromise)||(_=(T=this.serviceRef).current.apply(T,l([],s(m),!1))),[4,_];case 2:return O=c.sent(),u!==this.count?[2,new Promise((function(){}))]:(this.setState({data:O,error:void 0,loading:!1}),null===(o=(r=this.options).onSuccess)||void 0===o||o.call(r,O,m),this.runPluginHandler("onSuccess",O,m),null===(f=(a=this.options).onFinally)||void 0===f||f.call(a,m,O,void 0),u===this.count&&this.runPluginHandler("onFinally",m,O,void 0),[2,O]);case 3:if(x=c.sent(),u!==this.count)return[2,new Promise((function(){}))];throw this.setState({error:x,loading:!1}),null===(v=(d=this.options).onError)||void 0===v||v.call(d,x,m),this.runPluginHandler("onError",x,m),null===(p=(h=this.options).onFinally)||void 0===p||p.call(h,m,void 0,x),u===this.count&&this.runPluginHandler("onFinally",m,void 0,x),x;case 4:return[2]}}))}))},e.prototype.run=function(){for(var e=this,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];this.runAsync.apply(this,l([],s(t),!1)).catch((function(t){e.options.onError||console.error(t)}))},e.prototype.cancel=function(){this.count+=1,this.setState({loading:!1}),this.runPluginHandler("onCancel")},e.prototype.refresh=function(){this.run.apply(this,l([],s(this.state.params||[]),!1))},e.prototype.refreshAsync=function(){return this.runAsync.apply(this,l([],s(this.state.params||[]),!1))},e.prototype.mutate=function(e){var t=d(e)?e(this.state.data):e;this.runPluginHandler("onMutate",t),this.setState({data:t})},e}();const U=q,X=function(e,t,r){return function(e,t,r){void 0===t&&(t={}),void 0===r&&(r=[]);var o=t.manual,u=void 0!==o&&o,c=i(t,["manual"]),a=n({manual:u},c),f=E(e),d=Y(),v=w((function(){var e=r.map((function(e){var t;return null===(t=null==e?void 0:e.onInit)||void 0===t?void 0:t.call(e,a)})).filter(Boolean);return new U(f,a,d,Object.assign.apply(Object,l([{}],s(e),!1)))}),[]);return v.options=a,v.pluginImpls=r.map((function(e){return e(v,a)})),W((function(){if(!u){var e=v.state.params||t.defaultParams||[];v.run.apply(v,l([],s(e),!1))}})),S((function(){v.cancel()})),{loading:v.state.loading,data:v.state.data,error:v.state.error,params:v.state.params||[],cancel:p(v.cancel.bind(v)),refresh:p(v.refresh.bind(v)),refreshAsync:p(v.refreshAsync.bind(v)),run:p(v.run.bind(v)),runAsync:p(v.runAsync.bind(v)),mutate:p(v.mutate.bind(v))}}(e,t,l(l([],s(r||[]),!1),[L,A,N,$,B,y,R,z],!1))},G=function(t,r){var o;void 0===r&&(r={});var u=r.defaultPageSize,c=void 0===u?10:u,a=r.defaultCurrent,f=void 0===a?1:a,d=i(r,["defaultPageSize","defaultCurrent"]),v=X(t,n({defaultParams:[{current:f,pageSize:c}],refreshDepsAction:function(){_(1)}},d)),h=v.params[0]||{},m=h.current,g=void 0===m?1:m,y=h.pageSize,b=void 0===y?c:y,w=(null===(o=v.data)||void 0===o?void 0:o.total)||0,E=(0,e.useMemo)((function(){return Math.ceil(w/b)}),[b,w]),S=function(e,t){var r=e<=0?1:e,o=t<=0?1:t,i=Math.ceil(w/o);r>i&&(r=Math.max(1,i));var u=s(v.params||[]),c=u[0],a=void 0===c?{}:c,f=u.slice(1);v.run.apply(v,l([n(n({},a),{current:r,pageSize:o})],s(f),!1))},_=function(e){S(e,b)};return n(n({},v),{pagination:{current:g,pageSize:b,total:w,totalPage:E,onChange:p(S),changeCurrent:p(_),changePageSize:p((function(e){S(g,e)}))}})},J=function(t,r){var o;void 0===r&&(r={});var u=r.form,c=r.defaultType,a=void 0===c?"simple":c,f=r.defaultParams,d=r.manual,v=void 0!==d&&d,h=r.refreshDeps,g=void 0===h?[]:h,y=r.ready,b=void 0===y||y,w=i(r,["form","defaultType","defaultParams","manual","refreshDeps","ready"]),E=G(t,n(n({ready:b,manual:!0},w),{onSuccess:function(){for(var e,t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];L.current=!0,null===(e=w.onSuccess)||void 0===e||e.call.apply(e,l([w],s(t),!1))}})),S=E.params,_=void 0===S?[]:S,O=E.run,x=_[2]||{},T=s((0,e.useState)((null==x?void 0:x.type)||a),2),M=T[0],R=T[1],k=(0,e.useRef)({}),C=(0,e.useRef)([]),L=(0,e.useRef)(!1),A=!!(null==u?void 0:u.getInternalHooks),D=function(){if(!u)return{};if(A)return u.getFieldsValue(null,(function(){return!0}));var e=u.getFieldsValue(),t={};return Object.keys(e).forEach((function(n){u.getFieldInstance&&!u.getFieldInstance(n)||(t[n]=e[n])})),t},F=function(){if(u){if(A)return u.setFieldsValue(k.current);var e={};Object.keys(k.current).forEach((function(t){u.getFieldInstance&&!u.getFieldInstance(t)||(e[t]=k.current[t])})),u.setFieldsValue(e)}},I=function(e){b&&setTimeout((function(){(function(){if(!u)return Promise.resolve({});var e=D(),t=Object.keys(e);return A?u.validateFields(t):new Promise((function(e,n){u.validateFields(t,(function(t,r){t?n(t):e(r)}))}))})().then((function(t){void 0===t&&(t={});var o=e||n(n({pageSize:r.defaultPageSize||10},(null==_?void 0:_[0])||{}),{current:1});u?(k.current=n(n({},k.current),t),O(o,t,{allFormData:k.current,type:M})):O(o)})).catch((function(e){return e}))}))};(0,e.useEffect)((function(){if(_.length>0)return k.current=(null==x?void 0:x.allFormData)||{},F(),void O.apply(void 0,l([],s(_),!1));!v&&b&&(k.current=(null==f?void 0:f[1])||{},F(),I(null==f?void 0:f[0]))}),[]),m((function(){b&&F()}),[M]);var N=(0,e.useRef)(!1);return N.current=!1,m((function(){!v&&b&&(N.current=!0,u&&u.resetFields(),k.current=(null==f?void 0:f[1])||{},F(),I(null==f?void 0:f[0]))}),[b]),m((function(){N.current||b&&(v||(N.current=!0,E.pagination.changeCurrent(1)))}),l([],s(g),!1)),n(n({},E),{tableProps:{dataSource:(null===(o=E.data)||void 0===o?void 0:o.list)||C.current,loading:E.loading,onChange:p((function(e,t,r,o){var i=s(_||[]),u=i[0],c=i.slice(1);O.apply(void 0,l([n(n({},u),{current:e.current,pageSize:e.pageSize,filters:t,sorter:r,extra:o})],s(c),!1))})),pagination:{current:E.pagination.current,pageSize:E.pagination.pageSize,total:E.pagination.total}},search:{submit:p((function(e){var t,o,i;null===(t=null==e?void 0:e.preventDefault)||void 0===t||t.call(e),I(L.current?void 0:n({pageSize:r.defaultPageSize||(null===(i=null===(o=r.defaultParams)||void 0===o?void 0:o[0])||void 0===i?void 0:i.pageSize)||10,current:1},(null==f?void 0:f[0])||{}))})),type:M,changeType:p((function(){var e=D();k.current=n(n({},k.current),e),R((function(e){return"simple"===e?"advance":"simple"}))})),reset:p((function(){var e,t;u&&u.resetFields(),I(n(n({},(null==f?void 0:f[0])||{}),{pageSize:r.defaultPageSize||(null===(t=null===(e=r.defaultParams)||void 0===e?void 0:e[0])||void 0===t?void 0:t.pageSize)||10,current:1}))}))}})},K=function(t,n){(0,e.useEffect)((function(){var e=t(),n=!1;return function(){u(this,void 0,void 0,(function(){return c(this,(function(t){switch(t.label){case 0:if(!d(e[Symbol.asyncIterator]))return[3,4];t.label=1;case 1:return[4,e.next()];case 2:return t.sent().done||n?[3,3]:[3,1];case 3:return[3,6];case 4:return[4,e];case 5:t.sent(),t.label=6;case 6:return[2]}}))}))}(),function(){n=!0}}),n)},Z=function(t,n){void 0===t&&(t=!1);var r=s((0,e.useState)(t),2),o=r[0],i=r[1];return[o,(0,e.useMemo)((function(){var e=void 0===n?!t:n;return{toggle:function(){return i((function(n){return n===t?e:t}))},set:function(e){return i(e)},setLeft:function(){return i(t)},setRight:function(){return i(e)}}}),[])]};function Q(t){void 0===t&&(t=!1);var n=s(Z(!!t),2),r=n[0],o=n[1],i=o.toggle,u=o.set;return[r,(0,e.useMemo)((function(){return{toggle:i,set:function(e){return u(!!e)},setTrue:function(){return u(!0)},setFalse:function(){return u(!1)}}}),[])]}function ee(e,t){if(D)return e?d(e)?e():"current"in e?e.current:e:t}const te=function(e){if(!e||!document.getRootNode)return document;var t,n=Array.isArray(e)?e:[e];return function(e){return e.every((function(e){var t=ee(e);return!!t&&t.getRootNode()instanceof ShadowRoot}))}(n)&&(t=ee(n[0]))?t.getRootNode():document},ne=function(t){return function(n,r,o){var i=(0,e.useRef)(!1),u=(0,e.useRef)([]),c=(0,e.useRef)([]),a=(0,e.useRef)();t((function(){var e,t=(Array.isArray(o)?o:[o]).map((function(e){return ee(e)}));if(!i.current)return i.current=!0,u.current=t,c.current=r,void(a.current=n());t.length===u.current.length&&b(u.current,t)&&b(c.current,r)||(null===(e=a.current)||void 0===e||e.call(a),u.current=t,c.current=r,a.current=n())})),S((function(){var e;null===(e=a.current)||void 0===e||e.call(a),i.current=!1}))}},re=ne(e.useEffect);function oe(e,t,n){void 0===n&&(n="click");var r=E(e);re((function(){var e=function(e){(Array.isArray(t)?t:[t]).some((function(t){var n=ee(t);return!n||n.contains(e.target)}))||r.current(e)},o=te(t),i=Array.isArray(n)?n:[n];return i.forEach((function(t){return o.addEventListener(t,e)})),function(){i.forEach((function(t){return o.removeEventListener(t,e)}))}}),Array.isArray(n)?n:[n],t)}const ie=function(t,n){void 0===t&&(t={}),void 0===n&&(n={});var r=n.defaultValue,o=n.defaultValuePropName,i=void 0===o?"defaultValue":o,u=n.valuePropName,c=void 0===u?"value":u,a=n.trigger,f=void 0===a?"onChange":a,v=t[c],h=t.hasOwnProperty(c),m=(0,e.useMemo)((function(){return h?v:t.hasOwnProperty(i)?t[i]:r}),[]),g=(0,e.useRef)(m);h&&(g.current=v);var y=Y();return[g.current,p((function(e){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=d(e)?e(g.current):e;h||(g.current=o,y()),t[f]&&t[f].apply(t,l([o],s(n),!1))}))]};var ue=r(351),ce=r.n(ue);const ae=function(t,r){void 0===r&&(r={});var o=s((0,e.useState)((function(){var e=ce().get(t);return v(e)?e:d(r.defaultValue)?r.defaultValue():r.defaultValue})),2),u=o[0],c=o[1],a=p((function(e,o){void 0===o&&(o={});var a=n(n({},r),o),s=(a.defaultValue,i(a,["defaultValue"])),l=d(e)?e(u):e;c(l),void 0===l?ce().remove(t):ce().set(t,l,s)}));return[u,a]};var se=r(431),le=r.n(se),fe=function(e){if(!e)return 0;var t=le()(e).valueOf()-Date.now();return t<0?0:t};const de=function(t){void 0===t&&(t={});var n=t||{},r=n.leftTime,o=n.targetDate,i=n.interval,u=void 0===i?1e3:i,c=n.onEnd,a=(0,e.useMemo)((function(){return h(r)&&r>0?Date.now()+r:void 0}),[r]),l="leftTime"in t?a:o,f=s((0,e.useState)((function(){return fe(l)})),2),d=f[0],v=f[1],p=E(c);(0,e.useEffect)((function(){if(l){v(fe(l));var e=setInterval((function(){var t,n=fe(l);v(n),0===n&&(clearInterval(e),null===(t=p.current)||void 0===t||t.call(p))}),u);return function(){return clearInterval(e)}}v(0)}),[l,u]);var m=(0,e.useMemo)((function(){return e=d,{days:Math.floor(e/864e5),hours:Math.floor(e/36e5)%24,minutes:Math.floor(e/6e4)%60,seconds:Math.floor(e/1e3)%60,milliseconds:Math.floor(e)%1e3};var e}),[d]);return[d,m]};function ve(e,t){void 0===t&&(t={});var n=t.min,r=t.max,o=e;return h(r)&&(o=Math.min(r,o)),h(n)&&(o=Math.max(n,o)),o}const he=function(t,n){void 0===t&&(t=0),void 0===n&&(n={});var r=n.min,o=n.max,i=s((0,e.useState)((function(){return ve(t,{min:r,max:o})})),2),u=i[0],c=i[1],a=function(e){c((function(t){return ve(h(e)?e:e(t),{max:o,min:r})}))};return[u,{inc:p((function(e){void 0===e&&(e=1),a((function(t){return t+e}))})),dec:p((function(e){void 0===e&&(e=1),a((function(t){return t-e}))})),set:p((function(e){a(e)})),reset:p((function(){a(t)}))}]},pe=function(t,n){var r,o=E(t),i=null!==(r=null==n?void 0:n.wait)&&void 0!==r?r:1e3,u=(0,e.useMemo)((function(){return C()((function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return o.current.apply(o,l([],s(e),!1))}),i,n)}),[]);return S((function(){u.cancel()})),{run:u,cancel:u.cancel,flush:u.flush}},me=function(t,n){var r=s((0,e.useState)(t),2),o=r[0],i=r[1],u=pe((function(){i(t)}),n).run;return(0,e.useEffect)((function(){u()}),[t]),o},ge=function(t,n,r){var o=s((0,e.useState)({}),2),i=o[0],u=o[1],c=pe((function(){u({})}),r).run;(0,e.useEffect)((function(){return c()}),n),m(t,[i])};var ye=r(727),be=r.n(ye),we=function(e,t){return void 0===