├── .babelrc
├── .flowconfig
├── .gitignore
├── .npmignore
├── LICENSE
├── README.md
├── assets
└── cover.png
├── docs
├── bundle.js
├── favicon.ico
├── favicon.png
└── index.html
├── package.json
├── src
├── docs
│ ├── favicon.ico
│ ├── favicon.png
│ ├── index.html
│ ├── index.jsx
│ └── styles.css
└── lib
│ ├── global.js
│ ├── index.jsx
│ └── input.js
├── webpack.config.js
└── yarn.lock
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["flow","env", "react"],
3 | "plugins": [
4 | "transform-object-rest-spread",
5 | "transform-class-properties"
6 | ]
7 | }
8 |
--------------------------------------------------------------------------------
/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 |
3 | [include]
4 |
5 | [libs]
6 |
7 | [lints]
8 |
9 | [options]
10 |
11 | [strict]
12 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | .DS_Store
2 | *.log
3 | node_modules
4 | dist
5 | es
6 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | docs
2 | src
3 | .babelrc
4 | webpack.config.js
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Armando Sosa
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # 🎹 React Keyboardist
2 |
3 | 
4 |
5 | React Keyboardist offers a simple and declarative way to add keyboard shortcuts to your react applications. It is just a React Wrapper for [🎹Keyboardist](https://github.com/soska/keyboardist.js).
6 |
7 | [Click here for a simple demo](http://soska.github.io/react-keyboardist/docs/index.html)
8 |
9 | ## TOC
10 |
11 | * [Installation](#installation)
12 | * [Global Listener](#global)
13 | * [How to Use](#how-to-use)
14 | * [Other Events](#other-events)
15 | * [Multiple Listeners For A Key](#multiple-listeners)
16 | * [Event Monitor](#monitor)
17 | * [KeyboardInput](#keyboard-input)
18 | * [How to Use](#how-to-use-input)
19 | * [Textarea](#textarea)
20 | * [Examples](#examples)
21 | * [Integration with React Router](#react-router)
22 |
23 | ## Installation
24 |
25 | ```
26 | $ yarn add react-keyboardist
27 |
28 | or
29 |
30 | $ npm install --save react-keyboardist
31 | ```
32 |
33 | ## Global Listener
34 |
35 | The default export ` ` provides a global listener attached to the document element that will listen for every key event except those that happen inside input elements (e.g. ` `,``). This is useful, for example, to have keystrokes that activate different parts of your UI.
36 |
37 | If you need to listen for keyboard events inside an input using a similar API, React Keyboardist also comes with a [KeyboardInput](#keyboard-input) component.
38 |
39 | ### How to use
40 |
41 | Just pass a dictionary with the shape of `{keyName : [function]}` via the `bindings` property and they will be automatically binded when the component mounts.
42 |
43 | ```javascript
44 | import Keyboardist from 'react-keyboardist';
45 |
46 | class App extends React.Component {
47 | //... state methods would go here
48 |
49 | render() {
50 | return (
51 |
52 |
61 |
62 |
63 | );
64 | }
65 | }
66 | ```
67 |
68 | All the subscription objects will be automatically unsuscribed when the component unmounts so you can use it as any other component in your component hierarchy.
69 |
70 | ### Other Events
71 |
72 | By default React Keyboardist will listen to `keydown` events, but you can use `keyup` instead.
73 |
74 | ```javascript
75 |
85 | ```
86 |
87 | ### Multiple listeners for a Key
88 |
89 | You can add multiple listeners for the same key, and they will be executed
90 | starting from the last one. If one of the listeners returns `false` the execution chain will stop. This is useful when you want to override a key in a child component.
91 |
92 | ```javascript
93 | const App = ({ openDialog, closeDialog, isDialogOpen, handleLogout }) => (
94 |
95 |
101 | {isDialogOpen && }
102 |
103 | );
104 |
105 | const ModalDialog = ({ onClose }) => {
106 | const bindings = {
107 | Escape: () => {
108 | onClose();
109 | // this will prevent the Escape binding in the parent component to be triggered.
110 | return false;
111 | },
112 | };
113 | return (
114 |
115 |
116 |
117 |
118 | );
119 | };
120 | ```
121 |
122 | ### Event Monitor
123 |
124 | The `monitor` property allows you to either pass a monitor function or just set it to `true` to use Keyboardist's default monitor. You can [read more about Keyboardist monitor over here.](https://github.com/soska/keyboardist.js#key-monitor)
125 |
126 | ```javascript
127 | {
130 | // do something
131 | }}
132 | />
133 | ```
134 |
135 | ## KeyboardInput
136 |
137 | Sometimes you want to listen to key events inside an input or textarea element, for example, to make a keyboard-enabled live search or to add keyboard functions inside an editor.
138 |
139 | ### How to use
140 |
141 | `KeyboardInput` has pretty much the same API as the global listener, except that instead of not rendering anything, it will render either an ` ` component (by default) or a `` component.
142 |
143 | The properties for `KeyboardInput` are `bindings`, `eventName`, `monitor` and `component`, every other property will be forwarded to the rendered component.
144 |
145 | ```javascript
146 | import { KeyboardInput } from 'react-keyboardist';
147 |
148 | class App extends React.Component {
149 | //... state methods would go here
150 |
151 | render() {
152 | return (
153 |
154 |
163 |
164 |
165 | );
166 | }
167 | }
168 | ```
169 |
170 | ### Textarea
171 |
172 | If you want the component to render a `textarea` element instead of an `input`, you can use the `component` property.
173 |
174 | ```javascript
175 |
176 | ```
177 |
178 | ## Examples
179 |
180 | If you want to see all the capabilites of React Keyboardist, here's a [really contrived demo](http://soska.github.io/react-keyboardist/docs/index.html) and you can find the source for that in the `docs` folder.
181 |
182 | ### React Router + Keyboardist
183 |
184 | If your application is some kind of Admin Dashboard, you may be using React-Router for the different sections of the app. [React Router + Keyboardist](https://githuv.com/soska/react-router-plus-keyboardist) offers a drop-in replacement for the `Route` component that allows to assign a keyboard shortcut to every route.
185 |
186 | Here's [a blog post](https://armandososa.org/2018/6/12/react-router-plus-keyboardist/) with the reasoning behind it.
187 |
--------------------------------------------------------------------------------
/assets/cover.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soska/react-keyboardist/4527090d92313039e8774654756c8421ac5623a2/assets/cover.png
--------------------------------------------------------------------------------
/docs/bundle.js:
--------------------------------------------------------------------------------
1 | !function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=23)}([function(e,t,n){"use strict";e.exports=n(22)},function(e,t,n){"use strict";var r=function(e){return!(!e||!e.tagName)&&("BUTTON"===e.tagName||"INPUT"===e.tagName||"SELECT"===e.tagName||"TEXTAREA"===e.tagName)},o=function(e){return r(e.target||e.nativeEvent.target)},a={ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",ControlLeft:"control",ControlRight:"control"},i=function(e){return"code"in e?!!a[e.code]:16===e.which||17===e.which||18===e.which||91===e.which},l={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"escape",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta",106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",ArrowUp:"Up",ArrowDown:"Down",ArrowLeft:"Left",ArrowRight:"Right"},u=function(e){var t="",n=[];if("code"in e)t=l[e.code]?l[e.code]:e.code;else{var r=e.which;t=String.fromCharCode(r).toLowerCase(),l[r]&&(t=l[r])}return e.altKey&&n.push("Alt"),e.shiftKey&&n.push("Shift"),e.ctrlKey&&n.push("Ctrl"),n.push(t),n.join("+")},c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(e){console.log(":keyboard event:",e)};e.exports=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"keydown",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(void 0===("undefined"==typeof window?"undefined":c(window)))return!1;var n={},a=null;null===t&&(t=window.document);var l=!r(t);function f(e){if(!(i(e)||l&&o(e))){var t=u(e),r=n[t.toLowerCase()]||[];if("function"==typeof a){var c=r.length>0;a(t,c,e)}r.length&&e.preventDefault();for(var s=!0,f=r.length-1;f>=0&&(r[f]&&(s=r[f]()),!1!==s);f--);}}function d(){t.addEventListener(e,f)}return d(),{subscribe:function(e,t){return(e=e.toLowerCase()).replace(/\s/,""),void 0===n[e]&&(n[e]=[]),n[e].push(t),{unsubscribe:function(){var r=n[e].indexOf(t);n[e].splice(r,1)}}},setMonitor:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;a=!0===e?s:e},startListening:d,stopListening:function(){t.removeEventListener(e,f)}}}},function(e,t,n){"use strict";function r(e){return function(){return e}}var o=function(){};o.thatReturns=r,o.thatReturnsFalse=r(!1),o.thatReturnsTrue=r(!0),o.thatReturnsNull=r(null),o.thatReturnsThis=function(){return this},o.thatReturnsArgument=function(e){return e},e.exports=o},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";var r=function(e){};e.exports=function(e,t,n,o,a,i,l,u){if(r(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 s=[n,o,a,i,l,u],f=0;(c=new Error(t.replace(/%s/g,function(){return s[f++]}))).name="Invariant Violation"}throw c.framesToPop=1,c}}},function(e,t,n){"use strict";
2 | /*
3 | object-assign
4 | (c) Sindre Sorhus
5 | @license MIT
6 | */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,i,l=function(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;u=0&&s.splice(t,1)}function v(e){var t=document.createElement("style");return void 0===e.attrs.type&&(e.attrs.type="text/css"),y(t,e.attrs),h(e,t),t}function y(e,t){Object.keys(t).forEach(function(n){e.setAttribute(n,t[n])})}function g(e,t){var n,r,o,a;if(t.transform&&e.css){if(!(a=t.transform(e.css)))return function(){};e.css=a}if(t.singleton){var i=c++;n=u||(u=v(t)),r=C.bind(null,n,i,!1),o=C.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",y(t,e.attrs),h(e,t),t}(t),r=function(e,t,n){var r=n.css,o=n.sourceMap,a=void 0===t.convertToAbsoluteUrls&&o;(t.convertToAbsoluteUrls||a)&&(r=f(r));o&&(r+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(o))))+" */");var i=new Blob([r],{type:"text/css"}),l=e.href;e.href=URL.createObjectURL(i),l&&URL.revokeObjectURL(l)}.bind(null,n,t),o=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=v(t),r=function(e,t){var n=t.css,r=t.media;r&&e.setAttribute("media",r);if(e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}.bind(null,n),o=function(){m(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=i()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var n=p(e,t);return d(n,t),function(e){for(var r=[],o=0;o=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["component","eventName","bindings","monitor"]));return i.createElement(n,o({ref:function(t){return e.element=t}},r))}}]),t}();s.defaultProps={component:"input",eventName:"keydown",bindings:{},monitor:null},t.default=s},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,o=function(){function e(e,t){for(var n=0;nthis.eventPool.length&&this.eventPool.push(e)}function pe(e){e.eventPool=[],e.getPooled=fe,e.release=de}i(se.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=l.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=l.thatReturnsTrue)},persist:function(){this.isPersistent=l.thatReturnsTrue},isPersistent:l.thatReturnsFalse,destructor:function(){var e,t=this.constructor.Interface;for(e in t)this[e]=null;for(t=0;t=ge),Ce=String.fromCharCode(32),xe={beforeInput:{phasedRegistrationNames:{bubbled:"onBeforeInput",captured:"onBeforeInputCapture"},dependencies:["topCompositionEnd","topKeyPress","topTextInput","topPaste"]},compositionEnd:{phasedRegistrationNames:{bubbled:"onCompositionEnd",captured:"onCompositionEndCapture"},dependencies:"topBlur topCompositionEnd topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionStart:{phasedRegistrationNames:{bubbled:"onCompositionStart",captured:"onCompositionStartCapture"},dependencies:"topBlur topCompositionStart topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")},compositionUpdate:{phasedRegistrationNames:{bubbled:"onCompositionUpdate",captured:"onCompositionUpdateCapture"},dependencies:"topBlur topCompositionUpdate topKeyDown topKeyPress topKeyUp topMouseDown".split(" ")}},ke=!1;function Ee(e,t){switch(e){case"topKeyUp":return-1!==ve.indexOf(t.keyCode);case"topKeyDown":return 229!==t.keyCode;case"topKeyPress":case"topMouseDown":case"topBlur":return!0;default:return!1}}function _e(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var Te=!1;var Se={eventTypes:xe,extractEvents:function(e,t,n,r){var o=void 0,a=void 0;if(ye)e:{switch(e){case"topCompositionStart":o=xe.compositionStart;break e;case"topCompositionEnd":o=xe.compositionEnd;break e;case"topCompositionUpdate":o=xe.compositionUpdate;break e}o=void 0}else Te?Ee(e,n)&&(o=xe.compositionEnd):"topKeyDown"===e&&229===n.keyCode&&(o=xe.compositionStart);return o?(we&&(Te||o!==xe.compositionStart?o===xe.compositionEnd&&Te&&(a=ie()):(ae._root=r,ae._startText=le(),Te=!0)),o=he.getPooled(o,t,n,r),a?o.data=a:null!==(a=_e(n))&&(o.data=a),ee(o),a=o):a=null,(e=be?function(e,t){switch(e){case"topCompositionEnd":return _e(t);case"topKeyPress":return 32!==t.which?null:(ke=!0,Ce);case"topTextInput":return(e=t.data)===Ce&&ke?null:e;default:return null}}(e,n):function(e,t){if(Te)return"topCompositionEnd"===e||!ye&&Ee(e,t)?(e=ie(),ae._root=null,ae._startText=null,ae._fallbackText=null,Te=!1,e):null;switch(e){case"topPaste":return null;case"topKeyPress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1t}return!1}(t,n,o,r)&&(n=null),r||null===o?function(e){return!!pt.hasOwnProperty(e)||!dt.hasOwnProperty(e)&&(ft.test(e)?pt[e]=!0:(dt[e]=!0,!1))}(t)&&(null===n?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=null===n?3!==o.type&&"":n:(t=o.attributeName,r=o.attributeNamespace,null===n?e.removeAttribute(t):(n=3===(o=o.type)||4===o&&!0===n?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}function bt(e,t){var n=t.checked;return i({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=n?n:e._wrapperState.initialChecked})}function wt(e,t){var n=null==t.defaultValue?"":t.defaultValue,r=null!=t.checked?t.checked:t.defaultChecked;n=_t(null!=t.value?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Ct(e,t){null!=(t=t.checked)&>(e,"checked",t,!1)}function xt(e,t){Ct(e,t);var n=_t(t.value);null!=n&&("number"===t.type?(0===n&&""===e.value||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n)),t.hasOwnProperty("value")?Et(e,t.type,n):t.hasOwnProperty("defaultValue")&&Et(e,t.type,_t(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function kt(e,t){(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue"))&&(""===e.value&&(e.value=""+e._wrapperState.initialValue),e.defaultValue=""+e._wrapperState.initialValue),""!==(t=e.name)&&(e.name=""),e.defaultChecked=!e.defaultChecked,e.defaultChecked=!e.defaultChecked,""!==t&&(e.name=t)}function Et(e,t,n){"number"===t&&e.ownerDocument.activeElement===e||(null==n?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}function _t(e){switch(typeof e){case"boolean":case"number":case"object":case"string":case"undefined":return e;default:return""}}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(vt,yt);mt[t]=new ht(t,1,!1,e,null)}),"xlink:actuate xlink:arcrole xlink:href xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(vt,yt);mt[t]=new ht(t,1,!1,e,"http://www.w3.org/1999/xlink")}),["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(vt,yt);mt[t]=new ht(t,1,!1,e,"http://www.w3.org/XML/1998/namespace")}),mt.tabIndex=new ht("tabIndex",1,!1,"tabindex",null);var Tt={change:{phasedRegistrationNames:{bubbled:"onChange",captured:"onChangeCapture"},dependencies:"topBlur topChange topClick topFocus topInput topKeyDown topKeyUp topSelectionChange".split(" ")}};function St(e,t,n){return(e=se.getPooled(Tt.change,e,t,n)).type="change",Me(n),ee(e),e}var Pt=null,Nt=null;function It(e){L(e,!1)}function Ot(e){if(qe(W(e)))return e}function Rt(e,t){if("topChange"===e)return t}var Mt=!1;function Ut(){Pt&&(Pt.detachEvent("onpropertychange",Dt),Nt=Pt=null)}function Dt(e){"value"===e.propertyName&&Ot(Nt)&&He(It,e=St(Nt,e,We(e)))}function Ft(e,t,n){"topFocus"===e?(Ut(),Nt=n,(Pt=t).attachEvent("onpropertychange",Dt)):"topBlur"===e&&Ut()}function Lt(e){if("topSelectionChange"===e||"topKeyUp"===e||"topKeyDown"===e)return Ot(Nt)}function jt(e,t){if("topClick"===e)return Ot(t)}function At(e,t){if("topInput"===e||"topChange"===e)return Ot(t)}a.canUseDOM&&(Mt=Ke("input")&&(!document.documentMode||9vn.length&&vn.push(e)}}}var En=Object.freeze({get _enabled(){return gn},setEnabled:bn,isEnabled:function(){return gn},trapBubbledEvent:wn,trapCapturedEvent:Cn,dispatchEvent:kn});function _n(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}var Tn={animationend:_n("Animation","AnimationEnd"),animationiteration:_n("Animation","AnimationIteration"),animationstart:_n("Animation","AnimationStart"),transitionend:_n("Transition","TransitionEnd")},Sn={},Pn={};function Nn(e){if(Sn[e])return Sn[e];if(!Tn[e])return e;var t,n=Tn[e];for(t in n)if(n.hasOwnProperty(t)&&t in Pn)return Sn[e]=n[t];return e}a.canUseDOM&&(Pn=document.createElement("div").style,"AnimationEvent"in window||(delete Tn.animationend.animation,delete Tn.animationiteration.animation,delete Tn.animationstart.animation),"TransitionEvent"in window||delete Tn.transitionend.transition);var In={topAnimationEnd:Nn("animationend"),topAnimationIteration:Nn("animationiteration"),topAnimationStart:Nn("animationstart"),topBlur:"blur",topCancel:"cancel",topChange:"change",topClick:"click",topClose:"close",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",topFocus:"focus",topInput:"input",topKeyDown:"keydown",topKeyPress:"keypress",topKeyUp:"keyup",topLoad:"load",topLoadStart:"loadstart",topMouseDown:"mousedown",topMouseMove:"mousemove",topMouseOut:"mouseout",topMouseOver:"mouseover",topMouseUp:"mouseup",topPaste:"paste",topScroll:"scroll",topSelectionChange:"selectionchange",topTextInput:"textInput",topToggle:"toggle",topTouchCancel:"touchcancel",topTouchEnd:"touchend",topTouchMove:"touchmove",topTouchStart:"touchstart",topTransitionEnd:Nn("transitionend"),topWheel:"wheel"},On={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"},Rn={},Mn=0,Un="_reactListenersID"+(""+Math.random()).slice(2);function Dn(e){return Object.prototype.hasOwnProperty.call(e,Un)||(e[Un]=Mn++,Rn[e[Un]]={}),Rn[e[Un]]}function Fn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Ln(e,t){var n,r=Fn(e);for(e=0;r;){if(3===r.nodeType){if(n=e+r.textContent.length,e<=t&&n>=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Fn(r)}}function jn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&"text"===e.type||"textarea"===t||"true"===e.contentEditable)}var An=a.canUseDOM&&"documentMode"in document&&11>=document.documentMode,zn={select:{phasedRegistrationNames:{bubbled:"onSelect",captured:"onSelectCapture"},dependencies:"topBlur topContextMenu topFocus topKeyDown topKeyUp topMouseDown topMouseUp topSelectionChange".split(" ")}},Hn=null,Bn=null,Vn=null,Wn=!1;function Kn(e,t){if(Wn||null==Hn||Hn!==u())return null;var n=Hn;return"selectionStart"in n&&jn(n)?n={start:n.selectionStart,end:n.selectionEnd}:window.getSelection?n={anchorNode:(n=window.getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}:n=void 0,Vn&&c(Vn,n)?null:(Vn=n,(e=se.getPooled(zn.select,Bn,e,t)).type="select",e.target=Hn,ee(e),e)}var $n={eventTypes:zn,extractEvents:function(e,t,n,r){var o,a=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;if(!(o=!a)){e:{a=Dn(a),o=C.onSelect;for(var i=0;it.expirationTime)&&(e.expirationTime=t.expirationTime)}new Set;var ir=void 0,lr=void 0;function ur(e){ir=lr=null;var t=e.alternate,n=e.updateQueue;null===n&&(n=e.updateQueue=or(null)),null!==t?null===(e=t.updateQueue)&&(e=t.updateQueue=or(null)):e=null,ir=n,lr=e!==n?e:null}function cr(e,t){ur(e),e=ir;var n=lr;null===n?ar(e,t):null===e.last||null===n.last?(ar(e,t),ar(n,t)):(ar(e,t),n.last=t)}function sr(e,t,n,r){return"function"==typeof(e=e.partialState)?e.call(t,n,r):e}function fr(e,t,n,r,o,a){null!==e&&e.updateQueue===n&&(n=t.updateQueue={baseState:n.baseState,expirationTime:n.expirationTime,first:n.first,last:n.last,isInitialized:n.isInitialized,capturedValues:n.capturedValues,callbackList:null,hasForceUpdate:!1}),n.expirationTime=0,n.isInitialized?e=n.baseState:(e=n.baseState=t.memoizedState,n.isInitialized=!0);for(var l=!0,u=n.first,c=!1;null!==u;){var s=u.expirationTime;if(s>a){var f=n.expirationTime;(0===f||f>s)&&(n.expirationTime=s),c||(c=!0,n.baseState=e)}else c||(n.first=u.next,null===n.first&&(n.last=null)),u.isReplace?(e=sr(u,r,e,o),l=!0):(s=sr(u,r,e,o))&&(e=l?i({},e,s):i(e,s),l=!1),u.isForced&&(n.hasForceUpdate=!0),null!==u.callback&&(null===(s=n.callbackList)&&(s=n.callbackList=[]),s.push(u)),null!==u.capturedValue&&(null===(s=n.capturedValues)?n.capturedValues=[u.capturedValue]:s.push(u.capturedValue));u=u.next}return null!==n.callbackList?t.effectTag|=32:null!==n.first||n.hasForceUpdate||null!==n.capturedValues||(t.updateQueue=null),c||(n.baseState=e),e}function dr(e,t){var n=e.callbackList;if(null!==n)for(e.callbackList=null,e=0;em?(v=d,d=null):v=d.sibling;var y=p(o,d,l[m],u);if(null===y){null===d&&(d=v);break}e&&d&&null===y.alternate&&t(o,d),i=a(y,i,m),null===s?c=y:s.sibling=y,s=y,d=v}if(m===l.length)return n(o,d),c;if(null===d){for(;mv?(y=m,m=null):y=m.sibling;var b=p(o,m,g.value,u);if(null===b){m||(m=y);break}e&&m&&null===b.alternate&&t(o,m),i=a(b,i,v),null===s?c=b:s.sibling=b,s=b,m=y}if(g.done)return n(o,m),c;if(null===m){for(;!g.done;v++,g=l.next())null!==(g=f(o,g.value,u))&&(i=a(g,i,v),null===s?c=g:s.sibling=g,s=g);return c}for(m=r(o,m);!g.done;v++,g=l.next())null!==(g=h(m,o,v,g.value,u))&&(e&&null!==g.alternate&&m.delete(null===g.key?v:g.key),i=a(g,i,v),null===s?c=g:s.sibling=g,s=g);return e&&m.forEach(function(e){return t(o,e)}),c}return function(e,r,a,l){"object"==typeof a&&null!==a&&a.type===tt&&null===a.key&&(a=a.props.children);var u="object"==typeof a&&null!==a;if(u)switch(a.$$typeof){case Xe:e:{var c=a.key;for(u=r;null!==u;){if(u.key===c){if(10===u.tag?a.type===tt:u.type===a.type){n(e,u.sibling),(r=o(u,a.type===tt?a.props.children:a.props,l)).ref=hr(e,u,a),r.return=e,e=r;break e}n(e,u);break}t(e,u),u=u.sibling}a.type===tt?((r=Yn(a.props.children,e.mode,l,a.key)).return=e,e=r):((l=Gn(a,e.mode,l)).ref=hr(e,r,a),l.return=e,e=l)}return i(e);case et:e:{for(u=a.key;null!==r;){if(r.key===u){if(4===r.tag&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),(r=o(r,a.children||[],l)).return=e,e=r;break e}n(e,r);break}t(e,r),r=r.sibling}(r=Jn(a,e.mode,l)).return=e,e=r}return i(e)}if("string"==typeof a||"number"==typeof a)return a=""+a,null!==r&&6===r.tag?(n(e,r.sibling),(r=o(r,a,l)).return=e,e=r):(n(e,r),(r=Xn(a,e.mode,l)).return=e,e=r),i(e);if(pr(a))return m(e,r,a,l);if(ut(a))return v(e,r,a,l);if(u&&mr(e,a),void 0===a)switch(e.tag){case 2:case 1:d("152",(l=e.type).displayName||l.name||"Component")}return n(e,r)}}var yr=vr(!0),gr=vr(!1);function br(e,t,n,r,o,a,l){function u(e,t,n){s(e,t,n,t.expirationTime)}function s(e,t,n,r){t.child=null===e?gr(t,null,n,r):yr(t,e.child,n,r)}function p(e,t){var n=t.ref;(null===e&&null!==n||null!==e&&e.ref!==n)&&(t.effectTag|=128)}function h(e,t,n,r,o,a){if(p(e,t),!n&&!o)return r&&P(t,!1),y(e,t);n=t.stateNode,Ge.current=t;var i=o?null:n.render();return t.effectTag|=1,o&&(s(e,t,null,a),t.child=null),s(e,t,i,a),t.memoizedState=n.state,t.memoizedProps=n.props,r&&P(t,!0),t.child}function m(e){var t=e.stateNode;t.pendingContext?S(e,t.pendingContext,t.pendingContext!==t.context):t.context&&S(e,t.context,!1),C(e,t.containerInfo)}function v(e,t,n,r){var o=e.child;for(null!==o&&(o.return=e);null!==o;){switch(o.tag){case 12:var a=0|o.stateNode;if(o.type===t&&0!=(a&n)){for(a=o;null!==a;){var i=a.alternate;if(0===a.expirationTime||a.expirationTime>r)a.expirationTime=r,null!==i&&(0===i.expirationTime||i.expirationTime>r)&&(i.expirationTime=r);else{if(null===i||!(0===i.expirationTime||i.expirationTime>r))break;i.expirationTime=r}a=a.return}a=null}else a=o.child;break;case 13:a=o.type===e.type?null:o.child;break;default:a=o.child}if(null!==a)a.return=o;else for(a=o;null!==a;){if(a===e){a=null;break}if(null!==(o=a.sibling)){a=o;break}a=a.return}o=a}}function y(e,t){if(null!==e&&t.child!==e.child&&d("153"),null!==t.child){var n=qn(e=t.child,e.pendingProps,e.expirationTime);for(t.child=n,n.return=t;null!==e.sibling;)e=e.sibling,(n=n.sibling=qn(e,e.pendingProps,e.expirationTime)).return=t;n.sibling=null}return t.child}var g=e.shouldSetTextContent,b=e.shouldDeprioritizeSubtree,w=t.pushHostContext,C=t.pushHostContainer,x=r.pushProvider,k=n.getMaskedContext,E=n.getUnmaskedContext,_=n.hasContextChanged,T=n.pushContextProvider,S=n.pushTopLevelContextObject,P=n.invalidateContextProvider,N=o.enterHydrationState,I=o.resetHydrationState,O=o.tryToClaimNextHydratableInstance,R=(e=function(e,t,n,r,o){function a(e,t,n,r,o,a){if(null===t||null!==e.updateQueue&&e.updateQueue.hasForceUpdate)return!0;var i=e.stateNode;return e=e.type,"function"==typeof i.shouldComponentUpdate?i.shouldComponentUpdate(n,o,a):!(e.prototype&&e.prototype.isPureReactComponent&&c(t,n)&&c(r,o))}function l(e,t){t.updater=y,e.stateNode=t,t._reactInternalFiber=e}function u(e,t,n,r){e=t.state,"function"==typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(n,r),"function"==typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&y.enqueueReplaceState(t,t.state,null)}function s(e,t,n,r){if("function"==typeof(e=e.type).getDerivedStateFromProps)return e.getDerivedStateFromProps.call(null,n,r)}var d=e.cacheContext,p=e.getMaskedContext,h=e.getUnmaskedContext,m=e.isContextConsumer,v=e.hasContextChanged,y={isMounted:Gt,enqueueSetState:function(e,r,o){e=e._reactInternalFiber,o=void 0===o?null:o;var a=n(e);cr(e,{expirationTime:a,partialState:r,callback:o,isReplace:!1,isForced:!1,capturedValue:null,next:null}),t(e,a)},enqueueReplaceState:function(e,r,o){e=e._reactInternalFiber,o=void 0===o?null:o;var a=n(e);cr(e,{expirationTime:a,partialState:r,callback:o,isReplace:!0,isForced:!1,capturedValue:null,next:null}),t(e,a)},enqueueForceUpdate:function(e,r){e=e._reactInternalFiber,r=void 0===r?null:r;var o=n(e);cr(e,{expirationTime:o,partialState:null,callback:r,isReplace:!1,isForced:!0,capturedValue:null,next:null}),t(e,o)}};return{adoptClassInstance:l,callGetDerivedStateFromProps:s,constructClassInstance:function(e,t){var n=e.type,r=h(e),o=m(e),a=o?p(e,r):f,u=null!==(n=new n(t,a)).state&&void 0!==n.state?n.state:null;return l(e,n),e.memoizedState=u,null!==(t=s(e,0,t,u))&&void 0!==t&&(e.memoizedState=i({},e.memoizedState,t)),o&&d(e,r,a),n},mountClassInstance:function(e,t){var n=e.type,r=e.alternate,o=e.stateNode,a=e.pendingProps,i=h(e);o.props=a,o.state=e.memoizedState,o.refs=f,o.context=p(e,i),"function"==typeof n.getDerivedStateFromProps||"function"==typeof o.getSnapshotBeforeUpdate||"function"!=typeof o.UNSAFE_componentWillMount&&"function"!=typeof o.componentWillMount||(n=o.state,"function"==typeof o.componentWillMount&&o.componentWillMount(),"function"==typeof o.UNSAFE_componentWillMount&&o.UNSAFE_componentWillMount(),n!==o.state&&y.enqueueReplaceState(o,o.state,null),null!==(n=e.updateQueue)&&(o.state=fr(r,e,n,o,a,t))),"function"==typeof o.componentDidMount&&(e.effectTag|=4)},resumeMountClassInstance:function(e,t){var n=e.type,l=e.stateNode;l.props=e.memoizedProps,l.state=e.memoizedState;var c=e.memoizedProps,f=e.pendingProps,d=l.context,m=h(e);m=p(e,m),(n="function"==typeof n.getDerivedStateFromProps||"function"==typeof l.getSnapshotBeforeUpdate)||"function"!=typeof l.UNSAFE_componentWillReceiveProps&&"function"!=typeof l.componentWillReceiveProps||(c!==f||d!==m)&&u(e,l,f,m),d=e.memoizedState,t=null!==e.updateQueue?fr(null,e,e.updateQueue,l,f,t):d;var y=void 0;if(c!==f&&(y=s(e,0,f,t)),null!==y&&void 0!==y){t=null===t||void 0===t?y:i({},t,y);var g=e.updateQueue;null!==g&&(g.baseState=i({},g.baseState,y))}return c!==f||d!==t||v()||null!==e.updateQueue&&e.updateQueue.hasForceUpdate?((c=a(e,c,f,d,t,m))?(n||"function"!=typeof l.UNSAFE_componentWillMount&&"function"!=typeof l.componentWillMount||("function"==typeof l.componentWillMount&&l.componentWillMount(),"function"==typeof l.UNSAFE_componentWillMount&&l.UNSAFE_componentWillMount()),"function"==typeof l.componentDidMount&&(e.effectTag|=4)):("function"==typeof l.componentDidMount&&(e.effectTag|=4),r(e,f),o(e,t)),l.props=f,l.state=t,l.context=m,c):("function"==typeof l.componentDidMount&&(e.effectTag|=4),!1)},updateClassInstance:function(e,t,n){var l=t.type,c=t.stateNode;c.props=t.memoizedProps,c.state=t.memoizedState;var f=t.memoizedProps,d=t.pendingProps,m=c.context,y=h(t);y=p(t,y),(l="function"==typeof l.getDerivedStateFromProps||"function"==typeof c.getSnapshotBeforeUpdate)||"function"!=typeof c.UNSAFE_componentWillReceiveProps&&"function"!=typeof c.componentWillReceiveProps||(f!==d||m!==y)&&u(t,c,d,y),m=t.memoizedState,n=null!==t.updateQueue?fr(e,t,t.updateQueue,c,d,n):m;var g=void 0;if(f!==d&&(g=s(t,0,d,n)),null!==g&&void 0!==g){n=null===n||void 0===n?g:i({},n,g);var b=t.updateQueue;null!==b&&(b.baseState=i({},b.baseState,g))}return f!==d||m!==n||v()||null!==t.updateQueue&&t.updateQueue.hasForceUpdate?((g=a(t,f,d,m,n,y))?(l||"function"!=typeof c.UNSAFE_componentWillUpdate&&"function"!=typeof c.componentWillUpdate||("function"==typeof c.componentWillUpdate&&c.componentWillUpdate(d,n,y),"function"==typeof c.UNSAFE_componentWillUpdate&&c.UNSAFE_componentWillUpdate(d,n,y)),"function"==typeof c.componentDidUpdate&&(t.effectTag|=4),"function"==typeof c.getSnapshotBeforeUpdate&&(t.effectTag|=2048)):("function"!=typeof c.componentDidUpdate||f===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=4),"function"!=typeof c.getSnapshotBeforeUpdate||f===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=2048),r(t,d),o(t,n)),c.props=d,c.state=n,c.context=y,g):("function"!=typeof c.componentDidUpdate||f===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=4),"function"!=typeof c.getSnapshotBeforeUpdate||f===e.memoizedProps&&m===e.memoizedState||(t.effectTag|=2048),!1)}}}(n,a,l,function(e,t){e.memoizedProps=t},function(e,t){e.memoizedState=t})).adoptClassInstance,M=e.callGetDerivedStateFromProps,U=e.constructClassInstance,D=e.mountClassInstance,F=e.resumeMountClassInstance,L=e.updateClassInstance;return{beginWork:function(e,t,n){if(0===t.expirationTime||t.expirationTime>n){switch(t.tag){case 3:m(t);break;case 2:T(t);break;case 4:C(t,t.stateNode.containerInfo);break;case 13:x(t)}return null}switch(t.tag){case 0:null!==e&&d("155");var r=t.type,o=t.pendingProps,a=E(t);return r=r(o,a=k(t,a)),t.effectTag|=1,"object"==typeof r&&null!==r&&"function"==typeof r.render&&void 0===r.$$typeof?(a=t.type,t.tag=2,t.memoizedState=null!==r.state&&void 0!==r.state?r.state:null,"function"==typeof a.getDerivedStateFromProps&&(null!==(o=M(t,r,o,t.memoizedState))&&void 0!==o&&(t.memoizedState=i({},t.memoizedState,o))),o=T(t),R(t,r),D(t,n),e=h(e,t,!0,o,!1,n)):(t.tag=1,u(e,t,r),t.memoizedProps=o,e=t.child),e;case 1:return o=t.type,n=t.pendingProps,_()||t.memoizedProps!==n?(r=E(t),o=o(n,r=k(t,r)),t.effectTag|=1,u(e,t,o),t.memoizedProps=n,e=t.child):e=y(e,t),e;case 2:o=T(t),null===e?null===t.stateNode?(U(t,t.pendingProps),D(t,n),r=!0):r=F(t,n):r=L(e,t,n),a=!1;var l=t.updateQueue;return null!==l&&null!==l.capturedValues&&(a=r=!0),h(e,t,r,o,a,n);case 3:e:if(m(t),r=t.updateQueue,null!==r){if(a=t.memoizedState,o=fr(e,t,r,null,null,n),t.memoizedState=o,null!==(r=t.updateQueue)&&null!==r.capturedValues)r=null;else{if(a===o){I(),e=y(e,t);break e}r=o.element}a=t.stateNode,(null===e||null===e.child)&&a.hydrate&&N(t)?(t.effectTag|=2,t.child=gr(t,null,r,n)):(I(),u(e,t,r)),t.memoizedState=o,e=t.child}else I(),e=y(e,t);return e;case 5:return w(t),null===e&&O(t),o=t.type,l=t.memoizedProps,r=t.pendingProps,a=null!==e?e.memoizedProps:null,_()||l!==r||((l=1&t.mode&&b(o,r))&&(t.expirationTime=1073741823),l&&1073741823===n)?(l=r.children,g(o,r)?l=null:a&&g(o,a)&&(t.effectTag|=16),p(e,t),1073741823!==n&&1&t.mode&&b(o,r)?(t.expirationTime=1073741823,t.memoizedProps=r,e=null):(u(e,t,l),t.memoizedProps=r,e=t.child)):e=y(e,t),e;case 6:return null===e&&O(t),t.memoizedProps=t.pendingProps,null;case 8:t.tag=7;case 7:return o=t.pendingProps,_()||t.memoizedProps!==o||(o=t.memoizedProps),r=o.children,t.stateNode=null===e?gr(t,t.stateNode,r,n):yr(t,e.stateNode,r,n),t.memoizedProps=o,t.stateNode;case 9:return null;case 4:return C(t,t.stateNode.containerInfo),o=t.pendingProps,_()||t.memoizedProps!==o?(null===e?t.child=yr(t,null,o,n):u(e,t,o),t.memoizedProps=o,e=t.child):e=y(e,t),e;case 14:return u(e,t,n=(n=t.type.render)(t.pendingProps,t.ref)),t.memoizedProps=n,t.child;case 10:return n=t.pendingProps,_()||t.memoizedProps!==n?(u(e,t,n),t.memoizedProps=n,e=t.child):e=y(e,t),e;case 11:return n=t.pendingProps.children,_()||null!==n&&t.memoizedProps!==n?(u(e,t,n),t.memoizedProps=n,e=t.child):e=y(e,t),e;case 13:return function(e,t,n){var r=t.type._context,o=t.pendingProps,a=t.memoizedProps;if(!_()&&a===o)return t.stateNode=0,x(t),y(e,t);var i=o.value;if(t.memoizedProps=o,null===a)i=1073741823;else if(a.value===o.value){if(a.children===o.children)return t.stateNode=0,x(t),y(e,t);i=0}else{var l=a.value;if(l===i&&(0!==l||1/l==1/i)||l!=l&&i!=i){if(a.children===o.children)return t.stateNode=0,x(t),y(e,t);i=0}else if(i="function"==typeof r._calculateChangedBits?r._calculateChangedBits(l,i):1073741823,0==(i|=0)){if(a.children===o.children)return t.stateNode=0,x(t),y(e,t)}else v(t,r,i,n)}return t.stateNode=i,x(t),u(e,t,o.children),t.child}(e,t,n);case 12:e:{r=t.type,a=t.pendingProps,l=t.memoizedProps,o=r._currentValue;var c=r._changedBits;if(_()||0!==c||l!==a){t.memoizedProps=a;var s=a.unstable_observedBits;if(void 0!==s&&null!==s||(s=1073741823),t.stateNode=s,0!=(c&s))v(t,r,c,n);else if(l===a){e=y(e,t);break e}u(e,t,n=(n=a.children)(o)),e=t.child}else e=y(e,t)}return e;default:d("156")}}}}function wr(e,t){var n=t.source;null===t.stack&&st(n),null!==n&&ct(n),t=t.value,null!==e&&2===e.tag&&ct(e);try{t&&t.suppressReactErrorLogging||console.error(t)}catch(e){e&&e.suppressReactErrorLogging||console.error(e)}}var Cr={};function xr(e){function t(){if(null!==ee)for(var e=ee.return;null!==e;)U(e),e=e.return;te=null,ne=0,ee=null,ae=!1}function n(e){return null!==ie&&ie.has(e)}function r(e){for(;;){var t=e.alternate,n=e.return,r=e.sibling;if(0==(512&e.effectTag)){t=O(t,e,ne);var o=e;if(1073741823===ne||1073741823!==o.expirationTime){e:switch(o.tag){case 3:case 2:var a=o.updateQueue;a=null===a?0:a.expirationTime;break e;default:a=0}for(var i=o.child;null!==i;)0!==i.expirationTime&&(0===a||a>i.expirationTime)&&(a=i.expirationTime),i=i.sibling;o.expirationTime=a}if(null!==t)return t;if(null!==n&&0==(512&n.effectTag)&&(null===n.firstEffect&&(n.firstEffect=e.firstEffect),null!==e.lastEffect&&(null!==n.lastEffect&&(n.lastEffect.nextEffect=e.firstEffect),n.lastEffect=e.lastEffect),1he)&&(he=e),e}function s(e,n){e:{for(;null!==e;){if((0===e.expirationTime||e.expirationTime>n)&&(e.expirationTime=n),null!==e.alternate&&(0===e.alternate.expirationTime||e.alternate.expirationTime>n)&&(e.alternate.expirationTime=n),null===e.return){if(3!==e.tag){n=void 0;break e}var r=e.stateNode;!Z&&0!==ne&&nke&&d("185")}e=e.return}n=void 0}return n}function p(){return Y=W()-G,2+(Y/10|0)}function h(e,t,n,r,o){var a=J;J=1;try{return e(t,n,r,o)}finally{J=a}}function m(e){if(0!==ce){if(e>ce)return;$(se)}var t=W()-G;ce=e,se=K(g,{timeout:10*(e-2)-t})}function v(e,t){if(null===e.nextScheduledRoot)e.remainingExpirationTime=t,null===ue?(le=ue=e,e.nextScheduledRoot=e):(ue=ue.nextScheduledRoot=e).nextScheduledRoot=le;else{var n=e.remainingExpirationTime;(0===n||t=pe)&&(!me||p()>=pe);)x(de,pe,!me),y();else for(;null!==de&&0!==pe&&(0===e||e>=pe);)x(de,pe,!1),y();null!==ge&&(ce=0,se=-1),0!==pe&&m(pe),ge=null,me=!1,C()}function C(){if(Ee=0,null!==xe){var e=xe;xe=null;for(var t=0;t_e)&&(me=!0)}function _(e){null===de&&d("246"),de.remainingExpirationTime=0,ve||(ve=!0,ye=e)}var T=function(){var e=[],t=-1;return{createCursor:function(e){return{current:e}},isEmpty:function(){return-1===t},pop:function(n){0>t||(n.current=e[t],e[t]=null,t--)},push:function(n,r){e[++t]=n.current,n.current=r},checkThatStackIsEmpty:function(){},resetStackAfterFatalErrorInDev:function(){}}}(),S=function(e,t){function n(e){return e===Cr&&d("174"),e}var r=e.getChildHostContext,o=e.getRootHostContext;e=t.createCursor;var a=t.push,i=t.pop,l=e(Cr),u=e(Cr),c=e(Cr);return{getHostContext:function(){return n(l.current)},getRootHostContainer:function(){return n(c.current)},popHostContainer:function(e){i(l,e),i(u,e),i(c,e)},popHostContext:function(e){u.current===e&&(i(l,e),i(u,e))},pushHostContainer:function(e,t){a(c,t,e),a(u,e,e),a(l,Cr,e),t=o(t),i(l,e),a(l,t,e)},pushHostContext:function(e){var t=n(c.current),o=n(l.current);o!==(t=r(o,e.type,t))&&(a(u,e,e),a(l,t,e))}}}(e,T),P=function(e){function t(e,t,n){(e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=n}function n(e){return 2===e.tag&&null!=e.type.childContextTypes}function r(e,t){var n=e.stateNode,r=e.type.childContextTypes;if("function"!=typeof n.getChildContext)return t;for(var o in n=n.getChildContext())o in r||d("108",ct(e)||"Unknown",o);return i({},t,n)}var o=e.createCursor,a=e.push,l=e.pop,u=o(f),c=o(!1),s=f;return{getUnmaskedContext:function(e){return n(e)?s:u.current},cacheContext:t,getMaskedContext:function(e,n){var r=e.type.contextTypes;if(!r)return f;var o=e.stateNode;if(o&&o.__reactInternalMemoizedUnmaskedChildContext===n)return o.__reactInternalMemoizedMaskedChildContext;var a,i={};for(a in r)i[a]=n[a];return o&&t(e,n,i),i},hasContextChanged:function(){return c.current},isContextConsumer:function(e){return 2===e.tag&&null!=e.type.contextTypes},isContextProvider:n,popContextProvider:function(e){n(e)&&(l(c,e),l(u,e))},popTopLevelContextObject:function(e){l(c,e),l(u,e)},pushTopLevelContextObject:function(e,t,n){null!=u.cursor&&d("168"),a(u,t,e),a(c,n,e)},processChildContext:r,pushContextProvider:function(e){if(!n(e))return!1;var t=e.stateNode;return t=t&&t.__reactInternalMemoizedMergedChildContext||f,s=u.current,a(u,t,e),a(c,c.current,e),!0},invalidateContextProvider:function(e,t){var n=e.stateNode;if(n||d("169"),t){var o=r(e,s);n.__reactInternalMemoizedMergedChildContext=o,l(c,e),l(u,e),a(u,o,e)}else l(c,e);a(c,t,e)},findCurrentUnmaskedContext:function(e){for((2!==qt(e)||2!==e.tag)&&d("170");3!==e.tag;){if(n(e))return e.stateNode.__reactInternalMemoizedMergedChildContext;(e=e.return)||d("171")}return e.stateNode.context}}}(T);T=function(e){var t=e.createCursor,n=e.push,r=e.pop,o=t(null),a=t(null),i=t(0);return{pushProvider:function(e){var t=e.type._context;n(i,t._changedBits,e),n(a,t._currentValue,e),n(o,e,e),t._currentValue=e.pendingProps.value,t._changedBits=e.stateNode},popProvider:function(e){var t=i.current,n=a.current;r(o,e),r(a,e),r(i,e),(e=e.type._context)._currentValue=n,e._changedBits=t}}}(T);var N=function(e){function t(e,t){var n=new Qn(5,null,null,0);n.type="DELETED",n.stateNode=t,n.return=e,n.effectTag=8,null!==e.lastEffect?(e.lastEffect.nextEffect=n,e.lastEffect=n):e.firstEffect=e.lastEffect=n}function n(e,t){switch(e.tag){case 5:return null!==(t=a(t,e.type,e.pendingProps))&&(e.stateNode=t,!0);case 6:return null!==(t=i(t,e.pendingProps))&&(e.stateNode=t,!0);default:return!1}}function r(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag;)e=e.return;f=e}var o=e.shouldSetTextContent;if(!(e=e.hydration))return{enterHydrationState:function(){return!1},resetHydrationState:function(){},tryToClaimNextHydratableInstance:function(){},prepareToHydrateHostInstance:function(){d("175")},prepareToHydrateHostTextInstance:function(){d("176")},popHydrationState:function(){return!1}};var a=e.canHydrateInstance,i=e.canHydrateTextInstance,l=e.getNextHydratableSibling,u=e.getFirstHydratableChild,c=e.hydrateInstance,s=e.hydrateTextInstance,f=null,p=null,h=!1;return{enterHydrationState:function(e){return p=u(e.stateNode.containerInfo),f=e,h=!0},resetHydrationState:function(){p=f=null,h=!1},tryToClaimNextHydratableInstance:function(e){if(h){var r=p;if(r){if(!n(e,r)){if(!(r=l(r))||!n(e,r))return e.effectTag|=2,h=!1,void(f=e);t(f,p)}f=e,p=u(r)}else e.effectTag|=2,h=!1,f=e}},prepareToHydrateHostInstance:function(e,t,n){return t=c(e.stateNode,e.type,e.memoizedProps,t,n,e),e.updateQueue=t,null!==t},prepareToHydrateHostTextInstance:function(e){return s(e.stateNode,e.memoizedProps,e)},popHydrationState:function(e){if(e!==f)return!1;if(!h)return r(e),h=!0,!1;var n=e.type;if(5!==e.tag||"head"!==n&&"body"!==n&&!o(n,e.memoizedProps))for(n=p;n;)t(e,n),n=l(n);return r(e),p=f?l(e.stateNode):null,!0}}}(e),I=br(e,S,P,T,N,s,c).beginWork,O=function(e,t,n,r,o){function a(e){e.effectTag|=4}var i=e.createInstance,l=e.createTextInstance,u=e.appendInitialChild,c=e.finalizeInitialChildren,s=e.prepareUpdate,f=e.persistence,p=t.getRootHostContainer,h=t.popHostContext,m=t.getHostContext,v=t.popHostContainer,y=n.popContextProvider,g=n.popTopLevelContextObject,b=r.popProvider,w=o.prepareToHydrateHostInstance,C=o.prepareToHydrateHostTextInstance,x=o.popHydrationState,k=void 0,E=void 0,_=void 0;return e.mutation?(k=function(){},E=function(e,t,n){(t.updateQueue=n)&&a(t)},_=function(e,t,n,r){n!==r&&a(t)}):d(f?"235":"236"),{completeWork:function(e,t,n){var r=t.pendingProps;switch(t.tag){case 1:return null;case 2:return y(t),e=t.stateNode,null!==(r=t.updateQueue)&&null!==r.capturedValues&&(t.effectTag&=-65,"function"==typeof e.componentDidCatch?t.effectTag|=256:r.capturedValues=null),null;case 3:return v(t),g(t),(r=t.stateNode).pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),null!==e&&null!==e.child||(x(t),t.effectTag&=-3),k(t),null!==(e=t.updateQueue)&&null!==e.capturedValues&&(t.effectTag|=256),null;case 5:h(t),n=p();var o=t.type;if(null!==e&&null!=t.stateNode){var f=e.memoizedProps,T=t.stateNode,S=m();T=s(T,o,f,r,n,S),E(e,t,T,o,f,r,n,S),e.ref!==t.ref&&(t.effectTag|=128)}else{if(!r)return null===t.stateNode&&d("166"),null;if(e=m(),x(t))w(t,n,e)&&a(t);else{f=i(o,r,n,e,t);e:for(S=t.child;null!==S;){if(5===S.tag||6===S.tag)u(f,S.stateNode);else if(4!==S.tag&&null!==S.child){S.child.return=S,S=S.child;continue}if(S===t)break;for(;null===S.sibling;){if(null===S.return||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}c(f,o,r,n,e)&&a(t),t.stateNode=f}null!==t.ref&&(t.effectTag|=128)}return null;case 6:if(e&&null!=t.stateNode)_(e,t,e.memoizedProps,r);else{if("string"!=typeof r)return null===t.stateNode&&d("166"),null;e=p(),n=m(),x(t)?C(t)&&a(t):t.stateNode=l(r,e,n,t)}return null;case 7:(r=t.memoizedProps)||d("165"),t.tag=8,o=[];e:for((f=t.stateNode)&&(f.return=t);null!==f;){if(5===f.tag||6===f.tag||4===f.tag)d("247");else if(9===f.tag)o.push(f.pendingProps.value);else if(null!==f.child){f.child.return=f,f=f.child;continue}for(;null===f.sibling;){if(null===f.return||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}return r=(f=r.handler)(r.props,o),t.child=yr(t,null!==e?e.child:null,r,n),t.child;case 8:return t.tag=7,null;case 9:case 14:case 10:case 11:return null;case 4:return v(t),k(t),null;case 13:return b(t),null;case 12:return null;case 0:d("167");default:d("156")}}}}(e,S,P,T,N).completeWork,R=(S=function(e,t,n,r,o){var a=e.popHostContainer,i=e.popHostContext,l=t.popContextProvider,u=t.popTopLevelContextObject,c=n.popProvider;return{throwException:function(e,t,n){t.effectTag|=512,t.firstEffect=t.lastEffect=null,t={value:n,source:t,stack:st(t)};do{switch(e.tag){case 3:return ur(e),e.updateQueue.capturedValues=[t],void(e.effectTag|=1024);case 2:if(n=e.stateNode,0==(64&e.effectTag)&&null!==n&&"function"==typeof n.componentDidCatch&&!o(n)){ur(e);var r=(n=e.updateQueue).capturedValues;return null===r?n.capturedValues=[t]:r.push(t),void(e.effectTag|=1024)}}e=e.return}while(null!==e)},unwindWork:function(e){switch(e.tag){case 2:l(e);var t=e.effectTag;return 1024&t?(e.effectTag=-1025&t|64,e):null;case 3:return a(e),u(e),1024&(t=e.effectTag)?(e.effectTag=-1025&t|64,e):null;case 5:return i(e),null;case 4:return a(e),null;case 13:return c(e),null;default:return null}},unwindInterruptedWork:function(e){switch(e.tag){case 2:l(e);break;case 3:a(e),u(e);break;case 5:i(e);break;case 4:a(e);break;case 13:c(e)}}}}(S,P,T,0,n)).throwException,M=S.unwindWork,U=S.unwindInterruptedWork,D=(S=function(e,t,n,r,o){function a(e){var n=e.ref;if(null!==n)if("function"==typeof n)try{n(null)}catch(n){t(e,n)}else n.current=null}function i(e){switch(rr(e),e.tag){case 2:a(e);var n=e.stateNode;if("function"==typeof n.componentWillUnmount)try{n.props=e.memoizedProps,n.state=e.memoizedState,n.componentWillUnmount()}catch(n){t(e,n)}break;case 5:a(e);break;case 7:l(e.stateNode);break;case 4:f&&c(e)}}function l(e){for(var t=e;;)if(i(t),null===t.child||f&&4===t.tag){if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;t=t.return}t.sibling.return=t.return,t=t.sibling}else t.child.return=t,t=t.child}function u(e){return 5===e.tag||3===e.tag||4===e.tag}function c(e){for(var t=e,n=!1,r=void 0,o=void 0;;){if(!n){n=t.return;e:for(;;){switch(null===n&&d("160"),n.tag){case 5:r=n.stateNode,o=!1;break e;case 3:case 4:r=n.stateNode.containerInfo,o=!0;break e}n=n.return}n=!0}if(5===t.tag||6===t.tag)l(t),o?x(r,t.stateNode):C(r,t.stateNode);else if(4===t.tag?r=t.stateNode.containerInfo:i(t),null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return;4===(t=t.return).tag&&(n=!1)}t.sibling.return=t.return,t=t.sibling}}var s=e.getPublicInstance,f=e.mutation;e=e.persistence,f||d(e?"235":"236");var p=f.commitMount,h=f.commitUpdate,m=f.resetTextContent,v=f.commitTextUpdate,y=f.appendChild,g=f.appendChildToContainer,b=f.insertBefore,w=f.insertInContainerBefore,C=f.removeChild,x=f.removeChildFromContainer;return{commitBeforeMutationLifeCycles:function(e,t){switch(t.tag){case 2:if(2048&t.effectTag&&null!==e){var n=e.memoizedProps,r=e.memoizedState;(e=t.stateNode).props=t.memoizedProps,e.state=t.memoizedState,t=e.getSnapshotBeforeUpdate(n,r),e.__reactInternalSnapshotBeforeUpdate=t}break;case 3:case 5:case 6:case 4:break;default:d("163")}},commitResetTextContent:function(e){m(e.stateNode)},commitPlacement:function(e){e:{for(var t=e.return;null!==t;){if(u(t)){var n=t;break e}t=t.return}d("160"),n=void 0}var r=t=void 0;switch(n.tag){case 5:t=n.stateNode,r=!1;break;case 3:case 4:t=n.stateNode.containerInfo,r=!0;break;default:d("161")}16&n.effectTag&&(m(t),n.effectTag&=-17);e:t:for(n=e;;){for(;null===n.sibling;){if(null===n.return||u(n.return)){n=null;break e}n=n.return}for(n.sibling.return=n.return,n=n.sibling;5!==n.tag&&6!==n.tag;){if(2&n.effectTag)continue t;if(null===n.child||4===n.tag)continue t;n.child.return=n,n=n.child}if(!(2&n.effectTag)){n=n.stateNode;break e}}for(var o=e;;){if(5===o.tag||6===o.tag)n?r?w(t,o.stateNode,n):b(t,o.stateNode,n):r?g(t,o.stateNode):y(t,o.stateNode);else if(4!==o.tag&&null!==o.child){o.child.return=o,o=o.child;continue}if(o===e)break;for(;null===o.sibling;){if(null===o.return||o.return===e)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},commitDeletion:function(e){c(e),e.return=null,e.child=null,e.alternate&&(e.alternate.child=null,e.alternate.return=null)},commitWork:function(e,t){switch(t.tag){case 2:break;case 5:var n=t.stateNode;if(null!=n){var r=t.memoizedProps;e=null!==e?e.memoizedProps:r;var o=t.type,a=t.updateQueue;t.updateQueue=null,null!==a&&h(n,a,o,e,r,t)}break;case 6:null===t.stateNode&&d("162"),n=t.memoizedProps,v(t.stateNode,null!==e?e.memoizedProps:n,n);break;case 3:break;default:d("163")}},commitLifeCycles:function(e,t,n){switch(n.tag){case 2:if(e=n.stateNode,4&n.effectTag)if(null===t)e.props=n.memoizedProps,e.state=n.memoizedState,e.componentDidMount();else{var r=t.memoizedProps;t=t.memoizedState,e.props=n.memoizedProps,e.state=n.memoizedState,e.componentDidUpdate(r,t,e.__reactInternalSnapshotBeforeUpdate)}null!==(n=n.updateQueue)&&dr(n,e);break;case 3:if(null!==(t=n.updateQueue)){if(e=null,null!==n.child)switch(n.child.tag){case 5:e=s(n.child.stateNode);break;case 2:e=n.child.stateNode}dr(t,e)}break;case 5:e=n.stateNode,null===t&&4&n.effectTag&&p(e,n.type,n.memoizedProps,n);break;case 6:case 4:break;default:d("163")}},commitErrorLogging:function(e,t){switch(e.tag){case 2:var n=e.type;t=e.stateNode;var r=e.updateQueue;(null===r||null===r.capturedValues)&&d("264");var a=r.capturedValues;for(r.capturedValues=null,"function"!=typeof n.getDerivedStateFromCatch&&o(t),t.props=e.memoizedProps,t.state=e.memoizedState,n=0;n=Dr-e){if(!(-1!==Mr&&Mr<=e))return void(Ur||(Ur=!0,requestAnimationFrame(zr)));jr.didTimeout=!0}else jr.didTimeout=!1;Mr=-1,e=Or,Or=null,null!==e&&e(jr)}},!1);var zr=function(e){Ur=!1;var t=e-Dr+Lr;tt&&(t=8),Lr=t=t.length||d("93"),t=t[0]),n=""+t),null==n&&(n="")),e._wrapperState={initialValue:""+n}}function $r(e,t){var n=t.value;null!=n&&((n=""+n)!==e.value&&(e.value=n),null==t.defaultValue&&(e.defaultValue=n)),null!=t.defaultValue&&(e.defaultValue=t.defaultValue)}function Qr(e){var t=e.textContent;t===e._wrapperState.initialValue&&(e.value=t)}var qr={html:"http://www.w3.org/1999/xhtml",mathml:"http://www.w3.org/1998/Math/MathML",svg:"http://www.w3.org/2000/svg"};function Gr(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Yr(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?Gr(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var Xr,Jr=void 0,Zr=(Xr=function(e,t){if(e.namespaceURI!==qr.svg||"innerHTML"in e)e.innerHTML=t;else{for((Jr=Jr||document.createElement("div")).innerHTML=""+t+" ",t=Jr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,n,r){MSApp.execUnsafeLocalFunction(function(){return Xr(e,t)})}:Xr);function eo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType)return void(n.nodeValue=t)}e.textContent=t}var to={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},no=["Webkit","ms","Moz","O"];function ro(e,t){for(var n in e=e.style,t)if(t.hasOwnProperty(n)){var r=0===n.indexOf("--"),o=n,a=t[n];o=null==a||"boolean"==typeof a||""===a?"":r||"number"!=typeof a||0===a||to.hasOwnProperty(o)&&to[o]?(""+a).trim():a+"px","float"===n&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}Object.keys(to).forEach(function(e){no.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),to[t]=to[e]})});var oo=i({menuitem:!0},{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});function ao(e,t,n){t&&(oo[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML)&&d("137",e,n()),null!=t.dangerouslySetInnerHTML&&(null!=t.children&&d("60"),"object"==typeof t.dangerouslySetInnerHTML&&"__html"in t.dangerouslySetInnerHTML||d("61")),null!=t.style&&"object"!=typeof t.style&&d("62",n()))}function io(e,t){if(-1===e.indexOf("-"))return"string"==typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lo=l.thatReturns("");function uo(e,t){var n=Dn(e=9===e.nodeType||11===e.nodeType?e:e.ownerDocument);t=C[t];for(var r=0;r<\/script>",e=e.removeChild(e.firstChild)):e="string"==typeof t.is?n.createElement(e,{is:t.is}):n.createElement(e):e=n.createElementNS(r,e),e}function so(e,t){return(9===t.nodeType?t:t.ownerDocument).createTextNode(e)}function fo(e,t,n,r){var o=io(t,n);switch(t){case"iframe":case"object":wn("topLoad","load",e);var a=n;break;case"video":case"audio":for(a in On)On.hasOwnProperty(a)&&wn(a,On[a],e);a=n;break;case"source":wn("topError","error",e),a=n;break;case"img":case"image":case"link":wn("topError","error",e),wn("topLoad","load",e),a=n;break;case"form":wn("topReset","reset",e),wn("topSubmit","submit",e),a=n;break;case"details":wn("topToggle","toggle",e),a=n;break;case"input":wt(e,n),a=bt(e,n),wn("topInvalid","invalid",e),uo(r,"onChange");break;case"option":a=Hr(e,n);break;case"select":Vr(e,n),a=i({},n,{value:void 0}),wn("topInvalid","invalid",e),uo(r,"onChange");break;case"textarea":Kr(e,n),a=Wr(e,n),wn("topInvalid","invalid",e),uo(r,"onChange");break;default:a=n}ao(t,a,lo);var u,c=a;for(u in c)if(c.hasOwnProperty(u)){var s=c[u];"style"===u?ro(e,s):"dangerouslySetInnerHTML"===u?null!=(s=s?s.__html:void 0)&&Zr(e,s):"children"===u?"string"==typeof s?("textarea"!==t||""!==s)&&eo(e,s):"number"==typeof s&&eo(e,""+s):"suppressContentEditableWarning"!==u&&"suppressHydrationWarning"!==u&&"autoFocus"!==u&&(w.hasOwnProperty(u)?null!=s&&uo(r,u):null!=s&>(e,u,s,o))}switch(t){case"input":Qe(e),kt(e,n);break;case"textarea":Qe(e),Qr(e);break;case"option":null!=n.value&&e.setAttribute("value",n.value);break;case"select":e.multiple=!!n.multiple,null!=(t=n.value)?Br(e,!!n.multiple,t,!1):null!=n.defaultValue&&Br(e,!!n.multiple,n.defaultValue,!0);break;default:"function"==typeof a.onClick&&(e.onclick=l)}}function po(e,t,n,r,o){var a=null;switch(t){case"input":n=bt(e,n),r=bt(e,r),a=[];break;case"option":n=Hr(e,n),r=Hr(e,r),a=[];break;case"select":n=i({},n,{value:void 0}),r=i({},r,{value:void 0}),a=[];break;case"textarea":n=Wr(e,n),r=Wr(e,r),a=[];break;default:"function"!=typeof n.onClick&&"function"==typeof r.onClick&&(e.onclick=l)}ao(t,r,lo),t=e=void 0;var u=null;for(e in n)if(!r.hasOwnProperty(e)&&n.hasOwnProperty(e)&&null!=n[e])if("style"===e){var c=n[e];for(t in c)c.hasOwnProperty(t)&&(u||(u={}),u[t]="")}else"dangerouslySetInnerHTML"!==e&&"children"!==e&&"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&"autoFocus"!==e&&(w.hasOwnProperty(e)?a||(a=[]):(a=a||[]).push(e,null));for(e in r){var s=r[e];if(c=null!=n?n[e]:void 0,r.hasOwnProperty(e)&&s!==c&&(null!=s||null!=c))if("style"===e)if(c){for(t in c)!c.hasOwnProperty(t)||s&&s.hasOwnProperty(t)||(u||(u={}),u[t]="");for(t in s)s.hasOwnProperty(t)&&c[t]!==s[t]&&(u||(u={}),u[t]=s[t])}else u||(a||(a=[]),a.push(e,u)),u=s;else"dangerouslySetInnerHTML"===e?(s=s?s.__html:void 0,c=c?c.__html:void 0,null!=s&&c!==s&&(a=a||[]).push(e,""+s)):"children"===e?c===s||"string"!=typeof s&&"number"!=typeof s||(a=a||[]).push(e,""+s):"suppressContentEditableWarning"!==e&&"suppressHydrationWarning"!==e&&(w.hasOwnProperty(e)?(null!=s&&uo(o,e),a||c===s||(a=[])):(a=a||[]).push(e,s))}return u&&(a=a||[]).push("style",u),a}function ho(e,t,n,r,o){"input"===n&&"radio"===o.type&&null!=o.name&&Ct(e,o),io(n,r),r=io(n,o);for(var a=0;ar&&(o=r,r=e,e=o),o=Ln(n,e);var a=Ln(n,r);if(o&&a&&(1!==t.rangeCount||t.anchorNode!==o.node||t.anchorOffset!==o.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)){var i=document.createRange();i.setStart(o.node,o.offset),t.removeAllRanges(),e>r?(t.addRange(i),t.extend(a.node,a.offset)):(i.setEnd(a.node,a.offset),t.addRange(i))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(n.focus(),n=0;nN.length&&N.push(e)}function R(e,t,n,r){var o=typeof e;"undefined"!==o&&"boolean"!==o||(e=null);var a=!1;if(null===e)a=!0;else switch(o){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case u:case c:a=!0}}if(a)return n(r,e,""===t?"."+M(e,0):t),1;if(a=0,t=""===t?".":t+":",Array.isArray(e))for(var i=0;i=r.props.items.length&&(e=r.props.items.length-1),r.setState({selectedItem:e})},r.prev=function(){var e=r.state.selectedItem-1;e<0&&(e=0),r.setState({selectedItem:e})},r.superNext=function(){var e=r.state.selectedItem+3;e>=r.props.items.length&&(e=r.props.items.length-1),r.setState({selectedItem:e})},r.superPrev=function(){var e=r.state.selectedItem-3;e<0&&(e=0),r.setState({selectedItem:e})},r.submit=function(){r.props.onSelect(r.state.selectedItem)},r.reset=function(){r.setState({selectedItem:0})},s(r,n)}return f(t,o.default.Component),r(t,[{key:"render",value:function(){return o.default.createElement(o.default.Fragment,null,o.default.createElement(l.default,{bindings:{Down:this.next,"Shift+Down":this.superNext,Up:this.prev,"Shift+Up":this.superPrev,Enter:this.submit,Escape:this.reset},monitor:!0}),o.default.createElement(d,{items:h,selectedItem:this.state.selectedItem}))}}]),t}();p.defaultProperties={onSelect:function(){}};var h=["Rick Wakeman","Keith Emerson","Jordan Rudess","Tony Banks","Richard Wright","Chick Corea","Stevie Wonder","Herbie Hancock","Aleks Syntek","Chico Che"],m=function(e){function t(){var e,n,r;c(this,t);for(var o=arguments.length,a=Array(o),i=0;i90&&r.setState({bpm:e})},s(r,n)}return f(t,o.default.Component),r(t,[{key:"render",value:function(){return o.default.createElement("div",{className:"bpm-meter"},o.default.createElement("label",null,o.default.createElement("span",null,"Chose a BPM"),o.default.createElement(i.KeyboardInput,{value:this.state.bpm,className:"bpm-meter__input",onChange:function(){},bindings:{UP:this.up,DOWN:this.down}}),o.default.createElement("span",{className:"instructions"},"← Use your keyboard arrows")))}}]),t}(),g=function(e){function t(){var e,n,r;c(this,t);for(var o=arguments.length,a=Array(o),i=0;i
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | React Keyboardist
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "react-keyboardist",
3 | "version": "0.2.0",
4 | "description":
5 | "A simple keyboard global manager for react. Powered by keyboardist.",
6 | "main": "dist/index.js",
7 | "scripts": {
8 | "flow": "flow",
9 | "favicon": "cpx \"src/docs/favicon.*\" \"docs\"",
10 | "dev": "webpack-dev-server --mode development",
11 | "build:lib": "babel src/lib -d dist",
12 | "build:docs": "webpack --mode production",
13 | "build": "npm run build:lib && npm run build:docs && npm run favicon"
14 | },
15 | "keywords": [],
16 | "license": "MIT",
17 | "peerDependencies": {
18 | "react": "^15.3.0 || ^16.2.0",
19 | "react-dom": "^15.3.0 || ^16.2.0"
20 | },
21 | "devDependencies": {
22 | "babel-cli": "^6.26.0",
23 | "babel-core": "^6.26.3",
24 | "babel-loader": "^7.1.4",
25 | "babel-plugin-transform-class-properties": "^6.24.1",
26 | "babel-plugin-transform-object-rest-spread": "^6.26.0",
27 | "babel-preset-env": "^1.7.0",
28 | "babel-preset-flow": "^6.23.0",
29 | "babel-preset-react": "^6.24.1",
30 | "concurrently": "^3.5.1",
31 | "css-loader": "^0.28.11",
32 | "flow-bin": "^0.73.0",
33 | "html-webpack-plugin": "^3.2.0",
34 | "react": "^16.3.2",
35 | "react-dom": "^16.3.2",
36 | "style-loader": "^0.21.0",
37 | "webpack": "^4.6.0",
38 | "webpack-cli": "^2.0.15",
39 | "webpack-dev-server": "^3.1.3",
40 | "cpx": "^1.5.0"
41 | },
42 | "author": "Armando Sosa ",
43 | "homepage": "https://github.com/soska/react-keyboardist",
44 | "repository": {
45 | "type": "git",
46 | "url": "git@github.com:soska/react-keyboardist.git"
47 | },
48 | "dependencies": {
49 | "keyboardist": "^1.2.1"
50 | }
51 | }
52 |
--------------------------------------------------------------------------------
/src/docs/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soska/react-keyboardist/4527090d92313039e8774654756c8421ac5623a2/src/docs/favicon.ico
--------------------------------------------------------------------------------
/src/docs/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/soska/react-keyboardist/4527090d92313039e8774654756c8421ac5623a2/src/docs/favicon.png
--------------------------------------------------------------------------------
/src/docs/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | React Keyboardist
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/src/docs/index.jsx:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { render } from 'react-dom';
3 | import Keyboardist, { KeyboardInput } from '../lib';
4 | import './styles.css';
5 |
6 | const List = ({ items, selectedItem }) => {
7 | return (
8 |
9 | {items.map((item, index) => (
10 |
16 | {item}
17 |
18 | ))}
19 |
20 | );
21 | };
22 |
23 | class KeyboardList extends React.Component {
24 | state = {
25 | selectedItem: 0,
26 | };
27 |
28 | static defaultProperties = {
29 | onSelect: () => {},
30 | };
31 |
32 | next = () => {
33 | let nextItem = this.state.selectedItem + 1;
34 | if (nextItem >= this.props.items.length) {
35 | nextItem = this.props.items.length - 1;
36 | }
37 | this.setState({ selectedItem: nextItem });
38 | };
39 |
40 | prev = () => {
41 | let nextItem = this.state.selectedItem - 1;
42 | if (nextItem < 0) {
43 | nextItem = 0;
44 | }
45 | this.setState({ selectedItem: nextItem });
46 | };
47 |
48 | superNext = () => {
49 | let nextItem = this.state.selectedItem + 3;
50 | if (nextItem >= this.props.items.length) {
51 | nextItem = this.props.items.length - 1;
52 | }
53 | this.setState({ selectedItem: nextItem });
54 | };
55 |
56 | superPrev = () => {
57 | let nextItem = this.state.selectedItem - 3;
58 | if (nextItem < 0) {
59 | nextItem = 0;
60 | }
61 | this.setState({ selectedItem: nextItem });
62 | };
63 |
64 | submit = () => {
65 | this.props.onSelect(this.state.selectedItem);
66 | };
67 |
68 | reset = () => {
69 | this.setState({ selectedItem: 0 });
70 | };
71 |
72 | render() {
73 | return (
74 |
75 |
86 |
87 |
88 | );
89 | }
90 | }
91 |
92 | const items = [
93 | 'Rick Wakeman',
94 | 'Keith Emerson',
95 | 'Jordan Rudess',
96 | 'Tony Banks',
97 | 'Richard Wright',
98 | 'Chick Corea',
99 | 'Stevie Wonder',
100 | 'Herbie Hancock',
101 | 'Aleks Syntek',
102 | 'Chico Che',
103 | ];
104 |
105 | class Love extends React.Component {
106 | state = {
107 | loving: false,
108 | love: 0,
109 | };
110 |
111 | startLoving = () => {
112 | this.setState({ loving: true });
113 | };
114 |
115 | stopLoving = () => {
116 | this.setState({ loving: false });
117 | };
118 |
119 | love = () => {
120 | if (this.state.loving) {
121 | console.log('love is in the air');
122 | let love = this.state.love + 1;
123 | this.setState({ love });
124 | }
125 | this.timeout = window.setTimeout(this.love, 100);
126 | };
127 |
128 | componentDidMount() {
129 | this.love();
130 | }
131 |
132 | componentWillUnmount() {
133 | window.clearTimeout(this.timeout);
134 | }
135 |
136 | render() {
137 | return (
138 |
139 |
144 |
150 |
151 | ❤️
152 | =
153 | {this.state.love}
154 |
155 |
156 | );
157 | }
158 | }
159 |
160 | const Modal = ({ show = false, onClose, children }) => {
161 | if (!show) {
162 | return null;
163 | }
164 |
165 | return (
166 |
167 |
172 |
{children}
173 |
174 | );
175 | };
176 |
177 | class BPMMeter extends React.Component {
178 | state = {
179 | bpm: 140,
180 | };
181 |
182 | up = () => {
183 | const bpm = this.state.bpm + 1;
184 | if (bpm < 280) {
185 | this.setState({ bpm });
186 | }
187 | };
188 |
189 | down = () => {
190 | const bpm = this.state.bpm - 1;
191 | if (bpm > 90) {
192 | this.setState({ bpm });
193 | }
194 | };
195 |
196 | render() {
197 | return (
198 |
199 |
200 | Chose a BPM
201 | {}}
205 | bindings={{
206 | UP: this.up,
207 | DOWN: this.down,
208 | }}
209 | />
210 | ← Use your keyboard arrows
211 |
212 |
213 | );
214 | }
215 | }
216 |
217 | class DemoApp extends React.Component {
218 | state = {
219 | selected: null,
220 | showingDialog: false,
221 | };
222 |
223 | showDialog = () => {
224 | this.setState({
225 | showingDialog: true,
226 | });
227 | };
228 |
229 | hideDialog = () => {
230 | this.setState({
231 | showingDialog: false,
232 | });
233 | // returning false means the event does not propagate,
234 | // so the table reset action won't be fired.
235 | return false;
236 | };
237 |
238 | setItem = index => {
239 | this.setState({
240 | selectedItem: items[index],
241 | showingDialog: true,
242 | });
243 | };
244 |
245 | render() {
246 | return (
247 |
248 |
249 | You selected
250 | {this.state.selectedItem}
251 |
252 | press ESC to close
253 |
254 |
255 |
256 |
257 |
258 |
Select your favorite keyboardist
259 |
260 | Use up and down arrows to higlight a name / Hold down{' '}
261 | Shift to move three names at a time / press{' '}
262 | Enter to select / press Escape to reset /
263 | press L to show love.
264 |
265 |
266 |
267 |
268 | This is a demo built with{' '}
269 |
270 | React Keyboardist
271 | . Source code for this demo{' '}
272 |
273 | is here
274 | .
275 |
276 |
277 |
278 | );
279 | }
280 | }
281 |
282 | render( , document.getElementById('app'));
283 |
--------------------------------------------------------------------------------
/src/docs/styles.css:
--------------------------------------------------------------------------------
1 | body {
2 | font-family: 'Futura', 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS',
3 | sans-serif;
4 | margin: 0;
5 | background: linear-gradient(#099, #86d);
6 | background-attachment: fixed;
7 | }
8 |
9 | .bpm-meter {
10 | padding: 11px;
11 | text-align: center;
12 | }
13 |
14 | .bpm-meter__input {
15 | font-family: 'Futura', 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS';
16 | border: none;
17 | padding: 11px;
18 | margin-left: 11px;
19 | font-size: 18px;
20 | color: 13px;
21 | border-radius: 4px;
22 | box-shadow: rgba(0, 0, 0, 0.125) 0 4px 1px inset;
23 | color: #999;
24 | }
25 |
26 | .demo {
27 | margin: 22px;
28 | border-radius: 8px;
29 | background: #fafafa;
30 | box-shadow: rgba(0, 0, 0, 0.125) 8px 8px 0;
31 | border: 1px solid #eee;
32 | }
33 |
34 | h1 {
35 | font-size: 18px;
36 | font-weight: normal;
37 | color: rebeccapurple;
38 | padding: 11px;
39 | margin: 0;
40 | text-transform: uppercase;
41 | border-bottom: 1px solid #dfdfd0;
42 | }
43 |
44 | .instructions {
45 | padding: 11px;
46 | margin: 11px;
47 | color: #777;
48 | margin: none;
49 | font-family: monospace;
50 | background: #f9f9e6;
51 | border: 1px solid #f0f0de;
52 | }
53 |
54 | .instructions kbd {
55 | background: #ff0;
56 | display: inline-block;
57 | padding: 3px;
58 | }
59 |
60 | .list {
61 | list-style-type: none;
62 | margin: 0;
63 | padding: 0;
64 | }
65 |
66 | .list-item {
67 | display: block;
68 | padding: 14px;
69 | font-size: 16px;
70 | border-bottom: 1px solid #dfdfd0;
71 | color: #666;
72 | }
73 |
74 | .list-item--selected {
75 | background: tomato;
76 | color: gold;
77 | text-shadow: rgba(0, 0, 0, 0.5) 1px 1px 0;
78 | }
79 |
80 | .footer {
81 | color: #777;
82 | padding: 11px;
83 | }
84 |
85 | .modal {
86 | background: rgba(0, 0, 0, 0.5);
87 | position: fixed;
88 | left: 0;
89 | top: 0;
90 | width: 100%;
91 | height: 100%;
92 | display: flex;
93 | justify-content: center;
94 | align-items: center;
95 | }
96 |
97 | .modal__content {
98 | background: white;
99 | border-radius: 4px;
100 | padding: 22px;
101 | border: 1px solid #aaa;
102 | box-shadow: rgba(0, 0, 0, 0.2) 4px 4px 0;
103 | }
104 |
105 | .modal__content h3 {
106 | text-align: center;
107 | font-weight: normal;
108 | color: #999;
109 | font-size: 18px;
110 | }
111 |
112 | .modal__content h2 {
113 | text-align: center;
114 | font-weight: bold;
115 | color: #555;
116 | font-size: 22px;
117 | color: rebeccapurple;
118 | }
119 |
120 | .modal__content-help {
121 | padding: 11px;
122 | margin: 11px;
123 | color: #777;
124 | margin: none;
125 | font-family: monospace;
126 | background: #f9f9e6;
127 | border: 1px solid #f0f0de;
128 | }
129 |
130 | .love {
131 | position: fixed;
132 | right: 11px;
133 | bottom: 11px;
134 | padding: 11px 22px;
135 | border-radius: 22px;
136 | background: rgba(255, 255, 255, 0.9);
137 | border: 1px solid #eee;
138 | display: flex;
139 | justify-content: center;
140 | align-items: center;
141 | color: #777;
142 | opacity: 0.65;
143 | transform: scale(1);
144 | transition-property: all;
145 | transition-duration: 0.3s;
146 | transition-timing-function: ease-out;
147 | transform-origin: 95% 95%;
148 | }
149 |
150 | .love span {
151 | padding: 0 3px;
152 | }
153 |
154 | .love--loving {
155 | opacity: 1;
156 | transform: scale(1.8);
157 | transition-duration: 3s;
158 | }
159 |
--------------------------------------------------------------------------------
/src/lib/global.js:
--------------------------------------------------------------------------------
1 | // @flow
2 | import * as React from 'react';
3 | import createListener from 'keyboardist';
4 |
5 | const listeners = {
6 | keydown: createListener('keydown'),
7 | keyup: createListener('keyup'),
8 | };
9 |
10 | type Props = {
11 | eventName: 'keydown' | 'keyup',
12 | bindings: { [string]: any },
13 | monitor?: any,
14 | };
15 |
16 | class Keyboard extends React.PureComponent {
17 | subs = [];
18 |
19 | keyboardListener: any;
20 |
21 | static defaultProps = {
22 | eventName: 'keydown',
23 | bindings: {},
24 | monitor: null,
25 | };
26 |
27 | constructor(props: Props) {
28 | super(props);
29 | this.keyboardListener = listeners[props.eventName];
30 | }
31 |
32 | componentDidMount() {
33 | const { bindings, monitor } = this.props;
34 |
35 | Object.keys(bindings).forEach(eventName => {
36 | const callback = bindings[eventName];
37 | const subscription = this.keyboardListener.subscribe(eventName, callback);
38 | this.subs.push(subscription);
39 | });
40 |
41 | if (monitor) {
42 | this.keyboardListener.setMonitor(monitor);
43 | }
44 | }
45 |
46 | componentWillUnmount() {
47 | this.subs.forEach(subscription => subscription.unsubscribe());
48 | }
49 |
50 | render() {
51 | return null;
52 | }
53 | }
54 |
55 | export default Keyboard;
56 |
--------------------------------------------------------------------------------
/src/lib/index.jsx:
--------------------------------------------------------------------------------
1 | import GlobalKeyboardist from './global';
2 | import Input from './input';
3 |
4 | export const KeyboardInput = Input;
5 |
6 | export default GlobalKeyboardist;
7 |
--------------------------------------------------------------------------------
/src/lib/input.js:
--------------------------------------------------------------------------------
1 | import * as React from 'react';
2 | import createListener from 'keyboardist';
3 |
4 | class Input extends React.PureComponent {
5 | subs = [];
6 |
7 | static defaultProps = {
8 | component: 'input',
9 | eventName: 'keydown',
10 | bindings: {},
11 | monitor: null,
12 | };
13 |
14 | componentDidMount() {
15 | const { bindings, monitor, eventName } = this.props;
16 |
17 | this.keyboardListener = createListener(eventName, this.element);
18 |
19 | Object.keys(bindings).forEach(eventName => {
20 | const callback = bindings[eventName];
21 | const subscription = this.keyboardListener.subscribe(eventName, callback);
22 | this.subs.push(subscription);
23 | });
24 |
25 | if (monitor) {
26 | this.keyboardListener.setMonitor(monitor);
27 | }
28 | }
29 |
30 | componentWillUnmount() {
31 | this.subs.forEach(subscription => subscription.unsubscribe());
32 | }
33 |
34 | render() {
35 | const {
36 | component: Component,
37 | eventName,
38 | bindings,
39 | monitor,
40 | ...props
41 | } = this.props;
42 | return (this.element = el)} {...props} />;
43 | }
44 | }
45 |
46 | export default Input;
47 |
--------------------------------------------------------------------------------
/webpack.config.js:
--------------------------------------------------------------------------------
1 | const path = require('path');
2 | const HtmlWebpackPlugin = require('html-webpack-plugin');
3 |
4 | const port = process.env.PORT || 8000;
5 |
6 | module.exports = {
7 | entry: path.join(__dirname, 'src/docs'),
8 | output: {
9 | path: path.join(__dirname, 'docs'),
10 | filename: 'bundle.js',
11 | },
12 | module: {
13 | rules: [
14 | {
15 | test: /\.(js|jsx)$/,
16 | use: 'babel-loader',
17 | exclude: /node_modules/,
18 | },
19 | {
20 | test: /\.css$/,
21 | use: ['style-loader', 'css-loader'],
22 | },
23 | ],
24 | },
25 | plugins: [
26 | new HtmlWebpackPlugin({
27 | template: path.join(__dirname, 'src/docs/index.html'),
28 | }),
29 | ],
30 | resolve: {
31 | extensions: ['.js', '.jsx'],
32 | },
33 | devServer: {
34 | contentBase: path.join(__dirname, 'docs'),
35 | port,
36 | stats: 'minimal',
37 | },
38 | };
39 |
--------------------------------------------------------------------------------