├── .babelrc ├── .gitignore ├── README.md ├── config ├── default.json └── production.json ├── dist ├── about.component.js ├── about.component.js.map ├── common.js ├── common.js.map ├── contact.component.js ├── contact.component.js.map ├── home.component.js ├── home.component.js.map ├── index.html ├── main.js ├── main.js.map ├── vendor.js └── vendor.js.map ├── index.html ├── package-lock.json ├── package.json ├── postcss.config.js ├── src ├── about.component.js ├── contact.component.js ├── hello.component.js ├── home.component.js ├── index.js └── styles.scss └── webpack.config.js /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "env", 4 | "react" 5 | ], 6 | "plugins": [ 7 | "transform-decorators-legacy", 8 | "transform-class-properties", 9 | "transform-object-rest-spread", 10 | "syntax-dynamic-import" 11 | ] 12 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | build 3 | .DS_Store 4 | .vscode -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Follow my article on [Medium](https://medium.com/@thatisuday/react-router-and-webpack-v4-code-splitting-using-splitchunksplugin-f0a48f110312) 2 | -------------------------------------------------------------------------------- /config/default.json: -------------------------------------------------------------------------------- 1 | { 2 | "uglify": false, 3 | "sourcemap": false, 4 | "open": true, 5 | "publicPath": "/" 6 | } -------------------------------------------------------------------------------- /config/production.json: -------------------------------------------------------------------------------- 1 | { 2 | "uglify": true, 3 | "sourcemap": true, 4 | "open": false, 5 | "publicPath": "./" 6 | } -------------------------------------------------------------------------------- /dist/about.component.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[2],{32:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(1)),l=o(n(34));function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){return u.default.createElement("h1",null,"About Component! ",u.default.createElement(l.default,null))}}}]); 2 | //# sourceMappingURL=about.component.js.map -------------------------------------------------------------------------------- /dist/about.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/about.component.js"],"names":["__webpack_require__","props","_react2","default","createElement","_hello2"],"mappings":"0IACA,QAAAA,EAAA,QAEAA,EAAA,kEAEuB,SAAEC,GACrB,OACIC,EAAAC,QAAAC,cAAA,8BAAqBF,EAAAC,QAAAC,cAACC,EAAAF,QAAD","file":"about.component.js","sourcesContent":["// about.component.js\nimport React from 'react';\n\nimport HelloComponent from './hello.component';\n\nconst AboutComponent = ( props ) => {\n return (\n

About Component!

\n );\n}\n\nexport default AboutComponent;"],"sourceRoot":""} -------------------------------------------------------------------------------- /dist/common.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[0],{34:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=function(e){return e&&e.__esModule?e:{default:e}}(t(1));n.default=function(e){return o.default.createElement("span",{style:{color:"red"}},"Hello Component!")}}}]); 2 | //# sourceMappingURL=common.js.map -------------------------------------------------------------------------------- /dist/common.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/hello.component.js"],"names":["__webpack_require__","props","_react2","default","createElement","style","color"],"mappings":"0IACA,wDAAAA,EAAA,cAEuB,SAAEC,GACrB,OACIC,EAAAC,QAAAC,cAAA,QAAMC,OAAUC,MAAO,QAAvB","file":"common.js","sourcesContent":["// hello.component.js\nimport React from 'react';\n\nconst HelloComponent = ( props ) => {\n return (\n Hello Component!\n );\n}\n\nexport default HelloComponent;"],"sourceRoot":""} -------------------------------------------------------------------------------- /dist/contact.component.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{31:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var u=o(n(1)),l=o(n(34));function o(e){return e&&e.__esModule?e:{default:e}}t.default=function(e){return u.default.createElement("h1",null,"Contact Component! ",u.default.createElement(l.default,null))}}}]); 2 | //# sourceMappingURL=contact.component.js.map -------------------------------------------------------------------------------- /dist/contact.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/contact.component.js"],"names":["__webpack_require__","props","_react2","default","createElement","_hello2"],"mappings":"0IACA,QAAAA,EAAA,QAEAA,EAAA,kEAEyB,SAAEC,GACvB,OACIC,EAAAC,QAAAC,cAAA,gCAAuBF,EAAAC,QAAAC,cAACC,EAAAF,QAAD","file":"contact.component.js","sourcesContent":["// contact.component.js\nimport React from 'react';\n\nimport HelloComponent from './hello.component';\n\nconst ContactComponent = ( props ) => {\n return (\n

Contact Component!

\n );\n}\n\nexport default ContactComponent;"],"sourceRoot":""} -------------------------------------------------------------------------------- /dist/home.component.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[3],{33:function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var u=o(t(1)),l=o(t(34));function o(e){return e&&e.__esModule?e:{default:e}}n.default=function(e){return u.default.createElement("h1",null,"Home Component! ",u.default.createElement(l.default,null))}}}]); 2 | //# sourceMappingURL=home.component.js.map -------------------------------------------------------------------------------- /dist/home.component.js.map: -------------------------------------------------------------------------------- 1 | {"version":3,"sources":["webpack:///./src/home.component.js"],"names":["__webpack_require__","props","_react2","default","createElement","_hello2"],"mappings":"0IACA,QAAAA,EAAA,QAEAA,EAAA,kEAEsB,SAAEC,GACpB,OACIC,EAAAC,QAAAC,cAAA,6BAAoBF,EAAAC,QAAAC,cAACC,EAAAF,QAAD","file":"home.component.js","sourcesContent":["// home.component.js\nimport React from 'react';\n\nimport HelloComponent from './hello.component';\n\nconst HomeComponent = ( props ) => {\n return (\n

Home Component!

\n );\n}\n\nexport default HomeComponent;"],"sourceRoot":""} -------------------------------------------------------------------------------- /dist/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Webpack SCP Demo 6 | 7 | 8 |
9 | Hello World! 10 |
11 | 12 | -------------------------------------------------------------------------------- /dist/main.js: -------------------------------------------------------------------------------- 1 | !function(e){function t(t){for(var o,u,l=t[0],i=t[1],c=t[2],s=0,p=[];sa,html .menu>a{display:inline-block;margin:0 10px;text-decoration:none}body .menu>a.active,html .menu>a.active{text-decoration:underline}",""])},16:function(e,t,n){var o=n(15);"string"==typeof o&&(o=[[e.i,o,""]]);var r={hmr:!0,transform:void 0,insertInto:void 0};n(13)(o,r);o.locals&&(e.exports=o.locals)},30:function(e,t,n){"use strict";var o=function(){function e(e,t){for(var n=0;na,html .menu>a{display:inline-block;margin:0 10px;text-decoration:none}body .menu>a.active,html .menu>a.active{text-decoration:underline}\", \"\"]);\n\n// exports\n","\nvar content = require(\"!!../node_modules/css-loader/index.js!../node_modules/postcss-loader/lib/index.js!../node_modules/sass-loader/lib/loader.js!./styles.scss\");\n\nif(typeof content === 'string') content = [[module.id, content, '']];\n\nvar transform;\nvar insertInto;\n\n\n\nvar options = {\"hmr\":true}\n\noptions.transform = transform\noptions.insertInto = undefined;\n\nvar update = require(\"!../node_modules/style-loader/lib/addStyles.js\")(content, options);\n\nif(content.locals) module.exports = content.locals;\n\nif(module.hot) {\n\tmodule.hot.accept(\"!!../node_modules/css-loader/index.js!../node_modules/postcss-loader/lib/index.js!../node_modules/sass-loader/lib/loader.js!./styles.scss\", function() {\n\t\tvar newContent = require(\"!!../node_modules/css-loader/index.js!../node_modules/postcss-loader/lib/index.js!../node_modules/sass-loader/lib/loader.js!./styles.scss\");\n\n\t\tif(typeof newContent === 'string') newContent = [[module.id, newContent, '']];\n\n\t\tvar locals = (function(a, b) {\n\t\t\tvar key, idx = 0;\n\n\t\t\tfor(key in a) {\n\t\t\t\tif(!b || a[key] !== b[key]) return false;\n\t\t\t\tidx++;\n\t\t\t}\n\n\t\t\tfor(key in b) idx--;\n\n\t\t\treturn idx === 0;\n\t\t}(content.locals, newContent.locals));\n\n\t\tif(!locals) throw new Error('Aborting CSS HMR due to changed css-modules locals.');\n\n\t\tupdate(newContent);\n\t});\n\n\tmodule.hot.dispose(function() { update(); });\n}","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport { BrowserRouter, Switch, NavLink as Link, Route } from 'react-router-dom';\nimport loadable from 'react-loadable';\n\nimport './styles.scss';\n\n// loading view\nconst LoadingComponent = () =>

please wait...

;\n\n// home component\n//import HomeComponent from './home.component';\n\nconst AsyncHomeComponent = loadable( {\n loader: () => import( './home.component' ),\n loading: LoadingComponent\n} );\n\n// about component\nconst AsyncAboutComponent = loadable( {\n loader: () => import( './about.component' ),\n loading: LoadingComponent\n} );\n\n// contact component\nconst AsyncContactComponent = loadable( {\n loader: () => import( './contact.component' ),\n loading: LoadingComponent\n} );\n\n// create sample App component\nclass App extends React.Component {\n constructor( props ) {\n super( props );\n }\n\n render() {\n return(\n \n
\n
\n Home\n About\n Contact\n
\n \n \n \n \n \n \n
\n
\n );\n }\n}\n\n// render inside `app-root` element\nReactDOM.render( , document.getElementById( 'app-root' ) );"],"sourceRoot":""} -------------------------------------------------------------------------------- /dist/vendor.js: -------------------------------------------------------------------------------- 1 | (window.webpackJsonp=window.webpackJsonp||[]).push([[4],[function(e,t,n){e.exports=n(20)()},function(e,t,n){"use strict";e.exports=n(29)},function(e,t,n){"use strict";var r=function(){};e.exports=r},function(e,t,n){"use strict";e.exports=function(e,t,n,r,o,i,a,l){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,o,i,a,l],s=0;(u=new Error(t.replace(/%s/g,function(){return c[s++]}))).name="Invariant Violation"}throw u.framesToPop=1,u}}},function(e,t,n){"use strict";e.exports=function(){}},function(e,t,n){var r=n(18);e.exports=h,e.exports.parse=i,e.exports.compile=function(e,t){return u(i(e,t))},e.exports.tokensToFunction=u,e.exports.tokensToRegExp=d;var o=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function i(e,t){for(var n,r=[],i=0,a=0,l="",u=t&&t.delimiter||"/";null!=(n=o.exec(e));){var f=n[0],p=n[1],d=n.index;if(l+=e.slice(a,d),a=d+f.length,p)l+=p[1];else{var h=e[a],m=n[2],y=n[3],v=n[4],g=n[5],b=n[6],w=n[7];l&&(r.push(l),l="");var x=null!=m&&null!=h&&h!==m,k="+"===b||"*"===b,E="?"===b||"*"===b,C=n[2]||u,T=v||g;r.push({name:y||i++,prefix:m||"",delimiter:C,optional:E,repeat:k,partial:x,asterisk:!!w,pattern:T?s(T):w?".*":"[^"+c(C)+"]+?"})}}return a1&&void 0!==arguments[1]?arguments[1]:"",n=e&&e.split("/")||[],r=t&&t.split("/")||[],o=e&&d(e),i=t&&d(t),a=o||i;if(e&&d(e)?r=n:n.length&&(r.pop(),r=r.concat(n)),!r.length)return"/";var l=void 0;if(r.length){var u=r[r.length-1];l="."===u||".."===u||""===u}else l=!1;for(var c=0,s=r.length;s>=0;s--){var f=r[s];"."===f?h(r,s):".."===f?(h(r,s),c++):c&&(h(r,s),c--)}if(!a)for(;c--;c)r.unshift("..");!a||""===r[0]||r[0]&&d(r[0])||r.unshift("");var p=r.join("/");return l&&"/"!==p.substr(-1)&&(p+="/"),p},y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var v=function e(t,n){if(t===n)return!0;if(null==t||null==n)return!1;if(Array.isArray(t))return Array.isArray(n)&&t.length===n.length&&t.every(function(t,r){return e(t,n[r])});var r=void 0===t?"undefined":y(t);if(r!==(void 0===n?"undefined":y(n)))return!1;if("object"===r){var o=t.valueOf(),i=n.valueOf();if(o!==t||i!==n)return e(o,i);var a=Object.keys(t),l=Object.keys(n);return a.length===l.length&&a.every(function(r){return e(t[r],n[r])})}return!1},g=function(e){return"/"===e.charAt(0)?e:"/"+e},b=function(e){return"/"===e.charAt(0)?e.substr(1):e},w=function(e,t){return new RegExp("^"+t+"(\\/|\\?|#|$)","i").test(e)},x=function(e,t){return w(e,t)?e.substr(t.length):e},k=function(e){return"/"===e.charAt(e.length-1)?e.slice(0,-1):e},E=function(e){var t=e.pathname,n=e.search,r=e.hash,o=t||"/";return n&&"?"!==n&&(o+="?"===n.charAt(0)?n:"?"+n),r&&"#"!==r&&(o+="#"===r.charAt(0)?r:"#"+r),o},C=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{};p()(P,"Browser history needs a DOM");var t=window.history,n=function(){var e=window.navigator.userAgent;return(-1===e.indexOf("Android 2.")&&-1===e.indexOf("Android 4.0")||-1===e.indexOf("Mobile Safari")||-1!==e.indexOf("Chrome")||-1!==e.indexOf("Windows Phone"))&&window.history&&"pushState"in window.history}(),r=!(-1===window.navigator.userAgent.indexOf("Trident")),o=e.forceRefresh,i=void 0!==o&&o,a=e.getUserConfirmation,l=void 0===a?N:a,u=e.keyLength,c=void 0===u?6:u,f=e.basename?k(g(e.basename)):"",d=function(e){var t=e||{},n=t.key,r=t.state,o=window.location,i=o.pathname+o.search+o.hash;return s()(!f||w(i,f),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+i+'" to begin with "'+f+'".'),f&&(i=x(i,f)),T(i,r,n)},h=function(){return Math.random().toString(36).substr(2,c)},m=S(),y=function(e){U(H,e),H.length=t.length,m.notifyListeners(H.location,H.action)},v=function(e){(function(e){return void 0===e.state&&-1===navigator.userAgent.indexOf("CriOS")})(e)||_(d(e.state))},b=function(){_(d(M()))},C=!1,_=function(e){C?(C=!1,y()):m.confirmTransitionTo(e,"POP",l,function(t){t?y({action:"POP",location:e}):I(e)})},I=function(e){var t=H.location,n=A.indexOf(t.key);-1===n&&(n=0);var r=A.indexOf(e.key);-1===r&&(r=0);var o=n-r;o&&(C=!0,D(o))},L=d(M()),A=[L.key],F=function(e){return f+E(e)},D=function(e){t.go(e)},z=0,B=function(e){1===(z+=e)?(O(window,"popstate",v),r&&O(window,"hashchange",b)):0===z&&(R(window,"popstate",v),r&&R(window,"hashchange",b))},W=!1,H={length:t.length,action:"POP",location:L,createHref:F,push:function(e,r){s()(!("object"===(void 0===e?"undefined":j(e))&&void 0!==e.state&&void 0!==r),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var o=T(e,r,h(),H.location);m.confirmTransitionTo(o,"PUSH",l,function(e){if(e){var r=F(o),a=o.key,l=o.state;if(n)if(t.pushState({key:a,state:l},null,r),i)window.location.href=r;else{var u=A.indexOf(H.location.key),c=A.slice(0,-1===u?0:u+1);c.push(o.key),A=c,y({action:"PUSH",location:o})}else s()(void 0===l,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=r}})},replace:function(e,r){s()(!("object"===(void 0===e?"undefined":j(e))&&void 0!==e.state&&void 0!==r),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var o=T(e,r,h(),H.location);m.confirmTransitionTo(o,"REPLACE",l,function(e){if(e){var r=F(o),a=o.key,l=o.state;if(n)if(t.replaceState({key:a,state:l},null,r),i)window.location.replace(r);else{var u=A.indexOf(H.location.key);-1!==u&&(A[u]=o.key),y({action:"REPLACE",location:o})}else s()(void 0===l,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(r)}})},go:D,goBack:function(){return D(-1)},goForward:function(){return D(1)},block:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=m.setPrompt(e);return W||(B(1),W=!0),function(){return W&&(W=!1,B(-1)),t()}},listen:function(e){var t=m.appendListener(e);return B(1),function(){B(-1),t()}}};return H},L=Object.assign||function(e){for(var t=1;t=0?t:0)+"#"+e)},z=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};p()(P,"Hash history needs a DOM");var t=window.history,n=-1===window.navigator.userAgent.indexOf("Firefox"),r=e.getUserConfirmation,o=void 0===r?N:r,i=e.hashType,a=void 0===i?"slash":i,l=e.basename?k(g(e.basename)):"",u=A[a],c=u.encodePath,f=u.decodePath,d=function(){var e=f(F());return s()(!l||w(e,l),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+e+'" to begin with "'+l+'".'),l&&(e=x(e,l)),T(e)},h=S(),m=function(e){L(q,e),q.length=t.length,h.notifyListeners(q.location,q.action)},y=!1,v=null,b=function(){var e=F(),t=c(e);if(e!==t)D(t);else{var n=d(),r=q.location;if(!y&&_(r,n))return;if(v===E(n))return;v=null,C(n)}},C=function(e){y?(y=!1,m()):h.confirmTransitionTo(e,"POP",o,function(t){t?m({action:"POP",location:e}):j(e)})},j=function(e){var t=q.location,n=z.lastIndexOf(E(t));-1===n&&(n=0);var r=z.lastIndexOf(E(e));-1===r&&(r=0);var o=n-r;o&&(y=!0,B(o))},U=F(),M=c(U);U!==M&&D(M);var I=d(),z=[E(I)],B=function(e){s()(n,"Hash history go(n) causes a full page reload in this browser"),t.go(e)},W=0,H=function(e){1===(W+=e)?O(window,"hashchange",b):0===W&&R(window,"hashchange",b)},V=!1,q={length:t.length,action:"POP",location:I,createHref:function(e){return"#"+c(l+E(e))},push:function(e,t){s()(void 0===t,"Hash history cannot push state; it is ignored");var n=T(e,void 0,void 0,q.location);h.confirmTransitionTo(n,"PUSH",o,function(e){if(e){var t=E(n),r=c(l+t);if(F()!==r){v=t,function(e){window.location.hash=e}(r);var o=z.lastIndexOf(E(q.location)),i=z.slice(0,-1===o?0:o+1);i.push(t),z=i,m({action:"PUSH",location:n})}else s()(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),m()}})},replace:function(e,t){s()(void 0===t,"Hash history cannot replace state; it is ignored");var n=T(e,void 0,void 0,q.location);h.confirmTransitionTo(n,"REPLACE",o,function(e){if(e){var t=E(n),r=c(l+t);F()!==r&&(v=t,D(r));var o=z.indexOf(E(q.location));-1!==o&&(z[o]=t),m({action:"REPLACE",location:n})}})},go:B,goBack:function(){return B(-1)},goForward:function(){return B(1)},block:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=h.setPrompt(e);return V||(H(1),V=!0),function(){return V&&(V=!1,H(-1)),t()}},listen:function(e){var t=h.appendListener(e);return H(1),function(){H(-1),t()}}};return q},B="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},W=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.getUserConfirmation,n=e.initialEntries,r=void 0===n?["/"]:n,o=e.initialIndex,i=void 0===o?0:o,a=e.keyLength,l=void 0===a?6:a,u=S(),c=function(e){W(y,e),y.length=y.entries.length,u.notifyListeners(y.location,y.action)},f=function(){return Math.random().toString(36).substr(2,l)},p=H(i,0,r.length-1),d=r.map(function(e){return T(e,void 0,"string"==typeof e?f():e.key||f())}),h=E,m=function(e){var n=H(y.index+e,0,y.entries.length-1),r=y.entries[n];u.confirmTransitionTo(r,"POP",t,function(e){e?c({action:"POP",location:r,index:n}):c()})},y={length:d.length,action:"POP",location:d[p],index:p,entries:d,createHref:h,push:function(e,n){s()(!("object"===(void 0===e?"undefined":B(e))&&void 0!==e.state&&void 0!==n),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var r=T(e,n,f(),y.location);u.confirmTransitionTo(r,"PUSH",t,function(e){if(e){var t=y.index+1,n=y.entries.slice(0);n.length>t?n.splice(t,n.length-t,r):n.push(r),c({action:"PUSH",location:r,index:t,entries:n})}})},replace:function(e,n){s()(!("object"===(void 0===e?"undefined":B(e))&&void 0!==e.state&&void 0!==n),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var r=T(e,n,f(),y.location);u.confirmTransitionTo(r,"REPLACE",t,function(e){e&&(y.entries[y.index]=r,c({action:"REPLACE",location:r}))})},go:m,goBack:function(){return m(-1)},goForward:function(){return m(1)},canGo:function(e){var t=y.index+e;return t>=0&&t0&&void 0!==arguments[0]&&arguments[0];return u.setPrompt(e)},listen:function(e){return u.appendListener(e)}};return y},q=Object.assign||function(e){for(var t=1;t may have only one child element"),this.unlisten=r.listen(function(){e.setState({match:e.computeMatch(r.location.pathname)})})},t.prototype.componentWillReceiveProps=function(e){o()(this.props.history===e.history,"You cannot change ")},t.prototype.componentWillUnmount=function(){this.unlisten()},t.prototype.render=function(){var e=this.props.children;return e?a.a.Children.only(e):null},t}(a.a.Component);Y.propTypes={history:u.a.object.isRequired,children:u.a.node},Y.contextTypes={router:u.a.object},Y.childContextTypes={router:u.a.object.isRequired};var K=Y,Q=K;function G(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var X=function(e){function t(){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a ignores the history prop. To use a custom history, use `import { Router }` instead of `import { BrowserRouter as Router }`.")},t.prototype.render=function(){return a.a.createElement(Q,{history:this.history,children:this.props.children})},t}(a.a.Component);X.propTypes={basename:u.a.string,forceRefresh:u.a.bool,getUserConfirmation:u.a.func,keyLength:u.a.number,children:u.a.node};var J=X;function Z(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var ee=function(e){function t(){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a ignores the history prop. To use a custom history, use `import { Router }` instead of `import { HashRouter as Router }`.")},t.prototype.render=function(){return a.a.createElement(Q,{history:this.history,children:this.props.children})},t}(a.a.Component);ee.propTypes={basename:u.a.string,getUserConfirmation:u.a.func,hashType:u.a.oneOf(["hashbang","noslash","slash"]),children:u.a.node};var te=ee,ne=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["replace","to","innerRef"]);p()(this.context.router,"You should not use outside a "),p()(void 0!==t,'You must specify the "to" property');var o=this.context.router.history,i="string"==typeof t?T(t,null,null,o.location):t,l=o.createHref(i);return a.a.createElement("a",ne({},r,{onClick:this.handleClick,href:l,ref:n}))},t}(a.a.Component);ie.propTypes={onClick:u.a.func,target:u.a.string,replace:u.a.bool,to:u.a.oneOfType([u.a.string,u.a.object]).isRequired,innerRef:u.a.oneOfType([u.a.string,u.a.func])},ie.defaultProps={replace:!1},ie.contextTypes={router:u.a.shape({history:u.a.shape({push:u.a.func.isRequired,replace:u.a.func.isRequired,createHref:u.a.func.isRequired}).isRequired}).isRequired};var ae=ie;function le(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}var ue=function(e){function t(){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a ignores the history prop. To use a custom history, use `import { Router }` instead of `import { MemoryRouter as Router }`.")},t.prototype.render=function(){return a.a.createElement(K,{history:this.history,children:this.props.children})},t}(a.a.Component);ue.propTypes={initialEntries:u.a.array,initialIndex:u.a.number,getUserConfirmation:u.a.func,keyLength:u.a.number,children:u.a.node};var ce=ue,se=n(5),fe=n.n(se),pe={},de=0,he=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];"string"==typeof t&&(t={path:t});var r=t,o=r.path,i=r.exact,a=void 0!==i&&i,l=r.strict,u=void 0!==l&&l,c=r.sensitive,s=void 0!==c&&c;if(null==o)return n;var f=function(e,t){var n=""+t.end+t.strict+t.sensitive,r=pe[n]||(pe[n]={});if(r[e])return r[e];var o=[],i={re:fe()(e,o,t),keys:o};return de<1e4&&(r[e]=i,de++),i}(o,{end:a,strict:u,sensitive:s}),p=f.re,d=f.keys,h=p.exec(e);if(!h)return null;var m=h[0],y=h.slice(1),v=e===m;return a&&!v?null:{path:o,url:"/"===o&&""===m?"/":m,isExact:v,params:d.reduce(function(e,t,n){return e[t.name]=y[n],e},{})}},me=Object.assign||function(e){for(var t=1;t or withRouter() outside a ");var u=t.route,c=(r||u.location).pathname;return he(c,{path:o,strict:i,exact:a,sensitive:l},u.match)},t.prototype.componentWillMount=function(){o()(!(this.props.component&&this.props.render),"You should not use and in the same route; will be ignored"),o()(!(this.props.component&&this.props.children&&!ve(this.props.children)),"You should not use and in the same route; will be ignored"),o()(!(this.props.render&&this.props.children&&!ve(this.props.children)),"You should not use and in the same route; will be ignored")},t.prototype.componentWillReceiveProps=function(e,t){o()(!(e.location&&!this.props.location),' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),o()(!(!e.location&&this.props.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'),this.setState({match:this.computeMatch(e,t.router)})},t.prototype.render=function(){var e=this.state.match,t=this.props,n=t.children,r=t.component,o=t.render,i=this.context.router,l=i.history,u=i.route,c=i.staticContext,s={match:e,location:this.props.location||u.location,history:l,staticContext:c};return r?e?a.a.createElement(r,s):null:o?e?o(s):null:"function"==typeof n?n(s):n&&!ve(n)?a.a.Children.only(n):null},t}(a.a.Component);ge.propTypes={computedMatch:u.a.object,path:u.a.string,exact:u.a.bool,strict:u.a.bool,sensitive:u.a.bool,component:u.a.func,render:u.a.func,children:u.a.oneOfType([u.a.func,u.a.node]),location:u.a.object},ge.contextTypes={router:u.a.shape({history:u.a.object.isRequired,route:u.a.object.isRequired,staticContext:u.a.object})},ge.childContextTypes={router:u.a.object.isRequired};var be=ge,we=be,xe=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["to","exact","strict","location","activeClassName","className","activeStyle","style","isActive","aria-current"]),d="object"===(void 0===t?"undefined":ke(t))?t.pathname:t,h=d&&d.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1");return a.a.createElement(we,{path:h,exact:n,strict:r,location:o,children:function(e){var n=e.location,r=e.match,o=!!(s?s(r,n):r);return a.a.createElement(ae,xe({to:t,className:o?[l,i].filter(function(e){return e}).join(" "):l,style:o?xe({},c,u):c,"aria-current":o&&f||null},p))}})};Ee.propTypes={to:ae.propTypes.to,exact:u.a.bool,strict:u.a.bool,location:u.a.object,activeClassName:u.a.string,className:u.a.string,activeStyle:u.a.object,style:u.a.object,isActive:u.a.func,"aria-current":u.a.oneOf(["page","step","location","date","time","true"])},Ee.defaultProps={activeClassName:"active","aria-current":"page"};var Ce=Ee;var Te=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.enable=function(e){this.unblock&&this.unblock(),this.unblock=this.context.router.history.block(e)},t.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},t.prototype.componentWillMount=function(){p()(this.context.router,"You should not use outside a "),this.props.when&&this.enable(this.props.message)},t.prototype.componentWillReceiveProps=function(e){e.when?this.props.when&&this.props.message===e.message||this.enable(e.message):this.disable()},t.prototype.componentWillUnmount=function(){this.disable()},t.prototype.render=function(){return null},t}(a.a.Component);Te.propTypes={when:u.a.bool,message:u.a.oneOfType([u.a.func,u.a.string]).isRequired},Te.defaultProps={when:!0},Te.contextTypes={router:u.a.shape({history:u.a.shape({block:u.a.func.isRequired}).isRequired}).isRequired};var _e=Te,Se={},Pe=0,Oe=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"/"===e?e:function(e){var t=e,n=Se[t]||(Se[t]={});if(n[e])return n[e];var r=fe.a.compile(e);return Pe<1e4&&(n[e]=r,Pe++),r}(e)(t,{pretty:!0})},Re=Object.assign||function(e){for(var t=1;t outside a "),this.isStatic()&&this.perform()},t.prototype.componentDidMount=function(){this.isStatic()||this.perform()},t.prototype.componentDidUpdate=function(e){var t=T(e.to),n=T(this.props.to);_(t,n)?o()(!1,"You tried to redirect to the same route you're currently on: \""+n.pathname+n.search+'"'):this.perform()},t.prototype.computeTo=function(e){var t=e.computedMatch,n=e.to;return t?"string"==typeof n?Oe(n,t.params):Re({},n,{pathname:Oe(n.pathname,t.params)}):n},t.prototype.perform=function(){var e=this.context.router.history,t=this.props.push,n=this.computeTo(this.props);t?e.push(n):e.replace(n)},t.prototype.render=function(){return null},t}(a.a.Component);Ne.propTypes={computedMatch:u.a.object,push:u.a.bool,from:u.a.string,to:u.a.oneOfType([u.a.string,u.a.object]).isRequired},Ne.defaultProps={push:!1},Ne.contextTypes={router:u.a.shape({history:u.a.shape({push:u.a.func.isRequired,replace:u.a.func.isRequired}).isRequired,staticContext:u.a.object}).isRequired};var je=Ne,Ue=Object.assign||function(e){for(var t=1;t",e)}},De=function(){},ze=function(e){function t(){var n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t);for(var o=arguments.length,i=Array(o),a=0;a ignores the history prop. To use a custom history, use `import { Router }` instead of `import { StaticRouter as Router }`.")},t.prototype.render=function(){var e=this.props,t=e.basename,n=(e.context,e.location),r=function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(e,["basename","context","location"]),o={createHref:this.createHref,action:"POP",location:function(e,t){if(!e)return t;var n=Ie(e);return 0!==t.pathname.indexOf(n)?t:Ue({},t,{pathname:t.pathname.substr(n.length)})}(t,T(n)),push:this.handlePush,replace:this.handleReplace,go:Fe("go"),goBack:Fe("goBack"),goForward:Fe("goForward"),listen:this.handleListen,block:this.handleBlock};return a.a.createElement(K,Ue({},r,{history:o}))},t}(a.a.Component);ze.propTypes={basename:u.a.string,context:u.a.object.isRequired,location:u.a.oneOfType([u.a.string,u.a.object])},ze.defaultProps={basename:"",location:"/"},ze.childContextTypes={router:u.a.object.isRequired};var Be=ze;var We=function(e){function t(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.componentWillMount=function(){p()(this.context.router,"You should not use outside a ")},t.prototype.componentWillReceiveProps=function(e){o()(!(e.location&&!this.props.location),' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),o()(!(!e.location&&this.props.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.')},t.prototype.render=function(){var e=this.context.router.route,t=this.props.children,n=this.props.location||e.location,r=void 0,o=void 0;return a.a.Children.forEach(t,function(t){if(null==r&&a.a.isValidElement(t)){var i=t.props,l=i.path,u=i.exact,c=i.strict,s=i.sensitive,f=i.from,p=l||f;o=t,r=he(n.pathname,{path:p,exact:u,strict:c,sensitive:s},e.match)}}),r?a.a.cloneElement(o,{location:n,computedMatch:r}):null},t}(a.a.Component);We.contextTypes={router:u.a.shape({route:u.a.object.isRequired}).isRequired},We.propTypes={children:u.a.node,location:u.a.object};var He=We,Ve=Oe,qe=he,$e=n(10),Ye=n.n($e),Ke=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["wrappedComponentRef"]);return a.a.createElement(be,{children:function(t){return a.a.createElement(e,Ke({},r,t,{ref:n}))}})};return t.displayName="withRouter("+(e.displayName||e.name)+")",t.WrappedComponent=e,t.propTypes={wrappedComponentRef:u.a.func},Ye()(t,e)};n.d(t,"BrowserRouter",function(){return J}),n.d(t,"HashRouter",function(){return te}),n.d(t,"Link",function(){return ae}),n.d(t,"MemoryRouter",function(){return ce}),n.d(t,"NavLink",function(){return Ce}),n.d(t,"Prompt",function(){return _e}),n.d(t,"Redirect",function(){return je}),n.d(t,"Route",function(){return we}),n.d(t,"Router",function(){return Q}),n.d(t,"StaticRouter",function(){return Be}),n.d(t,"Switch",function(){return He}),n.d(t,"generatePath",function(){return Ve}),n.d(t,"matchPath",function(){return qe}),n.d(t,"withRouter",function(){return Qe})},function(e,t){e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var n=t.protocol+"//"+t.host,r=n+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,function(e,t){var o,i=t.trim().replace(/^"(.*)"$/,function(e,t){return t}).replace(/^'(.*)'$/,function(e,t){return t});return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(o=0===i.indexOf("//")?i:0===i.indexOf("/")?n+i:r+i.replace(/^\.\//,""),"url("+JSON.stringify(o)+")")})}},function(e,t,n){var r={},o=function(e){var t;return function(){return void 0===t&&(t=e.apply(this,arguments)),t}}(function(){return window&&document&&document.all&&!window.atob}),i=function(e){var t={};return function(e){if("function"==typeof e)return e();if(void 0===t[e]){var n=function(e){return document.querySelector(e)}.call(this,e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}}(),a=null,l=0,u=[],c=n(12);function s(e,t){for(var n=0;n=0&&u.splice(t,1)}function h(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),m(t,e.attrs),p(e,t),t}function m(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function y(e,t){var n,r,o,i;if(t.transform&&e.css){if(!(i=t.transform(e.css)))return function(){};e.css=i}if(t.singleton){var u=l++;n=a||(a=h(t)),r=g.bind(null,n,u,!1),o=g.bind(null,n,u,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",m(t,e.attrs),p(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,i=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||i)&&(r=c(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var a=new Blob([r],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(a),l&&URL.revokeObjectURL(l)}.bind(null,n,t),o=function(){d(n),n.href&&URL.revokeObjectURL(n.href)}):(n=h(t),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute("media",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){d(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=o()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=f(e,t);return s(n,t),function(e){for(var o=[],i=0;ithis.eventPool.length&&this.eventPool.push(e)}function Ee(e){e.eventPool=[],e.getPooled=xe,e.release=ke}a(we.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=l.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=l.thatReturnsTrue)},persist:function(){this.isPersistent=l.thatReturnsTrue},isPersistent:l.thatReturnsFalse,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;for(t=0;t=Pe),Ne=String.fromCharCode(32),je={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["compositionend","keypress","textInput","paste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"blur compositionend keydown keypress keyup mousedown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"blur compositionstart keydown keypress keyup mousedown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"blur compositionupdate keydown keypress keyup mousedown".split(" ")}},Ue=!1;function Me(e,t){switch(e){case"keyup":return-1!==_e.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"blur":return!0;default:return!1}}function Ie(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Le=!1;var Ae={eventTypes:je,extractEvents:function(e,t,n,r){var o=void 0,i=void 0;if(Se)e:{switch(e){case"compositionstart":o=je.compositionStart;break e;case"compositionend":o=je.compositionEnd;break e;case"compositionupdate":o=je.compositionUpdate;break e}o=void 0}else Le?Me(e,n)&&(o=je.compositionEnd):"keydown"===e&&229===n.keyCode&&(o=je.compositionStart);return o?(Re&&(Le||o!==je.compositionStart?o===je.compositionEnd&&Le&&(i=ye()):(me._root=r,me._startText=ve(),Le=!0)),o=Ce.getPooled(o,t,n,r),i?o.data=i:null!==(i=Ie(n))&&(o.data=i),ee(o),i=o):i=null,(e=Oe?function(e,t){switch(e){case"compositionend":return Ie(t);case"keypress":return 32!==t.which?null:(Ue=!0,Ne);case"textInput":return(e=t.data)===Ne&&Ue?null:e;default:return null}}(e,n):function(e,t){if(Le)return"compositionend"===e||!Se&&Me(e,t)?(e=ye(),me._root=null,me._startText=null,me._fallbackText=null,Le=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1