!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("prop-types"),require("react-router")):"function"==typeof define&&define.amd?define(["exports","react","prop-types","react-router"],e):e(t.ReactRouterRedux={},t.React,t.PropTypes,t.ReactRouter)}(this,function(t,e,r,o){"use strict";function n(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t){return function(){for(var e=arguments.length,r=Array(e),o=0;e>o;o++)r[o]=arguments[o];return{type:f,payload:{method:t,args:r}}}}var i="default"in e?e.default:e;r=r&&r.hasOwnProperty("default")?r.default:r;var u=Object.assign||function(t){for(var e=1;arguments.length>e;e++){var r=arguments[e];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},c="@@router/LOCATION_CHANGE",s={location:null},p=function(t){function e(){var r,o,a;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var i=arguments.length,u=Array(i),s=0;i>s;s++)u[s]=arguments[s];return r=o=n(this,t.call.apply(t,[this].concat(u))),o.handleLocationChange=function(t){o.store.dispatch({type:c,payload:t})},a=r,n(o,a)}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentWillMount=function(){var t=this.props,e=t.history,r=t.isSSR;this.store=t.store||this.context.store,this.handleLocationChange(e.location),r||(this.unsubscribeFromHistory=e.listen(this.handleLocationChange))},e.prototype.componentWillUnmount=function(){this.unsubscribeFromHistory&&this.unsubscribeFromHistory()},e.prototype.render=function(){return i.createElement(o.Router,this.props)},e}(e.Component);p.propTypes={store:r.object,history:r.object.isRequired,children:r.node,isSSR:r.bool},p.contextTypes={store:r.object};var l=function(t){return t.router.location},f="@@router/CALL_HISTORY_METHOD",h=a("push"),y=a("replace"),d=a("go"),b=a("goBack"),g=a("goForward"),v={push:h,replace:y,go:d,goBack:b,goForward:g};t.ConnectedRouter=p,t.routerMiddleware=function(t){return function(){return function(e){return function(r){if(r.type!==f)return e(r);var o=r.payload;t[o.method].apply(t,o.args)}}}},t.getLocation=l,t.createMatchSelector=function(t){var e=null,r=null;return function(n){var a=(l(n)||{}).pathname;if(a===e)return r;e=a;var i=o.matchPath(a,t);return i&&r&&i.url===r.url||(r=i),r}},t.LOCATION_CHANGE=c,t.routerReducer=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.type===c?u({},t,{location:e.payload}):t},t.CALL_HISTORY_METHOD=f,t.push=h,t.replace=y,t.go=d,t.goBack=b,t.goForward=g,t.routerActions=v,Object.defineProperty(t,"__esModule",{value:!0})});