Module 873263

6,424 characters · in no known chunk
Dependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{B6:()=>C,Ix:()=>m,W5:()=>w,W6:()=>b,XZ:()=>E,dO:()=>O,g:()=>L,qh:()=>v,rd:()=>S,zy:()=>D});var i=n(238710),r=n(64700),s=n(655972),a=n.n(s),o=n(830845),l=n(258635),u=n(542113),c=n(353719),d=n.n(c);n(53635),n(725664),n(833871);var _="u">typeof globalThis?globalThis:"u">typeof window?window:void 0!==n.g?n.g:{},f=r.createContext||function(e,t){var n,s,o="__create-react-context-"+(_.__global_unique_id__=(_.__global_unique_id__||0)+1)+"__",l=function(e){function n(){for(var t,n,i,r=arguments.length,s=Array(r),a=0;a<r;a++)s[a]=arguments[a];return n=(t=e.call.apply(e,[this].concat(s))||this).props.value,i=[],t.emitter={on:function(e){i.push(e)},off:function(e){i=i.filter(function(t){return t!==e})},get:function(){return n},set:function(e,t){n=e,i.forEach(function(e){return e(n,t)})}},t}(0,i.A)(n,e);var r=n.prototype;return r.getChildContext=function(){var e;return(e={})[o]=this.emitter,e},r.componentWillReceiveProps=function(e){if(this.props.value!==e.value){var n,i=this.props.value,r=e.value;(i===r?0!==i||1/i==1/r:i!=i&&r!=r)?n=0:0!=(n=("function"==typeof t?t(i,r):0x3fffffff)|0)&&this.emitter.set(e.value,n)}},r.render=function(){return this.props.children},n}(r.Component);(n={})[o]=a().object.isRequired,l.childContextTypes=n;var u=function(t){function n(){for(var e,n=arguments.length,i=Array(n),r=0;r<n;r++)i[r]=arguments[r];return(e=t.call.apply(t,[this].concat(i))||this).observedBits=void 0,e.state={value:e.getValue()},e.onUpdate=function(t,n){(e.observedBits&n)!=0&&e.setState({value:e.getValue()})},e}(0,i.A)(n,t);var r=n.prototype;return r.componentWillReceiveProps=function(e){var t=e.observedBits;this.observedBits=null==t?0x3fffffff:t},r.componentDidMount=function(){this.context[o]&&this.context[o].on(this.onUpdate);var e=this.props.observedBits;this.observedBits=null==e?0x3fffffff:e},r.componentWillUnmount=function(){this.context[o]&&this.context[o].off(this.onUpdate)},r.getValue=function(){return this.context[o]?this.context[o].get():e},r.render=function(){var e;return(Array.isArray(e=this.props.children)?e[0]:e)(this.state.value)},n}(r.Component);return(s={})[o]=a().object,u.contextTypes=s,{Provider:l,Consumer:u}},h=function(e){var t=f();return t.displayName=e,t},p=h("Router-History"),E=h("Router"),m=function(e){function t(t){var n;return(n=e.call(this,t)||this).state={location:t.history.location},n._isMounted=!1,n._pendingLocation=null,t.staticContext||(n.unlisten=t.history.listen(function(e){n._pendingLocation=e})),n}(0,i.A)(t,e),t.computeRootMatch=function(e){return{path:"/",url:"/",params:{},isExact:"/"===e}};var n=t.prototype;return n.componentDidMount=function(){var e=this;this._isMounted=!0,this.unlisten&&this.unlisten(),this.props.staticContext||(this.unlisten=this.props.history.listen(function(t){e._isMounted&&e.setState({location:t})})),this._pendingLocation&&this.setState({location:this._pendingLocation})},n.componentWillUnmount=function(){this.unlisten&&(this.unlisten(),this._isMounted=!1,this._pendingLocation=null)},n.render=function(){return r.createElement(E.Provider,{value:{history:this.props.history,location:this.state.location,match:t.computeRootMatch(this.state.location.pathname),staticContext:this.props.staticContext}},r.createElement(p.Provider,{children:this.props.children||null,value:this.props.history}))},t}(r.Component);r.Component;var g=function(e){function t(){return e.apply(this,arguments)||this}(0,i.A)(t,e);var n=t.prototype;return n.componentDidMount=function(){this.props.onMount&&this.props.onMount.call(this,this)},n.componentDidUpdate=function(e){this.props.onUpdate&&this.props.onUpdate.call(this,this,e)},n.componentWillUnmount=function(){this.props.onUnmount&&this.props.onUnmount.call(this,this)},n.render=function(){return null},t}(r.Component),A={},I=0;function T(e,t){return void 0===e&&(e="/"),void 0===t&&(t={}),"/"===e?e:(function(e){if(A[e])return A[e];var t=d().compile(e);return I<1e4&&(A[e]=t,I++),t})(e)(t,{pretty:!0})}function S(e){var t=e.computedMatch,n=e.to,i=e.push,s=void 0!==i&&i;return r.createElement(E.Consumer,null,function(e){e||(0,l.A)(!1);var i=e.history,a=e.staticContext,c=s?i.push:i.replace,d=(0,o.yJ)(t?"string"==typeof n?T(n,t.params):(0,u.A)({},n,{pathname:T(n.pathname,t.params)}):n);return a?(c(d),null):r.createElement(g,{onMount:function(){c(d)},onUpdate:function(e,t){var n=(0,o.yJ)(t.to);(0,o.Fu)(n,(0,u.A)({},d,{key:n.key}))||c(d)},to:n})})}var N={},y=0;function C(e,t){void 0===t&&(t={}),("string"==typeof t||Array.isArray(t))&&(t={path:t});var n=t,i=n.path,r=n.exact,s=void 0!==r&&r,a=n.strict,o=void 0!==a&&a,l=n.sensitive,u=void 0!==l&&l;return[].concat(i).reduce(function(t,n){if(!n&&""!==n)return null;if(t)return t;var i=function(e,t){var n=""+t.end+t.strict+t.sensitive,i=N[n]||(N[n]={});if(i[e])return i[e];var r=[],s={regexp:d()(e,r,t),keys:r};return y<1e4&&(i[e]=s,y++),s}(n,{end:s,strict:o,sensitive:u}),r=i.regexp,a=i.keys,l=r.exec(e);if(!l)return null;var c=l[0],_=l.slice(1),f=e===c;return s&&!f?null:{path:n,url:"/"===n&&""===c?"/":c,isExact:f,params:a.reduce(function(e,t,n){return e[t.name]=_[n],e},{})}},null)}var v=function(e){function t(){return e.apply(this,arguments)||this}return(0,i.A)(t,e),t.prototype.render=function(){var e=this;return r.createElement(E.Consumer,null,function(t){t||(0,l.A)(!1);var n,i=e.props.location||t.location,s=e.props.computedMatch?e.props.computedMatch:e.props.path?C(i.pathname,e.props):t.match,a=(0,u.A)({},t,{location:i,match:s}),o=e.props,c=o.children,d=o.component,_=o.render;return Array.isArray(c)&&(n=c,0===r.Children.count(n))&&(c=null),r.createElement(E.Provider,{value:a},a.match?c?"function"==typeof c?c(a):c:d?r.createElement(d,a):_?_(a):null:"function"==typeof c?c(a):null)})},t}(r.Component);r.Component;var O=function(e){function t(){return e.apply(this,arguments)||this}return(0,i.A)(t,e),t.prototype.render=function(){var e=this;return r.createElement(E.Consumer,null,function(t){t||(0,l.A)(!1);var n,i,s=e.props.location||t.location;return r.Children.forEach(e.props.children,function(e){if(null==i&&r.isValidElement(e)){n=e;var a=e.props.path||e.props.from;i=a?C(s.pathname,(0,u.A)({},e.props,{path:a})):t.match}}),i?r.cloneElement(n,{location:s,computedMatch:i}):null})},t}(r.Component),R=r.useContext;function b(){return R(p)}function D(){return R(E).location}function L(){var e=R(E).match;return e?e.params:{}}function w(e){var t=D(),n=R(E).match;return e?C(t.pathname,e):n}}