19 lines
16 KiB
JavaScript
19 lines
16 KiB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["exports","react","react-dom"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).ReactRedux={},e.React,e.ReactDOM)}(this,(function(e,t,n){"use strict";function r(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(n){if("default"!==n){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})),t.default=e,Object.freeze(t)}var u=r(t),c=o(t);function s(e,t,n){return e(n={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}()}},n.exports),n.exports}var a="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},i=u.default.useState,f=u.default.useEffect,l=u.default.useLayoutEffect,p=u.default.useDebugValue;function d(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!a(e,n)}catch(e){return!0}}var y="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),o=r[0].inst,u=r[1];return l((function(){o.value=n,o.getSnapshot=t,d(o)&&u({inst:o})}),[e,n,t]),f((function(){return d(o)&&u({inst:o}),e((function(){d(o)&&u({inst:o})}))}),[e]),p(n),n},m={useSyncExternalStore:void 0!==u.default.useSyncExternalStore?u.default.useSyncExternalStore:y},b=s((function(e){e.exports=m}));var S="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},v=b.useSyncExternalStore,h=u.default.useRef,g=u.default.useEffect,P=u.default.useMemo,w=u.default.useDebugValue,x={useSyncExternalStoreWithSelector:function(e,t,n,r,o){var u=h(null);if(null===u.current){var c={hasValue:!1,value:null};u.current=c}else c=u.current;u=P((function(){function e(e){if(!a){if(a=!0,u=e,e=r(e),void 0!==o&&c.hasValue){var t=c.value;if(o(t,e))return s=t}return s=e}if(t=s,S(u,e))return t;var n=r(e);return void 0!==o&&o(t,n)?t:(u=e,s=n)}var u,s,a=!1,i=void 0===n?null:n;return[function(){return e(t())},null===i?void 0:function(){return e(i())}]}),[t,n,r,o]);var s=v(e,u[0],u[1]);return g((function(){c.hasValue=!0,c.value=s}),[s]),w(s),s}},O=s((function(e){e.exports=x}));let $=function(e){e()};const C=()=>$,M=Symbol.for("react-redux-context"),E="undefined"!=typeof globalThis?globalThis:{};function j(){var e;if(!c.createContext)return{};const t=null!=(e=E[M])?e:E[M]=new Map;let n=t.get(c.createContext);return n||(n=c.createContext(null),t.set(c.createContext,n)),n}const R=j();function T(e=R){return function(){return t.useContext(e)}}const q=T(),k=()=>{throw Error("uSES not initialized!")};let N=k;const D=(e,t)=>e===t;function F(e=R){const n=e===R?q:T(e);return function(e,r={}){const{equalityFn:o=D,stabilityCheck:u}="function"==typeof r?{equalityFn:r}:r,{store:c,subscription:s,getServerState:a,stabilityCheck:i}=n();t.useRef(!0);const f=t.useCallback({[e.name]:t=>e(t)}[e.name],[e,i,u]),l=N(s.addNestedSub,c.getState,a||c.getState,f,o);return t.useDebugValue(l),l}}const _=F();function L(){return(L=Object.assign||function(e){for(var t=1;arguments.length>t;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function z(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;u.length>r;r++)0>t.indexOf(n=u[r])&&(o[n]=e[n]);return o}
|
|
/** @license React v16.13.1
|
|
* react-is.production.min.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/var V="function"==typeof Symbol&&Symbol.for,W=V?Symbol.for("react.element"):60103,U=V?Symbol.for("react.portal"):60106,H=V?Symbol.for("react.fragment"):60107,A=V?Symbol.for("react.strict_mode"):60108,I=V?Symbol.for("react.profiler"):60114,B=V?Symbol.for("react.provider"):60109,G=V?Symbol.for("react.context"):60110,J=V?Symbol.for("react.async_mode"):60111,K=V?Symbol.for("react.concurrent_mode"):60111,Q=V?Symbol.for("react.forward_ref"):60112,X=V?Symbol.for("react.suspense"):60113,Y=V?Symbol.for("react.suspense_list"):60120,Z=V?Symbol.for("react.memo"):60115,ee=V?Symbol.for("react.lazy"):60116,te=V?Symbol.for("react.block"):60121,ne=V?Symbol.for("react.fundamental"):60117,re=V?Symbol.for("react.responder"):60118,oe=V?Symbol.for("react.scope"):60119;function ue(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case W:switch(e=e.type){case J:case K:case H:case I:case A:case X:return e;default:switch(e=e&&e.$$typeof){case G:case Q:case ee:case Z:case B:return e;default:return t}}case U:return t}}}function ce(e){return ue(e)===K}var se={AsyncMode:J,ConcurrentMode:K,ContextConsumer:G,ContextProvider:B,Element:W,ForwardRef:Q,Fragment:H,Lazy:ee,Memo:Z,Portal:U,Profiler:I,StrictMode:A,Suspense:X,isAsyncMode:function(e){return ce(e)||ue(e)===J},isConcurrentMode:ce,isContextConsumer:function(e){return ue(e)===G},isContextProvider:function(e){return ue(e)===B},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===W},isForwardRef:function(e){return ue(e)===Q},isFragment:function(e){return ue(e)===H},isLazy:function(e){return ue(e)===ee},isMemo:function(e){return ue(e)===Z},isPortal:function(e){return ue(e)===U},isProfiler:function(e){return ue(e)===I},isStrictMode:function(e){return ue(e)===A},isSuspense:function(e){return ue(e)===X},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===H||e===K||e===I||e===A||e===X||e===Y||"object"==typeof e&&null!==e&&(e.$$typeof===ee||e.$$typeof===Z||e.$$typeof===B||e.$$typeof===G||e.$$typeof===Q||e.$$typeof===ne||e.$$typeof===re||e.$$typeof===oe||e.$$typeof===te)},typeOf:ue},ae=s((function(e){e.exports=se})),ie={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},fe={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},le={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},pe={};function de(e){return ae.isMemo(e)?le:pe[e.$$typeof]||ie}pe[ae.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},pe[ae.Memo]=le;var ye=Object.defineProperty,me=Object.getOwnPropertyNames,be=Object.getOwnPropertySymbols,Se=Object.getOwnPropertyDescriptor,ve=Object.getPrototypeOf,he=Object.prototype;var ge=function e(t,n,r){if("string"!=typeof n){if(he){var o=ve(n);o&&o!==he&&e(t,o,r)}var u=me(n);be&&(u=u.concat(be(n)));for(var c=de(t),s=de(n),a=0;u.length>a;++a){var i=u[a];if(!(fe[i]||r&&r[i]||s&&s[i]||c&&c[i])){var f=Se(n,i);try{ye(t,i,f)}catch(e){}}}}return t},Pe=Symbol.for("react.element"),we=Symbol.for("react.portal"),xe=Symbol.for("react.fragment"),Oe=Symbol.for("react.strict_mode"),$e=Symbol.for("react.profiler"),Ce=Symbol.for("react.provider"),Me=Symbol.for("react.context"),Ee=Symbol.for("react.server_context"),je=Symbol.for("react.forward_ref"),Re=Symbol.for("react.suspense"),Te=Symbol.for("react.suspense_list"),qe=Symbol.for("react.memo"),ke=Symbol.for("react.lazy"),Ne=Symbol.for("react.offscreen"),De=Symbol.for("react.module.reference");
|
|
/**
|
|
* @license React
|
|
* react-is.production.min.js
|
|
*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/function Fe(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case Pe:switch(e=e.type){case xe:case $e:case Oe:case Re:case Te:return e;default:switch(e=e&&e.$$typeof){case Ee:case Me:case je:case ke:case qe:case Ce:return e;default:return t}}case we:return t}}}var _e={ContextConsumer:Me,ContextProvider:Ce,Element:Pe,ForwardRef:je,Fragment:xe,Lazy:ke,Memo:qe,Portal:we,Profiler:$e,StrictMode:Oe,Suspense:Re,SuspenseList:Te,isAsyncMode:function(){return!1},isConcurrentMode:function(){return!1},isContextConsumer:function(e){return Fe(e)===Me},isContextProvider:function(e){return Fe(e)===Ce},isElement:function(e){return"object"==typeof e&&null!==e&&e.$$typeof===Pe},isForwardRef:function(e){return Fe(e)===je},isFragment:function(e){return Fe(e)===xe},isLazy:function(e){return Fe(e)===ke},isMemo:function(e){return Fe(e)===qe},isPortal:function(e){return Fe(e)===we},isProfiler:function(e){return Fe(e)===$e},isStrictMode:function(e){return Fe(e)===Oe},isSuspense:function(e){return Fe(e)===Re},isSuspenseList:function(e){return Fe(e)===Te},isValidElementType:function(e){return"string"==typeof e||"function"==typeof e||e===xe||e===$e||e===Oe||e===Re||e===Te||e===Ne||"object"==typeof e&&null!==e&&(e.$$typeof===ke||e.$$typeof===qe||e.$$typeof===Ce||e.$$typeof===Me||e.$$typeof===je||e.$$typeof===De||void 0!==e.getModuleId)},typeOf:Fe},Le=s((function(e){e.exports=_e}));const ze=["initMapStateToProps","initMapDispatchToProps","initMergeProps"];function Ve(e,t,n,r,{areStatesEqual:o,areOwnPropsEqual:u,areStatePropsEqual:c}){let s,a,i,f,l,p=!1;function d(p,d){const y=!u(d,a),m=!o(p,s,d,a);return s=p,a=d,y&&m?(i=e(s,a),t.dependsOnOwnProps&&(f=t(r,a)),l=n(i,f,a),l):y?(e.dependsOnOwnProps&&(i=e(s,a)),t.dependsOnOwnProps&&(f=t(r,a)),l=n(i,f,a),l):m?function(){const t=e(s,a),r=!c(t,i);return i=t,r&&(l=n(i,f,a)),l}():l}return function(o,u){return p?d(o,u):(s=o,a=u,i=e(s,a),f=t(r,a),l=n(i,f,a),p=!0,l)}}function We(e){return function(t){const n=e(t);function r(){return n}return r.dependsOnOwnProps=!1,r}}function Ue(e){return e.dependsOnOwnProps?!!e.dependsOnOwnProps:1!==e.length}function He(e,t){return function(t,{}){const n=function(e,t){return n.mapToProps(e,n.dependsOnOwnProps?t:void 0)};return n.dependsOnOwnProps=!0,n.mapToProps=function(t,r){n.mapToProps=e,n.dependsOnOwnProps=Ue(e);let o=n(t,r);return"function"==typeof o&&(n.mapToProps=o,n.dependsOnOwnProps=Ue(o),o=n(t,r)),o},n}}function Ae(e,t){return(n,r)=>{throw Error(`Invalid value of type ${typeof e} for ${t} argument when connecting component ${r.wrappedComponentName}.`)}}function Ie(e,t,n){return L({},n,e,t)}const Be={notify(){},get:()=>[]};function Ge(e,t){let n,r=Be,o=0,u=!1;function c(){i.onStateChange&&i.onStateChange()}function s(){o++,n||(n=t?t.addNestedSub(c):e.subscribe(c),r=function(){const e=C();let t=null,n=null;return{clear(){t=null,n=null},notify(){e((()=>{let e=t;for(;e;)e.callback(),e=e.next}))},get(){let e=[],n=t;for(;n;)e.push(n),n=n.next;return e},subscribe(e){let r=!0,o=n={callback:e,next:null,prev:n};return o.prev?o.prev.next=o:t=o,function(){r&&null!==t&&(r=!1,o.next?o.next.prev=o.prev:n=o.prev,o.prev?o.prev.next=o.next:t=o.next)}}}}())}function a(){o--,n&&0===o&&(n(),n=void 0,r.clear(),r=Be)}const i={addNestedSub:function(e){s();const t=r.subscribe(e);let n=!1;return()=>{n||(n=!0,t(),a())}},notifyNestedSubs:function(){r.notify()},handleChangeWrapper:c,isSubscribed:function(){return u},trySubscribe:function(){u||(u=!0,s())},tryUnsubscribe:function(){u&&(u=!1,a())},getListeners:()=>r};return i}const Je=!("undefined"==typeof window||void 0===window.document||void 0===window.document.createElement)?c.useLayoutEffect:c.useEffect;function Ke(e,t){return e===t?0!==e||0!==t||1/e==1/t:e!=e&&t!=t}function Qe(e,t){if(Ke(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;n.length>r;r++)if(!Object.prototype.hasOwnProperty.call(t,n[r])||!Ke(e[n[r]],t[n[r]]))return!1;return!0}const Xe=["reactReduxForwardedRef"];let Ye=k;const Ze=[null,null];function et(e,t,n,r,o,u){e.current=r,n.current=!1,o.current&&(o.current=null,u())}function tt(e,t){return e===t}function nt(e=R){const t=e===R?q:T(e);return function(){const{store:e}=t();return e}}const rt=nt();function ot(e=R){const t=e===R?rt:nt(e);return function(){return t().dispatch}}const ut=ot();N=O.useSyncExternalStoreWithSelector,(e=>{Ye=e})(b.useSyncExternalStore),$=n.unstable_batchedUpdates,Object.defineProperty(e,"batch",{enumerable:!0,get:function(){return n.unstable_batchedUpdates}}),e.Provider=function({store:e,context:t,children:n,serverState:r,stabilityCheck:o="once",noopCheck:u="once"}){const s=c.useMemo((()=>{const t=Ge(e);return{store:e,subscription:t,getServerState:r?()=>r:void 0,stabilityCheck:o,noopCheck:u}}),[e,r,o,u]),a=c.useMemo((()=>e.getState()),[e]);return Je((()=>{const{subscription:t}=s;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),a!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}}),[s,a]),c.createElement((t||R).Provider,{value:s},n)},e.ReactReduxContext=R,e.connect=function(e,t,n,{areStatesEqual:r=tt,areOwnPropsEqual:o=Qe,areStatePropsEqual:u=Qe,areMergedPropsEqual:s=Qe,forwardRef:a=!1,context:i=R}={}){const f=i,l=function(e){return e?"function"==typeof e?He(e):Ae(e,"mapStateToProps"):We((()=>({})))}(e),p=function(e){return e&&"object"==typeof e?We((t=>function(e,t){const n={};for(const r in e){const o=e[r];"function"==typeof o&&(n[r]=(...e)=>t(o(...e)))}return n}(e,t))):e?"function"==typeof e?He(e):Ae(e,"mapDispatchToProps"):We((e=>({dispatch:e})))}(t),d=function(e){return e?"function"==typeof e?function(e){return function(t,{areMergedPropsEqual:n}){let r,o=!1;return function(t,u,c){const s=e(t,u,c);return o?n(s,r)||(r=s):(o=!0,r=s),r}}}(e):Ae(e,"mergeProps"):()=>Ie}(n),y=!!e;return e=>{const t=e.displayName||e.name||"Component",n=`Connect(${t})`,i={shouldHandleStateChanges:y,displayName:n,wrappedComponentName:t,WrappedComponent:e,initMapStateToProps:l,initMapDispatchToProps:p,initMergeProps:d,areStatesEqual:r,areStatePropsEqual:u,areOwnPropsEqual:o,areMergedPropsEqual:s};function m(t){const[n,r,o]=c.useMemo((()=>{const{reactReduxForwardedRef:e}=t,n=z(t,Xe);return[t.context,e,n]}),[t]),u=c.useMemo((()=>n&&n.Consumer&&Le.isContextConsumer(c.createElement(n.Consumer,null))?n:f),[n,f]),s=c.useContext(u),a=!!t.store&&!!t.store.getState&&!!t.store.dispatch,l=a?t.store:s.store,p=!!s&&!!s.store?s.getServerState:l.getState,d=c.useMemo((()=>function(e,t){let{initMapStateToProps:n,initMapDispatchToProps:r,initMergeProps:o}=t,u=z(t,ze);return Ve(n(e,u),r(e,u),o(e,u),e,u)}(l.dispatch,i)),[l]),[m,b]=c.useMemo((()=>{if(!y)return Ze;const e=Ge(l,a?void 0:s.subscription),t=e.notifyNestedSubs.bind(e);return[e,t]}),[l,a,s]),S=c.useMemo((()=>a?s:L({},s,{subscription:m})),[a,s,m]),v=c.useRef(),h=c.useRef(o),g=c.useRef(),P=c.useRef(!1);c.useRef(!1);const w=c.useRef(!1),x=c.useRef();Je((()=>(w.current=!0,()=>{w.current=!1})),[]);const O=c.useMemo((()=>()=>g.current&&o===h.current?g.current:d(l.getState(),o)),[l,o]),$=c.useMemo((()=>e=>m?function(e,t,n,r,o,u,c,s,a,i,f){if(!e)return()=>{};let l=!1,p=null;const d=()=>{if(l||!s.current)return;const e=t.getState();let n,d;try{n=r(e,o.current)}catch(e){d=e,p=e}d||(p=null),n===u.current?c.current||i():(u.current=n,a.current=n,c.current=!0,f())};return n.onStateChange=d,n.trySubscribe(),d(),()=>{if(l=!0,n.tryUnsubscribe(),n.onStateChange=null,p)throw p}}(y,l,m,d,h,v,P,w,g,b,e):()=>{}),[m]);var C,M,E;let j;C=et,M=[h,v,P,o,g,b],Je((()=>C(...M)),E);try{j=Ye($,O,p?()=>d(p(),o):O)}catch(e){throw x.current&&(e.message+=`\nThe error may be correlated with this previous error:\n${x.current.stack}\n\n`),e}Je((()=>{x.current=void 0,g.current=void 0,v.current=j}));const R=c.useMemo((()=>c.createElement(e,L({},j,{ref:r}))),[r,e,j]);return c.useMemo((()=>y?c.createElement(u.Provider,{value:S},R):R),[u,R,S])}const b=c.memo(m);if(b.WrappedComponent=e,b.displayName=m.displayName=n,a){const t=c.forwardRef((function(e,t){return c.createElement(b,L({},e,{reactReduxForwardedRef:t}))}));return t.displayName=n,t.WrappedComponent=e,ge(t,e)}return ge(b,e)}},e.createDispatchHook=ot,e.createSelectorHook=F,e.createStoreHook=nt,e.shallowEqual=Qe,e.useDispatch=ut,e.useSelector=_,e.useStore=rt,Object.defineProperty(e,"__esModule",{value:!0})}));
|