text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("emotion"),require("react"),require("react-dom"),require("react-input-autosize"),require("prop-types")):"function"==typeof define&&define.amd?define(["emotion","react","react-dom","react-input-autosize","prop-types"],t):e.Select=t(e.emotion,e.React,e.ReactDOM,e.AutosizeInput,e.PropTypes)}(this,function(e,t,n,u,o){"use strict";var i="default"in t?t.default:t;u=u&&u.hasOwnProperty("default")?u.default:u,o=o&&o.hasOwnProperty("default")?o.default:o;var r=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}],s=function(e){for(var t=0;t<r.length;t++)e=e.replace(r[t].letters,r[t].base);return e},a="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},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var u=t[n];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(e,u.key,u)}}return function(t,n,u){return n&&e(t.prototype,n),u&&e(t,u),t}}(),p=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e},d=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var u in n)Object.prototype.hasOwnProperty.call(n,u)&&(e[u]=n[u])}return e},f=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},h=function(e,t){var n={};for(var u in e)t.indexOf(u)>=0||Object.prototype.hasOwnProperty.call(e,u)&&(n[u]=e[u]);return n},m=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},v=function(){return function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],u=!0,o=!1,i=void 0;try{for(var r,s=e[Symbol.iterator]();!(u=(r=s.next()).done)&&(n.push(r.value),!t||n.length!==t);u=!0);}catch(e){o=!0,i=e}finally{try{!u&&s.return&&s.return()}finally{if(o)throw i}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),g=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)},E=function(e){return e.replace(/^\s+|\s+$/g,"")},b=function(e){return e.label+" "+e.value},y=function(e){return function(t,n){var u=d({ignoreCase:!0,ignoreAccents:!0,stringify:b,trim:!0,matchFrom:"any"},e),o=u.ignoreCase,i=u.ignoreAccents,r=u.stringify,a=u.trim,l=u.matchFrom,c=a?E(n):n,p=a?E(r(t)):r(t);return o&&(c=c.toLowerCase(),p=p.toLowerCase()),i&&(c=s(c),p=s(p)),"start"===l?p.substr(0,c.length)===c:p.indexOf(c)>-1}},O=function(t){function n(){return l(this,n),m(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return f(n,t),c(n,[{key:"render",value:function(){var t=this.props,n=(t.in,t.out,t.onExited,t.appear,t.enter,t.exit,t.innerRef),u=h(t,["in","out","onExited","appear","enter","exit","innerRef"]);return i.createElement("input",d({ref:n},u,{className:e.css({background:0,border:0,fontSize:"inherit",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(0)"})}))}}]),n}(t.Component),C=function(e){function t(){return l(this,t),m(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,e),c(t,[{key:"componentDidMount",value:function(){this.props.innerRef(n.findDOMNode(this))}},{key:"componentWillUnmount",value:function(){this.props.innerRef(null)}},{key:"render",value:function(){return this.props.children}}]),t}(t.Component),F=["boxSizing","height","overflow","paddingRight","position"],A={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function D(e){e.preventDefault()}function S(e){e.stopPropagation()}function x(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;0===e?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function w(){return"ontouchstart"in window||navigator.maxTouchPoints}var M=!("undefined"==typeof window||!window.document||!window.document.createElement),I=0,V=function(e){function t(){var e,n,u;l(this,t);for(var o=arguments.length,i=Array(o),r=0;r<o;r++)i[r]=arguments[r];return n=u=m(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),u.originalStyles={},u.listenerOptions={capture:!1,passive:!1},m(u,n)}return f(t,e),c(t,[{key:"componentDidMount",value:function(){var e=this;if(M){var t=this.props,n=t.accountForScrollbars,u=t.touchScrollTarget,o=document.body,i=o&&o.style;if(n&&F.forEach(function(t){var n=i&&i[t];e.originalStyles[t]=n}),n&&I<1){var r=parseInt(this.originalStyles.paddingRight,10)||0,s=document.body?document.body.clientWidth:0,a=window.innerWidth-s+r||0;Object.keys(A).forEach(function(e){var t=A[e];i&&(i[e]=t)}),i&&(i.paddingRight=a+"px")}o&&w()&&(o.addEventListener("touchmove",D,this.listenerOptions),u&&(u.addEventListener("touchstart",x,this.listenerOptions),u.addEventListener("touchmove",S,this.listenerOptions))),I+=1}}},{key:"componentWillUnmount",value:function(){var e=this;if(M){var t=this.props,n=t.accountForScrollbars,u=t.touchScrollTarget,o=document.body,i=o&&o.style;I=Math.max(I-1,0),n&&I<1&&F.forEach(function(t){var n=e.originalStyles[t];i&&(i[t]=n)}),o&&w()&&(o.removeEventListener("touchmove",D,this.listenerOptions),u&&(u.removeEventListener("touchstart",x,this.listenerOptions),u.removeEventListener("touchmove",S,this.listenerOptions)))}}},{key:"render",value:function(){return null}}]),t}(t.Component);V.defaultProps={accountForScrollbars:!0};var P,k=(P="div",function(t){var n=t.css,u=t.innerRef,o=h(t,["css","innerRef"]);return i.createElement(P,d({ref:u,className:e.css(n)},o))}),L=function(t){return i.createElement("span",d({className:e.css({zIndex:9999,border:0,clip:"rect(1px, 1px, 1px, 1px)",height:1,width:1,position:"absolute",overflow:"hidden",padding:0,whiteSpace:"nowrap",backgroundColor:"red",color:"blue"})},t))},B=function(t){function n(){var e,t,u;l(this,n);for(var o=arguments.length,i=Array(o),r=0;r<o;r++)i[r]=arguments[r];return t=u=m(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(i))),u.state={touchScrollTarget:null},u.getScrollTarget=function(e){e!==u.state.touchScrollTarget&&u.setState({touchScrollTarget:e})},u.blurSelectInput=function(){document.activeElement&&document.activeElement.blur()},m(u,t)}return f(n,t),c(n,[{key:"render",value:function(){var t=this.props,n=t.children,u=t.isEnabled,o=this.state.touchScrollTarget;return u?i.createElement("div",null,i.createElement(k,{onClick:this.blurSelectInput,className:e.css({position:"fixed",left:0,bottom:0,right:0,top:0})}),i.createElement(C,{innerRef:this.getScrollTarget},n),o?i.createElement(V,{touchScrollTarget:o}):null):n}}]),n}(t.PureComponent),T=function(e){function t(){var e,n,u;l(this,t);for(var o=arguments.length,i=Array(o),r=0;r<o;r++)i[r]=arguments[r];return n=u=m(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),u.isBottom=!1,u.isTop=!1,u.cancelScroll=function(e){e.preventDefault(),e.stopPropagation()},u.handleEventDelta=function(e,t){var n=u.props,o=n.onBottomArrive,i=n.onBottomLeave,r=n.onTopArrive,s=n.onTopLeave,a=u.scrollTarget,l=a.scrollTop,c=a.scrollHeight,p=a.clientHeight,d=u.scrollTarget,f=t>0,h=c-p-l,m=!1;h>t&&u.isBottom&&(i&&i(e),u.isBottom=!1),f&&u.isTop&&(s&&s(e),u.isTop=!1),f&&t>h?(o&&!u.isBottom&&o(e),d.scrollTop=c,m=!0,u.isBottom=!0):!f&&-t>l&&(r&&!u.isTop&&r(e),d.scrollTop=0,m=!0,u.isTop=!0),m&&u.cancelScroll(e)},u.onWheel=function(e){u.handleEventDelta(e,e.deltaY)},u.onTouchStart=function(e){u.touchStart=e.changedTouches[0].clientY},u.onTouchMove=function(e){var t=u.touchStart-e.changedTouches[0].clientY;u.handleEventDelta(e,t)},u.getScrollTarget=function(e){u.scrollTarget=e},m(u,n)}return f(t,e),c(t,[{key:"componentDidMount",value:function(){this.startListening(this.scrollTarget)}},{key:"componentWillUnmount",value:function(){this.stopListening(this.scrollTarget)}},{key:"startListening",value:function(e){e.scrollHeight<=e.clientHeight||("function"==typeof e.addEventListener&&e.addEventListener("wheel",this.onWheel,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.addEventListener&&e.addEventListener("touchmove",this.onTouchMove,!1))}},{key:"stopListening",value:function(e){e.scrollHeight<=e.clientHeight||("function"==typeof e.removeEventListener&&e.removeEventListener("wheel",this.onWheel,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchstart",this.onTouchStart,!1),"function"==typeof e.removeEventListener&&e.removeEventListener("touchmove",this.onTouchMove,!1))}},{key:"render",value:function(){return i.createElement(C,{innerRef:this.getScrollTarget},this.props.children)}}]),t}(t.Component),R=function(e){function t(){return l(this,t),m(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,e),c(t,[{key:"render",value:function(){var e=this.props,t=e.isEnabled,n=h(e,["isEnabled"]);return t?i.createElement(T,n):this.props.children}}]),t}(t.Component);R.defaultProps={isEnabled:!0};var H="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};for(var N,_=(function(e){(function(){var t,n,u,o,i,r;"undefined"!=typeof performance&&null!==performance&&performance.now?e.exports=function(){return performance.now()}:"undefined"!=typeof process&&null!==process&&process.hrtime?(e.exports=function(){return(t()-i)/1e6},n=process.hrtime,o=(t=function(){var e;return 1e9*(e=n())[0]+e[1]})(),r=1e9*process.uptime(),i=o-r):Date.now?(e.exports=function(){return Date.now()-u},u=Date.now()):(e.exports=function(){return(new Date).getTime()-u},u=(new Date).getTime())}).call(H)}(N={exports:{}},N.exports),N.exports),U="undefined"==typeof window?H:window,j=["moz","webkit"],z="AnimationFrame",W=U["request"+z],Y=U["cancel"+z]||U["cancelRequest"+z],G=0;!W&&G<j.length;G++)W=U[j[G]+"Request"+z],Y=U[j[G]+"Cancel"+z]||U[j[G]+"CancelRequest"+z];if(!W||!Y){var q=0,X=0,K=[];W=function(e){if(0===K.length){var t=_(),n=Math.max(0,1e3/60-(t-q));q=n+t,setTimeout(function(){var e=K.slice(0);K.length=0;for(var t=0;t<e.length;t++)if(!e[t].cancelled)try{e[t].callback(q)}catch(e){setTimeout(function(){throw e},0)}},Math.round(n))}return K.push({handle:++X,callback:e,cancelled:!1}),X},Y=function(e){for(var t=0;t<K.length;t++)K[t].handle===e&&(K[t].cancelled=!0)}}var J=function(e){return W.call(U,e)};J.cancel=function(){Y.apply(U,arguments)},J.polyfill=function(e){e||(e=U),e.requestAnimationFrame=W,e.cancelAnimationFrame=Y};var Z=function(){};function Q(e,t){return t?"-"===t[0]?e+t:e+"__"+t:e}var $=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===(void 0===e?"undefined":a(e))&&null!==e?[e]:[]};function ee(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function te(e){return ee(e)?window.pageYOffset:e.scrollTop}function ne(e,t){ee(e)?window.scrollTo(0,t):e.scrollTop=t}function ue(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,u=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Z,o=te(e),i=t-o,r=10,s=0;!function t(){var a,l=i*((a=(a=s+=r)/n-1)*a*a+1)+o;ne(e,l),s<n?J(t):u(e)}()}function oe(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}var ie="#222",re="#2684FF",se="#B2D4FF",ae="#DEEBFF",le="#DE350B",ce="#FFBDAD",pe="hsl(0, 0%, 100%)",de="hsl(0, 0%, 98%)",fe="hsl(0, 0%, 95%)",he="hsl(0, 0%, 90%)",me="hsl(0, 0%, 80%)",ve="hsl(0, 0%, 70%)",ge="hsl(0, 0%, 60%)",Ee="hsl(0, 0%, 50%)",be="hsl(0, 0%, 40%)",ye="hsl(0, 0%, 0%)",Oe="hsla(0, 0%, 0%, 0.1)",Ce={baseUnit:4,controlHeight:38,menuGutter:8},Fe=function(t){function n(){return l(this,n),m(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return f(n,t),c(n,[{key:"render",value:function(){var t=this.props,n=t.children,u=t.className,o=t.cx,r=t.isMulti,s=t.getStyles,a=t.hasValue;return i.createElement("div",{className:o(e.css(s("valueContainer",this.props)),{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":a},u)},n)}}]),n}(t.Component),Ae=function(t){var n=t.size,u=h(t,["size"]);return i.createElement("svg",d({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:e.css({display:"inline-block",fill:"currentColor",lineHeight:1,stroke:"currentColor",strokeWidth:0})},u))},De=function(e){return i.createElement(Ae,d({size:20},e),i.createElement("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},Se=function(e){return i.createElement(Ae,d({size:20},e),i.createElement("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},xe=function(e){var t=e.isFocused;return{color:t?be:me,display:"flex",padding:2*Ce.baseUnit,transition:"color 150ms",":hover":{color:t?ye:ge}}},we=xe,Me=xe,Ie=function(t){var n=t.color,u=t.delay,o=t.offset;return i.createElement("span",{className:e.css({animationDuration:"1s",animationDelay:u+"ms",animationIterationCount:"infinite",animationName:"react-select-loading-indicator",animationTimingFunction:"ease-in-out",backgroundColor:n,borderRadius:"1em",display:"inline-block",marginLeft:o?"1em":null,height:"1em",verticalAlign:"top",width:"1em"})})};e.injectGlobal("@keyframes ","react-select-loading-indicator","{0%,80%,100%{opacity:0;}40%{opacity:1;}};");var Ve=function(t){var n=t.className,u=t.cx,o=t.getStyles,r=t.innerProps,s=t.isFocused,a=t.isRtl,l=s?ie:me;return i.createElement("div",d({},r,{className:u(e.css(o("loadingIndicator",t)),{indicator:!0,"loading-indicator":!0},n)}),i.createElement(Ie,{color:l,delay:0,offset:a}),i.createElement(Ie,{color:l,delay:160,offset:!0}),i.createElement(Ie,{color:l,delay:320,offset:!a}))};Ve.defaultProps={size:4};function Pe(e){var t=e.maxHeight,n=e.menuEl,u=e.minHeight,o=e.placement,i=e.shouldScroll,r=e.isFixedPosition,s=function(e){var t=getComputedStyle(e),n="absolute"===t.position,u=/(auto|scroll)/,o=document.documentElement;if("fixed"===t.position)return o;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),(!n||"static"!==t.position)&&u.test(t.overflow+t.overflowY+t.overflowX))return i;return o}(n),a={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return a;var l=s.getBoundingClientRect().height,c=n.getBoundingClientRect(),p=c.bottom,d=c.height,f=c.top,h=n.offsetParent.getBoundingClientRect().top,m=window.innerHeight,v=te(s),g=Ce.menuGutter,E=h-g,b=m-f,y=E+v,O=l-v-f,C=p-m+v+g,F=v+f-g;switch(o){case"auto":case"bottom":if(b>=d)return{placement:"bottom",maxHeight:t};if(O>=d&&!r)return i&&ue(s,C,160),{placement:"bottom",maxHeight:t};if(!r&&O>=u||r&&b>=u)return i&&ue(s,C,160),{placement:"bottom",maxHeight:r?b-g:O-g};if("auto"===o||r){var A=t;return(!r&&y>=u||r&&E>=u)&&(A=r?E-g-Ce.controlHeight:y-g-Ce.controlHeight),{placement:"top",maxHeight:A}}if("bottom"===o)return ne(s,C),{placement:"bottom",maxHeight:t};break;case"top":if(E>=d)return{placement:"top",maxHeight:t};if(y>=d&&!r)return i&&ue(s,F,160),{placement:"top",maxHeight:t};if(!r&&y>=u||r&&E>=u){var D=t;return(!r&&y>=u||r&&E>=u)&&(D=r?E-g:y-g),i&&ue(s,F,160),{placement:"top",maxHeight:D}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'+o+'".')}return a}var ke=function(e){return"auto"===e?"bottom":e},Le=function(t){function n(){var e,t,u;l(this,n);for(var o=arguments.length,i=Array(o),r=0;r<o;r++)i[r]=arguments[r];return t=u=m(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(i))),u.state={maxHeight:u.props.maxMenuHeight,placement:null},u.getPlacement=function(e){var t=u.props,n=t.minMenuHeight,o=t.maxMenuHeight,i=t.menuPlacement,r=t.menuPosition,s=t.menuShouldScrollIntoView,a=u.context.getPortalPlacement;if(e){var l="fixed"===r,c=Pe({maxHeight:o,menuEl:e,minHeight:n,placement:i,shouldScroll:s&&!l,isFixedPosition:l});a&&a(c),u.setState(c)}},u.getState=function(){var e=u.props.menuPlacement,t=u.state.placement||ke(e);return d({},u.props,{placement:t,maxHeight:u.state.maxHeight})},m(u,t)}return f(n,t),c(n,[{key:"render",value:function(){var t=this.props,n=t.children,u=t.className,o=t.cx,r=t.getStyles,s=t.innerProps;return i.createElement("div",d({className:o(e.css(r("menu",this.getState())),{menu:!0},u),ref:this.getPlacement},s),n)}}]),n}(t.Component);Le.contextTypes={getPortalPlacement:o.func};var Be=function(){return{color:ge,padding:2*Ce.baseUnit+"px "+3*Ce.baseUnit+"px",textAlign:"center"}},Te=Be,Re=Be,He=function(t){var n=t.children,u=t.className,o=t.cx,r=t.getStyles,s=t.innerProps;return i.createElement("div",d({className:o(e.css(r("noOptionsMessage",t)),{"menu-notice":!0,"menu-notice--no-options":!0},u)},s),n)};He.defaultProps={children:"No options"};var Ne=function(t){var n=t.children,u=t.className,o=t.cx,r=t.getStyles,s=t.innerProps;return i.createElement("div",d({className:o(e.css(r("loadingMessage",t)),{"menu-notice":!0,"menu-notice--loading":!0},u)},s),n)};Ne.defaultProps={children:"Loading..."};var _e=function(t){function u(){var e,t,n;l(this,u);for(var o=arguments.length,i=Array(o),r=0;r<o;r++)i[r]=arguments[r];return t=n=m(this,(e=u.__proto__||Object.getPrototypeOf(u)).call.apply(e,[this].concat(i))),n.state={placement:null},n.getPortalPlacement=function(e){var t=e.placement;t!==ke(n.props.menuPlacement)&&n.setState({placement:t})},m(n,t)}return f(u,t),c(u,[{key:"getChildContext",value:function(){return{getPortalPlacement:this.getPortalPlacement}}},{key:"render",value:function(){var t=this.props,u=t.appendTo,o=t.children,r=t.controlElement,s=t.menuPlacement,a=t.menuPosition,l=t.getStyles,c="fixed"===a;if(!u&&!c||!r)return null;var p=this.state.placement||ke(s),d=function(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}(r),f=c?0:window.pageYOffset,h={offset:d[p]+f,position:a,rect:d},m=i.createElement("div",{className:e.css(l("menuPortal",h))},o);return u?n.createPortal(m,u):m}}]),u}(t.Component);_e.childContextTypes={getPortalPlacement:o.func};var Ue=k,je=k,ze=function(e){function t(){return l(this,t),m(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return f(t,e),c(t,[{key:"render",value:function(){var e=this.props,t=e.children,n=h(e,["children"]);return i.createElement(k,n,t)}}]),t}(t.Component);ze.defaultProps={children:i.createElement(De,{size:14})};var We=function(t){function n(){return l(this,n),m(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return f(n,t),c(n,[{key:"render",value:function(){var t=this.props,n=t.children,u=t.className,o=t.components,r=t.cx,s=t.getStyles,a=t.innerProps,l=t.isDisabled,c=t.removeProps,p={container:r(e.css(s("multiValue",this.props)),{"multi-value":!0,"multi-value--is-disabled":l},u),label:r(e.css(s("multiValueLabel",this.props)),{"multi-value__label":!0},u),remove:r(e.css(s("multiValueRemove",this.props)),{"multi-value__remove":!0},u)},f=o.Container,h=o.Label,m=o.Remove;return i.createElement(f,d({className:p.container},a),i.createElement(h,{className:p.label},n),i.createElement(m,d({className:p.remove},c)))}}]),n}(t.Component);We.defaultProps={cropWithEllipsis:!0};var Ye={ClearIndicator:function(t){var n=t.children,u=void 0===n?i.createElement(De,null):n,o=t.className,r=t.cx,s=t.getStyles,a=t.innerProps;return i.createElement("div",d({},a,{className:r(e.css(s("clearIndicator",t)),{indicator:!0,"clear-indicator":!0},o)}),u)},Control:function(t){var n=t.children,u=t.cx,o=t.getStyles,r=t.className,s=t.isDisabled,a=t.isFocused,l=t.innerProps,c=l.innerRef,p=h(l,["innerRef"]);return i.createElement("div",d({ref:c,className:u(e.css(o("control",t)),{control:!0,"control--is-disabled":s,"control--is-focused":a},r)},p),n)},DropdownIndicator:function(t){var n=t.children,u=void 0===n?i.createElement(Se,null):n,o=t.className,r=t.cx,s=t.getStyles,a=t.innerProps;return i.createElement("div",d({},a,{className:r(e.css(s("dropdownIndicator",t)),{indicator:!0,"dropdown-indicator":!0},o)}),u)},DownChevron:Se,CrossIcon:De,Group:function(t){var n=t.children,u=t.className,o=t.cx,r=t.getStyles,s=t.Heading,a=t.label;return i.createElement("div",{className:o(e.css(r("group",t)),{group:!0},u)},i.createElement(s,{getStyles:r,cx:o},a),i.createElement("div",null,n))},GroupHeading:function(t){var n=t.className,u=t.cx,o=t.getStyles,r=h(t,["className","cx","getStyles"]);return i.createElement("div",d({className:u(e.css(o("groupHeading",t)),{"group-heading":!0},n)},r))},IndicatorsContainer:function(t){var n=t.children,u=t.className,o=t.cx,r=t.getStyles;return i.createElement("div",{className:o(e.css(r("indicatorsContainer",t)),{indicators:!0},u)},n)},IndicatorSeparator:function(t){var n=t.className,u=t.cx,o=t.getStyles,r=t.innerProps;return i.createElement("span",d({},r,{className:u(e.css(o("indicatorSeparator",t)),{"indicator-separator":!0},n)}))},Input:function(t){var n=t.className,o=t.cx,r=t.getStyles,s=t.innerRef,a=t.isHidden,l=t.isDisabled,c=h(t,["className","cx","getStyles","innerRef","isHidden","isDisabled"]);return i.createElement("div",{className:e.css(r("input",c))},i.createElement(u,d({className:o(null,{input:!0},n),inputRef:s,inputStyle:function(e){return{background:0,border:0,fontSize:"inherit",opacity:e?0:1,outline:0,padding:0,color:"inherit"}}(a),disabled:l},c)))},LoadingIndicator:Ve,Menu:Le,MenuList:function(t){var n=t.children,u=t.className,o=t.cx,r=t.getStyles,s=t.isMulti,a=t.innerProps.innerRef;return i.createElement("div",{className:o(e.css(r("menuList",t)),{"menu-list":!0,"menu-list--is-multi":s},u),ref:a},n)},MenuPortal:_e,LoadingMessage:Ne,NoOptionsMessage:He,MultiValue:We,MultiValueContainer:Ue,MultiValueLabel:je,MultiValueRemove:ze,Option:function(t){var n=t.children,u=t.className,o=t.cx,r=t.getStyles,s=t.isDisabled,a=t.isFocused,l=t.isSelected,c=t.innerProps,p=c.innerRef,f=h(c,["innerRef"]);return i.createElement("div",d({ref:p,className:o(e.css(r("option",t)),{option:!0,"option--is-disabled":s,"option--is-focused":a,"option--is-selected":l},u)},f),n)},Placeholder:function(t){var n=t.children,u=t.className,o=t.cx,r=t.getStyles,s=t.innerProps;return i.createElement("div",d({className:o(e.css(r("placeholder",t)),{placeholder:!0},u)},s),n)},SelectContainer:function(t){var n=t.children,u=t.className,o=t.cx,r=t.getStyles,s=t.innerProps,a=t.isDisabled,l=t.isRtl;return i.createElement("div",d({className:o(e.css(r("container",t)),{"--is-disabled":a,"--is-rtl":l},u)},s),n)},SingleValue:function(t){var n=t.children,u=t.className,o=t.cx,r=t.getStyles,s=t.isDisabled,a=t.innerProps;return i.createElement("div",d({className:o(e.css(r("singleValue",t)),{"single-value":!0,"single-value--is-disabled":s},u)},a),n)},ValueContainer:Fe},Ge=function(e){return d({},Ye,e.components)},qe={clearIndicator:Me,container:function(e){var t=e.isDisabled;return{direction:e.isRtl?"rtl":null,pointerEvents:t?"none":null,position:"relative"}},control:function(e){var t=e.isDisabled,n=e.isFocused;return{alignItems:"center",backgroundColor:t?fe:n?pe:de,borderColor:t?he:n?re:me,borderRadius:4,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px "+re:null,cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:Ce.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms","&:hover":{borderColor:n?re:ve}}},dropdownIndicator:we,group:function(){return{paddingBottom:2*Ce.baseUnit,paddingTop:2*Ce.baseUnit}},groupHeading:function(){return{color:"#999",cursor:"default",display:"block",fontSize:"75%",fontWeight:"500",marginBottom:"0.25em",paddingLeft:3*Ce.baseUnit,paddingRight:3*Ce.baseUnit,textTransform:"uppercase"}},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e){return{alignSelf:"stretch",backgroundColor:e.isDisabled?he:me,marginBottom:2*Ce.baseUnit,marginTop:2*Ce.baseUnit,width:1}},input:function(e){var t=e.isDisabled;return{margin:Ce.baseUnit/2,paddingBottom:Ce.baseUnit/2,paddingTop:Ce.baseUnit/2,visibility:t?"hidden":"visible",color:ie}},loadingIndicator:function(e){var t=e.isFocused,n=e.size;return{color:t?be:me,display:"flex",padding:2*Ce.baseUnit,transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"}},loadingMessage:Re,menu:function(e){var t,n=e.placement;return p(t={},function(e){return e?{bottom:"top",top:"bottom"}[e]:"bottom"}(n),"100%"),p(t,"backgroundColor",pe),p(t,"borderRadius",4),p(t,"boxShadow","0 0 0 1px "+Oe+", 0 4px 11px "+Oe),p(t,"marginBottom",Ce.menuGutter),p(t,"marginTop",Ce.menuGutter),p(t,"position","absolute"),p(t,"width","100%"),p(t,"zIndex",1),t},menuList:function(e){return{maxHeight:e.maxHeight,overflowY:"auto",paddingBottom:Ce.baseUnit,paddingTop:Ce.baseUnit,position:"relative",WebkitOverflowScrolling:"touch"}},menuPortal:function(e){var t=e.rect,n=e.offset,u=e.position;return{left:t.left,position:u,top:n,width:t.width,zIndex:1}},multiValue:function(){return{backgroundColor:he,borderRadius:2,display:"flex",margin:Ce.baseUnit/2,minWidth:0}},multiValueLabel:function(e){var t=e.cropWithEllipsis;return{color:ie,fontSize:"85%",overflow:"hidden",padding:3,paddingLeft:6,textOverflow:t?"ellipsis":null,whiteSpace:"nowrap"}},multiValueRemove:function(e){return{alignItems:"center",borderRadius:2,backgroundColor:e.isFocused&&ce,display:"flex",paddingLeft:Ce.baseUnit,paddingRight:Ce.baseUnit,":hover":{backgroundColor:ce,color:le}}},noOptionsMessage:Te,option:function(e){var t=e.isDisabled,n=e.isFocused,u=e.isSelected;return{backgroundColor:u?re:n?ae:"transparent",color:t?me:u?pe:"inherit",cursor:"default",display:"block",fontSize:"inherit",padding:2*Ce.baseUnit+"px "+3*Ce.baseUnit+"px",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)",":active":{backgroundColor:u?re:se}}},placeholder:function(){return{color:Ee,marginLeft:Ce.baseUnit/2,marginRight:Ce.baseUnit/2,position:"absolute",top:"50%",transform:"translateY(-50%)"}},singleValue:function(e){return{color:e.isDisabled?ge:ie,marginLeft:Ce.baseUnit/2,marginRight:Ce.baseUnit/2,maxWidth:"calc(100% - "+2*Ce.baseUnit+"px)",overflow:"hidden",position:"absolute",textOverflow:"ellipsis",whiteSpace:"nowrap",top:"50%",transform:"translateY(-50%)"}},valueContainer:function(){return{alignItems:"center",display:"flex",flex:1,flexWrap:"wrap",padding:Ce.baseUnit/2+"px "+2*Ce.baseUnit+"px",WebkitOverflowScrolling:"touch",position:"relative"}}};var Xe={backspaceRemovesValue:!0,blurInputOnSelect:oe(),captureMenuScroll:!oe(),closeMenuOnSelect:!0,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:y(),formatGroupLabel:function(e){return e.label},getOptionLabel:function(e){return e.label},getOptionValue:function(e){return e.value},isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return t+" result"+(1!==t?"s":"")+" available"},styles:{},tabIndex:"0",tabSelectsValue:!0},Ke=1,Je=function(e){function t(e){l(this,t);var n=m(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));Ze.call(n);var u=e.value;n.components=Ge(e),n.instancePrefix="react-select-"+(n.props.instanceId||++Ke);var o=$(u),i=n.buildMenuOptions(e,o);return n.state.menuOptions=i,n.state.selectValue=o,n}return f(t,e),c(t,[{key:"componentDidMount",value:function(){this.startListeningToTouch(),this.props.autoFocus&&this.focusInput()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props,n=t.components,u=t.options,o=t.value,i=t.inputValue;if(e.components!==n&&(this.components=Ge(e)),e.value!==o||e.options!==u||e.inputValue!==i){var r=$(e.value),s=this.buildMenuOptions(e,r),a=this.getNextFocusedValue(r),l=this.getNextFocusedOption(s.focusable);this.setState({menuOptions:s,selectValue:r,focusedOption:l,focusedValue:a})}null!=this.inputIsHiddenAfterUpdate&&(this.setState({inputIsHidden:this.inputIsHiddenAfterUpdate}),delete this.inputIsHiddenAfterUpdate)}},{key:"componentDidUpdate",value:function(e){var t,n,u,o,i,r=this.props,s=r.isDisabled,a=r.menuIsOpen,l=this.state.isFocused;(l&&!s&&e.isDisabled||l&&a&&!e.menuIsOpen)&&this.focusInput(),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(t=this.menuListRef,n=this.focusedOptionRef,u=t.getBoundingClientRect(),o=n.getBoundingClientRect(),i=n.offsetHeight/3,o.bottom+i>u.bottom?ne(t,Math.min(n.offsetTop+n.clientHeight-t.offsetHeight+i,t.scrollHeight)):o.top-i<u.top&&ne(t,Math.max(n.offsetTop-i,0))),this.scrollToFocusedOptionOnUpdate=!1}},{key:"componentWillUnmount",value:function(){this.stopListeningToTouch()}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){var e=this.props,t=e.isSearchable,n=e.isMulti;this.announceAriaLiveContext({event:"input",context:{isSearchable:t,isMulti:n}}),this.onInputChange("",{action:"menu-close"}),this.props.onMenuClose()}},{key:"onInputChange",value:function(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this.state,n=t.menuOptions,u=t.selectValue,o=this.props.isMulti,i="first"===e?0:n.focusable.length-1;if(!o){var r=n.focusable.indexOf(u[0]);r>-1&&(i=r)}this.scrollToFocusedOptionOnUpdate=!0,this.inputIsHiddenAfterUpdate=!1,this.onMenuOpen(),this.setState({focusedValue:null,focusedOption:n.focusable[i]}),this.announceAriaLiveContext({event:"menu"})}},{key:"focusValue",value:function(e){var t=this.props,n=t.isMulti,u=t.isSearchable,o=this.state,i=o.selectValue,r=o.focusedValue;if(n){this.setState({focusedOption:null});var s=i.indexOf(r);r||(s=-1,this.announceAriaLiveContext({event:"value"}));var a=i.length-1,l=-1;if(i.length){switch(e){case"previous":l=0===s?0:-1===s?a:s-1;break;case"next":s>-1&&s<a&&(l=s+1)}-1===l&&this.announceAriaLiveContext({event:"input",context:{isSearchable:u,isMulti:n}}),this.setState({inputIsHidden:-1!==l,focusedValue:i[l]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,n=this.state,u=n.focusedOption,o=n.menuOptions.focusable;if(o.length){var i=0,r=o.indexOf(u);u||(r=-1,this.announceAriaLiveContext({event:"menu"})),"up"===e?i=r>0?r-1:o.length-1:"down"===e?i=(r+1)%o.length:"pageup"===e?(i=r-t)<0&&(i=0):"pagedown"===e?(i=r+t)>o.length-1&&(i=o.length-1):"last"===e&&(i=o.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:o[i],focusedValue:null})}}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.getStyles,n=this.setValue,u=this.selectOption,o=this.props,i=o.className,r=o.classNamePrefix,s=o.isMulti,a=o.isRtl,l=o.options,c=this.state.selectValue,p=this.hasValue(),d=r;return i&&void 0===r&&(console.warn("\n        Warning: the behaviour of 'className' has changed between 2.0.0-beta.2 and 2.0.0-beta.3.\n        You can now use className to specify the class name of the outer container, and classNamePrefix to enable our provided BEM class names for internal elements.\n        The className prop will have no effect on internal elements when 2.0.0 is released.\n      "),d=i),{cx:function(e,t,n,u){var o=[t,u];if(n&&e)for(var i in n)n.hasOwnProperty(i)&&n[i]&&o.push(""+Q(e,i));return o.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}.bind(null,d),clearValue:e,getStyles:t,getValue:function(){return c},hasValue:p,isMulti:s,isRtl:a,options:l,selectOption:u,setValue:n,selectProps:o}}},{key:"getNextFocusedValue",value:function(e){if(this.clearFocusValueOnUpdate)return this.clearFocusValueOnUpdate=!1,null;var t=this.state,n=t.focusedValue,u=t.selectValue.indexOf(n);if(u>-1){if(e.indexOf(n)>-1)return n;if(u<e.length)return e[u]}return null}},{key:"getNextFocusedOption",value:function(e){var t=this.state.focusedOption;return t&&e.indexOf(t)>-1?t:e[0]}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.state.menuOptions.render.length}},{key:"countOptions",value:function(){return this.state.menuOptions.focusable.length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,n=e.isMulti;return void 0===t?n:t}},{key:"isOptionDisabled",value:function(e){return"function"==typeof this.props.isOptionDisabled&&this.props.isOptionDisabled(e)}},{key:"isOptionSelected",value:function(e,t){var n=this;if(t.indexOf(e)>-1)return!0;if("function"==typeof this.props.isOptionSelected)return this.props.isOptionSelected(e,t);var u=this.getOptionValue(e);return t.some(function(e){return n.getOptionValue(e)===u})}},{key:"filterOption",value:function(e,t){return!this.props.filterOption||this.props.filterOption(e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"==typeof this.props.formatOptionLabel){var n=this.props.inputValue,u=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:n,selectValue:u})}return this.getOptionLabel(e)}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"buildMenuOptions",value:function(e,t){var n=this,u=e.inputValue,o=void 0===u?"":u,i=function(e,u){var i=n.isOptionDisabled(e),r=n.isOptionSelected(e,t),s=n.getOptionLabel(e),a=n.getOptionValue(e);if(!(n.shouldHideSelectedOptions()&&r||!n.filterOption({label:s,value:a,data:e},o))){var l=i?void 0:function(){return n.onOptionHover(e)},c=i?void 0:function(){return n.selectOption(e)},p=n.getElementId("option")+"-"+u;return{innerProps:{id:p,onClick:c,onMouseMove:l,onMouseOver:l,role:"option",tabIndex:-1},data:e,isDisabled:i,isSelected:r,key:p,label:s,type:"option",value:a}}};return e.options.reduce(function(e,t,u){if(t.options){n.hasGroups||(n.hasGroups=!0);var o=t.options.map(function(t,n){var o=i(t,u+"-"+n);return o&&!o.isDisabled&&e.focusable.push(t),o}).filter(Boolean);if(o.length){var r=n.getElementId("group")+"-"+u;e.render.push({type:"group",key:r,data:t,options:o})}}else{var s=i(t,""+u);s&&(e.render.push(s),s.isDisabled||e.focusable.push(t))}return e},{render:[],focusable:[]})}},{key:"constructAriaLiveMessage",value:function(){var e=this.state,t=e.ariaLiveContext,n=e.selectValue,u=e.focusedValue,o=e.focusedOption,i=this.props,r=i.options,s=i.menuIsOpen,a=i.inputValue,l=i.screenReaderStatus;return(u?function(e){var t=e.focusedValue,n=e.getOptionLabel,u=e.selectValue;return"value "+n(t)+" focused, "+(u.indexOf(t)+1)+" of "+u.length+"."}({focusedValue:u,getOptionLabel:this.getOptionLabel,selectValue:n}):"")+" "+(o&&s?function(e){var t=e.focusedOption,n=e.getOptionLabel,u=e.options;return"option "+n(t)+" focused, "+(u.indexOf(t)+1)+" of "+u.length+"."}({focusedOption:o,getOptionLabel:this.getOptionLabel,options:r}):"")+" "+function(e){var t=e.inputValue;return e.screenReaderMessage+(t?" for search term "+t:"")+"."}({inputValue:a,screenReaderMessage:l({count:this.countOptions()})})+" "+t}},{key:"renderInput",value:function(){var e=this.props,t=e.isDisabled,n=e.isSearchable,u=e.inputId,o=e.inputValue,r=e.tabIndex,s=this.components.Input,a=this.state.inputIsHidden,l=u||this.getElementId("input");if(!n)return i.createElement(O,{id:l,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Z,onFocus:this.onInputFocus,readOnly:!0,tabIndex:r,value:""});var c={"aria-autocomplete":"list","aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"]},p=this.commonProps.cx;return i.createElement(s,d({autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",cx:p,getStyles:this.getStyles,id:l,innerRef:this.getInputRef,isDisabled:t,isHidden:a,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:r,type:"text",value:o},c))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.components,n=t.MultiValue,u=t.MultiValueContainer,o=t.MultiValueLabel,r=t.MultiValueRemove,s=t.SingleValue,a=t.Placeholder,l=this.commonProps,c=this.props,p=c.controlShouldRenderValue,f=c.isDisabled,h=c.isMulti,m=c.inputValue,v=c.placeholder,g=this.state,E=g.selectValue,b=g.focusedValue;if(!this.hasValue()||!p)return m?null:i.createElement(a,d({},l,{key:"placeholder",isDisabled:f}),v);if(h)return E.map(function(t){var s=t===b;return i.createElement(n,d({},l,{components:{Container:u,Label:o,Remove:r},isFocused:s,isDisabled:f,key:e.getOptionValue(t),removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault(),e.stopPropagation()}},data:t}),e.formatOptionLabel(t,"value"))});if(m)return null;var y=E[0];return i.createElement(s,d({},l,{data:y,isDisabled:f}),this.formatOptionLabel(y,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.components.ClearIndicator,t=this.commonProps,n=this.props,u=n.isDisabled,o=n.isLoading,r=this.state.isFocused;if(!this.isClearable()||!e||u||!this.hasValue()||o)return null;var s={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return i.createElement(e,d({},t,{innerProps:s,isFocused:r}))}},{key:"renderLoadingIndicator",value:function(){var e=this.components.LoadingIndicator,t=this.commonProps,n=this.props,u=n.isDisabled,o=n.isLoading,r=this.state.isFocused;if(!e||!o)return null;return i.createElement(e,d({},t,{innerProps:{"aria-hidden":"true"},isDisabled:u,isFocused:r}))}},{key:"renderIndicatorSeparator",value:function(){var e=this.components,t=e.DropdownIndicator,n=e.IndicatorSeparator;if(!t||!n)return null;var u=this.commonProps,o=this.props.isDisabled,r=this.state.isFocused;return i.createElement(n,d({},u,{isDisabled:o,isFocused:r}))}},{key:"renderDropdownIndicator",value:function(){var e=this.components.DropdownIndicator;if(!e)return null;var t=this.commonProps,n=this.props.isDisabled,u=this.state.isFocused,o={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return i.createElement(e,d({},t,{innerProps:o,isDisabled:n,isFocused:u}))}},{key:"renderMenu",value:function(){var e=this,t=this.components,n=t.Group,u=t.GroupHeading,o=t.Menu,r=t.MenuList,s=t.MenuPortal,a=t.LoadingMessage,l=t.NoOptionsMessage,c=t.Option,p=this.commonProps,f=this.state,m=f.focusedOption,v=f.menuOptions,g=this.props,E=g.captureMenuScroll,b=g.inputValue,y=g.isLoading,O=g.loadingMessage,C=g.minMenuHeight,F=g.maxMenuHeight,A=g.menuIsOpen,D=g.menuPlacement,S=g.menuPosition,x=g.menuPortalTarget,w=g.menuShouldBlockScroll,M=g.menuShouldScrollIntoView,I=g.noOptionsMessage,V=g.onMenuScrollToTop,P=g.onMenuScrollToBottom;if(!A)return null;var k=function(t){var n=m===t.data;return t.innerProps.innerRef=n?e.getFocusedOptionRef:void 0,i.createElement(c,d({},p,t,{isFocused:n}),e.formatOptionLabel(t.data,"menu"))},L=void 0;if(this.hasOptions())L=v.render.map(function(t){if("group"===t.type){t.type;var o=h(t,["type"]),r=t.key+"-heading";return i.createElement(n,d({},p,o,{Heading:u,headingProps:{id:r},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return k(e)}))}if("option"===t.type)return k(t)});else if(y){var T=O({inputValue:b});if(null===T)return null;L=i.createElement(a,p,T)}else{var H=I({inputValue:b});if(null===H)return null;L=i.createElement(l,p,H)}var N=i.createElement("div",null,i.createElement(o,d({},p,{innerProps:{onMouseDown:this.onMenuMouseDown,onMouseMove:this.onMenuMouseMove},isLoading:y,minMenuHeight:C,maxMenuHeight:F,menuPlacement:D,menuPosition:S,menuShouldScrollIntoView:M}),i.createElement(R,{isEnabled:E,onTopArrive:V,onBottomArrive:P},i.createElement(B,{isEnabled:w},i.createElement(r,d({},p,{innerProps:{innerRef:this.getMenuListRef},isLoading:y,maxHeight:F}),L)))));return x||"fixed"===S?i.createElement(s,d({},p,{appendTo:x,controlElement:this.controlRef,menuPlacement:D,menuPosition:S}),N):N}},{key:"renderFormField",value:function(){var e=this,t=this.props,n=t.delimiter,u=t.isDisabled,o=t.isMulti,r=t.name,s=this.state.selectValue;if(r&&!u){if(o){if(n){var a=s.map(function(t){return e.getOptionValue(t)}).join(n);return i.createElement("input",{name:r,type:"hidden",value:a})}return i.createElement("div",null,s.map(function(t,n){return i.createElement("input",{key:"i-"+n,name:r,type:"hidden",value:e.getOptionValue(t)})}))}var l=s[0]?this.getOptionValue(s[0]):"";return i.createElement("input",{name:r,type:"hidden",value:l})}}},{key:"renderLiveRegion",value:function(){return this.state.isFocused?i.createElement(L,{"aria-live":"assertive"},i.createElement("p",{id:"aria-selection-event"}," ",this.state.ariaLiveSelection),i.createElement("p",{id:"aria-context"}," ",this.constructAriaLiveMessage())):null}},{key:"render",value:function(){var e=this.components,t=e.Control,n=e.IndicatorsContainer,u=e.SelectContainer,o=e.ValueContainer,r=this.props,s=r.className,a=r.id,l=r.isDisabled,c=this.state.isFocused,p=this.commonProps=this.getCommonProps();return i.createElement(u,d({},p,{className:s,innerProps:{id:a,onKeyDown:this.onKeyDown},isDisabled:l,isFocused:c}),this.renderLiveRegion(),i.createElement(t,d({},p,{innerProps:{innerRef:this.getControlRef,onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:l,isFocused:c}),i.createElement(o,d({},p,{isDisabled:l}),this.renderPlaceholderOrValue(),this.renderInput()),i.createElement(n,d({},p,{isDisabled:l}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}]),t}(t.Component);Je.defaultProps=Xe;var Ze=function(){var e=this;this.state={ariaLiveSelection:"",ariaLiveContext:"",focusedOption:null,focusedValue:null,inputIsHidden:!1,isFocused:!1,menuOptions:{render:[],focusable:[]},selectValue:[]},this.blockOptionHover=!1,this.clearFocusValueOnUpdate=!1,this.hasGroups=!1,this.initialTouchX=0,this.initialTouchY=0,this.instancePrefix="",this.openAfterFocus=!1,this.scrollToFocusedOptionOnUpdate=!1,this.controlRef=null,this.getControlRef=function(t){e.controlRef=t},this.focusedOptionRef=null,this.getFocusedOptionRef=function(t){e.focusedOptionRef=t},this.menuListRef=null,this.getMenuListRef=function(t){e.menuListRef=t},this.inputRef=null,this.getInputRef=function(t){e.inputRef=t},this.focus=this.focusInput,this.blur=this.blurInput,this.setValue=function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"set-value",u=arguments[2],o=e.props,i=o.closeMenuOnSelect,r=o.isMulti,s=o.onChange;e.onInputChange("",{action:"set-value"}),i&&(e.inputIsHiddenAfterUpdate=!r,e.onMenuClose()),e.clearFocusValueOnUpdate=!0,s(t,{action:n,option:u})},this.selectOption=function(t){var n=e.props,u=n.blurInputOnSelect;if(n.isMulti){var o=e.state.selectValue;if(e.isOptionSelected(t,o)){var i=e.getOptionValue(t);e.setValue(o.filter(function(t){return e.getOptionValue(t)!==i}),"deselect-option",t),e.announceAriaLiveSelection({event:"deselect-option",context:{value:e.getOptionLabel(t)}})}else e.setValue([].concat(g(o),[t]),"select-option",t),e.announceAriaLiveSelection({event:"select-option",context:{value:e.getOptionLabel(t)}})}else e.setValue(t,"select-option"),e.announceAriaLiveSelection({event:"select-option",context:{value:e.getOptionLabel(t)}});u&&e.blurInput()},this.removeValue=function(t){var n=e.props.onChange,u=e.state.selectValue,o=e.getOptionValue(t);n(u.filter(function(t){return e.getOptionValue(t)!==o}),{action:"remove-value",removedValue:t}),e.announceAriaLiveSelection({event:"remove-value",context:{value:t?e.getOptionLabel(t):void 0}}),e.focusInput()},this.clearValue=function(){var t=e.props,n=t.isMulti;(0,t.onChange)(n?[]:null,{action:"clear"})},this.popValue=function(){var t=e.props.onChange,n=e.state.selectValue,u=n[n.length-1];e.announceAriaLiveSelection({event:"pop-value",context:{value:u?e.getOptionLabel(u):void 0}}),t(n.slice(0,n.length-1),{action:"pop-value",removedValue:u})},this.getOptionLabel=function(t){return e.props.getOptionLabel(t)},this.getOptionValue=function(t){return e.props.getOptionValue(t)},this.getStyles=function(t,n){var u=qe[t](n);u.boxSizing="border-box";var o=e.props.styles[t];return o?o(u,n):u},this.getElementId=function(t){return e.instancePrefix+"-"+t},this.getActiveDescendentId=function(){var t=e.props.menuIsOpen,n=e.state,u=n.menuOptions,o=n.focusedOption;if(o&&t){var i=u.focusable.indexOf(o),r=u.render[i];return r&&r.key}},this.announceAriaLiveSelection=function(t){var n=t.event,u=t.context;e.setState({ariaLiveSelection:function(e,t){var n=t.value;if(n)switch(e){case"deselect-option":case"pop-value":case"remove-value":return"option "+n+", deselected.";case"select-option":return"option "+n+", selected."}}(n,u)})},this.announceAriaLiveContext=function(t){var n=t.event,u=t.context;e.setState({ariaLiveContext:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.isSearchable,u=t.isMulti,o=t.label;switch(e){case"menu":return"Use Up and Down to choose options, press Backspace to select the currently focused option, press Escape to exit the menu, press Tab to select the option and exit the menu.";case"input":return(o||"Select")+" is focused "+(n?",type to refine list":"")+", press Down to open the menu, "+(u?" press left to focus selected values":"");case"value":return"Use left and right to toggle between focused values, press Enter to remove the currently focused value"}}(n,d({},u,{label:e.props["aria-label"]}))})},this.onMenuMouseDown=function(t){0===t.button&&(t.stopPropagation(),t.preventDefault(),e.focusInput())},this.onMenuMouseMove=function(t){e.blockOptionHover=!1},this.onControlMouseDown=function(t){var n=e.props.openMenuOnClick;e.state.isFocused?e.props.menuIsOpen?e.onMenuClose():e.openMenu("first"):(n&&(e.openAfterFocus=!0),e.focusInput()),"INPUT"!==t.target.tagName&&t.preventDefault()},this.onDropdownIndicatorMouseDown=function(t){if(!(t&&"mousedown"===t.type&&0!==t.button||e.props.isDisabled)){var n=e.props,u=n.isMulti,o=n.menuIsOpen;e.focusInput(),o?(e.inputIsHiddenAfterUpdate=!u,e.onMenuClose()):e.openMenu("first"),t.preventDefault(),t.stopPropagation()}},this.onClearIndicatorMouseDown=function(t){t&&"mousedown"===t.type&&0!==t.button||(e.clearValue(),t.stopPropagation(),e.openAfterFocus=!1,setTimeout(function(){return e.focusInput()}))},this.onTouchStart=function(t){var n=v(t.touches,1)[0];e.initialTouchX=n.clientX,e.initialTouchY=n.clientY,e.userIsDragging=!1},this.onTouchMove=function(t){var n=v(t.touches,1)[0],u=Math.abs(n.clientX-e.initialTouchX),o=Math.abs(n.clientY-e.initialTouchY);e.userIsDragging=u>5||o>5},this.onTouchEnd=function(t){if(!e.userIsDragging){var n=t.target;e.controlRef&&!e.controlRef.contains(n)&&e.menuListRef&&!e.menuListRef.contains(n)&&e.blurInput(),e.initialTouchX=0,e.initialTouchY=0}},this.onControlTouchEnd=function(t){e.userIsDragging||e.onControlMouseDown(t)},this.onClearIndicatorTouchEnd=function(t){e.userIsDragging||e.onClearIndicatorMouseDown(t)},this.onDropdownIndicatorTouchEnd=function(t){e.userIsDragging||e.onDropdownIndicatorMouseDown(t)},this.handleInputChange=function(t){var n=t.currentTarget.value;e.inputIsHiddenAfterUpdate=!1,e.onInputChange(n,{action:"input-change"}),e.onMenuOpen()},this.onInputFocus=function(t){var n=e.props,u=n.isSearchable,o=n.isMulti;e.props.onFocus&&e.props.onFocus(t),e.inputIsHiddenAfterUpdate=!1,e.announceAriaLiveContext({event:"input",context:{isSearchable:u,isMulti:o}}),e.setState({isFocused:!0}),(e.openAfterFocus||e.props.openMenuOnFocus)&&e.openMenu("first"),e.openAfterFocus=!1},this.onInputBlur=function(t){e.props.onBlur&&e.props.onBlur(t),e.onInputChange("",{action:"input-blur"}),e.onMenuClose(),e.setState({focusedValue:null,isFocused:!1})},this.onOptionHover=function(t){e.blockOptionHover||e.state.focusedOption===t||e.setState({focusedOption:t})},this.shouldHideSelectedOptions=function(){var t=e.props,n=t.hideSelectedOptions,u=t.isMulti;return void 0===n?u:n},this.onKeyDown=function(t){var n=e.props,u=n.isMulti,o=n.backspaceRemovesValue,i=n.escapeClearsValue,r=n.inputValue,s=n.isClearable,a=n.isDisabled,l=n.menuIsOpen,c=n.onKeyDown,p=n.tabSelectsValue,d=n.openMenuOnFocus,f=e.state,h=f.focusedOption,m=f.focusedValue,v=f.selectValue;if(!(a||"function"==typeof c&&(c(t),t.defaultPrevented))){switch(e.blockOptionHover=!0,t.key){case"ArrowLeft":if(!u||r)return;e.focusValue("previous");break;case"ArrowRight":if(!u||r)return;e.focusValue("next");break;case"Backspace":if(r)return;if(m)e.removeValue(m);else{if(!o)return;e.popValue()}break;case"Tab":if(t.shiftKey||!l||!p||!h||d&&e.isOptionSelected(h,v))return;e.selectOption(h);break;case"Enter":if(l){if(!h)return;e.selectOption(h)}else e.focusOption("first");break;case"Escape":l?(e.inputIsHiddenAfterUpdate=!1,e.onInputChange("",{action:"menu-close"}),e.onMenuClose()):s&&i&&e.clearValue();break;case" ":if(r)return;if(!l){e.openMenu("first");break}if(!h)return;e.selectOption(h);break;case"ArrowUp":l?e.focusOption("up"):e.openMenu("last");break;case"ArrowDown":l?e.focusOption("down"):e.openMenu("first");break;case"PageUp":if(!l)return;e.focusOption("pageup");break;case"PageDown":if(!l)return;e.focusOption("pagedown");break;case"Home":if(!l)return;e.focusOption("first");break;case"End":if(!l)return;e.focusOption("last");break;default:return}t.preventDefault()}}},Qe=function(e){var n,u;return u=n=function(t){function n(){var e,t,u;l(this,n);for(var o=arguments.length,i=Array(o),r=0;r<o;r++)i[r]=arguments[r];return t=u=m(this,(e=n.__proto__||Object.getPrototypeOf(n)).call.apply(e,[this].concat(i))),u.state={inputValue:void 0!==u.props.inputValue?u.props.inputValue:u.props.defaultInputValue,menuIsOpen:void 0!==u.props.menuIsOpen?u.props.menuIsOpen:u.props.defaultMenuIsOpen,value:void 0!==u.props.value?u.props.value:u.props.defaultValue},u.onChange=function(e,t){u.callProp("onChange",e,t),u.setState({value:e})},u.onInputChange=function(e,t){var n=u.callProp("onInputChange",e,t);u.setState({inputValue:void 0!==n?n:e})},u.onMenuOpen=function(){u.callProp("onMenuOpen"),u.setState({menuIsOpen:!0})},u.onMenuClose=function(){u.callProp("onMenuClose"),u.setState({menuIsOpen:!1})},m(u,t)}return f(n,t),c(n,[{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"getProp",value:function(e){return void 0!==this.props[e]?this.props[e]:this.state[e]}},{key:"callProp",value:function(e){if("function"==typeof this.props[e]){for(var t,n=arguments.length,u=Array(n>1?n-1:0),o=1;o<n;o++)u[o-1]=arguments[o];return(t=this.props)[e].apply(t,g(u))}}},{key:"render",value:function(){var t=this;return i.createElement(e,d({},this.props,{ref:function(e){t.select=e},inputValue:this.getProp("inputValue"),menuIsOpen:this.getProp("menuIsOpen"),onChange:this.onChange,onInputChange:this.onInputChange,onMenuClose:this.onMenuClose,onMenuOpen:this.onMenuOpen,value:this.getProp("value")}))}}]),n}(t.Component),n.defaultProps={defaultInputValue:"",defaultMenuIsOpen:!1,defaultValue:null},u},$e={cacheOptions:!1,defaultOptions:!1},et=function(e){var n,u;return u=n=function(t){function n(e){l(this,n);var t=m(this,(n.__proto__||Object.getPrototypeOf(n)).call(this));return t.mounted=!1,t.optionsCache={},t.handleInputChange=function(e,n){var u=t.props,o=u.cacheOptions,i=function(e,t,n){if(n){var u=n(e,t);if("string"==typeof u)return u}return e}(e,n,u.onInputChange);if(!i)return delete t.lastRequest,void t.setState({inputValue:"",loadedInputValue:"",loadedOptions:[],isLoading:!1,passEmptyOptions:!1});if(o&&t.optionsCache[i])t.setState({inputValue:i,loadedInputValue:i,loadedOptions:t.optionsCache[i],isLoading:!1,passEmptyOptions:!1});else{var r=t.lastRequest={};t.setState({inputValue:i,isLoading:!0,passEmptyOptions:!t.state.loadedInputValue},function(){t.loadOptions(i,function(e){t.mounted&&(e&&(t.optionsCache[i]=e),r===t.lastRequest&&(delete t.lastRequest,t.setState({isLoading:!1,loadedInputValue:i,loadedOptions:e||[],passEmptyOptions:!1})))})})}return i},t.state={defaultOptions:Array.isArray(e.defaultOptions)?e.defaultOptions:void 0,inputValue:"",isLoading:!0===e.defaultOptions,loadedOptions:[],passEmptyOptions:!1},t}return f(n,t),c(n,[{key:"componentDidMount",value:function(){var e=this;this.mounted=!0,!0===this.props.defaultOptions&&this.loadOptions("",function(t){if(e.mounted){var n=!!e.lastRequest;e.setState({defaultOptions:t||[],isLoading:n})}})}},{key:"componentWillReceiveProps",value:function(e){e.cacheOptions!==this.props.cacheOptions&&(this.optionsCache={})}},{key:"componentWillUnmount",value:function(){this.mounted=!1}},{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"loadOptions",value:function(e,t){var n=this.props.loadOptions;if(!n)return t();var u=n(e,t);u&&"function"==typeof u.then&&u.then(t,function(){return t()})}},{key:"render",value:function(){var t=this,n=this.props,u=(n.loadOptions,h(n,["loadOptions"])),o=this.state,r=o.defaultOptions,s=o.inputValue,a=o.isLoading,l=o.loadedInputValue,c=o.loadedOptions,p=o.passEmptyOptions?[]:s&&l?c:r||[];return i.createElement(e,d({},u,{ref:function(e){t.select=e},options:p,filterOption:null,isLoading:a,onInputChange:this.handleInputChange}))}}]),n}(t.Component),n.defaultProps=$e,u},tt=et(Qe(Je)),nt=function(e,t){var n=e.toLowerCase();return t.value.toLowerCase()===n||t.label.toLowerCase()===n},ut=d({allowCreateWhileLoading:!1,createOptionPosition:"last"},{formatCreateLabel:function(e){return'Create "'+e+'"'},isValidNewOption:function(e,t,n){return!(!e||t.some(function(t){return nt(e,t)})||n.some(function(t){return nt(e,t)}))},getNewOptionData:function(e,t){return{label:t,value:e,__isNew__:!0}}}),ot=function(e){var n,u;return u=n=function(t){function n(e){l(this,n);var t=m(this,(n.__proto__||Object.getPrototypeOf(n)).call(this,e));t.onChange=function(e,n){var u=t.props,o=u.getNewOptionData,i=u.inputValue,r=u.isMulti,s=u.onChange,a=u.onCreateOption,l=u.value;if("select-option"!==n.action)return s(e,n);var c=t.state.newOption,p=Array.isArray(e)?e:[e];if(p[p.length-1]!==c)s(e,n);else if(a)a(i);else{var d=o(i,i),f={action:"create-option"};s(r?[].concat(g($(l)),[d]):d,f)}};var u=e.options||[];return t.state={newOption:void 0,options:u},t}return f(n,t),c(n,[{key:"componentWillReceiveProps",value:function(e){var t=e.allowCreateWhileLoading,n=e.createOptionPosition,u=e.formatCreateLabel,o=e.getNewOptionData,i=e.inputValue,r=e.isLoading,s=e.isValidNewOption,a=e.value,l=e.options||[],c=this.state.newOption;c=s(i,$(a),l)?o(i,u(i)):void 0,this.setState({newOption:c,options:!t&&r||!c?l:"first"===n?[c].concat(g(l)):[].concat(g(l),[c])})}},{key:"focus",value:function(){this.select.focus()}},{key:"blur",value:function(){this.select.blur()}},{key:"render",value:function(){var t=this,n=h(this.props,[]),u=this.state.options;return i.createElement(e,d({},n,{ref:function(e){t.select=e},options:u,onChange:this.onChange}))}}]),n}(t.Component),n.defaultProps=ut,u},it=Qe(ot(Je)),rt=et(Qe(ot(Je))),st=Qe(Je);return st.Async=tt,st.AsyncCreatable=rt,st.Creatable=it,st.SelectBase=Je,st.createFilter=y,st.components=Ye,st.mergeStyles=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=d({},e);return Object.keys(t).forEach(function(u){e[u]?n[u]=function(n,o){return t[u](e[u](n,o),o)}:n[u]=t[u]}),n},st});
  