commit e87edf45a1ef17026665a497106a387a711b18df Author: Daniel Date: Thu Apr 27 15:03:28 2017 -0400 Add SPA for GitHub Pages boilerplate diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..562a5e3 --- /dev/null +++ b/.babelrc @@ -0,0 +1,3 @@ +{ + "presets": ["es2015", "react", "stage-1"] +} diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..55d6d50 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,23 @@ +{ + "root": true, + "parser": "babel-eslint", + "extends": "airbnb", + "env": { + "browser": true + }, + "rules": { + "no-unused-expressions": ["error", { "allowShortCircuit": true, "allowTernary": true }], + "no-plusplus": "off", + "import/no-extraneous-dependencies": ["error", {"devDependencies": ["./webpack.config.babel.js"]}], + "react/forbid-prop-types": "off", + "react/jsx-filename-extension": "off" + }, + "parserOptions": { + "ecmaFeatures": { + "experimentalObjectRestSpread": true + } + }, + "plugins": [ + "react" + ] +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..22c9377 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +# Dependency directory +node_modules + +# Source maps +*.js.map + +# Files marked with gitigx +*gitigx* diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..348985d --- /dev/null +++ b/404.html @@ -0,0 +1,41 @@ + + + + + Single Page Apps for GitHub Pages + + + + + diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..5a433bc --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +spa-github-pages.rafrex.com diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..2d5624d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2016 Rafael Pedicini + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..804747a --- /dev/null +++ b/README.md @@ -0,0 +1,115 @@ +# Single Page Apps for GitHub Pages + +[Live example][liveExample] + +This is a lightweight solution for deploying single page apps with [GitHub Pages][ghPagesOverview]. You can easily deploy a [React][react] single page app with [React Router][reactRouter] `browserHistory`, like the one in the [live example][liveExample], or a single page app built with any frontend library or framework. + +#### Why it's necessary +GitHub Pages doesn't natively support single page apps. When there is a fresh page load for a url like `example.tld/foo`, where `/foo` is a frontend route, the GitHub Pages server returns 404 because it knows nothing of `/foo`. + +#### How it works +When the GitHub Pages server gets a request for a path defined with frontend routes, e.g. `example.tld/foo`, it returns a custom `404.html` page. The [custom `404.html` page contains a script][404html] that takes the current url and converts the path and query string into just a query string, and then redirects the browser to the new url with only a query string and hash fragment. For example, `example.tld/one/two?a=b&c=d#qwe`, becomes `example.tld/?p=/one/two&q=a=b~and~c=d#qwe`. + +The GitHub Pages server receives the new request, e.g. `example.tld?p=/...`, ignores the query string and hash fragment and returns the `index.html` file, which has a [script that checks for a redirect in the query string][indexHtmlScript] before the single page app is loaded. If a redirect is present it is converted back into the correct url and added to the browser's history with `window.history.replaceState(...)`, but the browser won't attempt to load the new url. When the [single page app is loaded][indexHtmlSPA] further down in the `index.html` file, the correct url will be waiting in the browser's history for the single page app to route accordingly. (Note that these redirects are only needed with fresh page loads, and not when navigating within the single page app once it's loaded). + +A quick SEO note - while it's never good to have a 404 response, it appears based on [Search Engine Land's testing][seoLand] that Google's crawler will treat the JavaScript `window.location` redirect in the `404.html` file the same as a 301 redirect for its indexing. From my testing I can confirm that Google will index all pages without issue, the only caveat is that the redirect query is what Google indexes as the url. For example, the url `example.tld/about` will get indexed as `example.tld/?p=/about`. When the user clicks on the search result, the url will change back to `example.tld/about` once the site loads. + + +## Usage instructions +*For general information on using GitHub Pages please see [GitHub Pages Basics][ghPagesBasics], note that pages can be [User, Organization or Project Pages][ghPagesTypes]* +  + +**Basic instructions** - there are two things you need from this repo for your single page app to run on GitHub Pages + 1. Copy over the [`404.html`][404html] file to your repo as is + - Note that if you are setting up a Project Pages site and not using a [custom domain][customDomain] (i.e. your site's address is `username.github.io/repo-name`), then you need to set [`segmentCount` to `1` in the `404.html` file][segmentCount] in order to keep `/repo-name` in the path after the redirect. + 2. Copy the [redirect script][indexHtmlScript] in the `index.html` file and add it to your `index.html` file + - Note that the redirect script must be placed *before* your single page app script in your `index.html` file +  + +**Detailed instructions** - using this repo as a boilerplate for a React single page app hosted with GitHub Pages + 1. Clone this repo (`$ git clone https://github.com/rafrex/spa-github-pages.git`) + 2. Delete the `.git` directory (`cd` into the `spa-github-pages` directory and run `$ rm -rf .git`) + 3. Instantiate the repository + - If you're using this boilerplate as a new repository + - `$ git init` in the `spa-github-pages` directory, and then `$ git add .` and `$ git commit -m "Add SPA for GitHub Pages boilerplate"` to initialize a fresh repository + - If this will be a Project Pages site, then change the branch name from `master` to `gh-pages` (`$ git branch -m gh-pages`), if this will be a User or Organization Pages site, then leave the branch name as `master` + - Create an empty repo on GitHub.com (don't add a readme, gitignore or license), and add it as a remote to the local repo (`$ git remote add origin `) + - Feel free to rename the local `spa-github-pages` directory to anything you want (e.g. `your-project-name`) + - If you're adding this boilerplate as the `gh-pages` branch of an existing repository + - Create and checkout a new orphaned branch named `gh-pages` for your existing repo (`$ git checkout --orphan gh-pages`), note that the `gh-pages` branch won't appear in the list of branches until you make your first commit + - Delete all of the files and directories (except the `.git` directory) from the directory of your existing repo (`$ git rm -rf .`) + - Copy all of the files and directories (including hidden dot files) from the cloned `spa-github-pages` directory into your project's now empty directory (`$ mv path/to/spa-github-pages/{.[!.],}* path/to/your-projects-directory`) + - `$ git add .` and `$ git commit -m "Add SPA for GitHub Pages boilerplate"` to instantiate the `gh-pages` branch + 4. Set up a custom domain (optional) - see GitHub Pages instructions for [setting up a custom domain][customDomain] + - Update the [`CNAME` file][cnameFile] with your custom domain, don't include `http://`, but do include a subdomain if desired, e.g. `www` or `your-subdomain` + - Update your `CNAME` and/or `A` record with your DNS provider + - Run `$ dig your-subdomain.your-domain.tld` to make sure it's set up properly with your DNS (don't include `http://`) + 5. Set up without using a custom domain (optional) + - Delete the [`CNAME` file][cnameFile] + - If you are creating a User or Organization Pages site, then that's all you need to do + - If you are creating a Project Pages site, (i.e. your site's address is `username.github.io/repo-name`): + - Set [`segmentCount` to `1` in the `404.html` file][segmentCount] in order to keep `/repo-name` in the path after the redirect + - Add your `repo-name` to the absolute path of assets in `index.html` + - Change the [bundle.js src][indexHtmlSPA] to `"/repo-name/build/bundle.js"` + - If you are using React Router, you'll need to add the `repo-name` prefix to your routes and links, for example: + - `` + - `About` + 6. Run `$ npm install` to install React and other dependencies, and then run `$ webpack` to update the build + 7. `$ git add .` and `$ git commit -m "Update boilerplate for use with my domain"` and then push to GitHub (`$ git push origin gh-pages` for Project Pages or `$ git push origin master` for User or Organization Pages) - the example site should now be live on your domain + 8. Create your own site + - Write your own React components, create your own routes, and add your own style + - Note that the example site is created with all inline styles and uses [React Interactive][reactInteractive] for the links and other interactive components (there is no CSS except for a reset in `index.html`) + - Change the [title in `index.html`][indexHtmlTitle] and the [title in `404.html`][404htmlTitle] to your site's title + - Remove the [favicon links][favicon] from the header of `index.html` + - Remove the [Google analytics script][googleAnalytics] from the header of `index.html` (the analytics function is wrapped in an `if` statement so that it will only run on the example site's domain (http://spa-github-pages.rafrex.com), but you don't need it, so remove it or replace it with your own analytics) + - Change the readme, license and package.json as you see fit + - For testing changes locally see development environment info below + - To publish your changes to GitHub Pages run `$ webpack -p` for [production][webpackProduction] to update the build, then `$ git commit` and `$ git push` to make your changes live + - Note that `$ webpack -p` is [overloaded in the webpack config][webpackConfigOverload] to make React run faster (e.g. no PropType checking, etc) and strip out dead code not needed in production (e.g. comments, etc) + +#### Development environment +I have included `webpack-dev-server` for testing changes locally. It can be accessed by running `$ npm start` (details below), or you can use your own dev setup by running `$ webpack` and serving the `index.html` file and the `404.html` file for 404s. Note that `webpack-dev-server` automatically creates a new bundle whenever the source files change and serves the bundle from memory, so you'll never see the bundle as a file saved to disk. +- `$ npm start` runs the [start script][startScript] in `package.json`, which runs the command `$ webpack-dev-server -d --inline --host 0.0.0.0 --history-api-fallback --progress` + - `-d` is for [development mode with source maps][webpackDevelopment] + - `--inline` runs the server in [inline mode][webpackInline] which means that it will automatically push changes to the browser so you don't have to refresh the page + - `--host 0.0.0.0` makes the server listen for requests from the local network and not just the localhost, this is very useful for testing your site on a mobile device connected to your local network + - `--history-api-fallback` allows for frontend routing and will serve `index.html` when the requested file can't be found + - `--progress` shows the progress of the compilation in the command line +- `webpack-dev-server` will serve `index.html` at `http://localhost:8080` (port 8080 is the default). Note that you must load the `index.html` from the server and not just open it directly in the browser or the scripts won't load. + +#### Miscellaneous +- The `.nojekyll` file in this repo [turns off Jekyll for GitHub Pages][nojekyll] +- Need form submission on your static site? Use [Formspree][formspree] +- One of the great things about the GitHub Pages CDN is that all files are automatically compressed with gzip, so no need to worry about compressing your JavaScript, HTML or CSS files for production + + + +[404html]: https://github.com/rafrex/spa-github-pages/blob/gh-pages/404.html +[segmentCount]: https://github.com/rafrex/spa-github-pages/blob/gh-pages/404.html#L26 +[indexHtmlScript]: https://github.com/rafrex/spa-github-pages/blob/gh-pages/index.html#L58 +[indexHtmlSPA]: https://github.com/rafrex/spa-github-pages/blob/gh-pages/index.html#L113 +[cnameFile]: https://github.com/rafrex/spa-github-pages/blob/gh-pages/CNAME +[indexHtmlTitle]: https://github.com/rafrex/spa-github-pages/blob/gh-pages/index.html#L6 +[404htmlTitle]: https://github.com/rafrex/spa-github-pages/blob/gh-pages/404.html#L5 +[favicon]: https://github.com/rafrex/spa-github-pages/blob/gh-pages/index.html#L34 +[googleAnalytics]: https://github.com/rafrex/spa-github-pages/blob/gh-pages/index.html#L90 +[webpackConfigOverload]: https://github.com/rafrex/spa-github-pages/blob/gh-pages/webpack.config.babel.js#L21 +[startScript]: https://github.com/rafrex/spa-github-pages/blob/gh-pages/package.json#L6 + + +[ghPagesOverview]: https://pages.github.com/ +[ghPagesBasics]: https://help.github.com/categories/github-pages-basics/ +[ghPagesTypes]: https://help.github.com/articles/user-organization-and-project-pages/ +[customDomain]: https://help.github.com/articles/quick-start-setting-up-a-custom-domain/ +[nojekyll]: https://help.github.com/articles/files-that-start-with-an-underscore-are-missing/ + + +[liveExample]: http://spa-github-pages.rafrex.com +[react]: https://github.com/facebook/react +[reactRouter]: https://github.com/reactjs/react-router +[seoLand]: http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157 +[webpackProduction]: https://webpack.github.io/docs/cli.html#production-shortcut-p +[webpackDevelopment]: https://webpack.github.io/docs/cli.html#development-shortcut-d +[webpackInline]: https://webpack.github.io/docs/webpack-dev-server.html#inline-mode +[reactInteractive]: https://github.com/rafrex/react-interactive +[formspree]: http://formspree.io/ diff --git a/build/bundle.js b/build/bundle.js new file mode 100644 index 0000000..df329ce --- /dev/null +++ b/build/bundle.js @@ -0,0 +1,8 @@ +!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="/build/",t(0)}([function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}var o=n(4),a=r(o),i=n(142),u=n(35),s=n(112),c=r(s),l=n(115),p=r(l),f=n(116),d=r(f),h=n(113),v=r(h),m=n(114),y=r(m),g=a.default.createElement(u.Route,{path:"/",mapMenuTitle:"Home",component:c.default},a.default.createElement(u.IndexRoute,{component:p.default}),a.default.createElement(u.Route,{path:"example",mapMenuTitle:"Example",component:v.default},a.default.createElement(u.Route,{path:"two-deep",mapMenuTitle:"Two Deep",component:y.default})),a.default.createElement(u.Route,{path:"*",mapMenuTitle:"Page Not Found",component:d.default}));(0,i.render)(a.default.createElement(u.Router,{history:u.browserHistory,routes:g}),document.getElementById("root"))},function(e,t,n){"use strict";function r(e,t,n,r,a,i,u,s){if(o(t),!e){var c;if(void 0===t)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,a,i,u,s],p=0;c=new Error(t.replace(/%s/g,function(){return l[p++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(9),o=r;e.exports=o},function(e,t){"use strict";function n(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r0?void 0:(0,f.default)(!1),null!=p&&(a+=encodeURI(p));else if("("===c)s[o]="",o+=1;else if(")"===c){var v=s.pop();o-=1,o?s[o-1]+=v:a+=v}else if(":"===c.charAt(0))if(l=c.substring(1),p=t[l],null!=p||o>0?void 0:(0,f.default)(!1),null==p){if(o){s[o-1]="";for(var m=r.indexOf(c),y=r.slice(m,r.length),g=-1,b=0;b0?void 0:(0,f.default)(!1),d=m+g-1}}else o?s[o-1]+=encodeURIComponent(p):a+=encodeURIComponent(p);else o?s[o-1]+=c:a+=c;return o<=0?void 0:(0,f.default)(!1),a.replace(/\/+/g,"/")}t.__esModule=!0,t.compilePattern=i,t.matchPattern=u,t.getParamNames=s,t.getParams=c,t.formatPattern=l;var p=n(8),f=r(p),d=Object.create(null)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(t.indexOf("deprecated")!==-1){if(s[t])return;s[t]=!0}t="[react-router] "+t;for(var n=arguments.length,r=Array(n>2?n-2:0),o=2;o1){for(var m=Array(v),y=0;y1){for(var b=Array(g),_=0;_ should not have a "'+t+'" prop')}t.__esModule=!0,t.routes=t.route=t.components=t.component=t.history=void 0,t.falsy=r;var o=n(4),a=o.PropTypes.func,i=o.PropTypes.object,u=o.PropTypes.arrayOf,s=o.PropTypes.oneOfType,c=o.PropTypes.element,l=o.PropTypes.shape,p=o.PropTypes.string,f=(t.history=l({listen:a.isRequired,push:a.isRequired,replace:a.isRequired,go:a.isRequired,goBack:a.isRequired,goForward:a.isRequired}),t.component=s([a,p])),d=(t.components=s([f,i]),t.route=s([i,c]));t.routes=s([d,u(d)])},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.createMemoryHistory=t.hashHistory=t.browserHistory=t.applyRouterMiddleware=t.formatPattern=t.useRouterHistory=t.match=t.routerShape=t.locationShape=t.RouterContext=t.createRoutes=t.Route=t.Redirect=t.IndexRoute=t.IndexRedirect=t.withRouter=t.IndexLink=t.Link=t.Router=void 0;var o=n(15);Object.defineProperty(t,"createRoutes",{enumerable:!0,get:function(){return o.createRoutes}});var a=n(68);Object.defineProperty(t,"locationShape",{enumerable:!0,get:function(){return a.locationShape}}),Object.defineProperty(t,"routerShape",{enumerable:!0,get:function(){return a.routerShape}});var i=n(23);Object.defineProperty(t,"formatPattern",{enumerable:!0,get:function(){return i.formatPattern}});var u=n(224),s=r(u),c=n(99),l=r(c),p=n(220),f=r(p),d=n(235),h=r(d),v=n(221),m=r(v),y=n(222),g=r(y),b=n(101),_=r(b),C=n(223),T=r(C),k=n(69),E=r(k),w=n(233),P=r(w),x=n(106),O=r(x),S=n(226),M=r(S),N=n(227),R=r(N),A=n(231),I=r(A),D=n(103),L=r(D); +t.Router=s.default,t.Link=l.default,t.IndexLink=f.default,t.withRouter=h.default,t.IndexRedirect=m.default,t.IndexRoute=g.default,t.Redirect=_.default,t.Route=T.default,t.RouterContext=E.default,t.match=P.default,t.useRouterHistory=O.default,t.applyRouterMiddleware=M.default,t.browserHistory=R.default,t.hashHistory=I.default,t.createMemoryHistory=L.default},function(e,t){"use strict";t.__esModule=!0,t.PUSH="PUSH",t.REPLACE="REPLACE",t.POP="POP"},function(e,t){"use strict";t.__esModule=!0,t.addEventListener=function(e,t,n){return e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)},t.removeEventListener=function(e,t,n){return e.removeEventListener?e.removeEventListener(t,n,!1):e.detachEvent("on"+t,n)},t.supportsHistory=function(){var e=window.navigator.userAgent;return(e.indexOf("Android 2.")===-1&&e.indexOf("Android 4.0")===-1||e.indexOf("Mobile Safari")===-1||e.indexOf("Chrome")!==-1||e.indexOf("Windows Phone")!==-1)&&window.history&&"pushState"in window.history},t.supportsGoWithoutReloadUsingHash=function(){return window.navigator.userAgent.indexOf("Firefox")===-1},t.supportsPopstateOnHashchange=function(){return window.navigator.userAgent.indexOf("Trident")===-1}},function(e,t,n){"use strict";function r(e){return Object.prototype.hasOwnProperty.call(e,v)||(e[v]=d++,p[e[v]]={}),p[e[v]]}var o,a=n(5),i=n(51),u=n(171),s=n(90),c=n(204),l=n(62),p={},f=!1,d=0,h={topAbort:"abort",topAnimationEnd:c("animationend")||"animationend",topAnimationIteration:c("animationiteration")||"animationiteration",topAnimationStart:c("animationstart")||"animationstart",topBlur:"blur",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topChange:"change",topClick:"click",topCompositionEnd:"compositionend",topCompositionStart:"compositionstart",topCompositionUpdate:"compositionupdate",topContextMenu:"contextmenu",topCopy:"copy",topCut:"cut",topDoubleClick:"dblclick",topDrag:"drag",topDragEnd:"dragend",topDragEnter:"dragenter",topDragExit:"dragexit",topDragLeave:"dragleave",topDragOver:"dragover",topDragStart:"dragstart",topDrop:"drop",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topScroll:"scroll",topSeeked:"seeked",topSeeking:"seeking",topSelectionChange:"selectionchange",topStalled:"stalled",topSuspend:"suspend",topTextInput:"textInput",topTimeUpdate:"timeupdate",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:c("transitionend")||"transitionend",topVolumeChange:"volumechange",topWaiting:"waiting",topWheel:"wheel"},v="_reactListenersID"+String(Math.random()).slice(2),m=a({},u,{ReactEventListener:null,injection:{injectReactEventListener:function(e){e.setHandleTopLevel(m.handleTopLevel),m.ReactEventListener=e}},setEnabled:function(e){m.ReactEventListener&&m.ReactEventListener.setEnabled(e)},isEnabled:function(){return!(!m.ReactEventListener||!m.ReactEventListener.isEnabled())},listenTo:function(e,t){for(var n=t,o=r(n),a=i.registrationNameDependencies[e],u=0;u]/;e.exports=r},function(e,t,n){"use strict";var r,o=n(7),a=n(50),i=/^[ \r\n\t\f]/,u=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,s=n(58),c=s(function(e,t){if(e.namespaceURI!==a.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML=""+t+"";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(o.canUseDOM){var l=document.createElement("div");l.innerHTML=" ",""===l.innerHTML&&(c=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),i.test(t)||"<"===t[0]&&u.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),l=null}e.exports=c},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(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}function i(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)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t=t.left-1&&n<=t.right+1&&r>=t.top-1&&r<=t.bottom+1}if(!x.deviceHasMouse)return null;var n=e&&e.clientX||k.default.mouse.clientX,r=e&&e.clientY||k.default.mouse.clientY,o=!0;return o=!!k.default.mouse.mouseOnDocument&&(this.p.props.nonContainedChild?(0,C.default)(this.topNode,t):t(this.topNode)),o?"mouseOn":"mouseOff"}},{key:"manageFocus",value:function(e,t){var n=this;if(t&&(T.focusRegistry.focus===t||T.focusRegistry.blur===t))return"updateState";var r=!x.nonBlurrableTags[this.tagName]&&!this.p.props.focusToggleOff,o=this.p.props.tabIndex||x.knownRoleTags[this.tagName],a=function(e,a,i){return("force"===i||"focus"===e&&o||"blur"===e&&r)&&(t&&(T.focusRegistry[e]=t,n.manageSetTimeout("focusRegistry",function(){T.focusRegistry[e]=null},0)),n.track.focusTransition=a,n.topNode[e](),n.track.focusTransition!==a)?"terminate":(n.track.focusTransition="reset","updateState")},i=function(e,t){return n.track.state.focus?a("blur",e+"Blur",t):a("focus",e+"Focus",t)};switch(e){case"mousedown":return a("focus","mouseDownFocus");case"mouseup":return this.track.focusStateOnMouseDown?a("blur","mouseUpBlur"):(this.track.focusTransition="reset","updateState");case"touchclick":return i("touchClick");case"forceStateFocusTrue":return this.manageSetTimeout("forceStateFocusTrue",function(){!n.track.state.focus&&a("focus","forceStateFocus","force")},0),"terminate";case"forceStateFocusFalse":return this.manageSetTimeout("forceStateFocusFalse",function(){n.track.state.focus&&a("blur","forceStateBlur","force")},0),"terminate";case"refCallback":return this.track.state.focus?a("focus","refCallbackFocus","force"):(this.track.focusTransition="reset","terminate");case"focusForceBlur":return a("blur","focusForceBlur","force");default:return"updateState"}}},{key:"handleMouseEvent",value:function(e){switch(e.type){case"mouseenter":return(0,T.updateMouseFromRI)(e),this.p.props.onMouseEnter&&this.p.props.onMouseEnter(e),this.track.mouseOn=!0,this.track.buttonDown=1===e.buttons,"updateState";case"mouseleave":return(0,T.updateMouseFromRI)(e),this.p.props.onMouseLeave&&this.p.props.onMouseLeave(e),this.track.mouseOn=!1,this.track.buttonDown=!1,"updateState";case"mousemove":return this.p.props.onMouseMove&&this.p.props.onMouseMove(e),this.track.mouseOn&&this.track.buttonDown===(1===e.buttons)?"terminate":(this.track.mouseOn=!0,this.track.buttonDown=1===e.buttons,"updateState");case"mousedown":return this.p.props.onMouseDown&&this.p.props.onMouseDown(e),this.track.mouseOn=!0,this.track.buttonDown=!0,this.track.focusStateOnMouseDown=this.track.state.focus,this.manageFocus("mousedown",e);case"mouseup":this.p.props.onMouseUp&&this.p.props.onMouseUp(e),this.track.buttonDown=!1;var t=this.manageFocus("mouseup",e);return this.manageClick("mouseClick"),t;default:return"terminate"}}},{key:"handleTouchEvent",value:function(e){var t=this;this.track.mouseOn=!1,this.track.buttonDown=!1;var n=function(){t.track.touchDown=!1,t.track.touches={points:{},active:0},t.cancelTimeout("touchTapTimer")},r=function(){t.track.recentTouch=!0,t.manageSetTimeout("recentTouchTimer",function(){t.track.recentTouch=!1},x.queueTime)},o=function(){return t.p.props.extraTouchNoTap&&e.touches.length!==t.track.touches.active||t.track.touches.active>t.maxTapPoints},a=function(e,t,n){return Math.abs(e.clientX-t.startX)>=15+3*n||Math.abs(e.clientY-t.startY)>=15+3*n},i=function(n){for(var r=0;r0)return n(),"updateState";if(this.track.touches.touchend=!0,0===this.track.touches.active&&(this.track.touches.tapCanceled||o()))return n(),"updateState";if(this.track.touches.tapCanceled)return"terminate";if(o())return this.handleTouchEvent({type:"touchtapcancel"});if(i("client"),0===this.track.touches.active){var l=this.track.touches.points,p=Object.keys(l),f=p.length,d=p.every(function(e){return!a(l[e],l[e],f)})?f:0;switch(n(),d){case 1:var h="updateState";return(this.p.props.active||this.p.props.touchActive)&&(h=this.manageFocus("touchclick",e),this.manageClick("tapClick")),h;case 2:this.p.props.onTapTwo&&this.p.props.onTapTwo(e);break;case 3:this.p.props.onTapThree&&this.p.props.onTapThree(e);break;case 4:this.p.props.onTapFour&&this.p.props.onTapFour(e)}}return"updateState";case"touchcancel":return r(),this.p.props.onTouchCancel&&this.p.props.onTouchCancel(e),this.track.touches.active-=e.changedTouches.length,0===this.track.touches.active?(n(),"updateState"):this.handleTouchEvent({type:"touchtapcancel"});case"touchtapcancel":return this.cancelTimeout("touchTapTimer"),this.track.touchDown&&(this.track.touches.tapCanceled=!0,this.p.props.touchActiveTapOnly)?(this.track.touchDown=!1,"updateState"):"terminate";default:return"terminate"}}},{key:"manageClick",value:function(e){var t=this;this.cancelTimeout("clickType");var n=function(){t.manageSetTimeout("clickType",function(){t.track.clickType="reset"},x.queueTime)};switch(e){case"mouseClick":this.track.clickType="mouseClick",n();break;case"tapClick":this.track.clickType="tapClick",(0,P.default)(this.topNode),this.track.clickType="reset";break;case"keyClick":this.track.clickType="keyClick",x.knownRoleTags[this.tagName]?n():this.p.props.onClick&&this.manageSetTimeout("keyClickAfterSetState",function(){t.topNode.click(),t.track.clickType="reset"},32)}}},{key:"handleClickEvent",value:function(e){this.cancelTimeout("clickType");var t="terminate";if("reset"===this.track.clickType){var n="input"===this.tagName&&"submit"===this.type&&k.default.key.recentEnterKeyDown;n?this.track.clickType="keyClick":k.default.touch.recentTouch||k.default.touch.touchOnScreen||"touchOnly"===x.deviceType?(t=this.manageFocus("touchclick",e),this.track.keyClick="tapClick"):this.track.keyClick="mouseClick"}return this.p.props.onClick&&this.p.props.onClick(e,this.track.clickType),this.track.clickType="reset",t}},{key:"handleOtherEvent",value:function(e){switch(e.type){case"focus":if(this.p.props.onFocus&&this.p.props.onFocus(e),e.target!==this.topNode)return"terminate";if(this.cancelTimeout("windowFocus"),"reset"!==this.track.focusTransition||!this.track.focus){var t=this.track.focusTransition.toLowerCase();/mouse/.test(t)?this.track.focus="mouse":/touch/.test(t)||this.track.touchDown?this.track.focus="touch":this.track.previousFocus?this.track.focus=this.track.previousFocus:/forceState/.test(t)||(this.track.focus="tab")}return this.track.focusTransition="reset","updateState";case"blur":return this.p.props.onBlur&&this.p.props.onBlur(e),e.target!==this.topNode?"terminate":(this.track.focusTransition="reset",this.track.previousFocus=this.track.focus,this.track.focus=!1,this.track.spaceKeyDown=!1,this.track.enterKeyDown=!1,"updateState");case"keydown":if(this.p.props.onKeyDown&&this.p.props.onKeyDown(e),!this.track.focus)return"terminate";if(" "===e.key)this.track.spaceKeyDown=!0;else{if("Enter"!==e.key)return"terminate";this.track.enterKeyDown=!0,this.enterKeyTrigger&&this.manageClick("keyClick")}return"updateState";case"keyup":if(this.p.props.onKeyUp&&this.p.props.onKeyUp(e),!this.track.focus)return"terminate";if("Enter"===e.key)this.track.enterKeyDown=!1;else{if(" "!==e.key)return"terminate";this.track.spaceKeyDown=!1,this.spaceKeyTrigger&&this.manageClick("keyClick")}return"updateState";case"dragstart":return this.p.props.onDragStart&&this.p.props.onDragStart(e),this.track.drag=!0,"updateState";case"dragend":return this.p.props.onDragEnd&&this.p.props.onDragEnd(e),this.forceTrackIState("normal"),"updateState";default:return"terminate"}}},{key:"computeStyle",value:function(){var e={};this.p.props.useBrowserOutlineFocus||!this.p.props.focusFromTab&&("tab"===this.state.focus||x.nonBlurrableTags[this.tagName])||(e.outline=0,e.outlineOffset=0),(this.p.props.touchActive||this.p.props.active)&&x.deviceHasTouch&&(e.WebkitTapHighlightColor="rgba(0, 0, 0, 0)");var t="string"==typeof this.p.props.as&&this.p.props.as.toLowerCase();this.p.props.useBrowserCursor||!(this.p.props.onClick||"input"!==t&&this.p.props.tabIndex&&(this.p.mouseFocusStyle.style||this.p.mouseFocusStyle.className)||"input"===t&&("checkbox"===this.p.props.type||"radio"===this.p.props.type||"submit"===this.p.props.type)||"button"===t||"a"===t||"area"===t||"select"===t)||this.p.props.disabled||(e.cursor="pointer"),(0,f.default)(e,this.p.props.style);var n="keyActive"===this.state.iState||this.p.props.stylePriority&&this.p.props.stylePriority[this.state.iState],r=this.p[this.state.iState+"Style"].style,o=this.state.focus?this.p[this.state.focus+"FocusStyle"].style:null;return n?(0,f.default)(e,o,r):(0,f.default)(e,r,o),e}},{key:"computeClassName",value:function(){return(0,b.joinClasses)(this.p.props.className||"",this.p[this.state.iState+"Style"].className,this.state.focus?this.p[this.state.focus+"FocusStyle"].className:"")}},{key:"computeChildren",value:function(){var e=this,n=this.state.focus&&"focusFrom"+this.state.focus.charAt(0).toUpperCase()+this.state.focus.slice(1),r=this.p.props.stylePriority&&this.p.props.stylePriority[this.state.iState],o=function(t){var o=t.style?u({},t.style):{};(0,b.setActiveAndFocusProps)(t);var a=(0,b.extractStyle)(t,e.state.iState),i=e.state.focus&&(0,b.extractStyle)(t,n);return{className:(0,b.joinClasses)(t.className||"",a.className,i&&i.className||""),style:r&&(0,f.default)(o,i.style,a.style)||(0,f.default)(o,a.style,i.style)}},a=function r(a){return l.default.Children.map(a,function(a){if(!l.default.isValidElement(a))return a;if(a.props.showOnParent){var i=a.props.showOnParent.split(" ");if(!i.some(function(t){return t===e.state.iState||/Active/.test(e.state.iState)&&"active"===t||e.state.focus&&(t===n||"focus"===t)}))return null}var u=Object.keys(a.props);if(!u.some(function(e){return x.childInteractiveProps[e]}))return a.type===t?a:l.default.cloneElement(a,{},r(a.props.children));var s={},c={};u.forEach(function(e){x.childInteractiveProps[e]?"showOnParent"!==e&&(c[""+e.slice(8).charAt(0).toLowerCase()+e.slice(9)]=a.props[e]):s[e]=a.props[e]}),c.style=a.props.style,c.className=a.props.className;var p=o(c),f=p.style,d=p.className;return s.style=f,d&&(s.className=d),l.default.createElement(a.type,s,a.type===t?a.props.children:r(a.props.children))})};return a(this.p.props.children)}},{key:"render",value:function(){this.p.passThroughProps.style=this.computeStyle();var e=this.computeClassName();e&&(this.p.passThroughProps.className=e);var t=this.p.props.interactiveChild?this.computeChildren():this.p.props.children;return"string"==typeof this.p.props.as?(this.p.passThroughProps.ref=this.refCallback,l.default.createElement(this.p.props.as,this.p.passThroughProps,t)):l.default.createElement("span",{ref:this.refCallback},l.default.createElement(this.p.props.as,this.p.passThroughProps,t))}}]),t}(l.default.Component);O.propTypes=h.default,t.default=O,e.exports=t.default},function(e,t){"use strict";function n(e,t){return e===t?0!==e||0!==t||1/e===1/t:e!==e&&t!==t}function r(e,t){if(n(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(var i=0;i-1?void 0:i("96",e),!c.plugins[n]){t.extractEvents?void 0:i("97",e),c.plugins[n]=t;var r=t.eventTypes;for(var a in r)o(r[a],t,a)?void 0:i("98",a,e)}}}function o(e,t,n){c.eventNameDispatchConfigs.hasOwnProperty(n)?i("99",n):void 0,c.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var o in r)if(r.hasOwnProperty(o)){var u=r[o];a(u,t,n)}return!0}return!!e.registrationName&&(a(e.registrationName,t,n),!0)}function a(e,t,n){c.registrationNameModules[e]?i("100",e):void 0,c.registrationNameModules[e]=t,c.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var i=n(3),u=(n(1),null),s={},c={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},possibleRegistrationNames:null,injectEventPluginOrder:function(e){u?i("101"):void 0,u=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];s.hasOwnProperty(n)&&s[n]===o||(s[n]?i("102",n):void 0,s[n]=o,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return c.registrationNameModules[t.registrationName]||null;if(void 0!==t.phasedRegistrationNames){var n=t.phasedRegistrationNames;for(var r in n)if(n.hasOwnProperty(r)){var o=c.registrationNameModules[n[r]];if(o)return o}}return null},_resetEventPlugins:function(){u=null;for(var e in s)s.hasOwnProperty(e)&&delete s[e];c.plugins.length=0;var t=c.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=c.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};e.exports=c},function(e,t,n){"use strict";function r(e){return"topMouseUp"===e||"topTouchEnd"===e||"topTouchCancel"===e}function o(e){return"topMouseMove"===e||"topTouchMove"===e}function a(e){return"topMouseDown"===e||"topTouchStart"===e}function i(e,t,n,r){var o=e.type||"unknown-event";e.currentTarget=y.getNodeFromInstance(r),t?v.invokeGuardedCallbackWithCatch(o,n,e):v.invokeGuardedCallback(o,n,e),e.currentTarget=null}function u(e,t){var n=e._dispatchListeners,r=e._dispatchInstances;if(Array.isArray(n))for(var o=0;o0&&r.length<20?n+" (keys: "+r.join(", ")+")":n}function a(e,t){var n=u.get(e);return n?n:null}var i=n(3),u=(n(13),n(32)),s=(n(10),n(11)),c=(n(1),n(2),{isMounted:function(e){var t=u.get(e);return!!t&&!!t._renderedComponent},enqueueCallback:function(e,t,n){c.validateCallback(t,n);var o=a(e);return o?(o._pendingCallbacks?o._pendingCallbacks.push(t):o._pendingCallbacks=[t],void r(o)):null},enqueueCallbackInternal:function(e,t){e._pendingCallbacks?e._pendingCallbacks.push(t):e._pendingCallbacks=[t],r(e)},enqueueForceUpdate:function(e){var t=a(e,"forceUpdate");t&&(t._pendingForceUpdate=!0,r(t))},enqueueReplaceState:function(e,t){var n=a(e,"replaceState");n&&(n._pendingStateQueue=[t],n._pendingReplaceState=!0,r(n))},enqueueSetState:function(e,t){var n=a(e,"setState");if(n){var o=n._pendingStateQueue||(n._pendingStateQueue=[]);o.push(t),r(n)}},enqueueElementInternal:function(e,t,n){e._pendingElement=t,e._context=n,r(e)},validateCallback:function(e,t){e&&"function"!=typeof e?i("122",t,o(e)):void 0}});e.exports=c},function(e,t){"use strict";var n=function(e){return"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e};e.exports=n},function(e,t){"use strict";function n(e){var t,n=e.keyCode;return"charCode"in e?(t=e.charCode,0===t&&13===n&&(t=13)):t=n,t>=32||13===t?t:0}e.exports=n},function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return!!r&&!!n[r]}function r(e){return n}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=r},function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return t.correspondingUseElement&&(t=t.correspondingUseElement),3===t.nodeType?t.parentNode:t}e.exports=n},function(e,t,n){"use strict";function r(e,t){if(!a.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var i=document.createElement("div");i.setAttribute(n,"return;"),r="function"==typeof i[n]}return!r&&o&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var o,a=n(7);a.canUseDOM&&(o=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=r},function(e,t){"use strict";function n(e,t){var n=null===e||e===!1,r=null===t||t===!1;if(n||r)return n===r;var o=typeof e,a=typeof t;return"string"===o||"number"===o?"string"===a||"number"===a:"object"===a&&e.type===t.type&&e.key===t.key}e.exports=n},function(e,t,n){"use strict";var r=(n(5),n(9)),o=(n(2),r);e.exports=o},function(e,t,n){"use strict";function r(e){return v===Number.MAX_SAFE_INTEGER&&(v=0),v++,void 0===h[e][v]?v:r(e)}function o(e,t){var n=r(e);return h[e][n]=d[e].push({id:n,callback:t})-1,n}function a(e,t){"undefined"!==h[e][t]&&(d[e][h[e][t]].callback=m,delete h[e][t])}function i(e,t){e.forEach(function(e){f[e]=t})}function u(e){f[e.type](e)}function s(e){if(0!==d[e.type].length){e.persist=m;var t=[],n={};d[e.type].forEach(function(r){"reNotifyOfNext"===r.callback(e)&&(n[r.id]=t.push(r)-1)}),d[e.type]=t,h[e.type]=n}}function c(e){u(e),s(e)}function l(e,t,n,r){d[t]=[],h[t]={},e.addEventListener(t,n,p.passiveEventSupport?{capture:r,passive:"click"!==t}:r)}Object.defineProperty(t,"__esModule",{value:!0}),t.notifyOfNext=o,t.cancelNotifyOfNext=a,t.notifyOfAll=i;var p=n(18),f={},d={},h={},v=0,m=function(){};if(p.deviceHasTouch&&(l(window,"click",u,!0),Object.keys(p.touchEvents).forEach(function(e){l(document,e,"touchstart"===e?c:u,!0)})),p.deviceHasMouse){Object.keys(p.mouseEvents).forEach(function(e){l(document,e,"mouseenter"===e?c:u,!("mouseenter"===e||"mouseleave"===e))}),l(document,"dragstart",s,!0),p.passiveEventSupport&&l(document,"scroll",s,!0),d.mutation=[],h.mutation={};var y=(0,p.dummyEvent)("mutation"),g=new MutationObserver(s.bind(null,y));g.observe(document,{childList:!0,attributes:!0,subtree:!0,characterData:!0})}["focus","blur"].forEach(function(e){l(window,e,s,!1)}),l(document,"keydown",u,!0)},function(e,t){"use strict";function n(e,t,n){function r(){return i=!0,u?void(c=[].concat(Array.prototype.slice.call(arguments))):void n.apply(this,arguments)}function o(){if(!i&&(s=!0,!u)){for(u=!0;!i&&a=e&&s&&(i=!0,n()))}}var a=0,i=!1,u=!1,s=!1,c=void 0;o()}function r(e,t,n){function r(e,t,r){i||(t?(i=!0,n(t)):(a[e]=r,i=++u===o,i&&n(null,a)))}var o=e.length,a=[];if(0===o)return n(null,a);var i=!1,u=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}t.__esModule=!0,t.loopAsync=n,t.mapAsync=r},function(e,t,n){"use strict";function r(e){return"@@contextSubscriber/"+e}function o(e){var t,n,o=r(e),a=o+"/listeners",i=o+"/eventIndex",s=o+"/subscribe";return n={childContextTypes:(t={},t[o]=u.isRequired,t),getChildContext:function(){var e;return e={},e[o]={eventIndex:this[i],subscribe:this[s]},e},componentWillMount:function(){this[a]=[],this[i]=0},componentWillReceiveProps:function(){this[i]++},componentDidUpdate:function(){var e=this;this[a].forEach(function(t){return t(e[i])})}},n[s]=function(e){var t=this;return this[a].push(e),function(){t[a]=t[a].filter(function(t){return t!==e})}},n}function a(e){var t,n,o=r(e),a=o+"/lastRenderedEventIndex",i=o+"/handleContextUpdate",s=o+"/unsubscribe";return n={contextTypes:(t={},t[o]=u,t),getInitialState:function(){var e;return this.context[o]?(e={},e[a]=this.context[o].eventIndex,e):{}},componentDidMount:function(){this.context[o]&&(this[s]=this.context[o].subscribe(this[i]))},componentWillReceiveProps:function(){var e;this.context[o]&&this.setState((e={},e[a]=this.context[o].eventIndex,e))},componentWillUnmount:function(){this[s]&&(this[s](),this[s]=null)}},n[i]=function(e){if(e!==this.state[a]){var t;this.setState((t={},t[a]=e,t))}},n}t.__esModule=!0,t.ContextProvider=o,t.ContextSubscriber=a;var i=n(4),u=i.PropTypes.shape({subscribe:i.PropTypes.func.isRequired,eventIndex:i.PropTypes.number.isRequired})},function(e,t,n){"use strict";t.__esModule=!0,t.locationShape=t.routerShape=void 0;var r=n(4),o=r.PropTypes.func,a=r.PropTypes.object,i=r.PropTypes.shape,u=r.PropTypes.string;t.routerShape=i({push:o.isRequired,replace:o.isRequired,go:o.isRequired,goBack:o.isRequired,goForward:o.isRequired,setRouteLeaveHook:o.isRequired,isActive:o.isRequired}),t.locationShape=i({pathname:u.isRequired,search:u.isRequired,state:a,action:u.isRequired,key:u})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t1?t-1:0),o=1;o1?t-1:0),o=1;o1)for(var n=1;n.":"function"==typeof t?" Instead of passing a class like Foo, pass React.createElement(Foo) or .":null!=t&&void 0!==t.props?" This may be caused by unintentionally loading two independent copies of React.":"");var i,u=m.createElement(F,{child:t});if(e){var s=T.get(e);i=s._processChildContext(s._context)}else i=x;var l=f(n);if(l){var p=l._currentElement,h=p.props.child;if(M(h,t)){var v=l._renderedComponent.getPublicInstance(),y=r&&function(){r.call(v)};return U._updateRootComponent(l,u,i,n,y),v}U.unmountComponentAtNode(n)}var g=o(n),b=g&&!!a(g),_=c(n),C=b&&!l&&!_,k=U._renderNewRootComponent(u,n,C,i)._renderedComponent.getPublicInstance();return r&&r.call(k),k},render:function(e,t,n){return U._renderSubtreeIntoContainer(null,e,t,n)},unmountComponentAtNode:function(e){l(e)?void 0:d("40");var t=f(e);return t?(delete L[t._instance.rootID],P.batchedUpdates(s,t,e,!1),!0):(c(e),1===e.nodeType&&e.hasAttribute(R),!1)},_mountImageIntoNode:function(e,t,n,a,i){if(l(t)?void 0:d("41"),a){var u=o(t);if(k.canReuseMarkup(e,u))return void g.precacheNode(n,u);var s=u.getAttribute(k.CHECKSUM_ATTR_NAME);u.removeAttribute(k.CHECKSUM_ATTR_NAME);var c=u.outerHTML;u.setAttribute(k.CHECKSUM_ATTR_NAME,s);var p=e,f=r(p,c),v=" (client) "+p.substring(f-20,f+20)+"\n (server) "+c.substring(f-20,f+20);t.nodeType===I?d("42",v):void 0}if(t.nodeType===I?d("43"):void 0,i.useCreateElement){for(;t.lastChild;)t.removeChild(t.lastChild);h.insertTreeBefore(t,e,null)}else S(t,e),g.precacheNode(n,t.firstChild)}};e.exports=U},function(e,t,n){"use strict";var r=n(3),o=n(25),a=(n(1),{HOST:0,COMPOSITE:1,EMPTY:2,getType:function(e){return null===e||e===!1?a.EMPTY:o.isValidElement(e)?"function"==typeof e.type?a.COMPOSITE:a.HOST:void r("26",e)}});e.exports=a},function(e,t){"use strict";var n={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){n.currentScrollLeft=e.x,n.currentScrollTop=e.y}};e.exports=n},function(e,t,n){"use strict";function r(e,t){return null==t?o("30"):void 0,null==e?t:Array.isArray(e)?Array.isArray(t)?(e.push.apply(e,t),e):(e.push(t),e):Array.isArray(t)?[e].concat(t):[e,t]}var o=n(3);n(1),e.exports=r},function(e,t){"use strict";function n(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)}e.exports=n},function(e,t,n){"use strict";function r(e){for(var t;(t=e._renderedNodeType)===o.COMPOSITE;)e=e._renderedComponent;return t===o.HOST?e._renderedComponent:t===o.EMPTY?null:void 0}var o=n(89);e.exports=r},function(e,t,n){"use strict";function r(){return!a&&o.canUseDOM&&(a="textContent"in document.documentElement?"textContent":"innerText"),a}var o=n(7),a=null;e.exports=r},function(e,t,n){"use strict";function r(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}function o(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function a(e,t){var n;if(null===e||e===!1)n=c.create(a);else if("object"==typeof e){var u=e;!u||"function"!=typeof u.type&&"string"!=typeof u.type?i("130",null==u.type?u.type:typeof u.type,r(u._owner)):void 0,"string"==typeof u.type?n=l.createInternalComponent(u):o(u.type)?(n=new u.type(u),n.getHostNode||(n.getHostNode=n.getNativeNode)):n=new p(u)}else"string"==typeof e||"number"==typeof e?n=l.createInstanceForText(e):i("131",typeof e);return n._mountIndex=0,n._mountImage=null,n}var i=n(3),u=n(5),s=n(155),c=n(84),l=n(86),p=(n(202),n(1),n(2),function(e){this.construct(e)});u(p.prototype,s,{_instantiateReactComponent:a}),e.exports=a},function(e,t){"use strict";function n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!r[e.type]:"textarea"===t}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=n},function(e,t,n){"use strict";var r=n(7),o=n(41),a=n(42),i=function(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(i=function(e,t){return 3===e.nodeType?void(e.nodeValue=t):void a(e,o(t))})),e.exports=i},function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?c.escape(e.key):t.toString(36)}function o(e,t,n,a){var f=typeof e;if("undefined"!==f&&"boolean"!==f||(e=null),null===e||"string"===f||"number"===f||"object"===f&&e.$$typeof===u)return n(a,e,""===t?l+r(e,0):t),1;var d,h,v=0,m=""===t?l:t+p;if(Array.isArray(e))for(var y=0;y=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e){return 0===e.button}function i(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function u(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function s(e,t){return"function"==typeof e?e(t.location):e}t.__esModule=!0;var c=Object.assign||function(e){for(var t=1;t=0;r--){var o=e[r],a=o.path||"";if(n=a.replace(/\/*$/,"/")+n,0===a.indexOf("/"))break}return"/"+n}},propTypes:{path:f,from:f,to:f.isRequired,query:d,state:d,onEnter:l.falsy,children:l.falsy},render:function(){(0,u.default)(!1)}});t.default=h,e.exports=t.default},function(e,t){"use strict";function n(e,t,n){var a=o({},e,{setRouteLeaveHook:t.listenBeforeLeavingRoute,isActive:t.isActive});return r(a,n)}function r(e,t){var n=t.location,r=t.params,o=t.routes;return e.location=n,e.params=r,e.routes=o,e}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]&&arguments[1];return e.__id__||t&&(e.__id__=C++)}function s(e){return e.map(function(e){return T[u(e)]}).filter(function(e){return e})}function p(e,n){(0,m.default)(t,e,function(t,r){if(null==r)return void n();_=i({},r,{location:e});for(var o=s((0,c.default)(b,_).leaveRoutes),a=void 0,u=0,l=o.length;null==a&&u":i.innerHTML="<"+e+">",u[e]=!i.firstChild),u[e]?f[e]:null}var o=n(7),a=n(1),i=o.canUseDOM?document.createElement("div"):null,u={},s=[1,'"],c=[1,"","
"],l=[3,"","
"],p=[1,'',""],f={"*":[1,"?
","
"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:s,option:s,caption:c,colgroup:c,tbody:c,tfoot:c,thead:c,td:l,th:l},d=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];d.forEach(function(e){f[e]=p,u[e]=!0}),e.exports=r},function(e,t){"use strict";function n(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}e.exports=n},function(e,t){"use strict";function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;e.exports=n},function(e,t,n){"use strict";function r(e){return o(e).replace(a,"-ms-")}var o=n(129),a=/^ms-/;e.exports=r},function(e,t){"use strict";function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=n},function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=n(131);e.exports=r},function(e,t){"use strict";function n(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}e.exports=n},function(e,t){"use strict";t.__esModule=!0,t.loopAsync=function(e,t,n){var r=0,o=!1,a=!1,i=!1,u=void 0,s=function(){for(var e=arguments.length,t=Array(e),r=0;r=e&&i&&(o=!0,n()))}};c()}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0,t.replaceLocation=t.pushLocation=t.startListener=t.getCurrentLocation=t.go=t.getUserConfirmation=void 0;var o=n(45);Object.defineProperty(t,"getUserConfirmation",{enumerable:!0,get:function(){return o.getUserConfirmation}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return o.go}});var a=n(16),i=(r(a),n(19)),u=n(37),s=n(75),c=n(14),l="hashchange",p=function(){var e=window.location.href,t=e.indexOf("#");return t===-1?"":e.substring(t+1)},f=function(e){return window.location.hash=e},d=function(e){var t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+e)},h=t.getCurrentLocation=function(e,t){var n=e.decodePath(p()),r=(0,c.getQueryStringValueFromPath)(n,t),o=void 0;r&&(n=(0,c.stripQueryStringValueFromPath)(n,t),o=(0,s.readState)(r));var a=(0,c.parsePath)(n);return a.state=o,(0,i.createLocation)(a,void 0,r)},v=void 0,m=(t.startListener=function(e,t,n){var r=function(){var r=p(),o=t.encodePath(r);if(r!==o)d(o);else{var a=h(t,n);if(v&&a.key&&v.key===a.key)return;v=a,e(a)}},o=p(),a=t.encodePath(o);return o!==a&&d(a),(0,u.addEventListener)(window,l,r),function(){return(0,u.removeEventListener)(window,l,r)}},function(e,t,n,r){var o=e.state,a=e.key,i=t.encodePath((0,c.createPath)(e));void 0!==o&&(i=(0,c.addQueryStringValueToPath)(i,n,a),(0,s.saveState)(a,o)),v=e,r(i)});t.pushLocation=function(e,t,n){return m(e,t,n,function(e){p()!==e&&f(e)})},t.replaceLocation=function(e,t,n){return m(e,t,n,function(e){p()!==e&&d(e)})}},function(e,t,n){"use strict";t.__esModule=!0,t.replaceLocation=t.pushLocation=t.getCurrentLocation=t.go=t.getUserConfirmation=void 0; +var r=n(45);Object.defineProperty(t,"getUserConfirmation",{enumerable:!0,get:function(){return r.getUserConfirmation}}),Object.defineProperty(t,"go",{enumerable:!0,get:function(){return r.go}});var o=n(19),a=n(14);t.getCurrentLocation=function(){return(0,o.createLocation)(window.location)},t.pushLocation=function(e){return window.location.href=(0,a.createPath)(e),!1},t.replaceLocation=function(e){return window.location.replace((0,a.createPath)(e)),!1}},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function o(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t=0&&t=0&&m8&&C<=11),E=32,w=String.fromCharCode(E),P={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:["topBlur","topCompositionEnd","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:["topBlur","topCompositionStart","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:["topBlur","topCompositionUpdate","topKeyDown","topKeyPress","topKeyUp","topMouseDown"]}},x=!1,O=null,S={eventTypes:P,extractEvents:function(e,t,n,r){return[c(e,t,n,r),f(e,t,n,r)]}};e.exports=S},function(e,t,n){"use strict";var r=n(79),o=n(7),a=(n(10),n(123),n(197)),i=n(130),u=n(133),s=(n(2),u(function(e){return i(e)})),c=!1,l="cssFloat";if(o.canUseDOM){var p=document.createElement("div").style;try{p.font=""}catch(e){c=!0}void 0===document.documentElement.style.cssFloat&&(l="styleFloat")}var f={createMarkupForStyles:function(e,t){var n="";for(var r in e)if(e.hasOwnProperty(r)){var o=e[r];null!=o&&(n+=s(r)+":",n+=a(r,o,t)+";")}return n||null},setValueForStyles:function(e,t,n){var o=e.style;for(var i in t)if(t.hasOwnProperty(i)){var u=a(i,t[i],n);if("float"!==i&&"cssFloat"!==i||(i=l),u)o[i]=u;else{var s=c&&r.shorthandPropertyExpansions[i];if(s)for(var p in s)o[p]="";else o[i]=""}}}};e.exports=f},function(e,t,n){"use strict";function r(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function o(e){var t=k.getPooled(x.change,S,e,E(e));b.accumulateTwoPhaseDispatches(t),T.batchedUpdates(a,t)}function a(e){g.enqueueEvents(e),g.processEventQueue(!1)}function i(e,t){O=e,S=t,O.attachEvent("onchange",o)}function u(){O&&(O.detachEvent("onchange",o),O=null,S=null)}function s(e,t){if("topChange"===e)return t}function c(e,t,n){"topFocus"===e?(u(),i(t,n)):"topBlur"===e&&u()}function l(e,t){O=e,S=t,M=e.value,N=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(O,"value",I),O.attachEvent?O.attachEvent("onpropertychange",f):O.addEventListener("propertychange",f,!1)}function p(){O&&(delete O.value,O.detachEvent?O.detachEvent("onpropertychange",f):O.removeEventListener("propertychange",f,!1),O=null,S=null,M=null,N=null)}function f(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==M&&(M=t,o(e))}}function d(e,t){if("topInput"===e)return t}function h(e,t,n){"topFocus"===e?(p(),l(t,n)):"topBlur"===e&&p()}function v(e,t){if(("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)&&O&&O.value!==M)return M=O.value,S}function m(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function y(e,t){if("topClick"===e)return t}var g=n(30),b=n(31),_=n(7),C=n(6),T=n(11),k=n(12),E=n(61),w=n(62),P=n(96),x={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:["topBlur","topChange","topClick","topFocus","topInput","topKeyDown","topKeyUp","topSelectionChange"]}},O=null,S=null,M=null,N=null,R=!1;_.canUseDOM&&(R=w("change")&&(!document.documentMode||document.documentMode>8));var A=!1;_.canUseDOM&&(A=w("input")&&(!document.documentMode||document.documentMode>11));var I={get:function(){return N.get.call(this)},set:function(e){M=""+e,N.set.call(this,e)}},D={eventTypes:x,extractEvents:function(e,t,n,o){var a,i,u=t?C.getNodeFromInstance(t):window;if(r(u)?R?a=s:i=c:P(u)?A?a=d:(a=v,i=h):m(u)&&(a=y),a){var l=a(e,t);if(l){var p=k.getPooled(x.change,l,n,o);return p.type="change",b.accumulateTwoPhaseDispatches(p),p}}i&&i(e,u,t)}};e.exports=D},function(e,t,n){"use strict";var r=n(3),o=n(20),a=n(7),i=n(126),u=n(9),s=(n(1),{dangerouslyReplaceNodeWithMarkup:function(e,t){if(a.canUseDOM?void 0:r("56"),t?void 0:r("57"),"HTML"===e.nodeName?r("58"):void 0,"string"==typeof t){var n=i(t,u)[0];e.parentNode.replaceChild(n,e)}else o.replaceChildWithTree(e,t)}});e.exports=s},function(e,t){"use strict";var n=["ResponderEventPlugin","SimpleEventPlugin","TapEventPlugin","EnterLeaveEventPlugin","ChangeEventPlugin","SelectEventPlugin","BeforeInputEventPlugin"];e.exports=n},function(e,t,n){"use strict";var r=n(31),o=n(6),a=n(39),i={mouseEnter:{registrationName:"onMouseEnter",dependencies:["topMouseOut","topMouseOver"]},mouseLeave:{registrationName:"onMouseLeave",dependencies:["topMouseOut","topMouseOver"]}},u={eventTypes:i,extractEvents:function(e,t,n,u){if("topMouseOver"===e&&(n.relatedTarget||n.fromElement))return null;if("topMouseOut"!==e&&"topMouseOver"!==e)return null;var s;if(u.window===u)s=u;else{var c=u.ownerDocument;s=c?c.defaultView||c.parentWindow:window}var l,p;if("topMouseOut"===e){l=t;var f=n.relatedTarget||n.toElement;p=f?o.getClosestInstanceFromNode(f):null}else l=null,p=t;if(l===p)return null;var d=null==l?s:o.getNodeFromInstance(l),h=null==p?s:o.getNodeFromInstance(p),v=a.getPooled(i.mouseLeave,l,n,u);v.type="mouseleave",v.target=d,v.relatedTarget=h;var m=a.getPooled(i.mouseEnter,p,n,u);return m.type="mouseenter",m.target=h,m.relatedTarget=d,r.accumulateEnterLeaveDispatches(v,m,l,p),[v,m]}};e.exports=u},function(e,t,n){"use strict";function r(e){this._root=e,this._startText=this.getText(),this._fallbackText=null}var o=n(5),a=n(17),i=n(94);o(r.prototype,{destructor:function(){this._root=null,this._startText=null,this._fallbackText=null},getText:function(){return"value"in this._root?this._root.value:this._root[i()]},getData:function(){if(this._fallbackText)return this._fallbackText;var e,t,n=this._startText,r=n.length,o=this.getText(),a=o.length;for(e=0;e1?1-t:void 0;return this._fallbackText=o.slice(e,u),this._fallbackText}}),a.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r=n(21),o=r.injection.MUST_USE_PROPERTY,a=r.injection.HAS_BOOLEAN_VALUE,i=r.injection.HAS_NUMERIC_VALUE,u=r.injection.HAS_POSITIVE_NUMERIC_VALUE,s=r.injection.HAS_OVERLOADED_BOOLEAN_VALUE,c={isCustomAttribute:RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+r.ATTRIBUTE_NAME_CHAR+"]*$")),Properties:{accept:0,acceptCharset:0,accessKey:0,action:0,allowFullScreen:a,allowTransparency:0,alt:0,as:0,async:a,autoComplete:0,autoPlay:a,capture:a,cellPadding:0,cellSpacing:0,charSet:0,challenge:0,checked:o|a,cite:0,classID:0,className:0,cols:u,colSpan:0,content:0,contentEditable:0,contextMenu:0,controls:a,coords:0,crossOrigin:0,data:0,dateTime:0,default:a,defer:a,dir:0,disabled:a,download:s,draggable:0,encType:0,form:0,formAction:0,formEncType:0,formMethod:0,formNoValidate:a,formTarget:0,frameBorder:0,headers:0,height:0,hidden:a,high:0,href:0,hrefLang:0,htmlFor:0,httpEquiv:0,icon:0,id:0,inputMode:0,integrity:0,is:0,keyParams:0,keyType:0,kind:0,label:0,lang:0,list:0,loop:a,low:0,manifest:0,marginHeight:0,marginWidth:0,max:0,maxLength:0,media:0,mediaGroup:0,method:0,min:0,minLength:0,multiple:o|a,muted:o|a,name:0,nonce:0,noValidate:a,open:a,optimum:0,pattern:0,placeholder:0,playsInline:a,poster:0,preload:0,profile:0,radioGroup:0,readOnly:a,referrerPolicy:0,rel:0,required:a,reversed:a,role:0,rows:u,rowSpan:i,sandbox:0,scope:0,scoped:a,scrolling:0,seamless:a,selected:o|a,shape:0,size:u,sizes:0,span:u,spellCheck:0,src:0,srcDoc:0,srcLang:0,srcSet:0,start:i,step:0,style:0,summary:0,tabIndex:0,target:0,title:0,type:0,useMap:0,value:0,width:0,wmode:0,wrap:0,about:0,datatype:0,inlist:0,prefix:0,property:0,resource:0,typeof:0,vocab:0,autoCapitalize:0,autoCorrect:0,autoSave:0,color:0,itemProp:0,itemScope:a,itemType:0,itemID:0,itemRef:0,results:0,security:0,unselectable:0},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{}};e.exports=c},function(e,t,n){(function(t){"use strict";function r(e,t,n,r){var o=void 0===e[n];null!=t&&o&&(e[n]=a(t,!0))}var o=n(22),a=n(95),i=(n(53),n(63)),u=n(98);n(2),"undefined"!=typeof t&&t.env,1;var s={instantiateChildren:function(e,t,n,o){if(null==e)return null;var a={};return u(e,r,a),a},updateChildren:function(e,t,n,r,u,s,c,l,p){if(t||e){var f,d;for(f in t)if(t.hasOwnProperty(f)){d=e&&e[f];var h=d&&d._currentElement,v=t[f];if(null!=d&&i(h,v))o.receiveComponent(d,v,u,l),t[f]=d;else{d&&(r[f]=o.getHostNode(d),o.unmountComponent(d,!1));var m=a(v,!0);t[f]=m;var y=o.mountComponent(m,u,s,c,l,p);n.push(y)}}for(f in e)!e.hasOwnProperty(f)||t&&t.hasOwnProperty(f)||(d=e[f],r[f]=o.getHostNode(d),o.unmountComponent(d,!1))}},unmountChildren:function(e,t){for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];o.unmountComponent(r,t)}}};e.exports=s}).call(t,n(78))},function(e,t,n){"use strict";var r=n(49),o=n(161),a={processChildrenUpdates:o.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkup:r.dangerouslyReplaceNodeWithMarkup};e.exports=a},function(e,t,n){"use strict";function r(e){}function o(e,t){}function a(e){return!(!e.prototype||!e.prototype.isReactComponent)}function i(e){return!(!e.prototype||!e.prototype.isPureReactComponent)}var u=n(3),s=n(5),c=n(25),l=n(55),p=n(13),f=n(56),d=n(32),h=(n(10),n(89)),v=n(22),m=n(29),y=(n(1),n(44)),g=n(63),b=(n(2),{ImpureClass:0,PureClass:1,StatelessFunctional:2});r.prototype.render=function(){var e=d.get(this)._currentElement.type,t=e(this.props,this.context,this.updater);return o(e,t),t};var _=1,C={construct:function(e){this._currentElement=e,this._rootNodeID=0,this._compositeType=null,this._instance=null,this._hostParent=null,this._hostContainerInfo=null,this._updateBatchNumber=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedNodeType=null,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null,this._calledComponentWillUnmount=!1},mountComponent:function(e,t,n,s){this._context=s,this._mountOrder=_++,this._hostParent=t,this._hostContainerInfo=n;var l,p=this._currentElement.props,f=this._processContext(s),h=this._currentElement.type,v=e.getUpdateQueue(),y=a(h),g=this._constructComponent(y,p,f,v);y||null!=g&&null!=g.render?i(h)?this._compositeType=b.PureClass:this._compositeType=b.ImpureClass:(l=g,o(h,l),null===g||g===!1||c.isValidElement(g)?void 0:u("105",h.displayName||h.name||"Component"),g=new r(h),this._compositeType=b.StatelessFunctional),g.props=p,g.context=f,g.refs=m,g.updater=v,this._instance=g,d.set(g,this);var C=g.state;void 0===C&&(g.state=C=null),"object"!=typeof C||Array.isArray(C)?u("106",this.getName()||"ReactCompositeComponent"):void 0,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1;var T;return T=g.unstable_handleError?this.performInitialMountWithErrorHandling(l,t,n,e,s):this.performInitialMount(l,t,n,e,s),g.componentDidMount&&e.getReactMountReady().enqueue(g.componentDidMount,g),T},_constructComponent:function(e,t,n,r){return this._constructComponentWithoutOwner(e,t,n,r)},_constructComponentWithoutOwner:function(e,t,n,r){var o=this._currentElement.type;return e?new o(t,n,r):o(t,n,r)},performInitialMountWithErrorHandling:function(e,t,n,r,o){var a,i=r.checkpoint();try{a=this.performInitialMount(e,t,n,r,o)}catch(u){r.rollback(i),this._instance.unstable_handleError(u),this._pendingStateQueue&&(this._instance.state=this._processPendingState(this._instance.props,this._instance.context)),i=r.checkpoint(),this._renderedComponent.unmountComponent(!0),r.rollback(i),a=this.performInitialMount(e,t,n,r,o)}return a},performInitialMount:function(e,t,n,r,o){var a=this._instance,i=0;a.componentWillMount&&(a.componentWillMount(),this._pendingStateQueue&&(a.state=this._processPendingState(a.props,a.context))),void 0===e&&(e=this._renderValidatedComponent());var u=h.getType(e);this._renderedNodeType=u;var s=this._instantiateReactComponent(e,u!==h.EMPTY);this._renderedComponent=s;var c=v.mountComponent(s,r,t,n,this._processChildContext(o),i);return c},getHostNode:function(){return v.getHostNode(this._renderedComponent)},unmountComponent:function(e){if(this._renderedComponent){var t=this._instance;if(t.componentWillUnmount&&!t._calledComponentWillUnmount)if(t._calledComponentWillUnmount=!0,e){var n=this.getName()+".componentWillUnmount()";f.invokeGuardedCallback(n,t.componentWillUnmount.bind(t))}else t.componentWillUnmount();this._renderedComponent&&(v.unmountComponent(this._renderedComponent,e),this._renderedNodeType=null,this._renderedComponent=null,this._instance=null),this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=0,this._topLevelWrapper=null,d.remove(t)}},_maskContext:function(e){var t=this._currentElement.type,n=t.contextTypes;if(!n)return m;var r={};for(var o in n)r[o]=e[o];return r},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t,n=this._currentElement.type,r=this._instance;if(r.getChildContext&&(t=r.getChildContext()),t){"object"!=typeof n.childContextTypes?u("107",this.getName()||"ReactCompositeComponent"):void 0;for(var o in t)o in n.childContextTypes?void 0:u("108",this.getName()||"ReactCompositeComponent",o);return s({},e,t)}return e},_checkContextTypes:function(e,t,n){},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement?v.receiveComponent(this,this._pendingElement,e,this._context):null!==this._pendingStateQueue||this._pendingForceUpdate?this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context):this._updateBatchNumber=null},updateComponent:function(e,t,n,r,o){var a=this._instance;null==a?u("136",this.getName()||"ReactCompositeComponent"):void 0;var i,s=!1;this._context===o?i=a.context:(i=this._processContext(o),s=!0);var c=t.props,l=n.props;t!==n&&(s=!0),s&&a.componentWillReceiveProps&&a.componentWillReceiveProps(l,i);var p=this._processPendingState(l,i),f=!0;this._pendingForceUpdate||(a.shouldComponentUpdate?f=a.shouldComponentUpdate(l,p,i):this._compositeType===b.PureClass&&(f=!y(c,l)||!y(a.state,p))),this._updateBatchNumber=null,f?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,l,p,i,e,o)):(this._currentElement=n,this._context=o,a.props=l,a.state=p,a.context=i)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,o=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(o&&1===r.length)return r[0];for(var a=s({},o?r[0]:n.state),i=o?1:0;i=0||null!=t.is}function h(e){var t=e.type;f(t),this._currentElement=e,this._tag=t.toLowerCase(),this._namespaceURI=null,this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._hostNode=null,this._hostParent=null,this._rootNodeID=0,this._domID=0,this._hostContainerInfo=null,this._wrapperState=null,this._topLevelWrapper=null,this._flags=0}var v=n(3),m=n(5),y=n(144),g=n(146),b=n(20),_=n(50),C=n(21),T=n(81),k=n(30),E=n(51),w=n(38),P=n(82),x=n(6),O=n(162),S=n(163),M=n(83),N=n(166),R=(n(10),n(175)),A=n(180),I=(n(9),n(41)),D=(n(1),n(62),n(44),n(64),n(2),P),L=k.deleteListener,j=x.getNodeFromInstance,F=w.listenTo,U=E.registrationNameModules,H={string:!0,number:!0},B="style",q="__html",V={children:null,dangerouslySetInnerHTML:null,suppressContentEditableWarning:null},W=11,K={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},z={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Y={listing:!0,pre:!0,textarea:!0},X=m({menuitem:!0},z),Q=/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/,G={},$={}.hasOwnProperty,Z=1;h.displayName="ReactDOMComponent",h.Mixin={mountComponent:function(e,t,n,r){this._rootNodeID=Z++,this._domID=n._idCounter++,this._hostParent=t,this._hostContainerInfo=n;var a=this._currentElement.props;switch(this._tag){case"audio":case"form":case"iframe":case"img":case"link":case"object":case"source":case"video":this._wrapperState={listeners:null},e.getReactMountReady().enqueue(l,this);break;case"input":O.mountWrapper(this,a,t),a=O.getHostProps(this,a),e.getReactMountReady().enqueue(l,this);break;case"option":S.mountWrapper(this,a,t),a=S.getHostProps(this,a);break;case"select":M.mountWrapper(this,a,t),a=M.getHostProps(this,a),e.getReactMountReady().enqueue(l,this);break;case"textarea":N.mountWrapper(this,a,t),a=N.getHostProps(this,a),e.getReactMountReady().enqueue(l,this)}o(this,a);var i,p;null!=t?(i=t._namespaceURI,p=t._tag):n._tag&&(i=n._namespaceURI,p=n._tag),(null==i||i===_.svg&&"foreignobject"===p)&&(i=_.html),i===_.html&&("svg"===this._tag?i=_.svg:"math"===this._tag&&(i=_.mathml)),this._namespaceURI=i;var f;if(e.useCreateElement){var d,h=n._ownerDocument;if(i===_.html)if("script"===this._tag){var v=h.createElement("div"),m=this._currentElement.type;v.innerHTML="<"+m+">",d=v.removeChild(v.firstChild)}else d=a.is?h.createElement(this._currentElement.type,a.is):h.createElement(this._currentElement.type);else d=h.createElementNS(i,this._currentElement.type);x.precacheNode(this,d),this._flags|=D.hasCachedChildNodes,this._hostParent||T.setAttributeForRoot(d),this._updateDOMProperties(null,a,e);var g=b(d);this._createInitialChildren(e,a,r,g),f=g}else{var C=this._createOpenTagMarkupAndPutListeners(e,a),k=this._createContentMarkup(e,a,r);f=!k&&z[this._tag]?C+"/>":C+">"+k+""; +}switch(this._tag){case"input":e.getReactMountReady().enqueue(u,this),a.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"textarea":e.getReactMountReady().enqueue(s,this),a.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"select":a.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"button":a.autoFocus&&e.getReactMountReady().enqueue(y.focusDOMComponent,this);break;case"option":e.getReactMountReady().enqueue(c,this)}return f},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(null!=o)if(U.hasOwnProperty(r))o&&a(this,r,o,e);else{r===B&&(o&&(o=this._previousStyleCopy=m({},t.style)),o=g.createMarkupForStyles(o,this));var i=null;null!=this._tag&&d(this._tag,t)?V.hasOwnProperty(r)||(i=T.createMarkupForCustomAttribute(r,o)):i=T.createMarkupForProperty(r,o),i&&(n+=" "+i)}}return e.renderToStaticMarkup?n:(this._hostParent||(n+=" "+T.createMarkupForRoot()),n+=" "+T.createMarkupForID(this._domID))},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var a=H[typeof t.children]?t.children:null,i=null!=a?null:t.children;if(null!=a)r=I(a);else if(null!=i){var u=this.mountChildren(i,e,n);r=u.join("")}}return Y[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&b.queueHTML(r,o.__html);else{var a=H[typeof t.children]?t.children:null,i=null!=a?null:t.children;if(null!=a)b.queueText(r,a);else if(null!=i)for(var u=this.mountChildren(i,e,n),s=0;s"},receiveComponent:function(){},getHostNode:function(){return a.getNodeFromInstance(this)},unmountComponent:function(){a.uncacheNode(this)}}),e.exports=i},function(e,t){"use strict";var n={useCreateElement:!0,useFiber:!1};e.exports=n},function(e,t,n){"use strict";var r=n(49),o=n(6),a={dangerouslyProcessChildrenUpdates:function(e,t){var n=o.getNodeFromInstance(e);r.processUpdates(n,t)}};e.exports=a},function(e,t,n){"use strict";function r(){this._rootNodeID&&p.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=s.executeOnChange(t,e);l.asap(r,this);var o=t.name;if("radio"===t.type&&null!=o){for(var i=c.getNodeFromInstance(this),u=i;u.parentNode;)u=u.parentNode;for(var p=u.querySelectorAll("input[name="+JSON.stringify(""+o)+'][type="radio"]'),f=0;ft.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function u(e,t){if(window.getSelection){var n=window.getSelection(),r=e[l()].length,o=Math.min(t.start,r),a=void 0===t.end?o:Math.min(t.end,r);if(!n.extend&&o>a){var i=a;a=o,o=i}var u=c(e,o),s=c(e,a);if(u&&s){var p=document.createRange();p.setStart(u.node,u.offset),n.removeAllRanges(),o>a?(n.addRange(p),n.extend(s.node,s.offset)):(p.setEnd(s.node,s.offset),n.addRange(p))}}}var s=n(7),c=n(203),l=n(94),p=s.canUseDOM&&"selection"in document&&!("getSelection"in window),f={getOffsets:p?o:a,setOffsets:p?i:u};e.exports=f},function(e,t,n){"use strict";var r=n(3),o=n(5),a=n(49),i=n(20),u=n(6),s=n(41),c=(n(1),n(64),function(e){this._currentElement=e,this._stringText=""+e,this._hostNode=null,this._hostParent=null,this._domID=0,this._mountIndex=0,this._closingComment=null,this._commentNodes=null});o(c.prototype,{mountComponent:function(e,t,n,r){var o=n._idCounter++,a=" react-text: "+o+" ",c=" /react-text ";if(this._domID=o,this._hostParent=t,e.useCreateElement){var l=n._ownerDocument,p=l.createComment(a),f=l.createComment(c),d=i(l.createDocumentFragment());return i.queueChild(d,i(p)),this._stringText&&i.queueChild(d,i(l.createTextNode(this._stringText))),i.queueChild(d,i(f)),u.precacheNode(this,p),this._closingComment=f,d}var h=s(this._stringText);return e.renderToStaticMarkup?h:""+h+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var r=this.getHostNode();a.replaceDelimitedText(r[0],r[1],n)}}},getHostNode:function(){var e=this._commentNodes;if(e)return e;if(!this._closingComment)for(var t=u.getNodeFromInstance(this),n=t.nextSibling;;){if(null==n?r("67",this._domID):void 0,8===n.nodeType&&" /react-text "===n.nodeValue){this._closingComment=n;break}n=n.nextSibling}return e=[this._hostNode,this._closingComment],this._commentNodes=e,e},unmountComponent:function(){this._closingComment=null,this._commentNodes=null,u.uncacheNode(this)}}),e.exports=c},function(e,t,n){"use strict";function r(){this._rootNodeID&&l.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=u.executeOnChange(t,e);return c.asap(r,this),n}var a=n(3),i=n(5),u=n(54),s=n(6),c=n(11),l=(n(1),n(2),{getHostProps:function(e,t){null!=t.dangerouslySetInnerHTML?a("91"):void 0;var n=i({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return n},mountWrapper:function(e,t){var n=u.getValue(t),r=n;if(null==n){var i=t.defaultValue,s=t.children;null!=s&&(null!=i?a("92"):void 0,Array.isArray(s)&&(s.length<=1?void 0:a("93"),s=s[0]),i=""+s),null==i&&(i=""),r=i}e._wrapperState={initialValue:""+r,listeners:null,onChange:o.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=s.getNodeFromInstance(e),r=u.getValue(t);if(null!=r){var o=""+r;o!==n.value&&(n.value=o),null==t.defaultValue&&(n.defaultValue=o)}null!=t.defaultValue&&(n.defaultValue=t.defaultValue)},postMountWrapper:function(e){var t=s.getNodeFromInstance(e);t.value=t.textContent}});e.exports=l},function(e,t,n){"use strict";function r(e,t){"_hostNode"in e?void 0:s("33"),"_hostNode"in t?void 0:s("33");for(var n=0,r=e;r;r=r._hostParent)n++;for(var o=0,a=t;a;a=a._hostParent)o++;for(;n-o>0;)e=e._hostParent,n--;for(;o-n>0;)t=t._hostParent,o--;for(var i=n;i--;){if(e===t)return e;e=e._hostParent,t=t._hostParent}return null}function o(e,t){"_hostNode"in e?void 0:s("35"),"_hostNode"in t?void 0:s("35");for(;t;){if(t===e)return!0;t=t._hostParent}return!1}function a(e){return"_hostNode"in e?void 0:s("36"),e._hostParent}function i(e,t,n){for(var r=[];e;)r.push(e),e=e._hostParent;var o;for(o=r.length;o-- >0;)t(r[o],"captured",n);for(o=0;o0;)n(s[c],"captured",a)}var s=n(3);n(1),e.exports={isAncestor:o,getLowestCommonAncestor:r,getParentInstance:a,traverseTwoPhase:i,traverseEnterLeave:u}},function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var o=n(5),a=n(11),i=n(40),u=n(9),s={initialize:u,close:function(){f.isBatchingUpdates=!1}},c={initialize:u,close:a.flushBatchedUpdates.bind(a)},l=[c,s];o(r.prototype,i,{getTransactionWrappers:function(){return l}});var p=new r,f={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,a){var i=f.isBatchingUpdates;return f.isBatchingUpdates=!0,i?e(t,n,r,o,a):p.perform(e,null,t,n,r,o,a)}};e.exports=f},function(e,t,n){"use strict";function r(){k||(k=!0,g.EventEmitter.injectReactEventListener(y),g.EventPluginHub.injectEventPluginOrder(u),g.EventPluginUtils.injectComponentTree(f),g.EventPluginUtils.injectTreeTraversal(h),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:T,EnterLeaveEventPlugin:s,ChangeEventPlugin:i,SelectEventPlugin:C,BeforeInputEventPlugin:a}),g.HostComponent.injectGenericComponentClass(p),g.HostComponent.injectTextComponentClass(v),g.DOMProperty.injectDOMPropertyConfig(o),g.DOMProperty.injectDOMPropertyConfig(c),g.DOMProperty.injectDOMPropertyConfig(_),g.EmptyComponent.injectEmptyComponentFactory(function(e){return new d(e)}),g.Updates.injectReconcileTransaction(b),g.Updates.injectBatchingStrategy(m),g.Component.injectEnvironment(l))}var o=n(143),a=n(145),i=n(147),u=n(149),s=n(150),c=n(152),l=n(154),p=n(157),f=n(6),d=n(159),h=n(167),v=n(165),m=n(168),y=n(172),g=n(173),b=n(178),_=n(183),C=n(184),T=n(185),k=!1;e.exports={inject:r}},function(e,t){"use strict";var n="function"==typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103;e.exports=n},function(e,t,n){"use strict";function r(e){o.enqueueEvents(e),o.processEventQueue(!1)}var o=n(30),a={handleTopLevel:function(e,t,n,a){var i=o.extractEvents(e,t,n,a);r(i)}};e.exports=a},function(e,t,n){"use strict";function r(e){for(;e._hostParent;)e=e._hostParent;var t=p.getNodeFromInstance(e),n=t.parentNode;return p.getClosestInstanceFromNode(n)}function o(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function a(e){var t=d(e.nativeEvent),n=p.getClosestInstanceFromNode(t),o=n;do e.ancestors.push(o),o=o&&r(o);while(o);for(var a=0;a/,a=/^<\!\-\-/,i={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return a.test(e)?e:e.replace(o," "+i.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(i.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var o=r(e);return o===n}};e.exports=i},function(e,t,n){"use strict";function r(e,t,n){return{type:"INSERT_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:n,afterNode:t}}function o(e,t,n){return{type:"MOVE_EXISTING",content:null,fromIndex:e._mountIndex,fromNode:f.getHostNode(e),toIndex:n,afterNode:t}}function a(e,t){return{type:"REMOVE_NODE",content:null,fromIndex:e._mountIndex,fromNode:t,toIndex:null,afterNode:null}}function i(e){return{type:"SET_MARKUP",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function u(e){return{type:"TEXT_CONTENT",content:e,fromIndex:null,fromNode:null,toIndex:null,afterNode:null}}function s(e,t){return t&&(e=e||[],e.push(t)),e}function c(e,t){p.processChildrenUpdates(e,t)}var l=n(3),p=n(55),f=(n(32),n(10),n(13),n(22)),d=n(153),h=(n(9),n(199)),v=(n(1),{Mixin:{_reconcilerInstantiateChildren:function(e,t,n){return d.instantiateChildren(e,t,n)},_reconcilerUpdateChildren:function(e,t,n,r,o,a){var i,u=0;return i=h(t,u),d.updateChildren(e,i,n,r,o,this,this._hostContainerInfo,a,u),i},mountChildren:function(e,t,n){var r=this._reconcilerInstantiateChildren(e,t,n);this._renderedChildren=r;var o=[],a=0;for(var i in r)if(r.hasOwnProperty(i)){var u=r[i],s=0,c=f.mountComponent(u,t,this,this._hostContainerInfo,n,s);u._mountIndex=a++,o.push(c)}return o},updateTextContent:function(e){var t=this._renderedChildren;d.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&l("118");var r=[u(e)];c(this,r)},updateMarkup:function(e){var t=this._renderedChildren;d.unmountChildren(t,!1);for(var n in t)t.hasOwnProperty(n)&&l("118");var r=[i(e)];c(this,r)},updateChildren:function(e,t,n){this._updateChildren(e,t,n)},_updateChildren:function(e,t,n){var r=this._renderedChildren,o={},a=[],i=this._reconcilerUpdateChildren(r,e,a,o,t,n);if(i||r){var u,l=null,p=0,d=0,h=0,v=null;for(u in i)if(i.hasOwnProperty(u)){var m=r&&r[u],y=i[u];m===y?(l=s(l,this.moveChild(m,v,p,d)),d=Math.max(m._mountIndex,d),m._mountIndex=p):(m&&(d=Math.max(m._mountIndex,d)),l=s(l,this._mountChildAtIndex(y,a[h],v,p,t,n)),h++),p++,v=f.getHostNode(y)}for(u in o)o.hasOwnProperty(u)&&(l=s(l,this._unmountChild(r[u],o[u])));l&&c(this,l),this._renderedChildren=i}},unmountChildren:function(e){var t=this._renderedChildren;d.unmountChildren(t,e),this._renderedChildren=null},moveChild:function(e,t,n,r){if(e._mountIndex=t)return{node:o,offset:t-a};a=i}o=n(r(o))}}e.exports=o},function(e,t,n){"use strict";function r(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n["ms"+e]="MS"+t,n["O"+e]="o"+t.toLowerCase(),n}function o(e){if(u[e])return u[e];if(!i[e])return e;var t=i[e];for(var n in t)if(t.hasOwnProperty(n)&&n in s)return u[e]=t[n];return""}var a=n(7),i={animationend:r("Animation","AnimationEnd"),animationiteration:r("Animation","AnimationIteration"),animationstart:r("Animation","AnimationStart"),transitionend:r("Transition","TransitionEnd")},u={},s={};a.canUseDOM&&(s=document.createElement("div").style,"AnimationEvent"in window||(delete i.animationend.animation,delete i.animationiteration.animation,delete i.animationstart.animation),"TransitionEvent"in window||delete i.transitionend.transition),e.exports=o},function(e,t,n){"use strict";function r(e){return'"'+o(e)+'"'}var o=n(41);e.exports=r},function(e,t,n){"use strict";var r=n(88);e.exports=r.renderSubtreeIntoContainer},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e,t){if(e.children!==t.children)return!1;var n=Object.keys(t),r=t.forceState?-1:0,a=e.forceState?-1:0;if(n.length+r!==Object.keys(e).length+a)return!1;for(var s=function(n){return!!u.statePropOptionKeys.some(function(e){return t[n][e]})&&u.statePropOptionKeys.every(function(r){return t[n][r]===e[n][r]})},c=0;c=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:a.createElement;return function(t,n){return u.reduceRight(function(e,t){return t(e,n)},e(t,n))}};return function(e){return r.reduceRight(function(t,n){return n(t,e)},i.default.createElement(s.default,o({},e,{createElement:c(e.createElement)})))}},e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(137),a=r(o),i=n(104),u=r(i);t.default=(0,u.default)(a.default),e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){if(!e.path)return!1;var r=(0,a.getParamNames)(e.path);return r.some(function(e){return t.params[e]!==n.params[e]})}function o(e,t){var n=e&&e.routes,o=t.routes,a=void 0,i=void 0,u=void 0;return n?!function(){var s=!1;a=n.filter(function(n){if(s)return!0;var a=o.indexOf(n)===-1||r(n,e,t);return a&&(s=!0),a}),a.reverse(),u=[],i=[],o.forEach(function(e){var t=n.indexOf(e)===-1,r=a.indexOf(e)!==-1;t||r?u.push(e):i.push(e)})}():(a=[],i=[],u=o),{leaveRoutes:a,changeRoutes:i,enterRoutes:u}}t.__esModule=!0;var a=n(23);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n){if(t.component||t.components)return void n(null,t.component||t.components);var r=t.getComponent||t.getComponents;if(r){var o=r.call(t,e,n);(0,i.isPromise)(o)&&o.then(function(e){return n(null,e)},n)}else n()}function o(e,t){(0,a.mapAsync)(e.routes,function(t,n,o){r(e,t,o)},t)}t.__esModule=!0;var a=n(66),i=n(100);t.default=o,e.exports=t.default},function(e,t,n){"use strict";function r(e,t){var n={};return e.path?((0,o.getParamNames)(e.path).forEach(function(e){Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e])}),n):n}t.__esModule=!0;var o=n(23);t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var o=n(138),a=r(o),i=n(104),u=r(i);t.default=(0,u.default)(a.default),e.exports=t.default},function(e,t,n){"use strict";function r(e,t){if(e==t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return r(e,t[n])});if("object"===("undefined"==typeof e?"undefined":s(e))){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))if(void 0===e[n]){if(void 0!==t[n])return!1}else{if(!Object.prototype.hasOwnProperty.call(t,n))return!1;if(!r(e[n],t[n]))return!1}return!0}return String(e)===String(t)}function o(e,t){return"/"!==t.charAt(0)&&(t="/"+t),"/"!==e.charAt(e.length-1)&&(e+="/"),"/"!==t.charAt(t.length-1)&&(t+="/"),t===e}function a(e,t,n){for(var r=e,o=[],a=[],i=0,u=t.length;i=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function a(e,t){var n=e.history,r=e.routes,a=e.location,s=o(e,["history","routes","location"]);n||a?void 0:(0,c.default)(!1),n=n?n:(0,p.default)(s);var l=(0,d.default)(n,(0,h.createRoutes)(r));a=a?n.createLocation(a):n.getCurrentLocation(),l.match(a,function(e,r,o){var a=void 0;if(o){var s=(0,v.createRouterObject)(n,l,o);a=i({},o,{router:s,matchContext:{transitionManager:l,router:s}})}t(e,r&&n.createLocation(r,u.REPLACE),a)})}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:[];void 0===r&&("/"!==t.pathname.charAt(0)&&(t=l({},t,{pathname:"/"+t.pathname})),r=t.pathname),(0,f.loopAsync)(e.length,function(n,i,u){s(e[n],t,r,o,a,function(e,t){e||t?u(e,t):i()})},n)}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t>"),x={array:i("array"),bool:i("boolean"),func:i("function"),number:i("number"),object:i("object"),string:i("string"),symbol:i("symbol"),any:u(),arrayOf:s,element:c(),instanceOf:l,node:h(),objectOf:f,oneOf:p,oneOfType:d,shape:v};o.prototype=Error.prototype,e.exports=x},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n},function(e,t,n){"use strict";function r(e,t,n){this.props=e,this.context=t,this.refs=s,this.updater=n||u}function o(){}var a=n(5),i=n(70),u=n(71),s=n(29);o.prototype=i.prototype,r.prototype=new o,r.prototype.constructor=r,a(r.prototype,i.prototype),r.prototype.isPureReactComponent=!0,e.exports=r},function(e,t){"use strict";e.exports="15.4.1"},function(e,t,n){"use strict";function r(e){return a.isValidElement(e)?void 0:o("143"),e}var o=n(27),a=n(26);n(1),e.exports=r},function(e,t,n){"use strict";function r(e,t){return e&&"object"==typeof e&&null!=e.key?c.escape(e.key):t.toString(36)}function o(e,t,n,a){var f=typeof e;if("undefined"!==f&&"boolean"!==f||(e=null),null===e||"string"===f||"number"===f||"object"===f&&e.$$typeof===u)return n(a,e,""===t?l+r(e,0):t),1;var d,h,v=0,m=""===t?l:t+p;if(Array.isArray(e))for(var y=0;y + + + + + Single Page Apps for GitHub Pages + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + diff --git a/package.json b/package.json new file mode 100644 index 0000000..23da70d --- /dev/null +++ b/package.json @@ -0,0 +1,35 @@ +{ + "name": "spa-github-pages", + "version": "4.0.0", + "description": "Single Page Apps for GitHub Pages", + "scripts": { + "start": "webpack-dev-server -d --inline --host 0.0.0.0 --history-api-fallback --progress" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/rafrex/spa-github-pages.git" + }, + "author": "Rafael Pedicini ", + "license": "MIT", + "dependencies": { + "react": "^15.4.1", + "react-dom": "^15.4.1", + "react-interactive": "^0.5.1", + "react-router": "^3.0.0" + }, + "devDependencies": { + "babel-core": "^6.21.0", + "babel-eslint": "^7.1.1", + "babel-loader": "^6.2.10", + "babel-preset-es2015": "^6.18.0", + "babel-preset-react": "^6.16.0", + "babel-preset-stage-1": "^6.16.0", + "eslint": "^3.12.2", + "eslint-config-airbnb": "^13.0.0", + "eslint-plugin-import": "^2.2.0", + "eslint-plugin-jsx-a11y": "^2.2.3", + "eslint-plugin-react": "^6.8.0", + "webpack": "^1.14.0", + "webpack-dev-server": "^1.16.2" + } +} diff --git a/src/components/App.js b/src/components/App.js new file mode 100644 index 0000000..fe0b042 --- /dev/null +++ b/src/components/App.js @@ -0,0 +1,70 @@ +import React, { PropTypes } from 'react'; +import Interactive from 'react-interactive'; +import { Link } from 'react-router'; +import s from '../styles/app.style'; + +const propTypes = { + children: PropTypes.element.isRequired, + routes: PropTypes.array.isRequired, +}; + +function App({ children, routes }) { + function generateMapMenu() { + let path = ''; + + function nextPath(route) { + path += ( + (path.slice(-1) === '/' ? '' : '/') + + (route.path === '/' ? '' : route.path) + ); + return path; + } + + return ( + routes.filter(route => route.mapMenuTitle) + .map((route, index, array) => ( + + {route.mapMenuTitle} + {(index + 1) < array.length && ' / '} + + )) + ); + } + + + return ( +
+

Single Page Apps for GitHub Pages

+ https://github.com/rafrex/spa-github-pages + + {children} +
+ + Code and concept by Rafael Pedicini + +
+
+ ); +} + +App.propTypes = propTypes; + +export default App; diff --git a/src/components/ExampleComponent.js b/src/components/ExampleComponent.js new file mode 100644 index 0000000..f08ddda --- /dev/null +++ b/src/components/ExampleComponent.js @@ -0,0 +1,33 @@ +import React, { PropTypes } from 'react'; +import Interactive from 'react-interactive'; +import { Link } from 'react-router'; +import s from '../styles/exampleComponent.style'; + +const propTypes = { + children: PropTypes.element, +}; + +function ExampleComponent({ children }) { + return ( +
+

+ This is an example page. Refresh the page or copy/paste the url to + test out the redirect functionality (this same page should load + after the redirect). +

+ {children || +
+ Example two deep with query and hash +
+ } +
+ ); +} + +ExampleComponent.propTypes = propTypes; + +export default ExampleComponent; diff --git a/src/components/ExampleTwoDeepComponent.js b/src/components/ExampleTwoDeepComponent.js new file mode 100644 index 0000000..0646d5c --- /dev/null +++ b/src/components/ExampleTwoDeepComponent.js @@ -0,0 +1,71 @@ +import React, { PropTypes } from 'react'; +import Interactive from 'react-interactive'; +import { Link } from 'react-router'; +import s from '../styles/exampleTwoDeepComponent.style'; + +const propTypes = { + location: PropTypes.object.isRequired, +}; + +function ExampleTwoDeepComponent({ location }) { + const queryPresent = Object.keys(location.query).length !== 0; + const hashPresent = location.hash !== ''; + + function queryStringTitle() { + if (queryPresent) return 'The query string field-value pairs are:'; + return 'No query string in the url'; + } + + function hashFragmentTitle() { + if (hashPresent) return 'The hash fragment is:'; + return 'No hash fragment in the url'; + } + + function linkToShowQueryAndOrHash() { + if (queryPresent && hashPresent) return null; + + const queryString = (queryPresent ? location.search : '?field1=foo&field2=bar'); + const hashFragment = (hashPresent ? location.hash : '#boom!'); + + let linkText = ''; + if (queryPresent && !hashPresent) linkText = 'Show with hash fragment'; + if (!queryPresent && hashPresent) linkText = 'Show with query string'; + if (!queryPresent && !hashPresent) linkText = 'Show with query string and hash fragment'; + + return ( +
+ {linkText} +
+ ); + } + + return ( +
+
+
{queryStringTitle()}
+
    + { + Object.keys(location.query).map((field, index) => ( + s.li(`${field}: ${location.query[field]}`, { key: index }) + )) + } +
+
+
+
{hashFragmentTitle()}
+
    + {hashPresent ? s.li(location.hash.slice(1)) : undefined} +
+
+ {linkToShowQueryAndOrHash()} +
+ ); +} + +ExampleTwoDeepComponent.propTypes = propTypes; + +export default ExampleTwoDeepComponent; diff --git a/src/components/Home.js b/src/components/Home.js new file mode 100644 index 0000000..0e75449 --- /dev/null +++ b/src/components/Home.js @@ -0,0 +1,47 @@ +import React from 'react'; +import Interactive from 'react-interactive'; +import { Link } from 'react-router'; +import s from '../styles/home.style'; + +function Home() { + const repoReadmeLink = text => ( + {text} + ); + + return ( +
+

+ This is an example single page app built + with React and React Router using {' '} + {s.code('browserHistory')}. Navigate with the links below and + refresh the page or copy/paste the url to test out the redirect + functionality deployed to overcome GitHub Pages incompatibility + with single page apps (like this one). +

+

+ Please see the {repoReadmeLink('repo readme')} for instructions on how to + use this boilerplate to deploy your own single page app using GitHub Pages. +

+
+ Example page +
+
+ Example two deep with query and hash +
+
+ ); +} + +export default Home; diff --git a/src/components/PageNotFound.js b/src/components/PageNotFound.js new file mode 100644 index 0000000..8a4d3a2 --- /dev/null +++ b/src/components/PageNotFound.js @@ -0,0 +1,19 @@ +import React, { PropTypes } from 'react'; +import s from '../styles/pageNotFound.style'; + +const propTypes = { + location: PropTypes.object.isRequired, +}; + +function PageNotFound({ location }) { + return ( +

+ Page not found - the path, {s.code(location.pathname)}, + did not match any React Router routes. +

+ ); +} + +PageNotFound.propTypes = propTypes; + +export default PageNotFound; diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..3b7972b --- /dev/null +++ b/src/index.js @@ -0,0 +1,31 @@ +import React from 'react'; +import { render } from 'react-dom'; +import { Router, Route, IndexRoute, browserHistory } from 'react-router'; + +import App from './components/App'; +import Home from './components/Home'; +import PageNotFound from './components/PageNotFound'; +import ExampleComponent from './components/ExampleComponent'; +import ExampleTwoDeepComponent from './components/ExampleTwoDeepComponent'; + + +const routes = ( + + + + + + + + + +); + + +render( + , + document.getElementById('root'), +); diff --git a/src/styles/app.style.js b/src/styles/app.style.js new file mode 100644 index 0000000..50105ce --- /dev/null +++ b/src/styles/app.style.js @@ -0,0 +1,53 @@ +import style from './style'; + +const s = Object.create(style); + +s.root = { + fontFamily: 'helvetica neue, helvetica, sans-serif', + fontWeight: '300', + fontSize: '16px', + letterSpacing: '0.025em', + padding: '3vh 0 12vh 0', + width: '500px', + // use responsive max-width to simulate padding/margin to allow + // space for vertical scroll bar without creating horizontal scroll bar + // (if there is padding, the window will scroll horizontally to show the padding) + maxWidth: 'calc(100vw - 40px)', + + // center based on vw to prevent content jump when vertical scroll bar show/hide + // note: vw/vh include the width of scroll bars. Note that centering using margin auto + // or % (which doesn't include scroll bars, so changes when scroll bars shown) causes a page jump + position: 'relative', + left: '50vw', + WebkitTransform: 'translate(-50%, 0)', + MozTransform: 'translate(-50%, 0)', + msTransform: 'translate(-50%, 0)', + OTransform: 'translate(-50%, 0)', + transform: 'translate(-50%, 0)', + + WebkitTextSizeAdjust: 'none', + MozTextSizeAdjust: 'none', + msTextSizeAdjust: 'none', + textSizeAdjust: 'none', +}; + +s.title = { + fontSize: '20px', + marginBottom: '0.5vh', +}; + +s.repoLink = { + fontSize: '14px', +}; + +s.mapMenu = { + margin: '3vh 0', +}; + +s.creditLine = { + color: '#A0A0A0', + fontSize: '14px', + marginTop: '50px', +}; + +export default s; diff --git a/src/styles/exampleComponent.style.js b/src/styles/exampleComponent.style.js new file mode 100644 index 0000000..52f0d97 --- /dev/null +++ b/src/styles/exampleComponent.style.js @@ -0,0 +1,9 @@ +import style from './style'; + +const s = Object.create(style); + +s.pageLinkContainer = { + margin: '1vh 0', +}; + +export default s; diff --git a/src/styles/exampleTwoDeepComponent.style.js b/src/styles/exampleTwoDeepComponent.style.js new file mode 100644 index 0000000..d41ee3e --- /dev/null +++ b/src/styles/exampleTwoDeepComponent.style.js @@ -0,0 +1,9 @@ +import style from './style'; + +const s = Object.create(style); + +s.lineContainer = { + margin: '3vh 0', +}; + +export default s; diff --git a/src/styles/home.style.js b/src/styles/home.style.js new file mode 100644 index 0000000..52f0d97 --- /dev/null +++ b/src/styles/home.style.js @@ -0,0 +1,9 @@ +import style from './style'; + +const s = Object.create(style); + +s.pageLinkContainer = { + margin: '1vh 0', +}; + +export default s; diff --git a/src/styles/pageNotFound.style.js b/src/styles/pageNotFound.style.js new file mode 100644 index 0000000..8fdbd6e --- /dev/null +++ b/src/styles/pageNotFound.style.js @@ -0,0 +1,5 @@ +import style from './style'; + +const s = Object.create(style); + +export default s; diff --git a/src/styles/style.js b/src/styles/style.js new file mode 100644 index 0000000..0b12d41 --- /dev/null +++ b/src/styles/style.js @@ -0,0 +1,65 @@ +import React from 'react'; + +const link = { + normal: { + borderBottom: '1px dotted rgb(0, 168, 0)', + }, + hover: { + borderBottom: '1px solid rgb(0, 168, 0)', + color: 'black', + }, + active: 'hover', + touchActive: { + borderBottom: '1px dashed rgb(0, 168, 0)', + color: 'black', + }, + focusFromTab: { + outline: '2px solid rgb(0, 152, 0)', + outlineOffset: '2px', + color: 'black', + }, + touchActiveTapOnly: true, +}; + +const childLink = {}; +Object.keys(link).forEach((key) => { + if (key !== 'touchActiveTapOnly') { + childLink[`onParent${key.slice(0, 1).toUpperCase()}${key.slice(1)}`] = link[key]; + } +}); + +export default { + link, + childLink, + p: { + margin: '3vh 0', + lineHeight: '1.4', + }, + + // generate text formatted as code + code: content => ( + {content} + ), + + // custom bullets for li items + li: (content, props) => ( +
  • + + {content} +
  • + ), +}; diff --git a/webpack.config.babel.js b/webpack.config.babel.js new file mode 100644 index 0000000..dbff9ec --- /dev/null +++ b/webpack.config.babel.js @@ -0,0 +1,31 @@ +import webpack from 'webpack'; + +export default { + entry: `${__dirname}/src/index.js`, + output: { + path: `${__dirname}/build`, + publicPath: '/build/', + filename: 'bundle.js', + }, + + module: { + loaders: [ + { test: /\.jsx?$/, exclude: /node_modules/, loader: 'babel' }, + ], + }, + + resolve: { + extensions: ['', '.js', '.jsx'], + }, + + plugins: process.argv.indexOf('-p') === -1 ? null : [ + new webpack.DefinePlugin({ + 'process.env.NODE_ENV': JSON.stringify('production'), + }), + new webpack.optimize.UglifyJsPlugin({ + output: { + comments: false, + }, + }), + ], +};